app

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBroadWorkspaceEntryThreshold = 300
View Source
const DefaultSessionListLimit = 8

Variables

This section is empty.

Functions

func BuildStartupGuide

func BuildStartupGuide(cfg config.Config, check provider.Availability, workspace, explicitConfigPath string) tui.StartupGuide

func CommandNames

func CommandNames(commands []SlashCommand) []string

func CompactLine

func CompactLine(raw string, limit int) string

func CompleteSlashCommand

func CompleteSlashCommand(input string, commands []SlashCommand) (string, []string)

func ConfigPathHint

func ConfigPathHint(workspace, explicit string) string

func ContainsCommand

func ContainsCommand(commands []string, target string) bool

func CreateSession

func CreateSession(store *session.Store, workspace string) (*session.Session, error)

func CurrentVersion

func CurrentVersion() string

func DefaultUsageLines

func DefaultUsageLines() []string

func DetectProjectRoot

func DetectProjectRoot(start string) string

func DispatchCLI

func DispatchCLI(args []string, stdin io.Reader, stdout, stderr io.Writer, handlers DispatchHandlers) error

func IsBroadWorkspacePath

func IsBroadWorkspacePath(dir string) bool

func IsBroadWorkspacePathWithHome

func IsBroadWorkspacePathWithHome(dir, home string) bool

func IsFilesystemRoot

func IsFilesystemRoot(path string) bool

func IsHighRiskWorkspacePath

func IsHighRiskWorkspacePath(dir string) bool

func IsHighRiskWorkspacePathWithHome

func IsHighRiskWorkspacePathWithHome(dir, home string) bool

func LoadRuntimeConfig

func LoadRuntimeConfig(req ConfigRequest) (config.Config, error)

func MatchSlashCommands

func MatchSlashCommands(prefix string, commands []SlashCommand) []string

func ParseSessionListLimit

func ParseSessionListLimit(raw string) (int, error)

func RenderCommandSuggestions

func RenderCommandSuggestions(w io.Writer, input string, suggestions []string)

func RenderCurrentSession

func RenderCurrentSession(w io.Writer, sess *session.Session)

func RenderHelp

func RenderHelp(w io.Writer)

func RenderSessionsView

func RenderSessionsView(w io.Writer, currentID string, summaries []session.Summary, warnings []string)

func RenderSubAgentDetail

func RenderSubAgentDetail(w io.Writer, agent subagentspkg.Agent)

func RenderSubAgentsView

func RenderSubAgentsView(w io.Writer, agents []subagentspkg.Agent)

func RenderUsage

func RenderUsage(w io.Writer)

func RenderVersion

func RenderVersion(w io.Writer)

func ResolveSessionID

func ResolveSessionID(store *session.Store, prefix string) (string, error)

func ResolveWorkspace

func ResolveWorkspace(workspaceOverride string) (string, error)

func ResumeSessionInWorkspace

func ResumeSessionInWorkspace(store *session.Store, currentWorkspace, sessionPrefix string) (*session.Session, error)

func RunCLI

func RunCLI(args []string, stdin io.Reader, stdout, stderr io.Writer) error

RunCLI executes the default ByteMind CLI wiring.

func RunDemo added in v1.0.1

func RunDemo(args []string, stdout, stderr io.Writer) error

func RunDoctor added in v1.0.0

func RunDoctor(args []string, stdout, stderr io.Writer) error

func RunInit added in v1.0.1

func RunInit(args []string, stdout, stderr io.Writer) error

func RunInstall

func RunInstall(args []string, stdout, stderr io.Writer) error

func RunMCP

func RunMCP(args []string, stdin io.Reader, stdout, stderr io.Writer) error

func RunOneShot

func RunOneShot(req RunOneShotRequest) error

func RunOneShotArgs

func RunOneShotArgs(args []string, stdin io.Reader, stdout, stderr io.Writer) error

func RunSafety added in v1.0.0

func RunSafety(args []string, stdout, stderr io.Writer) error

func RunTUI

func RunTUI(req TUIRequest, runProgram func(tui.Options) error) error

func RunTUIArgs

func RunTUIArgs(args []string, stdin io.Reader, stdout, stderr io.Writer) error

func RunTrace added in v1.0.1

func RunTrace(args []string, stdout, stderr io.Writer) error

func RunWorkerArgs

func RunWorkerArgs(args []string, stdin io.Reader, stdout, stderr io.Writer) error

func SameWorkspace

func SameWorkspace(a, b string) bool

func StartupIssueHint

func StartupIssueHint(check provider.Availability) string

Types

type BootstrapRequest

type BootstrapRequest struct {
	Workspace                 string
	ConfigPath                string
	ModelOverride             string
	SessionID                 string
	StreamOverride            string
	SandboxEnabledOverride    string
	SystemSandboxModeOverride string
	ApprovalModeOverride      string
	AwayPolicyOverride        string
	MaxIterationsOverride     int
	RequireAPIKey             bool
	Stdin                     io.Reader
	Stdout                    io.Writer
}

BootstrapRequest declares dependencies and runtime overrides needed to assemble the application runtime for CLI/TUI execution.

type ConfigRequest

type ConfigRequest struct {
	Workspace                 string
	ConfigPath                string
	ModelOverride             string
	StreamOverride            string
	SandboxEnabledOverride    string
	SystemSandboxModeOverride string
	ApprovalModeOverride      string
	AwayPolicyOverride        string
	MaxIterationsOverride     int
}

ConfigRequest defines workspace config load plus CLI runtime overrides.

type DispatchHandlers

type DispatchHandlers struct {
	RunTUI        func(args []string, stdin io.Reader, stdout, stderr io.Writer) error
	RunOneShot    func(args []string, stdin io.Reader, stdout, stderr io.Writer) error
	RunWorker     func(args []string, stdin io.Reader, stdout, stderr io.Writer) error
	RunInstall    func(args []string, stdout, stderr io.Writer) error
	RunMCP        func(args []string, stdin io.Reader, stdout, stderr io.Writer) error
	RunDoctor     func(args []string, stdout, stderr io.Writer) error
	RunSafety     func(args []string, stdout, stderr io.Writer) error
	RunDemo       func(args []string, stdout, stderr io.Writer) error
	RunTrace      func(args []string, stdout, stderr io.Writer) error
	RunInit       func(args []string, stdout, stderr io.Writer) error
	RenderUsage   func(w io.Writer)
	RenderVersion func(w io.Writer)
}

type EntrypointRequest

type EntrypointRequest struct {
	WorkspaceOverride         string
	ConfigPath                string
	ModelOverride             string
	SessionID                 string
	StreamOverride            string
	SandboxEnabledOverride    string
	SystemSandboxModeOverride string
	ApprovalModeOverride      string
	AwayPolicyOverride        string
	MaxIterationsOverride     int
	RequireAPIKey             bool
	Stdin                     io.Reader
	Stdout                    io.Writer
}

type HelpLine

type HelpLine struct {
	Usage       string
	Description string
}

func DefaultHelpLines

func DefaultHelpLines() []HelpLine

type RunOneShotRequest

type RunOneShotRequest struct {
	Args   []string
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

type Runtime

type Runtime struct {
	Config      config.Config
	Runner      *agent.Runner
	Store       *session.Store
	Session     *session.Session
	TaskManager runtimepkg.TaskManager
	Extensions  extensionspkg.Manager
}

Runtime is the assembled runtime bundle consumed by command entrypoints.

func Bootstrap

func Bootstrap(req BootstrapRequest) (Runtime, error)

func BootstrapEntrypoint

func BootstrapEntrypoint(req EntrypointRequest) (Runtime, error)

type SessionSnapshotView

type SessionSnapshotView struct {
	ID        string
	Workspace string
	Updated   string
}

func BuildSessionSnapshotView

func BuildSessionSnapshotView(sess *session.Session, location *time.Location) SessionSnapshotView

type SessionSummaryView

type SessionSummaryView struct {
	Marker       string
	ID           string
	Updated      string
	MessageCount int
	Preview      string
	Workspace    string
}

func BuildSessionSummaryViews

func BuildSessionSummaryViews(summaries []session.Summary, currentID string, location *time.Location) []SessionSummaryView

type SlashCommand

type SlashCommand struct {
	Name        string
	Usage       string
	Description string
}

func DefaultSlashCommands

func DefaultSlashCommands() []SlashCommand

type SlashExecution

type SlashExecution struct {
	NextSession      *session.Session
	SessionToDisplay *session.Session
	Handled          bool
	ShouldExit       bool
	Command          string
	UsageHint        string
	UnknownInput     string
	Suggestions      []string
	Summaries        []session.Summary
	Warnings         []string
	SubAgents        []subagentspkg.Agent
	SubAgentDetail   *subagentspkg.Agent
}

func ExecuteSlashCommand

func ExecuteSlashCommand(store *session.Store, current *session.Session, input string, commands []SlashCommand) (SlashExecution, error)

type SlashHandleResult

type SlashHandleResult struct {
	NextSession *session.Session
	ShouldExit  bool
	Handled     bool
}

func HandleSlashCommand

func HandleSlashCommand(stdout io.Writer, store *session.Store, current *session.Session, input string, commands []SlashCommand) (SlashHandleResult, error)

type TUIRequest

type TUIRequest struct {
	Args   []string
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

type TUIRuntime

type TUIRuntime struct {
	Options tui.Options
	// contains filtered or unexported fields
}

func BuildTUIRuntime

func BuildTUIRuntime(req TUIRequest) (TUIRuntime, error)

func (TUIRuntime) Close

func (r TUIRuntime) Close() error

Jump to

Keyboard shortcuts

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