Documentation
¶
Index ¶
- Constants
- func BuildPrompt(instructions string, envContext map[string]string, taskContent string) string
- func BuildResultSection(r string) string
- func NewStep(cfg StepConfig) agentlib.Step
- func PrintResult(ctx context.Context, result Result) error
- type AgentStatus
- type PiRunnerConfig
- type Result
- type RunError
- type Runner
- type StepConfig
Constants ¶
View Source
const ( AgentStatusDone = agentlib.AgentStatusDone AgentStatusFailed = agentlib.AgentStatusFailed AgentStatusNeedsInput = agentlib.AgentStatusNeedsInput )
Variables ¶
This section is empty.
Functions ¶
func BuildPrompt ¶
BuildPrompt combines instructions with environment context and task content.
func BuildResultSection ¶
BuildResultSection renders a Result as a markdown section.
func NewStep ¶
func NewStep(cfg StepConfig) agentlib.Step
NewStep wraps a single Pi invocation as an agentlib.Step.
Types ¶
type AgentStatus ¶
type AgentStatus = agentlib.AgentStatus
AgentStatus mirrors the shared agent status type.
type PiRunnerConfig ¶
type PiRunnerConfig struct {
// AgentDir is the working directory for the pi process. Pi's
// context-file discovery walks AGENTS.md/CLAUDE.md from cwd toward /,
// so place project guardrails as AGENTS.md inside this directory.
// Pi's other config (settings, skills, sessions) is resolved via
// $PI_CODING_AGENT_DIR or ~/.pi/agent/ and is independent of cwd.
AgentDir string
// AllowedTools is the comma-separated list of tool names to enable.
AllowedTools string
// Model selects the model (e.g. "MiniMax-M2.7-highspeed").
Model string
// Env holds extra KEY=VALUE entries appended to the subprocess environment.
// Use for API keys, custom provider settings, etc.
Env map[string]string
}
PiRunnerConfig holds configuration for spawning the Pi CLI.
type Result ¶
type Result struct {
Result string `json:"result"`
}
Result is the structured output from a Pi CLI run.
Click to show internal directories.
Click to hide internal directories.