@lornatang/dsh-caveman 0.1.2 → 0.1.4
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 +10 -0
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/attribution.js +1 -1
- package/lib/compression.js +1 -1
- package/lib/native.js +16 -9
- package/package.json +1 -1
- package/scripts/learn-checksums.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.4 - 2026-11-19
|
|
4
|
+
|
|
5
|
+
- Restore the POSIX native-socket retry: a socket the runtime has not created yet is retried instead of disabling the call, while a replaced or foreign-owned path is still refused before any request is sent.
|
|
6
|
+
- Keep the verified analyzer binaries attached to this release under the new version.
|
|
7
|
+
|
|
8
|
+
## 0.1.3 - 2026-11-19
|
|
9
|
+
|
|
10
|
+
- Simplify the system-prompt and request-header hooks by dropping unused handler parameters; behavior is unchanged.
|
|
11
|
+
- Keep the verified analyzer binaries attached to this release under the new version.
|
|
12
|
+
|
|
3
13
|
## 0.1.2 - 2026-11-18
|
|
4
14
|
|
|
5
15
|
- Settle the block hook promise on timeout or abort, so a hung analyzer cannot stall tool execution.
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ git clone https://github.com/Lornatang/dsh-caveman.git
|
|
|
43
43
|
cd dsh-caveman
|
|
44
44
|
npm ci
|
|
45
45
|
npm pack
|
|
46
|
-
dsh plugin --profile <name> add ./lornatang-dsh-caveman-0.1.
|
|
46
|
+
dsh plugin --profile <name> add ./lornatang-dsh-caveman-0.1.4.tgz
|
|
47
47
|
```
|
|
48
48
|
|
|
49
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.
|
package/README.zh.md
CHANGED
|
@@ -43,7 +43,7 @@ git clone https://github.com/Lornatang/dsh-caveman.git
|
|
|
43
43
|
cd dsh-caveman
|
|
44
44
|
npm ci
|
|
45
45
|
npm pack
|
|
46
|
-
dsh plugin --profile <name> add ./lornatang-dsh-caveman-0.1.
|
|
46
|
+
dsh plugin --profile <name> add ./lornatang-dsh-caveman-0.1.4.tgz
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
`add` 命令把 bundle 组合进 profile。patch 会插入 `caveman` 行、三个 Cavecrew 预设及其委派工具。`add` 或 `remove` 后重启 DSH,使 profile 重新加载配置。
|
package/lib/attribution.js
CHANGED
|
@@ -20,5 +20,5 @@ export function cavemanRequestHeaders(endpoint, request, headers) {
|
|
|
20
20
|
return headers;
|
|
21
21
|
}
|
|
22
22
|
export function registerAttribution(ctx, endpoint) {
|
|
23
|
-
ctx.on('llm-pi-ai/request-headers', (request,
|
|
23
|
+
ctx.on('llm-pi-ai/request-headers', (request, _headers, next) => cavemanRequestHeaders(endpoint, request, next()));
|
|
24
24
|
}
|
package/lib/compression.js
CHANGED
|
@@ -321,7 +321,7 @@ export function registerCompression(ctx, endpoint, automatic) {
|
|
|
321
321
|
yield* next();
|
|
322
322
|
})());
|
|
323
323
|
const selections = new WeakMap();
|
|
324
|
-
ctx.on('system-prompt/assemble', async (
|
|
324
|
+
ctx.on('system-prompt/assemble', async (_assembly, context, next) => {
|
|
325
325
|
const result = await next();
|
|
326
326
|
if (context.agent && context.toolSet)
|
|
327
327
|
selections.set(context.agent, context.toolSet);
|
package/lib/native.js
CHANGED
|
@@ -77,23 +77,28 @@ function validResponse(value) {
|
|
|
77
77
|
return true;
|
|
78
78
|
}
|
|
79
79
|
/** Refuse a replaced socket path before sending prompt terms or tool data over it. */
|
|
80
|
-
async function
|
|
80
|
+
async function socketTrust(path) {
|
|
81
81
|
if (process.platform === 'win32')
|
|
82
|
-
return
|
|
82
|
+
return 'trusted';
|
|
83
83
|
try {
|
|
84
84
|
const info = await lstat(path);
|
|
85
85
|
if (!info.isSocket())
|
|
86
|
-
return
|
|
87
|
-
return typeof process.getuid === 'function'
|
|
86
|
+
return 'untrusted';
|
|
87
|
+
return typeof process.getuid === 'function' && info.uid !== process.getuid() ? 'untrusted' : 'trusted';
|
|
88
88
|
}
|
|
89
|
-
catch {
|
|
90
|
-
|
|
89
|
+
catch (error) {
|
|
90
|
+
// A runtime that is still starting has no socket yet. Report it as absent so the
|
|
91
|
+
// caller may retry its connection, and check this path again before each retry.
|
|
92
|
+
if (error.code === 'ENOENT')
|
|
93
|
+
return 'missing';
|
|
94
|
+
return 'untrusted';
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
export async function nativeCall(home, request, signal) {
|
|
94
98
|
if (signal?.aborted)
|
|
95
99
|
return undefined;
|
|
96
|
-
|
|
100
|
+
const socketPath = nativeSocketPath(home);
|
|
101
|
+
if (await socketTrust(socketPath) === 'untrusted')
|
|
97
102
|
return undefined;
|
|
98
103
|
const payload = Buffer.from(JSON.stringify(request) + '\n');
|
|
99
104
|
if (payload.length > 2 * 1024 * 1024)
|
|
@@ -103,7 +108,7 @@ export async function nativeCall(home, request, signal) {
|
|
|
103
108
|
let connected = false;
|
|
104
109
|
let size = 0;
|
|
105
110
|
const chunks = [];
|
|
106
|
-
const socket = connect({ path:
|
|
111
|
+
const socket = connect({ path: socketPath });
|
|
107
112
|
const finish = (response, retry = false) => {
|
|
108
113
|
if (finished)
|
|
109
114
|
return;
|
|
@@ -156,6 +161,8 @@ export async function nativeCall(home, request, signal) {
|
|
|
156
161
|
catch {
|
|
157
162
|
return undefined;
|
|
158
163
|
}
|
|
164
|
+
if (await socketTrust(socketPath) === 'untrusted')
|
|
165
|
+
return undefined;
|
|
159
166
|
return (await attempt()).response;
|
|
160
167
|
}
|
|
161
168
|
async function inputState(ctx, cwd, input, signal) {
|
|
@@ -216,7 +223,7 @@ export function registerNative(ctx, endpoint, policy) {
|
|
|
216
223
|
const selections = new WeakMap();
|
|
217
224
|
const pending = new Set();
|
|
218
225
|
const home = process.env.CAVEMAN_HOME ?? join(homedir(), '.caveman');
|
|
219
|
-
ctx.on('system-prompt/assemble', async (
|
|
226
|
+
ctx.on('system-prompt/assemble', async (_assembly, context, next) => {
|
|
220
227
|
const result = await next();
|
|
221
228
|
if (context.agent && context.toolSet)
|
|
222
229
|
selections.set(context.agent, context.toolSet);
|
package/package.json
CHANGED