@lornatang/dsh-caveman 0.1.0 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,16 +1,29 @@
1
- # Changelog
2
-
3
- ## 0.1.0 - 2026-11-18
4
-
5
- - Honor HTTP and HTTPS proxy settings when downloading verified analyzers.
6
-
7
- - Keep native child-session observations available after transient hook failures.
8
- - Read native responses promptly and allow bounded transport scheduling slack.
9
- - Provide Caveman skills and session-specific response styles.
10
- - Register Cavecrew investigator, builder, and reviewer presets and delegation tools.
11
- - Support recoverable native tool-result compression and session usage reports.
12
- - Analyze DSH session history and recover verified input from diagnostic locators.
13
- - Merge child-agent observations into their parent session.
14
- - Reduce repeated session scans and batch recoverable compression requests.
15
- - Offer Blocks suggestions and Browse MCP tools.
16
- - Provide an Auto model routing configuration and command-line entry.
1
+ # Changelog
2
+
3
+ ## 0.1.2 - 2026-11-18
4
+
5
+ - Settle the block hook promise on timeout or abort, so a hung analyzer cannot stall tool execution.
6
+ - Count only successful edits against the Cavecrew builder budget and match file identities with platform-aware case folding.
7
+ - Bound retained compression originals to 64 entries and 8 MiB, and drop an entry once it has been restored.
8
+ - Report inherited-event statistics from the current session's own events instead of replaying the whole log.
9
+ - Require a configured analyzer binary to be executable, and require the native bridge socket to be a socket owned by the service user on POSIX.
10
+ - Open input-state files non-blocking so a FIFO cannot stall the pre-execution check.
11
+
12
+ ## 0.1.1 - 2026-11-18
13
+
14
+ - Republish the DSH plugin with the verified analyzer binaries attached to the matching GitHub release.
15
+
16
+ ## 0.1.0 - 2026-11-18
17
+
18
+ - Honor HTTP and HTTPS proxy settings when downloading verified analyzers.
19
+
20
+ - Keep native child-session observations available after transient hook failures.
21
+ - Read native responses promptly and allow bounded transport scheduling slack.
22
+ - Provide Caveman skills and session-specific response styles.
23
+ - Register Cavecrew investigator, builder, and reviewer presets and delegation tools.
24
+ - Support recoverable native tool-result compression and session usage reports.
25
+ - Analyze DSH session history and recover verified input from diagnostic locators.
26
+ - Merge child-agent observations into their parent session.
27
+ - Reduce repeated session scans and batch recoverable compression requests.
28
+ - Offer Blocks suggestions and Browse MCP tools.
29
+ - Provide an Auto model routing configuration and command-line entry.
package/README.md CHANGED
@@ -1,218 +1,218 @@
1
- ---
2
- description: "Caveman voice, recoverable compression, browser tools, and delegation for DeepSeek Harness."
3
- kind: "package-bundle"
4
- ---
5
-
6
- # @lornatang/dsh-caveman
7
-
8
- English | [中文](README.zh.md)
9
-
10
- ## Summary
11
-
12
- `dsh-caveman` brings Caveman skills and tools to DeepSeek Harness. It provides session-specific response styles, recoverable tool-result compression, Auto model routing, Blocks suggestions, Browse tools, and Cavecrew delegation. Install the bundle into a profile to make these capabilities available to its sessions.
13
-
14
- ## Table of Contents
15
-
16
- - [Use this package](#use-this-package)
17
- - [Understand the implementation](#understand-the-implementation)
18
- - [Further Exploration](#further-exploration)
19
- - [Model Experience](#model-experience)
20
- - [Known Limitations](#known-limitations)
21
- - [Dev Note](#dev-note)
22
-
23
- -----
24
-
25
- <a id="use-this-package"></a>
26
- ## Use this package
27
-
28
- Node.js 22.19 or newer and DSH are required. Install the bundle into the profile whose sessions should use Caveman.
29
-
30
- ### Install into a profile
31
-
32
- Install and remove the package with:
33
-
34
- ```text
35
- dsh plugin --profile <name> add @lornatang/dsh-caveman
36
- dsh plugin --profile <name> remove @lornatang/dsh-caveman
37
- ```
38
-
39
- To install a package built from the repository:
40
-
41
- ```sh
42
- git clone https://github.com/Lornatang/dsh-caveman.git
43
- cd dsh-caveman
44
- npm ci
45
- npm pack
46
- dsh plugin --profile <name> add ./lornatang-dsh-caveman-0.1.0.tgz
47
- ```
48
-
49
- The `add` command composes the bundle into the profile. Its patches insert the `caveman` row, three Cavecrew presets, and their delegation tools. Restart DSH after `add` or `remove` so the profile reloads its composition.
50
-
51
- ### What you get
52
-
53
- | Surface | Provided by |
54
- |---|---|
55
- | Caveman skills and session-specific response styles | `src/skills.ts`, `src/mode.ts` |
56
- | Native coding policy | `src/index.ts` |
57
- | `/caveman-stats` for recorded session and historical usage | `src/stats.ts` |
58
- | Recoverable tool-result compression and `caveman_retrieve` | `src/compression.ts` and the middleware runtime |
59
- | Compression, recovery, statistics, and TOON MCP tools | DSH MCP manager and `caveman-mcp` |
60
- | Local memory and exact recovery | DSH MCP manager and `cavemem` |
61
- | Auto model selection | DSH pi-ai provider and Caveman proxy |
62
- | Shell suggestions | `src/blocks.ts` and Blocks |
63
- | `mcp__caveman_browse__*` browser tools | DSH MCP manager and Browse |
64
- | `cavecrew-investigator`, `cavecrew-builder`, `cavecrew-reviewer` | `presets/cavecrew.patch.yml` and `src/cavecrew.ts` |
65
- | `dsh-caveman` command when installed as a Node package | `scripts/caveman-cli.mjs` and `@caveman-ai/cli` |
66
-
67
- ### Configuration
68
-
69
- The bundle supplies a `caveman` row. Override only the fields you want to change in the profile's `cordis.patch.yml`:
70
-
71
- ```yaml
72
- # $DSH_HOME/profiles/<name>/cordis.patch.yml
73
- - id: caveman
74
- config:
75
- defaultMode: manual
76
- ```
77
-
78
- | Field | Default | Meaning |
79
- |---|---|---|
80
- | `defaultMode` | Configuration-derived, otherwise `caveman` | Starting voice for a session. |
81
- | `inputCompression` | auto | Use a verified local runtime when available; set `false` to disable or `true` to use the configured endpoint. |
82
- | `middlewareEndpoint` | `http://127.0.0.1:8787` | Loopback middleware address. |
83
- | `blocksBinary` | auto-detected | Override the absolute path to `caveman-blocks`. |
84
- | `browseBinary` | auto-detected | Override the absolute path to `caveman-browse`; requires the DSH MCP manager. |
85
- | `mcpBinary` | auto-detected | Override the absolute path to `caveman-mcp`; requires the DSH MCP manager. |
86
- | `memoryBinary` | auto-detected | Override the absolute path to `cavemem`; enables its local memory tools. |
87
-
88
- ### Voice and usage
89
-
90
- Use `/caveman`, `/ultracave`, `/megacave`, `/caveman ultra`, `/caveman wenyan`, `/caveman status`, or `stop caveman`. Mode changes belong to the current session. All 22 Caveman skills are available for explicit invocation; the model can also invoke the skills whose metadata permits it.
91
-
92
- `defaultMode` accepts `caveman`, `ultracave`, `megacave`, `manual`, or `off`. An explicit profile value wins; otherwise the resolver checks `CAVEMAN_DEFAULT_MODE`, project configuration, and user configuration before falling back to `caveman`.
93
-
94
- The native coding policy is included in the system prompt when the output module and Core are active. When the local runtime is running, it also supplies task-specific rules, maintains state across compaction, and can suggest reusing a verified unchanged file observation. Recovery references are shown only when the recovery MCP tool is available. `CAVEMAN_CORE=off`, record mode, or the `record-only` native profile disables the active rules; restart DSH after changing these settings. The `core-lean-build` profile adds the lean-build policy.
95
-
96
- `/caveman-stats` reports usage recorded on committed assistant messages, with output attributed to response modes when recorded. Use `--all` for live and stored sessions, `--since 7d` or `--since 24h` for usage within that window, and `--share` for a concise report of the selected scope. Historical totals exclude fork-inherited events and identify unavailable records. Savings remain unknown without a comparison.
97
-
98
- ### Usage analysis
99
-
100
- Run `npx @lornatang/dsh-caveman learn --json` for a local report, or add `--sources dsh` to focus on DSH sessions. Add `--retro` for the retrospective compression analysis. The first run downloads the platform's analyzer and verifies it against the package's SHA-256 manifest; later runs reuse the verified local copy. The `caveman-learn` skill can review findings and guide individual fixes with consent.
101
-
102
- DSH sessions are read from `$DSH_HOME/sessions` or `~/.dsh/sessions`. Set `CAVEMAN_DSH_SESSION_ROOT` when the session persistence backend uses a different directory.
103
-
104
- ### Recoverable compression
105
-
106
- Install the signed runtime components, select compression, and start the local middleware:
107
-
108
- ```sh
109
- npx @lornatang/dsh-caveman setup --install
110
- npx @lornatang/dsh-caveman tools config set think.mode compress
111
- npx @lornatang/dsh-caveman start
112
- ```
113
-
114
- Keep the last command running. With the `input` module enabled, the plugin detects its loopback listener and verifies it against the runtime's local run-state before sending tool content. Set `inputCompression: false` to turn this off. To explicitly use a configured middleware endpoint, set:
115
-
116
- ```yaml
117
- - id: caveman
118
- config:
119
- inputCompression: true
120
- middlewareEndpoint: 'http://127.0.0.1:8787'
121
- ```
122
-
123
- Text blocks of at least 2048 UTF-16 code units in successful tool results are eligible, including `run_code` results; other blocks remain intact. The model receives a recovery handle only when `caveman_retrieve` is callable directly or through the program SDK. The original remains in the session log and is restored to the visible session after the model request is prepared. If the runtime becomes unavailable, the session can still return exact original pages.
124
-
125
- ### Auto model selection
126
-
127
- Sign in with `npx @lornatang/dsh-caveman login`, enable the `routing` module, and start the local proxy as shown above. Make an OpenAI credential available to DSH as `OPENAI_API_KEY`.
128
-
129
- Merge the `caveman-auto` provider from [examples/caveman-auto.patch.yml](examples/caveman-auto.patch.yml) into the existing `llm-pi-ai` provider configuration, preserving other providers, and select its `caveman-auto` model. The example is an excerpt; replacing the entire provider map with it would remove other routes.
130
-
131
- When Auto is selected and routing is enabled, the proxy sends the latest and previous user asks, the tail of the last assistant response, and request facts to Caveman Cloud to select a model. The Free plan may retain that information to improve routing. When routing is off, the proxy falls back to its OpenAI default model; provider billing still applies. See the [privacy details](https://github.com/JuliusBrussee/caveman/blob/main/docs/technical/security-and-privacy.md).
132
-
133
- For Anthropic API traffic, merge [examples/caveman-anthropic.patch.yml](examples/caveman-anthropic.patch.yml) into the provider map and choose an available model. The local proxy can then apply its cache-warming policy when the request and provider cache are eligible; warm requests are recorded as usage.
134
-
135
- ### MCP, Blocks and Browse
136
-
137
- When `caveman-mcp` is installed, the DSH MCP manager exposes the `mcp__caveman__*` tools `caveman_compress`, `caveman_retrieve`, `caveman_stats`, `caveman_toon_encode`, and `caveman_toon_decode`. The server uses the local Caveman recovery store for its handles. Set `CAVEMAN_MCP=off` to disable automatic registration.
138
-
139
- When `cavemem` is installed, the MCP manager exposes `mcp__cavemem__*` tools for remembering, recalling, revising, inspecting, and forgetting local facts. `cavemem_recover` returns the exact original behind a recall handle and requires the DSH subprocess and working-directory services. Memories persist in the local Caveman home.
140
-
141
- When `caveman-blocks` is installed, `bash` and `pwsh` calls can receive Blocks suggestions. Suggestions accompany the result and do not change the command. Blocks reads the local `.blocks` directory and may save scrubbed script observations and usage data; see its [telemetry settings](https://github.com/caveman-ai/blocks/blob/main/docs/TELEMETRY.md).
142
-
143
- When `caveman-browse` is installed, the DSH MCP manager registers `mcp__caveman_browse__browser_snapshot`, `browser_act`, `browser_eval`, and `browser_recover`. Browse starts a dedicated headless Chrome by default. Its tools share the server's browser state and can navigate and run JavaScript.
144
-
145
- The plugin looks for each binary in its `CAVEMAN_MCP_BIN`, `CAVEMAN_BLOCKS_BIN`, `CAVEMAN_BROWSE_BIN`, or `CAVEMEM_BIN` override, on `PATH`, then in `$CAVEMAN_HOME/bin` (or `~/.caveman/bin`). Profile paths take precedence. Module switches are read on startup; restart DSH after changing them.
146
-
147
- ### Cavecrew
148
-
149
- The bundle defines the `cavecrew-investigator`, `cavecrew-builder`, and `cavecrew-reviewer` presets and corresponding delegation tools. The investigator and reviewer can read and search files and inspect Git through `cavecrew_git`; the builder can read and edit up to two file paths. The Git tool provides the read-only operations relevant to each role. They require the profile's agent-preset registry and in-process subagent provider.
150
-
151
- Each role inherits its parent provider and model. Set `CAVECREW_INVESTIGATOR_MODEL`, `CAVECREW_BUILDER_MODEL`, or `CAVECREW_REVIEWER_MODEL` before starting DSH to select another model on that provider for the corresponding role.
152
-
153
- ### Command-line interface
154
-
155
- When installed as a Node package, `dsh-caveman` forwards arguments and exit status to `@caveman-ai/cli`. In a checkout, run `node scripts/caveman-cli.mjs --help`.
156
-
157
- -----
158
-
159
- <a id="understand-the-implementation"></a>
160
- ## Understand the implementation
161
-
162
- <details>
163
- <summary>Implementation internals</summary>
164
-
165
- | Path | Responsibility |
166
- |---|---|
167
- | `cordis.patch.yml` and `presets/cavecrew.patch.yml` | Compose the host plugin, presets, and delegation tools. |
168
- | `src/index.ts` | Register skills, session voice instructions, and optional integrations. |
169
- | `src/skills.ts` and `src/mode.ts` | Provide skill content and resolve session mode changes. |
170
- | `src/stats.ts` | Report recorded session usage. |
171
- | `src/compression.ts` | Prepare recoverable tool-result projections and restore the session surface. |
172
- | `src/blocks.ts` | Supply Blocks suggestions for shell calls. |
173
- | `src/cavecrew.ts` | Install Cavecrew personas and scope their tools. |
174
- | `scripts/caveman-cli.mjs` | Forward command-line arguments. |
175
- | `tests/` | Verify DSH services, runtime integrations, and package installation. |
176
-
177
- Mode changes use direct user messages. Compression keeps the original session event and restores any pending projection during cleanup. Recovery handles are scoped to a session.
178
-
179
- </details>
180
-
181
- -----
182
-
183
- <a id="further-exploration"></a>
184
- ## Further Exploration
185
-
186
- - [CHANGELOG.md](CHANGELOG.md) — package changes.
187
- - [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) — profile and plugin configuration.
188
- - [NOTICE](NOTICE) and [LICENSE](LICENSE) — licensing and attribution.
189
-
190
- -----
191
-
192
- <a id="model-experience"></a>
193
- ## Model Experience
194
-
195
- The selected voice is supplied to the model on user turns. Eligible tool results can be shortened in model requests with a `caveman_retrieve` handle. User prompts are not rewritten. Savings and quality depend on the workload and have not been measured for this integration.
196
-
197
- #### KV Cache effect
198
-
199
- Changing voice or replacing and restoring a tool-result surface can change the cached prefix. Cache behavior depends on the provider.
200
-
201
- <a id="known-limitations"></a>
202
- ## Known Limitations
203
-
204
- - Auto requires a configured pi-ai provider, Caveman proxy, Cloud login, and OpenAI credential. The integration tests use local mock services.
205
- - Browse requires the MCP manager, `caveman-browse`, and Chrome. Blocks requires `caveman-blocks` and a local workspace.
206
- - Compression handles text blocks in tool results. Offline recovery returns exact pages; text-query recovery requires the middleware.
207
- - Some skills require additional CLI, account, or agent setup.
208
- - Cavecrew's inspection roles use read, search, and read-only Git tools; the builder can edit existing files and is limited to two file paths.
209
-
210
- <a id="dev-note"></a>
211
- ### Dev Note
212
-
213
- <details>
214
- <summary>Maintainer context</summary>
215
-
216
- `npm run typecheck` checks TypeScript; `npm test` builds and runs the tests. Set `CAVEMAN_PROXY_BINARY`, `CAVEMAN_MCP_BINARY`, `CAVEMEM_BINARY`, `CAVEMAN_BLOCKS_BINARY`, and `CAVEMAN_BROWSE_BINARY` to compatible executables and `CAVEMAN_BROWSE_CHROME` to Chrome to run the runtime integration tests. Set `DSH_CAVEMAN_LEARN_BINARY` to a built analyzer to test session analysis. Auto's test also requires OpenSSL. `npm run test:dsh` installs, boots, and removes the pack in an isolated profile. `npm pack` runs the test suite through `prepack`. `npm run benchmark` measures skill discovery and incremental session processing on synthetic input.
217
-
218
- </details>
1
+ ---
2
+ description: "Caveman voice, recoverable compression, browser tools, and delegation for DeepSeek Harness."
3
+ kind: "package-bundle"
4
+ ---
5
+
6
+ # @lornatang/dsh-caveman
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ `dsh-caveman` brings Caveman skills and tools to DeepSeek Harness. It provides session-specific response styles, recoverable tool-result compression, Auto model routing, Blocks suggestions, Browse tools, and Cavecrew delegation. Install the bundle into a profile to make these capabilities available to its sessions.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations](#known-limitations)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ Node.js 22.19 or newer and DSH are required. Install the bundle into the profile whose sessions should use Caveman.
29
+
30
+ ### Install into a profile
31
+
32
+ Install and remove the package with:
33
+
34
+ ```text
35
+ dsh plugin --profile <name> add @lornatang/dsh-caveman
36
+ dsh plugin --profile <name> remove @lornatang/dsh-caveman
37
+ ```
38
+
39
+ To install a package built from the repository:
40
+
41
+ ```sh
42
+ git clone https://github.com/Lornatang/dsh-caveman.git
43
+ cd dsh-caveman
44
+ npm ci
45
+ npm pack
46
+ dsh plugin --profile <name> add ./lornatang-dsh-caveman-0.1.2.tgz
47
+ ```
48
+
49
+ The `add` command composes the bundle into the profile. Its patches insert the `caveman` row, three Cavecrew presets, and their delegation tools. Restart DSH after `add` or `remove` so the profile reloads its composition.
50
+
51
+ ### What you get
52
+
53
+ | Surface | Provided by |
54
+ |---|---|
55
+ | Caveman skills and session-specific response styles | `src/skills.ts`, `src/mode.ts` |
56
+ | Native coding policy | `src/index.ts` |
57
+ | `/caveman-stats` for recorded session and historical usage | `src/stats.ts` |
58
+ | Recoverable tool-result compression and `caveman_retrieve` | `src/compression.ts` and the middleware runtime |
59
+ | Compression, recovery, statistics, and TOON MCP tools | DSH MCP manager and `caveman-mcp` |
60
+ | Local memory and exact recovery | DSH MCP manager and `cavemem` |
61
+ | Auto model selection | DSH pi-ai provider and Caveman proxy |
62
+ | Shell suggestions | `src/blocks.ts` and Blocks |
63
+ | `mcp__caveman_browse__*` browser tools | DSH MCP manager and Browse |
64
+ | `cavecrew-investigator`, `cavecrew-builder`, `cavecrew-reviewer` | `presets/cavecrew.patch.yml` and `src/cavecrew.ts` |
65
+ | `dsh-caveman` command when installed as a Node package | `scripts/caveman-cli.mjs` and `@caveman-ai/cli` |
66
+
67
+ ### Configuration
68
+
69
+ The bundle supplies a `caveman` row. Override only the fields you want to change in the profile's `cordis.patch.yml`:
70
+
71
+ ```yaml
72
+ # $DSH_HOME/profiles/<name>/cordis.patch.yml
73
+ - id: caveman
74
+ config:
75
+ defaultMode: manual
76
+ ```
77
+
78
+ | Field | Default | Meaning |
79
+ |---|---|---|
80
+ | `defaultMode` | Configuration-derived, otherwise `caveman` | Starting voice for a session. |
81
+ | `inputCompression` | auto | Use a verified local runtime when available; set `false` to disable or `true` to use the configured endpoint. |
82
+ | `middlewareEndpoint` | `http://127.0.0.1:8787` | Loopback middleware address. |
83
+ | `blocksBinary` | auto-detected | Override the absolute path to `caveman-blocks`. |
84
+ | `browseBinary` | auto-detected | Override the absolute path to `caveman-browse`; requires the DSH MCP manager. |
85
+ | `mcpBinary` | auto-detected | Override the absolute path to `caveman-mcp`; requires the DSH MCP manager. |
86
+ | `memoryBinary` | auto-detected | Override the absolute path to `cavemem`; enables its local memory tools. |
87
+
88
+ ### Voice and usage
89
+
90
+ Use `/caveman`, `/ultracave`, `/megacave`, `/caveman ultra`, `/caveman wenyan`, `/caveman status`, or `stop caveman`. Mode changes belong to the current session. All 22 Caveman skills are available for explicit invocation; the model can also invoke the skills whose metadata permits it.
91
+
92
+ `defaultMode` accepts `caveman`, `ultracave`, `megacave`, `manual`, or `off`. An explicit profile value wins; otherwise the resolver checks `CAVEMAN_DEFAULT_MODE`, project configuration, and user configuration before falling back to `caveman`.
93
+
94
+ The native coding policy is included in the system prompt when the output module and Core are active. When the local runtime is running, it also supplies task-specific rules, maintains state across compaction, and can suggest reusing a verified unchanged file observation. Recovery references are shown only when the recovery MCP tool is available. `CAVEMAN_CORE=off`, record mode, or the `record-only` native profile disables the active rules; restart DSH after changing these settings. The `core-lean-build` profile adds the lean-build policy.
95
+
96
+ `/caveman-stats` reports usage recorded on committed assistant messages, with output attributed to response modes when recorded. Use `--all` for live and stored sessions, `--since 7d` or `--since 24h` for usage within that window, and `--share` for a concise report of the selected scope. Historical totals exclude fork-inherited events and identify unavailable records. Savings remain unknown without a comparison.
97
+
98
+ ### Usage analysis
99
+
100
+ Run `npx @lornatang/dsh-caveman learn --json` for a local report, or add `--sources dsh` to focus on DSH sessions. Add `--retro` for the retrospective compression analysis. The first run downloads the platform's analyzer and verifies it against the package's SHA-256 manifest; later runs reuse the verified local copy. The `caveman-learn` skill can review findings and guide individual fixes with consent.
101
+
102
+ DSH sessions are read from `$DSH_HOME/sessions` or `~/.dsh/sessions`. Set `CAVEMAN_DSH_SESSION_ROOT` when the session persistence backend uses a different directory.
103
+
104
+ ### Recoverable compression
105
+
106
+ Install the signed runtime components, select compression, and start the local middleware:
107
+
108
+ ```sh
109
+ npx @lornatang/dsh-caveman setup --install
110
+ npx @lornatang/dsh-caveman tools config set think.mode compress
111
+ npx @lornatang/dsh-caveman start
112
+ ```
113
+
114
+ Keep the last command running. With the `input` module enabled, the plugin detects its loopback listener and verifies it against the runtime's local run-state before sending tool content. Set `inputCompression: false` to turn this off. To explicitly use a configured middleware endpoint, set:
115
+
116
+ ```yaml
117
+ - id: caveman
118
+ config:
119
+ inputCompression: true
120
+ middlewareEndpoint: 'http://127.0.0.1:8787'
121
+ ```
122
+
123
+ Text blocks of at least 2048 UTF-16 code units in successful tool results are eligible, including `run_code` results; other blocks remain intact. The model receives a recovery handle only when `caveman_retrieve` is callable directly or through the program SDK. The original remains in the session log and is restored to the visible session after the model request is prepared. If the runtime becomes unavailable, the session can still return exact original pages.
124
+
125
+ ### Auto model selection
126
+
127
+ Sign in with `npx @lornatang/dsh-caveman login`, enable the `routing` module, and start the local proxy as shown above. Make an OpenAI credential available to DSH as `OPENAI_API_KEY`.
128
+
129
+ Merge the `caveman-auto` provider from [examples/caveman-auto.patch.yml](examples/caveman-auto.patch.yml) into the existing `llm-pi-ai` provider configuration, preserving other providers, and select its `caveman-auto` model. The example is an excerpt; replacing the entire provider map with it would remove other routes.
130
+
131
+ When Auto is selected and routing is enabled, the proxy sends the latest and previous user asks, the tail of the last assistant response, and request facts to Caveman Cloud to select a model. The Free plan may retain that information to improve routing. When routing is off, the proxy falls back to its OpenAI default model; provider billing still applies. See the [privacy details](https://github.com/JuliusBrussee/caveman/blob/main/docs/technical/security-and-privacy.md).
132
+
133
+ For Anthropic API traffic, merge [examples/caveman-anthropic.patch.yml](examples/caveman-anthropic.patch.yml) into the provider map and choose an available model. The local proxy can then apply its cache-warming policy when the request and provider cache are eligible; warm requests are recorded as usage.
134
+
135
+ ### MCP, Blocks and Browse
136
+
137
+ When `caveman-mcp` is installed, the DSH MCP manager exposes the `mcp__caveman__*` tools `caveman_compress`, `caveman_retrieve`, `caveman_stats`, `caveman_toon_encode`, and `caveman_toon_decode`. The server uses the local Caveman recovery store for its handles. Set `CAVEMAN_MCP=off` to disable automatic registration.
138
+
139
+ When `cavemem` is installed, the MCP manager exposes `mcp__cavemem__*` tools for remembering, recalling, revising, inspecting, and forgetting local facts. `cavemem_recover` returns the exact original behind a recall handle and requires the DSH subprocess and working-directory services. Memories persist in the local Caveman home.
140
+
141
+ When `caveman-blocks` is installed, `bash` and `pwsh` calls can receive Blocks suggestions. Suggestions accompany the result and do not change the command. Blocks reads the local `.blocks` directory and may save scrubbed script observations and usage data; see its [telemetry settings](https://github.com/caveman-ai/blocks/blob/main/docs/TELEMETRY.md).
142
+
143
+ When `caveman-browse` is installed, the DSH MCP manager registers `mcp__caveman_browse__browser_snapshot`, `browser_act`, `browser_eval`, and `browser_recover`. Browse starts a dedicated headless Chrome by default. Its tools share the server's browser state and can navigate and run JavaScript.
144
+
145
+ The plugin looks for each binary in its `CAVEMAN_MCP_BIN`, `CAVEMAN_BLOCKS_BIN`, `CAVEMAN_BROWSE_BIN`, or `CAVEMEM_BIN` override, on `PATH`, then in `$CAVEMAN_HOME/bin` (or `~/.caveman/bin`). Profile paths take precedence. Module switches are read on startup; restart DSH after changing them.
146
+
147
+ ### Cavecrew
148
+
149
+ The bundle defines the `cavecrew-investigator`, `cavecrew-builder`, and `cavecrew-reviewer` presets and corresponding delegation tools. The investigator and reviewer can read and search files and inspect Git through `cavecrew_git`; the builder can read and edit up to two file paths. The Git tool provides the read-only operations relevant to each role. They require the profile's agent-preset registry and in-process subagent provider.
150
+
151
+ Each role inherits its parent provider and model. Set `CAVECREW_INVESTIGATOR_MODEL`, `CAVECREW_BUILDER_MODEL`, or `CAVECREW_REVIEWER_MODEL` before starting DSH to select another model on that provider for the corresponding role.
152
+
153
+ ### Command-line interface
154
+
155
+ When installed as a Node package, `dsh-caveman` forwards arguments and exit status to `@caveman-ai/cli`. In a checkout, run `node scripts/caveman-cli.mjs --help`.
156
+
157
+ -----
158
+
159
+ <a id="understand-the-implementation"></a>
160
+ ## Understand the implementation
161
+
162
+ <details>
163
+ <summary>Implementation internals</summary>
164
+
165
+ | Path | Responsibility |
166
+ |---|---|
167
+ | `cordis.patch.yml` and `presets/cavecrew.patch.yml` | Compose the host plugin, presets, and delegation tools. |
168
+ | `src/index.ts` | Register skills, session voice instructions, and optional integrations. |
169
+ | `src/skills.ts` and `src/mode.ts` | Provide skill content and resolve session mode changes. |
170
+ | `src/stats.ts` | Report recorded session usage. |
171
+ | `src/compression.ts` | Prepare recoverable tool-result projections and restore the session surface. |
172
+ | `src/blocks.ts` | Supply Blocks suggestions for shell calls. |
173
+ | `src/cavecrew.ts` | Install Cavecrew personas and scope their tools. |
174
+ | `scripts/caveman-cli.mjs` | Forward command-line arguments. |
175
+ | `tests/` | Verify DSH services, runtime integrations, and package installation. |
176
+
177
+ Mode changes use direct user messages. Compression keeps the original session event and restores any pending projection during cleanup. Recovery handles are scoped to a session.
178
+
179
+ </details>
180
+
181
+ -----
182
+
183
+ <a id="further-exploration"></a>
184
+ ## Further Exploration
185
+
186
+ - [CHANGELOG.md](CHANGELOG.md) — package changes.
187
+ - [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) — profile and plugin configuration.
188
+ - [NOTICE](NOTICE) and [LICENSE](LICENSE) — licensing and attribution.
189
+
190
+ -----
191
+
192
+ <a id="model-experience"></a>
193
+ ## Model Experience
194
+
195
+ The selected voice is supplied to the model on user turns. Eligible tool results can be shortened in model requests with a `caveman_retrieve` handle. User prompts are not rewritten. Savings and quality depend on the workload and have not been measured for this integration.
196
+
197
+ #### KV Cache effect
198
+
199
+ Changing voice or replacing and restoring a tool-result surface can change the cached prefix. Cache behavior depends on the provider.
200
+
201
+ <a id="known-limitations"></a>
202
+ ## Known Limitations
203
+
204
+ - Auto requires a configured pi-ai provider, Caveman proxy, Cloud login, and OpenAI credential. The integration tests use local mock services.
205
+ - Browse requires the MCP manager, `caveman-browse`, and Chrome. Blocks requires `caveman-blocks` and a local workspace.
206
+ - Compression handles text blocks in tool results. Offline recovery returns exact pages; text-query recovery requires the middleware.
207
+ - Some skills require additional CLI, account, or agent setup.
208
+ - Cavecrew's inspection roles use read, search, and read-only Git tools; the builder can edit existing files and is limited to two file paths.
209
+
210
+ <a id="dev-note"></a>
211
+ ### Dev Note
212
+
213
+ <details>
214
+ <summary>Maintainer context</summary>
215
+
216
+ `npm run typecheck` checks TypeScript; `npm test` builds and runs the tests. Set `CAVEMAN_PROXY_BINARY`, `CAVEMAN_MCP_BINARY`, `CAVEMEM_BINARY`, `CAVEMAN_BLOCKS_BINARY`, and `CAVEMAN_BROWSE_BINARY` to compatible executables and `CAVEMAN_BROWSE_CHROME` to Chrome to run the runtime integration tests. Set `DSH_CAVEMAN_LEARN_BINARY` to a built analyzer to test session analysis. Auto's test also requires OpenSSL. `npm run test:dsh` installs, boots, and removes the pack in an isolated profile. `npm pack` runs the test suite through `prepack`. `npm run benchmark` measures skill discovery and incremental session processing on synthetic input.
217
+
218
+ </details>