DisplayText returns the text to show in completion dialogs. It returns Description when available, otherwise the Instruction. For agent-only commands (no instruction or description), it falls back to a short "switch to " hint so the completion dialog still has something meaningful to show.
()
| 62 | // short "switch to <agent>" hint so the completion dialog still has |
| 63 | // something meaningful to show. |
| 64 | func (c Command) DisplayText() string { |
| 65 | if c.Description != "" { |
| 66 | return c.Description |
| 67 | } |
| 68 | if c.Instruction != "" { |
| 69 | return c.Instruction |
| 70 | } |
| 71 | if c.URL != "" { |
| 72 | return "Open " + c.URL |
| 73 | } |
| 74 | if c.Agent != "" { |
| 75 | return "Switch to " + c.Agent |
| 76 | } |
| 77 | return "" |
| 78 | } |
| 79 | |
| 80 | // Commands represents a set of named prompts for quick-starting conversations. |
| 81 | // It supports multiple YAML formats: |
no outgoing calls