clikit

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WaterfallModeOff     = "off"
	WaterfallModeSummary = "summary"
	WaterfallModeFull    = "full"
)

Variables

This section is empty.

Functions

func NormalizeWaterfallMode

func NormalizeWaterfallMode(v string) string

func PrintBanner

func PrintBanner(out io.Writer, modelName string, metas []SkillMeta)

func PrintEffectiveConfig

func PrintEffectiveConfig(out io.Writer, repoRoot string, cfg EffectiveConfig, timeoutMs int)

func PrintRuntimeEffectiveConfig

func PrintRuntimeEffectiveConfig(out io.Writer, eng RuntimeInfo, timeoutMs int)

func RunInteractiveShell

func RunInteractiveShell(ctx context.Context, in io.ReadCloser, out, errOut io.Writer, eng ReplEngine, timeoutMs int, verbose bool, waterfallMode string, initialSessionID string) error

func RunREPL

func RunREPL(ctx context.Context, in io.ReadCloser, out, errOut io.Writer, eng ReplEngine, timeoutMs int, verbose bool, waterfallMode string, initialSessionID string)

func RunStream

func RunStream(parent context.Context, out, errOut io.Writer, eng StreamEngine, sessionID, prompt string, timeoutMs int, verbose bool, waterfallMode string) error

func TurnRecorderMiddleware

func TurnRecorderMiddleware(recorder *TurnRecorder) middleware.Middleware

Types

type EffectiveConfig

type EffectiveConfig struct {
	ModelName       string
	ConfigRoot      string
	SkillsDirs      []string
	SkillsRecursive *bool
}

type InteractiveShell

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

func NewInteractiveShell

func NewInteractiveShell(cfg InteractiveShellConfig) *InteractiveShell

func (*InteractiveShell) Run

func (s *InteractiveShell) Run(ctx context.Context, in io.ReadCloser, out, errOut io.Writer) error

type InteractiveShellConfig

type InteractiveShellConfig struct {
	Engine            ReplEngine
	InitialSessionID  string
	TimeoutMs         int
	Verbose           bool
	WaterfallMode     string
	ShowStatusPerTurn bool
}

type ModelTurnStat

type ModelTurnStat struct {
	Iteration    int
	InputTokens  int
	OutputTokens int
	TotalTokens  int
	StopReason   string
	Preview      string
	Timestamp    time.Time
}

type ReplEngine

type ReplEngine interface {
	StreamEngine
	ModelName() string
	Skills() []SkillMeta
	SandboxBackend() string
}

type RuntimeAdapter

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

func NewRuntimeAdapter

func NewRuntimeAdapter(rt streamRuntime, cfg RuntimeAdapterConfig) *RuntimeAdapter

func (*RuntimeAdapter) ModelName

func (a *RuntimeAdapter) ModelName() string

func (*RuntimeAdapter) ModelTurnCount

func (a *RuntimeAdapter) ModelTurnCount(sessionID string) int

func (*RuntimeAdapter) ModelTurnsSince

func (a *RuntimeAdapter) ModelTurnsSince(sessionID string, offset int) []ModelTurnStat

func (*RuntimeAdapter) RepoRoot

func (a *RuntimeAdapter) RepoRoot() string

func (*RuntimeAdapter) RunStream

func (a *RuntimeAdapter) RunStream(ctx context.Context, sessionID, prompt string) (<-chan api.StreamEvent, error)

func (*RuntimeAdapter) SandboxBackend

func (a *RuntimeAdapter) SandboxBackend() string

func (*RuntimeAdapter) SettingsRoot

func (a *RuntimeAdapter) SettingsRoot() string

func (*RuntimeAdapter) Skills

func (a *RuntimeAdapter) Skills() []SkillMeta

func (*RuntimeAdapter) SkillsDirs

func (a *RuntimeAdapter) SkillsDirs() []string

func (*RuntimeAdapter) SkillsRecursive

func (a *RuntimeAdapter) SkillsRecursive() bool

type RuntimeAdapterConfig

type RuntimeAdapterConfig struct {
	ProjectRoot     string
	ConfigRoot      string
	ModelName       string
	SandboxBackend  string
	SkillsDirs      []string
	SkillsRecursive *bool
	TurnRecorder    *api.ModelTurnRecorder
}

type RuntimeInfo

type RuntimeInfo interface {
	ModelName() string
	SettingsRoot() string
	SkillsRecursive() bool
	SkillsDirs() []string
}

type SkillMeta

type SkillMeta struct {
	Name string
}

type StreamEngine

type StreamEngine interface {
	RunStream(ctx context.Context, sessionID, prompt string) (<-chan api.StreamEvent, error)
	ModelTurnCount(sessionID string) int
	ModelTurnsSince(sessionID string, offset int) []ModelTurnStat
	RepoRoot() string
}

type TurnRecorder

type TurnRecorder = api.ModelTurnRecorder

func NewTurnRecorder

func NewTurnRecorder() *TurnRecorder

Jump to

Keyboard shortcuts

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