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
- Variables
- func MapModelToBedrock(model Model) string
- func MapModelToClaudeCode(model Model) string
- func MapModelToKiroCLI(model Model) string
- func MapToolToAgentKit(tool Tool) string
- func MapToolToKiroCLI(tool Tool) string
- func ParseQualifiedName(qualifiedName string) (namespace, name string)
- type ADKGoConfig
- type AWSAgentCoreConfig
- type Agent
- type AgentKitLocalConfig
- type AgentResult
- type AutoGenConfig
- type Check
- type ClaudeCodeConfig
- type CodeExecutionConfig
- type CrewAIConfig
- type Deployment
- type DeploymentMode
- type DockerComposeConfig
- type GeminiCLIConfig
- type KiroCLIConfig
- type KubernetesConfig
- type LoggingConfig
- type MetricsConfig
- type Model
- type ObservabilityConfig
- type Platform
- type Port
- type PortType
- type Priority
- type Renderer
- type ResourceLimits
- type RetryPolicy
- type RuntimeConfig
- type Status
- type Step
- type StepRuntime
- type Target
- type Task
- type TaskResult
- type TaskType
- type Team
- type TeamReport
- type TeamSection
- type Tool
- type TracingConfig
- type Workflow
- type WorkflowType
Constants ¶
const BoxTemplate = `` /* 368-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.
Variables ¶
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.
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.
var ClaudeCodeModels = map[Model]string{
ModelHaiku: "haiku",
ModelSonnet: "sonnet",
ModelOpus: "opus",
}
ClaudeCodeModels maps canonical model names to Claude Code identifiers.
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.
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 ¶
MapModelToBedrock converts a canonical model to AWS Bedrock format.
func MapModelToClaudeCode ¶
MapModelToClaudeCode converts a canonical model to Claude Code format.
func MapModelToKiroCLI ¶
MapModelToKiroCLI converts a canonical model to Kiro CLI format.
func MapToolToAgentKit ¶
MapToolToAgentKit converts a canonical tool to AgentKit local format.
func MapToolToKiroCLI ¶
MapToolToKiroCLI converts a canonical tool to Kiro CLI format.
func ParseQualifiedName ¶ added in v0.4.0
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
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
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
LoadAgentsFromDirFlat loads agents from a single directory without recursion. This preserves the original non-recursive behavior for cases where subdirectories should be ignored.
func ParseAgentMarkdown ¶ added in v0.4.0
ParseAgentMarkdown parses an Agent from markdown bytes with YAML frontmatter.
func (*Agent) QualifiedName ¶ added in v0.4.0
QualifiedName returns the fully qualified agent name. Returns "namespace/name" if namespace is set, otherwise just "name".
func (*Agent) WithInstructions ¶
WithInstructions sets the agent's instructions and returns the agent for chaining.
func (*Agent) WithNamespace ¶ added in v0.4.0
WithNamespace sets the agent's namespace 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"`
// 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 ¶
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 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 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 KiroCLIConfig ¶
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 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.
func (Model) JSONSchema ¶ added in v0.5.0
func (Model) JSONSchema() *jsonschema.Schema
JSONSchema implements jsonschema.Schema for Model type.
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.
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.
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
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 Status ¶ added in v0.1.1
type Status string
Status represents the validation status following NASA Go/No-Go terminology.
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.
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
LoadTeamFromFile loads a Team from a JSON file.
func (*Team) WithAgents ¶
WithAgents sets the team's agents and returns the team for chaining.
func (*Team) WithOrchestrator ¶
WithOrchestrator sets the orchestrator and returns the team for chaining.
func (*Team) WithWorkflow ¶
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"`
// 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"`
// Teams are the validation teams/agents
Teams []TeamSection `json:"teams"`
// 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) 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)
Tasks []TaskResult `json:"tasks"`
// Status is the overall status (computed from tasks)
Status Status `json:"status"`
}
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.
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.