@askalf/dario
Advanced tools
+24
-0
@@ -67,2 +67,26 @@ /** | ||
| /** | ||
| * One-line per-request usage summary for verbose (-v / -vv) logs. | ||
| * | ||
| * dario already parses `input_tokens` / `cache_read_input_tokens` / | ||
| * `cache_creation_input_tokens` off every response into analytics and the | ||
| * `--log-file`, but never printed them to the console — so anyone debugging | ||
| * subscription burn (dario#678) only ever saw the request body and the | ||
| * billing *bucket*, never the cache accounting that actually governs cost. | ||
| * This surfaces it next to the existing `billing:` line so a plain `-vv` | ||
| * capture is self-diagnosing. | ||
| * | ||
| * `cachedPct` = cache_read / (input + cache_read + cache_create): the share of | ||
| * *prompt* tokens served from cache rather than freshly billed. On a repeated | ||
| * prompt a LOW value means the prefix is being re-created (a >5-minute gap | ||
| * expired the 5m TTL, or the cached prefix changed) — the exact signal the | ||
| * cache-TTL discussion turns on. Output tokens are excluded from the ratio | ||
| * (they are never cacheable). Pure + total-zero-safe for unit testing. | ||
| */ | ||
| export declare function formatUsageLogLine(requestCount: number, u: { | ||
| inputTokens?: number; | ||
| outputTokens?: number; | ||
| cacheReadTokens?: number; | ||
| cacheCreateTokens?: number; | ||
| }): string; | ||
| /** | ||
| * The sentinel `claim` dario assigns when a response carried no rate-limit | ||
@@ -69,0 +93,0 @@ * header at all (non-200s, stream aborts, early rejects — see `pool.ts` |
+27
-0
@@ -66,2 +66,29 @@ /** | ||
| /** | ||
| * One-line per-request usage summary for verbose (-v / -vv) logs. | ||
| * | ||
| * dario already parses `input_tokens` / `cache_read_input_tokens` / | ||
| * `cache_creation_input_tokens` off every response into analytics and the | ||
| * `--log-file`, but never printed them to the console — so anyone debugging | ||
| * subscription burn (dario#678) only ever saw the request body and the | ||
| * billing *bucket*, never the cache accounting that actually governs cost. | ||
| * This surfaces it next to the existing `billing:` line so a plain `-vv` | ||
| * capture is self-diagnosing. | ||
| * | ||
| * `cachedPct` = cache_read / (input + cache_read + cache_create): the share of | ||
| * *prompt* tokens served from cache rather than freshly billed. On a repeated | ||
| * prompt a LOW value means the prefix is being re-created (a >5-minute gap | ||
| * expired the 5m TTL, or the cached prefix changed) — the exact signal the | ||
| * cache-TTL discussion turns on. Output tokens are excluded from the ratio | ||
| * (they are never cacheable). Pure + total-zero-safe for unit testing. | ||
| */ | ||
| export function formatUsageLogLine(requestCount, u) { | ||
| const inp = u.inputTokens ?? 0; | ||
| const out = u.outputTokens ?? 0; | ||
| const cr = u.cacheReadTokens ?? 0; | ||
| const cc = u.cacheCreateTokens ?? 0; | ||
| const promptTotal = inp + cr + cc; | ||
| const pct = promptTotal > 0 ? Math.round((cr / promptTotal) * 100) : 0; | ||
| return `[dario] #${requestCount} usage: in=${inp} out=${out} cache_read=${cr} cache_create=${cc} (${pct}% of prompt from cache)`; | ||
| } | ||
| /** | ||
| * The sentinel `claim` dario assigns when a response carried no rate-limit | ||
@@ -68,0 +95,0 @@ * header at all (non-200s, stream aborts, early rejects — see `pool.ts` |
+1
-1
| { | ||
| "name": "@askalf/dario", | ||
| "version": "5.2.2", | ||
| "version": "5.2.3", | ||
| "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,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is too big to display
AI-detected potential malware
Supply chain riskAI has identified this package as malware. This is a strong signal that the package may be malicious.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential malware
Supply chain riskAI has identified this package as malware. This is a strong signal that the package may be malicious.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1375955
0.23%26653
0.22%