1interface slash-command {
2 use common.{range};
3
4 /// A slash command for use in the Assistant.
5 record slash-command {
6 /// The name of the slash command.
7 name: string,
8 /// The description of the slash command.
9 description: string,
10 /// The tooltip text to display for the run button.
11 tooltip-text: string,
12 /// Whether this slash command requires an argument.
13 requires-argument: bool,
14 }
15
16 /// The output of a slash command.
17 record slash-command-output {
18 /// The text produced by the slash command.
19 text: string,
20 /// The list of sections to show in the slash command placeholder.
21 sections: list<slash-command-output-section>,
22 }
23
24 /// A section in the slash command output.
25 record slash-command-output-section {
26 /// The range this section occupies.
27 range: range,
28 /// The label to display in the placeholder for this section.
29 label: string,
30 }
31
32 /// A completion for a slash command argument.
33 record slash-command-argument-completion {
34 /// The label to display for this completion.
35 label: string,
36 /// The new text that should be inserted into the command when this completion is accepted.
37 new-text: string,
38 /// Whether the command should be run when accepting this completion.
39 run-command: bool,
40 }
41}