// The text policy for mediated prompts (#1507, CHAT-03 ยง4). // // CHAT-01 lines 181โ€“183 refuse `text-policy` when the first non-whitespace // character is `/`. CHAT-01 lines 368โ€“370 leave `!`, `@` and slashes on later // lines open; CHAT-03 settles them from the pinned Pi 0.85.1 source. The RPC // `prompt` command calls AgentSession.prompt(message) (rpc-mode.js 298โ€“318), // and that path interprets text only through three checks, all on the exact // first character: // // - extension commands: `text.startsWith("/")` (agent-session.js 828); // - skills: `text.startsWith("/skill:")` (agent-session.js 984); // - prompt templates: `text.startsWith("/")` (prompt-templates.js 222). // // The bundle `pi` runs (dist/bundle/chunks/chunk-JVUZSMYM.js) carries the same // three checks. `!` and `!!` are shell shortcuts of the interactive editor only // (interactive-mode.js 2502), and `@` is a file argument of the command line // only (cli/args.js 214); neither is on the RPC prompt path. Pi never trims // before its checks, so a slash after leading whitespace or on a later line is // plain text to Pi. CHAT-01's rule still refuses the leading-whitespace case. // // Every prefix is therefore classified: a first non-whitespace `/` is refused, // and everything else is text. PREFIXES is the list the tests read (S2). export const TEXT_POLICY = "text-policy"; export const PREFIXES = Object.freeze([ Object.freeze({ prefix: "/", interpreted: true, example: "/goal x", basis: "agent-session.js 828: extension commands run immediately" }), Object.freeze({ prefix: "/skill:", interpreted: true, example: "/skill:ms-unslop", basis: "agent-session.js 984: skills expand" }), Object.freeze({ prefix: "/