kiro

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AgentName = "wetwire-gitlab"

AgentName is the identifier for the wetwire-gitlab Kiro agent.

View Source
const AgentPrompt = `You are an expert GitLab CI/CD pipeline designer using wetwire-gitlab-go.

Your role is to help users design and generate GitLab CI pipelines as Go code.

## wetwire-gitlab Syntax Rules

1. **Flat, Declarative Syntax**: Use package-level var declarations
   ` + "```go" + `
   var BuildJob = pipeline.Job{
       Name:   "build",
       Stage:  "build",
       Script: List("go build ./..."),
   }
   ` + "```" + `

2. **Direct Variable References**: Jobs reference other jobs directly
   ` + "```go" + `
   var TestJob = pipeline.Job{
       Needs: []any{BuildJob, LintJob},  // Variables, not strings
   }
   ` + "```" + `

3. **Dot-Import for Intrinsics**: Use intrinsics cleanly
   ` + "```go" + `
   import (
       . "github.com/lex00/wetwire-gitlab-go/intrinsics"
       "github.com/lex00/wetwire-gitlab-go/pipeline"
   )
   ` + "```" + `

4. **Helper Functions**: Use List(), Json{} for type safety
   - ` + "`List(\"a\", \"b\")`" + ` - For string slices
   - ` + "`Json{\"key\": \"value\"}`" + ` - For maps
   - ` + "`[]any{Job1, Job2}`" + ` - Only for Needs field

## Workflow

1. Ask the user about their project requirements
2. Generate Go pipeline code following wetwire conventions
3. Use wetwire_lint to validate the code
4. Fix any lint issues
5. Use wetwire_build to generate .gitlab-ci.yml

## Important

- Always validate code with wetwire_lint before presenting to user
- Fix lint issues immediately without asking
- Keep code simple and readable
- Use extracted variables for complex nested configurations`

AgentPrompt contains the system prompt for the wetwire-gitlab agent.

View Source
const MCPCommand = "wetwire-gitlab"

MCPCommand is the command to run the MCP server.

Variables

This section is empty.

Functions

func EnsureInstalled

func EnsureInstalled() error

EnsureInstalled installs the Kiro agent configuration if not already present.

func EnsureInstalledWithForce

func EnsureInstalledWithForce(force bool) error

EnsureInstalledWithForce installs the Kiro agent configuration. If force is true, overwrites any existing configuration.

func LaunchChat

func LaunchChat(agentName, initialPrompt string) error

LaunchChat launches an interactive Kiro CLI chat session with the wetwire-gitlab agent. It connects stdin/stdout directly to the terminal for interactive use.

func NewConfig

func NewConfig() corekiro.Config

NewConfig creates a new Kiro config for the wetwire-gitlab agent.

func RunTest

func RunTest(ctx context.Context, prompt string) (string, error)

RunTest runs the Kiro agent in non-interactive test mode. Returns the output from the test session.

Types

type AgentConfig

type AgentConfig struct {
	Name       string     `json:"name"`
	Prompt     string     `json:"prompt"`
	MCPServers []MCPEntry `json:"mcpServers"`
}

AgentConfig represents a Kiro agent configuration.

type MCPEntry

type MCPEntry struct {
	Name    string   `json:"name"`
	Command string   `json:"command"`
	Args    []string `json:"args"`
	Cwd     string   `json:"cwd,omitempty"`
}

MCPEntry represents an MCP server configuration.

type TestResult

type TestResult struct {
	Success       bool          // Overall test success
	Output        string        // Full command output
	Duration      time.Duration // Test execution time
	LintPassed    bool          // Whether linting succeeded
	BuildPassed   bool          // Whether build succeeded
	FilesCreated  []string      // Generated .go files
	ErrorMessages []string      // Collected error lines
}

TestResult contains the results of a persona test run.

type TestRunner

type TestRunner struct {
	OutputDir     string            // Directory for generated files
	Timeout       time.Duration     // Test timeout
	StreamHandler func(text string) // Optional output streaming callback
}

TestRunner executes persona-based tests using Kiro CLI.

func NewTestRunner

func NewTestRunner(outputDir string) *TestRunner

NewTestRunner creates a new TestRunner with the specified output directory.

func (*TestRunner) EnsureTestEnvironment

func (r *TestRunner) EnsureTestEnvironment() error

EnsureTestEnvironment prepares the output directory for testing.

func (*TestRunner) RunAllPersonas

func (r *TestRunner) RunAllPersonas(ctx context.Context, prompt string) (map[string]*TestResult, error)

RunAllPersonas runs the test with all available personas and returns aggregate results.

func (*TestRunner) RunWithPersona

func (r *TestRunner) RunWithPersona(ctx context.Context, prompt string, persona personas.Persona) (*TestResult, error)

RunWithPersona executes a test with the specified persona.

Jump to

Keyboard shortcuts

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