cli

package
v0.33.7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 53 Imported by: 0

Documentation

Overview

Package cli provides command-line interface functionality for gh-aw. This file (logs_command.go) contains the CLI command definition for the logs command.

Key responsibilities:

  • Defining the Cobra command structure and flags for gh aw logs
  • Parsing command-line arguments and flags
  • Validating inputs (workflow names, dates, engine parameters)
  • Delegating execution to the orchestrator (DownloadWorkflowLogs)

Package cli provides command-line interface functionality for gh-aw. This file (logs_display.go) contains functions for displaying workflow logs information to the console, including summary tables and metrics.

Key responsibilities:

  • Rendering workflow logs overview tables
  • Formatting metrics for display (duration, tokens, cost)
  • Aggregating totals across multiple runs

Package cli provides command-line interface functionality for gh-aw. This file (logs_download.go) contains functions for downloading and extracting GitHub Actions workflow artifacts and logs.

Key responsibilities:

  • Downloading workflow run artifacts via gh CLI
  • Extracting and organizing zip archives
  • Flattening single-file artifact directories
  • Managing local file system operations

Package cli provides command-line interface functionality for gh-aw. This file (logs_github_api.go) contains functions for interacting with the GitHub API to fetch workflow runs, job statuses, and job details.

Key responsibilities:

  • Listing workflow runs with pagination
  • Fetching job statuses and details for workflow runs
  • Handling GitHub CLI authentication and error responses

Package cli provides command-line interface functionality for gh-aw. This file (logs_metrics.go) contains functions for extracting and analyzing metrics from workflow execution logs.

Key responsibilities:

  • Extracting token usage, cost, and turn metrics from logs
  • Identifying missing tools requested by AI agents
  • Detecting MCP (Model Context Protocol) server failures
  • Aggregating metrics across multiple log files
  • Processing structured output from agent execution

Package cli provides command-line interface functionality for gh-aw. This file (logs_orchestrator.go) contains the main orchestration logic for downloading and processing workflow logs from GitHub Actions.

Key responsibilities:

  • Coordinating the main download workflow (DownloadWorkflowLogs)
  • Managing pagination and iteration through workflow runs
  • Concurrent downloading of artifacts from multiple runs
  • Applying filters (engine, firewall, staged, campaign, etc.)
  • Building and rendering output (console, JSON, tool graphs)

Package cli provides command-line interface functionality for gh-aw. This file (logs_parsing.go) contains functions for parsing and analyzing workflow logs from various AI engines.

Key responsibilities:

  • Parsing engine-specific log formats (Claude, Copilot, Codex, Custom)
  • Extracting engine configuration from aw_info.json
  • Locating agent log files and output artifacts
  • Parsing firewall logs and generating summaries
  • Running JavaScript parsers to generate markdown reports

Package cli provides command-line interface functionality for gh-aw. This file (logs_utils.go) contains utility functions used by the logs command.

Key responsibilities:

  • Discovering agentic workflow names from .lock.yml files
  • Utility functions for slice operations

Package cli contains MCP (Model Context Protocol) validation functions. This file consolidates validation logic for MCP server configurations.

Index

Constants

View Source
const (
	ZizmorImage     = "ghcr.io/zizmorcore/zizmor:latest"
	PoutineImage    = "ghcr.io/boostsecurityio/poutine:latest"
	ActionlintImage = "rhysd/actionlint:latest"
)

DockerImages defines the Docker images used by the compile tool's static analysis scanners

View Source
const (
	// MaxIterations limits how many batches we fetch to prevent infinite loops
	MaxIterations = 20
	// BatchSize is the number of runs to fetch in each iteration
	BatchSize = 100
	// BatchSizeForAllWorkflows is the larger batch size when searching for agentic workflows
	// There can be a really large number of workflow runs in a repository, so
	// we are generous in the batch size when used without qualification.
	BatchSizeForAllWorkflows = 250
	// MaxConcurrentDownloads limits the number of parallel artifact downloads
	MaxConcurrentDownloads = 10
)

Constants for the iterative algorithm

View Source
const (
	MCPConnectTimeout    = 10 * time.Second // Timeout for establishing MCP server connections
	MCPOperationTimeout  = 5 * time.Second  // Timeout for MCP operations (ListTools, ListResources)
	MCPServerHTTPTimeout = 30 * time.Minute // Timeout for HTTP server session
)

MCP timeout constants

View Source
const (
	// DefaultMaxMCPLogsOutputTokens is the default maximum number of tokens for MCP logs output
	// before triggering the guardrail (12000 tokens)
	DefaultMaxMCPLogsOutputTokens = 12000

	// CharsPerToken is the approximate number of characters per token
	// Using OpenAI's rule of thumb: ~4 characters per token
	CharsPerToken = 4
)
View Source
const (
	StatusActive   = "active"
	StatusInactive = "inactive"
)

Status constants for server status

View Source
const (
	ArgumentTypePositional = "positional"
)

Argument type constants

View Source
const WorkflowIDExplanation = `` /* 183-byte string literal not displayed */

WorkflowIDExplanation describes what a workflow-id is and accepted formats. This text is shared across multiple commands to ensure consistency.

Variables

View Source
var ErrNoArtifacts = errors.New("no artifacts found for this run")

ErrNoArtifacts indicates that a workflow run has no artifacts

Functions

func ActionsBuildCommand added in v0.32.2

func ActionsBuildCommand() error

ActionsBuildCommand builds all custom GitHub Actions by bundling JavaScript dependencies

func ActionsCleanCommand added in v0.32.2

func ActionsCleanCommand() error

ActionsCleanCommand removes generated index.js files from all actions

func ActionsValidateCommand added in v0.32.2

func ActionsValidateCommand() error

ActionsValidateCommand validates all action.yml files

func AddMCPTool added in v0.8.3

func AddMCPTool(workflowFile string, mcpServerID string, registryURL string, transportType string, customToolID string, verbose bool) error

AddMCPTool adds an MCP tool to an agentic workflow

func AddWorkflows added in v0.2.7

func AddWorkflows(workflows []string, number int, verbose bool, engineOverride string, name string, force bool, appendText string, createPR bool, noGitattributes bool, workflowDir string, noStopAfter bool, stopAfter string) error

AddWorkflows adds one or more workflows from components to .github/workflows with optional repository installation and PR creation

func ApplyJqFilter added in v0.20.0

func ApplyJqFilter(jsonInput string, jqFilter string) (string, error)

ApplyJqFilter applies a jq filter to JSON input

func AuditWorkflowRun added in v0.12.1

func AuditWorkflowRun(runID int64, owner, repo, hostname string, outputDir string, verbose bool, parse bool, jsonOutput bool) error

AuditWorkflowRun audits a single workflow run and generates a report

func AutoMergePullRequestsCreatedAfter added in v0.22.1

func AutoMergePullRequestsCreatedAfter(repoSlug string, createdAfter time.Time, verbose bool) error

AutoMergePullRequestsCreatedAfter checks for open PRs in the repository created after a specific time and auto-merges them This function filters PRs to only those created after the specified time to avoid merging unrelated PRs

func AutoMergePullRequestsLegacy added in v0.22.1

func AutoMergePullRequestsLegacy(repoSlug string, verbose bool) error

AutoMergePullRequestsLegacy is the legacy function that auto-merges all open PRs (used by trial command for backward compatibility)

func CheckAndPrepareDockerImages added in v0.31.2

func CheckAndPrepareDockerImages(useZizmor, usePoutine, useActionlint bool) error

CheckAndPrepareDockerImages checks if required Docker images are available for the requested static analysis tools. If any are not available, it starts downloading them and returns a message indicating the LLM should retry.

Returns:

  • nil if all required images are available
  • error with retry message if any images are downloading or need to be downloaded

func ClearCurrentRepoSlugCache added in v0.26.0

func ClearCurrentRepoSlugCache()

ClearCurrentRepoSlugCache clears the current repository slug cache This is useful for testing or when repository context might have changed

func CompileWorkflowDataWithValidation added in v0.25.0

func CompileWorkflowDataWithValidation(compiler *workflow.Compiler, workflowData *workflow.WorkflowData, filePath string, verbose bool, runZizmorPerFile bool, runPoutinePerFile bool, runActionlintPerFile bool, strict bool, validateActionSHAs bool) error

CompileWorkflowDataWithValidation compiles from already-parsed WorkflowData with validation This avoids re-parsing when the workflow data has already been parsed

func CompileWorkflowWithValidation added in v0.5.1

func CompileWorkflowWithValidation(compiler *workflow.Compiler, filePath string, verbose bool, runZizmorPerFile bool, runPoutinePerFile bool, runActionlintPerFile bool, strict bool, validateActionSHAs bool) error

CompileWorkflowWithValidation compiles a workflow with always-on YAML validation for CLI usage

func CompileWorkflows

func CompileWorkflows(config CompileConfig) ([]*workflow.WorkflowData, error)

CompileWorkflows compiles workflows based on the provided configuration

func CompleteDirectories added in v0.31.4

func CompleteDirectories(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteDirectories provides shell completion for directory paths

func CompleteEngineNames added in v0.31.4

func CompleteEngineNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteEngineNames provides shell completion for engine names (--engine flag)

func CompleteMCPServerNames added in v0.31.4

func CompleteMCPServerNames(workflowFile string) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteMCPServerNames provides shell completion for MCP server names If a workflow is specified, it returns the MCP servers defined in that workflow

func CompleteWorkflowNames added in v0.31.4

func CompleteWorkflowNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteWorkflowNames provides shell completion for workflow names It returns workflow IDs (basenames without .md extension) from .github/workflows/

func CreateWorkflowInteractively added in v0.8.3

func CreateWorkflowInteractively(workflowName string, verbose bool, force bool) error

CreateWorkflowInteractively prompts the user to build a workflow interactively

func DisableAllWorkflowsExcept added in v0.29.0

func DisableAllWorkflowsExcept(repoSlug string, exceptWorkflows []string, verbose bool) error

DisableAllWorkflowsExcept disables all workflows except the specified ones Typically used to disable all workflows except the one being trialled

func DisableWorkflows deprecated

func DisableWorkflows(pattern string) error

Deprecated: Use DisableWorkflowsByNames with specific workflow names instead DisableWorkflows disables workflows matching a pattern (legacy function for tests)

func DisableWorkflowsByNames added in v0.19.0

func DisableWorkflowsByNames(workflowNames []string, repoOverride string) error

DisableWorkflowsByNames disables workflows by specific names, or all if no names provided

func DownloadWorkflowLogs

func DownloadWorkflowLogs(workflowName string, count int, startDate, endDate, outputDir, engine, ref string, beforeRunID, afterRunID int64, repoOverride string, verbose bool, toolGraph bool, noStaged bool, firewallOnly bool, noFirewall bool, parse bool, jsonOutput bool, timeout int, campaignOnly bool, summaryFile string) error

DownloadWorkflowLogs downloads and analyzes workflow logs with metrics

func EnableWorkflows deprecated

func EnableWorkflows(pattern string) error

Deprecated: Use EnableWorkflowsByNames with specific workflow names instead EnableWorkflows enables workflows matching a pattern (legacy function for tests)

func EnableWorkflowsByNames added in v0.19.0

func EnableWorkflowsByNames(workflowNames []string, repoOverride string) error

EnableWorkflowsByNames enables workflows by specific names, or all if no names provided

func ExecuteWithRepeat added in v0.22.0

func ExecuteWithRepeat(options RepeatOptions) error

ExecuteWithRepeat runs a function once, and optionally repeats it the specified number of times with graceful signal handling for shutdown.

func ExtractLogMetricsFromRun added in v0.6.0

func ExtractLogMetricsFromRun(processedRun ProcessedRun) workflow.LogMetrics

ExtractLogMetricsFromRun extracts log metrics from a processed run's log directory

func ExtractWorkflowDescription added in v0.30.0

func ExtractWorkflowDescription(content string) string

ExtractWorkflowDescription extracts the description field from workflow content string

func ExtractWorkflowDescriptionFromFile added in v0.30.0

func ExtractWorkflowDescriptionFromFile(filePath string) string

ExtractWorkflowDescriptionFromFile extracts the description field from a workflow file

func GenerateActionMetadataCommand added in v0.32.2

func GenerateActionMetadataCommand() error

GenerateActionMetadataCommand generates action.yml and README.md files for JavaScript modules

func GenerateOutputSchema added in v0.21.0

func GenerateOutputSchema[T any]() (*jsonschema.Schema, error)

GenerateOutputSchema generates a JSON schema from a Go struct type for MCP tool outputs. This helper uses the github.com/google/jsonschema-go package to automatically generate schemas from Go types, leveraging struct tags for descriptions and constraints.

The schema is generated with default options which respect: - json tags for field names - jsonschema tags for descriptions and constraints - omitempty to mark optional fields

Example usage:

type MyOutput struct {
    Name  string `json:"name" jsonschema:"description=Name of the item"`
    Count int    `json:"count,omitempty" jsonschema:"description=Number of items"`
}

schema, err := GenerateOutputSchema[MyOutput]()
tool := &mcp.Tool{
    Name:         "my-tool",
    Description:  "My tool description",
    OutputSchema: schema,
}

func GetCurrentRepoSlug added in v0.22.1

func GetCurrentRepoSlug() (string, error)

GetCurrentRepoSlug gets the current repository slug with caching using sync.Once This is the recommended function to use for repository access across the codebase

func GetVersion

func GetVersion() string

GetVersion returns the current version

func InitRepository added in v0.11.0

func InitRepository(verbose bool, mcp bool, campaign bool, tokens bool, engine string, codespaceRepos []string, codespaceEnabled bool) error

InitRepository initializes the repository for agentic workflows

func InspectWorkflowMCP

func InspectWorkflowMCP(workflowFile string, serverFilter string, toolFilter string, verbose bool, useActionsSecrets bool) error

InspectWorkflowMCP inspects MCP servers used by a workflow and lists available tools, resources, and roots

func InstallPackage

func InstallPackage(repoSpec string, verbose bool) error

InstallPackage installs agentic workflows from a GitHub repository

func IsDockerImageAvailable added in v0.31.2

func IsDockerImageAvailable(image string) bool

IsDockerImageAvailable checks if a Docker image is available locally

func IsDockerImageDownloading added in v0.31.2

func IsDockerImageDownloading(image string) bool

IsDockerImageDownloading checks if a Docker image is currently being downloaded

func IsRunnable

func IsRunnable(markdownPath string) (bool, error)

IsRunnable checks if a workflow can be run (has schedule or workflow_dispatch trigger)

func IsRunningInCI added in v0.8.3

func IsRunningInCI() bool

IsRunningInCI checks if we're running in a CI environment

func ListToolsForMCP added in v0.10.0

func ListToolsForMCP(workflowFile string, mcpServerName string, verbose bool) error

ListToolsForMCP lists available tools for a specific MCP server

func ListWorkflowMCP added in v0.7.1

func ListWorkflowMCP(workflowFile string, verbose bool) error

ListWorkflowMCP lists MCP servers defined in a workflow

func MergeWorkflowContent added in v0.21.0

func MergeWorkflowContent(base, current, new, oldSourceSpec, newRef string, verbose bool) (string, bool, error)

MergeWorkflowContent performs a 3-way merge of workflow content using git merge-file It returns the merged content, whether conflicts exist, and any error

func NewAddCommand added in v0.8.3

func NewAddCommand(validateEngine func(string) error) *cobra.Command

NewAddCommand creates the add command

func NewAuditCommand added in v0.12.1

func NewAuditCommand() *cobra.Command

NewAuditCommand creates the audit command

func NewFixCommand added in v0.33.0

func NewFixCommand() *cobra.Command

NewFixCommand creates the fix command

func NewInitCommand added in v0.18.2

func NewInitCommand() *cobra.Command

NewInitCommand creates the init command

func NewLogsCommand

func NewLogsCommand() *cobra.Command

NewLogsCommand creates the logs command

func NewMCPAddSubcommand added in v0.8.3

func NewMCPAddSubcommand() *cobra.Command

NewMCPAddSubcommand creates the mcp add subcommand

func NewMCPCommand added in v0.6.3

func NewMCPCommand() *cobra.Command

NewMCPCommand creates the main mcp command with subcommands

func NewMCPInspectSubcommand added in v0.6.3

func NewMCPInspectSubcommand() *cobra.Command

NewMCPInspectSubcommand creates the mcp inspect subcommand This is the former mcp inspect command now nested under mcp

func NewMCPListSubcommand added in v0.7.1

func NewMCPListSubcommand() *cobra.Command

NewMCPListSubcommand creates the mcp list subcommand

func NewMCPListToolsSubcommand added in v0.10.0

func NewMCPListToolsSubcommand() *cobra.Command

NewMCPListToolsSubcommand creates the mcp list-tools subcommand

func NewMCPServerCommand added in v0.16.0

func NewMCPServerCommand() *cobra.Command

NewMCPServerCommand creates the mcp-server command

func NewPRCommand added in v0.22.2

func NewPRCommand() *cobra.Command

NewPRCommand creates the main pr command with subcommands

func NewPRTransferSubcommand added in v0.22.2

func NewPRTransferSubcommand() *cobra.Command

NewPRTransferSubcommand creates the pr transfer subcommand

func NewSecretsCommand added in v0.33.1

func NewSecretsCommand() *cobra.Command

NewSecretsCommand creates the main secrets command with subcommands

func NewStatusCommand added in v0.20.0

func NewStatusCommand() *cobra.Command

NewStatusCommand creates the status command

func NewTrialCommand added in v0.12.0

func NewTrialCommand(validateEngine func(string) error) *cobra.Command

NewTrialCommand creates the trial command

func NewUpdateCommand added in v0.14.0

func NewUpdateCommand(validateEngine func(string) error) *cobra.Command

NewUpdateCommand creates the update command

func NewWorkflow

func NewWorkflow(workflowName string, verbose bool, force bool) error

NewWorkflow creates a new workflow markdown file with template content

func NormalizeWorkflowFile added in v0.8.3

func NormalizeWorkflowFile(workflowFile string) string

NormalizeWorkflowFile normalizes a workflow file name by adding .md extension if missing

func ParseCopilotAgentLogMetrics added in v0.29.0

func ParseCopilotAgentLogMetrics(logContent string, verbose bool) workflow.LogMetrics

ParseCopilotAgentLogMetrics extracts metrics from GitHub Copilot agent logs This is different from Copilot CLI logs and requires specialized parsing

func PollWithSignalHandling added in v0.29.0

func PollWithSignalHandling(options PollOptions) error

PollWithSignalHandling polls with a function until it succeeds, fails, times out, or receives an interrupt signal This provides a reusable pattern for any operation that needs to poll with graceful Ctrl-C handling

func PrintDockerPullStatus added in v0.31.2

func PrintDockerPullStatus()

PrintDockerPullStatus prints the current pull status to stderr (for debugging)

func RegisterDirFlagCompletion added in v0.31.4

func RegisterDirFlagCompletion(cmd *cobra.Command, flagName string)

RegisterDirFlagCompletion registers completion for directory-type flags on a command

func RegisterEngineFlagCompletion added in v0.31.4

func RegisterEngineFlagCompletion(cmd *cobra.Command)

RegisterEngineFlagCompletion registers completion for the --engine flag on a command

func RemoveFieldFromOnTrigger added in v0.29.0

func RemoveFieldFromOnTrigger(content, fieldName string) (string, error)

RemoveFieldFromOnTrigger removes a field from the 'on' trigger object in the frontmatter. This handles nested fields like "stop-after" which are located under the "on" key. It preserves the original formatting of the frontmatter including comments and blank lines.

func RemoveWorkflows

func RemoveWorkflows(pattern string, keepOrphans bool) error

RemoveWorkflows removes workflows matching a pattern

func ResetDockerPullState added in v0.31.2

func ResetDockerPullState()

ResetDockerPullState resets the internal pull state (for testing)

func ResolveWorkflowPath added in v0.8.3

func ResolveWorkflowPath(workflowFile string) (string, error)

ResolveWorkflowPath resolves a workflow file path from various formats: - Absolute path to .md file - Relative path to .md file - Workflow name or subpath (e.g., "a.md" -> ".github/workflows/a.md", "shared/b.md" -> ".github/workflows/shared/b.md")

func RunFix added in v0.33.0

func RunFix(config FixConfig) error

RunFix runs the fix command with the given configuration

func RunWorkflowOnGitHub

func RunWorkflowOnGitHub(workflowIdOrName string, enable bool, engineOverride string, repoOverride string, refOverride string, autoMergePRs bool, pushSecrets bool, waitForCompletion bool, inputs []string, verbose bool) error

RunWorkflowOnGitHub runs an agentic workflow on GitHub Actions

func RunWorkflowTrials added in v0.12.0

func RunWorkflowTrials(workflowSpecs []string, logicalRepoSpec string, cloneRepoSpec string, hostRepoSpec string, deleteHostRepo, forceDeleteHostRepo, quiet bool, timeoutMinutes int, triggerContext string, repeatCount int, autoMergePRs bool, engineOverride string, appendText string, pushSecrets bool, verbose bool) error

RunWorkflowTrials executes the main logic for trialing one or more workflows

func RunWorkflowsOnGitHub added in v0.2.4

func RunWorkflowsOnGitHub(workflowNames []string, repeatCount int, enable bool, engineOverride string, repoOverride string, refOverride string, autoMergePRs bool, pushSecrets bool, inputs []string, verbose bool) error

RunWorkflowsOnGitHub runs multiple agentic workflows on GitHub Actions, optionally repeating a specified number of times

func SetDockerImageDownloading added in v0.31.2

func SetDockerImageDownloading(image string, downloading bool)

SetDockerImageDownloading sets the downloading state for an image (for testing)

func SetFieldInOnTrigger added in v0.29.0

func SetFieldInOnTrigger(content, fieldName, fieldValue string) (string, error)

SetFieldInOnTrigger sets a field value in the 'on' trigger object in the frontmatter. This handles nested fields like "stop-after" which are located under the "on" key. It preserves the original formatting of the frontmatter including comments and blank lines.

func SetMockImageAvailable added in v0.31.2

func SetMockImageAvailable(image string, available bool)

SetMockImageAvailable sets the mock availability for an image (for testing)

func SetVersionInfo

func SetVersionInfo(v string)

SetVersionInfo sets the version information for the CLI

func SplitRepoSlug added in v0.28.7

func SplitRepoSlug(slug string) (owner, repo string, err error)

SplitRepoSlug splits "owner/repo" into owner and repo

func StartDockerImageDownload added in v0.31.2

func StartDockerImageDownload(image string) bool

StartDockerImageDownload starts downloading a Docker image in the background Returns true if download was started, false if already downloading or available

func StatusWorkflows

func StatusWorkflows(pattern string, verbose bool, jsonOutput bool, ref string, labelFilter string) error

func ToGitRootRelativePath added in v0.33.1

func ToGitRootRelativePath(path string) string

ToGitRootRelativePath converts a path to be relative to the git root directory This provides stable paths regardless of the current working directory

func UpdateActions added in v0.32.0

func UpdateActions(allowMajor, verbose bool) error

UpdateActions updates GitHub Actions versions in .github/aw/actions-lock.json It checks each action for newer releases and updates the SHA if a newer version is found

func UpdateFieldInFrontmatter added in v0.21.0

func UpdateFieldInFrontmatter(content, fieldName, fieldValue string) (string, error)

UpdateFieldInFrontmatter updates a field in the frontmatter while preserving the original formatting when possible. It tries to preserve whitespace, comments, and formatting by working with the raw frontmatter lines, similar to how addSourceToWorkflow works.

func UpdateWorkflows added in v0.14.0

func UpdateWorkflows(workflowNames []string, allowMajor, force, verbose bool, engineOverride string, workflowsDir string, noStopAfter bool, stopAfter string, merge bool) error

UpdateWorkflows updates workflows from their source repositories

func UpdateWorkflowsWithExtensionCheck added in v0.19.0

func UpdateWorkflowsWithExtensionCheck(workflowNames []string, allowMajor, force, verbose bool, engineOverride string, createPR bool, workflowsDir string, noStopAfter bool, stopAfter string, merge bool, noActions bool) error

UpdateWorkflowsWithExtensionCheck performs the complete update process: 1. Check for gh-aw extension updates 2. Update GitHub Actions versions (unless --no-actions flag is set) 3. Update workflows from source repositories (compiles each workflow after update) 4. Optionally create a PR

func ValidEngineNames added in v0.31.4

func ValidEngineNames() []string

ValidEngineNames returns the list of valid AI engine names for shell completion

func ValidateMCPServerDockerAvailability added in v0.31.2

func ValidateMCPServerDockerAvailability() error

ValidateMCPServerDockerAvailability validates that Docker is available for MCP server operations that require static analysis tools

func WaitForWorkflowCompletion added in v0.22.1

func WaitForWorkflowCompletion(repoSlug, runID string, timeoutMinutes int, verbose bool) error

WaitForWorkflowCompletion waits for a workflow run to complete, with a specified timeout

Types

type AccessLogEntry added in v0.3.4

type AccessLogEntry struct {
	Timestamp string
	Duration  string
	ClientIP  string
	Status    string
	Size      string
	Method    string
	URL       string
	User      string
	Hierarchy string
	Type      string
}

AccessLogEntry represents a parsed squid access log entry

type AccessLogSummary added in v0.21.0

type AccessLogSummary struct {
	TotalRequests  int                        `json:"total_requests" console:"header:Total Requests"`
	AllowedCount   int                        `json:"allowed_count" console:"header:Allowed"`
	DeniedCount    int                        `json:"denied_count" console:"header:Denied"`
	AllowedDomains []string                   `json:"allowed_domains" console:"-"`
	DeniedDomains  []string                   `json:"denied_domains" console:"-"`
	ByWorkflow     map[string]*DomainAnalysis `json:"by_workflow,omitempty" console:"-"`
}

AccessLogSummary contains aggregated access log analysis

type ActionInput added in v0.32.2

type ActionInput struct {
	Name        string
	Description string
	Required    bool
	Default     string
}

ActionInput represents an input parameter

type ActionMetadata added in v0.32.2

type ActionMetadata struct {
	Name         string
	Description  string
	Filename     string // e.g., "noop.cjs"
	ActionName   string // e.g., "noop"
	Inputs       []ActionInput
	Outputs      []ActionOutput
	Dependencies []string
}

ActionMetadata represents metadata extracted from a JavaScript file

type ActionOutput added in v0.32.2

type ActionOutput struct {
	Name        string
	Description string
}

ActionOutput represents an output parameter

type Argument added in v0.8.3

type Argument struct {
	Type  string `json:"type"`
	Value string `json:"value,omitempty"`
}

Argument represents a command line argument

type AuditData added in v0.21.0

type AuditData struct {
	Overview                OverviewData             `json:"overview"`
	Metrics                 MetricsData              `json:"metrics"`
	KeyFindings             []Finding                `json:"key_findings,omitempty"`
	Recommendations         []Recommendation         `json:"recommendations,omitempty"`
	FailureAnalysis         *FailureAnalysis         `json:"failure_analysis,omitempty"`
	PerformanceMetrics      *PerformanceMetrics      `json:"performance_metrics,omitempty"`
	Jobs                    []JobData                `json:"jobs,omitempty"`
	DownloadedFiles         []FileInfo               `json:"downloaded_files"`
	MissingTools            []MissingToolReport      `json:"missing_tools,omitempty"`
	Noops                   []NoopReport             `json:"noops,omitempty"`
	MCPFailures             []MCPFailureReport       `json:"mcp_failures,omitempty"`
	FirewallAnalysis        *FirewallAnalysis        `json:"firewall_analysis,omitempty"`
	RedactedDomainsAnalysis *RedactedDomainsAnalysis `json:"redacted_domains_analysis,omitempty"`
	Errors                  []ErrorInfo              `json:"errors,omitempty"`
	Warnings                []ErrorInfo              `json:"warnings,omitempty"`
	ToolUsage               []ToolUsageInfo          `json:"tool_usage,omitempty"`
}

AuditData represents the complete structured audit data for a workflow run

type AwInfo added in v0.6.1

type AwInfo struct {
	EngineID        string      `json:"engine_id"`
	EngineName      string      `json:"engine_name"`
	Model           string      `json:"model"`
	Version         string      `json:"version"`
	CLIVersion      string      `json:"cli_version,omitempty"` // gh-aw CLI version
	WorkflowName    string      `json:"workflow_name"`
	Staged          bool        `json:"staged"`
	AwfVersion      string      `json:"awf_version,omitempty"`      // AWF firewall version (new name)
	FirewallVersion string      `json:"firewall_version,omitempty"` // AWF firewall version (old name, for backward compatibility)
	Steps           AwInfoSteps `json:"steps,omitempty"`            // Steps metadata
	CreatedAt       string      `json:"created_at"`
	// Additional fields that might be present
	RunID      any    `json:"run_id,omitempty"`
	RunNumber  any    `json:"run_number,omitempty"`
	Repository string `json:"repository,omitempty"`
}

AwInfo represents the structure of aw_info.json files

func (*AwInfo) GetFirewallVersion added in v0.33.6

func (a *AwInfo) GetFirewallVersion() string

GetFirewallVersion returns the AWF firewall version, preferring the new field name (awf_version) but falling back to the old field name (firewall_version) for backward compatibility with older aw_info.json files.

type AwInfoSteps added in v0.26.0

type AwInfoSteps struct {
	Firewall string `json:"firewall,omitempty"` // Firewall type (e.g., "squid") or empty if no firewall
}

AwInfoSteps represents the steps information in aw_info.json files

type Codemod added in v0.33.0

type Codemod struct {
	ID           string // Unique identifier for the codemod
	Name         string // Human-readable name
	Description  string // Description of what the codemod does
	IntroducedIn string // Version where this codemod was introduced
	Apply        func(content string, frontmatter map[string]any) (string, bool, error)
}

Codemod represents a single code transformation that can be applied to workflow files

func GetAllCodemods added in v0.33.0

func GetAllCodemods() []Codemod

GetAllCodemods returns all available codemods in the registry

type CodemodResult added in v0.33.0

type CodemodResult struct {
	Applied bool   // Whether the codemod was applied
	Message string // Description of what changed
}

CodemodResult represents the result of applying a codemod

type CombinedTrialResult added in v0.12.0

type CombinedTrialResult struct {
	WorkflowNames []string              `json:"workflow_names"`
	Results       []WorkflowTrialResult `json:"results"`
	Timestamp     time.Time             `json:"timestamp"`
}

CombinedTrialResult represents the combined results of multiple workflow trials

type CompilationStats added in v0.22.0

type CompilationStats struct {
	Total           int
	Errors          int
	Warnings        int
	FailedWorkflows []string // Names of workflows that failed compilation
}

CompilationStats tracks the results of workflow compilation

type CompileConfig added in v0.12.0

type CompileConfig struct {
	MarkdownFiles        []string // Files to compile (empty for all files)
	Verbose              bool     // Enable verbose output
	EngineOverride       string   // Override AI engine setting
	Validate             bool     // Enable schema validation
	Watch                bool     // Enable watch mode
	WorkflowDir          string   // Custom workflow directory
	SkipInstructions     bool     // Deprecated: Instructions are no longer written during compilation
	NoEmit               bool     // Validate without generating lock files
	Purge                bool     // Remove orphaned lock files
	TrialMode            bool     // Enable trial mode (suppress safe outputs)
	TrialLogicalRepoSlug string   // Target repository for trial mode
	Strict               bool     // Enable strict mode validation
	Dependabot           bool     // Generate Dependabot manifests for npm dependencies
	ForceOverwrite       bool     // Force overwrite of existing files (dependabot.yml)
	Zizmor               bool     // Run zizmor security scanner on generated .lock.yml files
	Poutine              bool     // Run poutine security scanner on generated .lock.yml files
	Actionlint           bool     // Run actionlint linter on generated .lock.yml files
	JSONOutput           bool     // Output validation results as JSON
	RefreshStopTime      bool     // Force regeneration of stop-after times instead of preserving existing ones
	ActionMode           string   // Action script inlining mode: inline, dev, or release
	Stats                bool     // Display statistics table sorted by file size
}

CompileConfig holds configuration options for compiling workflows

type ContinuationData added in v0.23.0

type ContinuationData struct {
	Message      string `json:"message"`
	WorkflowName string `json:"workflow_name,omitempty"`
	Count        int    `json:"count,omitempty"`
	StartDate    string `json:"start_date,omitempty"`
	EndDate      string `json:"end_date,omitempty"`
	Engine       string `json:"engine,omitempty"`
	Branch       string `json:"branch,omitempty"`
	AfterRunID   int64  `json:"after_run_id,omitempty"`
	BeforeRunID  int64  `json:"before_run_id,omitempty"`
	Timeout      int    `json:"timeout,omitempty"`
}

ContinuationData provides parameters to continue querying when timeout is reached

type CopilotAgentDetector added in v0.29.0

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

CopilotAgentDetector contains heuristics to detect if a workflow run was executed by GitHub Copilot agent

func NewCopilotAgentDetector added in v0.29.0

func NewCopilotAgentDetector(runDir string, verbose bool) *CopilotAgentDetector

NewCopilotAgentDetector creates a new detector for GitHub Copilot agent runs

func NewCopilotAgentDetectorWithPath added in v0.29.0

func NewCopilotAgentDetectorWithPath(runDir string, verbose bool, workflowPath string) *CopilotAgentDetector

NewCopilotAgentDetectorWithPath creates a detector with workflow path hint

func (*CopilotAgentDetector) IsGitHubCopilotAgent added in v0.29.0

func (d *CopilotAgentDetector) IsGitHubCopilotAgent() bool

IsGitHubCopilotAgent uses heuristics to determine if this run was executed by GitHub Copilot agent (not the Copilot CLI engine or agentic workflows)

type CopilotWorkflowStep added in v0.33.4

type CopilotWorkflowStep struct {
	Name string         `yaml:"name,omitempty"`
	Uses string         `yaml:"uses,omitempty"`
	Run  string         `yaml:"run,omitempty"`
	With map[string]any `yaml:"with,omitempty"`
	Env  map[string]any `yaml:"env,omitempty"`
}

CopilotWorkflowStep represents a GitHub Actions workflow step for Copilot setup scaffolding

type DependencyGraph added in v0.32.0

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

DependencyGraph tracks workflow dependencies for efficient recompilation

func NewDependencyGraph added in v0.32.0

func NewDependencyGraph(workflowsDir string) *DependencyGraph

NewDependencyGraph creates a new dependency graph

func (*DependencyGraph) BuildGraph added in v0.32.0

func (g *DependencyGraph) BuildGraph(compiler *workflow.Compiler) error

BuildGraph scans all workflow files and builds the dependency graph

func (*DependencyGraph) GetAffectedWorkflows added in v0.32.0

func (g *DependencyGraph) GetAffectedWorkflows(modifiedPath string) []string

GetAffectedWorkflows returns the list of workflows that need to be recompiled when the given file is modified

func (*DependencyGraph) RemoveWorkflow added in v0.32.0

func (g *DependencyGraph) RemoveWorkflow(workflowPath string)

RemoveWorkflow removes a workflow from the graph (e.g., when deleted)

func (*DependencyGraph) UpdateWorkflow added in v0.32.0

func (g *DependencyGraph) UpdateWorkflow(workflowPath string, compiler *workflow.Compiler) error

UpdateWorkflow updates a workflow in the graph (e.g., after it's been modified)

type DevcontainerCodespaces added in v0.32.2

type DevcontainerCodespaces struct {
	Repositories map[string]DevcontainerRepoPermissions `json:"repositories"`
}

DevcontainerCodespaces represents GitHub Codespaces-specific settings

type DevcontainerConfig added in v0.32.2

type DevcontainerConfig struct {
	Name              string                      `json:"name"`
	Image             string                      `json:"image"`
	Customizations    *DevcontainerCustomizations `json:"customizations,omitempty"`
	Features          DevcontainerFeatures        `json:"features,omitempty"`
	PostCreateCommand string                      `json:"postCreateCommand,omitempty"`
}

DevcontainerConfig represents the structure of devcontainer.json

type DevcontainerCustomizations added in v0.32.2

type DevcontainerCustomizations struct {
	VSCode     *DevcontainerVSCode     `json:"vscode,omitempty"`
	Codespaces *DevcontainerCodespaces `json:"codespaces,omitempty"`
}

DevcontainerCustomizations represents VSCode customizations in devcontainer.json

type DevcontainerFeatures added in v0.32.2

type DevcontainerFeatures map[string]any

DevcontainerFeatures represents features to install in the devcontainer

type DevcontainerRepoPermissions added in v0.32.2

type DevcontainerRepoPermissions struct {
	Permissions map[string]string `json:"permissions"`
}

DevcontainerRepoPermissions represents permissions for a repository

type DevcontainerVSCode added in v0.32.2

type DevcontainerVSCode struct {
	Settings   map[string]any `json:"settings,omitempty"`
	Extensions []string       `json:"extensions,omitempty"`
}

DevcontainerVSCode represents VSCode-specific settings

type DomainAnalysis added in v0.3.4

type DomainAnalysis struct {
	DomainBuckets
	TotalRequests int
	AllowedCount  int
	DeniedCount   int
}

DomainAnalysis represents analysis of domains from access logs

func (*DomainAnalysis) AddMetrics added in v0.28.7

func (d *DomainAnalysis) AddMetrics(other LogAnalysis)

AddMetrics adds metrics from another analysis

type DomainBuckets added in v0.30.0

type DomainBuckets struct {
	AllowedDomains []string
	DeniedDomains  []string
}

DomainBuckets holds allowed and denied domain lists with accessor methods. This struct is embedded by DomainAnalysis and FirewallAnalysis to share domain management functionality and eliminate code duplication.

func (*DomainBuckets) GetAllowedDomains added in v0.30.0

func (d *DomainBuckets) GetAllowedDomains() []string

GetAllowedDomains returns the list of allowed domains

func (*DomainBuckets) GetDeniedDomains added in v0.30.0

func (d *DomainBuckets) GetDeniedDomains() []string

GetDeniedDomains returns the list of denied domains

func (*DomainBuckets) SetAllowedDomains added in v0.30.0

func (d *DomainBuckets) SetAllowedDomains(domains []string)

SetAllowedDomains sets the list of allowed domains

func (*DomainBuckets) SetDeniedDomains added in v0.30.0

func (d *DomainBuckets) SetDeniedDomains(domains []string)

SetDeniedDomains sets the list of denied domains

type DomainRequestStats added in v0.25.0

type DomainRequestStats struct {
	Allowed int
	Denied  int
}

DomainRequestStats tracks request statistics per domain

type DownloadResult added in v0.0.25

type DownloadResult struct {
	Run                     WorkflowRun
	Metrics                 LogMetrics
	AccessAnalysis          *DomainAnalysis
	FirewallAnalysis        *FirewallAnalysis
	RedactedDomainsAnalysis *RedactedDomainsAnalysis
	MissingTools            []MissingToolReport
	Noops                   []NoopReport
	MCPFailures             []MCPFailureReport
	JobDetails              []JobInfoWithDuration
	Error                   error
	Skipped                 bool
	Cached                  bool // True if loaded from cached summary
	LogsPath                string
}

DownloadResult represents the result of downloading and processing a workflow run

type EnvironmentVariable added in v0.8.3

type EnvironmentVariable struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	IsRequired  bool   `json:"is_required,omitempty"`
	IsSecret    bool   `json:"is_secret,omitempty"`
	Default     string `json:"default,omitempty"`
}

EnvironmentVariable represents an environment variable configuration

type ErrorInfo added in v0.21.0

type ErrorInfo struct {
	File    string `json:"file,omitempty"`
	Line    int    `json:"line,omitempty"`
	Type    string `json:"type"`
	Message string `json:"message"`
}

ErrorInfo contains detailed error information

type ErrorSummary added in v0.24.0

type ErrorSummary struct {
	Type         string `json:"type" console:"header:Type"`
	Message      string `json:"message" console:"header:Message,maxlen:80"`
	Count        int    `json:"count" console:"header:Occurrences"`
	Engine       string `json:"engine,omitempty" console:"header:Engine,omitempty"`
	RunID        int64  `json:"run_id" console:"header:Sample Run"`
	RunURL       string `json:"run_url" console:"-"`
	WorkflowName string `json:"workflow_name,omitempty" console:"-"`
	PatternID    string `json:"pattern_id,omitempty" console:"-"`
}

ErrorSummary contains aggregated error/warning statistics

type FailureAnalysis added in v0.30.2

type FailureAnalysis struct {
	PrimaryFailure string   `json:"primary_failure"`      // Main reason for failure
	FailedJobs     []string `json:"failed_jobs"`          // List of failed job names
	ErrorSummary   string   `json:"error_summary"`        // Summary of errors
	RootCause      string   `json:"root_cause,omitempty"` // Identified root cause if determinable
}

FailureAnalysis provides structured analysis for failed workflows

type FileInfo added in v0.21.0

type FileInfo struct {
	Path        string `json:"path"`
	Size        int64  `json:"size"`
	Description string `json:"description"`
}

FileInfo contains information about downloaded artifact files

type FileTracker added in v0.0.22

type FileTracker struct {
	CreatedFiles    []string
	ModifiedFiles   []string
	OriginalContent map[string][]byte // Store original content for rollback
	// contains filtered or unexported fields
}

FileTracker keeps track of files created or modified during workflow operations to enable proper staging and rollback functionality

func NewFileTracker added in v0.0.22

func NewFileTracker() (*FileTracker, error)

NewFileTracker creates a new file tracker

func (*FileTracker) GetAllFiles added in v0.0.22

func (ft *FileTracker) GetAllFiles() []string

GetAllFiles returns all tracked files (created and modified)

func (*FileTracker) RollbackAllFiles added in v0.0.22

func (ft *FileTracker) RollbackAllFiles(verbose bool) error

RollbackAllFiles rolls back both created and modified files

func (*FileTracker) RollbackCreatedFiles added in v0.0.22

func (ft *FileTracker) RollbackCreatedFiles(verbose bool) error

RollbackCreatedFiles deletes all files that were created during the operation

func (*FileTracker) RollbackModifiedFiles added in v0.0.22

func (ft *FileTracker) RollbackModifiedFiles(verbose bool) error

RollbackModifiedFiles restores all modified files to their original state

func (*FileTracker) StageAllFiles added in v0.0.22

func (ft *FileTracker) StageAllFiles(verbose bool) error

StageAllFiles stages all tracked files using git add

func (*FileTracker) TrackCreated added in v0.0.22

func (ft *FileTracker) TrackCreated(filePath string)

TrackCreated adds a file to the created files list

func (*FileTracker) TrackModified added in v0.0.22

func (ft *FileTracker) TrackModified(filePath string)

TrackModified adds a file to the modified files list and stores its original content

type Finding added in v0.30.2

type Finding struct {
	Category    string `json:"category"`         // e.g., "error", "performance", "cost", "tooling"
	Severity    string `json:"severity"`         // "critical", "high", "medium", "low", "info"
	Title       string `json:"title"`            // Brief title
	Description string `json:"description"`      // Detailed description
	Impact      string `json:"impact,omitempty"` // What impact this has
}

Finding represents a key insight discovered during audit

type FirewallAnalysis added in v0.25.0

type FirewallAnalysis struct {
	DomainBuckets
	TotalRequests    int
	AllowedRequests  int
	DeniedRequests   int
	RequestsByDomain map[string]DomainRequestStats
}

FirewallAnalysis represents analysis of firewall logs This mirrors the structure from the JavaScript parser

func (*FirewallAnalysis) AddMetrics added in v0.28.7

func (f *FirewallAnalysis) AddMetrics(other LogAnalysis)

AddMetrics adds metrics from another analysis

type FirewallLogEntry added in v0.25.0

type FirewallLogEntry struct {
	Timestamp    string
	ClientIPPort string
	Domain       string
	DestIPPort   string
	Proto        string
	Method       string
	Status       string
	Decision     string
	URL          string
	UserAgent    string
}

FirewallLogEntry represents a parsed firewall log entry Format: timestamp client_ip:port domain dest_ip:port proto method status decision url user_agent

type FirewallLogSummary added in v0.25.0

type FirewallLogSummary struct {
	TotalRequests    int                           `json:"total_requests" console:"header:Total Requests"`
	AllowedRequests  int                           `json:"allowed_requests" console:"header:Allowed"`
	DeniedRequests   int                           `json:"denied_requests" console:"header:Denied"`
	AllowedDomains   []string                      `json:"allowed_domains" console:"-"`
	DeniedDomains    []string                      `json:"denied_domains" console:"-"`
	RequestsByDomain map[string]DomainRequestStats `json:"requests_by_domain,omitempty" console:"-"`
	ByWorkflow       map[string]*FirewallAnalysis  `json:"by_workflow,omitempty" console:"-"`
}

FirewallLogSummary contains aggregated firewall log data

type FixConfig added in v0.33.0

type FixConfig struct {
	WorkflowIDs []string
	Write       bool
	Verbose     bool
}

FixConfig contains configuration for the fix command

type GitHubWorkflow

type GitHubWorkflow struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Path  string `json:"path"`
	State string `json:"state"`
}

GitHubWorkflow represents a workflow from GitHub API

type Header struct {
	Name     string `json:"name"`
	IsSecret bool   `json:"is_secret,omitempty"`
	Default  string `json:"default,omitempty"`
}

Header represents an HTTP header for remote servers

type IncludeDependency

type IncludeDependency struct {
	SourcePath string // Path in the source (local)
	TargetPath string // Relative path where it should be copied in .github/workflows
	IsOptional bool   // Whether this is an optional include (@include?)
}

IncludeDependency represents a file dependency from @include directives

type InteractiveWorkflowBuilder added in v0.8.3

type InteractiveWorkflowBuilder struct {
	WorkflowName  string
	Trigger       string
	Engine        string
	Tools         []string
	SafeOutputs   []string
	Intent        string
	NetworkAccess string
	CustomDomains []string
}

InteractiveWorkflowBuilder collects user input to build an agentic workflow

type JobData added in v0.21.0

type JobData struct {
	Name       string `json:"name" console:"header:Name"`
	Status     string `json:"status" console:"header:Status"`
	Conclusion string `json:"conclusion,omitempty" console:"header:Conclusion,omitempty"`
	Duration   string `json:"duration,omitempty" console:"header:Duration,omitempty"`
}

JobData contains information about individual jobs

type JobInfo added in v0.9.0

type JobInfo struct {
	Name        string    `json:"name"`
	Status      string    `json:"status"`
	Conclusion  string    `json:"conclusion"`
	StartedAt   time.Time `json:"started_at,omitempty"`
	CompletedAt time.Time `json:"completed_at,omitempty"`
}

JobInfo represents basic information about a workflow job

type JobInfoWithDuration added in v0.21.0

type JobInfoWithDuration struct {
	JobInfo
	Duration time.Duration
}

JobInfoWithDuration extends JobInfo with calculated duration

type LogAnalysis added in v0.28.7

type LogAnalysis interface {
	// GetAllowedDomains returns the list of allowed domains
	GetAllowedDomains() []string
	// GetDeniedDomains returns the list of denied domains
	GetDeniedDomains() []string
	// SetAllowedDomains sets the list of allowed domains
	SetAllowedDomains(domains []string)
	// SetDeniedDomains sets the list of denied domains
	SetDeniedDomains(domains []string)
	// AddMetrics adds metrics from another analysis
	AddMetrics(other LogAnalysis)
}

LogAnalysis is an interface that both DomainAnalysis and FirewallAnalysis implement

type LogMetrics

type LogMetrics = workflow.LogMetrics

LogMetrics represents extracted metrics from log files This is now an alias to the shared type in workflow package

type LogParser added in v0.28.7

type LogParser[T LogAnalysis] func(logPath string, verbose bool) (T, error)

LogParser is a function type that parses a single log file

type LogsData added in v0.21.0

type LogsData struct {
	Summary           LogsSummary                `json:"summary" console:"title:Workflow Logs Summary"`
	Runs              []RunData                  `json:"runs" console:"title:Workflow Logs Overview"`
	ToolUsage         []ToolUsageSummary         `json:"tool_usage,omitempty" console:"title:🛠️  Tool Usage Summary,omitempty"`
	ErrorsAndWarnings []ErrorSummary             `json:"errors_and_warnings,omitempty" console:"title:Errors and Warnings,omitempty"`
	MissingTools      []MissingToolSummary       `json:"missing_tools,omitempty" console:"title:🛠️  Missing Tools Summary,omitempty"`
	MCPFailures       []MCPFailureSummary        `json:"mcp_failures,omitempty" console:"title:⚠️  MCP Server Failures,omitempty"`
	AccessLog         *AccessLogSummary          `json:"access_log,omitempty" console:"title:Access Log Analysis,omitempty"`
	FirewallLog       *FirewallLogSummary        `json:"firewall_log,omitempty" console:"title:🔥 Firewall Log Analysis,omitempty"`
	RedactedDomains   *RedactedDomainsLogSummary `json:"redacted_domains,omitempty" console:"title:🔒 Redacted URL Domains,omitempty"`
	Continuation      *ContinuationData          `json:"continuation,omitempty" console:"-"`
	LogsLocation      string                     `json:"logs_location" console:"-"`
}

LogsData represents the complete structured data for logs output

type LogsDataSchema added in v0.26.0

type LogsDataSchema struct {
	Description string                 `json:"description"`
	Type        string                 `json:"type"`
	Fields      map[string]SchemaField `json:"fields"`
}

LogsDataSchema describes the structure of the full logs output

type LogsSummary added in v0.21.0

type LogsSummary struct {
	TotalRuns         int     `json:"total_runs" console:"header:Total Runs"`
	TotalDuration     string  `json:"total_duration" console:"header:Total Duration"`
	TotalTokens       int     `json:"total_tokens" console:"header:Total Tokens,format:number"`
	TotalCost         float64 `json:"total_cost" console:"header:Total Cost,format:cost"`
	TotalTurns        int     `json:"total_turns" console:"header:Total Turns"`
	TotalErrors       int     `json:"total_errors" console:"header:Total Errors"`
	TotalWarnings     int     `json:"total_warnings" console:"header:Total Warnings"`
	TotalMissingTools int     `json:"total_missing_tools" console:"header:Total Missing Tools"`
}

LogsSummary contains aggregate metrics across all runs

type MCPConfig added in v0.27.0

type MCPConfig struct {
	Servers map[string]VSCodeMCPServer `json:"servers"`
}

MCPConfig represents the structure of mcp.json

type MCPFailureReport added in v0.6.2

type MCPFailureReport struct {
	ServerName   string `json:"server_name"`
	Status       string `json:"status"`
	Timestamp    string `json:"timestamp,omitempty"`
	WorkflowName string `json:"workflow_name,omitempty"`
	RunID        int64  `json:"run_id,omitempty"`
}

MCPFailureReport represents an MCP server failure detected in a workflow run

type MCPFailureSummary added in v0.6.2

type MCPFailureSummary struct {
	ServerName       string   `json:"server_name" console:"header:Server"`
	Count            int      `json:"count" console:"header:Failures"`
	Workflows        []string `json:"workflows" console:"-"`                  // List of workflow names that had this server fail
	WorkflowsDisplay string   `json:"-" console:"header:Workflows,maxlen:60"` // Formatted display of workflows
	RunIDs           []int64  `json:"run_ids" console:"-"`                    // List of run IDs where this server failed
}

MCPFailureSummary aggregates MCP server failure reports across runs

type MCPLogsGuardrailResponse added in v0.26.0

type MCPLogsGuardrailResponse struct {
	Message          string             `json:"message"`
	OutputTokens     int                `json:"output_tokens"`
	OutputSizeLimit  int                `json:"output_size_limit"`
	Schema           LogsDataSchema     `json:"schema"`
	SuggestedQueries []SuggestedJqQuery `json:"suggested_queries"`
}

MCPLogsGuardrailResponse represents the response when output is too large

type MCPPackage added in v0.8.3

type MCPPackage struct {
	RegistryType         string                `json:"registry_type,omitempty"`
	Identifier           string                `json:"identifier,omitempty"`
	Version              string                `json:"version,omitempty"`
	RuntimeHint          string                `json:"runtime_hint,omitempty"`
	Transport            Transport             `json:"transport,omitempty"`
	RuntimeArguments     []Argument            `json:"runtime_arguments,omitempty"`
	PackageArguments     []Argument            `json:"package_arguments,omitempty"`
	EnvironmentVariables []EnvironmentVariable `json:"environment_variables,omitempty"`
}

MCPPackage represents a package configuration for an MCP server

type MCPRegistryClient added in v0.8.3

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

MCPRegistryClient handles communication with MCP registries

func NewMCPRegistryClient added in v0.8.3

func NewMCPRegistryClient(registryURL string) *MCPRegistryClient

NewMCPRegistryClient creates a new MCP registry client

func (*MCPRegistryClient) GetServer added in v0.8.3

func (c *MCPRegistryClient) GetServer(serverName string) (*MCPRegistryServerForProcessing, error)

GetServer gets a specific server by name from the registry

func (*MCPRegistryClient) SearchServers added in v0.8.3

func (c *MCPRegistryClient) SearchServers(query string) ([]MCPRegistryServerForProcessing, error)

SearchServers searches for MCP servers in the registry by fetching all servers and filtering locally

type MCPRegistryServerForProcessing added in v0.8.3

type MCPRegistryServerForProcessing struct {
	Name                 string                `json:"name"`
	Description          string                `json:"description"`
	Repository           string                `json:"repository"`
	Command              string                `json:"command"`
	Args                 []string              `json:"args"`
	RuntimeHint          string                `json:"runtime_hint"`
	RuntimeArguments     []string              `json:"runtime_arguments"`
	Transport            string                `json:"transport"`
	Config               map[string]any        `json:"config"`
	EnvironmentVariables []EnvironmentVariable `json:"environment_variables"`
}

MCPRegistryServerForProcessing represents a flattened server for internal use

type MCPToolTableOptions added in v0.30.0

type MCPToolTableOptions struct {
	// TruncateLength is the maximum length for tool descriptions before truncation
	// A value of 0 means no truncation
	TruncateLength int
	// ShowSummary controls whether to display the summary line at the bottom
	ShowSummary bool
	// SummaryFormat is the format string for the summary (default: "📊 Summary: %d allowed, %d not allowed out of %d total tools\n")
	SummaryFormat string
	// ShowVerboseHint controls whether to show the "Run with --verbose" hint in non-verbose mode
	ShowVerboseHint bool
}

MCPToolTableOptions configures how the MCP tool table is rendered

func DefaultMCPToolTableOptions added in v0.30.0

func DefaultMCPToolTableOptions() MCPToolTableOptions

DefaultMCPToolTableOptions returns the default options for rendering MCP tool tables

type MetricsData added in v0.21.0

type MetricsData struct {
	TokenUsage    int     `json:"token_usage,omitempty" console:"header:Token Usage,format:number,omitempty"`
	EstimatedCost float64 `json:"estimated_cost,omitempty" console:"header:Estimated Cost,format:cost,omitempty"`
	Turns         int     `json:"turns,omitempty" console:"header:Turns,omitempty"`
	ErrorCount    int     `json:"error_count" console:"header:Errors"`
	WarningCount  int     `json:"warning_count" console:"header:Warnings"`
}

MetricsData contains execution metrics

type MissingToolReport added in v0.5.0

type MissingToolReport struct {
	Tool         string `json:"tool"`
	Reason       string `json:"reason"`
	Alternatives string `json:"alternatives,omitempty"`
	Timestamp    string `json:"timestamp"`
	WorkflowName string `json:"workflow_name,omitempty"` // Added for tracking which workflow reported this
	RunID        int64  `json:"run_id,omitempty"`        // Added for tracking which run reported this
}

MissingToolReport represents a missing tool reported by an agentic workflow

type MissingToolSummary added in v0.5.0

type MissingToolSummary struct {
	Tool               string   `json:"tool" console:"header:Tool"`
	Count              int      `json:"count" console:"header:Occurrences"`
	Workflows          []string `json:"workflows" console:"-"`                     // List of workflow names that reported this tool
	WorkflowsDisplay   string   `json:"-" console:"header:Workflows,maxlen:40"`    // Formatted display of workflows
	FirstReason        string   `json:"first_reason" console:"-"`                  // Reason from the first occurrence
	FirstReasonDisplay string   `json:"-" console:"header:First Reason,maxlen:50"` // Formatted display of first reason
	RunIDs             []int64  `json:"run_ids" console:"-"`                       // List of run IDs where this tool was reported
}

MissingToolSummary aggregates missing tool reports across runs

type NoopReport added in v0.30.2

type NoopReport struct {
	Message      string `json:"message"`
	Timestamp    string `json:"timestamp,omitempty"`
	WorkflowName string `json:"workflow_name,omitempty"` // Added for tracking which workflow reported this
	RunID        int64  `json:"run_id,omitempty"`        // Added for tracking which run reported this
}

NoopReport represents a noop message reported by an agentic workflow

type OverviewData added in v0.21.0

type OverviewData struct {
	RunID        int64     `json:"run_id" console:"header:Run ID"`
	WorkflowName string    `json:"workflow_name" console:"header:Workflow"`
	Status       string    `json:"status" console:"header:Status"`
	Conclusion   string    `json:"conclusion,omitempty" console:"header:Conclusion,omitempty"`
	CreatedAt    time.Time `json:"created_at" console:"header:Created At"`
	StartedAt    time.Time `json:"started_at,omitempty" console:"header:Started At,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty" console:"header:Updated At,omitempty"`
	Duration     string    `json:"duration,omitempty" console:"header:Duration,omitempty"`
	Event        string    `json:"event" console:"header:Event"`
	Branch       string    `json:"branch" console:"header:Branch"`
	URL          string    `json:"url" console:"header:URL"`
	LogsPath     string    `json:"logs_path,omitempty" console:"header:Files,omitempty"`
}

OverviewData contains basic information about the workflow run

type OverviewDisplay added in v0.21.0

type OverviewDisplay struct {
	RunID    int64  `console:"header:Run ID"`
	Workflow string `console:"header:Workflow"`
	Status   string `console:"header:Status"`
	Duration string `console:"header:Duration,omitempty"`
	Event    string `console:"header:Event"`
	Branch   string `console:"header:Branch"`
	URL      string `console:"header:URL"`
	Files    string `console:"header:Files,omitempty"`
}

OverviewDisplay is a display-optimized version of OverviewData for console rendering

type PRInfo added in v0.22.2

type PRInfo struct {
	Number      int    `json:"number"`
	Title       string `json:"title"`
	Body        string `json:"body"`
	State       string `json:"state"`
	HeadSHA     string `json:"headSHA"`
	BaseBranch  string `json:"baseBranch"`
	HeadBranch  string `json:"headBranch"`
	SourceRepo  string `json:"sourceRepo"`
	TargetRepo  string `json:"targetRepo"`
	AuthorLogin string `json:"authorLogin"`
}

PRInfo represents the details of a pull request

type Package

type Package struct {
	Name      string
	Path      string
	Workflows []string
	CommitSHA string
}

Package represents an installed package

type PerformanceMetrics added in v0.30.2

type PerformanceMetrics struct {
	TokensPerMinute float64 `json:"tokens_per_minute,omitempty"`
	CostEfficiency  string  `json:"cost_efficiency,omitempty"` // e.g., "good", "poor"
	AvgToolDuration string  `json:"avg_tool_duration,omitempty"`
	MostUsedTool    string  `json:"most_used_tool,omitempty"`
	NetworkRequests int     `json:"network_requests,omitempty"`
}

PerformanceMetrics provides aggregated performance statistics

type PollOptions added in v0.29.0

type PollOptions struct {
	// Interval between poll attempts
	PollInterval time.Duration
	// Timeout for the entire polling operation
	Timeout time.Duration
	// Function to call on each poll iteration
	// Should return PollContinue to keep polling, PollSuccess to succeed, or PollFailure to fail
	PollFunc func() (PollResult, error)
	// Message to display when polling starts (optional)
	StartMessage string
	// Message to display on each poll iteration (optional)
	ProgressMessage string
	// Message to display on successful completion (optional)
	SuccessMessage string
	// Whether to show verbose progress messages
	Verbose bool
}

PollOptions contains configuration for signal-aware polling

type PollResult added in v0.29.0

type PollResult int

PollResult represents the result of a polling operation

const (
	// PollContinue indicates polling should continue
	PollContinue PollResult = iota
	// PollSuccess indicates polling completed successfully
	PollSuccess
	// PollFailure indicates polling failed
	PollFailure
)

type ProcessedRun added in v0.3.4

type ProcessedRun struct {
	Run                     WorkflowRun
	AccessAnalysis          *DomainAnalysis
	FirewallAnalysis        *FirewallAnalysis
	RedactedDomainsAnalysis *RedactedDomainsAnalysis
	MissingTools            []MissingToolReport
	Noops                   []NoopReport
	MCPFailures             []MCPFailureReport
	JobDetails              []JobInfoWithDuration
}

ProcessedRun represents a workflow run with its associated analysis

type PullRequest added in v0.22.1

type PullRequest struct {
	Number    int       `json:"number"`
	Title     string    `json:"title"`
	IsDraft   bool      `json:"isDraft"`
	Mergeable string    `json:"mergeable"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

PullRequest represents a GitHub Pull Request

type Recommendation added in v0.30.2

type Recommendation struct {
	Priority string `json:"priority"`          // "high", "medium", "low"
	Action   string `json:"action"`            // What to do
	Reason   string `json:"reason"`            // Why to do it
	Example  string `json:"example,omitempty"` // Example of how to implement
}

Recommendation represents an actionable suggestion

type RedactedDomainsAnalysis added in v0.31.4

type RedactedDomainsAnalysis struct {
	// TotalDomains is the total number of unique domains found in the redacted log
	TotalDomains int `json:"total_domains" console:"header:Total Domains"`
	// Domains is a sorted list of unique domain names that were redacted
	Domains []string `json:"domains" console:"title:Redacted Domains,omitempty"`
}

RedactedDomainsAnalysis represents analysis of domains that were redacted during URL sanitization. The redacted-urls.log file is created during content sanitization when URLs from untrusted domains are encountered. This helps track which domains agents attempted to access but were blocked.

type RedactedDomainsLogSummary added in v0.31.4

type RedactedDomainsLogSummary struct {
	TotalDomains int                                 `json:"total_domains" console:"header:Total Domains"`
	Domains      []string                            `json:"domains" console:"title:Redacted Domains,omitempty"`
	ByWorkflow   map[string]*RedactedDomainsAnalysis `json:"by_workflow,omitempty" console:"-"`
}

RedactedDomainsLogSummary contains aggregated redacted domains data across all runs

type Remote added in v0.8.3

type Remote struct {
	Type    string   `json:"type"`
	URL     string   `json:"url"`
	Headers []Header `json:"headers,omitempty"`
}

Remote represents a remote server configuration

type RepeatOptions added in v0.22.0

type RepeatOptions struct {
	// Number of times to repeat execution (0 = run once)
	RepeatCount int
	// Message to display when starting repeat mode
	StartMessage string
	// Message to display on each repeat iteration (optional, uses default if empty)
	RepeatMessage string
	// Function to execute on each iteration
	ExecuteFunc func() error
	// Function to execute on cleanup/exit (optional)
	CleanupFunc func()
	// Whether to use stderr for informational messages (default: true)
	UseStderr bool
}

RepeatOptions contains configuration for the repeat functionality

type RepoSpec added in v0.14.0

type RepoSpec struct {
	RepoSlug string // e.g., "owner/repo"
	Version  string // optional version/tag/SHA/branch
}

RepoSpec represents a parsed repository specification

type Repository added in v0.8.3

type Repository struct {
	URL    string `json:"url"`
	Source string `json:"source,omitempty"`
}

Repository represents the source repository information

type RunData added in v0.21.0

type RunData struct {
	DatabaseID       int64     `json:"database_id" console:"header:Run ID"`
	Number           int       `json:"number" console:"-"`
	WorkflowName     string    `json:"workflow_name" console:"header:Workflow"`
	Agent            string    `json:"agent,omitempty" console:"header:Agent,omitempty"`
	Status           string    `json:"status" console:"header:Status"`
	Conclusion       string    `json:"conclusion,omitempty" console:"-"`
	Duration         string    `json:"duration,omitempty" console:"header:Duration,omitempty"`
	TokenUsage       int       `json:"token_usage,omitempty" console:"header:Tokens,format:number,omitempty"`
	EstimatedCost    float64   `json:"estimated_cost,omitempty" console:"header:Cost ($),format:cost,omitempty"`
	Turns            int       `json:"turns,omitempty" console:"header:Turns,omitempty"`
	ErrorCount       int       `json:"error_count" console:"header:Errors"`
	WarningCount     int       `json:"warning_count" console:"header:Warnings"`
	MissingToolCount int       `json:"missing_tool_count" console:"header:Missing"`
	CreatedAt        time.Time `json:"created_at" console:"header:Created"`
	URL              string    `json:"url" console:"-"`
	LogsPath         string    `json:"logs_path" console:"header:Logs Path"`
	Event            string    `json:"event" console:"-"`
	Branch           string    `json:"branch" console:"-"`
}

RunData contains information about a single workflow run

type RunSummary added in v0.23.0

type RunSummary struct {
	CLIVersion              string                   `json:"cli_version"`               // CLI version used to process this run
	RunID                   int64                    `json:"run_id"`                    // Workflow run database ID
	ProcessedAt             time.Time                `json:"processed_at"`              // When this summary was created
	Run                     WorkflowRun              `json:"run"`                       // Full workflow run metadata
	Metrics                 LogMetrics               `json:"metrics"`                   // Extracted log metrics
	AccessAnalysis          *DomainAnalysis          `json:"access_analysis"`           // Network access analysis
	FirewallAnalysis        *FirewallAnalysis        `json:"firewall_analysis"`         // Firewall log analysis
	RedactedDomainsAnalysis *RedactedDomainsAnalysis `json:"redacted_domains_analysis"` // Redacted URL domains analysis
	MissingTools            []MissingToolReport      `json:"missing_tools"`             // Missing tool reports
	Noops                   []NoopReport             `json:"noops"`                     // Noop messages
	MCPFailures             []MCPFailureReport       `json:"mcp_failures"`              // MCP server failures
	ArtifactsList           []string                 `json:"artifacts_list"`            // List of downloaded artifact files
	JobDetails              []JobInfoWithDuration    `json:"job_details"`               // Job execution details
}

RunSummary represents a complete summary of a workflow run's artifacts and metrics. This file is written to each run folder as "run_summary.json" to cache processing results and avoid re-downloading and re-processing already analyzed runs.

Key features: - Acts as a marker that a run has been fully processed - Stores all extracted metrics and analysis results - Includes CLI version for cache invalidation when the tool is updated - Enables fast reloading of run data without re-parsing logs

Cache invalidation: - If the CLI version in the summary doesn't match the current version, the run is reprocessed - This ensures that bug fixes and improvements in log parsing are automatically applied

type SchemaField added in v0.26.0

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

SchemaField describes a field in the schema

type SecretInfo added in v0.22.3

type SecretInfo struct {
	Name      string // Secret name (e.g., "DD_API_KEY")
	EnvKey    string // Environment variable key where it should be set
	Available bool   // Whether the secret is available
	Source    string // Where the secret was found ("env", "actions", or "")
	Value     string // The secret value (if fetched)
}

SecretInfo contains information about a required secret

type Server added in v0.8.3

type Server struct {
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Status      string       `json:"status"`
	Version     string       `json:"version,omitempty"`
	Repository  Repository   `json:"repository,omitempty"`
	Packages    []MCPPackage `json:"packages,omitempty"`
	Remotes     []Remote     `json:"remotes,omitempty"`
}

Server represents an MCP server in the registry

type ServerListResponse added in v0.8.3

type ServerListResponse struct {
	Servers []Server `json:"servers"`
}

ServerListResponse represents the response from the /servers endpoint

type SourceSpec added in v0.14.0

type SourceSpec struct {
	Repo string // e.g., "owner/repo"
	Path string // e.g., "workflows/workflow-name.md"
	Ref  string // optional ref (version/tag/SHA/branch)
}

SourceSpec represents a parsed source specification from workflow frontmatter

type SuggestedJqQuery added in v0.26.0

type SuggestedJqQuery struct {
	Description string `json:"description"`
	Query       string `json:"query"`
	Example     string `json:"example,omitempty"`
}

SuggestedJqQuery represents a suggested jq filter

type ToolGraph added in v0.6.0

type ToolGraph struct {
	Tools       map[string]bool // Set of all tools
	Transitions map[string]int  // Key: "from->to", Value: count
	// contains filtered or unexported fields
}

ToolGraph represents a directed graph of tool call sequences

func NewToolGraph added in v0.6.0

func NewToolGraph() *ToolGraph

NewToolGraph creates a new empty tool graph

func (*ToolGraph) AddSequence added in v0.6.0

func (g *ToolGraph) AddSequence(tools []string)

AddSequence adds a tool call sequence to the graph

func (*ToolGraph) GenerateMermaidGraph added in v0.6.0

func (g *ToolGraph) GenerateMermaidGraph() string

GenerateMermaidGraph generates a Mermaid state diagram from the tool graph

func (*ToolGraph) GetSummary added in v0.6.0

func (g *ToolGraph) GetSummary() string

GetSummary returns a summary of the tool graph

type ToolTransition added in v0.6.0

type ToolTransition struct {
	From  string // Source tool name
	To    string // Target tool name
	Count int    // Number of times this transition occurred
}

ToolTransition represents an edge in the tool graph

type ToolUsageInfo added in v0.21.0

type ToolUsageInfo struct {
	Name          string `json:"name" console:"header:Tool"`
	CallCount     int    `json:"call_count" console:"header:Calls"`
	MaxInputSize  int    `json:"max_input_size,omitempty" console:"header:Max Input,format:number,omitempty"`
	MaxOutputSize int    `json:"max_output_size,omitempty" console:"header:Max Output,format:number,omitempty"`
	MaxDuration   string `json:"max_duration,omitempty" console:"header:Max Duration,omitempty"`
}

ToolUsageInfo contains aggregated tool usage statistics

type ToolUsageSummary added in v0.21.0

type ToolUsageSummary struct {
	Name          string `json:"name" console:"header:Tool"`
	TotalCalls    int    `json:"total_calls" console:"header:Total Calls,format:number"`
	Runs          int    `json:"runs" console:"header:Runs"` // Number of runs that used this tool
	MaxOutputSize int    `json:"max_output_size,omitempty" console:"header:Max Output,format:filesize,default:N/A,omitempty"`
	MaxDuration   string `json:"max_duration,omitempty" console:"header:Max Duration,default:N/A,omitempty"`
}

ToolUsageSummary contains aggregated tool usage statistics

type Transport added in v0.8.3

type Transport struct {
	Type string `json:"type"`
}

Transport represents the transport configuration

type TrialArtifacts added in v0.14.3

type TrialArtifacts struct {
	SafeOutputs map[string]any `json:"safe_outputs"`
	//AgentStdioLogs      []string               `json:"agent_stdio_logs,omitempty"`
	AgenticRunInfo      map[string]any `json:"agentic_run_info,omitempty"`
	AdditionalArtifacts map[string]any `json:"additional_artifacts,omitempty"`
}

TrialArtifacts represents all artifacts downloaded from a workflow run

type TrialSecretTracker added in v0.18.0

type TrialSecretTracker struct {
	RepoSlug     string          `json:"repo_slug"`
	AddedSecrets map[string]bool `json:"added_secrets"` // secrets that were successfully added by trial
}

TrialSecretTracker tracks which secrets were added during a trial for cleanup

func NewTrialSecretTracker added in v0.18.0

func NewTrialSecretTracker(repoSlug string) *TrialSecretTracker

NewTrialSecretTracker creates a new secret tracker for a repository

type VSCodeMCPServer added in v0.31.4

type VSCodeMCPServer struct {
	Command string   `json:"command"`
	Args    []string `json:"args"`
	CWD     string   `json:"cwd,omitempty"`
}

VSCodeMCPServer represents a single MCP server configuration for VSCode mcp.json

type ValidationError added in v0.28.7

type ValidationError struct {
	Type    string `json:"type"`
	Message string `json:"message"`
	Line    int    `json:"line,omitempty"`
}

ValidationError represents a single validation error or warning

type ValidationResult added in v0.28.7

type ValidationResult struct {
	Workflow     string            `json:"workflow"`
	Valid        bool              `json:"valid"`
	Errors       []ValidationError `json:"errors"`
	Warnings     []ValidationError `json:"warnings"`
	CompiledFile string            `json:"compiled_file,omitempty"`
}

ValidationResult represents the validation result for a single workflow

type Workflow added in v0.27.0

type Workflow struct {
	Name string                 `yaml:"name,omitempty"`
	On   any                    `yaml:"on,omitempty"`
	Jobs map[string]WorkflowJob `yaml:"jobs,omitempty"`
}

Workflow represents a GitHub Actions workflow file

type WorkflowFileStatus added in v0.32.0

type WorkflowFileStatus struct {
	IsModified         bool // File has unstaged changes
	IsStaged           bool // File has staged changes
	HasUnpushedCommits bool // File has unpushed commits affecting it
}

WorkflowFileStatus represents the status of a workflow file in git

type WorkflowInfo added in v0.28.6

type WorkflowInfo struct {
	ID          string `console:"header:ID"`
	Name        string `console:"header:Name"`
	Description string `console:"header:Description,omitempty"`
	Path        string `console:"-"` // Internal use only, not displayed
}

WorkflowInfo represents metadata about an available workflow

type WorkflowJob added in v0.27.0

type WorkflowJob struct {
	RunsOn      any                   `yaml:"runs-on,omitempty"`
	Permissions map[string]any        `yaml:"permissions,omitempty"`
	Steps       []CopilotWorkflowStep `yaml:"steps,omitempty"`
}

WorkflowJob represents a GitHub Actions workflow job

type WorkflowMCPMetadata added in v0.24.0

type WorkflowMCPMetadata struct {
	FilePath    string
	FileName    string
	BaseName    string
	MCPConfigs  []parser.MCPServerConfig
	Frontmatter map[string]any
}

WorkflowMCPMetadata contains metadata about MCP servers in a workflow

func ScanWorkflowsForMCP added in v0.24.0

func ScanWorkflowsForMCP(workflowsDir string, serverFilter string, verbose bool) ([]WorkflowMCPMetadata, error)

ScanWorkflowsForMCP scans workflow files for MCP configurations Returns metadata for workflows that contain MCP servers

type WorkflowNode added in v0.32.0

type WorkflowNode struct {
	Path       string   // Absolute path to the workflow file
	IsTopLevel bool     // True if this is a top-level workflow (not in subdirectory)
	Imports    []string // List of imported file paths (absolute)
}

WorkflowNode represents a workflow file in the dependency graph

type WorkflowRun

type WorkflowRun struct {
	DatabaseID       int64     `json:"databaseId"`
	Number           int       `json:"number"`
	URL              string    `json:"url"`
	Status           string    `json:"status"`
	Conclusion       string    `json:"conclusion"`
	WorkflowName     string    `json:"workflowName"`
	WorkflowPath     string    `json:"workflowPath,omitempty"` // Workflow file path (e.g., .github/workflows/copilot-swe-agent.yml)
	CreatedAt        time.Time `json:"createdAt"`
	StartedAt        time.Time `json:"startedAt"`
	UpdatedAt        time.Time `json:"updatedAt"`
	Event            string    `json:"event"`
	HeadBranch       string    `json:"headBranch"`
	HeadSha          string    `json:"headSha"`
	DisplayTitle     string    `json:"displayTitle"`
	Duration         time.Duration
	TokenUsage       int
	EstimatedCost    float64
	Turns            int
	ErrorCount       int
	WarningCount     int
	MissingToolCount int
	NoopCount        int
	LogsPath         string
}

WorkflowRun represents a GitHub Actions workflow run with metrics

type WorkflowRunInfo added in v0.12.2

type WorkflowRunInfo struct {
	URL        string
	DatabaseID int64
	Status     string
	Conclusion string
	CreatedAt  time.Time
}

WorkflowRunInfo contains information about a workflow run

type WorkflowSourceInfo

type WorkflowSourceInfo struct {
	PackagePath string
	SourcePath  string
	CommitSHA   string // The actual commit SHA used when the package was installed
}

WorkflowSourceInfo contains information about where a workflow was found

type WorkflowSpec added in v0.13.0

type WorkflowSpec struct {
	RepoSpec            // embedded RepoSpec for Repo and Version fields
	WorkflowPath string // e.g., "workflows/workflow-name.md"
	WorkflowName string // e.g., "workflow-name"
	IsWildcard   bool   // true if this is a wildcard spec (e.g., "owner/repo/*")
}

WorkflowSpec represents a parsed workflow specification

func (*WorkflowSpec) String added in v0.14.0

func (w *WorkflowSpec) String() string

String returns the canonical string representation of the workflow spec in the format "owner/repo/path[@version]" or just the WorkflowPath for local specs

type WorkflowStats added in v0.33.4

type WorkflowStats struct {
	Workflow    string
	FileSize    int64
	Jobs        int
	Steps       int
	ScriptCount int
	ScriptSize  int
	ShellCount  int
	ShellSize   int
}

WorkflowStats holds statistics about a compiled workflow

type WorkflowStatus added in v0.20.0

type WorkflowStatus struct {
	Workflow      string   `json:"workflow" console:"header:Workflow"`
	EngineID      string   `json:"engine_id" console:"header:Engine"`
	Compiled      string   `json:"compiled" console:"header:Compiled"`
	Status        string   `json:"status" console:"header:Status"`
	TimeRemaining string   `json:"time_remaining" console:"header:Time Remaining"`
	Labels        []string `json:"labels,omitempty" console:"header:Labels,omitempty"`
	On            any      `json:"on,omitempty" console:"-"`
	RunStatus     string   `json:"run_status,omitempty" console:"header:Run Status,omitempty"`
	RunConclusion string   `json:"run_conclusion,omitempty" console:"header:Run Conclusion,omitempty"`
}

WorkflowStatus represents the status of a single workflow for JSON output

type WorkflowTrialResult added in v0.12.0

type WorkflowTrialResult struct {
	WorkflowName string         `json:"workflow_name"`
	RunID        string         `json:"run_id"`
	SafeOutputs  map[string]any `json:"safe_outputs"`
	//AgentStdioLogs      []string               `json:"agent_stdio_logs,omitempty"`
	AgenticRunInfo      map[string]any `json:"agentic_run_info,omitempty"`
	AdditionalArtifacts map[string]any `json:"additional_artifacts,omitempty"`
	Timestamp           time.Time      `json:"timestamp"`
}

WorkflowTrialResult represents the result of running a single workflow trial

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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