multiagentspec

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package multiagentspec provides Go types for Multi-Agent Spec definitions.

This package provides structs and utilities for defining multi-agent systems with full JSON serialization support.

Example:

agent := multiagentspec.Agent{
    Name:        "my-agent",
    Description: "A helpful agent",
    Model:       multiagentspec.ModelSonnet,
    Tools:       []string{"Read", "Write"},
}
data, _ := json.MarshalIndent(agent, "", "  ")

Index

Constants

View Source
const BoxTemplate = `` /* 627-byte string literal not displayed */

BoxTemplate is the text/template for the box format report. This is the reference implementation for rendering TeamReport to text. Each task is rendered on its own line with status indicator. Content blocks are rendered after tasks within each team section.

View Source
const NarrativeTemplate = `` /* 1224-byte string literal not displayed */

NarrativeTemplate is the Pandoc-friendly Markdown template. Designed for PDF generation via: pandoc report.md -o report.pdf --pdf-engine=xelatex

Variables

View Source
var AgentKitTools = map[Tool]string{
	ToolWebSearch: "shell",
	ToolWebFetch:  "shell",
	ToolRead:      "read",
	ToolWrite:     "write",
	ToolGlob:      "glob",
	ToolGrep:      "grep",
	ToolBash:      "shell",
	ToolEdit:      "write",
	ToolTask:      "shell",
}

AgentKitTools maps canonical tool names to AgentKit local identifiers.

View Source
var BedrockModels = map[Model]string{
	ModelHaiku:  "anthropic.claude-3-haiku-20240307-v1:0",
	ModelSonnet: "anthropic.claude-3-5-sonnet-20241022-v2:0",
	ModelOpus:   "anthropic.claude-3-opus-20240229-v1:0",
}

BedrockModels maps canonical model names to AWS Bedrock identifiers.

View Source
var ClaudeCodeModels = map[Model]string{
	ModelHaiku:  "haiku",
	ModelSonnet: "sonnet",
	ModelOpus:   "opus",
}

ClaudeCodeModels maps canonical model names to Claude Code identifiers.

View Source
var KiroCLIModels = map[Model]string{
	ModelHaiku:  "claude-haiku-35",
	ModelSonnet: "claude-sonnet-4",
	ModelOpus:   "claude-opus-4",
}

KiroCLIModels maps canonical model names to Kiro CLI identifiers.

View Source
var KiroCLITools = map[Tool]string{
	ToolWebSearch: "web_search",
	ToolWebFetch:  "web_fetch",
	ToolRead:      "read",
	ToolWrite:     "write",
	ToolGlob:      "glob",
	ToolGrep:      "grep",
	ToolBash:      "bash",
	ToolEdit:      "edit",
	ToolTask:      "task",
}

KiroCLITools maps canonical tool names to Kiro CLI identifiers.

Functions

func MapModelToBedrock

func MapModelToBedrock(model Model) string

MapModelToBedrock converts a canonical model to AWS Bedrock format.

func MapModelToClaudeCode

func MapModelToClaudeCode(model Model) string

MapModelToClaudeCode converts a canonical model to Claude Code format.

func MapModelToKiroCLI

func MapModelToKiroCLI(model Model) string

MapModelToKiroCLI converts a canonical model to Kiro CLI format.

func MapToolToAgentKit

func MapToolToAgentKit(tool Tool) string

MapToolToAgentKit converts a canonical tool to AgentKit local format.

func MapToolToKiroCLI

func MapToolToKiroCLI(tool Tool) string

MapToolToKiroCLI converts a canonical tool to Kiro CLI format.

func ParseQualifiedName added in v0.4.0

func ParseQualifiedName(qualifiedName string) (namespace, name string)

ParseQualifiedName splits a qualified agent name into namespace and name parts. Returns empty namespace if no "/" is present.

Examples:

ParseQualifiedName("agent-name")        → ("", "agent-name")
ParseQualifiedName("prd/lead")          → ("prd", "lead")
ParseQualifiedName("shared/review")     → ("shared", "review")

Types

type ADKGoConfig added in v0.3.0

type ADKGoConfig struct {
	Model        string `json:"model,omitempty"`
	ServerPort   int    `json:"serverPort,omitempty"`
	SessionStore string `json:"sessionStore,omitempty"`
	ToolRegistry string `json:"toolRegistry,omitempty"`
}

ADKGoConfig is the configuration for Google Agent Development Kit (Go).

type AWSAgentCoreConfig

type AWSAgentCoreConfig struct {
	Region          string `json:"region"`
	FoundationModel string `json:"foundationModel"`
	IAC             string `json:"iac"`
	LambdaRuntime   string `json:"lambdaRuntime"`
}

AWSAgentCoreConfig is the configuration for AWS AgentCore platform.

type Agent

type Agent struct {
	// Name is the unique identifier for the agent (lowercase, hyphenated).
	Name string `json:"name" yaml:"name"`

	// Namespace is the optional namespace for organizing agents.
	// Derived from subdirectory path if not explicitly set in frontmatter.
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`

	// Description is a brief summary of what the agent does.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`

	// Icon is the icon identifier for visual representation.
	// Formats: 'brandkit:name' (from brandkit repo), 'lucide:name' (Lucide icon),
	// or plain name for inference.
	Icon string `json:"icon,omitempty" yaml:"icon,omitempty"`

	// Model is the capability tier (haiku, sonnet, opus).
	Model Model `json:"model,omitempty" yaml:"model,omitempty"`

	// Tools are the tools available to this agent.
	Tools []string `json:"tools,omitempty" yaml:"tools,omitempty"`

	// AllowedTools are tools that can execute without user confirmation.
	AllowedTools []string `json:"allowedTools,omitempty" yaml:"allowedTools,omitempty"`

	// Skills are capabilities the agent can invoke.
	Skills []string `json:"skills,omitempty" yaml:"skills,omitempty"`

	// Dependencies are other agents this agent depends on.
	Dependencies []string `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`

	// Requires lists external tools or binaries required (e.g., go, git).
	Requires []string `json:"requires,omitempty" yaml:"requires,omitempty"`

	// Instructions is the system prompt for the agent.
	Instructions string `json:"instructions,omitempty" yaml:"instructions,omitempty"`

	// Tasks are the tasks this agent can perform.
	Tasks []Task `json:"tasks,omitempty" yaml:"tasks,omitempty"`
}

Agent represents an agent definition.

func LoadAgentFromFile added in v0.4.0

func LoadAgentFromFile(path string) (*Agent, error)

LoadAgentFromFile loads an Agent from a markdown file with YAML frontmatter.

The file format is:

---
name: agent-name
description: Agent description
model: sonnet
tools: [Read, Write, Bash]
tasks:
  - id: task-id
    description: Task description
---

# Agent Name

Instructions in markdown...

func LoadAgentsFromDir added in v0.4.0

func LoadAgentsFromDir(dir string) ([]*Agent, error)

LoadAgentsFromDir loads all Agent definitions from a directory. It recursively scans subdirectories. Agents in subdirectories have their namespace set to the subdirectory name (relative to the root dir), unless an explicit namespace is specified in the agent's frontmatter.

Example structure:

agents/
├── shared/
│   └── review-board.md    → namespace: "shared", name: "review-board"
├── prd/
│   └── lead.md            → namespace: "prd", name: "lead"
└── orchestrator.md        → namespace: "", name: "orchestrator"

func LoadAgentsFromDirFlat added in v0.4.0

func LoadAgentsFromDirFlat(dir string) ([]*Agent, error)

LoadAgentsFromDirFlat loads agents from a single directory without recursion. This preserves the original non-recursive behavior for cases where subdirectories should be ignored.

func NewAgent

func NewAgent(name, description string) *Agent

NewAgent creates a new Agent with the given name and description.

func ParseAgentMarkdown added in v0.4.0

func ParseAgentMarkdown(data []byte) (*Agent, error)

ParseAgentMarkdown parses an Agent from markdown bytes with YAML frontmatter.

func (*Agent) QualifiedName added in v0.4.0

func (a *Agent) QualifiedName() string

QualifiedName returns the fully qualified agent name. Returns "namespace/name" if namespace is set, otherwise just "name".

func (*Agent) WithInstructions

func (a *Agent) WithInstructions(instructions string) *Agent

WithInstructions sets the agent's instructions and returns the agent for chaining.

func (*Agent) WithModel

func (a *Agent) WithModel(model Model) *Agent

WithModel sets the agent's model and returns the agent for chaining.

func (*Agent) WithNamespace added in v0.4.0

func (a *Agent) WithNamespace(namespace string) *Agent

WithNamespace sets the agent's namespace and returns the agent for chaining.

func (*Agent) WithTools

func (a *Agent) WithTools(tools ...string) *Agent

WithTools sets the agent's tools and returns the agent for chaining.

type AgentKitLocalConfig

type AgentKitLocalConfig struct {
	Transport string `json:"transport"`
	Port      int    `json:"port,omitempty"`
}

AgentKitLocalConfig is the configuration for AgentKit local platform.

type AgentResult added in v0.1.1

type AgentResult struct {
	// Schema is the JSON schema URL for validation
	Schema string `json:"$schema,omitempty"`

	// AgentID identifies the agent (e.g., "pm", "qa", "documentation")
	AgentID string `json:"agent_id"`

	// StepID is the workflow step name (e.g., "pm-validation", "qa-validation")
	StepID string `json:"step_id"`

	// Inputs are values received from upstream agents in the DAG
	Inputs map[string]interface{} `json:"inputs,omitempty"`

	// Outputs are values produced by this agent for downstream agents
	Outputs map[string]interface{} `json:"outputs,omitempty"`

	// Tasks are the individual task results (one per line in reports)
	Tasks []TaskResult `json:"tasks"`

	// ContentBlocks holds rich content produced by this agent.
	// Allows agents to include findings, action items, etc.
	ContentBlocks []ContentBlock `json:"content_blocks,omitempty"`

	// Status is the overall status for this agent (computed from tasks)
	Status Status `json:"status"`

	// ExecutedAt is when the agent completed execution
	ExecutedAt time.Time `json:"executed_at"`

	// AgentModel is the LLM model used (e.g., "sonnet", "haiku", "opus")
	AgentModel string `json:"agent_model,omitempty"`

	// Duration is how long the agent took to execute
	Duration string `json:"duration,omitempty"`

	// Error is set if the agent failed to execute
	Error string `json:"error,omitempty"`
}

AgentResult is the JSON-serializable output from each validation agent. This is the intermediate representation that agents produce and the coordinator consumes to build the final TeamReport.

func ParseAgentResult added in v0.1.1

func ParseAgentResult(data []byte) (*AgentResult, error)

ParseAgentResult parses JSON into an AgentResult.

func (*AgentResult) ComputeStatus added in v0.1.1

func (a *AgentResult) ComputeStatus() Status

ComputeStatus computes the overall status from tasks.

func (*AgentResult) ToTeamSection added in v0.1.1

func (a *AgentResult) ToTeamSection() TeamSection

ToTeamSection converts an AgentResult to a TeamSection for the report.

type AutoGenConfig added in v0.3.0

type AutoGenConfig struct {
	Model                   string               `json:"model,omitempty"`
	HumanInputMode          string               `json:"humanInputMode,omitempty"`
	MaxConsecutiveAutoReply int                  `json:"maxConsecutiveAutoReply,omitempty"`
	CodeExecutionConfig     *CodeExecutionConfig `json:"codeExecutionConfig,omitempty"`
}

AutoGenConfig is the configuration for Microsoft AutoGen deployment.

type Check added in v0.1.1

type Check = TaskResult

Backward compatibility aliases Deprecated: Use TaskResult instead

type ClaudeCodeConfig

type ClaudeCodeConfig struct {
	AgentDir string `json:"agentDir"`
	Format   string `json:"format"`
}

ClaudeCodeConfig is the configuration for Claude Code platform.

type CodeExecutionConfig added in v0.3.0

type CodeExecutionConfig struct {
	WorkDir   string `json:"workDir,omitempty"`
	UseDocker bool   `json:"useDocker,omitempty"`
}

CodeExecutionConfig holds AutoGen code execution settings.

type CombinedWeights added in v0.6.0

type CombinedWeights struct {
	// Rule is the weight for rule-based score (0-1).
	Rule float64 `json:"rule"`

	// LLM is the weight for LLM score (0-1).
	LLM float64 `json:"llm"`
}

CombinedWeights specifies weighting for combined rule + LLM evaluation.

type ContentBlock added in v0.6.0

type ContentBlock struct {
	// Type discriminates the block variant.
	Type ContentBlockType `json:"type"`

	// Title is an optional section heading.
	Title string `json:"title,omitempty"`

	// Pairs holds key-value data (for kv_pairs type).
	Pairs []KVPair `json:"pairs,omitempty"`

	// Items holds list entries (for list type).
	Items []ListItem `json:"items,omitempty"`

	// Headers holds table column headers (for table type).
	Headers []string `json:"headers,omitempty"`

	// Rows holds table data rows (for table type).
	Rows [][]string `json:"rows,omitempty"`

	// Content holds multi-line text (for text type).
	Content string `json:"content,omitempty"`

	// Label is the metric name (for metric type).
	Label string `json:"label,omitempty"`

	// Value is the metric value (for metric type).
	Value string `json:"value,omitempty"`

	// Status is used for metric blocks to indicate health.
	Status Status `json:"status,omitempty"`

	// Target is the target value for metric blocks (e.g., "80%").
	Target string `json:"target,omitempty"`
}

ContentBlock represents rich content within a report section. The Type field determines which other fields are relevant:

  • kv_pairs: uses Pairs
  • list: uses Items
  • table: uses Headers, Rows
  • text: uses Content
  • metric: uses Label, Value, Status

func NewKVPairsBlock added in v0.6.0

func NewKVPairsBlock(title string, pairs ...KVPair) ContentBlock

NewKVPairsBlock creates a kv_pairs content block.

func NewListBlock added in v0.6.0

func NewListBlock(title string, items ...ListItem) ContentBlock

NewListBlock creates a list content block.

func NewMetricBlock added in v0.6.0

func NewMetricBlock(label, value string, status Status, target string) ContentBlock

NewMetricBlock creates a metric content block. Target is optional - pass empty string to omit.

func NewTableBlock added in v0.6.0

func NewTableBlock(title string, headers []string, rows [][]string) ContentBlock

NewTableBlock creates a table content block.

func NewTextBlock added in v0.6.0

func NewTextBlock(title, content string) ContentBlock

NewTextBlock creates a text content block.

type ContentBlockType added in v0.6.0

type ContentBlockType string

ContentBlockType discriminates content block variants.

const (
	ContentBlockKVPairs ContentBlockType = "kv_pairs"
	ContentBlockList    ContentBlockType = "list"
	ContentBlockTable   ContentBlockType = "table"
	ContentBlockText    ContentBlockType = "text"
	ContentBlockMetric  ContentBlockType = "metric"
)

func (ContentBlockType) JSONSchema added in v0.6.0

func (ContentBlockType) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for ContentBlockType type.

type CrewAIConfig added in v0.3.0

type CrewAIConfig struct {
	Model         string `json:"model,omitempty"`
	Verbose       bool   `json:"verbose,omitempty"`
	Memory        bool   `json:"memory,omitempty"`
	ProcessType   string `json:"processType,omitempty"`
	MaxIterations int    `json:"maxIterations,omitempty"`
}

CrewAIConfig is the configuration for CrewAI deployment.

type Deployment

type Deployment struct {
	// Schema is the JSON Schema reference.
	Schema string `json:"$schema,omitempty"`

	// Team is the reference to the team definition (team name).
	Team string `json:"team"`

	// Targets is the list of deployment targets.
	Targets []Target `json:"targets"`
}

Deployment represents a deployment definition.

func LoadDeploymentFromFile added in v0.4.0

func LoadDeploymentFromFile(path string) (*Deployment, error)

LoadDeploymentFromFile loads a Deployment from a JSON file.

func NewDeployment

func NewDeployment(team string) *Deployment

NewDeployment creates a new Deployment for the given team.

func (*Deployment) AddTarget

func (d *Deployment) AddTarget(target Target) *Deployment

AddTarget adds a deployment target and returns the deployment for chaining.

type DeploymentMode added in v0.3.0

type DeploymentMode string

DeploymentMode represents the deployment execution mode.

const (
	ModeSingleProcess DeploymentMode = "single-process"
	ModeMultiProcess  DeploymentMode = "multi-process"
	ModeDistributed   DeploymentMode = "distributed"
	ModeServerless    DeploymentMode = "serverless"
)

func (DeploymentMode) JSONSchema added in v0.5.0

func (DeploymentMode) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for DeploymentMode type.

type DockerComposeConfig added in v0.3.0

type DockerComposeConfig struct {
	NetworkMode string `json:"networkMode,omitempty"`
}

DockerComposeConfig is the configuration for Docker Compose deployment.

type Effort added in v0.6.0

type Effort string

Effort estimates the work required to address an issue.

const (
	// EffortTrivial indicates minimal effort (< 15 minutes).
	EffortTrivial Effort = "trivial"

	// EffortLow indicates small effort (< 1 hour).
	EffortLow Effort = "low"

	// EffortMedium indicates moderate effort (1-4 hours).
	EffortMedium Effort = "medium"

	// EffortHigh indicates significant effort (> 4 hours).
	EffortHigh Effort = "high"
)

type EvaluationType added in v0.6.0

type EvaluationType string

EvaluationType discriminates between rule-based and LLM evaluation.

const (
	// EvaluationTypeRule indicates deterministic rule-based evaluation.
	EvaluationTypeRule EvaluationType = "rule"

	// EvaluationTypeLLM indicates LLM-based semantic evaluation.
	EvaluationTypeLLM EvaluationType = "llm"

	// EvaluationTypeCombined indicates both rule-based and LLM evaluation.
	EvaluationTypeCombined EvaluationType = "combined"
)

type GeminiCLIConfig added in v0.3.0

type GeminiCLIConfig struct {
	Model     string `json:"model,omitempty"`
	ConfigDir string `json:"configDir,omitempty"`
}

GeminiCLIConfig is the configuration for Google Gemini CLI Assistant.

type Issue added in v0.6.0

type Issue struct {
	// ID is the issue identifier (e.g., "ISS-001").
	ID string `json:"id"`

	// Category is the evaluation category this issue belongs to.
	Category string `json:"category"`

	// Severity indicates how serious the issue is.
	Severity Severity `json:"severity"`

	// Problem describes what the issue is.
	Problem string `json:"problem"`

	// Location indicates where in the document the issue occurs
	// (e.g., "requirements.functional[2]", "executiveSummary.problemStatement").
	Location string `json:"location,omitempty"`

	// Analysis explains why this is a problem.
	Analysis string `json:"analysis,omitempty"`

	// Recommendation describes how to fix the issue.
	Recommendation string `json:"recommendation,omitempty"`

	// Example provides sample improved text or structure.
	Example string `json:"example,omitempty"`

	// Effort estimates the work required to fix this issue.
	Effort Effort `json:"effort,omitempty"`

	// RelatedIssues lists IDs of related issues.
	RelatedIssues []string `json:"relatedIssues,omitempty"`
}

Issue represents a specific problem identified in evaluation. Used in narrative reports for detailed fix guidance.

type KVPair added in v0.6.0

type KVPair struct {
	// Key is the label/identifier.
	Key string `json:"key"`

	// Value is the associated value.
	Value string `json:"value"`

	// Icon is an optional prefix icon (e.g., "🔴", "🟡").
	Icon string `json:"icon,omitempty"`
}

KVPair is a key-value pair with optional icon.

type KiroCLIConfig

type KiroCLIConfig struct {
	PluginDir string `json:"pluginDir"`
	Format    string `json:"format"`
}

KiroCLIConfig is the configuration for Kiro CLI platform.

type KubernetesConfig

type KubernetesConfig struct {
	Namespace      string          `json:"namespace"`
	HelmChart      bool            `json:"helmChart"`
	ImageRegistry  string          `json:"imageRegistry,omitempty"`
	ResourceLimits *ResourceLimits `json:"resourceLimits,omitempty"`
}

KubernetesConfig is the configuration for Kubernetes platforms.

type LLMEvaluation added in v0.6.0

type LLMEvaluation struct {
	// Score is the numeric score from LLM evaluation (typically 0-10).
	Score float64 `json:"score"`

	// MaxScore is the maximum possible score (default: 10).
	MaxScore float64 `json:"maxScore,omitempty"`

	// Confidence is the LLM's confidence in the evaluation (0-1 scale).
	Confidence float64 `json:"confidence,omitempty"`

	// Reasoning is the LLM's explanation of the score.
	Reasoning string `json:"reasoning,omitempty"`

	// Strengths are positive aspects identified by the LLM.
	Strengths []string `json:"strengths,omitempty"`

	// Concerns are issues or problems identified by the LLM.
	Concerns []string `json:"concerns,omitempty"`

	// Suggestions are actionable recommendations for improvement.
	Suggestions []string `json:"suggestions,omitempty"`

	// Model is the LLM model used (e.g., "claude-sonnet-4", "gpt-4").
	Model string `json:"model"`

	// Provider is the LLM provider (e.g., "anthropic", "openai", "bedrock").
	Provider string `json:"provider,omitempty"`

	// TokensUsed is the total tokens consumed for this evaluation.
	TokensUsed int `json:"tokensUsed,omitempty"`

	// LatencyMs is the LLM API response time in milliseconds.
	LatencyMs int `json:"latencyMs,omitempty"`

	// PromptVersion is a version identifier for the evaluation prompt.
	// Used for reproducibility and prompt iteration tracking.
	PromptVersion string `json:"promptVersion,omitempty"`
}

LLMEvaluation contains LLM-based evaluation results. This is the nested "llm" object in evaluation results when EvaluationType is "llm" or "combined".

type ListItem added in v0.6.0

type ListItem struct {
	// Text is the item content.
	Text string `json:"text"`

	// Icon is an optional prefix icon.
	Icon string `json:"icon,omitempty"`

	// Status allows automatic icon selection if Icon is empty.
	Status Status `json:"status,omitempty"`
}

ListItem is a list entry with optional icon and status.

func (ListItem) EffectiveIcon added in v0.6.0

func (li ListItem) EffectiveIcon() string

EffectiveIcon returns the Icon if set, otherwise derives from Status.

type LoggingConfig added in v0.3.0

type LoggingConfig struct {
	Level  string `json:"level,omitempty"`
	Format string `json:"format,omitempty"`
}

LoggingConfig holds logging configuration.

type MetricsConfig added in v0.3.0

type MetricsConfig struct {
	Enabled  bool   `json:"enabled,omitempty"`
	Exporter string `json:"exporter,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
}

MetricsConfig holds metrics collection configuration.

type Model

type Model string

Model represents the model capability tier.

const (
	ModelHaiku  Model = "haiku"
	ModelSonnet Model = "sonnet"
	ModelOpus   Model = "opus"
)

func (Model) JSONSchema added in v0.5.0

func (Model) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for Model type.

type NarrativeRenderer added in v0.6.0

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

NarrativeRenderer renders TeamReport to Pandoc-friendly Markdown. Output is designed for conversion to PDF via:

pandoc report.md -o report.pdf --pdf-engine=xelatex

func NewNarrativeRenderer added in v0.6.0

func NewNarrativeRenderer(w io.Writer) *NarrativeRenderer

NewNarrativeRenderer creates a new NarrativeRenderer writing to w.

func (*NarrativeRenderer) Render added in v0.6.0

func (r *NarrativeRenderer) Render(report *TeamReport) error

Render renders the report as Pandoc-friendly Markdown. No emojis are used - status is rendered as text (PASS, FAIL, WARNING, SKIP).

type NarrativeSection added in v0.6.0

type NarrativeSection struct {
	// Problem describes the issue or context being addressed.
	Problem string `json:"problem,omitempty"`

	// Analysis contains the detailed findings.
	Analysis string `json:"analysis,omitempty"`

	// Recommendation describes the suggested action.
	Recommendation string `json:"recommendation,omitempty"`
}

NarrativeSection holds prose content for narrative reports.

type ObservabilityConfig added in v0.3.0

type ObservabilityConfig struct {
	// Tracing contains distributed tracing settings.
	Tracing *TracingConfig `json:"tracing,omitempty"`

	// Metrics contains metrics collection settings.
	Metrics *MetricsConfig `json:"metrics,omitempty"`

	// Logging contains logging configuration.
	Logging *LoggingConfig `json:"logging,omitempty"`
}

ObservabilityConfig holds observability and monitoring configuration.

type Platform

type Platform string

Platform represents supported deployment platforms.

const (
	PlatformClaudeCode    Platform = "claude-code"
	PlatformGeminiCLI     Platform = "gemini-cli"
	PlatformKiroCLI       Platform = "kiro-cli"
	PlatformADKGo         Platform = "adk-go"
	PlatformCrewAI        Platform = "crewai"
	PlatformAutoGen       Platform = "autogen"
	PlatformAWSAgentCore  Platform = "aws-agentcore"
	PlatformAWSEKS        Platform = "aws-eks"
	PlatformAzureAKS      Platform = "azure-aks"
	PlatformGCPGKE        Platform = "gcp-gke"
	PlatformKubernetes    Platform = "kubernetes"
	PlatformDockerCompose Platform = "docker-compose"
	PlatformAgentKitLocal Platform = "agentkit-local"
)

func (Platform) JSONSchema added in v0.5.0

func (Platform) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for Platform type.

type Port added in v0.3.0

type Port struct {
	// Name is the port identifier (e.g., version_recommendation, test_results).
	Name string `json:"name"`

	// Type is the data type of this port.
	Type PortType `json:"type,omitempty"`

	// Description is a human-readable description of this data.
	Description string `json:"description,omitempty"`

	// Required indicates whether this input is required (inputs only).
	Required *bool `json:"required,omitempty"`

	// From is the source reference as 'step_name.output_name' (inputs only).
	From string `json:"from,omitempty"`

	// Schema is a JSON Schema for validating this port's data.
	Schema json.RawMessage `json:"schema,omitempty"`

	// Default is the default value if not provided (inputs only).
	Default interface{} `json:"default,omitempty"`
}

Port represents a typed input or output for a workflow step.

type PortType added in v0.3.0

type PortType string

PortType represents the data type of a port.

const (
	PortTypeString  PortType = "string"
	PortTypeNumber  PortType = "number"
	PortTypeBoolean PortType = "boolean"
	PortTypeObject  PortType = "object"
	PortTypeArray   PortType = "array"
	PortTypeFile    PortType = "file"
)

func (PortType) JSONSchema added in v0.5.0

func (PortType) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for PortType type.

type Priority

type Priority string

Priority represents deployment priority levels.

const (
	PriorityP1 Priority = "p1"
	PriorityP2 Priority = "p2"
	PriorityP3 Priority = "p3"
)

func (Priority) JSONSchema added in v0.5.0

func (Priority) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for Priority type.

type Renderer added in v0.1.1

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

Renderer renders TeamReport to various formats.

func NewRenderer added in v0.1.1

func NewRenderer(w io.Writer) *Renderer

NewRenderer creates a new Renderer writing to w.

func (*Renderer) Render added in v0.1.1

func (r *Renderer) Render(report *TeamReport) error

Render renders the report using the box template. It automatically sorts teams by DAG order before rendering.

type ResourceLimits

type ResourceLimits struct {
	CPU    string `json:"cpu,omitempty"`
	Memory string `json:"memory,omitempty"`
	GPU    int    `json:"gpu,omitempty"`
}

ResourceLimits defines resource limits for step execution.

type RetryPolicy added in v0.3.0

type RetryPolicy struct {
	// MaxAttempts is the maximum number of retry attempts.
	MaxAttempts int `json:"max_attempts,omitempty"`

	// Backoff is the backoff strategy (fixed, exponential, linear).
	Backoff string `json:"backoff,omitempty"`

	// InitialDelay is the initial delay before first retry.
	InitialDelay string `json:"initial_delay,omitempty"`

	// MaxDelay is the maximum delay between retries.
	MaxDelay string `json:"max_delay,omitempty"`

	// RetryableErrors are error types that should trigger retry.
	RetryableErrors []string `json:"retryable_errors,omitempty"`
}

RetryPolicy defines the retry behavior for step failures.

type RuntimeConfig added in v0.3.0

type RuntimeConfig struct {
	// Defaults are the default runtime settings for all steps.
	Defaults *StepRuntime `json:"defaults,omitempty"`

	// Steps contains per-step runtime overrides keyed by step name.
	Steps map[string]*StepRuntime `json:"steps,omitempty"`

	// Observability contains monitoring and tracing settings.
	Observability *ObservabilityConfig `json:"observability,omitempty"`
}

RuntimeConfig holds runtime configuration for workflow execution.

type Severity added in v0.6.0

type Severity string

Severity indicates how serious an issue is.

const (
	// SeverityCritical indicates a blocking issue that must be fixed.
	SeverityCritical Severity = "critical"

	// SeverityMajor indicates a significant issue that should be fixed.
	SeverityMajor Severity = "major"

	// SeverityMinor indicates a small issue that could be fixed.
	SeverityMinor Severity = "minor"

	// SeveritySuggestion indicates an optional improvement.
	SeveritySuggestion Severity = "suggestion"
)

type Status added in v0.1.1

type Status string

Status represents the validation status following NASA Go/No-Go terminology.

const (
	StatusGo   Status = "GO"
	StatusWarn Status = "WARN"
	StatusNoGo Status = "NO-GO"
	StatusSkip Status = "SKIP"
)

func (Status) Icon added in v0.1.1

func (s Status) Icon() string

Icon returns the UTF-8 icon for the status.

func (Status) JSONSchema added in v0.5.0

func (Status) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for Status type.

type Step

type Step struct {
	// Name is the step identifier.
	Name string `json:"name"`

	// Agent is the agent to execute this step.
	Agent string `json:"agent"`

	// DependsOn lists steps that must complete before this step.
	DependsOn []string `json:"depends_on,omitempty"`

	// Inputs are typed data inputs consumed by this step.
	Inputs []Port `json:"inputs,omitempty"`

	// Outputs are typed data outputs produced by this step.
	Outputs []Port `json:"outputs,omitempty"`
}

Step represents a workflow step definition.

type StepRuntime added in v0.3.0

type StepRuntime struct {
	// Timeout is the step timeout (e.g., 30s, 5m, 1h).
	Timeout string `json:"timeout,omitempty"`

	// Retry is the retry policy for step failures.
	Retry *RetryPolicy `json:"retry,omitempty"`

	// Condition is a condition expression for conditional execution.
	Condition string `json:"condition,omitempty"`

	// Concurrency is the max concurrent executions of this step.
	Concurrency int `json:"concurrency,omitempty"`

	// Resources are resource limits for this step.
	Resources *ResourceLimits `json:"resources,omitempty"`
}

StepRuntime holds runtime settings for a workflow step.

type Target

type Target struct {
	// Name is the unique name for this deployment target.
	Name string `json:"name"`

	// Platform is the target platform for deployment.
	Platform Platform `json:"platform"`

	// Mode is the deployment mode affecting runtime behavior.
	Mode DeploymentMode `json:"mode,omitempty"`

	// Priority is the deployment priority.
	Priority Priority `json:"priority,omitempty"`

	// Output is the directory for generated deployment artifacts.
	Output string `json:"output,omitempty"`

	// Runtime is the runtime configuration for workflow execution.
	Runtime *RuntimeConfig `json:"runtime,omitempty"`

	// Platform-specific configurations (use the one matching Platform field)
	ClaudeCode    *ClaudeCodeConfig    `json:"claudeCode,omitempty"`
	GeminiCLI     *GeminiCLIConfig     `json:"geminiCli,omitempty"`
	KiroCLI       *KiroCLIConfig       `json:"kiroCli,omitempty"`
	ADKGo         *ADKGoConfig         `json:"adkGo,omitempty"`
	CrewAI        *CrewAIConfig        `json:"crewai,omitempty"`
	AutoGen       *AutoGenConfig       `json:"autogen,omitempty"`
	AWSAgentCore  *AWSAgentCoreConfig  `json:"awsAgentCore,omitempty"`
	Kubernetes    *KubernetesConfig    `json:"kubernetes,omitempty"`
	DockerCompose *DockerComposeConfig `json:"dockerCompose,omitempty"`
	AgentKitLocal *AgentKitLocalConfig `json:"agentKitLocal,omitempty"`
}

Target represents a deployment target definition.

type Task added in v0.3.0

type Task struct {
	// ID is the unique task identifier within this agent.
	ID string `json:"id"`

	// Description describes what this task validates or accomplishes.
	Description string `json:"description,omitempty"`

	// Type is how the task is executed (command, pattern, file, manual).
	Type TaskType `json:"type,omitempty"`

	// Command is the shell command to execute (for type: command).
	Command string `json:"command,omitempty"`

	// Pattern is the regex pattern to search for (for type: pattern).
	Pattern string `json:"pattern,omitempty"`

	// File is the file path to check (for type: file).
	File string `json:"file,omitempty"`

	// Files is a glob pattern for files to check (for type: pattern).
	Files string `json:"files,omitempty"`

	// Required indicates if task failure causes agent to report NO-GO.
	Required *bool `json:"required,omitempty"`

	// ExpectedOutput describes what constitutes success.
	ExpectedOutput string `json:"expected_output,omitempty"`

	// HumanInLoop describes when to prompt for human intervention.
	HumanInLoop string `json:"human_in_loop,omitempty"`
}

Task represents a task that an agent can perform.

type TaskResult added in v0.2.0

type TaskResult struct {
	// ID is the task identifier (matches task id in agent definition)
	ID string `json:"id"`

	// Status is GO, WARN, NO-GO, or SKIP
	Status Status `json:"status"`

	// Detail is optional additional information about the result
	Detail string `json:"detail,omitempty"`

	// DurationMs is the task execution time in milliseconds
	DurationMs int64 `json:"duration_ms,omitempty"`

	// Metadata allows tasks to include structured data
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

TaskResult represents the result of executing a single task. Each task corresponds to a task defined in the agent's task list.

type TaskType added in v0.3.0

type TaskType string

TaskType represents how a task is executed.

const (
	TaskTypeCommand TaskType = "command"
	TaskTypePattern TaskType = "pattern"
	TaskTypeFile    TaskType = "file"
	TaskTypeManual  TaskType = "manual"
)

func (TaskType) JSONSchema added in v0.5.0

func (TaskType) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for TaskType type.

type Team

type Team struct {
	// Name is the team identifier (e.g., stats-agent-team).
	Name string `json:"name"`

	// Version is the semantic version of the team definition.
	Version string `json:"version"`

	// Description is a brief summary of the team's purpose.
	Description string `json:"description,omitempty"`

	// Agents is the list of agent names in the team.
	Agents []string `json:"agents"`

	// Orchestrator is the name of the orchestrator agent.
	Orchestrator string `json:"orchestrator,omitempty"`

	// Workflow is the workflow definition for agent coordination.
	Workflow *Workflow `json:"workflow,omitempty"`

	// Context is shared background information for all agents.
	Context string `json:"context,omitempty"`
}

Team represents a team definition.

func LoadTeamFromFile added in v0.4.0

func LoadTeamFromFile(path string) (*Team, error)

LoadTeamFromFile loads a Team from a JSON file.

func NewTeam

func NewTeam(name, version string) *Team

NewTeam creates a new Team with the given name and version.

func (*Team) WithAgents

func (t *Team) WithAgents(agents ...string) *Team

WithAgents sets the team's agents and returns the team for chaining.

func (*Team) WithOrchestrator

func (t *Team) WithOrchestrator(orchestrator string) *Team

WithOrchestrator sets the orchestrator and returns the team for chaining.

func (*Team) WithWorkflow

func (t *Team) WithWorkflow(workflow *Workflow) *Team

WithWorkflow sets the workflow and returns the team for chaining.

type TeamReport added in v0.1.1

type TeamReport struct {
	// Schema is the JSON schema URL for validation
	Schema string `json:"$schema,omitempty"`

	// Title is the report title (e.g., "CUSTOM EXTENSION ANALYSIS REPORT").
	// If empty, defaults to "TEAM STATUS REPORT" in rendering.
	Title string `json:"title,omitempty"`

	// Project is the repository identifier
	Project string `json:"project"`

	// Version is the target release version
	Version string `json:"version"`

	// Target is a human-readable target description
	Target string `json:"target,omitempty"`

	// Phase is the workflow phase (e.g., "PHASE 1: REVIEW")
	Phase string `json:"phase"`

	// SummaryBlocks appear after the header, before the phase.
	// For metadata, disposition, use-case descriptions.
	SummaryBlocks []ContentBlock `json:"summary_blocks,omitempty"`

	// Teams are the validation teams/agents
	Teams []TeamSection `json:"teams"`

	// FooterBlocks appear after all teams, before the final message.
	// For action items, recommendations, required follow-ups.
	FooterBlocks []ContentBlock `json:"footer_blocks,omitempty"`

	// Summary is the executive summary for narrative reports.
	Summary string `json:"summary,omitempty"`

	// Conclusion is the closing section for narrative reports.
	Conclusion string `json:"conclusion,omitempty"`

	// Status is the overall status (computed from teams)
	Status Status `json:"status"`

	// GeneratedAt is when the report was generated
	GeneratedAt time.Time `json:"generated_at"`

	// GeneratedBy identifies the coordinator
	GeneratedBy string `json:"generated_by,omitempty"`
}

TeamReport is the complete JSON-serializable report. This is what the coordinator produces by aggregating AgentResults.

func AggregateResults added in v0.1.1

func AggregateResults(results []AgentResult, project, version, phase string) *TeamReport

AggregateResults combines multiple AgentResults into a TeamReport.

func ParseTeamReport added in v0.1.1

func ParseTeamReport(data []byte) (*TeamReport, error)

ParseTeamReport parses JSON into a TeamReport.

func (*TeamReport) ComputeOverallStatus added in v0.1.1

func (r *TeamReport) ComputeOverallStatus() Status

ComputeOverallStatus computes the overall status from all teams.

func (*TeamReport) EffectiveTitle added in v0.6.0

func (r *TeamReport) EffectiveTitle() string

EffectiveTitle returns Title if set, otherwise the default.

func (*TeamReport) FinalMessage added in v0.1.1

func (r *TeamReport) FinalMessage() string

FinalMessage returns the final status message for display.

func (*TeamReport) IsGo added in v0.1.1

func (r *TeamReport) IsGo() bool

IsGo returns true if all teams pass validation.

func (*TeamReport) SortByDAG added in v0.1.2

func (r *TeamReport) SortByDAG()

SortByDAG sorts teams in topological order based on DependsOn relationships. Teams with no dependencies appear first, followed by teams whose dependencies have been satisfied. This uses Kahn's algorithm for topological sorting. Teams at the same level are sorted alphabetically by ID for deterministic output. If the DAG has cycles, teams in cycles appear at the end in their original order.

func (*TeamReport) ToJSON added in v0.1.1

func (r *TeamReport) ToJSON() ([]byte, error)

ToJSON serializes the report to JSON.

type TeamSection added in v0.1.1

type TeamSection struct {
	// ID is the workflow step ID (e.g., "pm-validation")
	ID string `json:"id"`

	// Name is the agent name (e.g., "pm")
	Name string `json:"name"`

	// AgentID matches the agent definition in team.json
	AgentID string `json:"agent_id,omitempty"`

	// Model is the LLM model used
	Model string `json:"model,omitempty"`

	// DependsOn lists the IDs of upstream teams in the DAG
	DependsOn []string `json:"depends_on,omitempty"`

	// Tasks are the task results for this team (one per line in reports).
	// Optional: teams can use ContentBlocks instead of or in addition to Tasks.
	Tasks []TaskResult `json:"tasks,omitempty"`

	// Status is the overall status (computed from tasks)
	Status Status `json:"status"`

	// ContentBlocks holds rich content for this team section.
	// Supports lists, kv_pairs, tables, text, metrics.
	ContentBlocks []ContentBlock `json:"content_blocks,omitempty"`

	// Narrative holds prose content for narrative reports.
	Narrative *NarrativeSection `json:"narrative,omitempty"`
}

TeamSection represents a team/agent section in the report.

func (*TeamSection) OverallStatus added in v0.1.1

func (t *TeamSection) OverallStatus() Status

OverallStatus computes the overall status for a team section.

type Tool

type Tool string

Tool represents canonical tool names available to agents.

const (
	ToolWebSearch Tool = "WebSearch"
	ToolWebFetch  Tool = "WebFetch"
	ToolRead      Tool = "Read"
	ToolWrite     Tool = "Write"
	ToolGlob      Tool = "Glob"
	ToolGrep      Tool = "Grep"
	ToolBash      Tool = "Bash"
	ToolEdit      Tool = "Edit"
	ToolTask      Tool = "Task"
)

func (Tool) JSONSchema added in v0.5.0

func (Tool) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for Tool type.

type TracingConfig added in v0.3.0

type TracingConfig struct {
	Enabled    bool    `json:"enabled,omitempty"`
	Exporter   string  `json:"exporter,omitempty"`
	Endpoint   string  `json:"endpoint,omitempty"`
	SampleRate float64 `json:"sample_rate,omitempty"`
}

TracingConfig holds distributed tracing configuration.

type Workflow

type Workflow struct {
	// Type is the workflow execution pattern.
	Type WorkflowType `json:"type,omitempty"`

	// Steps are the ordered steps in the workflow.
	Steps []Step `json:"steps,omitempty"`
}

Workflow represents a workflow definition.

type WorkflowType

type WorkflowType string

WorkflowType represents the workflow execution pattern.

const (
	WorkflowSequential   WorkflowType = "sequential"
	WorkflowParallel     WorkflowType = "parallel"
	WorkflowDAG          WorkflowType = "dag"
	WorkflowOrchestrated WorkflowType = "orchestrated"
)

func (WorkflowType) JSONSchema added in v0.5.0

func (WorkflowType) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for WorkflowType type.

Jump to

Keyboard shortcuts

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