utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExemptionRow

func BuildExemptionRow(e stogenerated.FrontendExemption, userNameMap map[string]string) map[string]interface{}

buildExemptionRow creates a table row from an STO exemption

func BuildIssueRow

func BuildIssueRow(issue stogenerated.AllIssueSummary) map[string]interface{}

buildIssueRow creates a table row from an STO issue

func SetCCMResponseFormatter

func SetCCMResponseFormatter(formatter CCMResponseFormatter)

SetCCMResponseFormatter sets the global CCM response formatter

func SetScsResponseFormatter

func SetScsResponseFormatter(formatter ScsResponseFormatter)

SetResponseFormatter sets the global response formatter

func SetStoResponseFormatter

func SetStoResponseFormatter(formatter StoResponseFormatter)

SetStoResponseFormatter sets the global STO response formatter

Types

type CCMResponseFormatter

type CCMResponseFormatter interface {
	FormatEC2AnalysisResponse(response *dto.CommitmentEC2AnalysisResponse) ([]mcp.Content, error)
}

ResponseFormatter defines the interface for formatting tool responses

var DefaultCCMResponseFormatter CCMResponseFormatter

DefaultCCMResponseFormatter holds the active response formatter implementation

type ScsResponseFormatter

type ScsResponseFormatter interface {
	// FormatArtifactSourcesResponse formats the artifact sources response
	// Receives raw artifact data and returns formatted MCP content
	// Internal mode can create custom rows/columns, external mode returns JSON
	FormatArtifactSourcesResponse(artifacts []generated.ArtifactV2ListingResponse, licenseFilterList *[]generated.LicenseFilter) ([]mcp.Content, error)
	// FormatCodeRepositoriesResponse formats code repositories as table events
	FormatCodeRepositoriesResponse(repositories []generated.CodeRepositoryListingResponse) ([]mcp.Content, error)
}

ResponseFormatter defines the interface for formatting tool responses Different implementations can be used for external (text) vs internal (table events) modes

var DefaultScsResponseFormatter ScsResponseFormatter

DefaultResponseFormatter holds the active response formatter implementation This should be set during initialization based on deployment mode

type StoResponseFormatter

type StoResponseFormatter interface {
	// FormatStoIssuesResponse formats STO security issues
	FormatStoIssuesResponse(response *stogenerated.FrontendAllIssuesListResponseBody) ([]mcp.Content, error)
	// FormatStoExemptionsResponse formats STO global exemptions with user info
	FormatStoExemptionsResponse(response *stogenerated.SecurityReviewResult, userNameMap map[string]string) ([]mcp.Content, error)
}

StoResponseFormatter defines the interface for formatting STO tool responses Different implementations can be used for external (text) vs internal (table events) modes

var DefaultStoResponseFormatter StoResponseFormatter

DefaultStoResponseFormatter holds the active STO response formatter implementation This should be set during initialization based on deployment mode

Jump to

Keyboard shortcuts

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