@askalf/dario 4.8.48 → 4.8.50
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 +15 -0
- package/dist/proxy.d.ts +8 -0
- package/dist/proxy.js +23 -0
- package/package.json +1 -1
package/dist/cc-template.js
CHANGED
|
@@ -1426,6 +1426,21 @@ export function buildCCRequest(clientBody, billingTag, cacheControl, identity, o
|
|
|
1426
1426
|
// wire footprint).
|
|
1427
1427
|
ccRequest.tools = CC_TOOL_DEFINITIONS;
|
|
1428
1428
|
}
|
|
1429
|
+
else if (model.toLowerCase().includes('fable')) {
|
|
1430
|
+
// Fable refuses tool-less CC-shaped MULTI-TURN requests (live replay
|
|
1431
|
+
// bisect 2026-06-09): scrubbed system + zero tools + an assistant turn
|
|
1432
|
+
// in history → 200 + stop_reason "refusal" with empty content on every
|
|
1433
|
+
// request, while the byte-identical body WITH CC's tool array answers.
|
|
1434
|
+
// Real CC always sends its tool array, so zero-tools is itself a
|
|
1435
|
+
// fingerprint divergence (see the merge-tools note above) — fable's
|
|
1436
|
+
// refusal layer is just the first model to punish it. Emit the CC base
|
|
1437
|
+
// array pinned with `tool_choice: none` so the model cannot call tools
|
|
1438
|
+
// the client never declared (without the pin it DOES — verified
|
|
1439
|
+
// spurious WebFetch on a weather prompt). Other families keep the
|
|
1440
|
+
// legacy tool-less shape, which they demonstrably accept.
|
|
1441
|
+
ccRequest.tools = CC_TOOL_DEFINITIONS;
|
|
1442
|
+
ccRequest.tool_choice = { type: 'none' };
|
|
1443
|
+
}
|
|
1429
1444
|
// Metadata
|
|
1430
1445
|
ccRequest.metadata = {
|
|
1431
1446
|
user_id: JSON.stringify({
|
package/dist/proxy.d.ts
CHANGED
|
@@ -29,6 +29,14 @@ export declare function parseProviderPrefix(model: string): {
|
|
|
29
29
|
*/
|
|
30
30
|
export declare const FABLE_FALLBACK_CREDIT_BETA = "fallback-credit-2026-06-01";
|
|
31
31
|
export declare function betaForModel(base: string, model: string | null | undefined): string;
|
|
32
|
+
/**
|
|
33
|
+
* Strip a trailing `[1m]` long-context tag from a model id. The tag is a
|
|
34
|
+
* client-side label: real CC sends the BASE id + `context-1m-2025-08-07`
|
|
35
|
+
* beta on the wire (live capture 2026-06-09, CC v2.1.170) — the literal
|
|
36
|
+
* `X[1m]` id 404s upstream on every family. Case-insensitive, only at the
|
|
37
|
+
* very end of the id. Exported for tests.
|
|
38
|
+
*/
|
|
39
|
+
export declare function stripContext1mTag(model: string): string;
|
|
32
40
|
export declare const ORCHESTRATION_TAG_NAMES: string[];
|
|
33
41
|
/**
|
|
34
42
|
* Build the regex list that actually strips orchestration tags.
|
package/dist/proxy.js
CHANGED
|
@@ -208,6 +208,18 @@ export function betaForModel(base, model) {
|
|
|
208
208
|
return base;
|
|
209
209
|
return base ? `${base},${FABLE_FALLBACK_CREDIT_BETA}` : FABLE_FALLBACK_CREDIT_BETA;
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Strip a trailing `[1m]` long-context tag from a model id. The tag is a
|
|
213
|
+
* client-side label: real CC sends the BASE id + `context-1m-2025-08-07`
|
|
214
|
+
* beta on the wire (live capture 2026-06-09, CC v2.1.170) — the literal
|
|
215
|
+
* `X[1m]` id 404s upstream on every family. Case-insensitive, only at the
|
|
216
|
+
* very end of the id. Exported for tests.
|
|
217
|
+
*/
|
|
218
|
+
export function stripContext1mTag(model) {
|
|
219
|
+
if (typeof model !== 'string')
|
|
220
|
+
return model;
|
|
221
|
+
return model.replace(/\[1m\]$/i, '');
|
|
222
|
+
}
|
|
211
223
|
// Orchestration tags injected by agents (Aider, Cursor, OpenCode, etc.)
|
|
212
224
|
// that confuse Claude when passed through. Strip before forwarding.
|
|
213
225
|
export const ORCHESTRATION_TAG_NAMES = [
|
|
@@ -1539,6 +1551,17 @@ export async function startProxy(opts = {}) {
|
|
|
1539
1551
|
for (const key of Object.keys(r))
|
|
1540
1552
|
delete r[key];
|
|
1541
1553
|
Object.assign(r, ccBody);
|
|
1554
|
+
// `X[1m]` is a client-side LABEL, never a valid wire id — real CC
|
|
1555
|
+
// sends the BASE model id plus the `context-1m-2025-08-07` beta
|
|
1556
|
+
// (live capture 2026-06-09, CC v2.1.170 with --model
|
|
1557
|
+
// 'claude-fable-5[1m]': wire model was 'claude-fable-5').
|
|
1558
|
+
// Forwarding the literal `[1m]` id upstream 404s ("model: …[1m]"
|
|
1559
|
+
// not_found) on every family. Strip it here; the context-1m beta
|
|
1560
|
+
// is already in the template beta set (and the existing
|
|
1561
|
+
// long-context billing auto-retry still governs accounts that
|
|
1562
|
+
// can't use it). requestModel keeps the [1m] form so model-aware
|
|
1563
|
+
// logic (family buckets, fable beta/effort) sees the user intent.
|
|
1564
|
+
r.model = stripContext1mTag(r.model);
|
|
1542
1565
|
}
|
|
1543
1566
|
finalBody = Buffer.from(JSON.stringify(r));
|
|
1544
1567
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.50",
|
|
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": {
|