1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use serde::{Deserialize, Serialize};
/// Enumerates the different types of commands that can be invoked with tags or anchors.
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub enum CommandKind {
/// A debug-only command.
Tag,
/// Includes content from another context file.
Include,
/// Inlines content from another file directly.
Inline,
/// Triggers a call to an external model to get an "answer".
Answer,
/// A command to repeat a section (not fully implemented).
Repeat,
/// Set variables from there on
Set,
/// Forget previous context
Forget,
/// Used to segment long tasks into steps
Task,
/// Used in tandem with task
Done,
}
impl ToString for CommandKind {
fn to_string(&self) -> String {
match self {
CommandKind::Tag => "tag",
CommandKind::Include => "include",
CommandKind::Inline => "inline",
CommandKind::Answer => "answer",
CommandKind::Repeat => "repeat",
CommandKind::Set => "set",
CommandKind::Forget => "forget",
CommandKind::Task => "task",
CommandKind::Done => "done",
}
.to_string()
}
}