2024-05-24 19:44:32 +00:00
|
|
|
interface slash-command {
|
2024-06-18 21:28:01 +00:00
|
|
|
use common.{range};
|
|
|
|
|
2024-05-24 19:44:32 +00:00
|
|
|
/// A slash command for use in the Assistant.
|
|
|
|
record slash-command {
|
|
|
|
/// The name of the slash command.
|
|
|
|
name: string,
|
|
|
|
/// The description of the slash command.
|
|
|
|
description: string,
|
2024-05-27 23:44:54 +00:00
|
|
|
/// The tooltip text to display for the run button.
|
|
|
|
tooltip-text: string,
|
2024-05-24 19:44:32 +00:00
|
|
|
/// Whether this slash command requires an argument.
|
|
|
|
requires-argument: bool,
|
|
|
|
}
|
2024-06-18 21:28:01 +00:00
|
|
|
|
|
|
|
/// The output of a slash command.
|
|
|
|
record slash-command-output {
|
|
|
|
/// The text produced by the slash command.
|
|
|
|
text: string,
|
|
|
|
/// The list of sections to show in the slash command placeholder.
|
|
|
|
sections: list<slash-command-output-section>,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// A section in the slash command output.
|
|
|
|
record slash-command-output-section {
|
|
|
|
/// The range this section occupies.
|
|
|
|
range: range,
|
|
|
|
/// The label to display in the placeholder for this section.
|
|
|
|
label: string,
|
|
|
|
}
|
2024-07-05 18:08:42 +00:00
|
|
|
|
|
|
|
/// A completion for a slash command argument.
|
|
|
|
record slash-command-argument-completion {
|
|
|
|
/// The label to display for this completion.
|
|
|
|
label: string,
|
|
|
|
/// The new text that should be inserted into the command when this completion is accepted.
|
|
|
|
new-text: string,
|
|
|
|
/// Whether the command should be run when accepting this completion.
|
|
|
|
run-command: bool,
|
|
|
|
}
|
2024-05-24 19:44:32 +00:00
|
|
|
}
|