@askalf/dario 5.5.47 → 5.5.49
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 +0 -32
- package/dist/cc-template.js +45 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_version": "2.1.
|
|
2
|
+
"_version": "2.1.240",
|
|
3
3
|
"_captured": "2026-08-19T16:59:03.395Z",
|
|
4
4
|
"_source": "bundled",
|
|
5
5
|
"_schemaVersion": 3,
|
|
@@ -1466,7 +1466,7 @@
|
|
|
1466
1466
|
"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",
|
|
1467
1467
|
"header_values": {
|
|
1468
1468
|
"accept": "application/json",
|
|
1469
|
-
"user-agent": "claude-cli/2.1.
|
|
1469
|
+
"user-agent": "claude-cli/2.1.240 (external, sdk-cli)",
|
|
1470
1470
|
"x-stainless-lang": "js",
|
|
1471
1471
|
"x-stainless-package-version": "0.112.1",
|
|
1472
1472
|
"x-stainless-retry-count": "0",
|
|
@@ -1489,7 +1489,7 @@
|
|
|
1489
1489
|
"output_config",
|
|
1490
1490
|
"stream"
|
|
1491
1491
|
],
|
|
1492
|
-
"_supportedMaxTested": "2.1.
|
|
1492
|
+
"_supportedMaxTested": "2.1.240",
|
|
1493
1493
|
"system_prompt_variants": {
|
|
1494
1494
|
"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, including answers, summaries, findings, conclusions, and 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 change 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 `/home/user/.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 (such as restarts, deletes, or 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",
|
|
1495
1495
|
"opus-5": "\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\nWrite code that reads like the surrounding code: match its comment density, naming, and idiom.\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. 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\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 `/home/user/.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\n# Delivering work\nDo ordinary work as asked, acting on the actual request rather than on speculation about what lies behind it. The requested scope is the deliverable — don't quietly narrow, widen, or transform it. Interpret ambiguity the way a careful colleague would: make routine judgment calls yourself, and check in only when different readings would lead to materially different work. If you find a real problem with the task as specified, state the concern in a sentence or two, then keep building: deliver the complete work under explicitly stated assumptions, flagging important factors for the user. Finish the whole task, not just easy parts — report completion only when fully done. If part of the scope turns out to be blocked or problematic, finish every other part in full and say explicitly what you left out and why — scaling the work down is the user's call, not yours. Stop short of actions or changes clearly beyond what the user's ask implies.\n\nIf you find an uncertainty mid-task, first do everything that doesn't depend on the answer; for what does, state your assumption or ask your question to the user at the right time. Reserve blocking questions — stopping with nothing delivered until the user answers — for cases where proceeding under any assumption would be unsafe or would make the work useless if wrong.\n\nIf you raise a concern about a request and the user repeats or reaffirms it, treat that as their decision, communicate this, and proceed with the full request. Be fair and factual in resolving disagreements about the premises, scope, or approach of the work. Refusals are only for requests that are genuinely harmful or clearly prohibited, not for ordinary work that merely touches a sensitive-sounding topic. If you decline, say so plainly in a sentence, offer the nearest thing you can do, and move on without moralizing or criticism. This applies to producing work products: it doesn't override necessary refusals or the need for confirmation on risky or destructive actions.\n\n# Corrections\nAvoid unnecessary or excessive self-correction. Only correct an earlier statement in your user-facing text when the error would change the user's code, conclusions, or decisions. State corrections plainly and concisely, and continue the task; combine multiple corrections rather than enumerating them all. For slips that change nothing for the user, simply make the correction and move on - no need to note it explicitly. Don't add apologies or preambles, don't be overly self-critical, and don't ruminate or give a detailed account of the mistake or tally past errors. Sometimes, other agents will report incorrect or misleading results - don't always take them at face value immediately. If other agents correct your statements and they are right, then simply update your approach without narrating too much about the correction to the user. This instruction does not apply to thinking blocks.\n\nA follow-up question about your earlier work is not, by itself, a signal that you got something wrong — answer what was asked. A statement that was accurate needs no correction: don't re-audit how you phrased it, how you verified it, or limits you already stated. When the user does point to a real error, correct it plainly as above.\n\nDo not call the AgentTool unless the user requested it\nDo not use workflows or deep-research unless the user requested it\n",
|
package/dist/cc-template.d.ts
CHANGED
|
@@ -505,38 +505,6 @@ export declare const EXTENDED_CACHE_TTL_BETA = "extended-cache-ttl-2025-04-11";
|
|
|
505
505
|
* is off or the beta is already present.
|
|
506
506
|
*/
|
|
507
507
|
export declare function withForced1hBeta(beta: string, env?: Record<string, string | undefined>): string;
|
|
508
|
-
/**
|
|
509
|
-
* Place CC-style prompt-cache breakpoints on the conversation. The system
|
|
510
|
-
* prompt is already cached at build time (2 system breakpoints); this adds a
|
|
511
|
-
* rolling breakpoint on the last user message plus an anchor on the previous
|
|
512
|
-
* one — total 4, the Anthropic max.
|
|
513
|
-
*
|
|
514
|
-
* Placement mirrors a live capture of CC v2.1.203 (dario#678):
|
|
515
|
-
*
|
|
516
|
-
* - Tools carry NO breakpoint. Real CC sends its tool array unstamped —
|
|
517
|
-
* Anthropic renders tools -> system -> messages, so the system breakpoints
|
|
518
|
-
* already cache the tools prefix. Stamping the last tool (pre-4.8.142) both
|
|
519
|
-
* diverged from CC's wire shape and spent the fourth slot the conversation
|
|
520
|
-
* anchor below needs.
|
|
521
|
-
*
|
|
522
|
-
* - The rolling breakpoint goes on the last USER message, not the last
|
|
523
|
-
* message. CC skips trailing role:"system" injections (agent-type updates
|
|
524
|
-
* etc.); stamping "the last message" meant any turn ending in one wrote no
|
|
525
|
-
* conversation entry at all, and the next request re-paid the entire
|
|
526
|
-
* history as fresh input.
|
|
527
|
-
*
|
|
528
|
-
* - The previous user message is anchored too. Anthropic's cache lookup
|
|
529
|
-
* walks back at most ~20 content blocks from a breakpoint; one parallel-
|
|
530
|
-
* tool turn (N tool_use + N tool_result blocks) can exceed that alone, and
|
|
531
|
-
* the rolling breakpoint then can't reach the prior turn's entry — the
|
|
532
|
-
* whole conversation re-bills at cache-WRITE cost every fan-out turn,
|
|
533
|
-
* which is the dario#678 burn ("read every file" sessions draining the
|
|
534
|
-
* Max window ~10x faster than direct CC). The anchor sits exactly where
|
|
535
|
-
* the previous request's rolling breakpoint was, so the lookup hits it
|
|
536
|
-
* positionally with no walk-back.
|
|
537
|
-
*
|
|
538
|
-
* Exported for unit testing.
|
|
539
|
-
*/
|
|
540
508
|
export declare function applyCcPromptCaching(ccRequest: Record<string, unknown>, cacheControl: CacheControl): void;
|
|
541
509
|
/**
|
|
542
510
|
* Drop later tools whose exact name already appeared. Upstream rejects the
|
package/dist/cc-template.js
CHANGED
|
@@ -1446,6 +1446,13 @@ export function withForced1hBeta(beta, env = process.env) {
|
|
|
1446
1446
|
*
|
|
1447
1447
|
* Exported for unit testing.
|
|
1448
1448
|
*/
|
|
1449
|
+
/**
|
|
1450
|
+
* A text block upstream treats as empty. `cache_control` on one of these is a
|
|
1451
|
+
* hard 400, so breakpoint placement must skip them.
|
|
1452
|
+
*/
|
|
1453
|
+
function isEmptyTextBlock(block) {
|
|
1454
|
+
return block?.type === 'text' && (typeof block.text !== 'string' || block.text === '');
|
|
1455
|
+
}
|
|
1449
1456
|
export function applyCcPromptCaching(ccRequest, cacheControl) {
|
|
1450
1457
|
// Tools — strip any stray client breakpoints (they'd count against the
|
|
1451
1458
|
// 4-breakpoint budget) without mutating shared element objects
|
|
@@ -1475,7 +1482,18 @@ export function applyCcPromptCaching(ccRequest, cacheControl) {
|
|
|
1475
1482
|
if (!Array.isArray(msg.content) || msg.content.length === 0)
|
|
1476
1483
|
continue;
|
|
1477
1484
|
const blocks = msg.content;
|
|
1478
|
-
|
|
1485
|
+
// Walk back past empty text blocks. Upstream rejects the whole request
|
|
1486
|
+
// with 400 "cache_control cannot be set for empty text blocks", so a
|
|
1487
|
+
// trailing empty text block would otherwise kill every request from
|
|
1488
|
+
// that turn onward (dario#1066). A turn with nothing else to stamp is
|
|
1489
|
+
// skipped rather than stamped illegally — it keeps its cache entry via
|
|
1490
|
+
// the next turn's anchor.
|
|
1491
|
+
let bi = blocks.length - 1;
|
|
1492
|
+
while (bi >= 0 && isEmptyTextBlock(blocks[bi]))
|
|
1493
|
+
bi--;
|
|
1494
|
+
if (bi < 0)
|
|
1495
|
+
continue;
|
|
1496
|
+
blocks[bi] = { ...blocks[bi], cache_control: cacheControl };
|
|
1479
1497
|
stamped++;
|
|
1480
1498
|
}
|
|
1481
1499
|
}
|
|
@@ -1659,6 +1677,32 @@ export function buildCCRequest(clientBody, billingTag, cacheControl, identity, o
|
|
|
1659
1677
|
}
|
|
1660
1678
|
}
|
|
1661
1679
|
}
|
|
1680
|
+
// ── Drop empty text blocks from history ──
|
|
1681
|
+
// Upstream rejects empty text blocks OUTRIGHT — stamped or not — and treats
|
|
1682
|
+
// whitespace-only text the same way ("messages: text content blocks must be
|
|
1683
|
+
// non-empty"; with a breakpoint on it, "cache_control cannot be set for
|
|
1684
|
+
// empty text blocks"). One such block entering the transcript mid-run
|
|
1685
|
+
// therefore killed every subsequent request of the session (dario#1066).
|
|
1686
|
+
// Filtering here fixes the REQUEST, which no breakpoint guard can: skipping
|
|
1687
|
+
// the stamp still leaves the illegal block on the wire.
|
|
1688
|
+
for (const msg of messages) {
|
|
1689
|
+
if (!Array.isArray(msg.content))
|
|
1690
|
+
continue;
|
|
1691
|
+
msg.content = msg.content.filter((b) => !(b.type === 'text' && (typeof b.text !== 'string' || b.text.trim() === '')));
|
|
1692
|
+
}
|
|
1693
|
+
// A USER turn left with no blocks is dropped — but only MID-conversation,
|
|
1694
|
+
// where the API combines the now-adjacent same-role turns and where the
|
|
1695
|
+
// #1066 session-killer lives (the empty turn sits in history, so every
|
|
1696
|
+
// later request carries it). The FINAL turn is deliberately left in place
|
|
1697
|
+
// per the dario#1033 decision below: popping it would expose the assistant
|
|
1698
|
+
// turn behind it and convert an honest "content must contain at least one
|
|
1699
|
+
// block" into a misleading prefill rejection.
|
|
1700
|
+
for (let i = messages.length - 2; i >= 0; i--) {
|
|
1701
|
+
const m = messages[i];
|
|
1702
|
+
if (m.role === 'user' && Array.isArray(m.content) && m.content.length === 0) {
|
|
1703
|
+
messages.splice(i, 1);
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1662
1706
|
// ── Drop trailing empty turns ──
|
|
1663
1707
|
// An assistant turn that was thinking-only before the strip above becomes
|
|
1664
1708
|
// content: []. Forwarding that shape makes Anthropic interpret the request
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.49",
|
|
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": {
|