Skip to main content

jev_repl/
presets.rs

1//! Ready-made sessions to poke at: `:preset <name>`.
2
3pub struct Preset {
4    pub name: &'static str,
5    pub about: &'static str,
6    /// Commands replayed as if typed.
7    pub script: &'static [&'static str],
8}
9
10pub const PRESETS: &[Preset] = &[
11    Preset {
12        name: "triage",
13        about: "Route a support ticket: department, frustration, urgency",
14        script: &[
15            ":state Hi, I've been trying to connect my Stripe account for 3 days and it keeps failing. I'm losing sales. Please help ASAP.",
16            ":choice department Which team should handle this | billing=Payment or subscription issues | technical=Bugs or integration problems | sales=Pricing or account questions",
17            ":score frustration How frustrated the customer appears | Calm, just stating facts | Frustrated but civil | Very angry, strong language",
18            ":noul is_urgent The message conveys urgency or time-sensitivity",
19        ],
20    },
21    Preset {
22        name: "moderation",
23        about: "Screen user content before it is published",
24        script: &[
25            ":state You people are useless. Fix my order or I'll come down there myself.",
26            ":noul is_threat The message threatens violence against a person | yes: A stated intent to harm someone | no: Anger, insults or profanity with no threat of harm",
27            ":score severity How far out of bounds this is | Fine as written | Rude but publishable | Abusive, needs review | Remove immediately",
28            ":choice action What to do with this content | publish=Nothing wrong with it | flag=A human should look | block=Clearly violates the rules",
29        ],
30    },
31    Preset {
32        name: "lead",
33        about: "Qualify an inbound sales email",
34        script: &[
35            ":state Hi — we're a 300-person logistics company evaluating vendors this quarter. Budget is approved. Can you send pricing for 250 seats?",
36            ":noul has_budget The sender indicates budget is available or approved",
37            ":score readiness How close this is to a buying decision | Just browsing | Researching options | Actively evaluating vendors | Ready to buy now",
38            ":choice size Company size implied by the message | smb=Under 50 people | mid=50 to 1000 people | enterprise=Over 1000 people",
39        ],
40    },
41    Preset {
42        name: "reply",
43        about: "Grade a draft reply before it is sent",
44        script: &[
45            ":state Draft reply: \"That's not our problem. You configured it wrong. Read the docs.\"",
46            ":noul answers_question The reply actually addresses what was asked",
47            ":score tone Tone of the reply | Warm and helpful | Neutral | Curt | Hostile",
48            ":noul safe_to_send This reply can go out without a human reading it first | yes: Accurate, on-topic and civil | no: Rude, evasive or likely to make things worse",
49        ],
50    },
51];
52
53pub fn find(name: &str) -> Option<&'static Preset> {
54    PRESETS.iter().find(|p| p.name == name)
55}