services

package
v0.0.0-...-99e730b Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobStatusPending   = "pending"
	JobStatusRunning   = "running"
	JobStatusCompleted = "completed"
	JobStatusFailed    = "failed"
	JobStatusCancelled = "cancelled"
)

JobStatus constants

View Source
const (
	JobTypeGenerateEmbeddings   = "generate_embeddings"
	JobTypeRegenerateEmbeddings = "regenerate_embeddings"
)

JobType constants

View Source
const (
	CollectionHubInstances      = "Integration_Hub_Instances"
	CollectionHubProtocolGroups = "Integration_Hub_Protocol_Groups"
	CollectionHubEndpoints      = "Integration_Hub_Endpoints"
	CollectionHubRoutes         = "Integration_Hub_Routes"
)

Collection names for hierarchical hub

View Source
const (
	CollectionPlantModels      = "Plant_Models"
	CollectionPlantModelAssets = "Plant_Model_Assets"
)
View Source
const (
	Collection3DModelAssets = "3D_Model_Assets"
)
View Source
const (
	Collection3DModels = "3D_Models"
)
View Source
const (
	CollectionDataSets = "DataSets"
)
View Source
const (
	CollectionDocuments = "Documents"
)
View Source
const CollectionIntegrationHub = "Integration_Hub"
View Source
const (
	CollectionWorkInstructions = "Work_Instructions"
)

Variables

View Source
var SkillsBaseDir = "./skills"

SkillsBaseDir is the root directory for installed skills. Override at startup (e.g. from config) before any install call.

Functions

func BooleanLiteral

func BooleanLiteral(dialect string, value bool) string

BooleanLiteral returns the appropriate boolean literal for the dialect

func CallToolDirect

func CallToolDirect(ctx context.Context, serverURL, mcpPath, toolName string, headers map[string]string, argsJSON string) (string, error)

CallToolDirect invokes a tool on an arbitrary MCP server without a catalog entry.

func CloseVectorDB

func CloseVectorDB() error

CloseVectorDB closes the vector database connection (if it's separate from main DB)

func CoalesceExpr

func CoalesceExpr(column string, defaultValue string) string

CoalesceExpr returns the appropriate COALESCE expression

func CurrentTimestampExpr

func CurrentTimestampExpr(dialect string) string

CurrentTimestampExpr returns the appropriate current timestamp expression for the dialect

func Example1_BasicInitialization

func Example1_BasicInitialization()

Example1_BasicInitialization shows basic service initialization

func Example2_CustomDatabaseQuery

func Example2_CustomDatabaseQuery(serviceFactory *ServiceFactory)

Example2_CustomDatabaseQuery shows how to execute custom queries against user databases

func Example3_DialectAwareQueries

func Example3_DialectAwareQueries(serviceFactory *ServiceFactory)

Example3_DialectAwareQueries shows how to use dialect helper functions

func Example4_SchemaDiscovery

func Example4_SchemaDiscovery(serviceFactory *ServiceFactory)

Example4_SchemaDiscovery shows comprehensive schema discovery

func Example5_ServiceWithCustomLogic

func Example5_ServiceWithCustomLogic(serviceFactory *ServiceFactory)

Example5_ServiceWithCustomLogic shows how to create a custom service using DatabaseHelper

func Example6_TransactionSupport

func Example6_TransactionSupport(serviceFactory *ServiceFactory)

Example6_TransactionSupport shows how to use transactions with multi-database support

func Example7_HealthChecksAndMonitoring

func Example7_HealthChecksAndMonitoring(serviceFactory *ServiceFactory)

Example7_HealthChecksAndMonitoring shows how to monitor database health

func GetColumnsQuery

func GetColumnsQuery(dialect string, schemaName string, tableName string) string

GetColumnsQuery returns the appropriate query to discover columns for each database type

func GetDatabaseListQuery

func GetDatabaseListQuery(dialect string) string

GetDatabaseListQuery returns the appropriate query to list all databases/schemas

func GetDefaultEnabledHubs

func GetDefaultEnabledHubs() ([]*models.IntegrationHub, error)

GetDefaultEnabledHubs retrieves all default enabled hub configurations (package-level function)

func GetDefaultHub

func GetDefaultHub(name string) (*models.IntegrationHub, error)

GetDefaultHub retrieves the default hub configuration for a name (package-level function)

func GetHub

func GetHub(hubID string) (*models.IntegrationHub, error)

GetHub retrieves a hub configuration by ID (package-level function)

func GetIndexesQuery

func GetIndexesQuery(dialect string, schemaName string, tableName string) string

GetIndexesQuery returns the appropriate query to discover indexes for each database type

func GetTablesQuery

func GetTablesQuery(dialect string, schemaName string) string

GetTablesQuery returns the appropriate query to discover tables for each database type

func GetVectorDB

func GetVectorDB(mainDB *gorm.DB) (*gorm.DB, error)

GetVectorDB returns the vector database connection based on aiconfig.json If use_main_db is true, it returns the main database connection Otherwise, it establishes a separate connection to the vector database

func GetVectorDBSchema

func GetVectorDBSchema() string

GetVectorDBSchema returns the schema name for vector database operations

func GetVectorDBTablePrefix

func GetVectorDBTablePrefix() string

GetVectorDBTablePrefix returns the table prefix for vector database tables

func InitializeVectorDatabase

func InitializeVectorDatabase(db *gorm.DB) error

InitializeVectorDatabase initializes the vector database tables if configured

func JSONExtractExpr

func JSONExtractExpr(dialect string, column string, path string) string

JSONExtractExpr returns the appropriate JSON extract expression

func LikeOperator

func LikeOperator(dialect string, caseSensitive bool) string

LikeOperator returns the appropriate LIKE operator for the dialect

func LimitOffsetClause

func LimitOffsetClause(dialect string, limit, offset int) string

LimitOffsetClause returns the appropriate pagination clause for the dialect

func NormalizeDataType

func NormalizeDataType(dialect string, dataType string) string

NormalizeDataType normalizes database-specific data types to common types

func ReadSkillContext

func ReadSkillContext(skillInstallPath string) string

ReadSkillContext reads the SKILL.md body for the named skill from its install path. Returns empty string if skill is not installed or SKILL.md is missing.

func SetGlobalAgentChannelService

func SetGlobalAgentChannelService(s *AgentChannelService)

func SetGlobalAgentChatService

func SetGlobalAgentChatService(s *AgentChatService)

func SetGlobalAgentDefinitionService

func SetGlobalAgentDefinitionService(s *AgentDefinitionService)

func SetGlobalAgentGatewayService

func SetGlobalAgentGatewayService(s *AgentGatewayService)

func SetGlobalAgentMemoryService

func SetGlobalAgentMemoryService(s *AgentMemoryService)

func SetGlobalAgentMonitorService

func SetGlobalAgentMonitorService(s *AgentMonitorService)

func SetGlobalAgentRunnerService

func SetGlobalAgentRunnerService(s *AgentRunnerService)

func SetGlobalAgentSandboxManager

func SetGlobalAgentSandboxManager(m *AgentSandboxManager)

func SetGlobalMCPServerService

func SetGlobalMCPServerService(s *MCPServerService)

func SetGlobalToolRegistry

func SetGlobalToolRegistry(s *AgentToolRegistryService)

func StringConcatExpr

func StringConcatExpr(dialect string, parts ...string) string

StringConcatExpr returns the appropriate string concatenation expression

func WithAgentNotifConfig

func WithAgentNotifConfig(ctx context.Context, cfg map[string]string) context.Context

WithAgentNotifConfig returns a child context that carries the agent's notification_config JSONB map. The runner injects this before the tool loop so that notification tools can resolve per-agent credentials without requiring the LLM to supply them explicitly.

Types

type AIAgencyRequest

type AIAgencyRequest struct {
	SessionID           string                   `json:"session_id"`
	UserID              string                   `json:"user_id"`
	Question            string                   `json:"question"`
	EditorType          string                   `json:"editor_type"`
	DatabaseAlias       string                   `json:"database_alias,omitempty"`
	EntityID            string                   `json:"entity_id,omitempty"`
	EntityContext       map[string]interface{}   `json:"entity_context,omitempty"`
	PageContext         map[string]interface{}   `json:"page_context,omitempty"`
	ConversationHistory []map[string]interface{} `json:"conversation_history,omitempty"`
	Options             map[string]interface{}   `json:"options,omitempty"`
}

AIAgencyRequest represents a request to the AI agency

type AIAgencyResponse

type AIAgencyResponse struct {
	SessionID      string                  `json:"session_id"`
	Answer         string                  `json:"answer"`
	ResponseType   string                  `json:"response_type"`       // "answer", "question", "code_generation", "clarification"
	IntentType     string                  `json:"intent_type"`         // "general", "bpm_generation", "query_generation", etc.
	Data           map[string]interface{}  `json:"data,omitempty"`      // Generated code, SQL, etc.
	Questions      []ClarificationQuestion `json:"questions,omitempty"` // Follow-up questions if needed
	Confidence     float64                 `json:"confidence"`
	RequiresAction bool                    `json:"requires_action"` // If user needs to approve/provide more info
	NextStep       string                  `json:"next_step,omitempty"`
	Metadata       map[string]interface{}  `json:"metadata,omitempty"`
}

AIAgencyResponse represents a response from the AI agency

type AIAgencyService

type AIAgencyService struct {
	DB                     *gorm.DB
	OpenAIKey              string
	OpenAIModel            string
	ChatService            *ChatService
	AIReportService        *AIReportService
	SchemaMetadataService  *SchemaMetadataService
	SchemaEmbeddingService *SchemaEmbeddingService
	// contains filtered or unexported fields
}

AIAgencyService provides unified AI assistant functionality across all editors It acts as an AI agency that can route questions to specialized handlers

func NewAIAgencyService

func NewAIAgencyService(
	db *gorm.DB,
	openAIKey, openAIModel string,
	chatService *ChatService,
	aiReportService *AIReportService,
	schemaService *SchemaMetadataService,
	embeddingService *SchemaEmbeddingService,
) *AIAgencyService

NewAIAgencyService creates a new AI agency service

func (*AIAgencyService) HandleRequest

func (s *AIAgencyService) HandleRequest(ctx context.Context, request *AIAgencyRequest) (*AIAgencyResponse, error)

HandleRequest is the main entry point for AI agency requests

type AIColumnInfo

type AIColumnInfo struct {
	ColumnName  string  `json:"column_name"`
	DataType    string  `json:"data_type"`
	Description string  `json:"description"`
	Similarity  float64 `json:"similarity,omitempty"`
}

AIColumnInfo contains column information for AI context

type AIEmbeddingService

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

func NewAIEmbeddingService

func NewAIEmbeddingService(db *gorm.DB) *AIEmbeddingService

NewAIEmbeddingService creates a new AI embedding service

func (*AIEmbeddingService) CreateBusinessEntity

func (s *AIEmbeddingService) CreateBusinessEntity(ctx context.Context, req models.BusinessEntityRequest, embeddingFunc func(string) ([]float32, error), iLog *logger.Log) (*models.AIBusinessEntity, error)

CreateBusinessEntity creates a new business entity with embedding

func (*AIEmbeddingService) CreateQueryTemplate

func (s *AIEmbeddingService) CreateQueryTemplate(ctx context.Context, req models.QueryTemplateRequest, embeddingFunc func(string) ([]float32, error), iLog *logger.Log) (*models.AIQueryTemplate, error)

CreateQueryTemplate creates a new query template with embedding

func (*AIEmbeddingService) DeleteBusinessEntity

func (s *AIEmbeddingService) DeleteBusinessEntity(id int, iLog *logger.Log) error

DeleteBusinessEntity soft deletes a business entity

func (*AIEmbeddingService) DeleteQueryTemplate

func (s *AIEmbeddingService) DeleteQueryTemplate(id int, iLog *logger.Log) error

DeleteQueryTemplate soft deletes a query template

func (*AIEmbeddingService) GenerateSchemaEmbeddings

func (s *AIEmbeddingService) GenerateSchemaEmbeddings(ctx context.Context, req models.SchemaMetadataRequest, embeddingFunc func(string) ([]float32, error), iLog *logger.Log) error

GenerateSchemaEmbeddings generates vector embeddings for database schema metadata

func (*AIEmbeddingService) GetBusinessEntities

func (s *AIEmbeddingService) GetBusinessEntities(configID int, iLog *logger.Log) ([]models.AIBusinessEntity, error)

GetBusinessEntities retrieves all business entities

func (*AIEmbeddingService) GetDatabaseSchemaMetadata

func (s *AIEmbeddingService) GetDatabaseSchemaMetadata(configID int, databaseAlias string, iLog *logger.Log) ([]models.DatabaseSchemaEmbedding, error)

GetDatabaseSchemaMetadata retrieves schema metadata for a database

func (*AIEmbeddingService) GetDatabasesWithEmbeddings

func (s *AIEmbeddingService) GetDatabasesWithEmbeddings(configID int, iLog *logger.Log) ([]string, error)

GetDatabasesWithEmbeddings retrieves list of databases that have embeddings

func (*AIEmbeddingService) GetEmbeddingConfigStats

func (s *AIEmbeddingService) GetEmbeddingConfigStats(iLog *logger.Log) ([]models.EmbeddingConfigStats, error)

GetEmbeddingConfigStats retrieves embedding configuration statistics

func (*AIEmbeddingService) GetEmbeddingConfigurations

func (s *AIEmbeddingService) GetEmbeddingConfigurations(iLog *logger.Log) ([]models.AIEmbeddingConfiguration, error)

GetEmbeddingConfigurations retrieves all embedding configurations

func (*AIEmbeddingService) GetQueryTemplates

func (s *AIEmbeddingService) GetQueryTemplates(configID int, iLog *logger.Log) ([]models.AIQueryTemplate, error)

GetQueryTemplates retrieves all query templates

func (*AIEmbeddingService) SearchSchema

func (s *AIEmbeddingService) SearchSchema(ctx context.Context, req models.SearchRequest, embeddingFunc func(string) ([]float32, error), iLog *logger.Log) (*models.SearchResponse, error)

SearchSchema performs vector similarity search on schema embeddings

func (*AIEmbeddingService) UpdateBusinessEntity

func (s *AIEmbeddingService) UpdateBusinessEntity(ctx context.Context, id int, req models.BusinessEntityRequest, embeddingFunc func(string) ([]float32, error), iLog *logger.Log) (*models.AIBusinessEntity, error)

UpdateBusinessEntity updates an existing business entity

func (*AIEmbeddingService) UpdateQueryTemplate

func (s *AIEmbeddingService) UpdateQueryTemplate(ctx context.Context, id int, req models.QueryTemplateRequest, embeddingFunc func(string) ([]float32, error), iLog *logger.Log) (*models.AIQueryTemplate, error)

UpdateQueryTemplate updates an existing query template

type AIReportService

type AIReportService struct {
	OpenAIKey   string
	OpenAIModel string
}

AIReportService handles AI-powered report generation

func NewAIReportService

func NewAIReportService(openAIKey, openAIModel string) *AIReportService

NewAIReportService creates a new AI report service

func (*AIReportService) GenerateReport

GenerateReport generates report structure from query results

func (*AIReportService) GenerateSQL

func (s *AIReportService) GenerateSQL(ctx context.Context, request Text2SQLRequest, schemaInfo string) (*Text2SQLResponse, error)

GenerateSQL generates SQL from natural language using AI

type AIScheduleBatchService

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

AIScheduleBatchService handles batch AI schedule operations

func NewAIScheduleBatchService

func NewAIScheduleBatchService(db *sql.DB, docdb *documents.DocDB) *AIScheduleBatchService

NewAIScheduleBatchService creates a new batch service

func (*AIScheduleBatchService) GetBatchJobResult

func (s *AIScheduleBatchService) GetBatchJobResult(ctx context.Context, jobID string) (*BatchJobResultResponse, error)

GetBatchJobResult retrieves the aggregated result of a completed batch job

func (*AIScheduleBatchService) GetBatchJobStatus

func (s *AIScheduleBatchService) GetBatchJobStatus(ctx context.Context, jobID string) (*BatchJobStatusResponse, error)

GetBatchJobStatus retrieves the status of a batch job

func (*AIScheduleBatchService) OptimizeScheduleBatch

OptimizeScheduleBatch creates batch jobs for async optimization

func (*AIScheduleBatchService) ProcessBatch

func (s *AIScheduleBatchService) ProcessBatch(ctx context.Context, payload BatchProcessPayload, user string) error

ProcessBatch processes a single batch (called by job worker)

type AIScheduleService

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

AIScheduleService handles AI-powered production scheduling

func NewAIScheduleService

func NewAIScheduleService() *AIScheduleService

NewAIScheduleService creates a new AI schedule service

func (*AIScheduleService) Chat

Chat provides conversational AI for schedule questions

func (*AIScheduleService) GenerateSchedule

GenerateSchedule generates a production schedule from natural language

func (*AIScheduleService) OptimizeSchedule

OptimizeSchedule optimizes an existing schedule

type AITableInfo

type AITableInfo struct {
	TableName   string         `json:"table_name"`
	SchemaName  string         `json:"schema_name"`
	Description string         `json:"description"`
	Similarity  float64        `json:"similarity,omitempty"`
	Columns     []AIColumnInfo `json:"columns"`
}

AITableInfo contains table and its columns information for AI context

type AgentChannelService

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

AgentChannelService manages agent-channel bindings and routes inbound messages from external messaging platforms (via OpenClaw bridge or native adapters) to IAC agents.

func GetGlobalAgentChannelService

func GetGlobalAgentChannelService() *AgentChannelService

func NewAgentChannelService

func NewAgentChannelService(docDB documents.DocumentDB) *AgentChannelService

NewAgentChannelService creates the service and initialises MongoDB indexes.

func (*AgentChannelService) AuthorizeUser

func (s *AgentChannelService) AuthorizeUser(channelID, channelUserID, channelUsername, iacUserID, iacUsername, authorizedBy string) error

func (*AgentChannelService) Create

func (*AgentChannelService) DeactivateSession

func (s *AgentChannelService) DeactivateSession(channelID, senderID string) error

DeactivateSession marks the MongoDB AgentChannelSession document for a sender as inactive, so the next inbound message creates a fresh conversation. Called by AgentMonitorService.ResetSession.

func (*AgentChannelService) Delete

func (s *AgentChannelService) Delete(id string) error

func (*AgentChannelService) GetAll

func (s *AgentChannelService) GetAll() ([]*models.AgentChannelDoc, error)

func (*AgentChannelService) GetByAgentID

func (s *AgentChannelService) GetByAgentID(agentID string) ([]*models.AgentChannelDoc, error)

func (*AgentChannelService) GetByID

func (*AgentChannelService) HandleInbound

func (s *AgentChannelService) HandleInbound(ctx context.Context, channelID, senderID, senderName, text string) (string, error)

HandleInbound processes a single inbound message from an external channel user.

Full flow:

  1. Load channel config + security policy
  2. (HMAC verification already done in controller before this is called)
  3. Upsert ChannelUserMapping — auto-registers any new sender
  4. If RequireUserAuth && sender not authorized → return polite refusal
  5. Rate-limit check (in-memory per-user hourly window)
  6. Get or create AgentChannelSession → persistent ConversationID for this sender
  7. Inject AgentChannelSecurityPolicy into context (tool allow/block, maxIterations)
  8. Call RunSyncInConversation(convID, agentID, text, ...) — loads full history so agent has complete context of the prior exchange before generating its response
  9. Increment session message count; update last_seen_on
  10. Truncate response to MaxResponseLength if set; return to caller

func (*AgentChannelService) ListMappings

func (s *AgentChannelService) ListMappings(channelID string) ([]*models.ChannelUserMappingDoc, error)

func (*AgentChannelService) ResolveChannelConfig

func (s *AgentChannelService) ResolveChannelConfig(ch *models.AgentChannelDoc) map[string]string

ResolveChannelConfig returns a copy of channel_config with all secrets resolved.

func (*AgentChannelService) RevokeUser

func (s *AgentChannelService) RevokeUser(channelID, channelUserID string) error

func (*AgentChannelService) SetChatService

func (s *AgentChannelService) SetChatService(svc *AgentChatService)

SetChatService injects the AgentChatService (avoids import cycle).

func (*AgentChannelService) SetRunAgentFunc

func (s *AgentChannelService) SetRunAgentFunc(fn func(ctx context.Context, agentID, agentName, prompt string, timeoutSecs int) (string, error))

SetRunAgentFunc injects the stateless agent execution callback (avoids import cycle).

func (*AgentChannelService) SetRunAgentInConvFunc

func (s *AgentChannelService) SetRunAgentInConvFunc(fn func(ctx context.Context, conversationID, agentID, agentName, prompt string, timeoutSecs int) (string, error))

SetRunAgentInConvFunc injects the conversation-aware execution callback. This is what HandleInbound uses so each channel message continues the same conversation thread and the agent sees the full prior message history.

func (*AgentChannelService) Update

type AgentChatService

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

AgentChatService manages conversations between users and agents

func GetGlobalAgentChatService

func GetGlobalAgentChatService() *AgentChatService

func NewAgentChatService

func NewAgentChatService(db *gorm.DB, sqlDB *sql.DB) *AgentChatService

func (*AgentChatService) CreateAgentConversation

func (s *AgentChatService) CreateAgentConversation(agentDefinitionID, userID, title string, createdBy string) (*models.Conversation, error)

CreateAgentConversation creates a new agent conversation linked to an agent definition

func (*AgentChatService) DeleteConversation

func (s *AgentChatService) DeleteConversation(conversationID, deletedBy string) error

DeleteConversation soft-deletes a conversation and its messages

func (*AgentChatService) GetConversation

func (s *AgentChatService) GetConversation(id string) (*models.Conversation, error)

GetConversation retrieves a conversation with messages

func (*AgentChatService) GetMessageHistory

func (s *AgentChatService) GetMessageHistory(conversationID string) ([]models.ChatMessage, error)

GetMessageHistory retrieves conversation messages in chronological order

func (*AgentChatService) ListAgentConversations

func (s *AgentChatService) ListAgentConversations(agentDefinitionID, userID string) ([]models.Conversation, error)

ListAgentConversations returns conversations for a specific agent and user

func (*AgentChatService) SaveAgentMessage

func (s *AgentChatService) SaveAgentMessage(conversationID, text, createdBy string) (*models.ChatMessage, error)

SaveAgentMessage saves an agent (assistant) message to the conversation

func (*AgentChatService) SaveAgentMessageWithTools

func (s *AgentChatService) SaveAgentMessageWithTools(conversationID, text string, toolResults []map[string]interface{}, createdBy string) (*models.ChatMessage, error)

SaveAgentMessageWithTools saves an agent message together with any rich tool results (ui_render, generate_html_report, etc.) produced during the run. toolResults is a slice of {tool, result} maps; stored as {"items":[...]} in the toolresults column.

func (*AgentChatService) SaveUserMessage

func (s *AgentChatService) SaveUserMessage(conversationID, text, createdBy string) (*models.ChatMessage, error)

SaveUserMessage saves a user message to the conversation

type AgentDefinitionService

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

AgentDefinitionService manages agent definitions and their skill/MCP assignments. Agent skills and MCP servers are now stored in MongoDB (CollectionAgentSkills, CollectionAgentDefinitions, CollectionMCPServers); PostgreSQL is used only for schedule queries and legacy schema cleanup.

func GetGlobalAgentDefinitionService

func GetGlobalAgentDefinitionService() *AgentDefinitionService

func NewAgentDefinitionService

func NewAgentDefinitionService(db *gorm.DB, sqlDB *sql.DB, docDB documents.DocumentDB) *AgentDefinitionService

NewAgentDefinitionService creates the service, runs schema cleanup, and initialises MongoDB indexes.

func (*AgentDefinitionService) CreateAgent

CreateAgent creates a new agent in MongoDB with the requested skill/MCP assignments.

func (*AgentDefinitionService) CreateSkill

CreateSkill adds a new skill to the catalog.

func (*AgentDefinitionService) DeleteAgent

func (s *AgentDefinitionService) DeleteAgent(id string, deletedBy string) error

DeleteAgent soft-deletes an agent by setting active=false.

func (*AgentDefinitionService) DeleteSkill

func (s *AgentDefinitionService) DeleteSkill(id string, deletedBy string) error

DeleteSkill soft-deletes a skill from the catalog.

func (*AgentDefinitionService) GetAgent

GetAgent retrieves an agent by ID with Skills and MCPServers hydrated from MongoDB.

func (*AgentDefinitionService) GetSkill

func (s *AgentDefinitionService) GetSkill(id string) (*models.AgentSkill, error)

GetSkill retrieves a single active skill by ID.

func (*AgentDefinitionService) GetSkillByName

func (s *AgentDefinitionService) GetSkillByName(name string) (*models.AgentSkill, error)

GetSkillByName looks up a skill by name (active or not).

func (*AgentDefinitionService) InstallSkillFromURL

func (s *AgentDefinitionService) InstallSkillFromURL(req InstallSkillRequest) (*models.AgentSkill, error)

InstallSkillFromURL downloads a skill package from the given URL, extracts it to SkillsBaseDir/{name}/, registers its tools in the tool registry, and persists the skill record in MongoDB.

Supported URL formats:

  • ZIP / .skill file → extracted into SkillsBaseDir/{name}/
  • Raw skill.json → saved as manifest; script download not attempted

func (*AgentDefinitionService) ListAgents

func (s *AgentDefinitionService) ListAgents() ([]models.AgentDefinition, error)

ListAgents returns all active agents with Skills and MCPServers hydrated.

func (*AgentDefinitionService) ListByRunInstance

func (s *AgentDefinitionService) ListByRunInstance(runInstance string) ([]models.AgentDefinition, error)

ListByRunInstance returns all active, enabled agents with a specific run_instance value.

func (*AgentDefinitionService) ListSkills

func (s *AgentDefinitionService) ListSkills() ([]models.AgentSkill, error)

ListSkills returns all active skills in the catalog ordered by category then name.

func (*AgentDefinitionService) LoadInstalledSkillsFromDisk

func (s *AgentDefinitionService) LoadInstalledSkillsFromDisk()

LoadInstalledSkillsFromDisk scans SkillsBaseDir and re-registers all installed skill tools with the tool registry. Called at startup so tools survive restarts.

func (*AgentDefinitionService) SyncBuiltinUISkills

func (s *AgentDefinitionService) SyncBuiltinUISkills()

SyncBuiltinUISkills ensures the ui_render skill catalog entry exists in MongoDB. The skill's Content field holds the full JSON spec so any agent assigned this skill receives the complete schema in the LLM tool description at run time. Existing entries are not modified.

func (*AgentDefinitionService) SyncBuiltinWebSkills

func (s *AgentDefinitionService) SyncBuiltinWebSkills(registry *AgentToolRegistryService)

SyncBuiltinWebSkills ensures that each registered web/search tool has a corresponding skill catalog entry in MongoDB so agents can assign them. Existing entries are not modified. New entries are created with skill_type="builtin". Called at startup after both the tool registry and definition service are initialised.

func (*AgentDefinitionService) ToggleAgent

func (s *AgentDefinitionService) ToggleAgent(id string, enabled bool, modifiedBy string) error

ToggleAgent enables or disables an agent.

func (*AgentDefinitionService) UninstallSkill

func (s *AgentDefinitionService) UninstallSkill(id string, deletedBy string) error

UninstallSkill removes skill files from disk and soft-deletes the MongoDB record.

func (*AgentDefinitionService) UpdateAgent

func (s *AgentDefinitionService) UpdateAgent(id string, req UpdateAgentRequest, modifiedBy string) (*models.AgentDefinition, error)

UpdateAgent updates mutable fields and optionally replaces skill/MCP assignments.

func (*AgentDefinitionService) UpdateSkill

func (s *AgentDefinitionService) UpdateSkill(id string, req UpdateSkillRequest, modifiedBy string) (*models.AgentSkill, error)

UpdateSkill updates display metadata for a skill.

type AgentGatewayService

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

AgentGatewayService manages agent gateways and their A2A task lifecycle. All data is stored in MongoDB (agent_gateways + gateway_tasks collections).

func GetGlobalAgentGatewayService

func GetGlobalAgentGatewayService() *AgentGatewayService

func NewAgentGatewayService

func NewAgentGatewayService(docDB documents.DocumentDB) *AgentGatewayService

NewAgentGatewayService creates the service and initialises MongoDB indexes.

func (*AgentGatewayService) CancelTask

func (s *AgentGatewayService) CancelTask(ctx context.Context, gatewayID, taskID string) error

CancelTask transitions a task to "canceled" if it is still submitted/working.

func (*AgentGatewayService) Create

Create inserts a new agent gateway document.

func (*AgentGatewayService) CreateTask

func (s *AgentGatewayService) CreateTask(ctx context.Context, gatewayID, input string) (*models.GatewayTaskDoc, error)

CreateTask creates a new gateway task document with status "submitted".

func (*AgentGatewayService) Delete

func (s *AgentGatewayService) Delete(id string) error

Delete soft-deletes a gateway by setting active=false.

func (*AgentGatewayService) ExecuteAsync

func (s *AgentGatewayService) ExecuteAsync(ctx context.Context, gatewayID, input string) (string, error)

ExecuteAsync creates a GatewayTask, starts a goroutine, and returns the taskID immediately.

func (*AgentGatewayService) ExecuteSync

func (s *AgentGatewayService) ExecuteSync(ctx context.Context, gatewayID, input string) (string, error)

ExecuteSync runs the gateway's workflow synchronously and returns the final response.

func (*AgentGatewayService) GetAll

func (s *AgentGatewayService) GetAll() ([]*models.AgentGatewayDoc, error)

GetAll returns all active agent gateways.

func (*AgentGatewayService) GetByID

GetByID returns a single gateway by its ID.

func (*AgentGatewayService) GetTask

func (s *AgentGatewayService) GetTask(ctx context.Context, gatewayID, taskID string) (*models.GatewayTaskDoc, error)

GetTask retrieves a gateway task by gatewayID + taskID.

func (*AgentGatewayService) SetRunAgentFunc

func (s *AgentGatewayService) SetRunAgentFunc(fn func(ctx context.Context, agentID, agentName, prompt string, timeoutSecs int) (string, error))

SetRunAgentFunc injects the agent execution callback (avoids import cycle). Called from contollershandlers.go after AgentRunnerService is initialized.

func (*AgentGatewayService) Update

Update replaces mutable fields on an existing gateway.

type AgentMemoryService

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

AgentMemoryService manages the 3-layer memory store for agents.

func GetGlobalAgentMemoryService

func GetGlobalAgentMemoryService() *AgentMemoryService

func NewAgentMemoryService

func NewAgentMemoryService(db *gorm.DB, sqlDB *sql.DB) *AgentMemoryService

func (*AgentMemoryService) ArchiveExpiredMemory

func (s *AgentMemoryService) ArchiveExpiredMemory() (int64, error)

ArchiveExpiredMemory archives items whose expires_at is in the past.

func (*AgentMemoryService) ArchiveIntervalMemory

func (s *AgentMemoryService) ArchiveIntervalMemory() (int64, error)

ArchiveIntervalMemory archives interval-retention items whose age exceeds retention_days.

func (*AgentMemoryService) ArchiveMemory

func (s *AgentMemoryService) ArchiveMemory(id, by string) error

ArchiveMemory marks a memory item as archived.

func (*AgentMemoryService) AutoSaveRunMemory

func (s *AgentMemoryService) AutoSaveRunMemory(
	ctx context.Context,
	agentID, runID, convID, taskPrompt, finalText, historyJSON string,
) error

AutoSaveRunMemory persists a completed agent run into the 3-layer memory store. L2 receives the full conversation history, L1 an LLM-generated summary, and L0 an index entry (keywords + reference to the L1 ID). This is intended to be called in a background goroutine — never blocks the run.

func (*AgentMemoryService) CleanMemory

func (s *AgentMemoryService) CleanMemory(agentID string, opts CleanOptions) (int64, error)

CleanMemory bulk-removes or archives memory items for an agent. When opts.ArchivedOnly=true, it hard-deletes archived items. Otherwise it soft-deletes active items matching the priority/layer filters.

func (*AgentMemoryService) CreateMemory

func (s *AgentMemoryService) CreateMemory(agentID string, req CreateMemoryRequest) (*models.AgentMemory, error)

CreateMemory creates a new memory item for an agent.

func (*AgentMemoryService) DeleteMemory

func (s *AgentMemoryService) DeleteMemory(id, by string) error

DeleteMemory soft-deletes a memory item (sets active=false).

func (*AgentMemoryService) FindSimilarMemory

func (s *AgentMemoryService) FindSimilarMemory(agentID, taskPrompt string, threshold float64) ([]SimilarMemoryResult, error)

FindSimilarMemory searches the L0 index for entries similar to taskPrompt. For each L0 match above threshold it also validates the L1 summary similarity. Returns results sorted by score descending; only entries with score >= threshold in both layers are returned.

func (*AgentMemoryService) GetMemory

func (s *AgentMemoryService) GetMemory(id string) (*models.AgentMemory, error)

GetMemory returns a single memory item by ID.

func (*AgentMemoryService) ListMemory

func (s *AgentMemoryService) ListMemory(agentID string, opts ListMemoryOptions) ([]models.AgentMemory, error)

ListMemory returns memory items for an agent with optional filters.

func (*AgentMemoryService) ReadMemoryItem

func (s *AgentMemoryService) ReadMemoryItem(id string) (*models.AgentMemory, error)

ReadMemoryItem returns a memory item and increments its access_count + last_accessed_on.

func (*AgentMemoryService) SaveMemoryItem

func (s *AgentMemoryService) SaveMemoryItem(
	agentID, title, summary, content, layer, priority, retention string,
	retentionDays *int,
) (*models.AgentMemory, error)

SaveMemoryItem creates or upserts a memory item during an agent run.

func (*AgentMemoryService) SearchMemory

func (s *AgentMemoryService) SearchMemory(agentID, query, layer string) ([]models.AgentMemory, error)

SearchMemory performs a title/tag text search against active, non-archived memory. layer="" searches all layers; otherwise restricts to the given layer.

func (*AgentMemoryService) UpdateMemory

func (s *AgentMemoryService) UpdateMemory(id string, req UpdateMemoryRequest, by string) (*models.AgentMemory, error)

UpdateMemory updates mutable fields of a memory item.

type AgentMonitorService

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

AgentMonitorService manages the lifecycle and observability of agent-channel chat sessions.

It acts as a transparent wrapper around the actual agent execution callback: AgentChannelService registers HandleMessage as its runAgentInConv callback, so every channel message flows through the monitor, which records timing, updates session status, and aggregates per-channel statistics.

Additionally, a background goroutine periodically:

  • Evicts stale sessions
  • Scans for agent_definitions with run_instance=channel_monitor and their linked agent_channels, registering them as active channel monitors.

The active monitor registry is authoritative for which agents are "running" as channel handlers. Channels whose linked agent has run_instance=channel_monitor are processed in interactive/conversation mode (RunSyncInConversation).

func GetGlobalAgentMonitorService

func GetGlobalAgentMonitorService() *AgentMonitorService

func NewAgentMonitorService

func NewAgentMonitorService() *AgentMonitorService

NewAgentMonitorService creates a ready-to-use (but not yet started) monitor service. Call Start() after dependency injection to begin the background loop.

func (*AgentMonitorService) GetActiveMonitorInfos

func (s *AgentMonitorService) GetActiveMonitorInfos() []*models.ActiveMonitorInfo

GetActiveMonitorInfos returns the active monitors as public API structs.

func (*AgentMonitorService) GetActiveMonitors

func (s *AgentMonitorService) GetActiveMonitors() []*channelMonitorEntry

GetActiveMonitors returns a snapshot of all currently active channel monitor bindings.

func (*AgentMonitorService) GetActiveSessions

func (s *AgentMonitorService) GetActiveSessions() []*models.MonitorSessionStatus

GetActiveSessions returns a snapshot of all currently tracked sessions.

func (*AgentMonitorService) GetSessionsByChannel

func (s *AgentMonitorService) GetSessionsByChannel(channelID string) []*models.MonitorSessionStatus

GetSessionsByChannel returns sessions for a specific channel.

func (*AgentMonitorService) GetStatus

func (s *AgentMonitorService) GetStatus() *models.MonitorStatus

GetStatus returns the top-level AgentMonitor status summary.

func (*AgentMonitorService) HandleMessage

func (s *AgentMonitorService) HandleMessage(
	ctx context.Context,
	convID, agentID, agentName, text string,
	timeoutSecs int,
) (string, error)

HandleMessage is registered as the runAgentInConv callback on AgentChannelService. It decorates every channel message execution with:

  • Session status tracking (idle → processing → idle/error)
  • Response time measurement
  • Per-channel message statistics

Context keys injected by AgentChannelService.HandleInbound are used to identify which channel and sender triggered this execution.

func (*AgentMonitorService) IsChannelMonitored

func (s *AgentMonitorService) IsChannelMonitored(channelID string) bool

IsChannelMonitored returns true if the given channelID is bound to a running channel_monitor agent. Callers can use this to enforce the run_instance contract.

func (*AgentMonitorService) ResetSession

func (s *AgentMonitorService) ResetSession(channelSvc *AgentChannelService, channelID, senderID string) error

ResetSession ends the tracked session for a given channel user, causing the next message to start a fresh conversation via AgentChannelService. The in-memory session entry is removed; the AgentChannelSession document in MongoDB is deactivated via channelSvc.DeactivateSession.

func (*AgentMonitorService) SetChannelService

func (s *AgentMonitorService) SetChannelService(svc *AgentChannelService)

SetChannelService injects the AgentChannelService so the monitor can query which channels are bound to each channel_monitor agent.

func (*AgentMonitorService) SetDefinitionService

func (s *AgentMonitorService) SetDefinitionService(svc *AgentDefinitionService)

SetDefinitionService injects the AgentDefinitionService so the monitor can scan for channel_monitor agents on startup and during periodic refresh.

func (*AgentMonitorService) SetRunAgentInConvFunc

func (s *AgentMonitorService) SetRunAgentInConvFunc(
	fn func(ctx context.Context, convID, agentID, agentName, prompt string, timeoutSecs int) (string, error),
)

SetRunAgentInConvFunc injects the actual execution callback. Must be called before HandleMessage is used.

func (*AgentMonitorService) Start

func (s *AgentMonitorService) Start()

Start launches the background monitoring goroutine and performs an initial scan of channel_monitor agents.

func (*AgentMonitorService) Stop

func (s *AgentMonitorService) Stop()

Stop signals the background loop to exit gracefully. For a full shutdown including all channel pollers, use StopAll instead.

func (*AgentMonitorService) StopAll

func (s *AgentMonitorService) StopAll(timeout time.Duration)

StopAll performs a graceful full shutdown:

  1. Cancels the context of every active channel poller (triggering their stop messages).
  2. Waits for all pollers to finish, up to the supplied timeout.
  3. Stops the background monitor loop.

Call this from the process-level shutdown handler to ensure stop messages are delivered before os.Exit is called.

type AgentRunRequest

type AgentRunRequest struct {
	AgentDefinitionID string
	AgentScheduleID   string // empty for on-demand runs
	ConversationID    string // existing conversation ID (pre-created by caller)
	TaskPrompt        string
	RequestedBy       string
}

AgentRunRequest is the input to RunAsync / RunFromJob

type AgentRunnerService

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

AgentRunnerService executes agent tasks using a ReAct-style LLM tool-call loop

func GetGlobalAgentRunnerService

func GetGlobalAgentRunnerService() *AgentRunnerService

func NewAgentRunnerService

func NewAgentRunnerService(
	db *gorm.DB,
	sqlDB *sql.DB,
	defService *AgentDefinitionService,
	chatService *AgentChatService,
	toolRegistry *AgentToolRegistryService,
	mcpService *MCPServerService,
	memorySvc *AgentMemoryService,
	sandboxMgr *AgentSandboxManager,
) *AgentRunnerService

func (*AgentRunnerService) AbortRun

func (s *AgentRunnerService) AbortRun(runID string)

AbortRun cancels an in-flight agent run

func (*AgentRunnerService) CreateSchedule

CreateSchedule creates a new agent schedule

func (*AgentRunnerService) DeleteSchedule

func (s *AgentRunnerService) DeleteSchedule(scheduleID, deletedBy string) error

DeleteSchedule soft-deletes a schedule

func (*AgentRunnerService) GetActiveRunsStatus

func (s *AgentRunnerService) GetActiveRunsStatus() map[string]string

GetActiveRunsStatus returns a map of agentDefinitionID -> "running" for all in-flight runs.

func (*AgentRunnerService) ListSchedules

func (s *AgentRunnerService) ListSchedules(agentDefinitionID string) ([]models.AgentSchedule, error)

ListSchedules returns schedules for an agent

func (*AgentRunnerService) RunAsync

func (s *AgentRunnerService) RunAsync(req AgentRunRequest) (string, error)

RunAsync starts an agent run in a goroutine and returns the run ID immediately

func (*AgentRunnerService) RunFromJob

func (s *AgentRunnerService) RunFromJob(ctx context.Context, payload models.AgentJobPayload) error

RunFromJob is the entry point called by the job system handler

func (*AgentRunnerService) RunSync

func (s *AgentRunnerService) RunSync(ctx context.Context, agentID, agentName, prompt string, timeoutSecs int) (string, error)

RunSync executes an agent synchronously and returns the final response text. It is used by the workflow engine (AIAgent node) to trigger a real agent run inline and wait for its result without SignalR coordination.

Resolution order: agentID (exact UUID) → agentName (case-insensitive lookup). timeoutSecs overrides the context deadline when > 0.

func (*AgentRunnerService) RunSyncInConversation

func (s *AgentRunnerService) RunSyncInConversation(ctx context.Context, conversationID, agentID, agentName, prompt string, timeoutSecs int) (string, error)

RunSyncInConversation executes an agent synchronously inside an EXISTING conversation. Unlike RunSync (which always creates a fresh conversation), this method loads the full message history of the supplied conversationID so the agent has complete context of the prior exchange — enabling true multi-turn chat via external channels.

Used by AgentChannelService.HandleInbound so each inbound message continues the same conversation thread that was started when the channel user first made contact.

func (*AgentRunnerService) ToggleSchedule

func (s *AgentRunnerService) ToggleSchedule(scheduleID string, enabled bool, modifiedBy string) error

ToggleSchedule enables or disables a schedule

type AgentSandbox

type AgentSandbox struct {
	RunID     string
	AgentID   string
	StartedAt time.Time
	Inbox     chan SandboxMessage // buffered channel (cap=100)
}

AgentSandbox is the runtime context for a single agent run.

type AgentSandboxManager

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

AgentSandboxManager manages the set of active agent sandboxes.

func GetGlobalAgentSandboxManager

func GetGlobalAgentSandboxManager() *AgentSandboxManager

func NewAgentSandboxManager

func NewAgentSandboxManager() *AgentSandboxManager

func (*AgentSandboxManager) Broadcast

func (m *AgentSandboxManager) Broadcast(topic string, msg SandboxMessage)

Broadcast sends a message to all active sandboxes matching the given topic prefix. Pass topic="" to broadcast to all active sandboxes.

func (*AgentSandboxManager) ListActive

func (m *AgentSandboxManager) ListActive() []SandboxInfo

ListActive returns info on all currently active sandboxes.

func (*AgentSandboxManager) Register

func (m *AgentSandboxManager) Register(runID, agentID string) *AgentSandbox

Register creates a new sandbox for a run and returns it. Must be called before the goroutine starts.

func (*AgentSandboxManager) Send

func (m *AgentSandboxManager) Send(toRunID string, msg SandboxMessage) error

Send delivers a message to the sandbox inbox identified by runID.

func (*AgentSandboxManager) SendToAgent

func (m *AgentSandboxManager) SendToAgent(toAgentID string, msg SandboxMessage) error

SendToAgent delivers a message to the first active sandbox for the given agentID.

func (*AgentSandboxManager) Unregister

func (m *AgentSandboxManager) Unregister(runID string)

Unregister removes the sandbox when the run completes.

type AgentToolRegistryService

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

AgentToolRegistryService manages available tools for agents

func GetGlobalToolRegistry

func GetGlobalToolRegistry() *AgentToolRegistryService

func NewAgentToolRegistryService

func NewAgentToolRegistryService(db *gorm.DB, sqlDB *sql.DB, docDB documents.DocumentDB, openAIKey, openAIModel string) *AgentToolRegistryService

NewAgentToolRegistryService creates and registers all built-in IAC tools. docDB is optional (pass nil when MongoDB is not configured). openAIKey and openAIModel enable AI-powered tools (query_database_nl, generate_bpm, etc.).

func (*AgentToolRegistryService) ExecuteTool

func (s *AgentToolRegistryService) ExecuteTool(ctx context.Context, name string, argsJSON string) (string, error)

ExecuteTool executes the named tool with JSON-decoded args

func (*AgentToolRegistryService) GetToolDefinitions

func (s *AgentToolRegistryService) GetToolDefinitions(enabledTools []string) []ToolDefinition

GetToolDefinitions returns LLM-ready tool definitions for the requested tool names. If enabledTools is empty, all tools are returned.

func (*AgentToolRegistryService) GetToolDefinitionsForSkills

func (s *AgentToolRegistryService) GetToolDefinitionsForSkills(skills []models.AgentSkill) []ToolDefinition

GetToolDefinitionsForSkills returns LLM-ready tool definitions for the given AgentSkill slice. When a skill carries a non-empty Content field (stored in MongoDB), that content is appended to the tool's description so the LLM sees the full schema/instructions from the skill catalog rather than only the hardcoded Go description.

func (*AgentToolRegistryService) RegisterInstalledSkill

func (s *AgentToolRegistryService) RegisterInstalledSkill(manifest *models.SkillManifest, installDir string) error

RegisterInstalledSkill registers all tools from an installed skill manifest into the tool registry so agents can call them via the ReAct loop. Each tool is backed by a subprocess handler that executes the skill's entry point.

func (*AgentToolRegistryService) UnregisterInstalledSkill

func (s *AgentToolRegistryService) UnregisterInstalledSkill(skillName string)

UnregisterInstalledSkill removes all tools registered for a skill name. It searches for tools whose names match registered installed skill tool names by looking for the skill tag prefix.

type AuthConfig

type AuthConfig struct {
	Type        string                 `json:"type"`
	Token       string                 `json:"token"`
	APIKey      string                 `json:"apiKey"`
	Username    string                 `json:"username"`
	Password    string                 `json:"password"`
	OAuth2      map[string]interface{} `json:"oauth2Config"`
	Credentials map[string]string      `json:"credentials"`
}

AuthConfig for authentication/authorization

type BPMGenerationHandler

type BPMGenerationHandler struct {
	OpenAIKey   string
	OpenAIModel string
	// contains filtered or unexported fields
}

BPMGenerationHandler handles BPM flow generation

func (*BPMGenerationHandler) CanHandle

func (h *BPMGenerationHandler) CanHandle(ctx context.Context, intent string, editorType string) bool

func (*BPMGenerationHandler) GetName

func (h *BPMGenerationHandler) GetName() string

func (*BPMGenerationHandler) Handle

type Badge

type Badge struct {
	Label string `json:"label"`
	Color string `json:"color"`
}

Badge represents a task badge

type BatchJobResultResponse

type BatchJobResultResponse struct {
	JobID    string                 `json:"jobId"`
	Status   string                 `json:"status"`
	Tasks    []Task                 `json:"tasks"`
	Changes  []ScheduleChange       `json:"changes"`
	Metadata map[string]interface{} `json:"metadata"`
}

BatchJobResultResponse represents the final aggregated result

type BatchJobStatusResponse

type BatchJobStatusResponse struct {
	JobID            string                          `json:"jobId"`
	Status           models.AIScheduleBatchJobStatus `json:"status"`
	Progress         int                             `json:"progress"`
	TotalBatches     int                             `json:"totalBatches"`
	CompletedBatches int                             `json:"completedBatches"`
	FailedBatches    int                             `json:"failedBatches"`
	TotalTasks       int                             `json:"totalTasks"`
	ProcessedTasks   int                             `json:"processedTasks"`
	StartedAt        *time.Time                      `json:"startedAt,omitempty"`
	CompletedAt      *time.Time                      `json:"completedAt,omitempty"`
	ErrorMessage     string                          `json:"errorMessage,omitempty"`
}

BatchJobStatusResponse represents the status of a batch job

type BatchProcessPayload

type BatchProcessPayload struct {
	BatchJobID   string                 `json:"batchJobId"`
	BatchNumber  int                    `json:"batchNumber"`
	Tasks        []Task                 `json:"tasks"`
	Resources    []Resource             `json:"resources"`
	Objective    string                 `json:"objective"`
	Constraints  map[string]interface{} `json:"constraints,omitempty"`
	SystemPrompt string                 `json:"systemPrompt,omitempty"`
	StartIndex   int                    `json:"startIndex"`
	EndIndex     int                    `json:"endIndex"`
}

BatchProcessPayload represents the payload for batch processing job

type BusinessEntityInfo

type BusinessEntityInfo struct {
	EntityName  string  `json:"entity_name"`
	EntityType  string  `json:"entity_type"`
	Description string  `json:"description"`
	Formula     string  `json:"formula,omitempty"`
	Similarity  float64 `json:"similarity,omitempty"`
}

BusinessEntityInfo contains business entity information

type BusinessEntityService

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

BusinessEntityService handles business entity management

func NewBusinessEntityService

func NewBusinessEntityService(db *gorm.DB) *BusinessEntityService

NewBusinessEntityService creates a new business entity service

func (*BusinessEntityService) CreateEntity

func (s *BusinessEntityService) CreateEntity(ctx context.Context, entity *models.BusinessEntity) error

CreateEntity creates a new business entity

func (*BusinessEntityService) DeleteEntity

func (s *BusinessEntityService) DeleteEntity(ctx context.Context, id string) error

DeleteEntity deletes a business entity

func (*BusinessEntityService) GetEntitiesByTable

func (s *BusinessEntityService) GetEntitiesByTable(ctx context.Context, databaseAlias, tableName string) ([]models.BusinessEntity, error)

GetEntitiesByTable retrieves business entities mapped to a specific table

func (*BusinessEntityService) GetEntity

GetEntity retrieves a business entity by ID

func (*BusinessEntityService) GetEntityContext

func (s *BusinessEntityService) GetEntityContext(ctx context.Context, databaseAlias string, entityNames []string) (string, error)

GetEntityContext builds business entity context for AI

func (*BusinessEntityService) ListEntities

func (s *BusinessEntityService) ListEntities(ctx context.Context, databaseAlias string) ([]models.BusinessEntity, error)

ListEntities retrieves all business entities for a database

func (*BusinessEntityService) SearchEntities

func (s *BusinessEntityService) SearchEntities(ctx context.Context, databaseAlias, keyword string) ([]models.BusinessEntity, error)

SearchEntities searches business entities by keyword

func (*BusinessEntityService) UpdateEntity

func (s *BusinessEntityService) UpdateEntity(ctx context.Context, id string, updates map[string]interface{}) error

UpdateEntity updates a business entity

type ChatRequest

type ChatRequest struct {
	Question string                 `json:"question"`
	Context  map[string]interface{} `json:"context"`
}

ChatRequest represents a chat request

type ChatResponse

type ChatResponse struct {
	Answer string `json:"answer"`
}

ChatResponse represents a chat response

type ChatService

type ChatService struct {
	DB                     *gorm.DB
	OpenAIKey              string
	OpenAIModel            string
	SchemaMetadataService  SchemaDiscoveryService
	SchemaEmbeddingService *SchemaEmbeddingService
	// contains filtered or unexported fields
}

ChatService handles chat and AI conversation features

func NewChatService

func NewChatService(db *gorm.DB, openAIKey, openAIModel string, schemaService SchemaDiscoveryService) *ChatService

NewChatService creates a new chat service

func (*ChatService) CreateConversation

func (s *ChatService) CreateConversation(userID, databaseAlias, title string, autoExecute bool) (*models.Conversation, error)

CreateConversation creates a new conversation

func (*ChatService) CreateEmbedding

func (s *ChatService) CreateEmbedding(ctx context.Context, text string) ([]float64, error)

CreateEmbedding creates a vector embedding for text using OpenAI

func (*ChatService) DeleteConversation

func (s *ChatService) DeleteConversation(id string) error

DeleteConversation soft deletes a conversation

func (*ChatService) ExecuteMessageSQL

func (s *ChatService) ExecuteMessageSQL(ctx context.Context, messageID string, modifiedSQL *string) (*models.ChatMessage, error)

ExecuteMessageSQL executes or re-executes SQL for a specific message

func (*ChatService) GetConversation

func (s *ChatService) GetConversation(id string) (*models.Conversation, error)

GetConversation retrieves a conversation by ID

func (*ChatService) GetMessage

func (s *ChatService) GetMessage(messageID string) (*models.ChatMessage, error)

GetMessage retrieves a single message by ID

func (*ChatService) ListConversations

func (s *ChatService) ListConversations(userID string, limit int) ([]models.Conversation, error)

ListConversations retrieves conversations for a user

func (*ChatService) ProcessMessage

func (s *ChatService) ProcessMessage(ctx context.Context, conversationID, userMessage, databaseAlias string, autoExecute bool) (*models.ChatMessage, error)

ProcessMessage processes a user message and generates AI response

func (*ChatService) SaveSchemaEmbedding

func (s *ChatService) SaveSchemaEmbedding(databaseAlias string, entityType models.EntityType, entityID, entityText string, embedding []float64) error

SaveSchemaEmbedding saves a schema embedding to the database

func (*ChatService) SearchSimilarSchemaElements

func (s *ChatService) SearchSimilarSchemaElements(ctx context.Context, databaseAlias, query string, limit int) ([]models.SchemaEmbedding, error)

SearchSimilarSchemaElements finds similar schema elements using vector search

type ClarificationQuestion

type ClarificationQuestion struct {
	Question string   `json:"question"`
	Type     string   `json:"type"` // "text", "choice", "confirm"
	Options  []string `json:"options,omitempty"`
	Required bool     `json:"required"`
}

ClarificationQuestion represents a question the AI needs answered

type CleanOptions

type CleanOptions struct {
	Priority     string // optional filter
	Layer        string // optional filter
	ArchivedOnly bool   // when true, hard-delete archived items; otherwise soft-delete matches
}

CleanOptions controls bulk-clean behaviour.

type CodeModificationHandler

type CodeModificationHandler struct {
	OpenAIKey              string
	OpenAIModel            string
	AIReportService        *AIReportService
	SchemaEmbeddingService *SchemaEmbeddingService
	SchemaMetadataService  *SchemaMetadataService
	// contains filtered or unexported fields
}

CodeModificationHandler handles code/query/script modifications for existing functions

func (*CodeModificationHandler) CanHandle

func (h *CodeModificationHandler) CanHandle(ctx context.Context, intent string, editorType string) bool

func (*CodeModificationHandler) GetName

func (h *CodeModificationHandler) GetName() string

func (*CodeModificationHandler) Handle

type CollectionService

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

CollectionService provides collection operations that work across multiple document DB types

func NewCollectionService

func NewCollectionService() *CollectionService

NewCollectionService creates a new collection service instance

func (*CollectionService) DeleteItem

func (s *CollectionService) DeleteItem(collectionName string, filter map[string]interface{}) error

DeleteItem deletes an item from the collection

func (*CollectionService) GetItemByField

func (s *CollectionService) GetItemByField(collectionName string, field string, value interface{}) (map[string]interface{}, error)

GetItemByField retrieves a single item by a specific field

func (*CollectionService) GetItemByID

func (s *CollectionService) GetItemByID(collectionName string, id string) (map[string]interface{}, error)

GetItemByID retrieves a single item by its ID

func (*CollectionService) InsertItem

func (s *CollectionService) InsertItem(collectionName string, data map[string]interface{}) (string, error)

InsertItem inserts a new item into the collection

func (*CollectionService) QueryCollection

func (s *CollectionService) QueryCollection(collectionName string, opts *QueryOptions) (*QueryResult, error)

QueryCollection queries a collection with pagination and filtering

func (*CollectionService) QueryCollectionLegacy

func (s *CollectionService) QueryCollectionLegacy(collectionName string, filter bson.M, projection bson.M) ([]bson.M, error)

QueryCollectionLegacy provides backward compatibility with the old DocDB.QueryCollection method

func (*CollectionService) UpdateItem

func (s *CollectionService) UpdateItem(collectionName string, filter map[string]interface{}, update map[string]interface{}) error

UpdateItem updates an item in the collection

type ColumnInfo

type ColumnInfo struct {
	ColumnName    string
	DataType      string
	IsNullable    string
	ColumnKey     string
	ColumnComment string
	OrdinalPos    int
}

ColumnInfo represents column metadata structure

type ComponentRecommendation

type ComponentRecommendation struct {
	ComponentType string                 `json:"component_type"`
	Name          string                 `json:"name"`
	X             float64                `json:"x"`
	Y             float64                `json:"y"`
	Width         float64                `json:"width"`
	Height        float64                `json:"height"`
	DataConfig    map[string]interface{} `json:"data_config"`
	ChartType     string                 `json:"chart_type,omitempty"`
	ChartConfig   map[string]interface{} `json:"chart_config,omitempty"`
	StyleConfig   map[string]interface{} `json:"style_config,omitempty"`
}

ComponentRecommendation represents an AI-recommended report component

type ConversationContext

type ConversationContext struct {
	SessionID           string                 `json:"session_id"`
	UserID              string                 `json:"user_id"`
	EditorType          string                 `json:"editor_type"` // "bpm", "page", "view", "workflow", "whiteboard", "report", "general"
	DatabaseAlias       string                 `json:"database_alias"`
	EntityID            string                 `json:"entity_id"`      // ID of BPM/Page/View being edited
	EntityContext       map[string]interface{} `json:"entity_context"` // Current state of the entity
	PageContext         map[string]interface{} `json:"page_context"`   // Current page context
	ConversationHistory []ConversationMessage  `json:"conversation_history"`
	Metadata            map[string]interface{} `json:"metadata"`
}

ConversationContext holds context about the current conversation

type ConversationMessage

type ConversationMessage struct {
	Role      string                 `json:"role"` // "user", "assistant", "system"
	Content   string                 `json:"content"`
	Timestamp time.Time              `json:"timestamp"`
	Metadata  map[string]interface{} `json:"metadata"`
}

ConversationMessage represents a single message in the conversation

type CreateAgentRequest

type CreateAgentRequest struct {
	Name               string          `json:"name"`
	Description        string          `json:"description"`
	Avatar             string          `json:"avatar"`
	ModelProvider      string          `json:"modelprovider"`
	ModelName          string          `json:"modelname"`
	SystemPrompt       string          `json:"systemprompt"`
	SkillNames         []string        `json:"skillnames"`
	MCPServerIDs       []string        `json:"mcpserverids"`
	MaxIterations      int             `json:"maxiterations"`
	Temperature        float64         `json:"temperature"`
	IsDefault          bool            `json:"isdefault"`
	Enabled            bool            `json:"enabled"`
	RunInstance        string          `json:"runinstance"`
	NotificationConfig models.JSONBMap `json:"notificationconfig"`
	CreatedBy          string          `json:"createdby"`
}

CreateAgentRequest holds parameters for creating a new agent.

type CreateMCPServerRequest

type CreateMCPServerRequest struct {
	Name          string            `json:"name"`
	Description   string            `json:"description"`
	TransportType string            `json:"transporttype"`
	URL           string            `json:"url"`
	MCPPath       string            `json:"mcppath"`
	Command       string            `json:"command"`
	Args          []string          `json:"args"`
	Headers       map[string]string `json:"headers"`
	Enabled       bool              `json:"enabled"`
	CreatedBy     string            `json:"createdby"`
}

type CreateMemoryRequest

type CreateMemoryRequest struct {
	Title         string   `json:"title"`
	Summary       string   `json:"summary"`
	Content       string   `json:"content"`
	ContentType   string   `json:"contenttype"`
	Tags          []string `json:"tags"`
	Layer         string   `json:"layer"`         // L0 | L1 | L2
	Priority      string   `json:"priority"`      // P0 | P1 | P2
	RetentionType string   `json:"retentiontype"` // permanent | interval | temporary
	RetentionDays *int     `json:"retentiondays"`
	ExpiresAt     *string  `json:"expiresat"` // RFC3339 string, optional
	CreatedBy     string   `json:"createdby"`
}

CreateMemoryRequest is the payload for creating a new memory item.

type CreateScheduleRequest

type CreateScheduleRequest struct {
	AgentDefinitionID string `json:"agentdefinitionid"`
	Name              string `json:"name"`
	Description       string `json:"description"`
	TaskPrompt        string `json:"taskprompt"`
	CronExpression    string `json:"cronexpression"`
	CreatedBy         string `json:"createdby"`
}

CreateScheduleRequest contains parameters for creating an agent schedule

type CreateSkillRequest

type CreateSkillRequest struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayname"`
	Description string `json:"description"`
	Category    string `json:"category"`
	CreatedBy   string `json:"createdby"`
}

type DataInsights

type DataInsights struct {
	Summary        string              `json:"summary"`
	KeyInsights    []string            `json:"key_insights"`
	Visualizations []VisualizationSpec `json:"visualizations"`
	DataAnalysis   DataStatistics      `json:"data_analysis"`
}

DataInsights represents AI-generated insights from query results

type DataSetService

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

DataSetService handles dataset schema storage and management

func NewDataSetService

func NewDataSetService(docDB documents.DocumentDB) *DataSetService

NewDataSetService creates a new dataset service

func (*DataSetService) CreateDataSet

func (ds *DataSetService) CreateDataSet(ctx context.Context, req *models.DataSetCreateRequest, user string) (*models.DataSet, error)

CreateDataSet creates a new dataset schema

func (*DataSetService) DeleteDataSet

func (ds *DataSetService) DeleteDataSet(ctx context.Context, id string) error

DeleteDataSet deletes a dataset

func (*DataSetService) GetDataSet

func (ds *DataSetService) GetDataSet(ctx context.Context, id string) (*models.DataSet, error)

GetDataSet retrieves a dataset by ID

func (*DataSetService) GetDataSetByName

func (ds *DataSetService) GetDataSetByName(ctx context.Context, name string) (*models.DataSet, error)

GetDataSetByName retrieves a dataset by name

func (*DataSetService) ListDataSets

func (ds *DataSetService) ListDataSets(ctx context.Context) ([]models.DataSet, error)

ListDataSets retrieves all datasets

func (*DataSetService) SearchDataSets

func (ds *DataSetService) SearchDataSets(ctx context.Context, query string) ([]models.DataSet, error)

SearchDataSets searches datasets by name or tags

func (*DataSetService) UpdateDataSet

func (ds *DataSetService) UpdateDataSet(ctx context.Context, id string, req *models.DataSetUpdateRequest, user string) (*models.DataSet, error)

UpdateDataSet updates dataset metadata and schema

type DataStatistics

type DataStatistics struct {
	RowCount       int                    `json:"row_count"`
	ColumnCount    int                    `json:"column_count"`
	NumericColumns []string               `json:"numeric_columns"`
	DateColumns    []string               `json:"date_columns"`
	TextColumns    []string               `json:"text_columns"`
	TopValues      map[string]interface{} `json:"top_values,omitempty"`
}

DataStatistics contains basic statistics about the data

type DatabaseHelper

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

DatabaseHelper provides multi-database support for services It wraps the database selector and provides dialect-aware operations

func NewDatabaseHelper

func NewDatabaseHelper(selector *dbconn.DatabaseSelector, gormDB *gorm.DB) *DatabaseHelper

NewDatabaseHelper creates a new database helper

func (*DatabaseHelper) ExecuteDialectQuery

func (h *DatabaseHelper) ExecuteDialectQuery(ctx context.Context, db dbconn.RelationalDB, queryFunc func(dialectName string) string, args ...interface{}) (*sql.Rows, error)

ExecuteDialectQuery executes a query using the appropriate dialect

func (*DatabaseHelper) GetAppDB

func (h *DatabaseHelper) GetAppDB() *gorm.DB

GetAppDB returns the GORM database for IAC application's own tables

func (*DatabaseHelper) GetUserDB

func (h *DatabaseHelper) GetUserDB(ctx context.Context, databaseAlias string) (dbconn.RelationalDB, error)

GetUserDB gets a database connection for a user's database This uses the database selector to choose the appropriate database

func (*DatabaseHelper) GetUserDBForWrite

func (h *DatabaseHelper) GetUserDBForWrite(ctx context.Context, databaseAlias string) (dbconn.RelationalDB, error)

GetUserDBForWrite gets a database connection for write operations

type DatasourceExecutionResult

type DatasourceExecutionResult struct {
	Alias           string                   `json:"alias"`
	Columns         []string                 `json:"columns"`
	Rows            []map[string]interface{} `json:"rows"` // Primary field for frontend TableRenderer
	Data            []map[string]interface{} `json:"data"` // Backward compatibility
	TotalRows       int                      `json:"total_rows"`
	ExecutionTimeMs int64                    `json:"execution_time_ms"`
	SQL             string                   `json:"sql,omitempty"`
	Error           string                   `json:"error,omitempty"`
}

DatasourceExecutionResult represents the execution result of a single datasource

type Dependency

type Dependency struct {
	PredecessorID string `json:"predecessorId"`
	Type          string `json:"type"` // FS, SS, FF, SF
	Lag           int    `json:"lag"`
}

Dependency represents a task dependency

type DocumentService

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

DocumentService handles document storage and management

func NewDocumentService

func NewDocumentService(docDB documents.DocumentDB, storagePath string, baseURL string, serverURL string) *DocumentService

NewDocumentService creates a new document service

func (*DocumentService) DeleteDocument

func (ds *DocumentService) DeleteDocument(ctx context.Context, id string) error

DeleteDocument deletes a document and its file

func (*DocumentService) GetDocument

func (ds *DocumentService) GetDocument(ctx context.Context, id string) (*models.Document, error)

GetDocument retrieves a document by ID

func (*DocumentService) GetDocumentsByType

func (ds *DocumentService) GetDocumentsByType(ctx context.Context, docType models.DocumentType) ([]models.Document, error)

GetDocumentsByType retrieves documents by type

func (*DocumentService) ListDocuments

func (ds *DocumentService) ListDocuments(ctx context.Context) ([]models.Document, error)

ListDocuments retrieves all documents

func (*DocumentService) ResolveDocumentURL

func (ds *DocumentService) ResolveDocumentURL(relativeURL string) string

ResolveDocumentURL converts a relative document URL to a full URL This is used by frontend to get actual accessible URLs

func (*DocumentService) SearchDocuments

func (ds *DocumentService) SearchDocuments(ctx context.Context, query string) ([]models.Document, error)

SearchDocuments searches documents by name or tags

func (*DocumentService) UpdateDocument

func (ds *DocumentService) UpdateDocument(ctx context.Context, id string, req *models.DocumentUpdateRequest, user string) (*models.Document, error)

UpdateDocument updates document metadata

func (*DocumentService) UploadDocument

func (ds *DocumentService) UploadDocument(ctx context.Context, file multipart.File, header *multipart.FileHeader, user string, description string, tags []string) (*models.Document, error)

UploadDocument handles file upload and creates document record

type EmbeddingField

type EmbeddingField []float64

EmbeddingField is a custom type for handling vector embeddings

func (*EmbeddingField) Scan

func (e *EmbeddingField) Scan(value interface{}) error

Scan implements the sql.Scanner interface

func (EmbeddingField) Value

func (e EmbeddingField) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type EmbeddingJobService

type EmbeddingJobService struct {
	DB                     *gorm.DB
	VectorDB               *gorm.DB // Vector database connection
	SchemaEmbeddingService *SchemaEmbeddingService
	// contains filtered or unexported fields
}

EmbeddingJobService handles async embedding generation jobs

func NewEmbeddingJobService

func NewEmbeddingJobService(db *gorm.DB, openAIKey string) *EmbeddingJobService

NewEmbeddingJobService creates a new embedding job service

func (*EmbeddingJobService) CreateEmbeddingJob

func (s *EmbeddingJobService) CreateEmbeddingJob(databaseAlias string, jobType string, tableNames []string, force bool) (*models.EmbeddingGenerationJob, error)

CreateEmbeddingJob creates a new embedding generation job

func (*EmbeddingJobService) GetJob

GetJob retrieves a job by ID

func (*EmbeddingJobService) GetJobByUUID

func (s *EmbeddingJobService) GetJobByUUID(uuid string) (*models.EmbeddingGenerationJob, error)

GetJobByUUID retrieves a job by UUID

func (*EmbeddingJobService) ProcessEmbeddingJobAsync

func (s *EmbeddingJobService) ProcessEmbeddingJobAsync(jobID int, databaseAlias string, tableNames []string, force bool)

ProcessEmbeddingJobAsync starts an async job to generate embeddings

func (*EmbeddingJobService) UpdateJobProgress

func (s *EmbeddingJobService) UpdateJobProgress(jobID int, totalItems, processedItems, failedItems int) error

UpdateJobProgress updates the job progress

func (*EmbeddingJobService) UpdateJobStatus

func (s *EmbeddingJobService) UpdateJobStatus(jobID int, status string, errorMsg *string) error

UpdateJobStatus updates the job status and related fields

type EmbeddingRequest

type EmbeddingRequest struct {
	Input string `json:"input"`
	Model string `json:"model"`
}

EmbeddingRequest represents OpenAI embedding API request

type EmbeddingResponse

type EmbeddingResponse struct {
	Data []struct {
		Embedding []float64 `json:"embedding"`
		Index     int       `json:"index"`
	} `json:"data"`
	Model string `json:"model"`
	Usage struct {
		PromptTokens int `json:"prompt_tokens"`
		TotalTokens  int `json:"total_tokens"`
	} `json:"usage"`
}

EmbeddingResponse represents OpenAI embedding API response

type ExecutionData

type ExecutionData struct {
	Datasources map[string]DatasourceExecutionResult `json:"datasources"`
}

ExecutionData wraps the datasource results to match frontend expectations

type ExecutionRequest

type ExecutionRequest struct {
	Parameters   map[string]interface{} `json:"parameters"`
	OutputFormat string                 `json:"output_format"`
}

ExecutionRequest represents a report execution request

type ExecutionResult

type ExecutionResult struct {
	ReportID        string                 `json:"report_id"`
	ReportName      string                 `json:"report_name"`
	ExecutedBy      string                 `json:"executed_by"`
	ExecutedAt      time.Time              `json:"executed_at"`
	Parameters      map[string]interface{} `json:"parameters"`
	OutputFormat    string                 `json:"output_format"`
	Status          string                 `json:"status"`
	ExecutionTimeMs int64                  `json:"execution_time_ms"`
	Data            ExecutionData          `json:"data"`
	ErrorMessage    string                 `json:"error_message,omitempty"`
}

ExecutionResult represents the result of a report execution

type FleetAnalysisRequest

type FleetAnalysisRequest struct {
	Plants []FleetPlant `json:"plants"`
}

FleetAnalysisRequest represents a request to analyze the global fleet

type FleetAnalysisResponse

type FleetAnalysisResponse struct {
	Insight string `json:"insight"`
}

FleetAnalysisResponse represents the AI analysis response for the fleet

type FleetPlant

type FleetPlant struct {
	Name       string  `json:"name"`
	Status     string  `json:"status"`
	Efficiency float64 `json:"efficiency"`
}

FleetPlant represents a simplified plant data for fleet analysis

type GeminiCandidate

type GeminiCandidate struct {
	Content GeminiContent `json:"content"`
}

type GeminiContent

type GeminiContent struct {
	Parts []GeminiPart `json:"parts"`
	Role  string       `json:"role,omitempty"`
}

type GeminiGenerationConfig

type GeminiGenerationConfig struct {
	Temperature      float64               `json:"temperature,omitempty"`
	MaxOutputTokens  int                   `json:"maxOutputTokens,omitempty"`
	ResponseMimeType string                `json:"responseMimeType,omitempty"`
	ResponseSchema   *GeminiResponseSchema `json:"responseSchema,omitempty"`
}

type GeminiInlineData

type GeminiInlineData struct {
	MimeType string `json:"mimeType"`
	Data     string `json:"data"`
}

type GeminiPart

type GeminiPart struct {
	Text       string            `json:"text,omitempty"`
	InlineData *GeminiInlineData `json:"inlineData,omitempty"`
}

type GeminiRequest

type GeminiRequest struct {
	Contents          []GeminiContent          `json:"contents"`
	GenerationConfig  GeminiGenerationConfig   `json:"generationConfig,omitempty"`
	SystemInstruction *GeminiSystemInstruction `json:"systemInstruction,omitempty"`
}

Google Gemini API structures

type GeminiResponse

type GeminiResponse struct {
	Candidates []GeminiCandidate `json:"candidates"`
}

type GeminiResponseSchema

type GeminiResponseSchema struct {
	Type       string                          `json:"type"`
	Properties map[string]GeminiSchemaProperty `json:"properties,omitempty"`
	Items      *GeminiSchemaProperty           `json:"items,omitempty"`
}

type GeminiSchemaProperty

type GeminiSchemaProperty struct {
	Type       string                          `json:"type"`
	Properties map[string]GeminiSchemaProperty `json:"properties,omitempty"`
	Items      *GeminiSchemaProperty           `json:"items,omitempty"`
	Enum       []string                        `json:"enum,omitempty"`
}

type GeminiSystemInstruction

type GeminiSystemInstruction struct {
	Parts []GeminiPart `json:"parts"`
}

type GeneralQuestionHandler

type GeneralQuestionHandler struct {
	OpenAIKey   string
	OpenAIModel string
	// contains filtered or unexported fields
}

GeneralQuestionHandler handles general Q&A questions

func (*GeneralQuestionHandler) CanHandle

func (h *GeneralQuestionHandler) CanHandle(ctx context.Context, intent string, editorType string) bool

func (*GeneralQuestionHandler) GetName

func (h *GeneralQuestionHandler) GetName() string

func (*GeneralQuestionHandler) Handle

type GenerateScheduleRequest

type GenerateScheduleRequest struct {
	Prompt             string                 `json:"prompt"`
	AvailableResources []Resource             `json:"availableResources"`
	CalendarConfig     map[string]interface{} `json:"calendarConfig,omitempty"`
	SystemPrompt       string                 `json:"systemPrompt,omitempty"`
}

GenerateScheduleRequest represents a schedule generation request

type GenerateScheduleResponse

type GenerateScheduleResponse struct {
	Tasks    []Task                 `json:"tasks"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

GenerateScheduleResponse represents a schedule generation response

type GlobalMapAIService

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

GlobalMapAIService handles AI-powered analysis for Global Map

func (*GlobalMapAIService) AnalyzeFleet

AnalyzeFleet generates an AI-powered analysis for the global fleet

func (*GlobalMapAIService) AnalyzePlant

AnalyzePlant generates an AI-powered analysis for a single plant

type HubMigrationService

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

HubMigrationService handles migration from flat to hierarchical structure

func NewHubMigrationService

func NewHubMigrationService(db *sql.DB, docDB documents.DocumentDB) *HubMigrationService

NewHubMigrationService creates new migration service

func (*HubMigrationService) MigrateAll

func (hms *HubMigrationService) MigrateAll(ctx context.Context, oldHubs []OldIntegrationHub, targetInstanceID string) (int, int, error)

MigrateAll migrates all hubs from a provided list

func (*HubMigrationService) MigrateFromFlat

func (hms *HubMigrationService) MigrateFromFlat(ctx context.Context, oldHub OldIntegrationHub, targetInstanceID string) error

MigrateFromFlat migrates old Integration_Hub to new hierarchical structure

type HubService

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

HubService provides hierarchical hub management using MongoDB

func NewHubService

func NewHubService(docDB documents.DocumentDB) *HubService

NewHubService creates new hub service with document database

func (*HubService) CreateEndpoint

func (hs *HubService) CreateEndpoint(ctx context.Context, endpoint *models.HubEndpoint) error

CreateEndpoint creates a new endpoint in MongoDB

func (*HubService) CreateInstance

func (hs *HubService) CreateInstance(ctx context.Context, instance *models.HubInstance) error

CreateInstance creates a new hub instance in MongoDB

func (*HubService) CreateProtocolGroup

func (hs *HubService) CreateProtocolGroup(ctx context.Context, group *models.HubProtocolGroup) error

CreateProtocolGroup creates a new protocol group in MongoDB

func (*HubService) DeleteEndpoint

func (hs *HubService) DeleteEndpoint(ctx context.Context, id string) error

DeleteEndpoint soft deletes an endpoint from MongoDB

func (*HubService) DeleteInstance

func (hs *HubService) DeleteInstance(ctx context.Context, id string) error

DeleteInstance soft deletes a hub instance from MongoDB

func (*HubService) DeleteProtocolGroup

func (hs *HubService) DeleteProtocolGroup(ctx context.Context, id string) error

DeleteProtocolGroup soft deletes a protocol group from MongoDB

func (*HubService) GetEndpointByID

func (hs *HubService) GetEndpointByID(ctx context.Context, id string) (*models.HubEndpoint, error)

GetEndpointByID retrieves an endpoint by ID from MongoDB

func (*HubService) GetHierarchicalTree

func (hs *HubService) GetHierarchicalTree(ctx context.Context, instanceID string) (*models.HierarchicalTreeNode, error)

GetHierarchicalTree builds hierarchical tree structure for an instance

func (*HubService) GetInstanceByID

func (hs *HubService) GetInstanceByID(ctx context.Context, id string) (*models.HubInstance, error)

GetInstanceByID retrieves a hub instance by ID from MongoDB

func (*HubService) ListEndpoints

func (hs *HubService) ListEndpoints(ctx context.Context, groupID string) ([]models.HubEndpoint, error)

ListEndpoints retrieves endpoints for a protocol group from MongoDB

func (*HubService) ListInstances

func (hs *HubService) ListInstances(ctx context.Context) ([]models.HubInstance, error)

ListInstances retrieves all hub instances from MongoDB

func (*HubService) ListProtocolGroups

func (hs *HubService) ListProtocolGroups(ctx context.Context, instanceID string, direction string) ([]models.HubProtocolGroup, error)

ListProtocolGroups retrieves protocol groups for an instance from MongoDB

func (*HubService) ResolveEndpointConfig

func (hs *HubService) ResolveEndpointConfig(ctx context.Context, endpointID string) (*models.ResolvedEndpointConfig, error)

ResolveEndpointConfig resolves final configuration with inheritance

func (*HubService) UpdateEndpoint

func (hs *HubService) UpdateEndpoint(ctx context.Context, endpoint *models.HubEndpoint) error

UpdateEndpoint updates an existing endpoint in MongoDB

func (*HubService) UpdateInstance

func (hs *HubService) UpdateInstance(ctx context.Context, instance *models.HubInstance) error

UpdateInstance updates an existing hub instance in MongoDB

func (*HubService) UpdateProtocolGroup

func (hs *HubService) UpdateProtocolGroup(ctx context.Context, group *models.HubProtocolGroup) error

UpdateProtocolGroup updates an existing protocol group in MongoDB

type ImageTo3DRequest

type ImageTo3DRequest struct {
	Image string `json:"image"` // base64 encoded image
}

ImageTo3DRequest represents an image-to-3D generation request

type ImageTo3DResponse

type ImageTo3DResponse struct {
	Asset PlantObject `json:"asset"`
}

ImageTo3DResponse represents an image-to-3D generation response

type InboundConfig

type InboundConfig struct {
	Enabled        bool                   `json:"enabled"`
	Protocol       string                 `json:"protocol"`
	MessageType    string                 `json:"messageType"`
	Endpoint       string                 `json:"endpoint"`
	Port           int                    `json:"port"`
	Path           string                 `json:"path"`
	Method         string                 `json:"method"`
	Timeout        int                    `json:"timeout"`
	RetryAttempts  int                    `json:"retryAttempts"`
	RetryInterval  int                    `json:"retryInterval"`
	Authentication AuthConfig             `json:"authentication"`
	QueueConfig    map[string]interface{} `json:"queueConfig"`
	FileConfig     map[string]interface{} `json:"fileConfig"`
}

InboundConfig from old structure

type IndexInfo

type IndexInfo struct {
	IndexName  string
	ColumnName string
	NonUnique  int
	SeqInIndex int
	IndexType  string
}

IndexInfo represents index information

type InstallSkillRequest

type InstallSkillRequest struct {
	URL         string `json:"url"`
	InstalledBy string `json:"installed_by"`
}

InstallSkillRequest carries the installation URL and requester identity.

type IntegrationHubService

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

IntegrationHubService provides simplified single-document integration hub operations

func NewIntegrationHubService

func NewIntegrationHubService(docDB documents.DocumentDB) *IntegrationHubService

NewIntegrationHubService creates new integration hub service with document database

func (*IntegrationHubService) CreateRevision

func (s *IntegrationHubService) CreateRevision(ctx context.Context, sourceId string, user string) (*models.IntegrationHub, error)

CreateRevision creates a new version based on an existing hub configuration

func (*IntegrationHubService) DeleteHub

func (s *IntegrationHubService) DeleteHub(ctx context.Context, id string) error

DeleteHub soft-deletes an integration hub configuration

func (*IntegrationHubService) GetAllEnabledHubs

func (s *IntegrationHubService) GetAllEnabledHubs(ctx context.Context) ([]*models.IntegrationHub, error)

GetAllEnabledHubs retrieves all enabled hub configurations (for hub executor)

func (*IntegrationHubService) GetAvailableStatuses

func (s *IntegrationHubService) GetAvailableStatuses() []models.IntegrationHubStatus

GetAvailableStatuses returns all available status options

func (*IntegrationHubService) GetDefaultEnabledHubs

func (s *IntegrationHubService) GetDefaultEnabledHubs(ctx context.Context) ([]*models.IntegrationHub, error)

GetDefaultEnabledHubs retrieves all default hub configurations that are enabled

func (*IntegrationHubService) GetDefaultHub

func (s *IntegrationHubService) GetDefaultHub(ctx context.Context, name string) (*models.IntegrationHub, error)

GetDefaultHub retrieves the default hub configuration for a name

func (*IntegrationHubService) GetHub

GetHub retrieves a single integration hub configuration by ID

func (*IntegrationHubService) GetNextVersion

func (s *IntegrationHubService) GetNextVersion(ctx context.Context, name string) (int, error)

GetNextVersion gets the next version number for a hub name

func (*IntegrationHubService) ListHubs

ListHubs retrieves all integration hub configurations

func (*IntegrationHubService) ListHubsByName

func (s *IntegrationHubService) ListHubsByName(ctx context.Context, name string) ([]models.IntegrationHub, error)

ListHubsByName retrieves all configurations for a specific name

func (*IntegrationHubService) SaveHub

SaveHub creates or updates an integration hub configuration (whole document)

func (*IntegrationHubService) SetAsDefault

func (s *IntegrationHubService) SetAsDefault(ctx context.Context, id string, user string) error

SetAsDefault sets a hub as the default for its name, clearing other defaults

func (*IntegrationHubService) UpdateStatus

func (s *IntegrationHubService) UpdateStatus(ctx context.Context, id string, status models.IntegrationHubStatus, user string) error

UpdateStatus updates the status of a hub configuration

type JobConfig

type JobConfig struct {
	Enabled         bool                   `json:"enabled"`
	JobType         string                 `json:"jobType"`
	Schedule        map[string]interface{} `json:"schedule"`
	Trigger         map[string]interface{} `json:"trigger"`
	ExecutionConfig map[string]interface{} `json:"executionConfig"`
	Parameters      map[string]interface{} `json:"parameters"`
}

JobConfig from old structure

type JobService

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

JobService provides methods for managing jobs

func NewJobService

func NewJobService(db *sql.DB) *JobService

NewJobService creates a new job service instance

func (*JobService) CleanupCompletedJobs

func (js *JobService) CleanupCompletedJobs(ctx context.Context, retentionHours int) (int, error)

CleanupCompletedJobs archives or deletes old completed jobs

func (*JobService) CreateJobFromIntegrationMessage

func (js *JobService) CreateJobFromIntegrationMessage(ctx context.Context, method, protocol, direction, handler, payload string, metadata models.JobMetadata) (*models.QueueJob, error)

CreateJobFromIntegrationMessage creates a queue job from an integration message

func (*JobService) CreateJobHistory

func (js *JobService) CreateJobHistory(ctx context.Context, history *models.JobHistory) error

CreateJobHistory creates a job execution history record

func (*JobService) CreateQueueJob

func (js *JobService) CreateQueueJob(ctx context.Context, job *models.QueueJob) error

CreateQueueJob creates a new job in the queue

func (*JobService) DeleteArchivedJobs

func (js *JobService) DeleteArchivedJobs(ctx context.Context, retentionDays int) (int, error)

DeleteArchivedJobs permanently deletes archived jobs older than specified days

func (*JobService) GetJobByID

func (js *JobService) GetJobByID(ctx context.Context, jobID string) (*models.QueueJob, error)

GetJobByID retrieves a job by its ID

func (*JobService) GetJobStatistics

func (js *JobService) GetJobStatistics(ctx context.Context) (map[string]interface{}, error)

GetJobStatistics retrieves job statistics

func (*JobService) GetNextPendingJob

func (js *JobService) GetNextPendingJob(ctx context.Context) (*models.QueueJob, error)

GetNextPendingJob retrieves the next pending job from the queue

func (*JobService) GetScheduledJobs

func (js *JobService) GetScheduledJobs(ctx context.Context) ([]*models.Job, error)

GetScheduledJobs retrieves all enabled scheduled jobs that should run

func (*JobService) IncrementRetryCount

func (js *JobService) IncrementRetryCount(ctx context.Context, jobID string) error

IncrementRetryCount increments the retry count for a job

func (*JobService) UpdateQueueJobStatus

func (js *JobService) UpdateQueueJobStatus(ctx context.Context, jobID string, statusID int, result string, errorMsg string) error

UpdateQueueJobStatus updates the status of a queue job

func (*JobService) UpdateScheduledJobNextRun

func (js *JobService) UpdateScheduledJobNextRun(ctx context.Context, jobID string, nextRunAt time.Time) error

UpdateScheduledJobNextRun updates the next run time for a scheduled job

type ListMemoryOptions

type ListMemoryOptions struct {
	Layer        string // L0 | L1 | L2 | "" (all)
	Priority     string // P0 | P1 | P2 | "" (all)
	ShowArchived bool
	SortBy       string // priority | createdon | access_count
}

ListMemoryOptions filters for ListMemory.

type MCPServerService

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

MCPServerService manages MCP server catalog entries and MCP client calls. CRUD operations now target MongoDB; FetchTools and CallTool remain unchanged.

func GetGlobalMCPServerService

func GetGlobalMCPServerService() *MCPServerService

func NewMCPServerService

func NewMCPServerService(db *gorm.DB, sqlDB *sql.DB, docDB documents.DocumentDB) *MCPServerService

NewMCPServerService creates the service backed by MongoDB for CRUD.

func (*MCPServerService) CallTool

func (s *MCPServerService) CallTool(ctx context.Context, server models.MCPServer, toolName, argsJSON string) (string, error)

CallTool calls a named tool on an HTTP MCP server via JSON-RPC 2.0.

func (*MCPServerService) CreateMCPServer

func (s *MCPServerService) CreateMCPServer(req CreateMCPServerRequest) (*models.MCPServer, error)

func (*MCPServerService) DeleteMCPServer

func (s *MCPServerService) DeleteMCPServer(id, deletedBy string) error

func (*MCPServerService) FetchTools

func (s *MCPServerService) FetchTools(server models.MCPServer) ([]ToolDefinition, error)

FetchTools calls the MCP server via JSON-RPC 2.0 "tools/list" and returns ToolDefinitions.

func (*MCPServerService) GetMCPServer

func (s *MCPServerService) GetMCPServer(id string) (*models.MCPServer, error)

func (*MCPServerService) InitializeSession

func (s *MCPServerService) InitializeSession(ctx context.Context, server models.MCPServer) (string, error)

InitializeSession sends an MCP initialize request and returns the session ID.

func (*MCPServerService) ListMCPServers

func (s *MCPServerService) ListMCPServers() ([]models.MCPServer, error)

func (*MCPServerService) UpdateMCPServer

func (s *MCPServerService) UpdateMCPServer(id string, req UpdateMCPServerRequest, modifiedBy string) (*models.MCPServer, error)

type MessageRoute

type MessageRoute struct {
	ID                 string                   `json:"id"`
	Name               string                   `json:"name"`
	Enabled            bool                     `json:"enabled"`
	Source             string                   `json:"source"`
	SourceFilter       string                   `json:"sourceFilter"`
	Destination        string                   `json:"destination"`
	TransformationType string                   `json:"transformationType"`
	Transformation     string                   `json:"transformation"`
	Mapping            []map[string]interface{} `json:"mapping"`
	Conditions         []map[string]interface{} `json:"conditions"`
	Priority           int                      `json:"priority"`
	Async              bool                     `json:"async"`
	ErrorHandling      map[string]interface{}   `json:"errorHandling"`
}

MessageRoute from old structure

type OldIntegrationHub

type OldIntegrationHub struct {
	ID          string         `json:"_id"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Enabled     bool           `json:"enabled"`
	Inbound     InboundConfig  `json:"inbound"`
	Outbound    OutboundConfig `json:"outbound"`
	Routes      []MessageRoute `json:"routes"`
	Jobs        []JobConfig    `json:"jobs"`
	CreatedBy   string         `json:"createdBy"`
}

OldIntegrationHub represents the old flat structure from MongoDB

type OptimizeScheduleBatchRequest

type OptimizeScheduleBatchRequest struct {
	CurrentTasks []Task                 `json:"currentTasks"`
	Resources    []Resource             `json:"resources"`
	Objective    string                 `json:"objective"`
	Constraints  map[string]interface{} `json:"constraints,omitempty"`
	SystemPrompt string                 `json:"systemPrompt,omitempty"`
	BatchSize    int                    `json:"batchSize,omitempty"` // Default: 30 tasks per batch
}

OptimizeScheduleBatchRequest represents an async batch optimization request

type OptimizeScheduleBatchResponse

type OptimizeScheduleBatchResponse struct {
	JobID        string `json:"jobId"`
	TotalBatches int    `json:"totalBatches"`
	TotalTasks   int    `json:"totalTasks"`
	BatchSize    int    `json:"batchSize"`
	Status       string `json:"status"`
	Message      string `json:"message"`
}

OptimizeScheduleBatchResponse represents the initial batch job response

type OptimizeScheduleRequest

type OptimizeScheduleRequest struct {
	CurrentTasks []Task                 `json:"currentTasks"`
	Resources    []Resource             `json:"resources"`
	Objective    string                 `json:"objective"`
	Constraints  map[string]interface{} `json:"constraints,omitempty"`
	SystemPrompt string                 `json:"systemPrompt,omitempty"`
}

OptimizeScheduleRequest represents a schedule optimization request

type OptimizeScheduleResponse

type OptimizeScheduleResponse struct {
	Tasks    []Task                 `json:"tasks"`
	Changes  []ScheduleChange       `json:"changes"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

OptimizeScheduleResponse represents a schedule optimization response

type OutboundConfig

type OutboundConfig struct {
	Enabled       bool                   `json:"enabled"`
	Destination   string                 `json:"destination"`
	Protocol      string                 `json:"protocol"`
	MessageType   string                 `json:"messageType"`
	Method        string                 `json:"method"`
	Timeout       int                    `json:"timeout"`
	RetryAttempts int                    `json:"retryAttempts"`
	RetryInterval int                    `json:"retryInterval"`
	Authorization AuthConfig             `json:"authorization"`
	QueueConfig   map[string]interface{} `json:"queueConfig"`
	FileConfig    map[string]interface{} `json:"fileConfig"`
}

OutboundConfig from old structure

type PageGenerationHandler

type PageGenerationHandler struct {
	OpenAIKey   string
	OpenAIModel string
	// contains filtered or unexported fields
}

PageGenerationHandler handles page structure generation

func (*PageGenerationHandler) CanHandle

func (h *PageGenerationHandler) CanHandle(ctx context.Context, intent string, editorType string) bool

func (*PageGenerationHandler) GetName

func (h *PageGenerationHandler) GetName() string

func (*PageGenerationHandler) Handle

type PlanSchedulerProfileService

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

PlanSchedulerProfileService handles plan scheduler profile operations

func NewPlanSchedulerProfileService

func NewPlanSchedulerProfileService(db *sql.DB, gormDB *gorm.DB) *PlanSchedulerProfileService

NewPlanSchedulerProfileService creates a new plan scheduler profile service

func (*PlanSchedulerProfileService) CreateConstraint

func (s *PlanSchedulerProfileService) CreateConstraint(ctx context.Context, constraint *models.PlanSchedulerProfileConstraint, createdBy string) error

CreateConstraint creates a new constraint for a profile

func (*PlanSchedulerProfileService) CreateDataSource

func (s *PlanSchedulerProfileService) CreateDataSource(ctx context.Context, dataSource *models.PlanSchedulerProfileDataSource, createdBy string) error

CreateDataSource creates a new data source for a profile

func (*PlanSchedulerProfileService) CreateProfile

func (s *PlanSchedulerProfileService) CreateProfile(ctx context.Context, profile *models.PlanSchedulerProfile, createdBy string) error

CreateProfile creates a new profile

func (*PlanSchedulerProfileService) CreateSetting

func (s *PlanSchedulerProfileService) CreateSetting(ctx context.Context, setting *models.PlanSchedulerProfileSetting, createdBy string) error

CreateSetting creates a new setting for a profile

func (*PlanSchedulerProfileService) DeleteConstraint

func (s *PlanSchedulerProfileService) DeleteConstraint(ctx context.Context, profileID string, constraintID string, modifiedBy string) error

DeleteConstraint soft-deletes a constraint (sets active = false)

func (*PlanSchedulerProfileService) DeleteDataSource

func (s *PlanSchedulerProfileService) DeleteDataSource(ctx context.Context, profileID string, dataSourceID string, modifiedBy string) error

DeleteDataSource soft-deletes a data source (sets active = false)

func (*PlanSchedulerProfileService) DeleteProfile

func (s *PlanSchedulerProfileService) DeleteProfile(ctx context.Context, id string, modifiedBy string) error

DeleteProfile soft-deletes a profile (sets active = false)

func (*PlanSchedulerProfileService) DeleteSession

func (s *PlanSchedulerProfileService) DeleteSession(ctx context.Context, sessionID, deletedBy string) error

DeleteSession soft-deletes a session

func (*PlanSchedulerProfileService) DeleteSetting

func (s *PlanSchedulerProfileService) DeleteSetting(ctx context.Context, profileID string, settingID string, modifiedBy string) error

DeleteSetting soft-deletes a setting (sets active = false)

func (*PlanSchedulerProfileService) GetAllProfiles

GetAllProfiles retrieves all active profiles

func (*PlanSchedulerProfileService) GetDefaultProfile

GetDefaultProfile retrieves the default profile

func (*PlanSchedulerProfileService) GetProfileByID

GetProfileByID retrieves a profile by ID with all related data

func (*PlanSchedulerProfileService) GetSession

GetSession gets a specific session by ID

func (*PlanSchedulerProfileService) GetSessionsByProfile

func (s *PlanSchedulerProfileService) GetSessionsByProfile(ctx context.Context, profileID string) ([]models.PlanSchedulerSession, error)

GetSessionsByProfile gets all sessions for a profile

func (*PlanSchedulerProfileService) LoadProfileData

func (s *PlanSchedulerProfileService) LoadProfileData(ctx context.Context, profileID string, parameters map[string]interface{}) (*models.PlanSchedulerProfileData, error)

LoadProfileData loads data from all data sources in a profile

func (*PlanSchedulerProfileService) SaveScheduleAsSession

func (s *PlanSchedulerProfileService) SaveScheduleAsSession(ctx context.Context, session *models.PlanSchedulerSession, createdBy string) error

SaveScheduleAsSession saves the schedule data as a session

func (*PlanSchedulerProfileService) UpdateConstraint

func (s *PlanSchedulerProfileService) UpdateConstraint(ctx context.Context, constraint *models.PlanSchedulerProfileConstraint, modifiedBy string) error

UpdateConstraint updates an existing constraint

func (*PlanSchedulerProfileService) UpdateDataSource

func (s *PlanSchedulerProfileService) UpdateDataSource(ctx context.Context, dataSource *models.PlanSchedulerProfileDataSource, modifiedBy string) error

UpdateDataSource updates an existing data source

func (*PlanSchedulerProfileService) UpdateProfile

func (s *PlanSchedulerProfileService) UpdateProfile(ctx context.Context, profile *models.PlanSchedulerProfile, modifiedBy string) error

UpdateProfile updates an existing profile

func (*PlanSchedulerProfileService) UpdateScheduleSession

func (s *PlanSchedulerProfileService) UpdateScheduleSession(ctx context.Context, session *models.PlanSchedulerSession, modifiedBy string) error

UpdateScheduleSession updates an existing session

func (*PlanSchedulerProfileService) UpdateSetting

func (s *PlanSchedulerProfileService) UpdateSetting(ctx context.Context, setting *models.PlanSchedulerProfileSetting, modifiedBy string) error

UpdateSetting updates an existing setting

type PlantAnalysisRequest

type PlantAnalysisRequest struct {
	Name   string    `json:"name"`
	Type   string    `json:"type"`
	Status string    `json:"status"`
	KPIs   PlantKPIs `json:"kpis"`
}

PlantAnalysisRequest represents a request to analyze a single plant

type PlantAnalysisResponse

type PlantAnalysisResponse struct {
	Insight string `json:"insight"`
}

PlantAnalysisResponse represents the AI analysis response for a single plant

type PlantKPIs

type PlantKPIs struct {
	Efficiency struct {
		Value  float64 `json:"value"`
		Unit   string  `json:"unit"`
		Target float64 `json:"target"`
	} `json:"efficiency"`
	Output struct {
		Value  float64 `json:"value"`
		Unit   string  `json:"unit"`
		Target float64 `json:"target"`
	} `json:"output"`
	Safety struct {
		Value  float64 `json:"value"`
		Unit   string  `json:"unit"`
		Target float64 `json:"target"`
	} `json:"safety"`
	Energy struct {
		Value  float64 `json:"value"`
		Unit   string  `json:"unit"`
		Target float64 `json:"target"`
	} `json:"energy"`
}

PlantKPIs represents the key performance indicators for a plant

type PlantObject

type PlantObject struct {
	Type     string          `json:"type"`
	Name     string          `json:"name"`
	Position []float64       `json:"position"`
	Parts    []PrimitivePart `json:"parts"`
	Width    float64         `json:"width"`
	Height   float64         `json:"height"`
	Depth    float64         `json:"depth"`
	Status   string          `json:"status"`
}

PlantObject represents a complete 3D object

type PlantStudioAIService

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

PlantStudioAIService handles AI-powered 3D model generation for Plant Studio

func NewPlantStudioAIService

func NewPlantStudioAIService() *PlantStudioAIService

NewPlantStudioAIService creates a new Plant Studio AI service

func (*PlantStudioAIService) GenerateFromImage

func (s *PlantStudioAIService) GenerateFromImage(ctx context.Context, req ImageTo3DRequest) (*ImageTo3DResponse, error)

GenerateFromImage generates 3D model from image

func (*PlantStudioAIService) GenerateFromText

func (s *PlantStudioAIService) GenerateFromText(ctx context.Context, req TextTo3DRequest) (*TextTo3DResponse, error)

GenerateFromText generates 3D models from text description

type PlantStudioService

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

PlantStudioService handles plant studio operations

func NewPlantStudioService

func NewPlantStudioService(docDB documents.DocumentDB) *PlantStudioService

NewPlantStudioService creates a new plant studio service

func (*PlantStudioService) DeletePlantAsset

func (ps *PlantStudioService) DeletePlantAsset(ctx context.Context, id string) error

DeletePlantAsset soft deletes a plant asset

func (*PlantStudioService) DeletePlantModel

func (ps *PlantStudioService) DeletePlantModel(ctx context.Context, id string) error

DeletePlantModel soft deletes a plant model

func (*PlantStudioService) GetPlantAsset

func (ps *PlantStudioService) GetPlantAsset(ctx context.Context, id string) (*models.PlantModelAsset, error)

GetPlantAsset retrieves a plant asset by ID

func (*PlantStudioService) GetPlantModel

func (ps *PlantStudioService) GetPlantModel(ctx context.Context, id string) (*models.PlantModel, error)

GetPlantModel retrieves a plant model by ID

func (*PlantStudioService) ListPlantAssets

func (ps *PlantStudioService) ListPlantAssets(ctx context.Context) ([]models.PlantModelAsset, error)

ListPlantAssets retrieves all plant assets

func (*PlantStudioService) ListPlantModels

func (ps *PlantStudioService) ListPlantModels(ctx context.Context) ([]models.PlantModel, error)

ListPlantModels retrieves all plant models

func (*PlantStudioService) SavePlantAsset

func (ps *PlantStudioService) SavePlantAsset(ctx context.Context, asset *models.PlantModelAsset, user string) error

SavePlantAsset creates or updates a plant asset

func (*PlantStudioService) SavePlantModel

func (ps *PlantStudioService) SavePlantModel(ctx context.Context, model *models.PlantModel, user string) error

SavePlantModel creates or updates a plant model

type PrimitivePart

type PrimitivePart struct {
	Type      string    `json:"type"`      // BOX, CYLINDER, SPHERE, CONE, TORUS, TRIANGLE
	Position  []float64 `json:"position"`  // [x, y, z]
	Rotation  []float64 `json:"rotation"`  // [x, y, z] in radians
	Scale     []float64 `json:"scale"`     // [x, y, z]
	Color     string    `json:"color"`     // hex color
	Operation string    `json:"operation"` // ADD or SUBTRACT
	Opacity   float64   `json:"opacity"`
	Wireframe bool      `json:"wireframe"`
	Emissive  string    `json:"emissive"`
	Name      string    `json:"name"`
}

PrimitivePart represents a geometric primitive in 3D space

type QueryGenerationHandler

type QueryGenerationHandler struct {
	AIReportService        *AIReportService
	SchemaMetadataService  *SchemaMetadataService
	SchemaEmbeddingService *SchemaEmbeddingService
	OpenAIKey              string
	OpenAIModel            string
	// contains filtered or unexported fields
}

QueryGenerationHandler handles SQL query generation

func (*QueryGenerationHandler) CanHandle

func (h *QueryGenerationHandler) CanHandle(ctx context.Context, intent string, editorType string) bool

func (*QueryGenerationHandler) GetName

func (h *QueryGenerationHandler) GetName() string

func (*QueryGenerationHandler) Handle

type QueryOptions

type QueryOptions struct {
	Filter     map[string]interface{} // Root element filters
	Projection map[string]interface{} // Fields to include/exclude
	PageSize   int                    // Number of items per page (limit)
	Page       int                    // Page number (starts at 1)
	Sort       map[string]int         // Sort fields: 1 for asc, -1 for desc
}

QueryOptions represents options for querying collections

type QueryResult

type QueryResult struct {
	Data       []map[string]interface{} `json:"data"`
	TotalCount int64                    `json:"total_count"`
	Page       int                      `json:"page"`
	PageSize   int                      `json:"page_size"`
	TotalPages int                      `json:"total_pages"`
}

QueryResult represents the result of a collection query with pagination

type QueryTemplateInfo

type QueryTemplateInfo struct {
	TemplateName string  `json:"template_name"`
	Category     string  `json:"category"`
	Description  string  `json:"description"`
	SQLTemplate  string  `json:"sql_template"`
	Similarity   float64 `json:"similarity,omitempty"`
}

QueryTemplateInfo contains query template information

type QueryTemplateService

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

QueryTemplateService handles query template management

func NewQueryTemplateService

func NewQueryTemplateService(db *gorm.DB) *QueryTemplateService

NewQueryTemplateService creates a new query template service

func (*QueryTemplateService) CreateTemplate

func (s *QueryTemplateService) CreateTemplate(ctx context.Context, template *models.QueryTemplate) error

CreateTemplate creates a new query template

func (*QueryTemplateService) DeleteTemplate

func (s *QueryTemplateService) DeleteTemplate(ctx context.Context, id string) error

DeleteTemplate deletes a query template

func (*QueryTemplateService) GetCategories

func (s *QueryTemplateService) GetCategories(ctx context.Context, databaseAlias string) ([]string, error)

GetCategories retrieves distinct categories for a database

func (*QueryTemplateService) GetTemplate

func (s *QueryTemplateService) GetTemplate(ctx context.Context, id string) (*models.QueryTemplate, error)

GetTemplate retrieves a query template by ID

func (*QueryTemplateService) GetTemplateContext

func (s *QueryTemplateService) GetTemplateContext(ctx context.Context, databaseAlias string, limit int) (string, error)

GetTemplateContext builds query template context for AI

func (*QueryTemplateService) GetTemplatesByIntent

func (s *QueryTemplateService) GetTemplatesByIntent(ctx context.Context, databaseAlias, intent string) ([]models.QueryTemplate, error)

GetTemplatesByIntent searches templates by natural language intent

func (*QueryTemplateService) IncrementUsageCount

func (s *QueryTemplateService) IncrementUsageCount(ctx context.Context, id string) error

IncrementUsageCount increments the usage count of a template

func (*QueryTemplateService) ListTemplates

func (s *QueryTemplateService) ListTemplates(ctx context.Context, databaseAlias string) ([]models.QueryTemplate, error)

ListTemplates retrieves all query templates for a database

func (*QueryTemplateService) SearchTemplates

func (s *QueryTemplateService) SearchTemplates(ctx context.Context, databaseAlias, keyword string) ([]models.QueryTemplate, error)

SearchTemplates searches query templates by keyword

func (*QueryTemplateService) UpdateTemplate

func (s *QueryTemplateService) UpdateTemplate(ctx context.Context, id string, updates map[string]interface{}) error

UpdateTemplate updates a query template

type ReportDocService

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

ReportDocService handles business logic for report documents in MongoDB

func NewReportDocService

func NewReportDocService(docDB documents.DocumentDB) *ReportDocService

NewReportDocService creates a new report document service

func (*ReportDocService) AddComponent

func (s *ReportDocService) AddComponent(ctx context.Context, reportID string, component schema.ReportComponentDoc, modifiedBy string) error

AddComponent adds a component to a report

func (*ReportDocService) AddDatasource

func (s *ReportDocService) AddDatasource(ctx context.Context, reportID string, datasource schema.ReportDatasourceDoc, modifiedBy string) error

AddDatasource adds a data source to a report

func (*ReportDocService) AddExecution

func (s *ReportDocService) AddExecution(ctx context.Context, reportID string, execution schema.ReportExecutionDoc) error

AddExecution records a report execution

func (*ReportDocService) AddParameter

func (s *ReportDocService) AddParameter(ctx context.Context, reportID string, parameter schema.ReportParameterDoc, modifiedBy string) error

AddParameter adds a parameter to a report

func (*ReportDocService) CreateReport

func (s *ReportDocService) CreateReport(ctx context.Context, report *schema.ReportDocument, createdBy string) (string, error)

CreateReport creates a new report document

func (*ReportDocService) DeleteReport

func (s *ReportDocService) DeleteReport(ctx context.Context, id string, deletedBy string) error

DeleteReport soft deletes a report

func (*ReportDocService) GetDefaultReport

func (s *ReportDocService) GetDefaultReport(ctx context.Context) (*schema.ReportDocument, error)

GetDefaultReport retrieves the default report

func (*ReportDocService) GetReportByID

func (s *ReportDocService) GetReportByID(ctx context.Context, id string) (*schema.ReportDocument, error)

GetReportByID retrieves a report by its ID

func (*ReportDocService) GetReportByName

func (s *ReportDocService) GetReportByName(ctx context.Context, name string) (*schema.ReportDocument, error)

GetReportByName retrieves a report by its name

func (*ReportDocService) GetReportsByCategory

func (s *ReportDocService) GetReportsByCategory(ctx context.Context, category string, page, pageSize int) ([]*schema.ReportDocument, int64, error)

GetReportsByCategory retrieves reports by category

func (*ReportDocService) InitializeIndexes

func (s *ReportDocService) InitializeIndexes(ctx context.Context) error

InitializeIndexes creates the required indexes for the Reports collection

func (*ReportDocService) ListReports

func (s *ReportDocService) ListReports(ctx context.Context, userID string, isPublic bool, category string, reportType string, page, pageSize int) ([]*schema.ReportDocument, int64, error)

ListReports retrieves reports with filtering, sorting, and pagination

func (*ReportDocService) SearchReports

func (s *ReportDocService) SearchReports(ctx context.Context, searchText string, page, pageSize int) ([]*schema.ReportDocument, int64, error)

SearchReports performs text search on reports

func (*ReportDocService) SetDefaultReport

func (s *ReportDocService) SetDefaultReport(ctx context.Context, reportID string, modifiedBy string) error

SetDefaultReport sets a report as the default

func (*ReportDocService) UpdateReport

func (s *ReportDocService) UpdateReport(ctx context.Context, id string, updates map[string]interface{}, modifiedBy string) error

UpdateReport updates a report document

func (*ReportDocService) UpdateReportRevision

func (s *ReportDocService) UpdateReportRevision(ctx context.Context, id string, modifiedBy string) error

UpdateReportRevision increments the revision number

type ReportExecutionService

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

ReportExecutionService handles report execution logic

func NewReportExecutionService

func NewReportExecutionService(schemaMetadataService *SchemaMetadataService) *ReportExecutionService

NewReportExecutionService creates a new report execution service

func (*ReportExecutionService) ExecuteReport

func (s *ReportExecutionService) ExecuteReport(
	ctx context.Context,
	report *schema.ReportDocument,
	request ExecutionRequest,
	executedBy string,
) (*ExecutionResult, error)

ExecuteReport executes a report and returns the results

type ReportGenerationRequest

type ReportGenerationRequest struct {
	Question   string                   `json:"question"`
	SQL        string                   `json:"sql"`
	Data       []map[string]interface{} `json:"data"`
	ReportName string                   `json:"report_name,omitempty"`
}

ReportGenerationRequest represents a request to generate a report from data

type ReportGenerationResponse

type ReportGenerationResponse struct {
	Title       string                    `json:"title"`
	Description string                    `json:"description"`
	Components  []ComponentRecommendation `json:"components"`
	Insights    []string                  `json:"insights"`
}

ReportGenerationResponse represents the AI-generated report structure

type ReportService

type ReportService struct {
	DB *gorm.DB
}

ReportService handles report business logic

func NewReportService

func NewReportService(db *gorm.DB) *ReportService

NewReportService creates a new report service

func (*ReportService) AddComponent

func (s *ReportService) AddComponent(component *models.ReportComponent) error

AddComponent adds a component to a report

func (*ReportService) AddDatasource

func (s *ReportService) AddDatasource(datasource *models.ReportDatasource) error

AddDatasource adds a datasource to a report

func (*ReportService) AddParameter

func (s *ReportService) AddParameter(parameter *models.ReportParameter) error

AddParameter adds a parameter to a report

func (*ReportService) CreateExecution

func (s *ReportService) CreateExecution(execution *models.ReportExecution) error

CreateExecution creates a new execution record

func (*ReportService) CreateFromTemplate

func (s *ReportService) CreateFromTemplate(templateID, userID string) (*models.Report, error)

CreateFromTemplate creates a report from a template

func (*ReportService) CreateReport

func (s *ReportService) CreateReport(report *models.Report) error

CreateReport creates a new report

func (*ReportService) DeleteComponent

func (s *ReportService) DeleteComponent(id string) error

DeleteComponent deletes a component

func (*ReportService) DeleteDatasource

func (s *ReportService) DeleteDatasource(id string) error

DeleteDatasource deletes a datasource

func (*ReportService) DeleteParameter

func (s *ReportService) DeleteParameter(id string) error

DeleteParameter deletes a parameter

func (*ReportService) DeleteReport

func (s *ReportService) DeleteReport(id string) error

DeleteReport soft deletes a report

func (*ReportService) DuplicateReport

func (s *ReportService) DuplicateReport(reportID, userID string) (*models.Report, error)

DuplicateReport creates a copy of an existing report

func (*ReportService) ExecuteReportQuery

func (s *ReportService) ExecuteReportQuery(reportID string, parameters map[string]interface{}) (map[string]interface{}, error)

ExecuteReportQuery executes all datasource queries for a report

func (*ReportService) GetAllComponents

func (s *ReportService) GetAllComponents(reportID string) ([]models.ReportComponent, error)

GetAllComponents retrieves all components for a report (including invisible)

func (*ReportService) GetComponents

func (s *ReportService) GetComponents(reportID string) ([]models.ReportComponent, error)

GetComponents retrieves all visible components for a report

func (*ReportService) GetDatasources

func (s *ReportService) GetDatasources(reportID string) ([]models.ReportDatasource, error)

GetDatasources retrieves all datasources for a report

func (*ReportService) GetExecutionHistory

func (s *ReportService) GetExecutionHistory(reportID string, limit int) ([]models.ReportExecution, error)

GetExecutionHistory retrieves execution history for a report

func (*ReportService) GetParameters

func (s *ReportService) GetParameters(reportID string) ([]models.ReportParameter, error)

GetParameters retrieves all parameters for a report

func (*ReportService) GetReportByID

func (s *ReportService) GetReportByID(id string) (*models.Report, error)

GetReportByID retrieves a report by ID with all relationships

func (*ReportService) GetShareByToken

func (s *ReportService) GetShareByToken(token string) (*models.ReportShare, error)

GetShareByToken retrieves a share by token

func (*ReportService) GetShares

func (s *ReportService) GetShares(reportID string) ([]models.ReportShare, error)

GetShares retrieves all shares for a report

func (*ReportService) GetTemplateByID

func (s *ReportService) GetTemplateByID(id string) (*models.ReportTemplate, error)

GetTemplateByID retrieves a template by ID

func (*ReportService) HardDeleteReport

func (s *ReportService) HardDeleteReport(id string) error

HardDeleteReport permanently deletes a report

func (*ReportService) ListReports

func (s *ReportService) ListReports(userID string, isPublic bool, reportType string, page, pageSize int) ([]models.Report, int64, error)

ListReports retrieves reports with pagination and filtering

func (*ReportService) ListTemplates

func (s *ReportService) ListTemplates(category string, isPublic bool) ([]models.ReportTemplate, error)

ListTemplates retrieves report templates

func (*ReportService) RevokeShare

func (s *ReportService) RevokeShare(id string) error

RevokeShare deactivates a share

func (*ReportService) SearchReports

func (s *ReportService) SearchReports(keyword string, userID string, limit int) ([]models.Report, error)

SearchReports searches reports by name or description

func (*ReportService) ShareReport

func (s *ReportService) ShareReport(share *models.ReportShare) error

ShareReport creates a share record

func (*ReportService) UpdateComponent

func (s *ReportService) UpdateComponent(id string, updates map[string]interface{}) error

UpdateComponent updates a component

func (*ReportService) UpdateDatasource

func (s *ReportService) UpdateDatasource(id string, updates map[string]interface{}) error

UpdateDatasource updates a datasource

func (*ReportService) UpdateExecution

func (s *ReportService) UpdateExecution(id string, updates map[string]interface{}) error

UpdateExecution updates an execution record

func (*ReportService) UpdateLastExecutedAt

func (s *ReportService) UpdateLastExecutedAt(reportID string) error

UpdateLastExecutedAt updates the last execution timestamp

func (*ReportService) UpdateParameter

func (s *ReportService) UpdateParameter(id string, updates map[string]interface{}) error

UpdateParameter updates a parameter

func (*ReportService) UpdateReport

func (s *ReportService) UpdateReport(id string, updates map[string]interface{}) error

UpdateReport updates an existing report

type Resource

type Resource struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
	Role string `json:"role"`
}

Resource represents a manufacturing resource

type SandboxInfo

type SandboxInfo struct {
	RunID     string    `json:"runid"`
	AgentID   string    `json:"agentid"`
	StartedAt time.Time `json:"startedat"`
}

SandboxInfo is a lightweight view returned by ListActive.

type SandboxMessage

type SandboxMessage struct {
	FromAgentID string `json:"fromagentid"`
	FromRunID   string `json:"fromrunid"`
	Topic       string `json:"topic"`
	Payload     string `json:"payload"` // JSON
	ReplyTo     string `json:"replyto"` // optional runID for response routing
}

SandboxMessage is a message sent between agent sandboxes or from external callers.

type ScheduleChange

type ScheduleChange struct {
	TaskID   string      `json:"taskId"`
	Field    string      `json:"field"`
	OldValue interface{} `json:"oldValue"`
	NewValue interface{} `json:"newValue"`
}

ScheduleChange represents a change made during optimization

type SchemaContext

type SchemaContext struct {
	Tables           []AITableInfo        `json:"tables"`
	BusinessEntities []BusinessEntityInfo `json:"business_entities"`
	QueryTemplates   []QueryTemplateInfo  `json:"query_templates"`
	TotalTables      int                  `json:"total_tables"`
	TotalEntities    int                  `json:"total_entities"`
	TotalTemplates   int                  `json:"total_templates"`
}

SchemaContext represents the schema context for AI

type SchemaContextService

type SchemaContextService struct {
	DB                     *gorm.DB
	VectorDB               *gorm.DB
	SchemaEmbeddingService *SchemaEmbeddingService
	// contains filtered or unexported fields
}

SchemaContextService provides schema context for AI chat and report generation Uses vector search to find relevant tables, columns, business entities, and query templates

func NewSchemaContextService

func NewSchemaContextService(db *gorm.DB, openAIKey string) *SchemaContextService

NewSchemaContextService creates a new schema context service

func (*SchemaContextService) FormatSchemaContextForAI

func (s *SchemaContextService) FormatSchemaContextForAI(context *SchemaContext) string

FormatSchemaContextForAI formats the schema context as a string for AI prompt

func (*SchemaContextService) GetSchemaContextByQuery

func (s *SchemaContextService) GetSchemaContextByQuery(ctx context.Context, databaseAlias, naturalLanguageQuery string, maxTables int) (*SchemaContext, error)

GetSchemaContextByQuery retrieves relevant schema context using natural language query Uses vector search to find the most relevant tables, columns, entities, and templates

type SchemaDiscoveryService

type SchemaDiscoveryService interface {
	GetDatabaseMetadata(ctx context.Context, databaseAlias string) ([]models.DatabaseSchemaMetadata, error)
}

SchemaDiscoveryService is an interface for services that can discover database schema

type SchemaEmbeddingService

type SchemaEmbeddingService struct {
	DB                    *gorm.DB
	VectorDB              *gorm.DB // Separate vector database connection
	OpenAIKey             string
	ModelName             string
	ConfigID              int // Default config ID for embeddings in vector tables
	SchemaMetadataService *SchemaMetadataService
	// contains filtered or unexported fields
}

SchemaEmbeddingService handles vector embedding generation and storage for schema elements

func NewSchemaEmbeddingService

func NewSchemaEmbeddingService(db *gorm.DB, openAIKey string) *SchemaEmbeddingService

NewSchemaEmbeddingService creates a new schema embedding service

func (*SchemaEmbeddingService) GenerateAndStoreColumnEmbedding

func (s *SchemaEmbeddingService) GenerateAndStoreColumnEmbedding(ctx context.Context, databaseAlias string, meta *models.DatabaseSchemaMetadata) error

GenerateAndStoreColumnEmbedding generates and stores embedding for a column in database_schema_embeddings

func (*SchemaEmbeddingService) GenerateAndStoreTableEmbedding

func (s *SchemaEmbeddingService) GenerateAndStoreTableEmbedding(ctx context.Context, databaseAlias string, meta *models.DatabaseSchemaMetadata) error

GenerateAndStoreTableEmbedding generates and stores embedding for a table in database_schema_embeddings

func (*SchemaEmbeddingService) GenerateBusinessEntityEmbedding

func (s *SchemaEmbeddingService) GenerateBusinessEntityEmbedding(ctx context.Context, entity *models.BusinessEntity) error

GenerateBusinessEntityEmbedding generates and stores embedding for a business entity

func (*SchemaEmbeddingService) GenerateColumnEmbedding

func (s *SchemaEmbeddingService) GenerateColumnEmbedding(ctx context.Context, metadata *models.DatabaseSchemaMetadata) error

GenerateColumnEmbedding generates and stores embedding for a column metadata entry

func (*SchemaEmbeddingService) GenerateEmbedding

func (s *SchemaEmbeddingService) GenerateEmbedding(ctx context.Context, text string) ([]float64, error)

GenerateEmbedding generates a vector embedding for text using OpenAI

func (*SchemaEmbeddingService) GenerateEmbeddingsForDatabase

func (s *SchemaEmbeddingService) GenerateEmbeddingsForDatabase(ctx context.Context, databaseAlias string) error

GenerateEmbeddingsForDatabase generates embeddings for all schema metadata in a database Stores embeddings in the database_schema_embeddings vector table

func (*SchemaEmbeddingService) GenerateTableEmbedding

func (s *SchemaEmbeddingService) GenerateTableEmbedding(ctx context.Context, metadata *models.DatabaseSchemaMetadata) error

GenerateTableEmbedding generates and stores embedding for a table metadata entry

func (*SchemaEmbeddingService) SearchSimilarBusinessEntities

func (s *SchemaEmbeddingService) SearchSimilarBusinessEntities(ctx context.Context, databaseAlias, query string, limit int) ([]models.BusinessEntity, error)

SearchSimilarBusinessEntities finds business entities similar to the query using vector search

func (*SchemaEmbeddingService) SearchSimilarColumns

func (s *SchemaEmbeddingService) SearchSimilarColumns(ctx context.Context, databaseAlias, query string, limit int) ([]models.DatabaseSchemaMetadata, error)

SearchSimilarColumns finds columns by first doing vector search on tables, then retrieving all columns for those tables This approach ensures we don't miss any columns that might not have embeddings

func (*SchemaEmbeddingService) SearchSimilarTables

func (s *SchemaEmbeddingService) SearchSimilarTables(ctx context.Context, databaseAlias, query string, limit int) ([]models.DatabaseSchemaMetadata, error)

SearchSimilarTables finds tables similar to the query using vector search

type SchemaMetadataService

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

SchemaMetadataService handles database schema discovery and metadata management

func NewSchemaMetadataService

func NewSchemaMetadataService(db *gorm.DB) *SchemaMetadataService

NewSchemaMetadataService creates a new schema metadata service db: The vector database connection for storing/checking embeddings

func (*SchemaMetadataService) DeleteMetadata

func (s *SchemaMetadataService) DeleteMetadata(ctx context.Context, id string) error

DeleteMetadata deletes a metadata entry

func (*SchemaMetadataService) DiscoverDatabaseSchema

func (s *SchemaMetadataService) DiscoverDatabaseSchema(ctx context.Context, databaseAlias, dbName string) error

DiscoverDatabaseSchema discovers all tables and columns in a database

func (*SchemaMetadataService) ExecuteCustomSQL

func (s *SchemaMetadataService) ExecuteCustomSQL(ctx context.Context, databaseAlias string, sqlQuery string) (map[string]interface{}, error)

ExecuteCustomSQL executes a custom SQL query

func (*SchemaMetadataService) ExecuteVisualQuery

func (s *SchemaMetadataService) ExecuteVisualQuery(ctx context.Context, databaseAlias string, visualQuery map[string]interface{}) (map[string]interface{}, error)

ExecuteVisualQuery converts a visual query structure to SQL and executes it

func (*SchemaMetadataService) GetAllDatabases

func (s *SchemaMetadataService) GetAllDatabases(ctx context.Context) ([]string, error)

GetAllDatabases returns a list of all unique database aliases

func (*SchemaMetadataService) GetColumnMetadata

func (s *SchemaMetadataService) GetColumnMetadata(ctx context.Context, databaseAlias, tableName string) ([]models.DatabaseSchemaMetadata, error)

GetColumnMetadata retrieves metadata for all columns in a table IMPORTANT: This dynamically discovers columns from the actual target database Columns are NOT stored or embedded - always retrieved fresh from the database

func (*SchemaMetadataService) GetDatabaseMetadata

func (s *SchemaMetadataService) GetDatabaseMetadata(ctx context.Context, databaseAlias string) ([]models.DatabaseSchemaMetadata, error)

GetDatabaseMetadata retrieves complete metadata (tables and columns) for a database If no metadata exists or existing metadata is incomplete, it automatically discovers and populates it from information_schema

func (*SchemaMetadataService) GetSchemaContext

func (s *SchemaMetadataService) GetSchemaContext(ctx context.Context, databaseAlias string, tableNames []string) (string, error)

GetSchemaContext builds a comprehensive schema context for AI

func (*SchemaMetadataService) GetTableDetail

func (s *SchemaMetadataService) GetTableDetail(ctx context.Context, databaseAlias, tableName, schemaName string) (map[string]interface{}, error)

GetTableDetail retrieves detailed information about a specific table including its columns

func (*SchemaMetadataService) GetTableMetadata

func (s *SchemaMetadataService) GetTableMetadata(ctx context.Context, databaseAlias string) ([]models.DatabaseSchemaMetadata, error)

GetTableMetadata retrieves metadata for all tables in a database IMPORTANT: This dynamically discovers tables from the actual target database and checks the vector database for embeddings (does NOT query stored metadata)

func (*SchemaMetadataService) SearchMetadata

func (s *SchemaMetadataService) SearchMetadata(ctx context.Context, databaseAlias, keyword string) ([]models.DatabaseSchemaMetadata, error)

SearchMetadata searches metadata by keyword

func (*SchemaMetadataService) UpdateMetadata

func (s *SchemaMetadataService) UpdateMetadata(ctx context.Context, id string, description *string) error

UpdateMetadata updates the description for a metadata entry

func (*SchemaMetadataService) ValidateSQL

func (s *SchemaMetadataService) ValidateSQL(ctx context.Context, databaseAlias string, sqlQuery string) (map[string]interface{}, error)

ValidateSQL validates SQL syntax without executing it

type SchemaMetadataServiceMultiDB

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

SchemaMetadataServiceMultiDB provides multi-database schema discovery This is an enhanced version of SchemaMetadataService that supports all database types

func NewSchemaMetadataServiceMultiDB

func NewSchemaMetadataServiceMultiDB(dbHelper *DatabaseHelper, appDB *gorm.DB) *SchemaMetadataServiceMultiDB

NewSchemaMetadataServiceMultiDB creates a new multi-database schema metadata service

func (*SchemaMetadataServiceMultiDB) DiscoverIndexes

func (s *SchemaMetadataServiceMultiDB) DiscoverIndexes(ctx context.Context, databaseAlias, schemaName, tableName string) ([]IndexInfo, error)

DiscoverIndexes discovers all indexes for a specific table

func (*SchemaMetadataServiceMultiDB) DiscoverSchema

func (s *SchemaMetadataServiceMultiDB) DiscoverSchema(ctx context.Context, databaseAlias, schemaName string) error

DiscoverSchema discovers all tables and columns in a user database This method supports all database types (MySQL, PostgreSQL, MSSQL, Oracle)

func (*SchemaMetadataServiceMultiDB) ExecuteQuery

func (s *SchemaMetadataServiceMultiDB) ExecuteQuery(ctx context.Context, databaseAlias, query string, args ...interface{}) (*sql.Rows, error)

ExecuteQuery executes a custom SQL query against a user database This is useful for ad-hoc queries with dialect-aware execution

func (*SchemaMetadataServiceMultiDB) GetColumnMetadata

func (s *SchemaMetadataServiceMultiDB) GetColumnMetadata(ctx context.Context, databaseAlias, tableName string) ([]models.DatabaseSchemaMetadata, error)

GetColumnMetadata retrieves metadata for all columns in a table

func (*SchemaMetadataServiceMultiDB) GetDatabaseMetadata

func (s *SchemaMetadataServiceMultiDB) GetDatabaseMetadata(ctx context.Context, databaseAlias string) ([]models.DatabaseSchemaMetadata, error)

GetDatabaseMetadata retrieves complete metadata (tables and columns) for a database If no metadata exists, it automatically discovers and populates it from the database schema

func (*SchemaMetadataServiceMultiDB) GetSchemaContext

func (s *SchemaMetadataServiceMultiDB) GetSchemaContext(ctx context.Context, databaseAlias string, tableNames []string) (string, error)

GetSchemaContext builds a comprehensive schema context for AI

func (*SchemaMetadataServiceMultiDB) GetTableMetadata

func (s *SchemaMetadataServiceMultiDB) GetTableMetadata(ctx context.Context, databaseAlias string) ([]models.DatabaseSchemaMetadata, error)

GetTableMetadata retrieves metadata for all tables in a database

func (*SchemaMetadataServiceMultiDB) UpdateMetadata

func (s *SchemaMetadataServiceMultiDB) UpdateMetadata(ctx context.Context, id string, description *string) error

UpdateMetadata updates the description for a metadata entry

type SchemaQuery

type SchemaQuery struct {
	Dialect string
	Query   string
}

SchemaQuery represents a database schema discovery query

type ServiceFactory

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

ServiceFactory creates service instances with multi-database support

func NewServiceFactory

func NewServiceFactory(poolManager *dbconn.PoolManager, appDB *gorm.DB) (*ServiceFactory, error)

NewServiceFactory creates a new service factory

func (*ServiceFactory) Close

func (f *ServiceFactory) Close() error

Close closes all database connections (call on shutdown)

func (*ServiceFactory) GetAIEmbeddingService

func (f *ServiceFactory) GetAIEmbeddingService() *AIEmbeddingService

GetAIEmbeddingService returns the AI embedding service

func (*ServiceFactory) GetAppDB

func (f *ServiceFactory) GetAppDB() *gorm.DB

GetAppDB returns the application's GORM database instance

func (*ServiceFactory) GetBusinessEntityService

func (f *ServiceFactory) GetBusinessEntityService() *BusinessEntityService

GetBusinessEntityService returns the business entity service

func (*ServiceFactory) GetDatabaseHelper

func (f *ServiceFactory) GetDatabaseHelper() *DatabaseHelper

GetDatabaseHelper returns the database helper for custom operations

func (*ServiceFactory) GetQueryTemplateService

func (f *ServiceFactory) GetQueryTemplateService() *QueryTemplateService

GetQueryTemplateService returns the query template service

func (*ServiceFactory) GetSchemaMetadataService

func (f *ServiceFactory) GetSchemaMetadataService() *SchemaMetadataService

GetSchemaMetadataService returns the schema metadata service (legacy)

func (*ServiceFactory) GetSchemaMetadataServiceMultiDB

func (f *ServiceFactory) GetSchemaMetadataServiceMultiDB() *SchemaMetadataServiceMultiDB

GetSchemaMetadataServiceMultiDB returns the multi-database schema metadata service

type SimilarMemoryResult

type SimilarMemoryResult struct {
	L0    models.AgentMemory
	L1    models.AgentMemory
	Score float64
}

SimilarMemoryResult holds a matched L1 memory and its similarity score.

type TableColumnInfo

type TableColumnInfo struct {
	Name string
	Type string
}

type TableInfo

type TableInfo struct {
	TableName    string
	TableComment string
	TableSchema  string
}

TableInfo represents table metadata structure

type Task

type Task struct {
	ID               string       `json:"id"`
	Name             string       `json:"name"`
	ResourceIDs      []string     `json:"resourceIds"`
	Start            time.Time    `json:"start"`
	End              time.Time    `json:"end"`
	Progress         int          `json:"progress"`
	Status           string       `json:"status"`
	Description      string       `json:"description"`
	SetupMinutes     int          `json:"setupMinutes,omitempty"`
	CycleTimeMinutes int          `json:"cycleTimeMinutes,omitempty"`
	Requirements     []string     `json:"requirements,omitempty"`
	Badges           []Badge      `json:"badges,omitempty"`
	Dependencies     []Dependency `json:"dependencies,omitempty"`
}

Task represents a production task

type Text2SQLRequest

type Text2SQLRequest struct {
	Question    string `json:"question"`
	DatabaseID  string `json:"database_id"`
	AutoExecute bool   `json:"auto_execute"`
	ThreadID    string `json:"thread_id,omitempty"`
}

Text2SQLRequest represents a natural language question

type Text2SQLResponse

type Text2SQLResponse struct {
	SQL         string                   `json:"sql"`
	Explanation string                   `json:"explanation"`
	Confidence  float64                  `json:"confidence"`
	TablesUsed  []string                 `json:"tables_used"`
	ColumnsUsed []string                 `json:"columns_used"`
	Reasoning   string                   `json:"reasoning"`
	QueryType   string                   `json:"query_type"`
	Data        []map[string]interface{} `json:"data,omitempty"`
	RowCount    int                      `json:"row_count,omitempty"`
}

Text2SQLResponse represents the AI-generated SQL

type TextTo3DRequest

type TextTo3DRequest struct {
	Description string `json:"description"`
}

TextTo3DRequest represents a text-to-3D generation request

type TextTo3DResponse

type TextTo3DResponse struct {
	Assets []PlantObject `json:"assets"`
}

TextTo3DResponse represents a text-to-3D generation response

type ThreeDModelAssetService

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

ThreeDModelAssetService handles 3D model asset library management

func NewThreeDModelAssetService

func NewThreeDModelAssetService(docDB documents.DocumentDB) *ThreeDModelAssetService

NewThreeDModelAssetService creates a new 3D model asset service

func (*ThreeDModelAssetService) CreateAsset

CreateAsset creates a new 3D model asset

func (*ThreeDModelAssetService) DeleteAsset

func (s *ThreeDModelAssetService) DeleteAsset(ctx context.Context, id string, user string) error

DeleteAsset deletes a 3D model asset

func (*ThreeDModelAssetService) GetAsset

GetAsset retrieves a 3D model asset by ID

func (*ThreeDModelAssetService) GetPopularAssets

func (s *ThreeDModelAssetService) GetPopularAssets(ctx context.Context, limit int, user string) ([]models.ThreeDModelAsset, error)

GetPopularAssets retrieves the most used assets

func (*ThreeDModelAssetService) IncrementUsageCount

func (s *ThreeDModelAssetService) IncrementUsageCount(ctx context.Context, id string) error

IncrementUsageCount increments the usage count when an asset is used

func (*ThreeDModelAssetService) ListAssets

func (s *ThreeDModelAssetService) ListAssets(ctx context.Context, assetType models.ThreeDModelAssetType, category string, tags []string, publicOnly bool, user string) ([]models.ThreeDModelAsset, error)

ListAssets retrieves all 3D model assets with optional filters

func (*ThreeDModelAssetService) SearchAssets

func (s *ThreeDModelAssetService) SearchAssets(ctx context.Context, query string, user string) ([]models.ThreeDModelAsset, error)

SearchAssets searches 3D model assets by name, description, or tags

func (*ThreeDModelAssetService) UpdateAsset

UpdateAsset updates a 3D model asset

type ThreeDModelService

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

ThreeDModelService handles 3D model storage and version control

func NewThreeDModelService

func NewThreeDModelService(docDB documents.DocumentDB) *ThreeDModelService

NewThreeDModelService creates a new 3D model service

func (*ThreeDModelService) AddExportedFormat

func (s *ThreeDModelService) AddExportedFormat(ctx context.Context, modelID string, format models.ThreeDModelFormat, documentID string) error

AddExportedFormat adds a reference to an exported format document

func (*ThreeDModelService) CreateModel

CreateModel creates a new 3D model with simplified document structure

func (*ThreeDModelService) DeleteModel

func (s *ThreeDModelService) DeleteModel(ctx context.Context, id string) error

DeleteModel soft deletes a 3D model by setting isActive to false

func (*ThreeDModelService) GetModel

func (s *ThreeDModelService) GetModel(ctx context.Context, id string) (*models.ThreeDModel, error)

GetModel retrieves a 3D model by ID with simplified structure

func (*ThreeDModelService) GetModelVersion

func (s *ThreeDModelService) GetModelVersion(ctx context.Context, id string, version int) (*models.ThreeDModelVersion, error)

GetModelVersion retrieves a specific version of a 3D model

func (*ThreeDModelService) ListModelVersions

ListModelVersions retrieves all versions of a 3D model

func (*ThreeDModelService) ListModels

func (s *ThreeDModelService) ListModels(ctx context.Context, category string, tags []string) ([]models.ThreeDModel, error)

ListModels retrieves all active 3D models with simplified structure

func (*ThreeDModelService) SearchModels

func (s *ThreeDModelService) SearchModels(ctx context.Context, query string) ([]models.ThreeDModel, error)

SearchModels searches active 3D models by name, description, or tags

func (*ThreeDModelService) UpdateModel

UpdateModel updates a 3D model with simplified structure

type ToolDefinition

type ToolDefinition struct {
	Type     string          `json:"type"` // always "function"
	Function ToolFunctionDef `json:"function"`
}

ToolDefinition is the JSON schema passed to the LLM for function calling

type ToolFunctionDef

type ToolFunctionDef struct {
	Name        string              `json:"name"`
	Description string              `json:"description"`
	Parameters  ToolParameterSchema `json:"parameters"`
}

type ToolHandler

type ToolHandler func(ctx context.Context, args map[string]interface{}) (string, error)

ToolHandler is a function that executes a tool with JSON args and returns a string result

type ToolParameterSchema

type ToolParameterSchema struct {
	Type       string                        `json:"type"` // always "object"
	Properties map[string]ToolPropertySchema `json:"properties"`
	Required   []string                      `json:"required,omitempty"`
}

type ToolPropertySchema

type ToolPropertySchema struct {
	Type        string `json:"type"`
	Description string `json:"description"`
}

type TransactionHandler

type TransactionHandler interface {
	CanHandle(ctx context.Context, intent string, editorType string) bool
	Handle(ctx context.Context, request *AIAgencyRequest, conversation *ConversationContext) (*AIAgencyResponse, error)
	GetName() string
}

TransactionHandler interface for specialized handlers

type UpdateAgentRequest

type UpdateAgentRequest struct {
	Name               *string         `json:"name"`
	Description        *string         `json:"description"`
	Avatar             *string         `json:"avatar"`
	ModelProvider      *string         `json:"modelprovider"`
	ModelName          *string         `json:"modelname"`
	SystemPrompt       *string         `json:"systemprompt"`
	SkillNames         []string        `json:"skillnames"`
	MCPServerIDs       []string        `json:"mcpserverids"`
	MaxIterations      *int            `json:"maxiterations"`
	Temperature        *float64        `json:"temperature"`
	IsDefault          *bool           `json:"isdefault"`
	Enabled            *bool           `json:"enabled"`
	RunInstance        *string         `json:"runinstance"`
	NotificationConfig models.JSONBMap `json:"notificationconfig"`
}

UpdateAgentRequest holds updatable fields for an agent. nil slice = no change; empty slice = remove all assignments.

type UpdateMCPServerRequest

type UpdateMCPServerRequest struct {
	Name          *string           `json:"name"`
	Description   *string           `json:"description"`
	TransportType *string           `json:"transporttype"`
	URL           *string           `json:"url"`
	MCPPath       *string           `json:"mcppath"`
	Command       *string           `json:"command"`
	Args          []string          `json:"args"`
	Headers       map[string]string `json:"headers"`
	Enabled       *bool             `json:"enabled"`
}

type UpdateMemoryRequest

type UpdateMemoryRequest struct {
	Title         *string  `json:"title"`
	Summary       *string  `json:"summary"`
	Content       *string  `json:"content"`
	ContentType   *string  `json:"contenttype"`
	Tags          []string `json:"tags"`
	Layer         *string  `json:"layer"`
	Priority      *string  `json:"priority"`
	RetentionType *string  `json:"retentiontype"`
	RetentionDays *int     `json:"retentiondays"`
	ExpiresAt     *string  `json:"expiresat"`
}

UpdateMemoryRequest is the payload for updating an existing memory item.

type UpdateSkillRequest

type UpdateSkillRequest struct {
	DisplayName *string `json:"displayname"`
	Description *string `json:"description"`
	Category    *string `json:"category"`
}

type ViewGenerationHandler

type ViewGenerationHandler struct {
	OpenAIKey   string
	OpenAIModel string
	// contains filtered or unexported fields
}

ViewGenerationHandler handles view structure generation

func (*ViewGenerationHandler) CanHandle

func (h *ViewGenerationHandler) CanHandle(ctx context.Context, intent string, editorType string) bool

func (*ViewGenerationHandler) GetName

func (h *ViewGenerationHandler) GetName() string

func (*ViewGenerationHandler) Handle

type VisualQuery

type VisualQuery struct {
	Tables  []string            `json:"tables"`
	Fields  []VisualQueryField  `json:"fields"`
	Filters []VisualQueryFilter `json:"filters,omitempty"`
	Joins   []VisualQueryJoin   `json:"joins,omitempty"`
	Sorts   []VisualQuerySort   `json:"sorts,omitempty"`
	GroupBy []string            `json:"groupBy,omitempty"`
	Limit   int                 `json:"limit,omitempty"`
	Offset  int                 `json:"offset,omitempty"`
}

VisualQuery represents the complete visual query structure

func ParseVisualQuery

func ParseVisualQuery(queryMap map[string]interface{}) (*VisualQuery, error)

ParseVisualQuery parses a visual query map into structured VisualQuery

func (*VisualQuery) GenerateSQL

func (vq *VisualQuery) GenerateSQL() (string, []interface{}, error)

GenerateSQL generates SQL from a visual query

type VisualQueryField

type VisualQueryField struct {
	Table       string `json:"table"`
	Column      string `json:"column"`
	Alias       string `json:"alias,omitempty"`
	Aggregation string `json:"aggregation,omitempty"` // SUM, AVG, COUNT, MAX, MIN
}

VisualQueryField represents a field in the visual query

type VisualQueryFilter

type VisualQueryFilter struct {
	Field    string      `json:"field"`
	Operator string      `json:"operator"` // =, !=, >, <, >=, <=, LIKE, IN, BETWEEN
	Value    interface{} `json:"value"`
	Logic    string      `json:"logic,omitempty"` // AND, OR
}

VisualQueryFilter represents a filter condition

type VisualQueryJoin

type VisualQueryJoin struct {
	Type        string `json:"type"` // INNER, LEFT, RIGHT, FULL
	Table       string `json:"table"`
	LeftColumn  string `json:"leftColumn"`
	RightColumn string `json:"rightColumn"`
}

VisualQueryJoin represents a table join

type VisualQuerySort

type VisualQuerySort struct {
	Field     string `json:"field"`
	Direction string `json:"direction"` // ASC, DESC
}

VisualQuerySort represents a sort order

type VisualizationSpec

type VisualizationSpec struct {
	Type        string            `json:"type"` // bar, line, pie, table, area, scatter
	Title       string            `json:"title"`
	Description string            `json:"description,omitempty"`
	XAxis       string            `json:"x_axis,omitempty"`
	YAxis       string            `json:"y_axis,omitempty"`
	YAxisMulti  []string          `json:"y_axis_multi,omitempty"`
	GroupBy     string            `json:"group_by,omitempty"`
	Config      map[string]string `json:"config,omitempty"`
}

VisualizationSpec defines a recommended chart/visualization

type WhiteboardGenerationHandler

type WhiteboardGenerationHandler struct {
	OpenAIKey   string
	OpenAIModel string
	// contains filtered or unexported fields
}

WhiteboardGenerationHandler handles whiteboard structure generation

func (*WhiteboardGenerationHandler) CanHandle

func (h *WhiteboardGenerationHandler) CanHandle(ctx context.Context, intent string, editorType string) bool

func (*WhiteboardGenerationHandler) GetName

func (h *WhiteboardGenerationHandler) GetName() string

func (*WhiteboardGenerationHandler) Handle

type WorkInstructionService

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

WorkInstructionService handles work instruction operations

func NewWorkInstructionService

func NewWorkInstructionService(docDB documents.DocumentDB, serverURL string) *WorkInstructionService

NewWorkInstructionService creates a new work instruction service

func (*WorkInstructionService) ChangeStatus

func (wis *WorkInstructionService) ChangeStatus(ctx context.Context, id string, status models.InstructionStatus, user string) error

ChangeStatus updates the status of a work instruction

func (*WorkInstructionService) CreateWorkInstruction

CreateWorkInstruction creates a new work instruction

func (*WorkInstructionService) DeleteWorkInstruction

func (wis *WorkInstructionService) DeleteWorkInstruction(ctx context.Context, id string) error

DeleteWorkInstruction deletes a work instruction by ID

func (*WorkInstructionService) DuplicateWorkInstruction

func (wis *WorkInstructionService) DuplicateWorkInstruction(ctx context.Context, id string, user string) (*models.WorkInstruction, error)

DuplicateWorkInstruction creates a copy of an existing work instruction

func (*WorkInstructionService) GetByStatus

GetByStatus retrieves work instructions by status

func (*WorkInstructionService) GetWorkInstruction

func (wis *WorkInstructionService) GetWorkInstruction(ctx context.Context, id string) (*models.WorkInstruction, error)

GetWorkInstruction retrieves a work instruction by ID

func (*WorkInstructionService) ListWorkInstructions

func (wis *WorkInstructionService) ListWorkInstructions(ctx context.Context) ([]models.WorkInstruction, error)

ListWorkInstructions retrieves all work instructions

func (*WorkInstructionService) SearchWorkInstructions

func (wis *WorkInstructionService) SearchWorkInstructions(ctx context.Context, query string) ([]models.WorkInstruction, error)

SearchWorkInstructions searches work instructions by title, part number, or tags

func (*WorkInstructionService) UpdateWorkInstruction

UpdateWorkInstruction updates an existing work instruction

type WorkflowGenerationHandler

type WorkflowGenerationHandler struct {
	OpenAIKey   string
	OpenAIModel string
	// contains filtered or unexported fields
}

WorkflowGenerationHandler handles workflow structure generation

func (*WorkflowGenerationHandler) CanHandle

func (h *WorkflowGenerationHandler) CanHandle(ctx context.Context, intent string, editorType string) bool

func (*WorkflowGenerationHandler) GetName

func (h *WorkflowGenerationHandler) GetName() string

func (*WorkflowGenerationHandler) Handle

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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