Documentation
¶
Index ¶
- func CommandLine(id CommandID, args string) string
- func CommandName(command string) string
- func DeniedApproval(command string) (string, bool)
- func FormatServerStatus(status core.ServerStatus) string
- func HelpText() string
- 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) 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) Ptr() *PickerData
- 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 TextEditData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandLine ¶ added in v0.2.0
CommandLine is the command text that runs id with args.
func CommandName ¶
func DeniedApproval ¶ added in v0.2.0
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 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
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.
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) 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 ¶ 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" )
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
}
Source Files
¶
- approval.go
- automation_commands.go
- automation_format.go
- automation_time.go
- background_tasks.go
- budget.go
- catalog.go
- context.go
- continue.go
- core_commands.go
- dispatcher.go
- memory.go
- menu_view.go
- module_commands.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_commands.go
- provider_custom.go
- provider_custom_delete.go
- provider_custom_lookup.go
- provider_form.go
- provider_format.go
- provider_openai_codex_auth.go
- provider_view.go
- providers.go
- reminders.go
- result_types.go
- run_stop.go
- search.go
- server.go
- session_commands.go
- sessions.go
- storage_files.go
- storage_format.go
- storage_picker.go
- storage_temp.go
- task_commands.go
- tasks_add.go
- tasks_picker.go
- todo.go
- usage.go