Documentation
¶
Index ¶
- Variables
- func EnsureLocalhostDomains(domains []string) []string
- func EnsureToolsSection(frontmatter map[string]any) map[string]any
- func ExpandIncludes(content, baseDir string, extractTools bool) (string, error)
- func ExpandIncludesForEngines(content, baseDir string) ([]string, error)
- func ExpandIncludesForSafeOutputs(content, baseDir string) ([]string, error)
- func ExpandIncludesWithManifest(content, baseDir string, extractTools bool) (string, []string, error)
- func ExtractFrontmatterString(content string) (string, error)
- func ExtractMarkdown(filePath string) (string, error)
- func ExtractMarkdownContent(content string) (string, error)
- func ExtractMarkdownSection(content, sectionName string) (string, error)
- func ExtractWorkflowNameFromMarkdown(filePath string) (string, error)
- func ExtractYAMLError(err error, frontmatterLineOffset int) (line int, column int, message string)
- func ExtractYamlChunk(yamlContent, key string) (string, error)
- func GetGitHubToken() (string, error)
- func MergeTools(base, additional map[string]any) (map[string]any, error)
- func ProcessImportsFromFrontmatter(frontmatter map[string]any, baseDir string) (mergedTools string, mergedEngines []string, err error)
- func ProcessIncludes(content, baseDir string, extractTools bool) (string, error)
- func ProcessIncludesForEngines(content, baseDir string) ([]string, string, error)
- func ProcessIncludesForSafeOutputs(content, baseDir string) ([]string, string, error)
- func StripANSI(s string) string
- func UpdateWorkflowFrontmatter(workflowPath string, updateFunc func(frontmatter map[string]any) error, ...) error
- func ValidateIncludedFileFrontmatterWithSchema(frontmatter map[string]any) error
- func ValidateIncludedFileFrontmatterWithSchemaAndLocation(frontmatter map[string]any, filePath string) error
- func ValidateMCPConfigWithSchema(mcpConfig map[string]any, toolName string) error
- func ValidateMainWorkflowFrontmatterWithSchema(frontmatter map[string]any) error
- func ValidateMainWorkflowFrontmatterWithSchemaAndLocation(frontmatter map[string]any, filePath string) error
- type FrontmatterResult
- type ImportDirectiveMatch
- type ImportsResult
- type JSONPathInfo
- type JSONPathLocation
- type MCPServerConfig
- type MCPServerInfo
- type NestedSection
- type PathSegment
Constants ¶
This section is empty.
Variables ¶
var IncludeDirectivePattern = regexp.MustCompile(`^(?:@(?:include|import)(\?)?\s+(.+)|{{#import(\?)?\s*:?\s*(.+?)\s*}})$`)
IncludeDirectivePattern matches @include, @import (deprecated), or {{#import (new) directives The colon after #import is optional and ignored if present
var LegacyIncludeDirectivePattern = regexp.MustCompile(`^@(?:include|import)(\?)?\s+(.+)$`)
LegacyIncludeDirectivePattern matches only the deprecated @include and @import directives
Functions ¶
func EnsureLocalhostDomains ¶ added in v0.8.3
EnsureLocalhostDomains ensures that localhost and 127.0.0.1 are always included in the allowed domains list for Playwright, even when custom domains are specified Includes port variations to allow all ports on localhost and 127.0.0.1
func EnsureToolsSection ¶ added in v0.8.3
EnsureToolsSection ensures the tools section exists in frontmatter and returns it
func ExpandIncludes ¶
ExpandIncludes recursively expands @include and @import directives until no more remain This matches the bash expand_includes function behavior
func ExpandIncludesForEngines ¶ added in v0.5.1
ExpandIncludesForEngines recursively expands @include and @import directives to extract engine configurations
func ExpandIncludesForSafeOutputs ¶ added in v0.14.1
ExpandIncludesForSafeOutputs recursively expands @include and @import directives to extract safe-outputs configurations
func ExpandIncludesWithManifest ¶ added in v0.14.1
func ExpandIncludesWithManifest(content, baseDir string, extractTools bool) (string, []string, error)
ExpandIncludesWithManifest recursively expands @include and @import directives and returns list of included files
func ExtractFrontmatterString ¶
ExtractFrontmatterString extracts only the YAML frontmatter as a string This matches the bash extract_frontmatter function
func ExtractMarkdown ¶
ExtractMarkdown extracts markdown content from a file (excluding frontmatter) This matches the bash extract_markdown function
func ExtractMarkdownContent ¶
ExtractMarkdownContent extracts only the markdown content (excluding frontmatter) This matches the bash extract_markdown function
func ExtractMarkdownSection ¶
ExtractMarkdownSection extracts a specific section from markdown content Supports H1-H3 headers and proper nesting (matches bash implementation)
func ExtractWorkflowNameFromMarkdown ¶
ExtractWorkflowNameFromMarkdown extracts workflow name from first H1 header This matches the bash extract_workflow_name_from_markdown function exactly
func ExtractYAMLError ¶
ExtractYAMLError extracts line and column information from YAML parsing errors frontmatterLineOffset is the line number where the frontmatter content begins in the document (1-based) This allows proper line number reporting when frontmatter is not at the beginning of the document
func ExtractYamlChunk ¶
ExtractYamlChunk extracts a specific YAML section with proper indentation handling This matches the bash extract_yaml_chunk function exactly
func GetGitHubToken ¶
GetGitHubToken attempts to get GitHub token from environment or gh CLI
func MergeTools ¶
MergeTools merges two neutral tool configurations. Only supports merging arrays and maps for neutral tools (bash, web-fetch, web-search, edit, mcp-*). Removes all legacy Claude tool merging logic.
func ProcessImportsFromFrontmatter ¶ added in v0.14.1
func ProcessImportsFromFrontmatter(frontmatter map[string]any, baseDir string) (mergedTools string, mergedEngines []string, err error)
ProcessImportsFromFrontmatter processes imports field from frontmatter Returns merged tools and engines from imported files
func ProcessIncludes ¶
ProcessIncludes processes @include, @import (deprecated), and {{#import: directives in markdown content This matches the bash process_includes function behavior
func ProcessIncludesForEngines ¶ added in v0.5.1
ProcessIncludesForEngines processes import directives to extract engine configurations
func ProcessIncludesForSafeOutputs ¶ added in v0.14.1
ProcessIncludesForSafeOutputs processes import directives to extract safe-outputs configurations
func StripANSI ¶
StripANSI removes all ANSI escape sequences from a string This handles: - CSI (Control Sequence Introducer) sequences: \x1b[... - OSC (Operating System Command) sequences: \x1b]...\x07 or \x1b]...\x1b\\ - Simple escape sequences: \x1b followed by a single character
func UpdateWorkflowFrontmatter ¶ added in v0.8.3
func UpdateWorkflowFrontmatter(workflowPath string, updateFunc func(frontmatter map[string]any) error, verbose bool) error
UpdateWorkflowFrontmatter updates the frontmatter of a workflow file using a callback function
func ValidateIncludedFileFrontmatterWithSchema ¶
ValidateIncludedFileFrontmatterWithSchema validates included file frontmatter using JSON schema
func ValidateIncludedFileFrontmatterWithSchemaAndLocation ¶
func ValidateIncludedFileFrontmatterWithSchemaAndLocation(frontmatter map[string]any, filePath string) error
ValidateIncludedFileFrontmatterWithSchemaAndLocation validates included file frontmatter with file location info
func ValidateMCPConfigWithSchema ¶
ValidateMCPConfigWithSchema validates MCP configuration using JSON schema
func ValidateMainWorkflowFrontmatterWithSchema ¶
ValidateMainWorkflowFrontmatterWithSchema validates main workflow frontmatter using JSON schema
Types ¶
type FrontmatterResult ¶
type FrontmatterResult struct {
Frontmatter map[string]any
Markdown string
// Additional fields for error context
FrontmatterLines []string // Original frontmatter lines for error context
FrontmatterStart int // Line number where frontmatter starts (1-based)
}
FrontmatterResult holds parsed frontmatter and markdown content
func ExtractFrontmatterFromContent ¶
func ExtractFrontmatterFromContent(content string) (*FrontmatterResult, error)
ExtractFrontmatterFromContent parses YAML frontmatter from markdown content string
type ImportDirectiveMatch ¶ added in v0.14.1
ImportDirectiveMatch holds the parsed components of an import directive
func ParseImportDirective ¶ added in v0.14.1
func ParseImportDirective(line string) *ImportDirectiveMatch
ParseImportDirective parses an import directive and returns its components
type ImportsResult ¶ added in v0.14.1
type ImportsResult struct {
MergedTools string // Merged tools configuration from all imports
MergedMCPServers string // Merged mcp-servers configuration from all imports
MergedEngines []string // Merged engine configurations from all imports
MergedSafeOutputs []string // Merged safe-outputs configurations from all imports
MergedMarkdown string // Merged markdown content from all imports
MergedSteps string // Merged steps configuration from all imports
MergedRuntimes string // Merged runtimes configuration from all imports
MergedServices string // Merged services configuration from all imports
MergedNetwork string // Merged network configuration from all imports
ImportedFiles []string // List of imported file paths (for manifest)
}
ImportsResult holds the result of processing imports from frontmatter
func ProcessImportsFromFrontmatterWithManifest ¶ added in v0.14.1
func ProcessImportsFromFrontmatterWithManifest(frontmatter map[string]any, baseDir string) (*ImportsResult, error)
ProcessImportsFromFrontmatterWithManifest processes imports field from frontmatter Returns result containing merged tools, engines, markdown content, and list of imported files
type JSONPathInfo ¶ added in v0.4.0
type JSONPathInfo struct {
Path string // JSON path like "/tools/1" or "/age"
Message string // Error message
Location []string // Instance location from jsonschema (e.g., ["tools", "1"])
}
JSONPathInfo holds information about a validation error and its path
func ExtractJSONPathFromValidationError ¶ added in v0.4.0
func ExtractJSONPathFromValidationError(err error) []JSONPathInfo
ExtractJSONPathFromValidationError extracts JSON path information from jsonschema validation errors
type JSONPathLocation ¶ added in v0.4.0
JSONPathLocation represents a location in YAML source corresponding to a JSON path
func LocateJSONPathInYAML ¶ added in v0.4.0
func LocateJSONPathInYAML(yamlContent string, jsonPath string) JSONPathLocation
LocateJSONPathInYAML finds the line/column position of a JSON path in YAML source
func LocateJSONPathInYAMLWithAdditionalProperties ¶ added in v0.4.0
func LocateJSONPathInYAMLWithAdditionalProperties(yamlContent string, jsonPath string, errorMessage string) JSONPathLocation
LocateJSONPathInYAMLWithAdditionalProperties finds the line/column position of a JSON path in YAML source with special handling for additional properties errors
type MCPServerConfig ¶
type MCPServerConfig struct {
Name string `json:"name"`
Type string `json:"type"` // stdio, http, docker
Registry string `json:"registry"` // URI to installation location from registry
Command string `json:"command"` // for stdio
Args []string `json:"args"` // for stdio
Container string `json:"container"` // for docker
Version string `json:"version"` // optional version/tag for container
EntrypointArgs []string `json:"entrypointArgs"` // arguments to add after container image
URL string `json:"url"` // for http
Headers map[string]string `json:"headers"` // for http
Env map[string]string `json:"env"` // environment variables
ProxyArgs []string `json:"proxy-args"` // custom proxy arguments for container-based tools
Allowed []string `json:"allowed"` // allowed tools
}
MCPServerConfig represents a parsed MCP server configuration
func ExtractMCPConfigurations ¶
func ExtractMCPConfigurations(frontmatter map[string]any, serverFilter string) ([]MCPServerConfig, error)
ExtractMCPConfigurations extracts MCP server configurations from workflow frontmatter
func ParseMCPConfig ¶
func ParseMCPConfig(toolName string, mcpSection any, toolConfig map[string]any) (MCPServerConfig, error)
ParseMCPConfig parses MCP configuration from various formats (map or JSON string)
type MCPServerInfo ¶
type MCPServerInfo struct {
Config MCPServerConfig
Connected bool
Error error
Tools []*mcp.Tool
Resources []*mcp.Resource
Roots []*mcp.Root
}
MCPServerInfo contains the inspection results for an MCP server
type NestedSection ¶ added in v0.4.0
type NestedSection struct {
// contains filtered or unexported fields
}
NestedSection represents a section of YAML content that corresponds to a nested object
type PathSegment ¶ added in v0.4.0
type PathSegment struct {
Type string // "key" or "index"
Value string // The raw value
Index int // Parsed index for array elements
}
PathSegment represents a segment in a JSON path