DescribeCall returns the contextual one-liner for the plugin's current invocation, or the static Description() as a fallback. The caller never needs to do the type assertion itself.
(p Plugin, args []string)
| 124 | // current invocation, or the static Description() as a fallback. The |
| 125 | // caller never needs to do the type assertion itself. |
| 126 | func DescribeCall(p Plugin, args []string) string { |
| 127 | if p == nil { |
| 128 | return "" |
| 129 | } |
| 130 | if d, ok := p.(DescriberWithInput); ok { |
| 131 | if s := d.DescribeCall(args); s != "" { |
| 132 | return s |
| 133 | } |
| 134 | } |
| 135 | return p.Description() |
| 136 | } |
| 137 | |
| 138 | // PromptFor extracts a system-prompt slice from a Prompter plugin, if |
| 139 | // any. Returns empty string and no error when the plugin doesn't |