ccblame 0.1.0

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/dist/cli.mjs +35 -0
  4. package/package.json +56 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rupaut98
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # ccblame
2
+
3
+ **git blame for your Claude Code spend — which subagent burned the budget?**
4
+
5
+ [![npm version](https://img.shields.io/npm/v/ccblame.svg)](https://www.npmjs.com/package/ccblame)
6
+ [![npm downloads](https://img.shields.io/npm/dm/ccblame.svg)](https://www.npmjs.com/package/ccblame)
7
+ [![CI](https://github.com/rupaut98/ccblame/actions/workflows/ci.yml/badge.svg)](https://github.com/rupaut98/ccblame/actions/workflows/ci.yml)
8
+ [![License: MIT](https://img.shields.io/npm/l/ccblame.svg)](./LICENSE)
9
+ [![Zero dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](https://github.com/rupaut98/ccblame/blob/main/package.json)
10
+
11
+ ![ccblame demo](https://raw.githubusercontent.com/rupaut98/ccblame/main/demo/demo.gif)
12
+
13
+ `ccblame` reads your local `~/.claude` transcripts and tells you *which subagent, project, and workflow* actually spent the money — not just a daily total. It runs entirely on your machine and never sends data anywhere.
14
+
15
+ ```
16
+ npx ccblame
17
+ ```
18
+
19
+ ```
20
+ $47.32 total Claude Code spend
21
+ main thread $12.05 (25%) · 38 subagents $35.27 (75%)
22
+ ▸ of which context re-priming (cache writes): $18.90 (54% of subagent spend)
23
+
24
+ # AGENT TASK MODEL IN OUT PRIME READ COST %
25
+ 1 code-reviewer audit auth module opus-4-8 4.1k 9.8k 180.0k 1.2M $6.40 18%
26
+ 2 general-purpose research pricing APIs opus-4-8 2.0k 3.1k 120.0k 890.0k $4.10 12%
27
+ 3 test-runner run and fix suite sonnet-5 8.2k 1.4k 60.0k 2.1M $2.05 6%
28
+
29
+ ────────────────────────────
30
+ subagents subtotal $35.27
31
+ ```
32
+
33
+ ## The problem
34
+
35
+ You kick off a workflow before lunch. It fans out subagents — a reviewer, a couple of researchers, a test-runner — and each of *those* spawns more. A `/loop` in one session, a scheduled task in another, a GitHub Action answering PRs. You come back and your weekly quota is halfway gone. **Which one did that?**
36
+
37
+ Here's what makes it expensive *and* invisible: **every subagent starts with a cold cache.** A cache *write* costs 1.25×–2× the base input rate; a cache *read* is ~0.1× ([prompt-caching docs](https://code.claude.com/docs/en/prompt-caching)). A subagent doesn't inherit the parent's warm cache — it re-primes context from scratch on its first turn, paying the write premium on every single spawn. Anthropic's own multi-agent research system used [~15× more tokens than chat](https://www.anthropic.com/engineering/multi-agent-research-system). The tax is real, and no tool shows you *who* paid it.
38
+
39
+ ## Why the existing tools don't answer this
40
+
41
+ They give you plenty of **totals** — and almost no **attribution**.
42
+
43
+ | | Daily/session totals | Per-model split | **Per-subagent $** | **Spawn tree** | **Re-priming tax** |
44
+ |---|:---:|:---:|:---:|:---:|:---:|
45
+ | Claude Code `/cost` | ✓ | ✓ | ✗ | ✗ | shows cache-write tokens, not as a spawn cost |
46
+ | Claude Code `/usage` | ✓ | — | flat % by *category* | ✗ | ✗ |
47
+ | statusline | ✓ | — | ✗ (can undercount subagents) | ✗ | ✗ |
48
+ | ccusage | ✓ | ✓ | ✗ | ✗ | ✗ |
49
+ | sniffly / cccost / ccost | ✓ | ✓ (some) | ✗ | ✗ | ✗ |
50
+ | **ccblame** | ✓ | ✓ | **✓** | **✓** | **✓** |
51
+
52
+ `/usage` gets closest, but it's a flat category *percentage* — no dollars, no individual agent, no tree. ccusage nails daily/session/model totals and shows cache-write tokens as a column, but never asks *which subagent* they belonged to. And this isn't Anthropic's to fix soon: the feature request **"Per-Subagent Token Usage Tracking" was closed as [not planned](https://github.com/anthropics/claude-code/issues/22625)** ("there's no way to measure how many tokens each agent consumed"). ccblame is that missing view.
53
+
54
+ ## What you get
55
+
56
+ - **Ranked table** — every subagent invocation, costliest first. `PRIME` is the re-priming tax (cache-write tokens), `READ` is the cheap cache reuse, `%` is each agent's share of subagent spend.
57
+ - **Headline** — total split into main-thread vs. subagent spend, with the pure re-priming share called out: `▸ context re-priming (cache writes): $18.90 (54% of subagent spend)`.
58
+ - **Spawn tree** (`--tree`) — the parent→child hierarchy, each node carrying its own cost *and* its subtree's, so you see which *branch* is heavy, not just which leaf.
59
+ - **Breakdowns** (`--by type | workflow | project | model | day`) — the dimensions that answer "who?".
60
+ - **Interactive drill-down** (`ccblame browse`, needs [`fzf`](https://github.com/junegunn/fzf)) — pivot through days, sessions, and agents live. No fzf? It falls back to the plain table.
61
+
62
+ ![ccblame browse — interactive drill-down](https://raw.githubusercontent.com/rupaut98/ccblame/main/demo/browse.gif)
63
+
64
+ ## Install
65
+
66
+ ```bash
67
+ npx ccblame # zero install — just run it
68
+ bunx ccblame # same, via bun
69
+ npm install -g ccblame # if you want it on PATH
70
+ ```
71
+
72
+ Needs Node ≥ 18.3. Zero runtime dependencies — the whole thing is one bundled file.
73
+
74
+ ## Usage
75
+
76
+ ```bash
77
+ ccblame # ranked subagent table + headline
78
+ ccblame --tree # spawn hierarchy with per-node cost
79
+ ccblame --by project # group by project
80
+ ccblame --by workflow --top 10 # 10 costliest workflow runs
81
+ ccblame --project payer-policies # scope to one project (substring match)
82
+ ccblame --workflow wf_abc # scope to one workflow run (prefix match)
83
+ ccblame --since 2026-06-01 # on/after a date (YYYY-MM-DD or RFC3339)
84
+ ccblame --until 2026-06-30 # on/before a date (pairs with --since)
85
+ ccblame --json # machine-readable, full dataset
86
+ ccblame browse # interactive drill-down (needs fzf)
87
+ ```
88
+
89
+ Date boundaries for `--since`/`--until` and `--by day` are **UTC**. `--top N` trims the *displayed* table only — `--json` and every total stay full-population, so the numbers reconcile with your real spend.
90
+
91
+ The dollar figures are an **estimate reconciled from your local logs** (main-thread + subagent spend always sums to the grand total), not a copy of your billed Anthropic invoice. Unpriced or unknown models are flagged loudly (`?`) and counted as `$0`, so a total is always a floor — never a silent undercount.
92
+
93
+ ## How the re-priming tax is computed
94
+
95
+ Each usage line records cache-write tokens in two TTL buckets — ephemeral 5-minute and 1-hour. ccblame sums those into `PRIME` (the write cost a spawn pays to load context) and keeps `READ` (`cacheRead`) separate. The headline prices those write tokens and reports them as a share of subagent spend — the number no other tool isolates: not "how many cache tokens," but "how much did re-priming subagents cost you."
96
+
97
+ ## Privacy
98
+
99
+ ccblame reads token-accounting and routing metadata only — usage counts, model names, ids, timestamps, and agent labels. **It never reads or emits the content of your messages, prompts, tool calls, or results.** It reads `~/.claude` (or `$CLAUDE_CONFIG_DIR`) locally and makes no network calls:
100
+
101
+ ```
102
+ Reads ~/.claude (or $CLAUDE_CONFIG_DIR) locally. Never sends data anywhere.
103
+ ```
104
+
105
+ ## JSON
106
+
107
+ `--json` emits the complete dataset for scripting:
108
+
109
+ ```json
110
+ {
111
+ "total_cost_usd": 47.32,
112
+ "main_thread_cost_usd": 12.05,
113
+ "subagent_cost_usd": 35.27,
114
+ "subagent_count": 38,
115
+ "subagents": [
116
+ {
117
+ "agent_type": "code-reviewer",
118
+ "description": "audit auth module",
119
+ "model": "claude-opus-4-8",
120
+ "project": "…",
121
+ "depth": 1,
122
+ "parent_agent_id": "…",
123
+ "tokens": { "input": 4100, "output": 9800, "cache5m": 180000, "cache1h": 0, "cacheRead": 1200000 },
124
+ "cost_usd": 6.40,
125
+ "unpriced_model": false
126
+ }
127
+ ]
128
+ }
129
+ ```
130
+
131
+ `--by <dim> --json` emits grouped output (`by`, `total_cost_usd`, `groups[]`) with the same reconciliation guarantees.
132
+
133
+ ## Development
134
+
135
+ ```bash
136
+ bun test # tests
137
+ bun run lint # biome
138
+ bun run typecheck # tsc
139
+ bun run build # tsdown → dist/cli.mjs
140
+ ```
141
+
142
+ ## License
143
+
144
+ MIT
package/dist/cli.mjs ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire as e}from"node:module";import{parseArgs as t}from"node:util";import{basename as n,join as r,resolve as i}from"node:path";import{existsSync as a,lstatSync as o,mkdtempSync as s,readFileSync as c,readdirSync as l,rmSync as u,statSync as d,writeFileSync as f}from"node:fs";import{homedir as p,tmpdir as m}from"node:os";import{spawnSync as h}from"node:child_process";var g=Object.create,_=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,ee=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,x=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),te=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=y(t),a=0,o=i.length,s;a<o;a++)s=i[a],!b.call(e,s)&&s!==n&&_(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=v(t,s))||r.enumerable});return e},ne=(e,t,n)=>(n=e==null?{}:g(ee(e)),te(t||!e||!e.__esModule?_(n,`default`,{value:e,enumerable:!0}):n,e)),S=e(import.meta.url),C=ne(x(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}))(),1);const re={_meta:{source:`LiteLLM model_prices_and_context_window.json + Anthropic pricing`,verified:`2026-06-28`,unit:`USD per million tokens`,note:`Keyed by model family; resolver matches opus/sonnet/haiku in the model id.`},fable:{input:10,output:50,cache5m:12.5,cache1h:20,cacheRead:1},opus:{input:5,output:25,cache5m:6.25,cache1h:10,cacheRead:.5},sonnet:{input:3,output:15,cache5m:3.75,cache1h:6,cacheRead:.3},haiku:{input:1,output:5,cache5m:1.25,cache1h:2,cacheRead:.1}};function ie(e){let t=e.toLowerCase();return t===`<synthetic>`?`<synthetic>`:t.includes(`fable`)||t.includes(`mythos`)?`fable`:t.includes(`opus`)?`opus`:t.includes(`sonnet`)?`sonnet`:t.includes(`haiku`)?`haiku`:null}function w(e,t,n){let r=ie(t);if(r===`<synthetic>`)return{cost:0,unpriced:!1};if(!r)return{cost:0,unpriced:!0};let i=re[r];return{cost:(e.input*i.input+e.output*i.output+e.cache5m*i.cache5m+e.cache1h*i.cache1h+e.cacheRead*i.cacheRead)/1e6*1,unpriced:!1}}const ae=e=>e.startsWith(`~`)?r(p(),e.slice(1)):e,oe=e=>{try{return d(e)}catch{return null}},T=e=>oe(e)?.isDirectory()??!1,se=e=>oe(e)?.isFile()??!1,ce=e=>{try{return o(e).isDirectory()}catch{return!1}},E=e=>{try{return l(e)}catch{return[]}},D=e=>{try{return JSON.parse(c(e,`utf8`))}catch{return null}};function le(){let e=process.env.CLAUDE_CONFIG_DIR;if(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>i(ae(e)));return[...new Set(t)]}let t=process.env.XDG_CONFIG_HOME||r(p(),`.config`);return[...new Set([r(t,`claude`),r(p(),`.claude`)])]}function ue(){let e=le().filter(e=>a(r(e,`projects`)));if(process.env.CLAUDE_CONFIG_DIR&&e.length===0)throw Error(`CLAUDE_CONFIG_DIR is set but no path contains a projects/ directory.`);return e}function de(e){for(let t of e){let e=D(r(t,`settings.json`));if(e&&typeof e.cleanupPeriodDays==`number`)return e.cleanupPeriodDays}return null}function fe(){let e=ue(),t=[],n=[],i=[];for(let a of e){let e=r(a,`projects`);if(T(e))for(let a of E(e)){let o=r(e,a);if(T(o))for(let e of E(o)){let s=r(o,e);if(e.endsWith(`.jsonl`)&&se(s)){n.push({path:s,project:a,sessionId:e.replace(/\.jsonl$/,``)});continue}let c=r(s,`subagents`);if(!T(c))continue;pe(c,a,e,t);let l=r(s,`workflows`);if(T(l))for(let e of E(l))e.startsWith(`wf_`)&&e.endsWith(`.json`)&&i.push(r(l,e))}}}return{configDirs:e,pairs:t,mainSessions:n,manifests:i,cleanupPeriodDays:de(e)}}function pe(e,t,n,i){for(let o of E(e)){let s=r(e,o);if(ce(s)){pe(s,t,n,i);continue}if(!o.startsWith(`agent-`)||!o.endsWith(`.meta.json`))continue;let c=o.slice(6,-10),l=r(e,`agent-${c}.jsonl`);a(l)&&i.push({metaPath:s,jsonlPath:l,project:t,sessionId:n,agentId:c})}}function me(){return{input:0,output:0,cache5m:0,cache1h:0,cacheRead:0}}function he(e,t){e.input+=t.input,e.output+=t.output,e.cache5m+=t.cache5m,e.cache1h+=t.cache1h,e.cacheRead+=t.cacheRead}function O(e){return e.input+e.output+e.cache5m+e.cache1h+e.cacheRead}const ge=/^\d+\.\d+\.\d+$/,k=e=>typeof e==`number`&&Number.isFinite(e)?e:0,A=e=>typeof e==`string`?e:null,j=e=>{try{return c(e,`utf8`).split(`
3
+ `)}catch{return[]}},M=e=>{try{return JSON.parse(e)}catch{return}};function N(e){let t=[];for(let n of j(e)){if(!n.includes(`"usage":{`))continue;let e=M(n);if(e?.type!==`assistant`)continue;let r=e.message,i=r?.usage;if(!i||typeof i!=`object`)continue;let a=r.id,o=e.requestId;if(typeof a!=`string`||a===``||typeof o!=`string`||o===``||e.version!=null&&!ge.test(String(e.version)))continue;let s=Date.parse(e.timestamp);if(Number.isNaN(s))continue;let c=A(r.model);if(!c)continue;let l=i.cache_creation??{},u={input:k(i.input_tokens),output:k(i.output_tokens),cache5m:k(l.ephemeral_5m_input_tokens),cache1h:k(l.ephemeral_1h_input_tokens),cacheRead:k(i.cache_read_input_tokens)};u.cache5m===0&&u.cache1h===0&&(u.cache5m=k(i.cache_creation_input_tokens)),t.push({msgId:a,requestId:o,model:c,isSidechain:e.isSidechain===!0,fast:e.speed===`fast`||i.speed===`fast`,ts:s,usage:u,slug:A(e.slug),attributionAgent:A(e.attributionAgent)})}return t}function P(e){let t=new Map;for(let n of e){let e=`${n.msgId} ${n.requestId}`,r=t.get(e);(!r||_e(n,r))&&t.set(e,n)}return[...t.values()]}function _e(e,t){if(e.isSidechain!==t.isSidechain)return!e.isSidechain;let n=O(e.usage),r=O(t.usage);return n===r?e.fast===t.fast?!1:e.fast:n>r}function F(e){let t=[];for(let n of j(e)){if(!n.includes(`"tool_use"`)||!n.includes(`"Agent"`)&&!n.includes(`"Task"`))continue;let e=M(n)?.message?.content;if(Array.isArray(e))for(let n of e)n?.type===`tool_use`&&(n.name===`Agent`||n.name===`Task`)&&typeof n.id==`string`&&t.push(n.id)}return t}const I=e=>e.replace(/^-+/,``).split(`-`).slice(-2).join(`-`)||e;function ve(e){let t=new Map;for(let r of e){let e=D(r);if(!e)continue;let i=n(r).replace(/\.json$/,``),a=typeof e.workflowName==`string`?e.workflowName:null;for(let n of e.workflowProgress??[])n?.type!==`workflow_agent`||typeof n.agentId!=`string`||t.set(n.agentId,{workflowId:i,workflowName:a,label:typeof n.label==`string`?n.label:``})}return t}function ye(e=fe()){let{pairs:t,mainSessions:n,cleanupPeriodDays:r,configDirs:i}=e,a=new Map;for(let e of n)for(let t of F(e.path))a.set(t,null);for(let e of t)for(let t of F(e.jsonlPath))a.set(t,e.agentId);let o=ve(e.manifests),s=new Set,c=[];for(let e of t){let t=D(e.metaPath)??{},n=L(P(N(e.jsonlPath)),s);if(!n)continue;let r=typeof t.toolUseId==`string`?t.toolUseId:null,i=o.get(e.agentId);c.push({kind:`subagent`,agentId:e.agentId,agentType:t.agentType||n.first.attributionAgent||`‹unknown agent›`,description:i?.label||t.description||``,toolUseId:r,parentAgentId:r?a.get(r)??null:null,depth:1,sessionId:e.sessionId,project:e.project,projectLabel:I(e.project),workflowId:i?.workflowId??null,workflowName:i?.workflowName??null,...R(n)})}for(let e of n){let t=L(P(N(e.path)),s);t&&c.push({kind:`main`,agentId:`main:${e.sessionId}`,agentType:`(main thread)`,description:e.sessionId.slice(0,8),toolUseId:null,parentAgentId:null,depth:0,sessionId:e.sessionId,project:e.project,projectLabel:I(e.project),workflowId:null,workflowName:null,...R(t)})}return be(c),{invocations:c,cleanupPeriodDays:r,unpricedModels:s,configDirs:i}}function L(e,t){if(e.length===0)return null;let n=me(),r=new Map,i=0,a=!1,o=1/0;for(let s of e){he(n,s.usage);let e=w(s.usage,s.model,s.fast);i+=e.cost,e.unpriced&&(a=!0,t.add(s.model)),r.set(s.model,(r.get(s.model)??0)+O(s.usage)),o=Math.min(o,s.ts)}let s=[...r.entries()].sort((e,t)=>t[1]-e[1])[0]?.[0]??`unknown`;return{tokens:n,cost:i,model:s,unpricedModel:a,startedAt:o,first:e[0]}}function R(e){return{slug:e.first.slug,model:e.model,startedAt:e.startedAt,tokens:e.tokens,cost:e.cost,unpricedModel:e.unpricedModel}}function be(e){let t=new Map(e.map(e=>[e.agentId,e])),n=(e,r)=>{if(!e.parentAgentId||r.has(e.agentId))return 1;let i=t.get(e.parentAgentId);return i?(r.add(e.agentId),n(i,r)+1):1};for(let t of e)t.depth=n(t,new Set)}function z(e,t){let n=new Map;for(let r of e){let[e,i]=t(r),a=n.get(e);a||(a={key:e,label:i,cost:0,mainCost:0,subCost:0,count:0,subCount:0,tokens:me(),unpriced:!1},n.set(e,a)),a.cost+=r.cost,r.kind===`main`?a.mainCost+=r.cost:(a.subCost+=r.cost,a.subCount+=1),a.count+=1,he(a.tokens,r.tokens),a.unpriced||=r.unpricedModel}return[...n.values()].sort((e,t)=>t.cost-e.cost)}const B=e=>new Date(e).toISOString().slice(0,10),xe=e=>[B(e.startedAt),B(e.startedAt)],Se=e=>[e.agentType,e.agentType],Ce=e=>[e.project,e.projectLabel],we=e=>[e.model,e.model],Te=e=>[e.workflowId??``,e.workflowName?`${e.workflowName} · ${(e.workflowId??``).slice(0,9)}`:e.workflowId??``],Ee=e=>z(e,Se),De=e=>z(e,xe),Oe=e=>z(e,Ce),ke=e=>z(e,we),Ae=e=>z(e.filter(e=>e.workflowId),Te);function je(e){let t=new Map(e.map(e=>[e.agentId,{inv:e,children:[],subtreeCost:0}])),n=[];for(let e of t.values()){let r=e.inv.parentAgentId,i=r?t.get(r):void 0;i?i.children.push(e):n.push(e)}let r=e=>(e.subtreeCost=e.inv.cost+e.children.reduce((e,t)=>e+r(t),0),e.children.sort((e,t)=>t.subtreeCost-e.subtreeCost),e.subtreeCost);for(let e of n)r(e);return n.sort((e,t)=>t.subtreeCost-e.subtreeCost)}var V=x(((e,t)=>{let n=[],r=0,i=(e,t)=>{r>=t&&n.push(e)};i.WARN=1,i.INFO=2,i.DEBUG=3,i.reset=()=>{n=[]},i.setDebugLevel=e=>{r=e},i.warn=e=>i(e,i.WARN),i.info=e=>i(e,i.INFO),i.debug=e=>i(e,i.DEBUG),i.debugMessages=()=>n,t.exports=i})),Me=x(((e,t)=>{t.exports=({onlyFirst:e=!1}={})=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}})),Ne=x(((e,t)=>{let n=Me();t.exports=e=>typeof e==`string`?e.replace(n(),``):e})),Pe=x(((e,t)=>{let n=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);t.exports=n,t.exports.default=n})),Fe=x(((e,t)=>{t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}})),Ie=x(((e,t)=>{let n=Ne(),r=Pe(),i=Fe(),a=e=>{if(typeof e!=`string`||e.length===0||(e=n(e),e.length===0))return 0;e=e.replace(i(),` `);let t=0;for(let n=0;n<e.length;n++){let i=e.codePointAt(n);i<=31||i>=127&&i<=159||i>=768&&i<=879||(i>65535&&n++,t+=r(i)?2:1)}return t};t.exports=a,t.exports.default=a})),Le=x(((e,t)=>{let n=Ie();function r(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function i(e){let t=r();return(``+e).replace(t,``).split(`
4
+ `).reduce(function(e,t){return n(t)>e?n(t):e},0)}function a(e,t){return Array(t+1).join(e)}function o(e,t,n,r){let o=i(e);if(t+1>=o){let i=t-o;switch(r){case`right`:e=a(n,i)+e;break;case`center`:{let t=Math.ceil(i/2);e=a(n,i-t)+e+a(n,t);break}default:e+=a(n,i);break}}return e}let s={};function c(e,t,n){t=`\x1B[`+t+`m`,n=`\x1B[`+n+`m`,s[t]={set:e,to:!0},s[n]={set:e,to:!1},s[e]={on:t,off:n}}c(`bold`,1,22),c(`italics`,3,23),c(`underline`,4,24),c(`inverse`,7,27),c(`strikethrough`,9,29);function l(e,t){let n=t[1]?parseInt(t[1].split(`;`)[0]):0;if(n>=30&&n<=39||n>=90&&n<=97){e.lastForegroundAdded=t[0];return}if(n>=40&&n<=49||n>=100&&n<=107){e.lastBackgroundAdded=t[0];return}if(n===0){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];return}let r=s[t[0]];r&&(e[r.set]=r.to)}function u(e){let t=r(!0),n=t.exec(e),i={};for(;n!==null;)l(i,n),n=t.exec(e);return i}function d(e,t){let n=e.lastBackgroundAdded,r=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(n){e[n]&&(t+=s[n].off)}),n&&n!=`\x1B[49m`&&(t+=`\x1B[49m`),r&&r!=`\x1B[39m`&&(t+=`\x1B[39m`),t}function f(e,t){let n=e.lastBackgroundAdded,r=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(n){e[n]&&(t=s[n].on+t)}),n&&n!=`\x1B[49m`&&(t=n+t),r&&r!=`\x1B[39m`&&(t=r+t),t}function p(e,t){if(e.length===i(e))return e.substr(0,t);for(;i(e)>t;)e=e.slice(0,-1);return e}function m(e,t){let n=r(!0),a=e.split(r()),o=0,s=0,c=``,u,f={};for(;s<t;){u=n.exec(e);let r=a[o];if(o++,s+i(r)>t&&(r=p(r,t-s)),c+=r,s+=i(r),s<t){if(!u)break;c+=u[0],l(f,u)}}return d(f,c)}function h(e,t,n){if(n||=`…`,i(e)<=t)return e;t-=i(n);let r=m(e,t);r+=n;let a=`\x1B]8;;\x07`;return e.includes(a)&&!r.includes(a)&&(r+=a),r}function g(){return{chars:{top:`─`,"top-mid":`┬`,"top-left":`┌`,"top-right":`┐`,bottom:`─`,"bottom-mid":`┴`,"bottom-left":`└`,"bottom-right":`┘`,left:`│`,"left-mid":`├`,mid:`─`,"mid-mid":`┼`,right:`│`,"right-mid":`┤`,middle:`│`},truncate:`…`,colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:[`red`],border:[`grey`],compact:!1},head:[]}}function _(e,t){e||={},t||=g();let n=Object.assign({},t,e);return n.chars=Object.assign({},t.chars,e.chars),n.style=Object.assign({},t.style,e.style),n}function v(e,t){let n=[],r=t.split(/(\s+)/g),a=[],o=0,s;for(let t=0;t<r.length;t+=2){let c=r[t],l=o+i(c);o>0&&s&&(l+=s.length),l>e?(o!==0&&n.push(a.join(``)),a=[c],o=i(c)):(a.push(s||``,c),o=l),s=r[t+1]}return o&&n.push(a.join(``)),n}function y(e,t){let n=[],r=``;function i(t,i){for(r.length&&i&&(r+=i),r+=t;r.length>e;)n.push(r.slice(0,e)),r=r.slice(e)}let a=t.split(/(\s+)/g);for(let e=0;e<a.length;e+=2)i(a[e],e&&a[e-1]);return r.length&&n.push(r),n}function ee(e,t,n=!0){let r=[];t=t.split(`
5
+ `);let i=n?v:y;for(let n=0;n<t.length;n++)r.push.apply(r,i(e,t[n]));return r}function b(e){let t={},n=[];for(let r=0;r<e.length;r++){let i=f(t,e[r]);t=u(i);let a=Object.assign({},t);n.push(d(a,i))}return n}function x(e,t){return[`\x1B]`,`8`,`;`,`;`,e||t,`\x07`,t,`\x1B]`,`8`,`;`,`;`,`\x07`].join(``)}t.exports={strlen:i,repeat:a,pad:o,truncate:h,mergeOptions:_,wordWrap:ee,colorizeLines:b,hyperlink:x}})),Re=x(((e,t)=>{var n={};t.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(e){var t=r[e],i=n[e]=[];i.open=`\x1B[`+t[0]+`m`,i.close=`\x1B[`+t[1]+`m`})})),ze=x(((e,t)=>{t.exports=function(e,t){t||=process.argv;var n=t.indexOf(`--`),r=/^-{1,2}/.test(e)?``:`--`,i=t.indexOf(r+e);return i!==-1&&(n===-1?!0:i<n)}})),Be=x(((e,t)=>{var n=S(`os`),r=ze(),i=process.env,a=void 0;r(`no-color`)||r(`no-colors`)||r(`color=false`)?a=!1:(r(`color`)||r(`colors`)||r(`color=true`)||r(`color=always`))&&(a=!0),`FORCE_COLOR`in i&&(a=i.FORCE_COLOR.length===0||parseInt(i.FORCE_COLOR,10)!==0);function o(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(e){if(a===!1)return 0;if(r(`color=16m`)||r(`color=full`)||r(`color=truecolor`))return 3;if(r(`color=256`))return 2;if(e&&!e.isTTY&&a!==!0)return 0;var t=+!!a;if(process.platform===`win32`){var o=n.release().split(`.`);return Number(process.versions.node.split(`.`)[0])>=8&&Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if(`CI`in i)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`].some(function(e){return e in i})||i.CI_NAME===`codeship`?1:t;if(`TEAMCITY_VERSION`in i)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION);if(`TERM_PROGRAM`in i){var s=parseInt((i.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(i.TERM_PROGRAM){case`iTerm.app`:return s>=3?3:2;case`Hyper`:return 3;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||`COLORTERM`in i?1:(i.TERM,t)}function c(e){return o(s(e))}t.exports={supportsColor:c,stdout:c(process.stdout),stderr:c(process.stderr)}})),Ve=x(((e,t)=>{t.exports=function(e,t){var n=``;e||=`Run the trap, drop the bass`,e=e.split(``);var r={a:[`@`,`Ą`,`Ⱥ`,`Ʌ`,`Δ`,`Λ`,`Д`],b:[`ß`,`Ɓ`,`Ƀ`,`ɮ`,`β`,`฿`],c:[`©`,`Ȼ`,`Ͼ`],d:[`Ð`,`Ɗ`,`Ԁ`,`ԁ`,`Ԃ`,`ԃ`],e:[`Ë`,`ĕ`,`Ǝ`,`ɘ`,`Σ`,`ξ`,`Ҽ`,`੬`],f:[`Ӻ`],g:[`ɢ`],h:[`Ħ`,`ƕ`,`Ң`,`Һ`,`Ӈ`,`Ԋ`],i:[`༏`],j:[`Ĵ`],k:[`ĸ`,`Ҡ`,`Ӄ`,`Ԟ`],l:[`Ĺ`],m:[`ʍ`,`Ӎ`,`ӎ`,`Ԡ`,`ԡ`,`൩`],n:[`Ñ`,`ŋ`,`Ɲ`,`Ͷ`,`Π`,`Ҋ`],o:[`Ø`,`õ`,`ø`,`Ǿ`,`ʘ`,`Ѻ`,`ם`,`۝`,`๏`],p:[`Ƿ`,`Ҏ`],q:[`্`],r:[`®`,`Ʀ`,`Ȑ`,`Ɍ`,`ʀ`,`Я`],s:[`§`,`Ϟ`,`ϟ`,`Ϩ`],t:[`Ł`,`Ŧ`,`ͳ`],u:[`Ʊ`,`Ս`],v:[`ט`],w:[`Ш`,`Ѡ`,`Ѽ`,`൰`],x:[`Ҳ`,`Ӿ`,`Ӽ`,`ӽ`],y:[`¥`,`Ұ`,`Ӌ`],z:[`Ƶ`,`ɀ`]};return e.forEach(function(e){e=e.toLowerCase();var t=r[e]||[` `],i=Math.floor(Math.random()*t.length);r[e]===void 0?n+=e:n+=r[e][i]}),n}})),He=x(((e,t)=>{t.exports=function(e,t){e||=` he is here `;var n={up:`̍.̎.̄.̅.̿.̑.̆.̐.͒.͗.͑.̇.̈.̊.͂.̓.̈.͊.͋.͌.̃.̂.̌.͐.̀.́.̋.̏.̒.̓.̔.̽.̉.ͣ.ͤ.ͥ.ͦ.ͧ.ͨ.ͩ.ͪ.ͫ.ͬ.ͭ.ͮ.ͯ.̾.͛.͆.̚`.split(`.`),down:`̖.̗.̘.̙.̜.̝.̞.̟.̠.̤.̥.̦.̩.̪.̫.̬.̭.̮.̯.̰.̱.̲.̳.̹.̺.̻.̼.ͅ.͇.͈.͉.͍.͎.͓.͔.͕.͖.͙.͚.̣`.split(`.`),mid:[`̕`,`̛`,`̀`,`́`,`͘`,`̡`,`̢`,`̧`,`̨`,`̴`,`̵`,`̶`,`͜`,`͝`,`͞`,`͟`,`͠`,`͢`,`̸`,`̷`,`͡`,` ҉`]},r=[].concat(n.up,n.down,n.mid);function i(e){return Math.floor(Math.random()*e)}function a(e){var t=!1;return r.filter(function(n){t=n===e}),t}function o(e,t){var r=``,o,s;for(s in t||={},t.up=t.up===void 0?!0:t.up,t.mid=t.mid===void 0?!0:t.mid,t.down=t.down===void 0?!0:t.down,t.size=t.size===void 0?`maxi`:t.size,e=e.split(``),e)if(!a(s)){switch(r+=e[s],o={up:0,down:0,mid:0},t.size){case`mini`:o.up=i(8),o.mid=i(2),o.down=i(8);break;case`maxi`:o.up=i(16)+3,o.mid=i(4)+1,o.down=i(64)+3;break;default:o.up=i(8)+1,o.mid=i(6)/2,o.down=i(8)+1;break}var c=[`up`,`mid`,`down`];for(var l in c)for(var u=c[l],d=0;d<=o[u];d++)t[u]&&(r+=n[u][i(n[u].length)])}return r}return o(e,t)}})),Ue=x(((e,t)=>{t.exports=function(e){return function(t,n,r){if(t===` `)return t;switch(n%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}})),We=x(((e,t)=>{t.exports=function(e){return function(t,n,r){return n%2==0?t:e.inverse(t)}}})),Ge=x(((e,t)=>{t.exports=function(e){var t=[`red`,`yellow`,`green`,`blue`,`magenta`];return function(n,r,i){return n===` `?n:e[t[r++%t.length]](n)}}})),Ke=x(((e,t)=>{t.exports=function(e){var t=[`underline`,`inverse`,`grey`,`yellow`,`red`,`green`,`blue`,`white`,`cyan`,`magenta`,`brightYellow`,`brightRed`,`brightGreen`,`brightBlue`,`brightWhite`,`brightCyan`,`brightMagenta`];return function(n,r,i){return n===` `?n:e[t[Math.round(Math.random()*(t.length-2))]](n)}}})),qe=x(((e,t)=>{var n={};t.exports=n,n.themes={};var r=S(`util`),i=n.styles=Re(),a=Object.defineProperties,o=new RegExp(/[\r\n]+/g);n.supportsColor=Be().supportsColor,n.enabled===void 0&&(n.enabled=n.supportsColor()!==!1),n.enable=function(){n.enabled=!0},n.disable=function(){n.enabled=!1},n.stripColors=n.strip=function(e){return(``+e).replace(/\x1B\[\d+m/g,``)},n.stylize=function(e,t){if(!n.enabled)return e+``;var r=i[t];return!r&&t in n?n[t](e):r.open+e+r.close};var s=/[|\\{}()[\]^$+*?.]/g,c=function(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(s,`\\$&`)};function l(e){var t=function e(){return f.apply(e,arguments)};return t._styles=e,t.__proto__=d,t}var u=(function(){var e={};return i.grey=i.gray,Object.keys(i).forEach(function(t){i[t].closeRe=new RegExp(c(i[t].close),`g`),e[t]={get:function(){return l(this._styles.concat(t))}}}),e})(),d=a(function(){},u);function f(){var e=Array.prototype.slice.call(arguments).map(function(e){return e!=null&&e.constructor===String?e:r.inspect(e)}).join(` `);if(!n.enabled||!e)return e;for(var t=e.indexOf(`
6
+ `)!=-1,a=this._styles,s=a.length;s--;){var c=i[a[s]];e=c.open+e.replace(c.closeRe,c.open)+c.close,t&&(e=e.replace(o,function(e){return c.close+e+c.open}))}return e}n.setTheme=function(e){if(typeof e==`string`){console.log(`colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));`);return}for(var t in e)(function(t){n[t]=function(r){if(typeof e[t]==`object`){var i=r;for(var a in e[t])i=n[e[t][a]](i);return i}return n[e[t]](r)}})(t)};function p(){var e={};return Object.keys(u).forEach(function(t){e[t]={get:function(){return l([t])}}}),e}var m=function(e,t){var n=t.split(``);return n=n.map(e),n.join(``)};for(var h in n.trap=Ve(),n.zalgo=He(),n.maps={},n.maps.america=Ue()(n),n.maps.zebra=We()(n),n.maps.rainbow=Ge()(n),n.maps.random=Ke()(n),n.maps)(function(e){n[e]=function(t){return m(n.maps[e],t)}})(h);a(n,p())})),Je=x(((e,t)=>{t.exports=qe()})),Ye=x(((e,t)=>{let{info:n,debug:r}=V(),i=Le();var a=class e{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){[`boolean`,`number`,`bigint`,`string`].indexOf(typeof e)!==-1&&(e={content:``+e}),e||={},this.options=e;let t=e.content;if([`boolean`,`number`,`bigint`,`string`].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||``;else throw Error(`Content needs to be a primitive, got: `+typeof t);this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let n=this.options.chars||{},r=e.chars,a=this.chars={};f.forEach(function(e){l(n,r,e,a)}),this.truncate=this.options.truncate||e.truncate;let o=this.options.style=this.options.style||{},s=e.style;l(o,s,`padding-left`,this),l(o,s,`padding-right`,this),this.head=o.head||s.head,this.border=o.border||s.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=i.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:n=t}=this.options;if(this.fixedWidth&&n){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let t=1;for(;t<this.colSpan;)this.fixedWidth+=e.colWidths[this.x+t],t++}let{wrapOnWordBoundary:t=!0}=e,{wrapOnWordBoundary:n=t}=this.options;return this.wrapLines(i.wordWrap(this.fixedWidth,this.content,n))}return this.wrapLines(this.content.split(`
7
+ `))}wrapLines(e){let t=i.colorizeLines(e);return this.href?t.map(e=>i.hyperlink(this.href,e)):t}init(e){let t=this.x,n=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(n,n+this.rowSpan),this.width=this.widths.reduce(d,-1),this.height=this.heights.reduce(d,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[n],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e==`top`)return this.drawTop(this.drawRight);if(e==`bottom`)return this.drawBottom(this.drawRight);let r=i.truncate(this.content,10,this.truncate);e||n(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${r}`);let a=Math.max(this.height-this.lines.length,0),o;switch(this.vAlign){case`center`:o=Math.ceil(a/2);break;case`bottom`:o=a;break;default:o=0}if(e<o||e>=o+this.lines.length)return this.drawEmpty(this.drawRight,t);let s=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-o,this.drawRight,s,t)}drawTop(e){let t=[];return this.cells?this.widths.forEach(function(e,n){t.push(this._topLeftChar(n)),t.push(i.repeat(this.chars[this.y==0?`top`:`mid`],e))},this):(t.push(this._topLeftChar(0)),t.push(i.repeat(this.chars[this.y==0?`top`:`mid`],this.width))),e&&t.push(this.chars[this.y==0?`topRight`:`rightMid`]),this.wrapWithStyleColors(`border`,t.join(``))}_topLeftChar(t){let n=this.x+t,r;if(this.y==0)r=n==0?`topLeft`:t==0?`topMid`:`top`;else if(n==0)r=`leftMid`;else if(r=t==0?`midMid`:`bottomMid`,this.cells&&(this.cells[this.y-1][n]instanceof e.ColSpanCell&&(r=t==0?`topMid`:`mid`),t==0)){let t=1;for(;this.cells[this.y][n-t]instanceof e.ColSpanCell;)t++;this.cells[this.y][n-t]instanceof e.RowSpanCell&&(r=`leftMid`)}return this.chars[r]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let n=Je();for(let t=this[e].length-1;t>=0;t--)n=n[this[e][t]];return n(t)}catch{return t}else return t}drawLine(e,t,n,r){let a=this.chars[this.x==0?`left`:`middle`];if(this.x&&r&&this.cells){let e=this.cells[this.y+r][this.x-1];for(;e instanceof o;)e=this.cells[e.y][e.x-1];e instanceof s||(a=this.chars.rightMid)}let c=i.repeat(` `,this.paddingLeft),l=t?this.chars.right:``,u=i.repeat(` `,this.paddingRight),d=this.lines[e],f=this.width-(this.paddingLeft+this.paddingRight);n&&(d+=this.truncate||`…`);let p=i.truncate(d,f,this.truncate);return p=i.pad(p,f,` `,this.hAlign),p=c+p+u,this.stylizeLine(a,p,l)}stylizeLine(e,t,n){return e=this.wrapWithStyleColors(`border`,e),n=this.wrapWithStyleColors(`border`,n),this.y===0&&(t=this.wrapWithStyleColors(`head`,t)),e+t+n}drawBottom(e){let t=this.chars[this.x==0?`bottomLeft`:`bottomMid`],n=i.repeat(this.chars.bottom,this.width),r=e?this.chars.bottomRight:``;return this.wrapWithStyleColors(`border`,t+n+r)}drawEmpty(e,t){let n=this.chars[this.x==0?`left`:`middle`];if(this.x&&t&&this.cells){let e=this.cells[this.y+t][this.x-1];for(;e instanceof o;)e=this.cells[e.y][e.x-1];e instanceof s||(n=this.chars.rightMid)}let r=e?this.chars.right:``,a=i.repeat(` `,this.width);return this.stylizeLine(n,a,r)}},o=class{constructor(){}draw(e){return typeof e==`number`&&r(`${this.y}-${this.x}: 1x1 ColSpanCell`),``}init(){}mergeTableOptions(){}},s=class{constructor(e){this.originalCell=e}init(e){let t=this.y,n=this.originalCell.y;this.cellOffset=t-n,this.offset=u(e.rowHeights,n,this.cellOffset)}draw(e){return e==`top`?this.originalCell.draw(this.offset,this.cellOffset):e==`bottom`?this.originalCell.draw(`bottom`):(r(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e))}mergeTableOptions(){}};function c(...e){return e.filter(e=>e!=null).shift()}function l(e,t,n,r){let i=n.split(`-`);i.length>1?(i[1]=i[1].charAt(0).toUpperCase()+i[1].substr(1),i=i.join(``),r[i]=c(e[i],e[n],t[i],t[n])):r[n]=c(e[n],t[n])}function u(e,t,n){let r=e[t];for(let i=1;i<n;i++)r+=1+e[t+i];return r}function d(e,t){return e+t+1}let f=[`top`,`top-mid`,`top-left`,`top-right`,`bottom`,`bottom-mid`,`bottom-left`,`bottom-right`,`left`,`left-mid`,`mid`,`mid-mid`,`right`,`right-mid`,`middle`];t.exports=a,t.exports.ColSpanCell=o,t.exports.RowSpanCell=s})),Xe=x(((e,t)=>{let{warn:n,debug:r}=V(),i=Ye(),{ColSpanCell:a,RowSpanCell:o}=i;(function(){function e(t,n){return t[n]>0?e(t,n+1):n}function c(t){let n={};t.forEach(function(t,r){let i=0;t.forEach(function(t){t.y=r,t.x=r?e(n,i):i;let a=t.rowSpan||1,o=t.colSpan||1;if(a>1)for(let e=0;e<o;e++)n[t.x+e]=a;i=t.x+o}),Object.keys(n).forEach(e=>{n[e]--,n[e]<1&&delete n[e]})})}function l(e){let t=0;return e.forEach(function(e){e.forEach(function(e){t=Math.max(t,e.x+(e.colSpan||1))})}),t}function u(e){return e.length}function d(e,t){let n=e.y,r=e.y-1+(e.rowSpan||1),i=t.y,a=!(n>t.y-1+(t.rowSpan||1)||i>r),o=e.x,s=e.x-1+(e.colSpan||1),c=t.x,l=!(o>t.x-1+(t.colSpan||1)||c>s);return a&&l}function f(e,t,n){let r=Math.min(e.length-1,n),i={x:t,y:n};for(let t=0;t<=r;t++){let n=e[t];for(let e=0;e<n.length;e++)if(d(i,n[e]))return!0}return!1}function p(e,t,n,r){for(let i=n;i<r;i++)if(f(e,i,t))return!1;return!0}function m(e){e.forEach(function(t,n){t.forEach(function(t){for(let r=1;r<t.rowSpan;r++){let i=new o(t);i.x=t.x,i.y=t.y+r,i.colSpan=t.colSpan,g(i,e[n+r])}})})}function h(e){for(let t=e.length-1;t>=0;t--){let n=e[t];for(let e=0;e<n.length;e++){let t=n[e];for(let r=1;r<t.colSpan;r++){let i=new a;i.x=t.x+r,i.y=t.y,n.splice(e+1,0,i)}}}}function g(e,t){let n=0;for(;n<t.length&&t[n].x<e.x;)n++;t.splice(n,0,e)}function _(e){let t=u(e),a=l(e);r(`Max rows: ${t}; Max cols: ${a}`);for(let r=0;r<t;r++)for(let o=0;o<a;o++)if(!f(e,o,r)){let s={x:o,y:r,colSpan:1,rowSpan:1};for(o++;o<a&&!f(e,o,r);)s.colSpan++,o++;let c=r+1;for(;c<t&&p(e,c,s.x,s.x+s.colSpan);)s.rowSpan++,c++;let l=new i(s);l.x=s.x,l.y=s.y,n(`Missing cell at ${l.y}-${l.x}.`),g(l,e[r])}}function v(e){return e.map(function(e){if(!Array.isArray(e)){let t=Object.keys(e)[0];e=e[t],Array.isArray(e)?(e=e.slice(),e.unshift(t)):e=[t,e]}return e.map(function(e){return new i(e)})})}function y(e){let t=v(e);return c(t),_(t),m(t),h(t),t}t.exports={makeTableLayout:y,layoutTable:c,addRowSpanCells:m,maxWidth:l,fillInTable:_,computeWidths:s(`colSpan`,`desiredWidth`,`x`,1),computeHeights:s(`rowSpan`,`desiredHeight`,`y`,1)}})();function s(e,t,n,r){return function(i,a){let o=[],s=[],c={};a.forEach(function(i){i.forEach(function(i){(i[e]||1)>1?s.push(i):o[i[n]]=Math.max(o[i[n]]||0,i[t]||0,r)})}),i.forEach(function(e,t){typeof e==`number`&&(o[t]=e)});for(let r=s.length-1;r>=0;r--){let a=s[r],l=a[e],u=a[n],d=o[u],f=typeof i[u]==`number`?0:1;if(typeof d==`number`)for(let e=1;e<l;e++)d+=1+o[u+e],typeof i[u+e]!=`number`&&f++;else d=t===`desiredWidth`?a.desiredWidth-1:1,(!c[u]||c[u]<d)&&(c[u]=d);if(a[t]>d){let e=0;for(;f>0&&a[t]>d;){if(typeof i[u+e]!=`number`){let n=Math.round((a[t]-d)/f);d+=n,o[u+e]+=n,f--}e++}}}Object.assign(i,o,c);for(let e=0;e<i.length;e++)i[e]=Math.max(r,i[e]||0)}}})),Ze=x(((e,t)=>{let n=V(),r=Le(),i=Xe();var a=class extends Array{constructor(e){super();let t=r.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case`boolean`:n.setDebugLevel(n.WARN);break;case`number`:n.setDebugLevel(t.debug);break;case`string`:n.setDebugLevel(parseInt(t.debug,10));break;default:n.setDebugLevel(n.WARN),n.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return n.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;t?(e=[this.options.head],this.length&&e.push.apply(e,this)):this.options.style.head=[];let n=i.makeTableLayout(e);n.forEach(function(e){e.forEach(function(e){e.mergeTableOptions(this.options,n)},this)},this),i.computeWidths(this.options.colWidths,n),i.computeHeights(this.options.rowHeights,n),n.forEach(function(e){e.forEach(function(e){e.init(this.options)},this)},this);let r=[];for(let e=0;e<n.length;e++){let i=n[e],a=this.options.rowHeights[e];(e===0||!this.options.style.compact||e==1&&t)&&o(i,`top`,r);for(let e=0;e<a;e++)o(i,e,r);e+1==n.length&&o(i,`bottom`,r)}return r.join(`
8
+ `)}get width(){return this.toString().split(`
9
+ `)[0].length}};a.reset=()=>n.reset();function o(e,t,n){let r=[];e.forEach(function(e){r.push(e.draw(t))});let i=r.join(``);i.length&&n.push(i)}t.exports=a})),Qe=ne(x(((e,t)=>{t.exports=Ze()}))(),1);const H=(process.stdout.columns??100)>=100,U=e=>`$${e.toFixed(2)}`;function W(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}const G=(e,t)=>t>0?`${Math.round(e/t*100)}%`:`0%`,K=e=>e.replace(/^claude-/,``).replace(/-\d{8}$/,``);function q(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n}const $e=e=>e.tokens.cache5m+e.tokens.cache1h,et=e=>e.unpricedModel?C.default.red(`?`):``;function tt(e,t){let n=new Qe.default({head:(H?[`#`,`AGENT`,`TASK`,`MODEL`,`IN`,`OUT`,`PRIME`,`READ`,`COST`,`%`]:[`#`,`AGENT`,`TASK`,`COST`,`%`]).map(e=>C.default.dim(e)),style:{head:[],border:[]},colAligns:H?[`right`,`left`,`left`,`left`,`right`,`right`,`right`,`right`,`right`,`right`]:[`right`,`left`,`left`,`right`,`right`]});return e.forEach((e,r)=>{let i=H?[K(e.model),W(e.tokens.input),W(e.tokens.output),W($e(e)),W(e.tokens.cacheRead)]:[],a=[String(r+1),e.agentType+et(e),q(e.description,H?30:24),...i,U(e.cost),G(e.cost,t)];n.push(r===0?a.map((e,t)=>t===0?e:C.default.bold(C.default.yellow(e))):a)}),n.toString()}function nt(e,t,n,r,i){let a=[`${C.default.bold(C.default.green(U(e)))} ${C.default.dim(`total Claude Code spend`)}`,` ${C.default.dim(`main thread`)} ${C.default.bold(U(t))} ${C.default.dim(`(${G(t,e)})`)} ${C.default.dim(`·`)} ${C.default.bold(`${r} subagent${r===1?``:`s`}`)} ${C.default.bold(U(n))} ${C.default.dim(`(${G(n,e)})`)}`];return n>0&&a.push(`${C.default.yellow(`▸`)} ${C.default.dim(`of which context re-priming (cache writes):`)} ${C.default.bold(U(i))} ${C.default.dim(`(${G(i,n)} of subagent spend)`)}`),a.join(`
10
+ `)}function rt(e,t,n,r){let i;i=r?H?[n,`SUBAGENTS`,`TOKENS`,`MAIN`,`SUB`,`TOTAL`,`%`]:[n,`SUB`,`TOTAL`]:[n,`COUNT`,`TOKENS`,`COST`,`AVG`,`%`];let a=i.map((e,t)=>t===0?`left`:`right`),o=new Qe.default({head:i.map(e=>C.default.dim(e)),style:{head:[],border:[]},colAligns:a});for(let n of e){let e=n.label+(n.unpriced?C.default.red(` ?`):``),i=C.default.bold(C.default.green(U(n.subCost))),a=C.default.bold(U(n.cost));r?H?o.push([e,String(n.subCount),W(O(n.tokens)),C.default.dim(U(n.mainCost)),i,a,G(n.cost,t)]):o.push([e,i,a]):o.push([e,String(n.count),W(O(n.tokens)),a,C.default.dim(U(n.cost/n.count)),G(n.cost,t)])}return o.toString()}function it(e,t){let n=[],r=(e,i,a,o)=>{let s=o?``:a?`└─ `:`├─ `,c=e.inv,l=`${C.default.bold(c.agentType)}${c.description?C.default.dim(` "${q(c.description,32)}"`):``}`,u=U(c.cost),d=e.children.length>0?C.default.dim(` [subtree ${U(e.subtreeCost)}]`):``;n.push(`${C.default.dim(i+s)}${l} ${C.default.dim(K(c.model))} ${C.default.bold(u)} ${C.default.dim(`(${G(c.cost,t)})`)}${d}`);let f=i+(o?``:a?` `:`│ `);e.children.forEach((t,n)=>{r(t,f,n===e.children.length-1,!1)})};return e.forEach((t,n)=>{r(t,``,n===e.length-1,!0)}),n.join(`
11
+ `)}function J(e,t){return`${C.default.dim(`─`.repeat(28))}\n${C.default.dim(e)} ${C.default.bold(C.default.green(U(t)))}`}function at(e,t,n){return{by:e,total_cost_usd:t,groups:n.map(e=>({key:e.key,label:e.label,cost_usd:e.cost,main_cost_usd:e.mainCost,subagent_cost_usd:e.subCost,count:e.count,subagent_count:e.subCount,unpriced:e.unpriced}))}}function ot(e,t,n){return{total_cost_usd:t+n,main_thread_cost_usd:t,subagent_cost_usd:n,subagent_count:e.length,subagents:e.map(e=>({agent_id:e.agentId,agent_type:e.agentType,description:e.description,slug:e.slug,model:e.model,session_id:e.sessionId,project:e.project,depth:e.depth,parent_agent_id:e.parentAgentId,started_at:new Date(e.startedAt).toISOString(),tokens:e.tokens,cost_usd:e.cost,unpriced_model:e.unpricedModel}))}}const Y=e=>w({input:0,output:0,cache5m:e.tokens.cache5m,cache1h:e.tokens.cache1h,cacheRead:0},e.model,!1).cost;function st(e,t,n=`cost`){let r=new Map;for(let n of e){let[e,i]=t(n),a=r.get(e);a||(a={key:e,label:i,invs:[],cost:0,prime:0},r.set(e,a)),a.invs.push(n),a.cost+=n.cost,a.prime+=Y(n)}let i=[...r.values()];return i.sort(n===`tax`?(e,t)=>t.prime/(t.cost||1)-e.prime/(e.cost||1):(e,t)=>t.cost-e.cost),i}function ct(e,t,n,r=10){if(n<=0)return C.default.dim(`░`.repeat(r));let i=Math.min(r,Math.max(+(e>0),Math.round(e/n*r))),a=Math.min(i,e>0?Math.round(t/e*i):0);return C.default.yellow(`█`.repeat(a))+C.default.green(`█`.repeat(i-a))+C.default.dim(`░`.repeat(r-i))}const lt=(e,t)=>`${C.default.yellow(`▸`)} ${C.default.dim(`context re-priming:`)} ${C.default.bold(U(t))} ${C.default.dim(`(${G(t,e)} of ${U(e)})`)}`,ut=e=>`${lt(e.cost,e.prime)}\n\n${rt(Ee(e.invs),e.cost,`AGENT TYPE`,!1)}`,dt=e=>{let t=[...e.invs].sort((e,t)=>t.cost-e.cost);return`${lt(e.cost,e.prime)}\n\n${tt(t,e.cost)}\n${J(`session subtotal`,e.cost)}`},ft=(e,t)=>`${ct(e.cost,e.prime,t)} ${q(e.label,22).padEnd(22)} ${U(e.cost).padStart(9)} ${String(e.invs.length).padStart(4)} sub ${C.default.yellow(G(e.prime,e.cost).padStart(4))}`,pt=(e,t)=>{let n=Math.min(...e.invs.map(e=>e.startedAt));return`${ct(e.cost,e.prime,t)} ${B(n)} ${e.key.slice(0,8)} ${U(e.cost).padStart(9)} ${String(e.invs.length).padStart(3)} sub ${C.default.yellow(G(e.prime,e.cost).padStart(4))}`},X=[{col:`projects`,keyFn:e=>[e.project,e.projectLabel]},{col:`days`,keyFn:e=>[B(e.startedAt),B(e.startedAt)]},{col:`agent types`,keyFn:e=>[e.agentType,e.agentType]},{col:`models`,keyFn:e=>[e.model,K(e.model)]},{col:`workflows`,keyFn:e=>[e.workflowId??``,e.workflowName??e.workflowId??``],filter:e=>!!e.workflowId}],mt=e=>e?.code===`ENOENT`;function Z(e){let t=e.rows.map(e=>`${e.key}\t${e.display}`).join(`
12
+ `),n=h(`fzf`,[`--delimiter= `,`--with-nth=2`,`--ansi`,`--no-sort`,`--prompt=${e.prompt}`,`--header=${e.header}`,`--expect=${e.pivotable?`ctrl-t,ctrl-s`:`ctrl-s`}`,`--bind=ctrl-o:toggle-preview,ctrl-/:toggle-preview,ctrl-_:toggle-preview`,`--bind=ctrl-w:change-preview-window(down,65%,wrap|right,55%,wrap|hidden)`,`--bind=ctrl-y:execute-silent(printf %s {1} | pbcopy 2>/dev/null || printf %s {1} | xclip -selection clipboard 2>/dev/null || printf %s {1} | wl-copy 2>/dev/null)`,`--preview`,`cat "${r(e.dir,e.prefix)}{n}" 2>/dev/null`,`--preview-window=down,65%,wrap`],{input:t,stdio:[`pipe`,`pipe`,`inherit`],encoding:`utf8`});if(mt(n.error))return{fzfMissing:!0};if(n.status!==0)return{key:null};let[i=``,a=``]=(n.stdout??``).split(`
13
+ `),o=i.trim();return o===`ctrl-t`?{action:`pivot`}:o===`ctrl-s`?{action:`sort`}:{key:a.split(` `)[0]||null}}function ht(){return process.stderr.write("browse needs fzf on PATH (e.g. `brew install fzf`) — showing the table instead.\n"),!1}function gt(e){return mt(h(`less`,[`-R`],{input:e,stdio:[`pipe`,`inherit`,`inherit`]}).error)?(process.stdout.write(`${e}\n`),!1):!0}function _t(e){if(e.length===0)return process.stdout.write("No subagent spend in this data — run `ccblame` for the main-thread breakdown.\n"),!0;let t=e.reduce((e,t)=>e+t.cost,0),n=e.reduce((e,t)=>e+Y(t),0),i=`${C.default.bold(C.default.green(U(t)))} ${C.default.dim(`subagent spend`)} · ${C.default.yellow(`${G(n,t)} re-priming tax`)}`,a=s(r(m(),`ccblame-`)),o=0,c=`cost`,l=e=>`${i} ${C.default.dim(`[sort: ${c===`tax`?`tax%`:`cost`}]`)}\n${C.default.dim(e)}`,d=e=>{for(;;){let t=st(e.invs,e=>[e.sessionId,e.sessionId],c),n=Math.max(0,...t.map(e=>e.cost)),i=t.map(e=>dt(e));t.forEach((e,t)=>{f(r(a,`sess-${t}`),i[t])});let o=Z({rows:t.map(e=>({key:e.key,display:pt(e,n)})),dir:a,prefix:`sess-`,prompt:`ccblame ▸ ${q(e.label,18)} ▸ `,header:l(`enter: full table · esc: back · ^s: sort · ^y: copy id · ^o: preview`),pivotable:!1});if(`fzfMissing`in o)return`missing`;if(`action`in o){c=c===`cost`?`tax`:`cost`;continue}if(o.key===null)return`back`;let s=t.findIndex(e=>e.key===o.key);if(s>=0&&!gt(i[s]))return`quit`}};try{for(;;){let t=X[o],n=st(t.filter?e.filter(t.filter):e,t.keyFn,c),i=Math.max(0,...n.map(e=>e.cost));n.forEach((e,t)=>{f(r(a,`grp-${t}`),ut(e))});let s=Z({rows:n.map(e=>({key:e.key,display:ft(e,i)})),dir:a,prefix:`grp-`,prompt:`ccblame ▸ ${t.col} ▸ `,header:l(`enter: drill · esc: quit · ^t: pivot · ^s: sort · ^y: copy · ^o: preview`),pivotable:!0});if(`fzfMissing`in s)return ht();if(`action`in s){if(s.action===`pivot`)do o=(o+1)%X.length;while(X[o].filter&&e.filter(X[o].filter).length===0);else c=c===`cost`?`tax`:`cost`;continue}if(s.key===null)return!0;let u=n.find(e=>e.key===s.key);if(u){let e=d(u);if(e===`missing`)return ht();if(e===`quit`)return!0}}}finally{u(a,{recursive:!0,force:!0})}}function vt(e,t){let n=Date.parse(e);return Number.isNaN(n)?null:t&&/^\d{4}-\d{2}-\d{2}$/.test(e)?n+864e5-1:n}function yt(e,t){let n=e;if(typeof t.session==`string`){let e=t.session;n=n.filter(t=>t.sessionId.startsWith(e))}if(typeof t.workflow==`string`){let e=t.workflow;n=n.filter(t=>t.workflowId?.startsWith(e))}if(typeof t.project==`string`){let e=t.project.toLowerCase();n=n.filter(t=>t.project.toLowerCase().includes(e)||t.projectLabel.toLowerCase().includes(e))}if(typeof t.since==`string`){let e=vt(t.since,!1);e===null&&Q(`invalid --since date: ${t.since}`),n=n.filter(t=>t.startedAt>=e)}if(typeof t.until==`string`){let e=vt(t.until,!0);e===null&&Q(`invalid --until date: ${t.until}`),n=n.filter(t=>t.startedAt<=e)}return n}function Q(e){process.stderr.write(`${C.default.red(`error`)}: ${e}\n`),process.exit(1)}function bt(e,t){if(typeof t!=`string`)return e;let n=Number.parseInt(t,10);return(Number.isNaN(n)||n<=0)&&Q(`invalid --top: ${t}`),e.slice(0,n)}function $(e,t){e.unpricedModels.size>0&&t.write(`${C.default.yellow(`⚠`)} no pricing for ${[...e.unpricedModels].join(`, `)} — ${C.default.dim(`marked ? ; their cost is counted as $0, so totals are a floor`)}\n`);let n=e.cleanupPeriodDays;n!==null&&n<3650&&t.write(`${C.default.dim(`note: Claude Code keeps transcripts ~${n} days (cleanupPeriodDays); older history is gone. Raise it in ~/.claude/settings.json (e.g. 3650) to keep more.`)}\n`)}function xt(){let e;try{e=t({allowPositionals:!0,options:{by:{type:`string`},tree:{type:`boolean`},session:{type:`string`},workflow:{type:`string`},project:{type:`string`},since:{type:`string`},until:{type:`string`},top:{type:`string`},json:{type:`boolean`},help:{type:`boolean`,short:`h`},version:{type:`boolean`,short:`v`}}})}catch(e){Q(e.message)}let n=e.values,r=e.positionals[0];if(n.help)return void console.log(`ccblame — git blame for your Claude Code spend; which subagent burned the budget?
14
+
15
+ Usage
16
+ ccblame [command] [options]
17
+
18
+ Commands
19
+ (default) ranked table of subagent invocations, costliest first
20
+ browse interactive subagent drill-down (needs fzf)
21
+
22
+ Options
23
+ --by <dim> aggregate by: type | workflow | project | model | day
24
+ --tree show the spawn hierarchy with per-node cost
25
+ --session <id> scope to one session (prefix match)
26
+ --workflow <id> scope to one workflow run (prefix match)
27
+ --project <name> scope to a project (substring match)
28
+ --since <date> only invocations on/after (YYYY-MM-DD or RFC3339; day boundaries are UTC)
29
+ --until <date> only invocations on/before
30
+ --top <n> show only the N costliest
31
+ --json machine-readable output
32
+ -h, --help this help
33
+ -v, --version print version
34
+
35
+ Reads ~/.claude (or $CLAUDE_CONFIG_DIR) locally. Never sends data anywhere.`);if(n.version)return void console.log(`0.1.0`);let i;try{i=ye()}catch(e){Q(e.message)}let a=yt(i.invocations,n),o=a.filter(e=>e.kind===`subagent`).sort((e,t)=>t.cost-e.cost),s=a.reduce((e,t)=>t.kind===`main`?e+t.cost:e,0),c=o.reduce((e,t)=>e+t.cost,0),l=s+c,u=process.stdout;if(a.length===0){if(n.json)return void u.write(`${JSON.stringify(ot([],0,0),null,2)}\n`);let e=i.configDirs.length?i.configDirs:le();u.write(`${C.default.yellow(`No Claude Code usage found.`)}\nLooked in: ${e.map(e=>`${e}/projects`).join(`, `)}\n`),$(i,u);return}if(r===`browse`&&_t(o))return;let d=n.by;if(d){let e={type:{group:()=>Ee(a),col:`AGENT TYPE`,split:!1},workflow:{group:()=>Ae(a),col:`WORKFLOW`,split:!1},project:{group:()=>Oe(a),col:`PROJECT`,split:!0},model:{group:()=>ke(a),col:`MODEL`,split:!0},day:{group:()=>De(a).sort((e,t)=>e.key.localeCompare(t.key)),col:`DAY`,split:!0}}[d];if(!e)return void Q(`unknown --by dimension: ${d} (use type | workflow | project | model | day)`);let t=e.group(),r=t.reduce((e,t)=>e+t.cost,0),o=bt(t,n.top);if(n.json){u.write(`${JSON.stringify(at(d,r,t),null,2)}\n`);return}if(o.length===0){u.write(`${C.default.dim(`no ${d} data found in range.`)}\n`),$(i,u);return}u.write(`${rt(o,r,e.col,e.split)}\n${J(`TOTAL`,r)}\n`),$(i,u);return}if(n.json){u.write(`${JSON.stringify(ot(o,s,c),null,2)}\n`);return}let f=o.reduce((e,t)=>e+Y(t),0),p=nt(l,s,c,o.length,f);if(n.tree){u.write(`${p}\n\n${it(je(o),l)}\n`),$(i,u);return}let m=n.top?bt(o,n.top):o.slice(0,St(o.length)),h=o.length-m.length;u.write(`${p}\n\n${tt(m,c)}\n${J(`subagents subtotal`,c)}\n`),h>0&&u.write(C.default.dim(`showing top ${m.length} of ${o.length} subagents — --top N · --by day · browse\n`)),$(i,u)}function St(e){return process.stdout.isTTY?Math.max((process.stdout.rows??40)-12,10):e}xt();export{};
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "ccblame",
3
+ "version": "0.1.0",
4
+ "description": "git blame for your Claude Code spend — which subagent burned the budget?",
5
+ "type": "module",
6
+ "bin": {
7
+ "ccblame": "dist/cli.mjs"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "provenance": true
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18.3"
18
+ },
19
+ "scripts": {
20
+ "build": "tsdown",
21
+ "dev": "bun src/cli.ts",
22
+ "test": "bun test",
23
+ "lint": "biome check src test",
24
+ "format": "biome check --write src test",
25
+ "typecheck": "tsc --noEmit",
26
+ "prepublishOnly": "bun run build"
27
+ },
28
+ "keywords": [
29
+ "claude",
30
+ "claude-code",
31
+ "subagent",
32
+ "cost",
33
+ "tokens",
34
+ "usage",
35
+ "ccusage",
36
+ "cli"
37
+ ],
38
+ "license": "MIT",
39
+ "author": "rupaut98",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/rupaut98/ccblame.git"
43
+ },
44
+ "homepage": "https://github.com/rupaut98/ccblame#readme",
45
+ "bugs": "https://github.com/rupaut98/ccblame/issues",
46
+ "dependencies": {},
47
+ "devDependencies": {
48
+ "@biomejs/biome": "^2.4.0",
49
+ "@types/bun": "^1.3.0",
50
+ "@types/node": "^22.10.0",
51
+ "cli-table3": "^0.6.5",
52
+ "picocolors": "^1.1.1",
53
+ "tsdown": "^0.22.0",
54
+ "typescript": "^5.7.2"
55
+ }
56
+ }