@kulapard/pi-caveman 0.2.0 → 0.3.0

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/AGENTS.md CHANGED
@@ -12,6 +12,12 @@ Project memory for agents working in this repo. Non-obvious conventions only.
12
12
  session always starts `off`. There is **no** cross-session config file or env var.
13
13
  - Activation = `before_agent_start` appends `modeInstructions(mode)` to the
14
14
  system prompt. Statusline = `ctx.ui.setStatus("caveman", …)` guarded by `hasUI`.
15
+ - The extension's `modeInstructions` injection is the **canonical** activator;
16
+ the `caveman` skill (`skills/caveman/SKILL.md`) is a standalone fallback for
17
+ hosts that load skills but not this extension. When both are active the model
18
+ may see both rule sets — mild, intentional redundancy. They are not
19
+ programmatically de-duped: skill loading is model-driven and the skill's prose
20
+ differs from `modeInstructions`, so there is no reliable text to match on.
15
21
  - Pi 0.80.2 has **no `agents/` subagent mechanism**. The `agents/cavecrew-*.md`
16
22
  files are reference personas only and cavecrew is optional/out-of-scope.
17
23
 
package/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.0] - 2026-06-29
11
+
12
+ ### Fixed
13
+
14
+ - `/caveman-help` card linked "Full docs" to the upstream `JuliusBrussee/caveman`
15
+ repo; now points to `kulapard/pi-caveman`.
16
+ - `caveman-help` skill table was missing `/caveman-stats`, disagreeing with the
17
+ extension's own `HELP_TEXT`; added the row.
18
+ - `ultra` mode was documented as "Tables over prose" in the README and help
19
+ card, contradicting the injected mode instructions; docs now match behavior
20
+ (abbreviate prose words, arrows for causality).
21
+ - Input handler no longer throws when an input event arrives without `text`
22
+ (`event.text.trim()` → `(event.text ?? "").trim()`).
23
+ - `caveman-compress` docs said the backup is always `FILE.original.md`, but the
24
+ skill preserves the source extension; corrected to `FILE.original.<ext>`.
25
+
26
+ ### Changed
27
+
28
+ - `engines.node` floor raised from `>=18` to `>=22.6.0`, matching the
29
+ `node --experimental-strip-types` requirement of the test/typecheck workflow.
30
+ - Natural-language activation now also triggers on `"be brief"` (added to
31
+ `ACTIVATION_RE`, the `caveman` skill description, and the README) so the
32
+ deterministic regex matches the advertised triggers.
33
+
10
34
  ## [0.2.0] - 2026-06-29
11
35
 
12
36
  ### Changed
@@ -41,6 +65,7 @@ port of [caveman](https://github.com/JuliusBrussee/caveman).
41
65
  token, automatic provenance, a tag-equals-version guard, and a concurrency
42
66
  group).
43
67
 
44
- [Unreleased]: https://github.com/kulapard/pi-caveman/compare/v0.2.0...HEAD
68
+ [Unreleased]: https://github.com/kulapard/pi-caveman/compare/v0.3.0...HEAD
69
+ [0.3.0]: https://github.com/kulapard/pi-caveman/compare/v0.2.0...v0.3.0
45
70
  [0.2.0]: https://github.com/kulapard/pi-caveman/compare/v0.1.0...v0.2.0
46
71
  [0.1.0]: https://github.com/kulapard/pi-caveman/releases/tag/v0.1.0
package/README.md CHANGED
@@ -12,9 +12,9 @@ plus a set of skills under `skills/`.
12
12
 
13
13
  ## Install
14
14
 
15
- pi-caveman publishes to npm as
15
+ pi-caveman is published to npm as
16
16
  [`@kulapard/pi-caveman`](https://www.npmjs.com/package/@kulapard/pi-caveman).
17
- Once the first release is live, install it into a Pi setup with:
17
+ Install it into a Pi setup with:
18
18
 
19
19
  ```bash
20
20
  pi install npm:@kulapard/pi-caveman
@@ -67,7 +67,7 @@ session ends.
67
67
  |------|---------|--------|
68
68
  | **lite** | `/caveman lite` | Drop filler. Keep sentence structure. |
69
69
  | **full** | `/caveman` | Drop articles, filler, pleasantries, hedging. Fragments OK. Default. |
70
- | **ultra** | `/caveman ultra` | Extreme compression. Bare fragments. Tables over prose. |
70
+ | **ultra** | `/caveman ultra` | Extreme compression. Bare fragments. Abbreviate prose words; arrows (X → Y). |
71
71
  | **wenyan-lite** | `/caveman wenyan-lite` | Classical Chinese (文言文) style, light compression. |
72
72
  | **wenyan-full** | `/caveman wenyan` | Full 文言文. Maximum classical terseness. |
73
73
  | **wenyan-ultra** | `/caveman wenyan-ultra` | Extreme classical terseness. |
@@ -91,7 +91,7 @@ You don't have to use a slash command. The extension watches your messages and
91
91
  switches mode on phrases like:
92
92
 
93
93
  - **Activate:** "caveman mode", "talk like caveman", "use caveman", "less
94
- tokens", "fewer tokens", "save tokens" → enables **full** mode.
94
+ tokens", "fewer tokens", "save tokens", "be brief" → enables **full** mode.
95
95
  - **Deactivate:** "stop caveman", "normal mode", "disable caveman" → turns it
96
96
  off.
97
97
 
@@ -118,7 +118,7 @@ package — so it does not belong in this extension-plus-skills package.
118
118
 
119
119
  The Pi-side equivalent is the `caveman-compress` skill, invoked via the
120
120
  `/caveman-compress` command. It is prompt-only: the Pi agent itself compresses a
121
- prose memory file in place (writing a `FILE.original.md` backup) using its own
121
+ prose memory file in place (writing a `FILE.original.<ext>` backup) using its own
122
122
  model and file tools, preserving code, URLs, and paths verbatim. No Python and no
123
123
  external Claude CLI are involved — compression is performed by the host Pi agent,
124
124
  the same way the other skills work.
@@ -90,5 +90,5 @@ Auto-clarity:
90
90
  }
91
91
 
92
92
  export const ACTIVATION_RE =
93
- /\b(caveman mode|talk like caveman|use caveman|less tokens|fewer tokens|save tokens)\b/i;
93
+ /\b(caveman mode|talk like caveman|use caveman|less tokens|fewer tokens|save tokens|be brief)\b/i;
94
94
  export const DEACTIVATION_RE = /\b(stop caveman|normal mode|disable caveman)\b/i;
@@ -133,15 +133,14 @@ export default function cavemanExtension(pi: ExtensionAPI) {
133
133
  });
134
134
 
135
135
  pi.on("input", (event, ctx) => {
136
- if (event.source === "extension") return { action: "continue" as const };
137
- const text = event.text.trim();
138
- if (DEACTIVATION_RE.test(text)) {
139
- if (mode !== "off") persistMode("off", ctx);
140
- return { action: "continue" as const };
141
- }
142
- if (mode === "off" && ACTIVATION_RE.test(text)) {
143
- persistMode("full", ctx);
144
- return { action: "continue" as const };
136
+ // Ignore the extension's own echoed input (self-echo guard).
137
+ if (event.source !== "extension") {
138
+ const text = (event.text ?? "").trim();
139
+ if (DEACTIVATION_RE.test(text)) {
140
+ if (mode !== "off") persistMode("off", ctx);
141
+ } else if (mode === "off" && ACTIVATION_RE.test(text)) {
142
+ persistMode("full", ctx);
143
+ }
145
144
  }
146
145
  return { action: "continue" as const };
147
146
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kulapard/pi-caveman",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Caveman for Pi: ultra-compressed agent output that preserves technical substance. Six intensity modes, slash commands, natural-language activation, and a session statusline.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  "CHANGELOG.md"
24
24
  ],
25
25
  "engines": {
26
- "node": ">=18"
26
+ "node": ">=22.6.0"
27
27
  },
28
28
  "keywords": [
29
29
  "pi-package",
@@ -49,6 +49,6 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@earendil-works/pi-coding-agent": "^0.80.2",
52
- "typescript": "^5"
52
+ "typescript": "^6"
53
53
  }
54
54
  }
@@ -5,7 +5,7 @@ description: >
5
5
  while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra,
6
6
  wenyan-lite, wenyan-full, wenyan-ultra.
7
7
  Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens",
8
- "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
8
+ "fewer tokens", "save tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
9
9
  ---
10
10
 
11
11
  Respond terse like smart caveman. All technical substance stay. Only fluff die.
@@ -3,7 +3,7 @@ name: caveman-compress
3
3
  description: >
4
4
  Compress natural language memory files (AGENTS.md, CLAUDE.md, todos, preferences) into caveman
5
5
  format to save input tokens. Preserves all technical substance, code, URLs, and structure.
6
- Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md.
6
+ Compressed version overwrites the original file. Human-readable backup saved as FILE.original.<ext> (same extension as the source).
7
7
  Trigger: /caveman-compress FILEPATH or "compress memory file"
8
8
  ---
9
9
 
@@ -11,7 +11,7 @@ description: >
11
11
 
12
12
  ## Purpose
13
13
 
14
- Compress natural language files (`AGENTS.md`, `CLAUDE.md`, todos, preferences) into caveman-speak to reduce input tokens. Compressed version overwrites original. Human-readable backup saved as `<filename>.original.md`.
14
+ Compress natural language files (`AGENTS.md`, `CLAUDE.md`, todos, preferences) into caveman-speak to reduce input tokens. Compressed version overwrites original. Human-readable backup saved as `<filename>.original.<ext>` (same extension as the source, e.g. `AGENTS.md` → `AGENTS.original.md`, `notes.txt` → `notes.original.txt`).
15
15
 
16
16
  ## Trigger
17
17
 
@@ -104,5 +104,5 @@ Compressed:
104
104
  - Skip files larger than ~500 KB (too big to rewrite safely in one pass)
105
105
  - If file has mixed content (prose + code), compress ONLY the prose sections
106
106
  - If unsure whether something is code or prose, leave it unchanged
107
- - Original file is backed up as FILE.original.md before overwriting
108
- - Never compress FILE.original.md (skip it)
107
+ - Original file is backed up as FILE.original.<ext> (same extension as the source) before overwriting
108
+ - Never compress a FILE.original.<ext> backup (skip it)
@@ -16,7 +16,7 @@ Display this reference card when invoked. One-shot — do NOT change mode, write
16
16
  |------|---------|-------------|
17
17
  | **Lite** | `/caveman lite` | Drop filler. Keep sentence structure. |
18
18
  | **Full** | `/caveman` | Drop articles, filler, pleasantries, hedging. Fragments OK. Default. |
19
- | **Ultra** | `/caveman ultra` | Extreme compression. Bare fragments. Tables over prose. |
19
+ | **Ultra** | `/caveman ultra` | Extreme compression. Bare fragments. Abbreviate prose words; arrows (X → Y). |
20
20
  | **Wenyan-Lite** | `/caveman wenyan-lite` | Classical Chinese style, light compression. |
21
21
  | **Wenyan-Full** | `/caveman wenyan` | Full 文言文. Maximum classical terseness. |
22
22
  | **Wenyan-Ultra** | `/caveman wenyan-ultra` | Extreme. Ancient scholar on a budget. |
@@ -30,6 +30,7 @@ Mode stick until changed or session end.
30
30
  | **caveman-commit** | `/caveman-commit` | Terse commit messages. Conventional Commits. ≤50 char subject. |
31
31
  | **caveman-review** | `/caveman-review` | One-line PR comments: `L42: bug: user null. Add guard.` |
32
32
  | **caveman-compress** | `/caveman-compress <file>` | Compress .md files to caveman prose. Saves ~46% input tokens. |
33
+ | **caveman-stats** | `/caveman-stats` | On-demand, model-driven estimate of tokens saved this session. |
33
34
  | **caveman-help** | `/caveman-help` | This card. |
34
35
 
35
36
  ## Deactivate
@@ -48,4 +49,4 @@ Mode set per session. New session start → mode `off`; activate again with `/ca
48
49
 
49
50
  ## More
50
51
 
51
- Full docs: https://github.com/JuliusBrussee/caveman
52
+ Full docs: https://github.com/kulapard/pi-caveman