controlplane

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandLine added in v0.2.0

func CommandLine(id CommandID, args string) string

CommandLine is the command text that runs id with args.

func CommandName

func CommandName(command string) string

func DeniedApproval added in v0.2.0

func DeniedApproval(command string) (string, bool)

DeniedApproval returns the approval that a "/approval deny <id> [reason]" command, or the prefix its prompt submits, denies.

func FormatServerStatus

func FormatServerStatus(status core.ServerStatus) string

func HelpText

func HelpText() string

func StopNotice added in v0.2.0

func StopNotice(reason agent.StopReason) string

StopNotice explains why a completed run stopped before its work was done; "" when it finished normally. Clients add how to continue.

Types

type CommandID

type CommandID string
const (
	CommandNewSession  CommandID = "new_session"
	CommandSessions    CommandID = "sessions"
	CommandSession     CommandID = "session"
	CommandProvider    CommandID = "provider"
	CommandPermissions CommandID = "permissions"
	CommandContext     CommandID = "context"
	CommandUsage       CommandID = "usage"
	CommandContinue    CommandID = "continue"
	CommandBudget      CommandID = "budget"
	CommandTodo        CommandID = "todo"
	CommandMemory      CommandID = "memory"
	CommandSearch      CommandID = "search"
	CommandSkills      CommandID = "skills"
	CommandModules     CommandID = "modules"
	CommandRemind      CommandID = "remind"
	CommandTasks       CommandID = "tasks"
	CommandServer      CommandID = "server"
	CommandStatus      CommandID = "status"
	CommandRestart     CommandID = "restart"
	CommandStop        CommandID = "stop"
	CommandHelp        CommandID = "help"
	CommandApproval    CommandID = "approval"
)

type CommandSpec

type CommandSpec struct {
	ID      CommandID
	Command string
	Aliases []string
	Title   string
	Menu    bool
	Public  bool
}

func BotCommands added in v0.2.0

func BotCommands() []CommandSpec

BotCommands are the commands a client lists by name: the menu ones and /help.

func Catalog

func Catalog() []CommandSpec

func Parse

func Parse(text string) (CommandSpec, string, bool)

type ConfirmData

type ConfirmData struct {
	Title          string
	Message        string
	ConfirmLabel   string
	CancelLabel    string
	ConfirmCommand string
	CancelCommand  string
	ConfirmDanger  bool
	CancelDanger   bool
}

type Dispatcher

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

Dispatcher runs slash commands against the daemon for one client: its name, external key and role come with daemon.

func New

func New(daemon *daemonclient.Client, workingDir string) *Dispatcher

func (*Dispatcher) Handle

func (d *Dispatcher) Handle(ctx context.Context, text string) (Result, error)

type FormData

type FormData struct {
	Title         string
	Fields        []FormField
	SubmitLabel   string
	CancelLabel   string
	SubmitCommand string
	CancelCommand string
	Error         string
}

type FormField

type FormField struct {
	ID          string
	Label       string
	Value       string
	EditCommand string
	Disabled    bool
}

type InfoData

type InfoData struct {
	Title        string
	Text         string
	Rows         []InfoRow
	CloseCommand string
}

type InfoRow

type InfoRow struct {
	Label string
	Value string
}

func FormatServerStatusRows

func FormatServerStatusRows(status core.ServerStatus) []InfoRow
type MenuState struct {
	SessionTitle   string
	ProviderID     string
	ModelID        string
	PermissionMode core.PermissionMode
	Capabilities   core.SessionCapabilities
}

type PickerBuilder

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

func NewPickerData

func NewPickerData(kind PickerKind, title string) *PickerBuilder

func (*PickerBuilder) Action

func (b *PickerBuilder) Action(id string, title string, info string, command string) *PickerBuilder

func (*PickerBuilder) Back

func (b *PickerBuilder) Back(command string) *PickerBuilder

func (*PickerBuilder) Command added in v0.2.0

func (b *PickerBuilder) Command(command string) *PickerBuilder

Command is the command that shows this picker again.

func (*PickerBuilder) Danger

func (b *PickerBuilder) Danger(id string, title string, info string, command string) *PickerBuilder

func (*PickerBuilder) Item

func (b *PickerBuilder) Item(item PickerItem) *PickerBuilder

func (*PickerBuilder) Items

func (b *PickerBuilder) Items(items ...PickerItem) *PickerBuilder

func (*PickerBuilder) Meta added in v0.1.8

func (b *PickerBuilder) Meta(meta string) *PickerBuilder

func (*PickerBuilder) Ptr

func (b *PickerBuilder) Ptr() *PickerData

func (*PickerBuilder) Row

func (b *PickerBuilder) Row(id string, title string, info string, command string) *PickerBuilder

func (*PickerBuilder) Select added in v0.1.16

func (b *PickerBuilder) Select(closeCommand string) *PickerBuilder

Select makes the picker a choice that runs closeCommand when dismissed.

func (*PickerBuilder) Static added in v0.1.13

func (b *PickerBuilder) Static(id string, title string, info string) *PickerBuilder

type PickerData

type PickerData struct {
	Kind  PickerKind
	Title string
	Meta  string
	// Command shows the picker again (Telegram pages with it); empty when
	// the picker cannot be repeated, and then it is shown unpaged.
	Command string
	Back    string // command of a Back button; empty for none
	// Popup is a choice that closes once picked; Close runs on dismissal.
	Popup bool
	Close string
	Items []PickerItem
}

PickerData is a list screen; clients render it as they see fit (Telegram buttons, a terminal menu) from these fields alone.

type PickerItem

type PickerItem struct {
	ID       string
	Title    string
	Info     string
	Search   string
	Command  string
	Selected bool
	Focused  bool
	Disabled bool
	Role     PickerItemRole
}
func Menu(state MenuState) []PickerItem

Menu is the command menu of the terminal and of Telegram's /help: the menu commands, the session's ones first, with their current state.

func (PickerItem) NeedsSeparator

func (item PickerItem) NeedsSeparator() bool

NeedsSeparator reports whether a list draws a line above item.

type PickerItemRole

type PickerItemRole string
const (
	PickerItemRoleNormal PickerItemRole = ""
	PickerItemRoleDanger PickerItemRole = "danger"
	PickerItemRoleAction PickerItemRole = "action"
)

type PickerKind

type PickerKind string
const (
	PickerCommandMenu     PickerKind = "command_menu"
	PickerSessions        PickerKind = "sessions"
	PickerSessionRuntime  PickerKind = "session_runtime"
	PickerSessionActions  PickerKind = "session_actions"
	PickerSessionModels   PickerKind = "session_models"
	PickerProvider        PickerKind = "provider"
	PickerProviderCustom  PickerKind = "provider_custom"
	PickerProviderActions PickerKind = "provider_actions"
	PickerPermissions     PickerKind = "permissions"
	PickerContext         PickerKind = "context"
	PickerModules         PickerKind = "modules"
	PickerModule          PickerKind = "module"
	PickerExternalAgents  PickerKind = "external_agents"
	PickerExternalAgent   PickerKind = "external_agent"
	PickerStorage         PickerKind = "storage"
	PickerStorageFiles    PickerKind = "storage_files"
	PickerStorageFile     PickerKind = "storage_file"
	PickerStorageTemp     PickerKind = "storage_temp"
	PickerStorageCleanup  PickerKind = "storage_cleanup"
	PickerStorageTempFile PickerKind = "storage_temp_file"
	PickerSessionSkills   PickerKind = "session_skills"
	PickerSessionSkill    PickerKind = "session_skill"
	PickerSkills          PickerKind = "skills"
	PickerSkillsSection   PickerKind = "skills_section"
	PickerSkill           PickerKind = "skill"
	PickerMCP             PickerKind = "mcp"
	PickerMCPServer       PickerKind = "mcp_server"
	PickerTasks           PickerKind = "tasks"
	PickerTaskActions     PickerKind = "task_actions"
	PickerTaskArchive     PickerKind = "task_archive"
	PickerServer          PickerKind = "server"
)

type PromptData

type PromptData struct {
	Title               string
	Placeholder         string
	Value               string
	SubmitCommandPrefix string
	CancelCommand       string
	Sensitive           bool
}

func DenyWithReasonPrompt added in v0.2.0

func DenyWithReasonPrompt(approvalID string) PromptData

DenyWithReasonPrompt asks for the reason a client sends with a denial.

type Result

type Result struct {
	Handled        bool
	Text           string
	ReloadSnapshot bool
	Picker         *PickerData
	Form           *FormData
	Prompt         *PromptData
	TextEdit       *TextEditData
	Confirm        *ConfirmData
	Info           *InfoData
}

type TextEditData added in v0.1.11

type TextEditData struct {
	Title               string
	Placeholder         string
	Value               string
	SubmitCommandPrefix string
	CancelCommand       string
}

Jump to

Keyboard shortcuts

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