@askalf/dario 3.30.0 → 3.30.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/README.md +2 -1
- package/dist/cc-template.d.ts +1 -2
- package/dist/cc-template.js +5 -5
- package/dist/proxy.js +3 -3
- package/dist/shim/runtime.cjs +2 -2
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -108,6 +108,7 @@ Something broken? `dario doctor` prints a single aggregated health report — da
|
|
|
108
108
|
- **Teams running local or hosted OpenAI-compat servers** (LiteLLM, vLLM, Ollama, Groq, OpenRouter, self-hosted) who want one stable local endpoint every tool can reuse.
|
|
109
109
|
- **Anyone building AI coding tools** who wants provider independence without writing an OpenAI ↔ Anthropic translator themselves.
|
|
110
110
|
- **Claude Max / Pro subscribers** who want their subscription usable from every tool on their machine, not just Claude Code.
|
|
111
|
+
- **[Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) users** who want OAuth-subscription routing under the SDK. Point `baseURL: 'http://localhost:3456'` and dario translates API-key calls into your Claude Max auth — agent code stays identical.
|
|
111
112
|
- **Power users on multi-agent workloads** who want multi-account pooling, session stickiness, and in-flight 429 failover on their own machine, against their own subscriptions.
|
|
112
113
|
- **Operators who care about wire-level fidelity** — the fingerprint tightening in v3.22 – v3.28 means proxy mode's divergence from CC is observable (via `dario doctor`) and tunable (flags + env vars for each axis).
|
|
113
114
|
|
|
@@ -276,7 +277,7 @@ Dario's built-in `TOOL_MAP` carries **~66 schema-verified entries** covering the
|
|
|
276
277
|
|
|
277
278
|
| Agent | Covered tool names (subset) |
|
|
278
279
|
|---|---|
|
|
279
|
-
| Claude Code | default — CC
|
|
280
|
+
| Claude Code / Claude Agent SDK | default — CC / SDK tools (same schema as of CC v2.1.114 / `@anthropic-ai/claude-agent-sdk@0.2.x`) |
|
|
280
281
|
| Cline / Roo Code / Kilo Code | `execute_command`, `write_to_file`, `replace_in_file`, `apply_diff`, `list_files`, `search_files`, `read_file` |
|
|
281
282
|
| Cursor | `run_terminal_cmd`, `edit_file`, `search_replace`, `codebase_search`, `grep_search`, `file_search`, `list_dir`, `read_file` (`target_file`) |
|
|
282
283
|
| Windsurf | `run_command`, `view_file`, `write_to_file`, `replace_file_content`, `find_by_name`, `grep_search`, `list_dir`, `search_web`, `read_url_content` |
|
package/dist/cc-template.d.ts
CHANGED
|
@@ -166,9 +166,8 @@ export interface RequestContext {
|
|
|
166
166
|
* Replaces the entire request structure — tools, fields, ordering — with
|
|
167
167
|
* what real CC sends. Only the conversation content is preserved.
|
|
168
168
|
*/
|
|
169
|
-
export declare function buildCCRequest(clientBody: Record<string, unknown>, billingTag: string,
|
|
169
|
+
export declare function buildCCRequest(clientBody: Record<string, unknown>, billingTag: string, cacheControl: {
|
|
170
170
|
type: 'ephemeral';
|
|
171
|
-
ttl: '1h';
|
|
172
171
|
}, identity: {
|
|
173
172
|
deviceId: string;
|
|
174
173
|
accountUuid: string;
|
package/dist/cc-template.js
CHANGED
|
@@ -688,7 +688,7 @@ const TOOL_MAP = {
|
|
|
688
688
|
* Replaces the entire request structure — tools, fields, ordering — with
|
|
689
689
|
* what real CC sends. Only the conversation content is preserved.
|
|
690
690
|
*/
|
|
691
|
-
export function buildCCRequest(clientBody, billingTag,
|
|
691
|
+
export function buildCCRequest(clientBody, billingTag, cacheControl, identity, opts = {}) {
|
|
692
692
|
const model = clientBody.model || 'claude-sonnet-4-6';
|
|
693
693
|
const isHaiku = model.toLowerCase().includes('haiku');
|
|
694
694
|
const messages = clientBody.messages || [];
|
|
@@ -931,8 +931,8 @@ export function buildCCRequest(clientBody, billingTag, cache1h, identity, opts =
|
|
|
931
931
|
messages,
|
|
932
932
|
system: [
|
|
933
933
|
{ type: 'text', text: billingTag },
|
|
934
|
-
{ type: 'text', text: CC_AGENT_IDENTITY, cache_control:
|
|
935
|
-
{ type: 'text', text: fullSystemPrompt, cache_control:
|
|
934
|
+
{ type: 'text', text: CC_AGENT_IDENTITY, cache_control: cacheControl },
|
|
935
|
+
{ type: 'text', text: fullSystemPrompt, cache_control: cacheControl },
|
|
936
936
|
],
|
|
937
937
|
};
|
|
938
938
|
// Tools come before metadata in CC's key order.
|
|
@@ -949,12 +949,12 @@ export function buildCCRequest(clientBody, billingTag, cache1h, identity, opts =
|
|
|
949
949
|
session_id: identity.sessionId,
|
|
950
950
|
}),
|
|
951
951
|
};
|
|
952
|
-
ccRequest.max_tokens =
|
|
952
|
+
ccRequest.max_tokens = 32000;
|
|
953
953
|
// Model-specific fields — order: thinking, context_management, output_config
|
|
954
954
|
if (!isHaiku) {
|
|
955
955
|
ccRequest.thinking = { type: 'adaptive' };
|
|
956
956
|
ccRequest.context_management = { edits: [{ type: 'clear_thinking_20251015', keep: 'all' }] };
|
|
957
|
-
ccRequest.output_config = { effort: '
|
|
957
|
+
ccRequest.output_config = { effort: 'high' };
|
|
958
958
|
}
|
|
959
959
|
ccRequest.stream = stream;
|
|
960
960
|
// Replay the captured top-level key order. The hardcoded build order above
|
package/dist/proxy.js
CHANGED
|
@@ -878,8 +878,8 @@ export async function startProxy(opts = {}) {
|
|
|
878
878
|
const buildTag = computeBuildTag(userMsg, cliVersion);
|
|
879
879
|
const cch = computeCch();
|
|
880
880
|
const fullVersion = `${cliVersion}.${buildTag}`;
|
|
881
|
-
const billingTag = `x-anthropic-billing-header: cc_version=${fullVersion}; cc_entrypoint=cli; cch=${cch};`;
|
|
882
|
-
const
|
|
881
|
+
const billingTag = `x-anthropic-billing-header: cc_version=${fullVersion}; cc_entrypoint=sdk-cli; cch=${cch};`;
|
|
882
|
+
const CACHE_EPHEMERAL = { type: 'ephemeral' };
|
|
883
883
|
// Session stickiness: rebind the pre-selected pool account to
|
|
884
884
|
// whatever the sticky-key resolver picks. If this is a new
|
|
885
885
|
// conversation the key binds to the current best account
|
|
@@ -920,7 +920,7 @@ export async function startProxy(opts = {}) {
|
|
|
920
920
|
const bodyIdentity = poolAccount
|
|
921
921
|
? poolAccount.identity
|
|
922
922
|
: { deviceId: identity.deviceId, accountUuid: identity.accountUuid, sessionId: preBodySessionId };
|
|
923
|
-
const { body: ccBody, toolMap, detectedClient } = buildCCRequest(r, billingTag,
|
|
923
|
+
const { body: ccBody, toolMap, detectedClient } = buildCCRequest(r, billingTag, CACHE_EPHEMERAL, bodyIdentity, {
|
|
924
924
|
preserveTools: opts.preserveTools ?? false,
|
|
925
925
|
hybridTools: opts.hybridTools ?? false,
|
|
926
926
|
noAutoDetect: opts.noAutoDetect ?? false,
|
package/dist/shim/runtime.cjs
CHANGED
|
@@ -145,8 +145,8 @@ function rewriteBody(bodyText, tmpl) {
|
|
|
145
145
|
const billingTag = body.system[0];
|
|
146
146
|
body.system = [
|
|
147
147
|
billingTag,
|
|
148
|
-
{ type: 'text', text: tmpl.agent_identity, cache_control: { type: 'ephemeral'
|
|
149
|
-
{ type: 'text', text: tmpl.system_prompt, cache_control: { type: 'ephemeral'
|
|
148
|
+
{ type: 'text', text: tmpl.agent_identity, cache_control: { type: 'ephemeral' } },
|
|
149
|
+
{ type: 'text', text: tmpl.system_prompt, cache_control: { type: 'ephemeral' } },
|
|
150
150
|
];
|
|
151
151
|
body.tools = tmpl.tools;
|
|
152
152
|
return JSON.stringify(body);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "3.30.
|
|
3
|
+
"version": "3.30.2",
|
|
4
4
|
"description": "A local LLM router. One endpoint, every provider — Claude subscriptions, OpenAI, OpenRouter, Groq, local LiteLLM, any OpenAI-compat endpoint — your tools don't need to change.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"e2e": "node test/e2e.mjs",
|
|
30
30
|
"compat": "node test/compat.mjs",
|
|
31
31
|
"lint:pkg": "node scripts/check-package-json.mjs",
|
|
32
|
+
"drift:sdk": "node scripts/check-sdk-drift.mjs",
|
|
32
33
|
"fix:pkg": "node -e \"const fs=require('fs');fs.writeFileSync('package.json',JSON.stringify(JSON.parse(fs.readFileSync('package.json','utf-8')),null,2)+'\\n')\""
|
|
33
34
|
},
|
|
34
35
|
"keywords": [
|