Documentation
¶
Index ¶
- Constants
- Variables
- func AgentHintJSON(errMsg string) string
- func GetAPIKey() string
- func GetBackendOnlyFlag() bool
- func GetConfigFilePath() string
- func GetOpenBrowserFlag() bool
- func GetOutputFormat() string
- func GetPortFlag() int
- func GetRequestTimeout() int
- func GetServerURL() string
- func GetUIDevFlag() bool
- func NewAddCommand() *cobra.Command
- func NewAgentCommand() *cobra.Command
- func NewConfigCommand() *cobra.Command
- func NewExecutionCommand() *cobra.Command
- func NewInitCommand() *cobra.Command
- func NewListCommand() *cobra.Command
- func NewLogsCommand() *cobra.Command
- func NewMCPCommand() *cobra.Command
- func NewMCPDiscoverCommand() *cobra.Command
- func NewMCPLogsCommand() *cobra.Command
- func NewMCPMigrateCommand() *cobra.Command
- func NewMCPRemoveCommand() *cobra.Command
- func NewMCPRestartCommand() *cobra.Command
- func NewMCPSkillsCommand() *cobra.Command
- func NewMCPSkillsGenerateCommand() *cobra.Command
- func NewMCPSkillsListCommand() *cobra.Command
- func NewMCPSkillsRefreshCommand() *cobra.Command
- func NewMCPStartCommand() *cobra.Command
- func NewMCPStatusCommand() *cobra.Command
- func NewMCPStopCommand() *cobra.Command
- func NewNodesCommand() *cobra.Command
- func NewRootCommand(runServerFunc func(cmd *cobra.Command, args []string), versionInfo VersionInfo) *cobra.Command
- func NewStopCommand() *cobra.Command
- func NewUninstallCommand() *cobra.Command
- func NewVCCommand() *cobra.Command
- func NewVCVerifyCommand() *cobra.Command
- func NewVersionCommand(versionInfo VersionInfo) *cobra.Command
- func PrintBullet(message string)
- func PrintError(message string)
- func PrintHeader(message string)
- func PrintInfo(message string)
- func PrintSubheader(message string)
- func PrintSuccess(message string)
- func PrintWarning(message string)
- type AgentError
- type AgentMeta
- type AgentNodeStopper
- type AgentResponse
- type ComplianceChecks
- type ComponentVerification
- type ComprehensiveVerificationResult
- type DIDResolutionInfo
- type DIDResolutionResult
- type EnhancedVCChain
- type EnhancedVCVerifier
- type IntegrityCheckResults
- type LogViewer
- type MCPAddCommand
- type MCPAddOptions
- type PackageConfigManager
- func (pcm *PackageConfigManager) InteractiveConfig(packageName string) error
- func (pcm *PackageConfigManager) ListConfig(packageName string) error
- func (pcm *PackageConfigManager) SetVariable(packageName, key, value string) error
- func (pcm *PackageConfigManager) UnsetVariable(packageName, key string) error
- type SecurityAnalysis
- type Spinner
- type VCVerificationResult
- type VerificationIssue
- type VerificationMetadata
- type VerificationStep
- type VerificationSummary
- type VerifyOptions
- type VersionInfo
- type WorkflowVerification
Constants ¶
const ( StatusSuccess = "✔" // Standardized StatusError = "❗" // Standardized StatusWarning = "⚠" // Added StatusInfo = "ℹ" // Added StatusArrow = "→" StatusBullet = "•" )
Professional CLI status symbols
const AgentHint = `AI Agent? Run "af agent help" for structured JSON output.`
Variables ¶
var ( Green = color.New(color.FgGreen).SprintFunc() Red = color.New(color.FgRed).SprintFunc() Yellow = color.New(color.FgYellow).SprintFunc() Blue = color.New(color.FgBlue).SprintFunc() Cyan = color.New(color.FgCyan).SprintFunc() // Added Gray = color.New(color.FgHiBlack).SprintFunc() Bold = color.New(color.Bold).SprintFunc() )
Color functions for professional output
Functions ¶
func AgentHintJSON ¶
AgentHintJSON returns a structured JSON hint on stderr for agents that ran a wrong root command.
func GetBackendOnlyFlag ¶
func GetBackendOnlyFlag() bool
func GetOpenBrowserFlag ¶
func GetOpenBrowserFlag() bool
func GetOutputFormat ¶
func GetOutputFormat() string
func GetPortFlag ¶
func GetPortFlag() int
func GetRequestTimeout ¶
func GetRequestTimeout() int
func GetServerURL ¶
func GetServerURL() string
func GetUIDevFlag ¶
func GetUIDevFlag() bool
func NewAddCommand ¶
NewAddCommand creates the add command for adding dependencies
func NewAgentCommand ¶
func NewConfigCommand ¶
NewConfigCommand creates the config command
func NewExecutionCommand ¶
NewExecutionCommand groups execution management subcommands.
func NewInitCommand ¶
NewInitCommand builds a fresh Cobra command for initializing a new agent project.
func NewMCPCommand ¶
NewMCPCommand creates the mcp command for managing MCP servers
func NewMCPDiscoverCommand ¶
NewMCPDiscoverCommand creates the mcp discover command
func NewMCPLogsCommand ¶
NewMCPLogsCommand creates the mcp logs command
func NewMCPMigrateCommand ¶
NewMCPMigrateCommand creates the mcp migrate command
func NewMCPRemoveCommand ¶
NewMCPRemoveCommand creates the mcp remove command
func NewMCPRestartCommand ¶
NewMCPRestartCommand creates the mcp restart command
func NewMCPSkillsCommand ¶
NewMCPSkillsCommand creates the mcp skills command
func NewMCPSkillsGenerateCommand ¶
NewMCPSkillsGenerateCommand creates the mcp skills generate command
func NewMCPSkillsListCommand ¶
NewMCPSkillsListCommand creates the mcp skills list command
func NewMCPSkillsRefreshCommand ¶
NewMCPSkillsRefreshCommand creates the mcp skills refresh command
func NewMCPStartCommand ¶
NewMCPStartCommand creates the mcp start command
func NewMCPStatusCommand ¶
NewMCPStatusCommand creates the mcp status command
func NewMCPStopCommand ¶
NewMCPStopCommand creates the mcp stop command
func NewNodesCommand ¶
NewNodesCommand groups node management subcommands.
func NewRootCommand ¶
func NewRootCommand(runServerFunc func(cmd *cobra.Command, args []string), versionInfo VersionInfo) *cobra.Command
NewRootCommand creates and returns the root Cobra command for the AgentField CLI.
func NewUninstallCommand ¶
NewUninstallCommand creates the uninstall command
func NewVCCommand ¶
NewVCCommand creates the vc command with subcommands
func NewVCVerifyCommand ¶
NewVCVerifyCommand creates the vc verify subcommand
func NewVersionCommand ¶
func NewVersionCommand(versionInfo VersionInfo) *cobra.Command
NewVersionCommand creates the version command
func PrintError ¶
func PrintError(message string)
PrintError prints an error message with cross mark
func PrintInfo ¶
func PrintInfo(message string)
PrintInfo prints an informational message with arrow
func PrintSuccess ¶
func PrintSuccess(message string)
PrintSuccess prints a success message with checkmark
Types ¶
type AgentError ¶
type AgentNodeStopper ¶
type AgentNodeStopper struct {
AgentFieldHome string
}
AgentNodeStopper handles stopping agent nodes
func (*AgentNodeStopper) StopAgentNode ¶
func (as *AgentNodeStopper) StopAgentNode(agentNodeName string) error
StopAgentNode stops a running agent node
type AgentResponse ¶
type AgentResponse struct {
OK bool `json:"ok"`
Data interface{} `json:"data,omitempty"`
Error *AgentError `json:"error,omitempty"`
Meta *AgentMeta `json:"meta,omitempty"`
}
type ComplianceChecks ¶
type ComplianceChecks struct {
W3CCompliance bool `json:"w3c_compliance"`
AgentFieldStandardCompliance bool `json:"agentfield_standard_compliance"`
AuditTrailIntegrity bool `json:"audit_trail_integrity"`
DataIntegrityChecks bool `json:"data_integrity_checks"`
Issues []VerificationIssue `json:"issues"`
}
ComplianceChecks represents compliance and audit verification results
type ComponentVerification ¶
type ComponentVerification struct {
VCID string `json:"vc_id"`
ExecutionID string `json:"execution_id"`
IssuerDID string `json:"issuer_did"`
Valid bool `json:"valid"`
SignatureValid bool `json:"signature_valid"`
FormatValid bool `json:"format_valid"`
Status string `json:"status"`
DurationMS int `json:"duration_ms"`
Timestamp string `json:"timestamp"`
Error string `json:"error,omitempty"`
}
ComponentVerification represents verification result for a single component
type ComprehensiveVerificationResult ¶
type ComprehensiveVerificationResult struct {
Valid bool `json:"valid"`
OverallScore float64 `json:"overall_score"` // 0-100
CriticalIssues []VerificationIssue `json:"critical_issues"`
Warnings []VerificationIssue `json:"warnings"`
ComponentResults []ComponentVerification `json:"component_results"`
WorkflowVerification *WorkflowVerification `json:"workflow_verification,omitempty"`
IntegrityChecks IntegrityCheckResults `json:"integrity_checks"`
SecurityAnalysis SecurityAnalysis `json:"security_analysis"`
ComplianceChecks ComplianceChecks `json:"compliance_checks"`
VerificationTimestamp string `json:"verification_timestamp"`
}
ComprehensiveVerificationResult provides detailed verification results
type DIDResolutionInfo ¶
type DIDResolutionInfo struct {
DID string `json:"did"`
Method string `json:"method"`
PublicKeyJWK map[string]interface{} `json:"public_key_jwk"`
WebURL string `json:"web_url,omitempty"`
CachedAt string `json:"cached_at,omitempty"`
ResolvedFrom string `json:"resolved_from"`
}
DIDResolutionInfo represents DID resolution information
type DIDResolutionResult ¶
type DIDResolutionResult struct {
DID string `json:"did"`
Method string `json:"method"`
ResolvedFrom string `json:"resolved_from"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
WebURL string `json:"web_url,omitempty"`
}
DIDResolutionResult represents the result of DID resolution
type EnhancedVCChain ¶
type EnhancedVCChain struct {
WorkflowID string `json:"workflow_id"`
GeneratedAt string `json:"generated_at"`
TotalExecutions int `json:"total_executions"`
CompletedExecutions int `json:"completed_executions"`
WorkflowStatus string `json:"workflow_status"`
ExecutionVCs []types.ExecutionVC `json:"execution_vcs"`
ComponentVCs []types.ExecutionVC `json:"component_vcs,omitempty"`
WorkflowVC types.WorkflowVC `json:"workflow_vc"`
DIDResolutionBundle map[string]DIDResolutionInfo `json:"did_resolution_bundle,omitempty"`
VerificationMetadata VerificationMetadata `json:"verification_metadata,omitempty"`
}
EnhancedVCChain represents a VC chain with DID resolution bundle
type EnhancedVCVerifier ¶
type EnhancedVCVerifier struct {
// contains filtered or unexported fields
}
EnhancedVCVerifier provides comprehensive VC verification with all integrity checks
func NewEnhancedVCVerifier ¶
func NewEnhancedVCVerifier(didResolutions map[string]DIDResolutionInfo, verbose bool) *EnhancedVCVerifier
NewEnhancedVCVerifier creates a new enhanced VC verifier
func (*EnhancedVCVerifier) VerifyEnhancedVCChain ¶
func (v *EnhancedVCVerifier) VerifyEnhancedVCChain(chain EnhancedVCChain) *ComprehensiveVerificationResult
VerifyEnhancedVCChain performs comprehensive verification of a VC chain
type IntegrityCheckResults ¶
type IntegrityCheckResults struct {
MetadataConsistency bool `json:"metadata_consistency"`
FieldConsistency bool `json:"field_consistency"`
TimestampValidation bool `json:"timestamp_validation"`
HashValidation bool `json:"hash_validation"`
StructuralIntegrity bool `json:"structural_integrity"`
Issues []VerificationIssue `json:"issues"`
}
IntegrityCheckResults represents various integrity verification results
type MCPAddCommand ¶
type MCPAddCommand struct {
ProjectDir string
Opts *MCPAddOptions
Verbose bool
AppConfig *config.Config
Manager *mcp.MCPManager // Initialized in the builder or Execute
}
MCPAddCommand encapsulates the logic for adding an MCP server.
func NewMCPAddCommand ¶
func NewMCPAddCommand(projectDir string, opts *MCPAddOptions, verboseFlag bool) (*MCPAddCommand, error)
NewMCPAddCommand acts as a builder for MCPAddCommand. It performs initial processing and validation.
func (*MCPAddCommand) Execute ¶
func (cmd *MCPAddCommand) Execute() error
Execute performs the MCP server addition.
type MCPAddOptions ¶
type MCPAddOptions struct {
Source string // Positional argument
Alias string // Positional argument or --alias flag
MCP bool // --mcp flag
Force bool // --force flag
URL string // --url flag (for remote MCP servers)
RunCmd string // --run flag (command to run the server)
SetupCmds []string // --setup flags (setup commands, repeatable)
WorkingDir string // --working-dir flag
EnvVars []string // --env flags (raw "KEY=VALUE")
Description string // --description flag
Tags []string // --tags flags (repeatable)
HealthCheck string // --health-check flag
Timeout int // --timeout flag (in seconds)
Version string // --version flag
}
MCPAddOptions holds all the flag-based options for the 'add --mcp' command.
type PackageConfigManager ¶
type PackageConfigManager struct {
AgentFieldHome string
}
PackageConfigManager handles environment configuration for packages
func (*PackageConfigManager) InteractiveConfig ¶
func (pcm *PackageConfigManager) InteractiveConfig(packageName string) error
InteractiveConfig runs interactive configuration for a package
func (*PackageConfigManager) ListConfig ¶
func (pcm *PackageConfigManager) ListConfig(packageName string) error
ListConfig lists current environment configuration for a package
func (*PackageConfigManager) SetVariable ¶
func (pcm *PackageConfigManager) SetVariable(packageName, key, value string) error
SetVariable sets a specific environment variable
func (*PackageConfigManager) UnsetVariable ¶
func (pcm *PackageConfigManager) UnsetVariable(packageName, key string) error
UnsetVariable removes an environment variable
type SecurityAnalysis ¶
type SecurityAnalysis struct {
SignatureStrength string `json:"signature_strength"`
KeyValidation bool `json:"key_validation"`
DIDAuthenticity bool `json:"did_authenticity"`
ReplayProtection bool `json:"replay_protection"`
TamperEvidence []string `json:"tamper_evidence"`
SecurityScore float64 `json:"security_score"`
Issues []VerificationIssue `json:"issues"`
}
SecurityAnalysis represents security-focused verification results
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner represents a CLI spinner for progress indication
func NewSpinner ¶
NewSpinner creates a new spinner with the given message
func (*Spinner) UpdateMessage ¶
UpdateMessage updates the spinner message while it's running
type VCVerificationResult ¶
type VCVerificationResult struct {
Valid bool `json:"valid"`
Type string `json:"type"`
WorkflowID string `json:"workflow_id,omitempty"`
SignatureValid bool `json:"signature_valid"`
FormatValid bool `json:"format_valid"`
Message string `json:"message"`
Error string `json:"error,omitempty"`
VerifiedAt string `json:"verified_at"`
ComponentResults []ComponentVerification `json:"component_results,omitempty"`
DIDResolutions []DIDResolutionResult `json:"did_resolutions,omitempty"`
VerificationSteps []VerificationStep `json:"verification_steps,omitempty"`
Summary VerificationSummary `json:"summary"`
}
VCVerificationResult represents the comprehensive verification result
type VerificationIssue ¶
type VerificationIssue struct {
Type string `json:"type"`
Severity string `json:"severity"` // "critical", "warning", "info"
Component string `json:"component"`
Field string `json:"field"`
Expected string `json:"expected"`
Actual string `json:"actual"`
Description string `json:"description"`
}
VerificationIssue represents a specific verification problem
type VerificationMetadata ¶
type VerificationMetadata struct {
ExportVersion string `json:"export_version"`
TotalSignatures int `json:"total_signatures"`
BundledDIDs int `json:"bundled_dids"`
ExportTimestamp string `json:"export_timestamp"`
}
VerificationMetadata contains metadata about the verification process
type VerificationStep ¶
type VerificationStep struct {
Step int `json:"step"`
Description string `json:"description"`
Success bool `json:"success"`
Details string `json:"details,omitempty"`
Error string `json:"error,omitempty"`
}
VerificationStep represents a single step in the verification process
type VerificationSummary ¶
type VerificationSummary struct {
TotalComponents int `json:"total_components"`
ValidComponents int `json:"valid_components"`
TotalDIDs int `json:"total_dids"`
ResolvedDIDs int `json:"resolved_dids"`
TotalSignatures int `json:"total_signatures"`
ValidSignatures int `json:"valid_signatures"`
}
VerificationSummary provides a high-level summary
type VerifyOptions ¶
VerifyOptions holds verification configuration
type VersionInfo ¶
VersionInfo holds build-time version information
type WorkflowVerification ¶
type WorkflowVerification struct {
WorkflowID string `json:"workflow_id"`
Valid bool `json:"valid"`
SignatureValid bool `json:"signature_valid"`
ComponentConsistency bool `json:"component_consistency"`
TimestampConsistency bool `json:"timestamp_consistency"`
StatusConsistency bool `json:"status_consistency"`
ChainIntegrity bool `json:"chain_integrity"`
Issues []VerificationIssue `json:"issues"`
}
WorkflowVerification represents workflow-level verification results