@askalf/dario 4.8.138 → 4.8.140

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.201",
2
+ "_version": "2.1.202",
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.201 (external, sdk-cli)",
1420
+ "user-agent": "claude-cli/2.1.202 (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.201",
1445
+ "_supportedMaxTested": "2.1.202",
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
  }
@@ -432,6 +432,25 @@ export declare function resolveEffort(flag: EffortValue | undefined, clientBody:
432
432
  * — never a broken request.
433
433
  */
434
434
  export declare function supportsAdaptiveThinking(modelId: string): boolean;
435
+ /**
436
+ * Anthropic prompt-cache control. `ttl` is the cache lifetime: `5m` (the
437
+ * upstream default when omitted) or `1h`. Real CC sends `1h` on its system
438
+ * blocks (see live-fingerprint.ts extractTemplate), so dario mirrors it.
439
+ */
440
+ export type CacheControl = {
441
+ type: 'ephemeral';
442
+ ttl?: '5m' | '1h';
443
+ };
444
+ /**
445
+ * The cache-control dario stamps on every breakpoint (2 system + tools +
446
+ * conversation). `ttl: '1h'` mirrors real CC — dario shipped the 5-min
447
+ * ephemeral default, so its prefix expired 12x sooner than CC's and any
448
+ * interactive turn past the 5-min window re-created the whole prefix
449
+ * (system + all tools) at cache-creation cost, draining the Max window far
450
+ * faster than direct CC (root cause of dario#678). Single source of truth so
451
+ * the emitted TTL can't silently drift back to 5m.
452
+ */
453
+ export declare const CC_CACHE_CONTROL: CacheControl;
435
454
  /**
436
455
  * Place CC-style prompt-cache breakpoints on the tools array and the
437
456
  * conversation. The system prompt is already cached at build time (2 system
@@ -446,12 +465,8 @@ export declare function supportsAdaptiveThinking(modelId: string): boolean;
446
465
  * sails through. CC genuinely caches tools + conversation, so NOT caching them
447
466
  * was itself a wire divergence from CC. Exported for unit testing.
448
467
  */
449
- export declare function applyCcPromptCaching(ccRequest: Record<string, unknown>, cacheControl: {
450
- type: 'ephemeral';
451
- }): void;
452
- export declare function buildCCRequest(clientBody: Record<string, unknown>, billingTag: string, cacheControl: {
453
- type: 'ephemeral';
454
- }, identity: {
468
+ export declare function applyCcPromptCaching(ccRequest: Record<string, unknown>, cacheControl: CacheControl): void;
469
+ export declare function buildCCRequest(clientBody: Record<string, unknown>, billingTag: string, cacheControl: CacheControl, identity: {
455
470
  deviceId: string;
456
471
  accountUuid: string;
457
472
  sessionId: string;
@@ -1235,6 +1235,16 @@ export function supportsAdaptiveThinking(modelId) {
1235
1235
  return true;
1236
1236
  return false;
1237
1237
  }
1238
+ /**
1239
+ * The cache-control dario stamps on every breakpoint (2 system + tools +
1240
+ * conversation). `ttl: '1h'` mirrors real CC — dario shipped the 5-min
1241
+ * ephemeral default, so its prefix expired 12x sooner than CC's and any
1242
+ * interactive turn past the 5-min window re-created the whole prefix
1243
+ * (system + all tools) at cache-creation cost, draining the Max window far
1244
+ * faster than direct CC (root cause of dario#678). Single source of truth so
1245
+ * the emitted TTL can't silently drift back to 5m.
1246
+ */
1247
+ export const CC_CACHE_CONTROL = { type: 'ephemeral', ttl: '1h' };
1238
1248
  /**
1239
1249
  * Place CC-style prompt-cache breakpoints on the tools array and the
1240
1250
  * conversation. The system prompt is already cached at build time (2 system
package/dist/doctor.js CHANGED
@@ -334,7 +334,7 @@ export async function runChecks(opts = {}) {
334
334
  // non-passthrough request and dominate the input-token cost on small
335
335
  // turns. Anthropic caches them after the first hit (cache_creation
336
336
  // tokens on call 1, then cache_read on subsequent calls within the
337
- // 5-min/1-hr TTL), but non-CC users routing heavy tooling get
337
+ // 1-hour TTL), but non-CC users routing heavy tooling get
338
338
  // surprised by the first-request charge. Surface the size up front
339
339
  // so they can plan.
340
340
  //
@@ -355,7 +355,7 @@ export async function runChecks(opts = {}) {
355
355
  detail: `${promptChars.toLocaleString()} chars system prompt + ${toolCount} tool defs ` +
356
356
  `(${toolChars.toLocaleString()} chars JSON-serialized) injected per non-passthrough ` +
357
357
  `request. Cached after first hit; read-cost only on subsequent calls within ` +
358
- `the 5-min/1-hr TTL. Exact token count surfaces as cache_creation_input_tokens ` +
358
+ `the 1-hour TTL. Exact token count surfaces as cache_creation_input_tokens ` +
359
359
  `on the first response (or run \`dario doctor --usage\`).`,
360
360
  });
361
361
  }
package/dist/proxy.js CHANGED
@@ -9,7 +9,7 @@ import { arch, platform } from 'node:process';
9
9
  import { getAccessToken, getStatus } from './oauth.js';
10
10
  import { buildHealthResponse, derivePoolStatus, shouldDiscloseHealthInternals } from './health-response.js';
11
11
  import { darioVersion } from './version.js';
12
- import { buildCCRequest, applyCcPromptCaching, parseEffortSuffix, reverseMapResponse, createStreamingReverseMapper, orderHeadersForOutbound, isMcpToolName, CC_TEMPLATE } from './cc-template.js';
12
+ import { buildCCRequest, applyCcPromptCaching, parseEffortSuffix, reverseMapResponse, createStreamingReverseMapper, orderHeadersForOutbound, isMcpToolName, CC_TEMPLATE, CC_CACHE_CONTROL } from './cc-template.js';
13
13
  import { stampCch, hasCchSeed } from './cch.js';
14
14
  import { describeTemplate, detectDrift, checkCCCompat } from './live-fingerprint.js';
15
15
  import { AccountPool, computeStickyKey, parseRateLimits, modelFamily, isInAuthCooldown, authCooldownMs, reconcilePoolAccounts } from './pool.js';
@@ -2049,7 +2049,8 @@ export async function startProxy(opts = {}) {
2049
2049
  // current Claude Code, which sends none. dario#528.
2050
2050
  const cch = hasCchSeed(cliVersion) ? computeCch() : null;
2051
2051
  const billingTag = buildBillingTag(cliVersion, cch);
2052
- const CACHE_EPHEMERAL = { type: 'ephemeral' };
2052
+ // 1h cache TTL, matching real CC (see CC_CACHE_CONTROL / dario#678).
2053
+ const CACHE_EPHEMERAL = CC_CACHE_CONTROL;
2053
2054
  // Session stickiness: rebind the pre-selected pool account to
2054
2055
  // whatever the sticky-key resolver picks. If this is a new
2055
2056
  // conversation the key binds to the current best account
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/dario",
3
- "version": "4.8.138",
3
+ "version": "4.8.140",
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": {