repl

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package repl provides an interactive REPL for the Chronos CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name        string
	Description string
	Handler     func(args string) error
}

Command represents a slash command.

type REPL

type REPL struct {
	// contains filtered or unexported fields
}

REPL is the interactive command loop.

func New

func New(store storage.Storage) *REPL

New creates a new REPL with built-in commands.

func (*REPL) Register

func (r *REPL) Register(c Command)

Register adds a slash command.

func (*REPL) SetAgent

func (r *REPL) SetAgent(a *agent.Agent)

SetAgent configures the single agent that handles non-command input. It also adds the agent to the roster so /agent can list it.

func (*REPL) SetAgents added in v0.9.0

func (r *REPL) SetAgents(agents []*agent.Agent)

SetAgents loads a full roster of agents (e.g. every agent in a YAML config). The first agent becomes the active one; use /agent <id> to switch.

func (*REPL) SetStream added in v0.7.0

func (r *REPL) SetStream(enabled bool)

SetStream enables or disables token-by-token streaming of agent responses.

func (*REPL) SetTeams added in v0.9.0

func (r *REPL) SetTeams(teamIDs []string, runner TeamRunner)

SetTeams registers the team IDs available to run and the callback that runs them. Enables the /teams and /team commands.

func (*REPL) Start

func (r *REPL) Start() error

Start begins the interactive loop.

type TeamRunner added in v0.9.0

type TeamRunner func(ctx context.Context, teamID, message string) (<-chan team.TeamStreamEvent, error)

TeamRunner runs a configured team by ID and returns a stream of its events. The cmd package wires this in so the REPL can drive teams without importing the CLI's team-construction logic.

Jump to

Keyboard shortcuts

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