Files
9router/open-sse/rtk/cavemanPrompts.js
decolua 936d65ae1c Enhance chat handling and introduce Caveman feature
- Refactored handleChatCore to include Caveman functionality, allowing for terse-style system prompts to reduce output token usage.
- Updated APIPageClient to manage Caveman settings, including enabling/disabling and selecting compression levels.
- Adjusted AntigravityExecutor to consolidate function declarations for compatibility with Gemini.
- Removed unnecessary console logs during translator initialization across multiple routes.
2026-04-30 18:00:38 +07:00

36 lines
1.7 KiB
JavaScript

// Caveman intensity-level prompts injected into system message to reduce output tokens.
// Adapted from caveman skill (https://github.com/JuliusBrussee/caveman).
export const CAVEMAN_LEVELS = {
LITE: "lite",
FULL: "full",
ULTRA: "ultra",
};
const SHARED_BOUNDARIES = "Code blocks, file paths, commands, errors, URLs: keep exact. Security warnings, irreversible action confirmations, multi-step ordered sequences: write normal. Resume terse style after.";
export const CAVEMAN_PROMPTS = {
[CAVEMAN_LEVELS.LITE]: [
"Respond tersely. Keep grammar and full sentences but drop filler, hedging and pleasantries (just/really/basically/sure/of course/I'd be happy to).",
"Pattern: state the thing, the action, the reason. Then next step.",
SHARED_BOUNDARIES,
"Active every response until user asks for normal mode.",
].join(" "),
[CAVEMAN_LEVELS.FULL]: [
"Respond like terse caveman. All technical substance stay exact, only fluff die.",
"Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries, hedging. Fragments OK. Short synonyms (big not extensive, fix not implement a solution for).",
"Pattern: [thing] [action] [reason]. [next step].",
SHARED_BOUNDARIES,
"Active every response until user asks for normal mode.",
].join(" "),
[CAVEMAN_LEVELS.ULTRA]: [
"Respond ultra-terse. Maximum compression. Telegraphic.",
"Abbreviate (DB/auth/config/req/res/fn/impl), strip conjunctions, use arrows for causality (X → Y). One word when one word enough.",
"Pattern: [thing] → [result]. [fix].",
SHARED_BOUNDARIES,
"Active every response until user asks for normal mode.",
].join(" "),
};