Documentation
¶
Overview ¶
Package cli provides the interactive inline CLI terminal application.
Index ¶
Constants ¶
const CtrlCTimeout = 2 * time.Second
CtrlCTimeout is the duration before the Ctrl+C confirmation resets.
Variables ¶
var App = trail.SimpleFC("App", func() trail.Node { queryClient := kitex.UseMemo(func() *wind.Client { return wind.NewClient() }, nil) return kitex.Fragment( wind.Provider(wind.ProviderProps{Client: queryClient}, appContent()), components.TerminalStatus(), ) })
App is the root REPL UI component, wrapped in a wind.Provider.
var ErrInvalidOptions = errors.New("repl: invalid options")
ErrInvalidOptions is returned when required Options fields are missing.
Functions ¶
func ActiveQuota ¶
func ActiveQuota() *api.ModelQuota
ActiveQuota returns the store's latest quota reading for the active model, or nil when the model has no subscription window or none was ever read.
func ActiveSession ¶
ActiveSession returns the currently active session from the store, or nil if none.
func ActiveUsage ¶
func ActiveUsage() api.SessionUsage
ActiveUsage returns the active session's usage snapshot; it is empty for draft sessions that never recorded calls.
func FormatExitSummary ¶
func FormatExitSummary(in ExitSummaryInput) string
FormatExitSummary renders the goodbye block: the ASCII brand mark in the left gutter beside aligned Changes, Cost/Quota, Tokens, and Resume rows. It is plain-string output (the app runtime has already stopped), so colors come from the static theme snapshot rather than the reactive hook.
Types ¶
type ExitSummaryInput ¶
type ExitSummaryInput struct {
SessionID string
Usage api.SessionUsage
// Quota is optional; when set the cost row renders remaining quota
// instead of dollar cost.
Quota *api.ModelQuota
// Color enables ANSI true-color output; disable for pipes and NO_COLOR.
Color bool
}
ExitSummaryInput carries everything the post-REPL goodbye block renders.
type Options ¶
type Options struct {
Client *client.Client
Workspace string
Version string
SessionID string
Agent string
Model string
Title string
Backend backend.Backend
StartDaemon func(ctx context.Context, socketPath string) error
// Sandbox is the requested sandbox isolation backend ("native" or
// "local") for sessions this REPL creates. Empty means the daemon
// resolves the host default (native when available).
Sandbox api.SandboxMode
// StartupNotices are appended to the transcript as warning notices once
// the REPL boots (e.g. a daemon version skew the user should act on).
StartupNotices []string
}
Options holds configuration for starting the REPL.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package command implements the REPL slash command system for the TaskSmith CLI.
|
Package command implements the REPL slash command system for the TaskSmith CLI. |
|
Package components provides UI components for the repl terminal interface.
|
Package components provides UI components for the repl terminal interface. |
|
Package store manages global application UI state for the REPL using kites.
|
Package store manages global application UI state for the REPL using kites. |