kiro

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package kiro provides the AWS Kiro CLI agent adapter.

Index

Constants

View Source
const (
	// AdapterName is the identifier for this adapter.
	AdapterName = "kiro"

	// AgentsDir is the agents directory name.
	AgentsDir = "agents"

	// ProjectConfigDir is the project config directory.
	ProjectConfigDir = ".kiro"
)

Variables

This section is empty.

Functions

func ReadUserAgent

func ReadUserAgent(name string) (*core.Agent, error)

ReadUserAgent reads a user-level agent configuration.

func UserAgentPath

func UserAgentPath(name string) (string, error)

UserAgentPath returns the path to a specific user agent config.

func UserAgentsPath

func UserAgentsPath() (string, error)

UserAgentsPath returns the path to the user's agents directory.

func WriteUserAgent

func WriteUserAgent(agent *core.Agent) error

WriteUserAgent writes an agent to the user's agents directory.

Types

type Adapter

type Adapter struct{}

Adapter converts between canonical Agent and Kiro CLI agent format.

func (*Adapter) DefaultDir

func (a *Adapter) DefaultDir() string

DefaultDir returns the default directory name for Kiro agents.

func (*Adapter) FileExtension

func (a *Adapter) FileExtension() string

FileExtension returns the file extension for Kiro agents.

func (*Adapter) FromCore

func (a *Adapter) FromCore(agent *core.Agent) *AgentConfig

FromCore converts canonical Agent to Kiro agent config.

func (*Adapter) Marshal

func (a *Adapter) Marshal(agent *core.Agent) ([]byte, error)

Marshal converts canonical Agent to Kiro agent JSON bytes.

func (*Adapter) Name

func (a *Adapter) Name() string

Name returns the adapter identifier.

func (*Adapter) Parse

func (a *Adapter) Parse(data []byte) (*core.Agent, error)

Parse converts Kiro agent JSON bytes to canonical Agent.

func (*Adapter) ReadFile

func (a *Adapter) ReadFile(path string) (*core.Agent, error)

ReadFile reads a Kiro agent JSON file and returns canonical Agent.

func (*Adapter) ToCore

func (a *Adapter) ToCore(kiroCfg *AgentConfig) *core.Agent

ToCore converts Kiro agent config to canonical Agent.

func (*Adapter) WriteFile

func (a *Adapter) WriteFile(agent *core.Agent, path string) error

WriteFile writes canonical Agent to a Kiro agent JSON file.

type AgentConfig

type AgentConfig struct {
	// Name is the agent identifier.
	Name string `json:"name"`

	// Description is a human-readable description of the agent's purpose.
	Description string `json:"description,omitempty"`

	// Tools lists the tools available to this agent.
	// Built-in tools: read, write, shell, web_search, web_fetch, etc.
	Tools []string `json:"tools,omitempty"`

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

	// Resources lists file paths or glob patterns for context.
	// Uses file:// prefix, e.g., "file://README.md", "file://.kiro/steering/**/*.md"
	Resources []string `json:"resources,omitempty"`

	// Prompt contains the system instructions for the agent.
	Prompt string `json:"prompt,omitempty"`

	// Model specifies the Claude model to use (e.g., "claude-sonnet-4").
	Model string `json:"model,omitempty"`

	// MCPServers defines MCP server configurations for this agent.
	MCPServers map[string]MCPServerConfig `json:"mcpServers,omitempty"`

	// IncludeMcpJson determines whether to inherit servers from workspace/user config.
	IncludeMcpJson bool `json:"includeMcpJson,omitempty"`
}

AgentConfig represents a Kiro CLI custom agent configuration. File location: ~/.kiro/agents/[agent-name].json

type MCPServerConfig

type MCPServerConfig struct {
	// Command is the executable to launch for stdio servers.
	Command string `json:"command,omitempty"`

	// Args are command-line arguments for the server.
	Args []string `json:"args,omitempty"`

	// Env contains environment variables for the server process.
	Env map[string]string `json:"env,omitempty"`

	// URL is the endpoint for remote HTTP/SSE servers.
	URL string `json:"url,omitempty"`

	// Headers contains HTTP headers for authentication.
	Headers map[string]string `json:"headers,omitempty"`
}

MCPServerConfig represents an MCP server configuration within an agent.

Jump to

Keyboard shortcuts

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