Documentation
¶
Index ¶
- func CommandName(command string) string
- func CommandText(id CommandID) string
- func CompactRequested(command string) bool
- func DeniedApproval(command string) (string, bool)
- func FormatServerStatus(status core.ServerStatus) string
- func GoalLine(goal *core.SessionGoal) string
- func HelpText() string
- func RestartRequested(command string) bool
- func StopNotice(reason agent.StopReason) string
- type CommandID
- type CommandSpec
- type ConfirmData
- type Dispatcher
- type FormData
- type FormField
- type InfoData
- type InfoRow
- type MenuState
- type PickerBuilder
- func (b *PickerBuilder) Action(id string, title string, info string, command string) *PickerBuilder
- func (b *PickerBuilder) Back(command string) *PickerBuilder
- func (b *PickerBuilder) Build() PickerData
- func (b *PickerBuilder) Command(command string) *PickerBuilder
- func (b *PickerBuilder) Danger(id string, title string, info string, command string) *PickerBuilder
- func (b *PickerBuilder) Item(item PickerItem) *PickerBuilder
- func (b *PickerBuilder) Items(items ...PickerItem) *PickerBuilder
- func (b *PickerBuilder) Meta(meta string) *PickerBuilder
- func (b *PickerBuilder) Row(id string, title string, info string, command string) *PickerBuilder
- func (b *PickerBuilder) Select(closeCommand string) *PickerBuilder
- func (b *PickerBuilder) Static(id string, title string, info string) *PickerBuilder
- type PickerData
- type PickerItem
- type PickerItemRole
- type PickerKind
- type PromptData
- type Result
- type Route
- type Screen
- type TextData
- type Verb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandName ¶
func CommandText ¶ added in v0.2.1
CommandText is the command's slash word, such as "/modules".
func CompactRequested ¶ added in v0.2.1
CompactRequested reports whether command compacts the context now, which may outlast a client's usual wait.
func DeniedApproval ¶ added in v0.2.0
DeniedApproval returns the approval that a "/approval deny <id> [reason]" command, or the command its prompt submits, denies.
func FormatServerStatus ¶
func FormatServerStatus(status core.ServerStatus) string
func GoalLine ¶ added in v0.2.1
func GoalLine(goal *core.SessionGoal) string
GoalLine is a goal in one short line for status displays, "" without one.
func RestartRequested ¶ added in v0.2.1
RestartRequested reports whether command is the confirmed daemon restart, which clients run themselves to show its progress and the notice after it.
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" CommandPlan CommandID = "plan" CommandContext CommandID = "context" CommandUsage CommandID = "usage" CommandContinue CommandID = "continue" CommandBudget CommandID = "budget" CommandGoal CommandID = "goal" CommandTodo CommandID = "todo" CommandHooks CommandID = "hooks" 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" CommandUndo CommandID = "undo" CommandRewind CommandID = "rewind" )
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, /plan and /help.
func Catalog ¶
func Catalog() []CommandSpec
type ConfirmData ¶
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. It keeps the client's open forms, so a client keeps one dispatcher while it shows its screens.
func New ¶
func New(daemon *daemonclient.Client, workingDir string) *Dispatcher
type InfoRow ¶
func FormatServerStatusRows ¶
func FormatServerStatusRows(status core.ServerStatus) []InfoRow
type MenuState ¶
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) Build ¶
func (b *PickerBuilder) Build() PickerData
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) 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 ¶ added in v0.2.0
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" PickerCheckpoints PickerKind = "checkpoints" PickerMemoryPending PickerKind = "memory_pending" )
type PromptData ¶
type PromptData struct {
Title string
Placeholder string
Value string
Submit string
CancelCommand string
Sensitive bool
Multiline bool
}
PromptData asks for one value, which the client hands to Dispatcher.Answer with Submit; Multiline asks for a text to edit rather than a line, and Sensitive for a secret the client neither shows nor keeps.
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 ¶
Result is what a command shows, one screen or none, and whether the client reloads its snapshot because the command changed session state.
type Route ¶ added in v0.2.1
Route is a verb with its operands and value.
func DecodeRoute ¶ added in v0.2.1
DecodeRoute reads a command line: the longest verb its words name (one that takes a value when text is left over), its operands and the rest as value. It is false for text that is no command.
Source Files
¶
- approval.go
- automation_commands.go
- automation_format.go
- automation_time.go
- background_tasks.go
- budget.go
- catalog.go
- checkpoints.go
- context.go
- continue.go
- dispatcher.go
- forms.go
- goal.go
- hooks.go
- memory.go
- memory_suggestions.go
- menu_view.go
- module_settings.go
- modules.go
- modules_external_agents.go
- modules_mcp.go
- modules_skills.go
- modules_skills_edit.go
- modules_skills_helpers.go
- modules_storage.go
- parse.go
- permissions.go
- picker_builder.go
- provider_custom.go
- provider_custom_delete.go
- provider_custom_lookup.go
- provider_form.go
- provider_format.go
- provider_input.go
- provider_openai_codex_auth.go
- provider_view.go
- providers.go
- reminders.go
- result_types.go
- route.go
- run_stop.go
- search.go
- server.go
- sessions.go
- storage_files.go
- storage_format.go
- storage_picker.go
- storage_temp.go
- tasks_add.go
- tasks_picker.go
- todo.go
- usage.go