@lornatang/dsh-caveman 0.1.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +202 -0
  3. package/LICENSE-MIT +21 -0
  4. package/NOTICE +51 -0
  5. package/README.md +218 -0
  6. package/README.zh.md +218 -0
  7. package/cordis.patch.yml +3 -0
  8. package/examples/caveman-anthropic.patch.yml +14 -0
  9. package/examples/caveman-auto.patch.yml +15 -0
  10. package/lib/attribution.js +24 -0
  11. package/lib/blocks.js +80 -0
  12. package/lib/cavecrew-git.js +83 -0
  13. package/lib/cavecrew.js +67 -0
  14. package/lib/compression.js +434 -0
  15. package/lib/index.js +127 -0
  16. package/lib/memory.js +35 -0
  17. package/lib/mode.js +71 -0
  18. package/lib/native.js +357 -0
  19. package/lib/runtime.js +199 -0
  20. package/lib/skills.js +75 -0
  21. package/lib/stats.js +189 -0
  22. package/lib/types/attribution.d.ts +8 -0
  23. package/lib/types/blocks.d.ts +12 -0
  24. package/lib/types/cavecrew-git.d.ts +5 -0
  25. package/lib/types/cavecrew.d.ts +10 -0
  26. package/lib/types/compression.d.ts +50 -0
  27. package/lib/types/index.d.ts +30 -0
  28. package/lib/types/memory.d.ts +3 -0
  29. package/lib/types/mode.d.ts +33 -0
  30. package/lib/types/native.d.ts +43 -0
  31. package/lib/types/runtime.d.ts +23 -0
  32. package/lib/types/skills.d.ts +3 -0
  33. package/lib/types/stats.d.ts +6 -0
  34. package/package.json +129 -0
  35. package/presets/cavecrew.patch.yml +54 -0
  36. package/scripts/benchmark.mjs +79 -0
  37. package/scripts/caveman-cli.mjs +30 -0
  38. package/scripts/learn-binary.mjs +82 -0
  39. package/scripts/learn-checksums.json +29 -0
  40. package/vendor/caveman/LICENSE +202 -0
  41. package/vendor/caveman/LICENSE-MIT +21 -0
  42. package/vendor/caveman/NOTICE +49 -0
  43. package/vendor/caveman/agents/cavecrew-builder.md +46 -0
  44. package/vendor/caveman/agents/cavecrew-investigator.md +56 -0
  45. package/vendor/caveman/agents/cavecrew-reviewer.md +47 -0
  46. package/vendor/caveman/skills/activation-rule.mjs +43 -0
  47. package/vendor/caveman/skills/cavecrew/README.md +67 -0
  48. package/vendor/caveman/skills/cavecrew/SKILL.md +78 -0
  49. package/vendor/caveman/skills/caveman/README.md +68 -0
  50. package/vendor/caveman/skills/caveman/SKILL.md +89 -0
  51. package/vendor/caveman/skills/caveman-commit/README.md +44 -0
  52. package/vendor/caveman/skills/caveman-commit/SKILL.md +63 -0
  53. package/vendor/caveman/skills/caveman-compress/README.md +262 -0
  54. package/vendor/caveman/skills/caveman-compress/SECURITY.md +55 -0
  55. package/vendor/caveman/skills/caveman-compress/SKILL.md +114 -0
  56. package/vendor/caveman/skills/caveman-compress/scripts/__init__.py +9 -0
  57. package/vendor/caveman/skills/caveman-compress/scripts/__main__.py +3 -0
  58. package/vendor/caveman/skills/caveman-compress/scripts/benchmark.py +80 -0
  59. package/vendor/caveman/skills/caveman-compress/scripts/cli.py +94 -0
  60. package/vendor/caveman/skills/caveman-compress/scripts/compress.py +1331 -0
  61. package/vendor/caveman/skills/caveman-compress/scripts/detect.py +192 -0
  62. package/vendor/caveman/skills/caveman-compress/scripts/validate.py +440 -0
  63. package/vendor/caveman/skills/caveman-discover/SKILL.md +115 -0
  64. package/vendor/caveman/skills/caveman-evidence-review/SKILL.md +142 -0
  65. package/vendor/caveman/skills/caveman-explore/SKILL.md +42 -0
  66. package/vendor/caveman/skills/caveman-explore/package.json +12 -0
  67. package/vendor/caveman/skills/caveman-explore/tests/skill-file.test.mjs +44 -0
  68. package/vendor/caveman/skills/caveman-help/README.md +39 -0
  69. package/vendor/caveman/skills/caveman-help/SKILL.md +62 -0
  70. package/vendor/caveman/skills/caveman-learn/CLAUDE.md +32 -0
  71. package/vendor/caveman/skills/caveman-learn/README.md +38 -0
  72. package/vendor/caveman/skills/caveman-learn/SKILL.md +185 -0
  73. package/vendor/caveman/skills/caveman-learn/package.json +12 -0
  74. package/vendor/caveman/skills/caveman-learn/tests/index.js +1 -0
  75. package/vendor/caveman/skills/caveman-learn/tests/skill-file.test.mjs +54 -0
  76. package/vendor/caveman/skills/caveman-manage/SKILL.md +112 -0
  77. package/vendor/caveman/skills/caveman-optimize/SKILL.md +111 -0
  78. package/vendor/caveman/skills/caveman-review/README.md +33 -0
  79. package/vendor/caveman/skills/caveman-review/SKILL.md +53 -0
  80. package/vendor/caveman/skills/caveman-setup/SKILL.md +222 -0
  81. package/vendor/caveman/skills/caveman-stats/README.md +48 -0
  82. package/vendor/caveman/skills/caveman-stats/SKILL.md +17 -0
  83. package/vendor/caveman/skills/compile.mjs +298 -0
  84. package/vendor/caveman/skills/engine-mcp-tools.json +10 -0
  85. package/vendor/caveman/skills/generated/aider/pack.json +163 -0
  86. package/vendor/caveman/skills/generated/claude/pack.json +163 -0
  87. package/vendor/caveman/skills/generated/codex/pack.json +163 -0
  88. package/vendor/caveman/skills/generated/gemini/pack.json +163 -0
  89. package/vendor/caveman/skills/generated/hermes/pack.json +163 -0
  90. package/vendor/caveman/skills/generated/opencode/pack.json +163 -0
  91. package/vendor/caveman/skills/investigate-first/SKILL.md +16 -0
  92. package/vendor/caveman/skills/investigate-first/agents/openai.yaml +4 -0
  93. package/vendor/caveman/skills/lean-build/SKILL.md +18 -0
  94. package/vendor/caveman/skills/lean-build/agents/openai.yaml +4 -0
  95. package/vendor/caveman/skills/megacave/README.md +11 -0
  96. package/vendor/caveman/skills/megacave/SKILL.md +65 -0
  97. package/vendor/caveman/skills/migration/SKILL.md +17 -0
  98. package/vendor/caveman/skills/migration/agents/openai.yaml +4 -0
  99. package/vendor/caveman/skills/native/native-core.md +16 -0
  100. package/vendor/caveman/skills/registry.json +283 -0
  101. package/vendor/caveman/skills/safe-refactor/SKILL.md +16 -0
  102. package/vendor/caveman/skills/safe-refactor/agents/openai.yaml +4 -0
  103. package/vendor/caveman/skills/surgical-patch/SKILL.md +16 -0
  104. package/vendor/caveman/skills/surgical-patch/agents/openai.yaml +4 -0
  105. package/vendor/caveman/skills/ultracave/README.md +13 -0
  106. package/vendor/caveman/skills/ultracave/SKILL.md +63 -0
  107. package/vendor/caveman/skills/verbs-gate.mjs +213 -0
  108. package/vendor/caveman/skills/verify-and-stop/SKILL.md +16 -0
  109. package/vendor/caveman/skills/verify-and-stop/agents/openai.yaml +4 -0
  110. package/vendor/caveman/src/hooks/caveman-config.js +921 -0
  111. package/vendor/caveman/src/hooks/caveman-parse.js +342 -0
  112. package/vendor/caveman/src/hooks/package.json +3 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
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.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/LICENSE-MIT ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Julius Brussee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,51 @@
1
+ dsh-caveman
2
+ Copyright 2026 Lornatang and contributors
3
+ Caveman
4
+ Copyright 2026 Julius Brussee
5
+
6
+ Before Caveman 3.0.0, the parts of this repository outside the Engine-linked
7
+ runtime were licensed under the MIT License (see LICENSING.md). Contributions
8
+ made to those parts before 3.0.0 were received under the MIT License and remain
9
+ available under it. Its copyright and permission notice is retained in
10
+ LICENSE-MIT.
11
+
12
+ This product includes third-party software:
13
+
14
+ - engine/pixel/ is a Go port of pxpipe (https://github.com/teamchong/pxpipe),
15
+ used under the MIT License.
16
+ Copyright (c) 2026 claude-image-proxy contributors
17
+
18
+ - The glyph atlases embedded in engine/pixel/assets/ are rasterized from:
19
+ - Spleen 5x8, Copyright (c) 2018-2026, Frederic Cambus.
20
+ BSD 2-Clause License.
21
+ - GNU Unifont 16.0.04, dual-licensed under the SIL Open Font License 1.1 and
22
+ the GNU GPL version 2 (or later) with the GNU font-embedding exception.
23
+
24
+ - browse/ links these MIT-licensed Go modules:
25
+ - github.com/chromedp/chromedp, Copyright (c) 2016-2025 Kenneth Shaw
26
+ - github.com/chromedp/cdproto, Copyright (c) 2016-2025 Kenneth Shaw
27
+ - github.com/chromedp/sysutil, Copyright (c) 2016-2017 Kenneth Shaw
28
+
29
+ - The runtime binaries and the container image link third-party Go modules
30
+ under the MIT, BSD-3-Clause and Apache-2.0 licenses. Their license texts, and
31
+ the Go runtime's, ship with every binary release as
32
+ THIRD_PARTY_GO_LICENSES.tar.gz and in the image under /licenses/third_party/.
33
+
34
+ - packages/cli/src/index.ts contains a port, with changes, of Qwen Code
35
+ 0.22.3's MCP server and permission-rule matchers and its tool-name
36
+ normalization (https://github.com/QwenLM/qwen-code), used under the Apache
37
+ License, Version 2.0.
38
+ Copyright 2025 Google LLC
39
+ Copyright 2025 Qwen
40
+
41
+ - The @caveman-ai/cli package bundles MIT-licensed npm packages
42
+ (@clack/prompts, @clack/core, sisteransi, fast-string-width,
43
+ fast-string-truncated-width, fast-wrap-ansi); see packages/cli/NOTICE.
44
+
45
+ - extension/fonts/ holds the Geist and Geist Mono fonts,
46
+ Copyright (c) 2023 Vercel, in collaboration with basement.studio,
47
+ under the SIL Open Font License 1.1.
48
+
49
+ Full license texts: engine/pixel/NOTICE, engine/pixel/assets/SPLEEN_LICENSE.txt,
50
+ engine/pixel/assets/UNIFONT_LICENSE.txt, browse/NOTICE, packages/cli/NOTICE, and
51
+ extension/fonts/GEIST_LICENSE.txt.
package/README.md ADDED
@@ -0,0 +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>