ui

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(template string, args []string) string

Expand substitutes placeholder patterns in template with the given args.

Supported patterns:

  • $1, $2, ... $N — positional args (1-based, out-of-range → "")
  • ${@:N} — all args from index N onward (1-based)
  • ${@:N:L} — L args starting at index N (1-based)
  • $@ / $ARGUMENTS — all args joined by space

Substitution is single-pass per pattern class (no recursive expansion).

func ParseArgs

func ParseArgs(s string) []string

ParseArgs splits a command argument string respecting double and single quotes. Empty quoted strings are skipped.

func ReadStdinPrompt

func ReadStdinPrompt() (string, error)

ReadStdinPrompt reads all of stdin as a prompt (for pipe usage).

func RunPrint

func RunPrint(sess *agent.Session, args []string, jsonMode bool) error

RunPrint executes non-interactive print/json mode.

func RunPrintMode

func RunPrintMode(sess *agent.Session, prompt string, jsonMode bool) error

RunPrintMode runs the agent in non-interactive mode. stdout receives assistant text (pipe-friendly), stderr receives tool/status info. When jsonMode is true, all events are streamed as JSONL to stdout.

func RunTUI

func RunTUI(sess *agent.Session, cwd, gitBranch, modelName string, profile policy.Profile, mcpMgr *mcpclient.Manager) error

RunTUI executes interactive TUI mode.

Types

type App

type App struct {
	Session   *agent.Session
	Cwd       string
	GitBranch string

	// PolicyProfile controls slash-command risk gating.
	PolicyProfile policy.Profile

	// Templates are user-defined prompt templates loaded from .md files.
	Templates []config.PromptTemplate

	// Skills are loaded skill definitions.
	Skills []config.Skill

	// MCPManager manages MCP server connections.
	MCPManager *mcpclient.Manager

	// PlanStore persists plans to <cwd>/.codebot/plans/.
	PlanStore *storage.PlanStore

	// History provides input history for Up/Down navigation.
	History *storage.History
	// contains filtered or unexported fields
}

App is the TUI adapter. Business logic lives in agent.Session.

func (*App) Config

func (a *App) Config() tui.Config

Config returns a tui.Config with all hooks wired to this App.

Directories

Path Synopsis
Package imageinput handles image input from clipboard paste and file drag-drop, converting raw data to agentcore ContentBlocks.
Package imageinput handles image input from clipboard paste and file drag-drop, converting raw data to agentcore ContentBlocks.

Jump to

Keyboard shortcuts

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