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
42
43
44
45
46
47
48
49
50
//! Shared prompt/warning builders for the `/goal` slash command.
//!
//! Both the TUI dispatch (`tui/app/messaging.rs`) and the channel command
//! handler (`channels/commands.rs`) turn a user's `/goal …` into the same
//! behaviour on every surface (TUI, Telegram, Discord, WhatsApp, Slack):
//!
//! - A **bare** `/goal` (no text) is DENIED. It shows a usage warning
//! directly and does NOT touch the agent or the conversation context, so
//! a fat-fingered `/goal` just leaves the chat exactly as it was.
//! - `/goal <text>` (or a management subcommand like `status`/`pause`/
//! `resume`/`clear`) is forwarded to the agent as a `[SYSTEM:]` directive
//! that calls the `slash_command` tool.
//!
//! Keeping the wording in one place stops the surfaces from drifting apart.
/// Warning shown when a user types a bare `/goal` with no text. Displayed
/// directly on every surface — never sent to the LLM, never persisted to
/// context. Tells the user the correct shape: command followed by the goal.
/// Build the `[SYSTEM:]` directive that turns a user's `/goal <text>` into a
/// `slash_command` tool call. `args` is everything typed after `/goal`
/// (whitespace trimmed here). Callers MUST check [`is_bare`] first and show
/// [`goal_usage_warning`] instead of calling this with empty args.
///
/// The directive ALWAYS instructs `command='/goal'` with the rest in the
/// separate `args` field. Folding the text into `command=` (e.g.
/// `command='/goal debug the build'`) makes the dispatch match — which
/// compares against `"/goal"` exactly — fall through and fail, so the call
/// has to be retried. Keeping command and args split avoids that round-trip.
/// True when the `/goal` argument string is empty after trimming, i.e. the
/// user typed a bare `/goal` and should get the usage warning.