tool

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tool implements the application service for the tool bounded context — orchestrates pkg/domain/tool entities and cross-cutting concerns (audit, notifications, RBAC).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkDisableToolsInput

type BulkDisableToolsInput struct {
	TenantID string   `json:"tenant_id" validate:"required,uuid"`
	ToolIDs  []string `json:"tool_ids" validate:"required,min=1,dive,uuid"`
}

BulkDisableToolsInput represents the input for bulk disabling tools.

type BulkEnableToolsInput

type BulkEnableToolsInput struct {
	TenantID string   `json:"tenant_id" validate:"required,uuid"`
	ToolIDs  []string `json:"tool_ids" validate:"required,min=1,dive,uuid"`
}

BulkEnableToolsInput represents the input for bulk enabling tools.

type CategoryService

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

CategoryService handles tool category business operations.

func NewCategoryService

func NewCategoryService(
	repo tooldomcat.Repository,
	toolRepo tooldom.Repository,
	log *logger.Logger,
) *CategoryService

NewCategoryService creates a new CategoryService.

func (*CategoryService) CreateCategory

CreateCategory creates a new tenant custom category.

func (*CategoryService) DeleteCategory

func (s *CategoryService) DeleteCategory(ctx context.Context, tenantID, categoryID string) error

DeleteCategory deletes a tenant custom category.

func (*CategoryService) GetCategory

func (s *CategoryService) GetCategory(ctx context.Context, id string) (*tooldomcat.ToolCategory, error)

GetCategory returns a category by ID.

func (*CategoryService) ListAllCategories

func (s *CategoryService) ListAllCategories(ctx context.Context, tenantID string) ([]*tooldomcat.ToolCategory, error)

ListAllCategories returns all categories for a tenant context (for dropdowns).

func (*CategoryService) ListCategories

ListCategories returns categories matching the filter. Always includes platform (builtin) categories. If TenantID is provided, also includes that tenant's custom categories.

func (*CategoryService) UpdateCategory

UpdateCategory updates an existing tenant custom category.

type CompleteToolExecutionInput

type CompleteToolExecutionInput struct {
	ExecutionID   string         `json:"execution_id" validate:"required,uuid"`
	FindingsCount int            `json:"findings_count"`
	OutputSummary map[string]any `json:"output_summary"`
}

CompleteToolExecutionInput represents the input for completing a tool execution.

type CreateCategoryInput

type CreateCategoryInput struct {
	TenantID    string `json:"-"`
	CreatedBy   string `json:"-"`
	Name        string `json:"name" validate:"required,min=2,max=50"`
	DisplayName string `json:"display_name" validate:"required,max=100"`
	Description string `json:"description" validate:"max=500"`
	Icon        string `json:"icon" validate:"max=50"`
	Color       string `json:"color" validate:"max=20"`
}

CreateCategoryInput represents the input for creating a tenant custom category.

type CreateCustomToolInput

type CreateCustomToolInput struct {
	TenantID         string         `json:"tenant_id" validate:"required,uuid"`
	CreatedBy        string         `json:"created_by" validate:"omitempty,uuid"` // User ID who created the tool
	Name             string         `json:"name" validate:"required,min=1,max=50"`
	DisplayName      string         `json:"display_name" validate:"max=100"`
	Description      string         `json:"description" validate:"max=1000"`
	CategoryID       string         `json:"category_id" validate:"omitempty,uuid"` // UUID of tool_categories
	InstallMethod    string         `json:"install_method" validate:"required,oneof=go pip npm docker binary"`
	InstallCmd       string         `json:"install_cmd" validate:"max=500"`
	UpdateCmd        string         `json:"update_cmd" validate:"max=500"`
	VersionCmd       string         `json:"version_cmd" validate:"max=500"`
	VersionRegex     string         `json:"version_regex" validate:"max=200"`
	ConfigSchema     map[string]any `json:"config_schema"`
	DefaultConfig    map[string]any `json:"default_config"`
	Capabilities     []string       `json:"capabilities" validate:"max=20,dive,max=50"`
	SupportedTargets []string       `json:"supported_targets" validate:"max=10,dive,max=50"`
	OutputFormats    []string       `json:"output_formats" validate:"max=10,dive,max=20"`
	DocsURL          string         `json:"docs_url" validate:"omitempty,url,max=500"`
	GithubURL        string         `json:"github_url" validate:"omitempty,url,max=500"`
	LogoURL          string         `json:"logo_url" validate:"omitempty,url,max=500"`
	Tags             []string       `json:"tags" validate:"max=20,dive,max=50"`
}

CreateCustomToolInput represents the input for creating a tenant custom tool.

type CreateInput

type CreateInput struct {
	Name             string         `json:"name" validate:"required,min=1,max=50"`
	DisplayName      string         `json:"display_name" validate:"max=100"`
	Description      string         `json:"description" validate:"max=1000"`
	CategoryID       string         `json:"category_id" validate:"omitempty,uuid"` // UUID of tool_categories
	InstallMethod    string         `json:"install_method" validate:"required,oneof=go pip npm docker binary"`
	InstallCmd       string         `json:"install_cmd" validate:"max=500"`
	UpdateCmd        string         `json:"update_cmd" validate:"max=500"`
	VersionCmd       string         `json:"version_cmd" validate:"max=500"`
	VersionRegex     string         `json:"version_regex" validate:"max=200"`
	ConfigSchema     map[string]any `json:"config_schema"`
	DefaultConfig    map[string]any `json:"default_config"`
	Capabilities     []string       `json:"capabilities" validate:"max=20,dive,max=50"`
	SupportedTargets []string       `json:"supported_targets" validate:"max=10,dive,max=50"`
	OutputFormats    []string       `json:"output_formats" validate:"max=10,dive,max=20"`
	DocsURL          string         `json:"docs_url" validate:"omitempty,url,max=500"`
	GithubURL        string         `json:"github_url" validate:"omitempty,url,max=500"`
	LogoURL          string         `json:"logo_url" validate:"omitempty,url,max=500"`
	Tags             []string       `json:"tags" validate:"max=20,dive,max=50"`
}

CreateInput represents the input for creating a tool.

type CreateTenantToolConfigInput

type CreateTenantToolConfigInput struct {
	TenantID  string         `json:"tenant_id" validate:"required,uuid"`
	ToolID    string         `json:"tool_id" validate:"required,uuid"`
	Config    map[string]any `json:"config"`
	IsEnabled bool           `json:"is_enabled"`
	UpdatedBy string         `json:"updated_by" validate:"omitempty,uuid"`
}

CreateTenantToolConfigInput represents the input for creating a tenant tool config.

type FailToolExecutionInput

type FailToolExecutionInput struct {
	ExecutionID  string `json:"execution_id" validate:"required,uuid"`
	ErrorMessage string `json:"error_message" validate:"required,max=2000"`
}

FailToolExecutionInput represents the input for failing a tool execution.

type ListAvailableToolsInput

type ListAvailableToolsInput struct {
	TenantID     string   `json:"tenant_id" validate:"required,uuid"`
	Category     string   `json:"category" validate:"omitempty,max=50"` // Category name (dynamic from tool_categories)
	Capabilities []string `json:"capabilities"`
	IsActive     *bool    `json:"is_active"`
	Search       string   `json:"search" validate:"max=255"`
	Tags         []string `json:"tags"`
	Page         int      `json:"page"`
	PerPage      int      `json:"per_page"`
}

ListAvailableToolsInput represents the input for listing all available tools.

type ListCategoriesInput

type ListCategoriesInput struct {
	TenantID  string
	IsBuiltin *bool
	Search    string
	Page      int
	PerPage   int
}

ListCategoriesInput represents the input for listing categories.

type ListCustomToolsInput

type ListCustomToolsInput struct {
	TenantID     string   `json:"tenant_id" validate:"required,uuid"`
	Category     string   `json:"category" validate:"omitempty,max=50"` // Category name (dynamic from tool_categories)
	Capabilities []string `json:"capabilities"`
	IsActive     *bool    `json:"is_active"`
	Search       string   `json:"search" validate:"max=255"`
	Tags         []string `json:"tags"`
	Page         int      `json:"page"`
	PerPage      int      `json:"per_page"`
}

ListCustomToolsInput represents the input for listing tenant custom tools.

type ListInput

type ListInput struct {
	// TenantID is the caller's tenant, set from JWT context — scopes custom-tool visibility.
	TenantID     string   `json:"-"`
	Category     string   `json:"category" validate:"omitempty,max=50"` // Category name (dynamic from tool_categories)
	Capabilities []string `json:"capabilities"`
	IsActive     *bool    `json:"is_active"`
	IsBuiltin    *bool    `json:"is_builtin"`
	Search       string   `json:"search" validate:"max=255"`
	Tags         []string `json:"tags"`
	Page         int      `json:"page"`
	PerPage      int      `json:"per_page"`
}

ListInput represents the input for listing tools.

type ListPlatformToolsInput

type ListPlatformToolsInput struct {
	Category     string   `json:"category" validate:"omitempty,max=50"` // Category name (dynamic from tool_categories)
	Capabilities []string `json:"capabilities"`
	IsActive     *bool    `json:"is_active"`
	Search       string   `json:"search" validate:"max=255"`
	Tags         []string `json:"tags"`
	Page         int      `json:"page"`
	PerPage      int      `json:"per_page"`
}

ListPlatformToolsInput represents the input for listing platform tools.

type ListTenantToolConfigsInput

type ListTenantToolConfigsInput struct {
	TenantID  string `json:"tenant_id" validate:"required,uuid"`
	ToolID    string `json:"tool_id" validate:"omitempty,uuid"`
	IsEnabled *bool  `json:"is_enabled"`
	Page      int    `json:"page"`
	PerPage   int    `json:"per_page"`
}

ListTenantToolConfigsInput represents the input for listing tenant tool configs.

type ListToolExecutionsInput

type ListToolExecutionsInput struct {
	TenantID      string `json:"tenant_id" validate:"required,uuid"`
	ToolID        string `json:"tool_id" validate:"omitempty,uuid"`
	AgentID       string `json:"agent_id" validate:"omitempty,uuid"`
	PipelineRunID string `json:"pipeline_run_id" validate:"omitempty,uuid"`
	Status        string `json:"status" validate:"omitempty,oneof=running completed failed timeout"`
	Page          int    `json:"page"`
	PerPage       int    `json:"per_page"`
}

ListToolExecutionsInput represents the input for listing tool executions.

type ListToolsWithConfigInput

type ListToolsWithConfigInput struct {
	TenantID  string   `json:"tenant_id" validate:"required,uuid"`
	Category  string   `json:"category" validate:"omitempty,max=50"` // Category name (dynamic from tool_categories)
	IsActive  *bool    `json:"is_active"`
	IsBuiltin *bool    `json:"is_builtin"`
	Search    string   `json:"search" validate:"max=255"`
	Tags      []string `json:"tags"`
	Page      int      `json:"page"`
	PerPage   int      `json:"per_page"`
}

ListToolsWithConfigInput represents the input for listing tools with config.

type PipelineDeactivator

type PipelineDeactivator interface {
	// DeactivatePipelinesByTool deactivates all active pipelines using the specified tool.
	// Returns the count of deactivated pipelines and their IDs.
	DeactivatePipelinesByTool(ctx context.Context, toolName string) (int, []shared.ID, error)

	// GetPipelinesUsingTool returns all active pipeline IDs that use a specific tool.
	GetPipelinesUsingTool(ctx context.Context, toolName string) ([]shared.ID, error)
}

PipelineDeactivator interface for cascade deactivation when tools are disabled/deleted. This decouples Service from PipelineService while allowing the cascade behavior.

type RecordToolExecutionInput

type RecordToolExecutionInput struct {
	TenantID      string         `json:"tenant_id" validate:"required,uuid"`
	ToolID        string         `json:"tool_id" validate:"required,uuid"`
	AgentID       string         `json:"agent_id" validate:"omitempty,uuid"`
	PipelineRunID string         `json:"pipeline_run_id" validate:"omitempty,uuid"`
	StepRunID     string         `json:"step_run_id" validate:"omitempty,uuid"`
	InputConfig   map[string]any `json:"input_config"`
	TargetsCount  int            `json:"targets_count"`
}

RecordToolExecutionInput represents the input for recording a tool execution.

type Service

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

Service handles tool registry business operations.

func NewService

func NewService(
	toolRepo tooldom.Repository,
	configRepo tooldom.TenantToolConfigRepository,
	executionRepo tooldom.ToolExecutionRepository,
	log *logger.Logger,
) *Service

NewService creates a new Service.

func (*Service) ActivateCustomTool

func (s *Service) ActivateCustomTool(ctx context.Context, tenantID, toolID string) (*tooldom.Tool, error)

ActivateCustomTool activates a tenant custom tool.

func (*Service) ActivateTool

func (s *Service) ActivateTool(ctx context.Context, tenantID, toolID string) (*tooldom.Tool, error)

ActivateTool activates a tool. tenantID scopes the mutation: like UpdateTool and DeleteTool it enforces CanManage, so a tenant can only (de)activate its own custom tools and never a platform tool or another tenant's tool.

func (*Service) BulkDisableTools

func (s *Service) BulkDisableTools(ctx context.Context, input BulkDisableToolsInput) error

BulkDisableTools disables multiple tools for a tenant.

func (*Service) BulkEnableTools

func (s *Service) BulkEnableTools(ctx context.Context, input BulkEnableToolsInput) error

BulkEnableTools enables multiple tools for a tenant.

func (*Service) CompleteToolExecution

func (s *Service) CompleteToolExecution(ctx context.Context, input CompleteToolExecutionInput) (*tooldom.ToolExecution, error)

CompleteToolExecution marks a tool execution as completed.

func (*Service) CreateCustomTool

func (s *Service) CreateCustomTool(ctx context.Context, input CreateCustomToolInput) (*tooldom.Tool, error)

CreateCustomTool creates a new tenant custom tool.

func (*Service) CreateTenantToolConfig

func (s *Service) CreateTenantToolConfig(ctx context.Context, input CreateTenantToolConfigInput) (*tooldom.TenantToolConfig, error)

CreateTenantToolConfig creates a new tenant tool configuration.

func (*Service) CreateTool

func (s *Service) CreateTool(ctx context.Context, input CreateInput) (*tooldom.Tool, error)

CreateTool creates a new tool in the registry.

func (*Service) DeactivateCustomTool

func (s *Service) DeactivateCustomTool(ctx context.Context, tenantID, toolID string) (*tooldom.Tool, error)

DeactivateCustomTool deactivates a tenant custom tool. Also cascade deactivates any active pipelines that use this tool.

func (*Service) DeactivateTool

func (s *Service) DeactivateTool(ctx context.Context, tenantID, toolID string) (*tooldom.Tool, error)

DeactivateTool deactivates a tool. Also cascade deactivates any active pipelines that use this tool.

func (*Service) DeleteCustomTool

func (s *Service) DeleteCustomTool(ctx context.Context, tenantID, toolID string) error

DeleteCustomTool deletes a tenant custom tool. Before deleting, cascade deactivates any active pipelines that use this tool.

func (*Service) DeleteTenantToolConfig

func (s *Service) DeleteTenantToolConfig(ctx context.Context, tenantID, toolID string) error

DeleteTenantToolConfig deletes a tenant tool configuration.

func (*Service) DeleteTool

func (s *Service) DeleteTool(ctx context.Context, tenantID, toolID string) error

DeleteTool deletes a tool from the registry. Before deleting, cascade deactivates any active pipelines that use this tool.

func (*Service) DisableToolForTenant

func (s *Service) DisableToolForTenant(ctx context.Context, tenantID, toolID string) error

DisableToolForTenant disables a tool for a tenant.

func (*Service) EnableToolForTenant

func (s *Service) EnableToolForTenant(ctx context.Context, tenantID, toolID string) error

EnableToolForTenant enables a tool for a tenant.

func (*Service) FailToolExecution

func (s *Service) FailToolExecution(ctx context.Context, input FailToolExecutionInput) (*tooldom.ToolExecution, error)

FailToolExecution marks a tool execution as failed.

func (*Service) GetCustomTool

func (s *Service) GetCustomTool(ctx context.Context, tenantID, toolID string) (*tooldom.Tool, error)

GetCustomTool retrieves a tenant custom tool.

func (*Service) GetEffectiveToolConfig

func (s *Service) GetEffectiveToolConfig(ctx context.Context, tenantID, toolID string) (map[string]any, error)

GetEffectiveToolConfig retrieves the effective (merged) configuration for a tool.

func (*Service) GetTenantToolConfig

func (s *Service) GetTenantToolConfig(ctx context.Context, tenantID, toolID string) (*tooldom.TenantToolConfig, error)

GetTenantToolConfig retrieves a tenant tool configuration.

func (*Service) GetTenantToolStats

func (s *Service) GetTenantToolStats(ctx context.Context, tenantID string, days int) (*tooldom.TenantToolStats, error)

GetTenantToolStats retrieves aggregated tool statistics for a tenant.

func (*Service) GetTool

func (s *Service) GetTool(ctx context.Context, toolID string) (*tooldom.Tool, error)

GetTool retrieves a tool by ID.

func (*Service) GetToolByName

func (s *Service) GetToolByName(ctx context.Context, name string) (*tooldom.Tool, error)

GetToolByName retrieves a tool by name.

func (*Service) GetToolStats

func (s *Service) GetToolStats(ctx context.Context, tenantID, toolID string, days int) (*tooldom.ToolStats, error)

GetToolStats retrieves statistics for a specific tool.

func (*Service) GetToolWithConfig

func (s *Service) GetToolWithConfig(ctx context.Context, tenantID, toolID string) (*tooldom.ToolWithConfig, error)

GetToolWithConfig retrieves a tool with its tenant-specific configuration.

func (*Service) ListAvailableTools

func (s *Service) ListAvailableTools(ctx context.Context, input ListAvailableToolsInput) (pagination.Result[*tooldom.Tool], error)

ListAvailableTools lists all tools available to a tenant (platform + custom).

func (*Service) ListCustomTools

func (s *Service) ListCustomTools(ctx context.Context, input ListCustomToolsInput) (pagination.Result[*tooldom.Tool], error)

ListCustomTools lists tenant's custom tools.

func (*Service) ListEnabledToolsForTenant

func (s *Service) ListEnabledToolsForTenant(ctx context.Context, tenantID string) ([]*tooldom.TenantToolConfig, error)

ListEnabledToolsForTenant lists all enabled tools for a tenant.

func (*Service) ListPlatformTools

func (s *Service) ListPlatformTools(ctx context.Context, input ListPlatformToolsInput) (pagination.Result[*tooldom.Tool], error)

ListPlatformTools lists platform tools (system-provided, available to all tenants).

func (*Service) ListTenantToolConfigs

ListTenantToolConfigs lists tenant tool configurations.

func (*Service) ListToolExecutions

ListToolExecutions lists tool executions with filters.

func (*Service) ListTools

func (s *Service) ListTools(ctx context.Context, input ListInput) (pagination.Result[*tooldom.Tool], error)

ListTools lists tools with filters, scoped to the caller's tenant.

The tools table holds both platform tools (tenant_id IS NULL) and every tenant's private custom tools. Without a tenant scope this endpoint returned ALL tenants' custom tools. It is now restricted to platform tools + the caller's own custom tools; a zero tenant fails closed.

func (*Service) ListToolsByCapability

func (s *Service) ListToolsByCapability(ctx context.Context, capability string) ([]*tooldom.Tool, error)

ListToolsByCapability lists tools by capability.

func (*Service) ListToolsByCategory

func (s *Service) ListToolsByCategory(ctx context.Context, category string) ([]*tooldom.Tool, error)

ListToolsByCategory lists tools by category name.

func (*Service) ListToolsWithConfig

ListToolsWithConfig lists tools with their tenant-specific config.

func (*Service) RecordToolExecution

func (s *Service) RecordToolExecution(ctx context.Context, input RecordToolExecutionInput) (*tooldom.ToolExecution, error)

RecordToolExecution records a new tool execution.

func (*Service) SetAgentRepo

func (s *Service) SetAgentRepo(repo agent.Repository)

SetAgentRepo sets the agent repository for tool availability checks. This is optional - if not set, IsAvailable will always be true.

func (*Service) SetCategoryRepo

func (s *Service) SetCategoryRepo(repo tooldomcat.Repository)

SetCategoryRepo sets the category repository for fetching category info. This is optional - if not set, Category will be nil in responses.

func (*Service) SetPipelineDeactivator

func (s *Service) SetPipelineDeactivator(deactivator PipelineDeactivator)

SetPipelineDeactivator sets the pipeline deactivator for cascade deactivation. This is optional - if not set, pipelines will not be auto-deactivated when tools are disabled.

func (*Service) TimeoutToolExecution

func (s *Service) TimeoutToolExecution(ctx context.Context, executionID string) (*tooldom.ToolExecution, error)

TimeoutToolExecution marks a tool execution as timed out.

func (*Service) UpdateCustomTool

func (s *Service) UpdateCustomTool(ctx context.Context, input UpdateCustomToolInput) (*tooldom.Tool, error)

UpdateCustomTool updates a tenant custom tool.

func (*Service) UpdateTenantToolConfig

func (s *Service) UpdateTenantToolConfig(ctx context.Context, input UpdateTenantToolConfigInput) (*tooldom.TenantToolConfig, error)

UpdateTenantToolConfig updates a tenant tool configuration (upsert).

func (*Service) UpdateTool

func (s *Service) UpdateTool(ctx context.Context, input UpdateInput) (*tooldom.Tool, error)

UpdateTool updates an existing tool.

func (*Service) UpdateToolVersion

func (s *Service) UpdateToolVersion(ctx context.Context, input UpdateToolVersionInput) (*tooldom.Tool, error)

UpdateToolVersion updates the version information of a tool.

type UpdateCategoryInput

type UpdateCategoryInput struct {
	TenantID    string `json:"-"`
	ID          string `json:"-"`
	DisplayName string `json:"display_name" validate:"required,max=100"`
	Description string `json:"description" validate:"max=500"`
	Icon        string `json:"icon" validate:"max=50"`
	Color       string `json:"color" validate:"max=20"`
}

UpdateCategoryInput represents the input for updating a category.

type UpdateCustomToolInput

type UpdateCustomToolInput struct {
	TenantID         string         `json:"tenant_id" validate:"required,uuid"`
	ToolID           string         `json:"tool_id" validate:"required,uuid"`
	DisplayName      string         `json:"display_name" validate:"max=100"`
	Description      string         `json:"description" validate:"max=1000"`
	InstallCmd       string         `json:"install_cmd" validate:"max=500"`
	UpdateCmd        string         `json:"update_cmd" validate:"max=500"`
	VersionCmd       string         `json:"version_cmd" validate:"max=500"`
	VersionRegex     string         `json:"version_regex" validate:"max=200"`
	ConfigSchema     map[string]any `json:"config_schema"`
	DefaultConfig    map[string]any `json:"default_config"`
	Capabilities     []string       `json:"capabilities" validate:"max=20,dive,max=50"`
	SupportedTargets []string       `json:"supported_targets" validate:"max=10,dive,max=50"`
	OutputFormats    []string       `json:"output_formats" validate:"max=10,dive,max=20"`
	DocsURL          string         `json:"docs_url" validate:"omitempty,url,max=500"`
	GithubURL        string         `json:"github_url" validate:"omitempty,url,max=500"`
	LogoURL          string         `json:"logo_url" validate:"omitempty,url,max=500"`
	Tags             []string       `json:"tags" validate:"max=20,dive,max=50"`
}

UpdateCustomToolInput represents the input for updating a tenant custom tool.

type UpdateInput

type UpdateInput struct {
	ToolID           string         `json:"tool_id" validate:"required,uuid"`
	TenantID         string         `json:"-"` // set from the JWT tenant context, not the body
	DisplayName      string         `json:"display_name" validate:"max=100"`
	Description      string         `json:"description" validate:"max=1000"`
	InstallCmd       string         `json:"install_cmd" validate:"max=500"`
	UpdateCmd        string         `json:"update_cmd" validate:"max=500"`
	VersionCmd       string         `json:"version_cmd" validate:"max=500"`
	VersionRegex     string         `json:"version_regex" validate:"max=200"`
	ConfigSchema     map[string]any `json:"config_schema"`
	DefaultConfig    map[string]any `json:"default_config"`
	Capabilities     []string       `json:"capabilities" validate:"max=20,dive,max=50"`
	SupportedTargets []string       `json:"supported_targets" validate:"max=10,dive,max=50"`
	OutputFormats    []string       `json:"output_formats" validate:"max=10,dive,max=20"`
	DocsURL          string         `json:"docs_url" validate:"omitempty,url,max=500"`
	GithubURL        string         `json:"github_url" validate:"omitempty,url,max=500"`
	LogoURL          string         `json:"logo_url" validate:"omitempty,url,max=500"`
	Tags             []string       `json:"tags" validate:"max=20,dive,max=50"`
}

UpdateInput represents the input for updating a tool.

type UpdateTenantToolConfigInput

type UpdateTenantToolConfigInput struct {
	TenantID  string         `json:"tenant_id" validate:"required,uuid"`
	ToolID    string         `json:"tool_id" validate:"required,uuid"`
	Config    map[string]any `json:"config"`
	IsEnabled bool           `json:"is_enabled"`
	UpdatedBy string         `json:"updated_by" validate:"omitempty,uuid"`
}

UpdateTenantToolConfigInput represents the input for updating a tenant tool config.

type UpdateToolVersionInput

type UpdateToolVersionInput struct {
	ToolID         string `json:"tool_id" validate:"required,uuid"`
	CurrentVersion string `json:"current_version" validate:"max=50"`
	LatestVersion  string `json:"latest_version" validate:"max=50"`
}

UpdateToolVersionInput represents the input for updating tool version.

Jump to

Keyboard shortcuts

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