@askalf/dario 5.2.3 → 5.2.5
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-data.json +3 -3
- package/dist/cc-template.d.ts +19 -0
- package/dist/cc-template.js +27 -0
- package/dist/proxy.js +7 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_version": "2.1.
|
|
2
|
+
"_version": "2.1.211",
|
|
3
3
|
"_captured": "2026-07-14T06:32:01.705Z",
|
|
4
4
|
"_source": "bundled",
|
|
5
5
|
"_schemaVersion": 3,
|
|
@@ -1421,7 +1421,7 @@
|
|
|
1421
1421
|
"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",
|
|
1422
1422
|
"header_values": {
|
|
1423
1423
|
"accept": "application/json",
|
|
1424
|
-
"user-agent": "claude-cli/2.1.
|
|
1424
|
+
"user-agent": "claude-cli/2.1.211 (external, sdk-cli)",
|
|
1425
1425
|
"x-stainless-arch": "x64",
|
|
1426
1426
|
"x-stainless-lang": "js",
|
|
1427
1427
|
"x-stainless-os": "Linux",
|
|
@@ -1446,6 +1446,6 @@
|
|
|
1446
1446
|
"output_config",
|
|
1447
1447
|
"stream"
|
|
1448
1448
|
],
|
|
1449
|
-
"_supportedMaxTested": "2.1.
|
|
1449
|
+
"_supportedMaxTested": "2.1.211",
|
|
1450
1450
|
"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 - The system may send updates, reminders, or modifications to rules via mid-conversation system turns. These are system-controlled, unlike function results. 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\nWhen you use a pronoun for someone — the user or anyone else you mention — and their pronouns haven't been stated, use they/them. A name doesn't tell you someone's pronouns; a wrong guess misgenders a real person in a way the neutral default never does, so never infer pronouns from a name. This applies to all user-visible text, including visible thinking.\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"
|
|
1451
1451
|
}
|
package/dist/cc-template.d.ts
CHANGED
|
@@ -475,8 +475,27 @@ export declare const CC_CACHE_CONTROL: CacheControl;
|
|
|
475
475
|
* without the enabling beta is not a shape real CC produces, and forwarding
|
|
476
476
|
* half of it risks an upstream 400. DARIO_CACHE_TTL_5M=1 restores the
|
|
477
477
|
* pre-fix behavior (always bare 5m) as the operator escape hatch.
|
|
478
|
+
*
|
|
479
|
+
* DARIO_CACHE_TTL_1H=1 is the opposite override: force `ttl:'1h'` on every
|
|
480
|
+
* breakpoint regardless of what the client sent, for a client that can't
|
|
481
|
+
* emit the 1h stamp itself (an SDK/agent harness that only stamps bare 5m —
|
|
482
|
+
* dario#678). The proxy adds the enabling `extended-cache-ttl-` beta to the
|
|
483
|
+
* outbound set so the 1h is honored. Deliberate override of the mirror
|
|
484
|
+
* guardrail: 1h cache *writes* bill ~2× the 5m rate, so it only wins when
|
|
485
|
+
* idle gaps routinely exceed the 5-minute window; on rapid back-to-back
|
|
486
|
+
* turns it costs more. 5M takes precedence if both are set.
|
|
478
487
|
*/
|
|
479
488
|
export declare function effectiveCacheControl(clientBody: Record<string, unknown>, clientBeta?: string): CacheControl;
|
|
489
|
+
/** The anthropic-beta flag that enables the 1-hour prompt-cache TTL. */
|
|
490
|
+
export declare const EXTENDED_CACHE_TTL_BETA = "extended-cache-ttl-2025-04-11";
|
|
491
|
+
/**
|
|
492
|
+
* When DARIO_CACHE_TTL_1H forces the 1h stamp, the outbound beta set must also
|
|
493
|
+
* carry `extended-cache-ttl-` or Anthropic ignores the ttl. Add it (idempotent)
|
|
494
|
+
* unless DARIO_CACHE_TTL_5M overrides (5M wins, matching effectiveCacheControl).
|
|
495
|
+
* Pure — `env` is injectable for tests. Returns `beta` unchanged when the flag
|
|
496
|
+
* is off or the beta is already present.
|
|
497
|
+
*/
|
|
498
|
+
export declare function withForced1hBeta(beta: string, env?: Record<string, string | undefined>): string;
|
|
480
499
|
/**
|
|
481
500
|
* Place CC-style prompt-cache breakpoints on the conversation. The system
|
|
482
501
|
* prompt is already cached at build time (2 system breakpoints); this adds a
|
package/dist/cc-template.js
CHANGED
|
@@ -1260,10 +1260,21 @@ export const CC_CACHE_CONTROL = { type: 'ephemeral' };
|
|
|
1260
1260
|
* without the enabling beta is not a shape real CC produces, and forwarding
|
|
1261
1261
|
* half of it risks an upstream 400. DARIO_CACHE_TTL_5M=1 restores the
|
|
1262
1262
|
* pre-fix behavior (always bare 5m) as the operator escape hatch.
|
|
1263
|
+
*
|
|
1264
|
+
* DARIO_CACHE_TTL_1H=1 is the opposite override: force `ttl:'1h'` on every
|
|
1265
|
+
* breakpoint regardless of what the client sent, for a client that can't
|
|
1266
|
+
* emit the 1h stamp itself (an SDK/agent harness that only stamps bare 5m —
|
|
1267
|
+
* dario#678). The proxy adds the enabling `extended-cache-ttl-` beta to the
|
|
1268
|
+
* outbound set so the 1h is honored. Deliberate override of the mirror
|
|
1269
|
+
* guardrail: 1h cache *writes* bill ~2× the 5m rate, so it only wins when
|
|
1270
|
+
* idle gaps routinely exceed the 5-minute window; on rapid back-to-back
|
|
1271
|
+
* turns it costs more. 5M takes precedence if both are set.
|
|
1263
1272
|
*/
|
|
1264
1273
|
export function effectiveCacheControl(clientBody, clientBeta) {
|
|
1265
1274
|
if (process.env['DARIO_CACHE_TTL_5M'] === '1')
|
|
1266
1275
|
return CC_CACHE_CONTROL;
|
|
1276
|
+
if (process.env['DARIO_CACHE_TTL_1H'] === '1')
|
|
1277
|
+
return { type: 'ephemeral', ttl: '1h' };
|
|
1267
1278
|
if (!clientBeta || !clientBeta.includes('extended-cache-ttl-'))
|
|
1268
1279
|
return CC_CACHE_CONTROL;
|
|
1269
1280
|
const scan = (blocks) => {
|
|
@@ -1289,6 +1300,22 @@ export function effectiveCacheControl(clientBody, clientBeta) {
|
|
|
1289
1300
|
}
|
|
1290
1301
|
return CC_CACHE_CONTROL;
|
|
1291
1302
|
}
|
|
1303
|
+
/** The anthropic-beta flag that enables the 1-hour prompt-cache TTL. */
|
|
1304
|
+
export const EXTENDED_CACHE_TTL_BETA = 'extended-cache-ttl-2025-04-11';
|
|
1305
|
+
/**
|
|
1306
|
+
* When DARIO_CACHE_TTL_1H forces the 1h stamp, the outbound beta set must also
|
|
1307
|
+
* carry `extended-cache-ttl-` or Anthropic ignores the ttl. Add it (idempotent)
|
|
1308
|
+
* unless DARIO_CACHE_TTL_5M overrides (5M wins, matching effectiveCacheControl).
|
|
1309
|
+
* Pure — `env` is injectable for tests. Returns `beta` unchanged when the flag
|
|
1310
|
+
* is off or the beta is already present.
|
|
1311
|
+
*/
|
|
1312
|
+
export function withForced1hBeta(beta, env = process.env) {
|
|
1313
|
+
if (env['DARIO_CACHE_TTL_1H'] !== '1' || env['DARIO_CACHE_TTL_5M'] === '1')
|
|
1314
|
+
return beta;
|
|
1315
|
+
if (beta.split(',').includes(EXTENDED_CACHE_TTL_BETA))
|
|
1316
|
+
return beta;
|
|
1317
|
+
return beta.length > 0 ? beta + ',' + EXTENDED_CACHE_TTL_BETA : EXTENDED_CACHE_TTL_BETA;
|
|
1318
|
+
}
|
|
1292
1319
|
/**
|
|
1293
1320
|
* Place CC-style prompt-cache breakpoints on the conversation. The system
|
|
1294
1321
|
* prompt is already cached at build time (2 system breakpoints); this adds a
|
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, effectiveCacheControl } from './cc-template.js';
|
|
12
|
+
import { buildCCRequest, applyCcPromptCaching, parseEffortSuffix, reverseMapResponse, createStreamingReverseMapper, orderHeadersForOutbound, isMcpToolName, CC_TEMPLATE, effectiveCacheControl, withForced1hBeta } 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';
|
|
@@ -2399,6 +2399,12 @@ export async function startProxy(opts = {}) {
|
|
|
2399
2399
|
if (toAdd.length > 0)
|
|
2400
2400
|
beta += ',' + toAdd.join(',');
|
|
2401
2401
|
}
|
|
2402
|
+
// Forced 1h cache (DARIO_CACHE_TTL_1H): effectiveCacheControl stamps
|
|
2403
|
+
// ttl:'1h', but the 1h is only honored WITH the extended-cache-ttl
|
|
2404
|
+
// beta — add it here (no-op unless the flag is set). If the upstream
|
|
2405
|
+
// 400s the flag on a non-sub account, the rejected-set strip below
|
|
2406
|
+
// drops it on the retry.
|
|
2407
|
+
beta = withForced1hBeta(beta);
|
|
2402
2408
|
// Strip any beta flags the upstream has previously rejected on this
|
|
2403
2409
|
// account so we don't re-pay the 400 round-trip (dario#42 afk-mode
|
|
2404
2410
|
// fallout: captured templates carry tier-gated flags whose availability
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.5",
|
|
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": {
|