pi-caveman 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,7 +62,7 @@ The config dialog lets you:
62
62
  - **Default level** — Set a level that activates automatically on every new session (e.g. `full` to always start in caveman mode)
63
63
  - **Show status bar** — Toggle the animated campfire indicator in the footer
64
64
 
65
- Settings are saved to `~/.pi/agent/caveman.json` and persist across all sessions.
65
+ Settings are saved to `~/.pi/agent/caveman.json` by default and persist across all sessions. If `XDG_CONFIG_HOME` is set, the path becomes `$XDG_CONFIG_HOME/pi/agent/caveman.json`; `PI_CODING_AGENT_DIR` overrides both.
66
66
 
67
67
  ### Status Bar
68
68
 
@@ -82,7 +82,7 @@ When active, a status bar displays caveman level and an animated campfire flicke
82
82
 
83
83
  ## How It Works
84
84
 
85
- The extension hooks `before_agent_start` to append caveman communication rules to the system prompt at the selected intensity. Within a session, the active level is stored as a custom session entry and restored on resume. Across sessions, persistent config (`~/.pi/agent/caveman.json`) provides the default level and status bar preference. Auto-clarity rules tell the model to drop caveman mode for security warnings or irreversible actions.
85
+ The extension hooks `before_agent_start` to append caveman communication rules to the system prompt at the selected intensity. Within a session, the active level is stored as a custom session entry and restored on resume. Across sessions, persistent config (`~/.pi/agent/caveman.json` by default, or `$XDG_CONFIG_HOME/pi/agent/caveman.json` when `XDG_CONFIG_HOME` is set; `PI_CODING_AGENT_DIR` overrides both) provides the default level and status bar preference. Auto-clarity rules tell the model to drop caveman mode for security warnings or irreversible actions.
86
86
 
87
87
  ## Warning
88
88
 
@@ -159,7 +159,10 @@ Respond like smart caveman. Cut all filler, keep technical substance.
159
159
 
160
160
  const INTENSITY: Record<Exclude<Level, "off" | "micro">, string> = {
161
161
  lite: `\
162
- No filler/hedging. Keep articles + full sentences. Professional but tight.
162
+ No filler, no hedging, no pleasantries. Keep articles and full sentences.
163
+ Write like a tight senior engineer in chat: complete sentences, plain prose,
164
+ no fragments unless natural. Technical terms exact. Short is good, choppy is not.
165
+ Prefer 2-4 sentence answers over bullet fragments when prose reads better.
163
166
  Example: "Your component re-renders because you create a new object reference each render. Wrap it in \`useMemo\`."`,
164
167
 
165
168
  full: `\
@@ -236,13 +239,16 @@ export default function caveman(pi: ExtensionAPI) {
236
239
 
237
240
  function syncStatus(ctx: Pick<ExtensionContext, "ui">) {
238
241
  stopAnimation();
239
- const theme = ctx.ui.theme;
240
242
 
241
243
  if (level === "off" || !config.showStatus) {
242
244
  ctx.ui.setStatus("caveman", "");
243
245
  return;
244
246
  }
245
247
 
248
+ // Hosts like pi-web-ui expose setStatus without a TUI theme — bail instead of throwing on theme.fg.
249
+ if (!ctx.ui.theme?.fg) return;
250
+ const theme = ctx.ui.theme;
251
+
246
252
  const anim = ANIMATIONS[level];
247
253
  const setFrame = (frame: string) => {
248
254
  ctx.ui.setStatus("caveman", frame + " " + theme.fg("muted", "caveman level: ") + theme.fg("text", anim.label));
@@ -435,7 +441,11 @@ export default function caveman(pi: ExtensionAPI) {
435
441
  await ensureConfigLoaded();
436
442
  if (level === "off") return;
437
443
  const addition =
438
- level === "micro" ? MICRO_PROMPT : `${BASE}\n\n${INTENSITY[level]}\n\n${SAFETY}`;
444
+ level === "micro"
445
+ ? MICRO_PROMPT
446
+ : level === "lite"
447
+ ? `${INTENSITY.lite}\n\n${SAFETY}`
448
+ : `${BASE}\n\n${INTENSITY[level]}\n\n${SAFETY}`;
439
449
  return {
440
450
  systemPrompt: appendSystemPrompt(
441
451
  event.systemPrompt as string | string[] | null | undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-caveman",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Why use many token when few do trick. Caveman mode for pi — cuts ~75% output tokens while keeping full technical accuracy.",
5
5
  "keywords": [
6
6
  "pi-package",