types

package
v1.30.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneThroughJSON

func CloneThroughJSON(oldConfig, newConfig any)

Types

type Command

type Command struct {
	// Description is shown in completion dialogs and help text.
	// For simple format commands, this is empty and the instruction is used for display.
	Description string `json:"description,omitempty"`

	// Instruction is the prompt sent to the agent.
	// Supports:
	// - Bang commands: !`command` (executed and output inserted)
	// - Positional arguments: $1, $2, etc.
	Instruction string `json:"instruction,omitempty"`
}

Command represents an agent command with optional metadata. It supports two YAML formats:

Simple format (string value):

fix-lint: "Fix the lint issues"

Advanced format (object value):

fix-lint:
  description: "Fix linting errors in the codebase"
  instruction: |
    Fix the lint issues reported by: !`golangci-lint run`
    Focus on files: $1

func (Command) DisplayText

func (c Command) DisplayText() string

DisplayText returns the text to show in completion dialogs. Returns Description if available, otherwise truncates the Instruction.

type Commands

type Commands map[string]Command

Commands represents a set of named prompts for quick-starting conversations. It supports multiple YAML formats:

Map of simple strings:

commands:
  df: "check disk space"
  ls: "list files"

List of singleton maps (simple strings):

commands:
  - df: "check disk space"
  - ls: "list files"

Map of advanced objects:

commands:
  fix-lint:
    description: "Fix linting errors"
    instruction: "Fix the lint issues"

Mixed format (simple and advanced):

commands:
  simple: "A simple command"
  advanced:
    description: "An advanced command"
    instruction: "Do something complex"

func (*Commands) UnmarshalYAML

func (c *Commands) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML supports both map and list-of-singleton-maps syntaxes, with values being either simple strings or Command objects.

type StringOrList

type StringOrList []string

func (*StringOrList) UnmarshalYAML

func (sm *StringOrList) UnmarshalYAML(unmarshal func(any) error) error

Jump to

Keyboard shortcuts

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