@askalf/dario 4.8.72 → 4.8.73
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 +7 -4
- package/dist/cc-template.js +23 -19
- package/package.json +1 -1
package/dist/cc-template.d.ts
CHANGED
|
@@ -39,10 +39,13 @@ export declare const CC_TOOL_DEFINITIONS: {
|
|
|
39
39
|
description: string;
|
|
40
40
|
input_schema: Record<string, unknown>;
|
|
41
41
|
}[];
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
|
|
42
|
+
/** CC's own tool names, EXACT case ("Read", "Bash", "Agent", …). A CC client's
|
|
43
|
+
* tools identity-map to themselves and OVERRIDE TOOL_MAP — whose lowercase
|
|
44
|
+
* cross-client aliases ('read' → {path}/{filePath}) would otherwise mistranslate
|
|
45
|
+
* a CC tool (Read's file_path → path). Exact case is the discriminator: CC sends
|
|
46
|
+
* PascalCase, the {path}-style clients send lowercase/snake, so a non-CC `read`
|
|
47
|
+
* still routes through TOOL_MAP. Tracks the live bundle (refreshed each bake). */
|
|
48
|
+
export declare const CC_NATIVE_NAMES: Set<string>;
|
|
46
49
|
/** CC's static system prompt (~25KB). */
|
|
47
50
|
export declare const CC_SYSTEM_PROMPT: string;
|
|
48
51
|
/** CC's agent identity string. */
|
package/dist/cc-template.js
CHANGED
|
@@ -45,10 +45,13 @@ export function filterToolsForPlatform(tools, platform) {
|
|
|
45
45
|
}
|
|
46
46
|
/** CC's exact tool definitions for the current platform — filtered from the bundled union. */
|
|
47
47
|
export const CC_TOOL_DEFINITIONS = filterToolsForPlatform(TEMPLATE.tools, process.platform);
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
|
|
48
|
+
/** CC's own tool names, EXACT case ("Read", "Bash", "Agent", …). A CC client's
|
|
49
|
+
* tools identity-map to themselves and OVERRIDE TOOL_MAP — whose lowercase
|
|
50
|
+
* cross-client aliases ('read' → {path}/{filePath}) would otherwise mistranslate
|
|
51
|
+
* a CC tool (Read's file_path → path). Exact case is the discriminator: CC sends
|
|
52
|
+
* PascalCase, the {path}-style clients send lowercase/snake, so a non-CC `read`
|
|
53
|
+
* still routes through TOOL_MAP. Tracks the live bundle (refreshed each bake). */
|
|
54
|
+
export const CC_NATIVE_NAMES = new Set(CC_TOOL_DEFINITIONS.map((t) => String(t.name)));
|
|
52
55
|
/** CC's static system prompt (~25KB). */
|
|
53
56
|
export const CC_SYSTEM_PROMPT = TEMPLATE.system_prompt;
|
|
54
57
|
/** CC's agent identity string. */
|
|
@@ -1234,19 +1237,20 @@ export function buildCCRequest(clientBody, billingTag, cacheControl, identity, o
|
|
|
1234
1237
|
const claimedCC = new Set();
|
|
1235
1238
|
for (const tool of clientTools) {
|
|
1236
1239
|
const name = (tool.name || '').toLowerCase();
|
|
1237
|
-
// A CC client's OWN tools map to THEMSELVES (identity)
|
|
1238
|
-
//
|
|
1239
|
-
//
|
|
1240
|
-
//
|
|
1241
|
-
//
|
|
1242
|
-
//
|
|
1243
|
-
//
|
|
1244
|
-
//
|
|
1245
|
-
//
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1240
|
+
// A CC client's OWN tools map to THEMSELVES (identity), and this OVERRIDES
|
|
1241
|
+
// TOOL_MAP. Two failure modes it fixes, both seen via the dock:
|
|
1242
|
+
// 1. TOOL_MAP's lowercase cross-client aliases mistranslate a CC tool —
|
|
1243
|
+
// `Read` → TOOL_MAP['read'] whose translateBack emits {path, filePath}
|
|
1244
|
+
// instead of {file_path}, so every Read failed validation client-side.
|
|
1245
|
+
// 2. CC's newer built-ins (Agent, AskUserQuestion, Cron*, Task*, Workflow,
|
|
1246
|
+
// NotebookEdit, Enter/ExitPlanMode, …) aren't in TOOL_MAP at all, so
|
|
1247
|
+
// they were round-robined onto Read/Bash/etc. and collided.
|
|
1248
|
+
// Exact case is the discriminator (CC sends PascalCase; {path}-style clients
|
|
1249
|
+
// send lowercase/snake) so a genuine non-CC `read` still routes via TOOL_MAP.
|
|
1250
|
+
// Tracks the live bundle, so future CC tools are covered after the next bake.
|
|
1251
|
+
const mapping = CC_NATIVE_NAMES.has(tool.name)
|
|
1252
|
+
? { ccTool: tool.name, translateArgs: (a) => a, translateBack: (a) => a }
|
|
1253
|
+
: TOOL_MAP[name];
|
|
1250
1254
|
if (mapping) {
|
|
1251
1255
|
// In hybrid mode, clone the shared mapping and attach the
|
|
1252
1256
|
// client-declared top-level field names from input_schema.
|
|
@@ -1282,8 +1286,8 @@ export function buildCCRequest(clientBody, billingTag, cacheControl, identity, o
|
|
|
1282
1286
|
const CC_FALLBACK_TOOLS = ['Bash', 'Read', 'Grep', 'Glob', 'WebSearch', 'WebFetch'];
|
|
1283
1287
|
for (const tool of clientTools) {
|
|
1284
1288
|
const name = (tool.name || '').toLowerCase();
|
|
1285
|
-
if (
|
|
1286
|
-
continue; //
|
|
1289
|
+
if (CC_NATIVE_NAMES.has(tool.name) || TOOL_MAP[name])
|
|
1290
|
+
continue; // CC-native (identity in pass 1) or mapped
|
|
1287
1291
|
unmappedTools.push(tool.name);
|
|
1288
1292
|
if (opts.hybridTools)
|
|
1289
1293
|
continue; // dropped — see comment above
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.73",
|
|
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": {
|