Documentation
¶
Index ¶
- func AddPermissionsToContext(ctx context.Context, perms *permissions.Config) context.Context
- func CreateFilterFromJSONString(filterString string) (thehive.InputQueryNamedOperation, error)
- func ExpandEntitiesWithQueries(ctx context.Context, entityType string, entities []map[string]interface{}, ...) ([]map[string]interface{}, error)
- func GetAttachmentsFromAlertID(ctx context.Context, client *thehive.APIClient, alertID string) ([]map[string]interface{}, error)
- func GetAttachmentsFromCaseID(ctx context.Context, client *thehive.APIClient, caseID string) ([]map[string]interface{}, error)
- func GetCommentsFromAlertID(ctx context.Context, client *thehive.APIClient, alertID string) ([]map[string]interface{}, error)
- func GetCommentsFromCaseID(ctx context.Context, client *thehive.APIClient, caseID string) ([]map[string]interface{}, error)
- func GetHiveClientFromContext(ctx context.Context) (*thehive.APIClient, error)
- func GetJSONFields(v interface{}) []string
- func GetModelCompletion(ctx context.Context, messages []mcp.PromptMessage, target interface{}) error
- func GetObservablesFromAlertID(ctx context.Context, client *thehive.APIClient, alertID string) ([]map[string]interface{}, error)
- func GetObservablesFromCaseID(ctx context.Context, client *thehive.APIClient, caseID string) ([]map[string]interface{}, error)
- func GetOpenaiModelCompletion(ctx context.Context, messages []openai.ChatCompletionMessage, ...) error
- func GetPagesFromAlertID(ctx context.Context, client *thehive.APIClient, alertID string) ([]map[string]interface{}, error)
- func GetPagesFromCaseID(ctx context.Context, client *thehive.APIClient, caseID string) ([]map[string]interface{}, error)
- func GetPermissionsFromContext(ctx context.Context) (*permissions.Config, error)
- func GetSamplingModelCompletion(ctx context.Context, messages []mcp.PromptMessage, target interface{}) error
- func GetSupportedQueries(entityType string) []string
- func GetTaskLogsFromTaskID(ctx context.Context, client *thehive.APIClient, taskID string) ([]map[string]interface{}, error)
- func GetTasksFromCaseID(ctx context.Context, client *thehive.APIClient, caseID string) ([]map[string]interface{}, error)
- func InitOpenai(options *types.TheHiveMcpDefaultOptions)
- func NewToolResultJSONUnescaped(data interface{}) *mcp.CallToolResult
- func ParseDateFields(entity map[string]interface{}) (map[string]interface{}, error)
- func PerformAdditionalQueries(ctx context.Context, entityType string, entities []map[string]interface{}, ...) (map[string][]interface{}, error)
- func TranslateDatesToTimestamps(filterMap map[string]interface{}) map[string]interface{}
- func ValidateQuery(entityType, queryName string) error
- type ElicitationTransport
- type EntityQueryConfig
- type OpenAIWrapper
- type QueryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPermissionsToContext ¶
AddPermissionsToContext adds permissions configuration to the context
func CreateFilterFromJSONString ¶
func CreateFilterFromJSONString(filterString string) (thehive.InputQueryNamedOperation, error)
func ExpandEntitiesWithQueries ¶
func ExpandEntitiesWithQueries( ctx context.Context, entityType string, entities []map[string]interface{}, additionalQueries []string, ) ([]map[string]interface{}, error)
ExpandEntitiesWithQueries expands each entity with its related data inline
func GetCommentsFromAlertID ¶
func GetCommentsFromCaseID ¶
func GetJSONFields ¶
func GetJSONFields(v interface{}) []string
func GetModelCompletion ¶
func GetModelCompletion(ctx context.Context, messages []mcp.PromptMessage, target interface{}) error
func GetObservablesFromAlertID ¶
func GetObservablesFromAlertID(ctx context.Context, client *thehive.APIClient, alertID string) ([]map[string]interface{}, error)
Alert-related functions
func GetOpenaiModelCompletion ¶
func GetOpenaiModelCompletion( ctx context.Context, messages []openai.ChatCompletionMessage, target interface{}, ) error
GetOpenaiModelCompletion uses the globally initialized OpenAI wrapper
func GetPagesFromAlertID ¶
func GetPagesFromCaseID ¶
func GetPermissionsFromContext ¶
func GetPermissionsFromContext(ctx context.Context) (*permissions.Config, error)
GetPermissionsFromContext retrieves permissions configuration from the context
func GetSamplingModelCompletion ¶
func GetSamplingModelCompletion(ctx context.Context, messages []mcp.PromptMessage, target interface{}) error
func GetSupportedQueries ¶
GetSupportedQueries returns the list of supported queries for an entity type
func GetTaskLogsFromTaskID ¶
func GetTaskLogsFromTaskID(ctx context.Context, client *thehive.APIClient, taskID string) ([]map[string]interface{}, error)
Task-related functions
func GetTasksFromCaseID ¶
func GetTasksFromCaseID(ctx context.Context, client *thehive.APIClient, caseID string) ([]map[string]interface{}, error)
Case-related functions
func InitOpenai ¶
func InitOpenai(options *types.TheHiveMcpDefaultOptions)
InitOpenai initializes the global OpenAI wrapper with configuration from options If OpenAI configuration is missing, it logs warnings but does not return errors
func NewToolResultJSONUnescaped ¶
func NewToolResultJSONUnescaped(data interface{}) *mcp.CallToolResult
NewToolResultJSONUnescaped creates a new MCP tool result with proper UTF-8 encoding without escaping non-ASCII characters. This fixes issues where Unicode characters like emojis and accented characters get escaped (e.g., ✅ becomes \u2705).
func ParseDateFields ¶
func PerformAdditionalQueries ¶
func PerformAdditionalQueries( ctx context.Context, entityType string, entities []map[string]interface{}, additionalQueries []string, ) (map[string][]interface{}, error)
PerformAdditionalQueries collects all additional data separately (your original behavior)
func TranslateDatesToTimestamps ¶
Searches the filter map for date strings and converts them to timestamps in milliseconds since epoch.
func ValidateQuery ¶
ValidateQuery checks if a query is supported for an entity type
Types ¶
type ElicitationTransport ¶
type ElicitationTransport struct {
Transport http.RoundTripper
}
ElicitationTransport wraps an http.RoundTripper to add elicitation for modifying operations
type EntityQueryConfig ¶
EntityQueryConfig maps query names to their corresponding query functions