@askalf/dario 3.30.0 → 3.30.1
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.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 +1 -1
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.1",
|
|
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": {
|