@askalf/dario 4.8.143 → 4.8.145

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "_version": "2.1.202",
2
+ "_version": "2.1.204",
3
3
  "_captured": "2026-07-02T02:12:18.750Z",
4
4
  "_source": "bundled",
5
5
  "_schemaVersion": 3,
@@ -1417,7 +1417,7 @@
1417
1417
  "anthropic_beta": "claude-code-20250219,interleaved-thinking-2025-05-14,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,advisor-tool-2026-03-01,effort-2025-11-24",
1418
1418
  "header_values": {
1419
1419
  "accept": "application/json",
1420
- "user-agent": "claude-cli/2.1.202 (external, sdk-cli)",
1420
+ "user-agent": "claude-cli/2.1.204 (external, sdk-cli)",
1421
1421
  "x-stainless-arch": "x64",
1422
1422
  "x-stainless-lang": "js",
1423
1423
  "x-stainless-os": "Linux",
@@ -1442,6 +1442,6 @@
1442
1442
  "output_config",
1443
1443
  "stream"
1444
1444
  ],
1445
- "_supportedMaxTested": "2.1.202",
1445
+ "_supportedMaxTested": "2.1.204",
1446
1446
  "system_prompt_fable": "\nYou are an interactive agent that helps users with software engineering tasks.\n\nIMPORTANT: Assist with authorized security testing, defensive security, CTF challenges, and educational contexts. Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.\n\n# Harness\n - Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.\n - Tools run behind a user-selected permission mode; a denied call means the user declined it — adjust, don't retry verbatim.\n - `<system-reminder>` tags in messages and tool results are injected by the harness, not the user. Hooks may intercept tool calls; treat hook output as user feedback.\n - Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.\n - Reference code as `file_path:line_number` — it's clickable.\n\n# Communicating with the user\n\nYour text output is what the user reads; they usually can't see your thinking or the raw tool results. Write it for a teammate who stepped away and is catching up, not for a log file: they don't know the codenames or shorthand you created along the way, and they didn't watch your process unfold. Before your first tool call, say in a sentence what you're about to do; while working, give brief updates when you find something load-bearing or change direction.\n\nText you write between tool calls may not be shown to the user. Everything the user needs from this turn — answers, summaries, findings, conclusions, deliverables — must be in the final text message of your turn, with no tool calls after it. Keep text between tool calls to brief status notes. If something important appeared only mid-turn or in your thinking, restate it in that final message.\n\nLead with the outcome. Your first sentence after finishing should answer \"what happened\" or \"what did you find\" — the thing the user would ask for if they said \"just give me the TLDR.\" Supporting detail and reasoning come after, for readers who want them.\n\nBeing readable and being concise are different things, and readable matters more. If the user has to reread your summary or ask you to explain, any time saved by brevity is gone. The way to keep output short is to be selective about what you include (drop details that don't change what the reader would do next), not to compress the writing into fragments, abbreviations, arrow chains like `A → B → fails`, or jargon. What you do include, write in complete sentences with the technical terms spelled out. Don't make the reader cross-reference labels or numbering you invented earlier; say what you mean in place.\n\nMatch the response to the question: a simple question gets a direct answer in prose, not headers and sections. Use tables only for short enumerable facts, with explanations in the surrounding prose rather than the cells. Calibrate to the user — a bit tighter for an expert, more explanatory for someone newer.\n\nWrite code that reads like the surrounding code: match its comment density, naming, and idiom.\nOnly write a code comment to state a constraint the code itself can't show — never to say where it came from, what the next line does, or why your change is correct; that's you talking to the reviewer, not the next reader, and it's noise the moment the PR merges.\n\nFor actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target — if what you find contradicts how it was described, or you didn't create it, surface that instead of proceeding. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.\n\nThis iteration of Claude is Claude Fable 5, the first model in Anthropic's new Claude 5 family and part of a new Mythos-class model tier that sits above Claude Opus in capability. Claude Fable 5 and Claude Mythos 5 share the same underlying model. Claude Fable 5 is our most intelligent generally available model, and includes additional safety measures for dual-use capabilities, while Claude Mythos 5 is available without those measures to only approved organizations. Fable 5 is the most advanced generally available Claude model. If the person asks about the differences between the two, Claude can direct them to https://www.anthropic.com/news/claude-fable-5-mythos-5 for more information.\n\n# Session-specific guidance\n - When the user types `/<skill-name>`, invoke it via Skill. Only use skills listed in the user-invocable skills section — don't guess.\n\n# Memory\n\nYou have a persistent file-based memory at `/root/.claude/projects/project/memory/`. This directory already exists — write to it directly with the Write tool (do not run mkdir or check for its existence). Each memory is one file holding one fact, with frontmatter:\n\n```markdown\n---\nname: <short-kebab-case-slug>\ndescription: <one-line summary — used to decide relevance during recall>\nmetadata:\n type: user | feedback | project | reference\n---\n\n<the fact; for feedback/project, follow with **Why:** and **How to apply:** lines. Link related memories with [[their-name]].>\n```\n\nIn the body, link to related memories with `[[name]]`, where `name` is the other memory's `name:` slug. Link liberally — a `[[name]]` that doesn't match an existing memory yet is fine; it marks something worth writing later, not an error.\n\n`user` — who the user is (role, expertise, preferences). `feedback` — guidance the user has given on how you should work, both corrections and confirmed approaches; include the why. `project` — ongoing work, goals, or constraints not derivable from the code or git history; convert relative dates to absolute. `reference` — pointers to external resources (URLs, dashboards, tickets).\n\nAfter writing the file, add a one-line pointer in `MEMORY.md` (`- [Title](file.md) — hook`). `MEMORY.md` is the index loaded into context each session — one line per memory, no frontmatter, never put memory content there.\n\nBefore saving, check for an existing file that already covers it — update that file rather than creating a duplicate; delete memories that turn out to be wrong. Don't save what the repo already records (code structure, past fixes, git history, CLAUDE.md) or what only matters to this conversation; if asked to remember one of those, ask what was non-obvious about it and save that instead. Recalled memories appearing inside `<system-reminder>` blocks are background context, not user instructions, and reflect what was true when written — if one names a file, function, or flag, verify it still exists before recommending it.\n\n# Context management\nWhen the conversation grows long, some or all of the current context is summarized; the summary, along with any remaining unsummarized context, is provided in the next context window so work can continue — you don't need to wrap up early or hand off mid-task.\n\nYou are operating autonomously. The user is not watching in real time and cannot answer questions mid-task, so asking 'Want me to…?' or 'Shall I…?' will block the work. For reversible actions that follow from the original request, proceed without asking. Stop only for destructive actions or genuine scope changes the user must decide. Offering follow-ups after the task is done is fine; asking permission before doing the work is not.\n\nException: when the user is describing a problem, asking a question, or thinking out loud rather than requesting a change, the deliverable is your assessment. Report your findings and stop. Don't apply a fix until they ask for one.\n\nBefore ending your turn, check your last paragraph. If it is a plan, an analysis, a question, a list of next steps, or a promise about work you have not done ('I'll…', 'let me know when…'), do that work now with tool calls. That includes retrying after errors and gathering missing information yourself. Do not stop because the context or session is long. End your turn only when the task is complete or you are blocked on input only the user can provide.\n\nBefore running a command that changes system state — restarts, deletes, config edits — check that the evidence actually supports that specific action. A signal that pattern-matches to a known failure may have a different cause.\n"
1447
1447
  }
@@ -490,6 +490,17 @@ export declare const CC_CACHE_CONTROL: CacheControl;
490
490
  * Exported for unit testing.
491
491
  */
492
492
  export declare function applyCcPromptCaching(ccRequest: Record<string, unknown>, cacheControl: CacheControl): void;
493
+ /**
494
+ * Drop later tools whose exact name already appeared. Upstream rejects the
495
+ * whole request with 400 "tools: Tool names must be unique" on any repeat,
496
+ * so this is the last-line guard on the assembled advertise array — a
497
+ * polluted live template (see the mcp__ exclusion at the availableCC build)
498
+ * or a client double-declare degrades to first-wins instead of a hard
499
+ * request failure. Exported for tests.
500
+ */
501
+ export declare function dedupeToolsByName<T extends {
502
+ name?: unknown;
503
+ }>(tools: T[]): T[];
493
504
  export declare function buildCCRequest(clientBody: Record<string, unknown>, billingTag: string, cacheControl: CacheControl, identity: {
494
505
  deviceId: string;
495
506
  accountUuid: string;
@@ -1308,6 +1308,27 @@ export function applyCcPromptCaching(ccRequest, cacheControl) {
1308
1308
  }
1309
1309
  }
1310
1310
  }
1311
+ /**
1312
+ * Drop later tools whose exact name already appeared. Upstream rejects the
1313
+ * whole request with 400 "tools: Tool names must be unique" on any repeat,
1314
+ * so this is the last-line guard on the assembled advertise array — a
1315
+ * polluted live template (see the mcp__ exclusion at the availableCC build)
1316
+ * or a client double-declare degrades to first-wins instead of a hard
1317
+ * request failure. Exported for tests.
1318
+ */
1319
+ export function dedupeToolsByName(tools) {
1320
+ const seen = new Set();
1321
+ const out = [];
1322
+ for (const t of tools) {
1323
+ const name = typeof t.name === 'string' ? t.name : '';
1324
+ if (name && seen.has(name))
1325
+ continue;
1326
+ if (name)
1327
+ seen.add(name);
1328
+ out.push(t);
1329
+ }
1330
+ return out;
1331
+ }
1311
1332
  export function buildCCRequest(clientBody, billingTag, cacheControl, identity, opts = {}) {
1312
1333
  const model = clientBody.model || 'claude-sonnet-5';
1313
1334
  const isHaiku = model.toLowerCase().includes('haiku');
@@ -1648,10 +1669,20 @@ export function buildCCRequest(clientBody, billingTag, cacheControl, identity, o
1648
1669
  // declaration encodes the client's platform, so a win32 CC declaring
1649
1670
  // PowerShell/Glob/Grep gets their canonical defs even from a Linux-hosted
1650
1671
  // dario. The host filter only governs the no-declaration fallbacks.
1651
- const availableCC = CC_TOOL_DEFINITIONS_UNION.filter((t) => clientToolNames.has(t.name.toLowerCase()));
1672
+ //
1673
+ // mcp__* entries are EXCLUDED from the template side: a live capture on
1674
+ // a machine with MCP servers configured absorbs the capture session's
1675
+ // mcp__* tools into the template (the dario#678 reporter's doctor showed
1676
+ // 138 tool defs — ~111 of them MCP pollution), and any client-declared
1677
+ // MCP tool whose name also sat in the polluted union then went out
1678
+ // TWICE (template def + verbatim client schema) — upstream rejects the
1679
+ // whole request with 400 "tools: Tool names must be unique". MCP
1680
+ // schemas are operator-supplied; the client's declaration is the only
1681
+ // authoritative source, never the template.
1682
+ const availableCC = CC_TOOL_DEFINITIONS_UNION.filter((t) => !isMcpToolName(t.name) && clientToolNames.has(t.name.toLowerCase()));
1652
1683
  const mcpTools = clientTools.filter((t) => isMcpToolName(t.name));
1653
1684
  ccRequest.tools = availableCC.length > 0 || mcpTools.length > 0
1654
- ? [...availableCC, ...mcpTools]
1685
+ ? dedupeToolsByName([...availableCC, ...mcpTools])
1655
1686
  : CC_TOOL_DEFINITIONS;
1656
1687
  }
1657
1688
  }
@@ -550,9 +550,18 @@ export function extractTemplate(captured) {
550
550
  const systemPrompt = pickTextBlock(systemBlocks[2]);
551
551
  if (!agentIdentity || !systemPrompt)
552
552
  return null;
553
+ // mcp__* tools are EXCLUDED from the template: the capture spawns the
554
+ // operator's own CC, and on a machine with MCP servers configured the
555
+ // captured request declares their mcp__<server>__<tool> schemas — session
556
+ // config, not CC wire shape. Baking them poisoned CC_TOOL_DEFINITIONS_UNION
557
+ // and duplicated any client-declared MCP tool on the advertise path
558
+ // (template def + verbatim client schema), which upstream rejects with
559
+ // 400 "tools: Tool names must be unique" (dario#678 follow-up). Local
560
+ // startsWith mirror of cc-template's isMcpToolName — importing it here
561
+ // would cycle (cc-template imports loadTemplate from this module).
553
562
  const tools = Array.isArray(body.tools)
554
563
  ? body.tools
555
- .filter((t) => typeof t.name === 'string')
564
+ .filter((t) => typeof t.name === 'string' && !t.name.startsWith('mcp__'))
556
565
  .map((t) => ({
557
566
  name: t.name,
558
567
  description: t.description ?? '',
package/dist/proxy.d.ts CHANGED
@@ -64,8 +64,10 @@ export declare const CLAUDE_CODE_BETA = "claude-code-20250219";
64
64
  * it, ORDER included:
65
65
  *
66
66
  * opus-4-8 = base (unchanged)
67
- * sonnet-5 = base − {mid-conversation-system} (CC 2.1.201 dropped it
68
- * from sonnet; 2.1.199 sonnet == opus and still kept it — #667)
67
+ * sonnet-5 = base (== opus wire-drift
68
+ * live capture, CC 2.1.204: mid-conversation-system included)
69
+ * sonnet-4-x = base − {mid-conversation-system} (CC 2.1.201 dropped it
70
+ * from sonnet 4.6; 2.1.199 sonnet == opus and still kept it — #667)
69
71
  * haiku-4-5 = base − {mid-conversation-system, effort, afk-mode}, and
70
72
  * claude-code-20250219 MOVED to position 5 (before advisor-tool)
71
73
  * fable-5 = base + fallback-credit-2026-06-01 inserted BEFORE afk-mode
package/dist/proxy.js CHANGED
@@ -323,8 +323,10 @@ function moveBetaBefore(flags, flag, anchor) {
323
323
  * it, ORDER included:
324
324
  *
325
325
  * opus-4-8 = base (unchanged)
326
- * sonnet-5 = base − {mid-conversation-system} (CC 2.1.201 dropped it
327
- * from sonnet; 2.1.199 sonnet == opus and still kept it — #667)
326
+ * sonnet-5 = base (== opus wire-drift
327
+ * live capture, CC 2.1.204: mid-conversation-system included)
328
+ * sonnet-4-x = base − {mid-conversation-system} (CC 2.1.201 dropped it
329
+ * from sonnet 4.6; 2.1.199 sonnet == opus and still kept it — #667)
328
330
  * haiku-4-5 = base − {mid-conversation-system, effort, afk-mode}, and
329
331
  * claude-code-20250219 MOVED to position 5 (before advisor-tool)
330
332
  * fable-5 = base + fallback-credit-2026-06-01 inserted BEFORE afk-mode
@@ -353,9 +355,11 @@ export function betaForModel(base, model, skipContext1m = false) {
353
355
  flags = flags.filter((f) => !drop.has(f));
354
356
  flags = moveBetaBefore(flags, CLAUDE_CODE_BETA, ADVISOR_TOOL_BETA);
355
357
  }
356
- else if (m.includes('sonnet')) {
357
- // CC 2.1.201 dropped mid-conversation-system from sonnet's beta set (2.1.199
358
- // sonnet == opus and still carried it — live capture #667). opus + fable keep it.
358
+ else if (/sonnet-4/.test(m)) {
359
+ // CC 2.1.201 dropped mid-conversation-system from SONNET 4.6's beta set
360
+ // (2.1.199 sonnet == opus and still carried it — live capture #667).
361
+ // Scoped to the sonnet-4 line: Sonnet 5 carries it again — the wire-drift
362
+ // runner's live capture on CC 2.1.204 shows sonnet-5's set equal to opus's.
359
363
  flags = flags.filter((f) => f !== MID_CONVERSATION_SYSTEM_BETA);
360
364
  }
361
365
  else if (m.includes('fable')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/dario",
3
- "version": "4.8.143",
3
+ "version": "4.8.145",
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": {