@askalf/dario 5.5.52 → 5.5.54
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/dist/cc-template.js +20 -0
- package/dist/live-fingerprint.d.ts +16 -0
- package/dist/live-fingerprint.js +29 -0
- package/package.json +1 -1
package/dist/cc-template.js
CHANGED
|
@@ -1619,6 +1619,26 @@ export function buildCCRequest(clientBody, billingTag, cacheControl, identity, o
|
|
|
1619
1619
|
messages.splice(i, 1);
|
|
1620
1620
|
}
|
|
1621
1621
|
}
|
|
1622
|
+
// A TRAILING assistant turn the filter emptied is dropped too — content: []
|
|
1623
|
+
// at the end reads as a prefill upstream, which Opus under adaptive thinking
|
|
1624
|
+
// + the claude-code beta refuses outright. This is a copy of the trailing
|
|
1625
|
+
// drop further down (which must ALSO stay there, running after the general
|
|
1626
|
+
// path's thinking strip — the shape it was written for); the copy exists so
|
|
1627
|
+
// the genuine-CC early return inherits it (dario#1077 follow-up: stage 3 of
|
|
1628
|
+
// 3, the "failure moves rather than disappears" case). Same constraints as
|
|
1629
|
+
// the original: assistant turns ONLY — popping an empty final user turn
|
|
1630
|
+
// would convert an honest "content must contain at least one block" into a
|
|
1631
|
+
// misleading prefill rejection (dario#1033), and popping a NON-empty
|
|
1632
|
+
// trailing assistant is the OpenClaw runaway loop (#37). Idempotent, so
|
|
1633
|
+
// running it twice on the general path changes nothing.
|
|
1634
|
+
while (messages.length > 0) {
|
|
1635
|
+
const last = messages[messages.length - 1];
|
|
1636
|
+
if (last.role === 'assistant' && Array.isArray(last.content) && last.content.length === 0) {
|
|
1637
|
+
messages.pop();
|
|
1638
|
+
continue;
|
|
1639
|
+
}
|
|
1640
|
+
break;
|
|
1641
|
+
}
|
|
1622
1642
|
// ── Genuine Claude Code client → byte-faithful passthrough ──
|
|
1623
1643
|
// A real CC request already IS the CC wire shape. Replacing its system
|
|
1624
1644
|
// prompt with the template (prepending ~25KB per request shape) and
|
|
@@ -289,6 +289,22 @@ export type PreservedToolReason = 'platform' | 'interactive' | 'config-scoped';
|
|
|
289
289
|
* regression).
|
|
290
290
|
*/
|
|
291
291
|
export declare function preservedToolReason(name: string, platform: string): PreservedToolReason | null;
|
|
292
|
+
/**
|
|
293
|
+
* Names the fallback bundle carries that `captureTools` lacks and NO
|
|
294
|
+
* preservation set classifies. Empty on every capture measured so far
|
|
295
|
+
* (win32 + linux, CC 2.1.236 and 2.1.241 — dario#1062's report did not
|
|
296
|
+
* reproduce), but the roster is remote-config-shaped: the config-scoped four
|
|
297
|
+
* flipped between the 8/11 and 8/15 bakes, and WaitForMcpServers appeared in
|
|
298
|
+
* one capture and vanished in the next, minutes apart, same binary. So the
|
|
299
|
+
* day this goes non-empty must be LOUD, not a silent shrink of
|
|
300
|
+
* CC_NATIVE_NAMES_UNION: capture-and-bake refuses to write the bundle, and
|
|
301
|
+
* the live path logs it. Note the win32 subtlety: a win32-only tool missing
|
|
302
|
+
* from a WIN32 capture is unclassified (it was expected there) — that is a
|
|
303
|
+
* real drop, not a platform artifact.
|
|
304
|
+
*/
|
|
305
|
+
export declare function unclassifiedToolDrops<T extends {
|
|
306
|
+
name: string;
|
|
307
|
+
}>(captureTools: T[], fallbackTools: T[], platform: string): string[];
|
|
292
308
|
/**
|
|
293
309
|
* Re-union `capture.tools` with any tool `fallback` carries that the capture is
|
|
294
310
|
* required to keep (see preservedToolReason). Returns the merged tool array,
|
package/dist/live-fingerprint.js
CHANGED
|
@@ -241,6 +241,25 @@ export function preservedToolReason(name, platform) {
|
|
|
241
241
|
return 'config-scoped';
|
|
242
242
|
return null;
|
|
243
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Names the fallback bundle carries that `captureTools` lacks and NO
|
|
246
|
+
* preservation set classifies. Empty on every capture measured so far
|
|
247
|
+
* (win32 + linux, CC 2.1.236 and 2.1.241 — dario#1062's report did not
|
|
248
|
+
* reproduce), but the roster is remote-config-shaped: the config-scoped four
|
|
249
|
+
* flipped between the 8/11 and 8/15 bakes, and WaitForMcpServers appeared in
|
|
250
|
+
* one capture and vanished in the next, minutes apart, same binary. So the
|
|
251
|
+
* day this goes non-empty must be LOUD, not a silent shrink of
|
|
252
|
+
* CC_NATIVE_NAMES_UNION: capture-and-bake refuses to write the bundle, and
|
|
253
|
+
* the live path logs it. Note the win32 subtlety: a win32-only tool missing
|
|
254
|
+
* from a WIN32 capture is unclassified (it was expected there) — that is a
|
|
255
|
+
* real drop, not a platform artifact.
|
|
256
|
+
*/
|
|
257
|
+
export function unclassifiedToolDrops(captureTools, fallbackTools, platform) {
|
|
258
|
+
const have = new Set(captureTools.map((t) => t.name));
|
|
259
|
+
return fallbackTools
|
|
260
|
+
.filter((t) => !have.has(t.name) && preservedToolReason(t.name, platform) === null)
|
|
261
|
+
.map((t) => t.name);
|
|
262
|
+
}
|
|
244
263
|
/**
|
|
245
264
|
* Re-union `capture.tools` with any tool `fallback` carries that the capture is
|
|
246
265
|
* required to keep (see preservedToolReason). Returns the merged tool array,
|
|
@@ -345,6 +364,16 @@ function withPreservedTools(live, options) {
|
|
|
345
364
|
return live; // bundle unreadable — the capture is still better than throwing
|
|
346
365
|
}
|
|
347
366
|
const { tools, preserved } = mergePreservedTools(live.tools, bundled.tools, process.platform);
|
|
367
|
+
// A tool the capture omitted that NO set classifies stays out of the merge
|
|
368
|
+
// (nothing here invents wire shape) — but silence is how that class of rot
|
|
369
|
+
// ships, so say it every load. A client declaring one of these will not
|
|
370
|
+
// identity-map and lands in the unmapped round-robin (the v4.8.93 mode).
|
|
371
|
+
const unclassified = unclassifiedToolDrops(live.tools, bundled.tools, process.platform);
|
|
372
|
+
if (unclassified.length > 0 && !options?.silent) {
|
|
373
|
+
console.warn(`[dario] live template: this capture omitted ${unclassified.length} tool${unclassified.length === 1 ? '' : 's'} no preservation set classifies — ` +
|
|
374
|
+
`NOT restored, clients declaring them will not identity-map: ${unclassified.join(', ')}. ` +
|
|
375
|
+
'Please report this at dario#1062 with your `claude --version`.');
|
|
376
|
+
}
|
|
348
377
|
if (preserved.length === 0)
|
|
349
378
|
return live;
|
|
350
379
|
if (!options?.silent) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.54",
|
|
4
4
|
"description": "Use your Claude Pro/Max subscription in any tool — Cursor, Cline, Aider, the Agent SDK, your scripts — at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|