wrapped-agents 1.1.0 → 1.2.1

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/SKILL.md CHANGED
@@ -12,23 +12,25 @@ Build the user's year with AI coding agents, wrapped. All numbers come from the
12
12
  Run, in a terminal (read-only over the user's agent logs; writes only to the temp folder):
13
13
 
14
14
  ```bash
15
- npx -y wrapped-agents@1.1.0 --json --no-open
15
+ npx -y wrapped-agents@1.2.1 --json --no-open
16
16
  ```
17
17
 
18
18
  It prints the path of `wrapped-<year>.json`. Before running, tell the user in one sentence: it reads their local agent logs (~/.claude, ~/.codex, Cursor, ~/.gemini, ~/.qwen, OpenCode, ~/.pi, ~/.vibe) read-only and nothing about their usage leaves the machine.
19
19
 
20
- No Node? Use the first that exists: `bunx wrapped-agents@1.1.0 --json --no-open` · `deno run -A npm:wrapped-agents@1.1.0 --json --no-open` · or `git clone --depth 1 --branch v1.1.0 https://github.com/LeonardoDaviti/agent-wrapped "$TMPDIR/agent-wrapped" && node "$TMPDIR/agent-wrapped/src/cli.mjs" --json --no-open`. If none works, say so and point to https://leonardodaviti.github.io/agent-wrapped.
20
+ No Node? Use the first that exists: `bunx wrapped-agents@1.2.1 --json --no-open` · `deno run -A npm:wrapped-agents@1.2.1 --json --no-open` · or `git clone --depth 1 --branch v1.2.1 https://github.com/LeonardoDaviti/agent-wrapped "$TMPDIR/agent-wrapped" && node "$TMPDIR/agent-wrapped/src/cli.mjs" --json --no-open`. If none works, say so and point to https://leonardodaviti.github.io/agent-wrapped.
21
21
 
22
22
  If a sandbox blocks reading a folder, ask the user once for read access; otherwise continue and mention which harness was skipped.
23
23
 
24
24
  ## 2 · Write the roast
25
25
 
26
26
  From the printed `wrapped-<year>.json` only, write one roast line: ≤ 12 words, citing a number copied exactly from it; roast habits, never the person, no project names.
27
+ Also write one funny line for the tokens slide: pick a work from `compare.options`, use its `times` exactly, and land the punchline on one of the user's real quirks from the file (please ×, Esc ×, "you're right" ×, top one-word prompt, busiest day); savage, specific, ≤ 16 words.
28
+ Also write one playful guess at what happened on `busiest.date` (≤ 20 words).
27
29
 
28
30
  ## 3 · Render and open
29
31
 
30
32
  ```bash
31
- npx -y wrapped-agents@1.1.0 --from "<path to wrapped-<year>.json>" --roast "<your line>" --roast-by "<your harness, e.g. Claude Code>"
33
+ npx -y wrapped-agents@1.2.1 --from "<path to wrapped-<year>.json>" --roast "<your line>" --quip "<your tokens line>" --day "<your busiest-day guess>" --roast-by "<your harness, e.g. Claude Code>"
32
34
  ```
33
35
 
34
36
  If `handle.github` in the file is null, ask the user for their GitHub username first and add `--handle <name>`. If they ask for a different look, add `--skin <wrapped|anthropic|claude-code|codex|opencode|pi|hermes|mistral-vibe|yours>` (default: their most-used harness and its own theme).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrapped-agents",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Your year with AI coding agents, wrapped. Claude Code, Codex, Cursor, Gemini CLI, Qwen Code, OpenCode, Pi, Mistral Vibe. Runs locally; your usage data never leaves your machine.",
5
5
  "type": "module",
6
6
  "bin": {
package/page/story.html CHANGED
@@ -11,7 +11,11 @@ html{background:#070707}
11
11
  body{color:var(--fg);font-family:var(--body);-webkit-font-smoothing:antialiased;overscroll-behavior-y:none}
12
12
  button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
13
13
  /* ---------- the stage: one 9:16 frame ---------- */
14
- #stage{position:relative;height:100vh;height:100dvh;display:grid;place-items:center;overflow:hidden;background:radial-gradient(60% 55% at 50% 42%,color-mix(in srgb,var(--li) 16%,transparent),transparent 70%),#070707}
14
+ #stage{position:relative;height:100vh;height:100dvh;display:grid;place-items:center;overflow:hidden;isolation:isolate}
15
+ /* the world behind the frame: the skin's own background, blurred and dimmed, lit by its accents (never part of an export) */
16
+ #stage::before{content:"";position:absolute;inset:-90px;z-index:-2;transform:translateZ(0);filter:blur(44px) saturate(1.35) brightness(var(--wdim,.6));background:radial-gradient(44% 54% at 14% 20%,color-mix(in srgb,var(--li) 55%,transparent),transparent 72%),radial-gradient(48% 58% at 88% 82%,color-mix(in srgb,var(--pk) 50%,transparent),transparent 72%),radial-gradient(38% 42% at 78% 8%,color-mix(in srgb,var(--lv) 34%,transparent),transparent 72%),var(--bg)}
17
+ #stage::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(80% 90% at 50% 50%,transparent 40%,#0008)}
18
+ #stage.full::before,#stage.full::after{display:none}
15
19
  #frame{position:relative;overflow:hidden;background:var(--bg);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:pan-y;-webkit-tap-highlight-color:transparent;contain:layout paint}
16
20
  #frame.boxed{border-radius:22px;box-shadow:0 40px 120px #000a,0 0 0 1px #ffffff14}
17
21
  #view{position:absolute;left:0;top:0;transform-origin:0 0}
@@ -23,10 +27,14 @@ button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webki
23
27
  #b-save{right:12px}
24
28
  #toast{position:absolute;z-index:7;left:50%;bottom:22px;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:var(--pp);color:var(--opp);font:600 14px/1 var(--fm);padding:12px 16px;border-radius:99px;white-space:nowrap;transition:opacity .25s,transform .35s cubic-bezier(.2,.9,.3,1.2)}
25
29
  #toast.on{opacity:1;transform:translate(-50%,0)}
26
- .nav{position:absolute;top:50%;width:52px;height:52px;margin-top:-26px;border-radius:50%;display:grid;place-items:center;color:#fff;background:#ffffff12;opacity:.55;transition:opacity .2s,background .2s}
27
- .nav:hover{opacity:1;background:#ffffff24}.nav svg{width:22px;height:22px}
30
+ .nav{position:absolute;top:50%;width:52px;height:52px;margin-top:-26px;border-radius:50%;display:grid;place-items:center;color:#fff;background:#00000059;box-shadow:inset 0 0 0 1px #ffffff26;opacity:.8;transition:opacity .2s,background .2s}
31
+ .nav:hover{opacity:1;background:#000000a6}.nav svg{width:22px;height:22px}
28
32
  .nav[hidden]{display:none}
29
- #cue{position:absolute;bottom:10px;left:50%;margin-left:-14px;width:28px;height:28px;color:#fff;opacity:.35}
33
+ #cue{position:absolute;bottom:10px;left:50%;margin-left:-14px;width:28px;height:28px;color:#fff;opacity:.6;filter:drop-shadow(0 1px 2px #000c)}
34
+ button:focus-visible{outline:3px solid var(--chrome,var(--fg));outline-offset:3px}
35
+ .nav:focus-visible,.wbar button:focus-visible{outline-color:#fff;opacity:1}
36
+ .slide button:focus-visible{outline:7px solid var(--fg);outline-offset:6px}
37
+ html.embed,html.embed body{overflow:hidden;height:100%}html.embed #report,html.embed #cue,html.embed [data-act=report]{display:none!important}
30
38
  /* ---------- slides: 1080 wide, 1920+ tall, scaled into the frame ---------- */
31
39
  .slide{position:absolute;inset:0;overflow:hidden;background:var(--bg);color:var(--fg);display:flex;flex-direction:column;padding:104px 44px 44px;font-family:var(--body);font-variant-numeric:tabular-nums;-webkit-font-smoothing:antialiased;text-rendering:geometricPrecision}
32
40
  .slide.x{padding-top:60px}
@@ -43,16 +51,17 @@ button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webki
43
51
  .lab{font-size:30px;opacity:.62}
44
52
  .pill{display:inline-block;border-radius:99px;padding:14px 28px;font-size:30px;background:var(--pp);color:var(--opp);white-space:nowrap}
45
53
  .fit{white-space:nowrap}
46
- .top{flex:none;display:flex;justify-content:space-between;align-items:center;font-size:30px;margin-bottom:46px}
54
+ .top{flex:none;display:flex;justify-content:space-between;align-items:center;font-size:30px;margin-bottom:46px;padding-right:70px}
55
+ .caret{display:inline-block;width:.55em;height:1.05em;margin-left:4px;vertical-align:-.18em;background:currentColor;animation:caret 1.1s steps(1) infinite}@keyframes caret{50%{opacity:0}}
47
56
  .foot{flex:none;margin-top:auto;padding-top:34px;display:flex;justify-content:space-between;align-items:center;gap:20px}
48
57
  .gh{display:inline-flex;align-items:center;gap:12px;white-space:nowrap}
49
58
  .gh svg{fill:currentColor;flex:none}
50
59
  .logo{flex:none;border-radius:calc(var(--r) * 1.2);background:var(--lg);display:grid;grid-template-columns:repeat(5,1fr);gap:9px;padding:30px}
51
60
  .logo i{border-radius:7px}
52
- .logo{overflow:hidden}
61
+ .logo{overflow:hidden;color:var(--lgc,var(--ink))}
53
62
  .logo .lw{grid-column:1/-1;grid-row:1/-1;padding:14px;display:grid;min-width:0;min-height:0;overflow:hidden}
54
63
  .logo .lw svg,.mark svg{display:block;width:100%;height:100%;min-height:0}
55
- .mark{display:grid;place-items:center;flex:none}
64
+ .mark{display:grid;place-items:center;flex:none;color:var(--mkc,var(--fg))}
56
65
  .mark svg{width:100%;height:100%}
57
66
  .bar{display:block;height:100%;transform-origin:0 50%}
58
67
  .hl{background:var(--ink);color:var(--li);padding:0 14px;border-radius:12px;font-weight:800}
@@ -68,16 +77,22 @@ button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webki
68
77
  .heat b{flex:1;display:flex;flex-direction:column;gap:4px}
69
78
  .heat i{aspect-ratio:1;border-radius:3px;background:var(--sf)}
70
79
  /* receipt */
71
- .paper{background:var(--paper);color:#111;border-radius:6px;padding:56px 60px 80px;font:600 31px/1.45 "JetBrains Mono","Commit Mono",monospace;-webkit-mask:radial-gradient(14px at 50% 100%,#0000 98%,#000) 0 0/40px 100%;mask:radial-gradient(14px at 50% 100%,#0000 98%,#000) 0 0/40px 100%;display:flex;flex-direction:column}
80
+ .paper{background:var(--paper);color:#111;border-radius:6px;padding:50px 60px 66px;font:600 31px/1.45 "JetBrains Mono","Commit Mono",monospace;-webkit-mask:radial-gradient(14px at 50% 100%,#0000 98%,#000) 0 0/40px 100%;mask:radial-gradient(14px at 50% 100%,#0000 98%,#000) 0 0/40px 100%;display:flex;flex-direction:column}
72
81
  .paper .ln{display:flex;justify-content:space-between;gap:20px}
73
82
  .paper .sub{opacity:.55;font-size:25px;margin-bottom:10px}
74
83
  .paper hr{border:0;border-top:4px dashed #111;margin:26px 0}
84
+ /* quiz */
85
+ .qz{display:flex;align-items:center;gap:30px;width:100%;height:190px;padding:0 44px;background:var(--sf);color:var(--fg);text-align:left;transition:background .3s,color .3s,opacity .3s}
86
+ .qz .qs{opacity:0;transition:opacity .3s}
87
+ .qz.qy{background:var(--li);color:var(--ink)}.qz.qy .qs{opacity:1}
88
+ .qz.qn{opacity:.4}
75
89
  /* share controls */
76
90
  .btn{display:flex;align-items:center;justify-content:center;gap:16px;border-radius:calc(var(--r) * .7 + 10px);font-size:40px;height:118px;padding:0 34px;cursor:pointer;white-space:nowrap}
77
91
  .btn svg{width:40px;height:40px;flex:none}
78
92
  .seg3{display:flex;border-radius:99px;background:var(--sf);padding:8px;gap:6px}
79
- .seg3 button{flex:1;height:84px;border-radius:99px;font-size:30px;font-family:var(--fm);font-weight:600;letter-spacing:.04em;opacity:.7}
80
- .seg3 button[aria-pressed=true]{background:var(--fg);color:var(--bg);opacity:1}
93
+ .seg3 button{flex:1;height:84px;border-radius:99px;font-size:30px;font-family:var(--fm);font-weight:600;letter-spacing:.04em;opacity:.7;transition:opacity .2s}
94
+ .seg3 button:hover{opacity:1}
95
+ .seg3 button[aria-pressed=true]{background:var(--pp);color:var(--opp);opacity:1}
81
96
  .sw{width:64px;height:64px;border-radius:50%;flex:none;box-shadow:inset 0 0 0 3px #ffffff30}
82
97
  .sw[aria-pressed=true]{outline:5px solid var(--fg);outline-offset:6px}
83
98
  .tog{display:flex;align-items:center;gap:22px;font-size:32px}
@@ -110,7 +125,7 @@ button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webki
110
125
  .rl b{font-weight:700;min-width:140px}
111
126
  .rl span{opacity:.7}
112
127
  #host{position:fixed;left:-40000px;top:0;pointer-events:none;contain:strict}
113
- @media (prefers-reduced-motion:reduce){#toast,.tog i,.tog i::after{transition:none}}
128
+ @media (prefers-reduced-motion:reduce){.caret{animation:none}#toast,.tog i,.tog i::after,.qz,.qz .qs{transition:none}}
114
129
  </style>
115
130
  </head><body>
116
131
  <main id="stage">
@@ -131,14 +146,16 @@ button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webki
131
146
  <script>
132
147
  (() => {
133
148
  'use strict';
134
- // <qr> · QR encoder: byte mode, ECC M, versions 1–15, all 8 masks scored (ISO 18004 penalty rules)
149
+ // <qr> · QR encoder: byte mode, ECC M, versions 1–20, all 8 masks scored (ISO 18004 penalty rules)
135
150
  const QR = (() => {
136
151
  // [ecc codewords per block, [blocks, data codewords], [blocks, data codewords]?] for ECC level M
137
152
  const M = [null, [10, [1, 16]], [16, [1, 28]], [26, [1, 44]], [18, [2, 32]], [24, [2, 43]], [16, [4, 27]], [18, [4, 31]],
138
153
  [22, [2, 38], [2, 39]], [22, [3, 36], [2, 37]], [26, [4, 43], [1, 44]], [30, [1, 50], [4, 51]], [22, [6, 36], [2, 37]],
139
- [22, [8, 37], [1, 38]], [24, [4, 40], [5, 41]], [24, [5, 41], [5, 42]]];
154
+ [22, [8, 37], [1, 38]], [24, [4, 40], [5, 41]], [24, [5, 41], [5, 42]],
155
+ [28, [7, 45], [3, 46]], [28, [10, 46], [1, 47]], [26, [9, 43], [4, 44]], [26, [3, 44], [11, 45]], [26, [3, 41], [13, 42]]];
140
156
  const ALIGN = [null, [], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50],
141
- [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70]];
157
+ [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70],
158
+ [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90]];
142
159
  const EXP = new Uint8Array(512), LOG = new Uint8Array(256);
143
160
  for (let i = 0, x = 1; i < 255; i++) { EXP[i] = x; LOG[x] = i; x <<= 1; if (x & 256) x ^= 0x11d; }
144
161
  for (let i = 255; i < 512; i++) EXP[i] = EXP[i - 255];
@@ -172,11 +189,11 @@ const QR = (() => {
172
189
  }
173
190
  return p + Math.floor(Math.abs(dark * 20 - n * n * 10) / (n * n)) * 10; // rule 4
174
191
  }
175
- /** text → { version, size, mask, modules: boolean[y][x] }; throws above version 15 */
192
+ /** text → { version, size, mask, modules: boolean[y][x] }; throws above version 20 */
176
193
  function encode(text, { minVersion = 1, mask: forceMask } = {}) {
177
194
  const bytes = [...new TextEncoder().encode(text)];
178
- let v = minVersion; while (v <= 15 && capacity(v) < bytes.length) v++;
179
- if (v > 15) throw new Error(`QR payload too big: ${bytes.length} bytes > ${capacity(15)}`);
195
+ let v = minVersion; while (v <= 20 && capacity(v) < bytes.length) v++;
196
+ if (v > 20) throw new Error(`QR payload too big: ${bytes.length} bytes > ${capacity(20)}`);
180
197
  const bits = [], put = (val, len) => { for (let i = len - 1; i >= 0; i--) bits.push((val >>> i) & 1); };
181
198
  put(4, 4); put(bytes.length, v < 10 ? 8 : 16); bytes.forEach(b => put(b, 8));
182
199
  put(0, Math.min(4, dataCw(v) * 8 - bits.length)); while (bits.length % 8) bits.push(0);
@@ -250,12 +267,12 @@ if (typeof location !== 'undefined' && /[?&]embed=1/.test(location.search)) docu
250
267
  typeof addEventListener === 'function' && addEventListener('message', e => { const m = e.data; if (m && m.awSkin && window.AW && window.AW.setSkin) window.AW.setSkin(m.awSkin); });
251
268
  const SITE = 'https://leonardodaviti.github.io/agent-wrapped/', REPO = 'leonardodaviti/agent-wrapped';
252
269
  const HARNESS = { 'claude-code': 'Claude Code', codex: 'Codex', pi: 'Pi', 'mistral-vibe': 'Mistral Vibe', opencode: 'OpenCode', hermes: 'Hermes', 'gemini-cli': 'Gemini CLI', cursor: 'Cursor', copilot: 'Copilot CLI', goose: 'Goose', aider: 'Aider', cline: 'Cline' };
253
- const LABELS = { harness: 'Harness of the Year', model: 'Model of the Year', tokens: 'Tokens', spendings: 'Spendings', prompts: 'Prompts', sessions: 'Sessions', streak: 'Streak', marathon: 'Marathon', swarm: 'Swarm', peakHour: 'Peak hour', politeness: 'Politeness', backseat: 'Backseat driver', lines: 'Lines written', mostResumed: 'Most resumed', wordOfYear: 'Word of the Year', agentClass: 'Agent class', tier: 'Top X%', skill: 'Skill of the Year', rateLimits: 'Rate limits', age: 'Agentic Age', twin: 'Agent Twin', youreRight: '“You’re right”', modelRace: 'Model race', caps: 'ALL CAPS', screenshots: 'Screenshots', compactions: 'Compactions', prs: 'Shipped', ctrlZ: 'Ctrl+Z Award', roast: 'Roast' };
270
+ const LABELS = { harness: 'Harness of the Year', model: 'Model of the Year', tokens: 'Tokens', spendings: 'Spendings', prompts: 'Prompts', sessions: 'Sessions', streak: 'Streak', marathon: 'Marathon', swarm: 'Swarm', peakHour: 'Peak hour', politeness: 'Politeness', backseat: 'Backseat driver', lines: 'Lines written', mostResumed: 'Most resumed', wordOfYear: 'Word of the Year', agentClass: 'Agent class', tier: 'Top X%', skill: 'Skill of the Year', tool: 'Tool of the Year', rateLimits: 'Limits reached', age: 'Agentic Age', twin: 'Agent Twin', youreRight: '“You’re right”', modelRace: 'Model race', caps: 'ALL CAPS', screenshots: 'Screenshots', compactions: 'Compactions', prs: 'Shipped', ctrlZ: 'Ctrl+Z Award', roast: 'Roast' };
254
271
  // order in which award values ride along in the QR link (most wanted first)
255
- const QR_AWARDS = ['peakHour', 'politeness', 'backseat', 'youreRight', 'spendings', 'marathon', 'wordOfYear', 'lines', 'ctrlZ', 'prs', 'skill', 'rateLimits', 'mostResumed', 'screenshots', 'caps', 'compactions', 'modelRace'];
272
+ const QR_AWARDS = ['rateLimits', 'skill', 'peakHour', 'politeness', 'backseat', 'youreRight', 'spendings', 'marathon', 'wordOfYear', 'lines', 'ctrlZ', 'prs', 'mostResumed', 'screenshots', 'caps', 'compactions', 'modelRace', 'tool'];
256
273
 
257
- /** the compact subset that travels in the #d= fragment; drops optional fields until the QR fits (v15, ECC M) */
258
- function compact(W, maxBytes = QR.capacity(15)) {
274
+ /** the compact subset that travels in the #d= fragment; drops optional fields until the QR fits (v20, ECC M) */
275
+ function compact(W, maxBytes = QR.capacity(20)) {
259
276
  const t = W.totals || {}, aw = Object.fromEntries((W.awards || []).map(a => [a.id, a.value]));
260
277
  const base = { v: 1, y: W.year, h: W.handle?.github || W.handle?.display || '', s: W.theme?.skin || 'wrapped',
261
278
  t: [t.prompts || 0, t.sessions || 0, t.activeDays || 0, t.streak?.days || 0, Math.round((t.tokens || 0) / 1e6), Math.round((t.cacheShare || 0) * 100), t.subagents || 0] };
@@ -266,13 +283,18 @@ function compact(W, maxBytes = QR.capacity(15)) {
266
283
  o => W.tier && (o.T = [W.tier.label]),
267
284
  o => W.age?.years != null && (o.A = W.age.years),
268
285
  o => W.twin && (o.X = [W.twin.name, W.twin.match]),
286
+ o => W.models?.length > 1 && (o.M = W.models.slice(0, 3).map(m => [m.label, pc(m.share)])),
287
+ o => W.quiz?.choices?.includes(W.quiz.answer) && (o.q = [...W.quiz.choices.slice(0, 3), W.quiz.choices.indexOf(W.quiz.answer)]),
288
+ o => W.busiest?.date && (o.b = [W.busiest.date, W.busiest.prompts ?? null, W.busiest.peakHour ?? null]),
269
289
  o => W.roast && (o.r = W.roast),
270
290
  o => W.harnesses?.length > 2 && (o.H = W.harnesses.slice(0, 3).map(h => [h.id, pc(h.share)])),
271
291
  o => W.tier?.power && (o.T = [W.tier.label, W.tier.power]),
272
- o => W.models?.length > 1 && (o.M = W.models.slice(0, 3).map(m => [m.label, pc(m.share)])),
292
+ o => W.compare?.text && (o.c = W.compare.text),
293
+ o => W.busiest?.date && W.dayLine && (o.b = [W.busiest.date, W.busiest.prompts ?? null, W.busiest.peakHour ?? null, W.dayLine]),
294
+ o => W.roastBy && (o.w = W.roastBy),
295
+ o => W.spendings?.usd && (o.u = [W.spendings.usd, W.spendings.perDay || 0]),
273
296
  ...QR_AWARDS.map(id => o => aw[id] && ((o.a = o.a || {})[id] = aw[id])),
274
297
  o => W.twin?.why && (o.X = [W.twin.name, W.twin.match, W.twin.why]),
275
- o => W.spendings?.usd && (o.u = [W.spendings.usd, W.spendings.perDay || 0]),
276
298
  ];
277
299
  const size = o => SITE.length + 3 + B64U.enc(JSON.stringify(o)).length;
278
300
  let o = base;
@@ -293,7 +315,9 @@ function expand(c) {
293
315
  models: (c.M || []).map(([label, s]) => ({ label, share: s / 100 })),
294
316
  series: {}, spendings: c.u ? { usd: c.u[0], perDay: c.u[1], byModel: [] } : null,
295
317
  tier: c.T ? { label: c.T[0], power: c.T[1] || '' } : null, age: c.A != null ? { years: c.A, why: [] } : null,
296
- twin: c.X ? { name: c.X[0], match: c.X[1], why: c.X[2] || '' } : null, awards, roast: c.r || null, privacy: { projectsHidden: true } };
318
+ twin: c.X ? { name: c.X[0], match: c.X[1], why: c.X[2] || '' } : null, awards, roast: c.r || null, compare: c.c ? { text: c.c } : null,
319
+ quiz: c.q ? { choices: c.q.slice(0, -1), answer: c.q[c.q.at(-1)], share: (c.M?.[0]?.[0] === c.q[c.q.at(-1)] ? c.M[0][1] : 0) / 100 } : null,
320
+ busiest: c.b ? { date: c.b[0], prompts: c.b[1], peakHour: c.b[2] } : null, dayLine: c.b?.[3] || null, roastBy: c.w || null, privacy: { projectsHidden: true } };
297
321
  }
298
322
  // </share>
299
323
 
@@ -326,12 +350,22 @@ if (W?.theme?.yours && typeof W.theme.yours === 'object') {
326
350
  const SKINS = Object.keys(SK);
327
351
  // free bundled faces stand in when a brand face is not installed (all OFL, inlined by render.mjs)
328
352
  const withFallback = v => v.replace(/(^|,)\s*Inter\b(?![^,]*")/, '$1Inter,"Mona Sans"').replace(/"JetBrains Mono"/, '"JetBrains Mono","Commit Mono"').replace(/"EB Garamond"/, '"EB Garamond",Lora');
353
+ // WCAG contrast between two CSS colours (a gradient counts as its last, solid layer); best(bg, a, b…) → the option that reads best on bg
354
+ const lum = v => { let h = (String(v || '').match(/#[0-9a-f]{3,8}\b/gi) || []).pop(); if (!h) return null; h = h.slice(1); if (h.length < 6) h = [...h].map(c => c + c).join(''); return [0, 2, 4].reduce((s, i, n) => { const c = parseInt(h.slice(i, i + 2), 16) / 255; return s + (c <= .03928 ? c / 12.92 : ((c + .055) / 1.055) ** 2.4) * [.2126, .7152, .0722][n]; }, 0); };
355
+ const contrast = (a, b) => { const x = lum(a), y = lum(b); return x == null || y == null ? 0 : (Math.max(x, y) + .05) / (Math.min(x, y) + .05); };
356
+ const best = (bg, ...opts) => opts.reduce((a, b) => contrast(b, bg) > contrast(a, bg) ? b : a);
329
357
  let skin = SK[Q.get('skin')] ? Q.get('skin') : SK[W?.theme?.skin] ? W.theme.skin : 'wrapped';
330
358
  function applySkin(name) {
331
359
  skin = SK[name] ? name : 'wrapped';
332
360
  const st = document.documentElement.style, k = SK[skin];
333
361
  TOKENS.forEach(t => st.removeProperty('--' + t));
334
362
  for (const [a, b] of Object.entries(k)) if (a !== 'logo') st.setProperty('--' + a, a === 'fd' || a === 'fm' ? withFallback(b) : b);
363
+ // derived: what a currentColor logo wears on the logo tile (--lg) and on an ink badge, and for "yours" the text on its pill / blue tile
364
+ const cs = getComputedStyle(document.documentElement), g = t => cs.getPropertyValue('--' + t).trim();
365
+ st.setProperty('--lgc', best(g('lg'), g('ink'), g('fg'))); st.setProperty('--mkc', best(g('ink'), g('fg'), g('lg')));
366
+ st.setProperty('--lit', contrast(g('li'), g('bg')) >= 2.2 ? g('li') : ['gr', 'bl', 'or', 'pk', 'lv'].map(g).find(c => contrast(c, g('bg')) >= 2.5) || g('fg')); // accent text on the slide background
367
+ st.setProperty('--wdim', lum(g('bg')) > .35 ? '.82' : '.6'); // a light skin keeps a light world
368
+ if (skin === 'yours') { k.opp || st.setProperty('--opp', best(g('pp'), g('ink'), g('fg'))); k.obl || st.setProperty('--obl', best(g('bl'), g('ink'), g('fg'))); }
335
369
  document.documentElement.dataset.skin = skin;
336
370
  }
337
371
 
@@ -365,7 +399,28 @@ const logoTile = (px = 264) => {
365
399
  };
366
400
  const top = (dark) => `<div class="top M N in"${dark ? ' style="color:var(--ink)"' : ''}><span class="gh">${GH(32)}${esc(handle())}${W.year ? `<span style="opacity:.55">· ${W.year}</span>` : ''}</span></div>`;
367
401
  const INSTALL = 'npx wrapped-agents';
368
- const foot = () => `<div class="foot"><span class="M N" style="font-size:40px;letter-spacing:0;text-transform:none;white-space:nowrap;opacity:.92">$ ${INSTALL}</span></div>`;
402
+ const CTA = () => `wrap my ${W?.year || 'year'}`;
403
+ // the call to action under every card, on one line: the hook, then the exact command in a code pill
404
+ // the CTA typed into the current skin's own agent input box (one box, one line; caret blinks live, still in exports)
405
+ const CHAT = {
406
+ 'claude-code': { box: 'border:3px solid color-mix(in srgb,currentColor 45%,transparent);border-radius:18px;padding:20px 28px', p: '<b style="opacity:.55">&gt;</b>', cmd: null },
407
+ codex: { box: 'background:color-mix(in srgb,currentColor 9%,transparent);padding:22px 28px', p: '<b>›</b>', cmd: null },
408
+ 'gemini-cli': { box: 'border:3px solid transparent;border-radius:16px;padding:20px 28px;background:linear-gradient(#0b0b0b,#0b0b0b) padding-box,linear-gradient(90deg,#4796e4,#847ace,#c3677f) border-box;color:#f3f0e8', p: '<b style="color:#847ace">&gt;</b>', cmd: '#4796e4' },
409
+ 'mistral-vibe': { box: 'border:3px solid transparent;border-radius:6px;padding:20px 28px;background:linear-gradient(#000,#000) padding-box,linear-gradient(90deg,#ffd800,#ff8205,#e10500) border-box;color:#fff', p: '<b style="color:#ff8205">&gt;</b>', cmd: '#ffd800' },
410
+ opencode: { box: 'border-left:8px solid currentColor;background:color-mix(in srgb,currentColor 8%,transparent);padding:22px 28px', p: '', cmd: null, meta: 'Build · wrapped-agents' },
411
+ pi: { box: 'border-top:3px solid currentColor;border-bottom:3px solid currentColor;padding:18px 4px', p: '', cmd: null },
412
+ cursor: { box: 'background:#1d1d1d;color:#e4e4e4;border:2px solid #343434;border-radius:22px;padding:22px 28px', p: '', cmd: '#e4e4e4', meta: 'Agent ▾ &nbsp;Auto', send: '#e4e4e4;color:#1d1d1d' },
413
+ anthropic: { box: 'background:#fff;color:#141413;border:2px solid #e3dfd5;border-radius:28px;padding:22px 28px;box-shadow:0 6px 20px rgba(0,0,0,.08)', p: '', cmd: '#c6613f', sans: 1, send: '#c6613f;color:#fff' },
414
+ };
415
+ const foot = () => {
416
+ const c = CHAT[skin === 'qwen-code' ? 'gemini-cli' : skin] || { box: 'border:3px solid currentColor;border-radius:16px;padding:20px 28px', p: '<b>❯</b>', cmd: null };
417
+ const font = c.sans ? 'font:500 34px/1.25 var(--body)' : 'font:500 31px/1.25 var(--fm)';
418
+ const text = `${CTA()} with <span style="${c.cmd ? `color:${c.cmd};` : ''}font-weight:700">${INSTALL}</span><span class="caret"${c.sans ? ' style="width:3px"' : ''}></span>`;
419
+ const send = c.send ? `<span style="flex:none;margin-left:auto;width:54px;height:54px;border-radius:${c.sans ? 14 : 99}px;display:grid;place-items:center;background:${c.send};font:700 30px/1 var(--body)">↑</span>` : '';
420
+ return `<div class="foot" style="display:block;white-space:nowrap"><div class="chat" style="${c.box};${font};letter-spacing:0;text-transform:none;text-align:left">
421
+ <div style="display:flex;align-items:center;gap:16px">${c.p ? `<span style="flex:none">${c.p}</span>` : ''}<span style="overflow:hidden;text-overflow:ellipsis">${text}</span>${c.meta ? '' : send}</div>
422
+ ${c.meta ? `<div style="display:flex;align-items:center;gap:16px;margin-top:14px;font-size:22px;opacity:.6">${c.meta}${send ? `<span style="margin-left:auto;opacity:1">${send}</span>` : ''}</div>` : ''}</div></div>`;
423
+ };
369
424
  const cnt = (v, f = 'n', to = v) => `<span data-n="${v}" data-f="${f}" data-to="${to}">${FMT[f](v, to)}</span>`;
370
425
  const COLORS = ['li', 'pk', 'lv', 'or', 'bl'];
371
426
 
@@ -376,10 +431,15 @@ const S = {};
376
431
  S.tokens = {
377
432
  ok: () => T().tokens > 0, dur: 5500, chrome: 'ink',
378
433
  html: () => {
379
- const t = T().tokens, hp = t / 1.45e6, line = hp >= 10
380
- ? `That’s every Harry Potter book, read <b class="hl">${N(+hp.toPrecision(2))}</b> times.`
381
- : `That’s <b class="hl">${N(Math.max(1, t / 1.2e5))}</b> novels’ worth of words.`;
382
- const pills = [T().cacheShare ? Math.round(T().cacheShare * 100) + '% re-read from cache' : '', T().toolCalls ? N(T().toolCalls) + ' tool calls' : ''].filter(Boolean);
434
+ // the comparison comes from the stats engine (a different work each run, counted on input + output only); old wrap files fall back to the fixed line
435
+ const t = T().tokens, hp = t / 1.45e6, cmp = typeof W.compare?.text === 'string' && W.compare.text.trim(), hl = x => `<b class="hl">${x}</b>`;
436
+ // highlight the multiple: the engine's own number when the text carries it (a title like "1984" must not win), else the number before "times", else the first one
437
+ const x2 = +(+W.compare?.times || 0).toPrecision(2), opt = cmp && (W.compare.options || []).find(o => o?.times && cmp.includes(o.work) && cmp.includes(o.times));
438
+ const want = opt ? String(opt.times) : x2 >= 100 ? N(x2) : x2 >= 10 ? x2.toFixed(0) : x2 ? x2.toFixed(1) : '', re = want && new RegExp('(?<![\\d,.])' + want.replace('.', '\\.') + '(?![\\d,])');
439
+ const line = cmp ? esc(cmp).replace(re && re.test(cmp) ? re : /\d[\d,.]*(?=\s+times)/.test(cmp) ? /\d[\d,.]*(?=\s+times)/ : /\d[\d,.]*\d|\d/, hl)
440
+ : hp >= 10 ? `That’s every Harry Potter book, read ${hl(N(+hp.toPrecision(2)))} times.`
441
+ : `That’s ${hl(N(Math.max(1, t / 1.2e5)))} novels’ worth of words.`;
442
+ const pills = [T().toolCalls ? N(T().toolCalls) + ' tool calls' : ''].filter(Boolean);
383
443
  return `<div class="slide" style="background:var(--li);color:var(--ink)">${top(1)}
384
444
  <div class="M in" style="font-size:40px">This year your agents burned</div><div class="grow"></div>
385
445
  <div class="H fit in" style="font-size:300px">${cnt(t, 'b')}</div><div class="H in" style="font-size:130px;margin-top:14px">tokens.</div>
@@ -411,6 +471,39 @@ S.harness = {
411
471
  run: el => $$('.bar', el).forEach((b, i) => grow(b, 'scaleX', 500 + i * 120)),
412
472
  };
413
473
 
474
+ // guess your #1 model: three choices, then the race is the reveal
475
+ let quizDone = false, STILL = false; // STILL: building an export, slides render their final state
476
+ S.quiz = {
477
+ ok: () => { const q = W.quiz; return Array.isArray(q?.choices) && q.choices.length > 1 && q.choices.includes(q.answer); },
478
+ dur: 8000, reset: () => { quizDone = false; }, end: () => quizReveal(),
479
+ html: () => {
480
+ const q = W.quiz, open = STATIC || STILL || quizDone, ask = String(q.question || 'Which model did you use most?');
481
+ return `<div class="slide">${top()}
482
+ <div class="M lab in">Before the reveal</div><div class="H in" style="font-size:${ask.length > 34 ? 112 : 140}px;margin-top:24px">${esc(ask)}</div>
483
+ <div class="grow" style="min-height:40px"></div>
484
+ <div class="col" style="gap:22px">${q.choices.slice(0, 3).map((c, i) => `<button class="qz tile in ctl${open ? (c === q.answer ? ' qy' : ' qn') : ''}" data-quiz="${i}"><span class="M" style="font-size:30px;opacity:.55;flex:none">${i + 1}</span><span class="H fit" style="font-size:92px;flex:1;min-width:0">${esc(c)}</span>${c === q.answer && q.share ? `<span class="M qs" style="font-size:34px;flex:none">${pct(q.share)}</span>` : ''}</button>`).join('')}</div>
485
+ <div class="M in qa" style="font-size:32px;margin-top:40px;min-height:44px">${open ? esc(quizLine()) : 'Pick one'}</div>
486
+ ${foot()}</div>`;
487
+ },
488
+ };
489
+ const quizLine = say => `${say ? say + ' ' : ''}${W.quiz.answer}${W.quiz.share ? ' · ' + pct(W.quiz.share) + ' of your tokens' : ''}`;
490
+ /** pick = the chosen label, or undefined when the countdown ran out */
491
+ function quizReveal(pick) {
492
+ const el = $('.slide.live', view), q = W.quiz;
493
+ if (!el || el.dataset.key !== 'quiz' || quizDone) return;
494
+ quizDone = true;
495
+ const motion = !STATIC && !reduced();
496
+ $$('[data-quiz]', el).forEach(b => {
497
+ const c = q.choices[+b.dataset.quiz], right = c === q.answer; b.classList.add(right ? 'qy' : 'qn');
498
+ if (!motion) return;
499
+ if (right) b.animate([{ transform: 'scale(.96)' }, { transform: 'none' }], { duration: SP.pop.ms, easing: SP.pop.easing });
500
+ else if (c === pick) b.animate([0, -24, 20, -14, 8, 0].map(x => ({ transform: `translateX(${x}px)` })), { duration: 420, easing: 'ease-out' });
501
+ });
502
+ const qa = $('.qa', el); if (qa) qa.textContent = quizLine(pick === undefined ? 'Time’s up.' : pick === q.answer ? 'You knew it.' : 'Not quite.');
503
+ if (prog) { prog.onfinish = null; prog.finish(); }
504
+ after(1900, next);
505
+ }
506
+
414
507
  // model race: month by month, then the year
415
508
  function raceFrames() {
416
509
  const R = W.series?.race;
@@ -429,14 +522,14 @@ S.race = {
429
522
  ok: () => raceFrames().F.length > 1 || raceFrames().models.length > 1, dur: () => raceFrames().F.length > 1 ? 9500 : 5000,
430
523
  html: () => {
431
524
  const { models, F } = raceFrames(), fin = F.at(-1).vals, rank = order(fin), n = Math.min(models.length, 6);
432
- const col = i => C(COLORS[rank.indexOf(i) % 5]), tot = F.at(-1).tot || fin.reduce((a, b) => a + b, 0) || 1, mx = Math.max(...fin) || 1;
525
+ const col = i => rank.indexOf(i) % 5 === 0 ? 'var(--lit,var(--li))' : C(COLORS[rank.indexOf(i) % 5]), tot = F.at(-1).tot || fin.reduce((a, b) => a + b, 0) || 1, mx = Math.max(...fin) || 1;
433
526
  const win = models[rank[0]], wm = (W.models || []).find(m => m.label === win);
434
527
  return `<div class="slide">${top()}
435
- <div class="M lab in">Model race · ${W.year || ''}</div><div class="H in" style="font-size:150px;margin-top:24px">Who ruled<br><span class="rm" style="color:var(--li)">${esc(F.at(-1).label)}</span>?</div>
528
+ <div class="M lab in">Model race · ${W.year || ''}</div><div class="H in" style="font-size:150px;margin-top:24px">Who ruled<br><span class="rm" style="color:var(--lit,var(--li))">${esc(F.at(-1).label)}</span>?</div>
436
529
  <div class="race in grow" style="margin-top:80px;min-height:${n * RACE_ROW}px">${rank.slice(0, n).map((i, r) => `<div class="rr" data-i="${i}" style="transform:translateY(${r * RACE_ROW}px)">
437
530
  <div class="rn H"><span class="fit" style="min-width:0">${esc(models[i])}</span><span class="M rv">${Math.round(fin[i] / tot * 100)}%</span></div>
438
531
  <div class="rt"><i style="background:${col(i)};transform:scaleX(${Math.max(.02, fin[i] / mx)})"></i></div></div>`).join('')}</div>
439
- <div class="row in" style="align-items:baseline;justify-content:space-between;margin-top:20px"><span class="M lab">Model of the Year</span><span class="H fit" style="font-size:64px;color:var(--li)">${esc(win)}${wm?.share ? ` · ${Math.round(wm.share * 100)}%` : ''}</span></div>
532
+ <div class="row in" style="align-items:baseline;justify-content:space-between;margin-top:20px"><span class="M lab" style="flex:none">Model of the Year</span><span class="H fit" style="font-size:64px;color:var(--lit,var(--li));flex:1;min-width:0;text-align:right">${esc(win)}${wm?.share ? ` · ${Math.round(wm.share * 100)}%` : ''}</span></div>
440
533
  ${foot()}</div>`;
441
534
  },
442
535
  run: el => {
@@ -463,7 +556,7 @@ S.race = {
463
556
  };
464
557
  const order = vals => vals.map((v, i) => [v, i]).sort((a, b) => b[0] - a[0] || a[1] - b[1]).map(x => x[1]);
465
558
 
466
- // prompts + streak bento
559
+ // the card: "My {year}", the bento of the year's awards. It is a story slide, the share-slide preview and what Save card exports
467
560
  function heatCells() {
468
561
  const days = W.series?.days, y = W.year;
469
562
  if (!days || !y || !Object.keys(days).length) return null;
@@ -479,29 +572,45 @@ function heatCells() {
479
572
  }
480
573
  return cols;
481
574
  }
482
- const head = (w) => `<div class="row" style="align-items:center;gap:40px;margin-bottom:30px;flex:none">${logoTile(236)}<div style="min-width:0;flex:1">
575
+ const head = (w, px = 236) => `<div class="row" style="align-items:center;gap:40px;margin-bottom:30px;flex:none">${logoTile(px)}<div style="min-width:0;flex:1">
483
576
  <div class="H fit in" style="font-size:150px">${w}</div><div class="row in" style="gap:24px;align-items:center;margin-top:22px;flex-wrap:wrap">
484
- <span class="M N gh" style="font-size:36px">${GH(40)}${esc(handle())}</span>${W.tier?.label ? `<span class="pill M">${esc(W.tier.label)}</span>` : ''}</div></div></div>`;
577
+ <span class="M N gh" style="font-size:36px;max-width:100%;min-width:0">${GH(40)}<span style="overflow:hidden;text-overflow:ellipsis">${esc(handle())}</span></span>${W.tier?.label ? `<span class="pill M">${esc(W.tier.label)}</span>` : ''}</div></div></div>`;
578
+ const pct = x => { const p = Math.round((x || 0) * 100); return p < 1 && x > 0 ? '<1%' : p + '%'; };
579
+ function ballot() {
580
+ const h = W.harnesses?.[0], m = W.models?.[0], pick = (id, fb) => { const a = AW(id); return a?.value ? a : fb || null; };
581
+ return [['Harness', pick('harness', h && { value: h.label || HARNESS[h.id] || h.id, detail: h.share ? pct(h.share) + ' of prompts' : '' })],
582
+ ['Model', pick('model', m && { value: m.label, detail: m.share ? pct(m.share) + ' of tokens' : '' })],
583
+ ['Skill', pick('skill')]].filter(r => r[1]);
584
+ }
585
+ // a long one-word value (a skill id) breaks once, near its middle, so fit() can keep it large
586
+ const two = v => { v = String(v ?? ''); if (v.length < 10) return esc(v); let at = -1; [...v].forEach((c, i) => { if (/[-_ /.:]/.test(c) && i < v.length - 1 && Math.abs(i + 1 - v.length / 2) < Math.abs(at + 1 - v.length / 2)) at = i; }); return at < 0 ? esc(v) : esc(v.slice(0, at + 1)) + '<br>' + esc(v.slice(at + 1).trim()); };
485
587
  S.bento = {
486
- ok: () => T().prompts > 0, dur: 6500,
588
+ ok: () => T().prompts > 0 || ballot().length > 0, dur: 6500,
487
589
  html: () => {
488
- const t = T(), mo = W.series?.months, mx = mo ? Math.max(...mo, 1) : 1, heat = heatCells();
489
- const st = t.streak || {}, small = [['Sessions', t.sessions, 'lv'], ['Active days', t.activeDays, 'or'], ['Subagents', t.subagents, 'bl']].filter(x => x[1] != null);
590
+ const t = T(), heat = heatCells(), rows = Object.fromEntries(ballot()), H = (W.harnesses || []).slice(0, 12), mx = Math.max(...H.map(h => h.share || 0), .01);
591
+ const tok = AW('tokens')?.value || (t.tokens > 0 ? BIG(t.tokens) : ''), usd = AW('spendings')?.value || (W.spendings?.usd ? '≈ ' + USD(W.spendings.usd) : ''), sw = AW('swarm'), agents = num(sw?.value) ?? t.subagents, rl = AW('rateLimits');
592
+ // THE FIVE TILES, in one place. Two big ones: { value, detail }. Three small ones: [label, value html, detail, colour token]; an entry with no value is left out.
593
+ const hw = rows.Harness, mw = rows.Model, share = W.models?.[0]?.share ?? (num(mw?.detail) ?? 0) / 100;
594
+ const small = [
595
+ ['Skill of the Year', rows.Skill && two(rows.Skill.value), rows.Skill?.detail, 'lv'],
596
+ rl && num(rl.value) != null ? ['Limits reached', cnt(num(rl.value)), rl.detail, 'or'] : ['Agents spawned', agents != null && cnt(agents), sw?.detail, 'or'],
597
+ ['Tokens', t.tokens > 0 ? cnt(t.tokens, 'b') : esc(tok), usd, 'bl'],
598
+ ].filter(x => x[1]);
490
599
  const cls = W.tier?.power || AW('agentClass')?.value, slogan = AW('agentClass')?.detail;
491
600
  return `<div class="slide">
492
601
  ${head('My ' + (W.year || ''))}
493
602
  <div class="col grow" style="gap:26px">
494
603
  <div class="row" style="flex:1.5;min-height:0">
495
- <div class="tile in" style="flex:1.35;background:var(--li);color:var(--ink);display:flex;flex-direction:column"><div class="M" style="font-size:28px">Prompts</div><div class="H fit" style="font-size:150px;margin-top:40px">${cnt(t.prompts)}</div>
496
- ${mo ? `<div class="mb" style="margin-top:auto;display:flex;gap:8px;align-items:flex-end;height:110px">${mo.map(v => `<i class="bar" style="flex:1;height:${Math.max(8, v / mx * 110)}px;border-radius:6px;background:var(--ink);opacity:${(.25 + v / mx * .75).toFixed(2)};transform-origin:50% 100%"></i>`).join('')}</div>` : ''}</div>
497
- ${st.days ? `<div class="tile in" style="flex:1;background:var(--pk);color:var(--ink);display:flex;flex-direction:column"><div class="M" style="font-size:28px">Streak</div><div class="H" style="font-size:190px;margin-top:30px">${cnt(st.days)}</div><div style="font-size:42px;font-weight:800;margin-top:16px">days in a row</div>
498
- <div class="sq" style="margin-top:auto;display:flex;gap:10px">${'<i style="width:44px;height:44px;border-radius:12px;background:var(--ink)"></i>'.repeat(7)}</div>${st.from ? `<div class="M N" style="font-size:24px;margin-top:16px;opacity:.75">${md(st.from)} – ${md(st.to)}</div>` : ''}</div>` : ''}
604
+ <div class="tile in" style="flex:1.35;min-width:0;background:var(--li);color:var(--ink);display:flex;flex-direction:column">${hw ? `<div class="M" style="font-size:28px;white-space:nowrap;letter-spacing:.04em">Harness of the Year</div><div class="H fit" style="font-size:150px;margin-top:40px">${esc(hw.value)}</div>${hw.detail ? `<div style="font-size:42px;font-weight:800;margin-top:16px">${esc(hw.detail)}</div>` : ''}
605
+ ${H.length > 1 ? `<div class="mb" style="margin-top:auto;display:flex;gap:8px;align-items:flex-end;height:110px">${H.map(h => `<i class="bar" style="flex:1;height:${Math.max(8, (h.share || 0) / mx * 110)}px;border-radius:6px;background:var(--ink);opacity:${(.25 + (h.share || 0) / mx * .75).toFixed(2)};transform-origin:50% 100%"></i>`).join('')}</div>` : ''}`
606
+ : `<div class="M" style="font-size:28px">Prompts</div><div class="H fit" style="font-size:150px;margin-top:40px">${cnt(t.prompts)}</div>`}</div>
607
+ ${mw ? `<div class="tile in" style="flex:1;min-width:0;background:var(--pk);color:var(--ink);display:flex;flex-direction:column"><div class="M" style="font-size:28px;white-space:nowrap;letter-spacing:.04em">Model of the Year</div><div class="H fit" style="font-size:190px;margin-top:30px">${esc(mw.value)}</div>${mw.detail ? `<div style="font-size:42px;font-weight:800;margin-top:16px">${esc(mw.detail)}</div>` : ''}
608
+ ${share > 0 ? `<div class="sq" style="margin-top:auto;display:flex;gap:10px">${Array.from({ length: 5 }, (_, i) => { const f = Math.round(Math.max(0, Math.min(1, share * 5 - i)) * 100); return `<i style="width:44px;height:44px;border-radius:12px;background:linear-gradient(90deg,var(--ink) ${f}%,color-mix(in srgb,var(--ink) 22%,transparent) ${f}%)"></i>`; }).join('')}</div>` : ''}</div>` : ''}
499
609
  </div>
500
- ${small.length ? `<div class="row" style="flex:1;min-height:0">${small.map(([a, v, c]) => `<div class="tile in" style="flex:1;background:${C(c)};color:${c === 'bl' ? 'var(--obl)' : 'var(--ink)'};display:flex;flex-direction:column;justify-content:space-between"><div class="M" style="font-size:26px">${a}</div><div class="H fit" style="font-size:88px">${cnt(v)}</div></div>`).join('')}</div>` : ''}
610
+ ${small.length ? `<div class="row" style="flex:1;min-height:0">${small.map(([a, v, d, c]) => `<div class="tile in" style="flex:1 1 0;min-width:0;background:${C(c)};color:${c === 'bl' ? 'var(--obl)' : 'var(--ink)'};display:flex;flex-direction:column;justify-content:space-between"><div class="M" style="font-size:22px;white-space:nowrap;letter-spacing:.04em">${a}</div><div><div class="H fit" style="font-size:88px;line-height:.95">${v}</div>${d ? `<div class="M N" style="font-size:22px;opacity:.75;margin-top:12px;line-height:1.3;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden">${esc(d).replace(' · ', '<br>')}</div>` : ''}</div></div>`).join('')}</div>` : ''}
501
611
  ${cls ? `<div class="tile in" style="flex:none;border:4px solid var(--fg);padding:28px 40px;display:flex;justify-content:space-between;align-items:center;gap:30px"><div class="col" style="flex:none;gap:10px"><span class="M" style="font-size:28px">Agent class</span>${slogan ? `<span style="font-size:26px;opacity:.7;max-width:420px">${esc(slogan)}</span>` : ''}</div><span class="H fit" style="font-size:68px;min-width:0;text-align:right">${esc(cls)}</span></div>` : ''}
502
612
  </div>
503
613
  ${heat ? `<div class="heat in" style="margin-top:30px">${heat.map(c => `<b>${c.map(s => `<i${s ? ` style="${s}"` : ''}></i>`).join('')}</b>`).join('')}</div>` : ''}
504
- ${W.coverage?.length ? `<div class="M N in" style="font-size:24px;opacity:.55;margin-top:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis">${W.coverage.map(c => `${esc(c.label)} since ${md(c.from)}`).join(' · ')}</div>` : ''}
505
614
  ${foot()}</div>`;
506
615
  },
507
616
  run: el => {
@@ -511,29 +620,40 @@ S.bento = {
511
620
  },
512
621
  };
513
622
 
514
- // peak hour, 24 h clock
515
- const hours = () => { const h = W.series?.hours; return h?.length === 24 && h.some(v => v > 0) ? h : null; };
516
- S.clock = {
517
- ok: () => !!(hours() || AW('peakHour')), dur: 5500,
623
+ // the busiest day of the year (and the hour it peaked)
624
+ const DAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
625
+ const agentName = () => W.roastBy || W.harnesses?.[0]?.label || 'your agent';
626
+ S.day = {
627
+ ok: () => /^\d{4}-\d\d-\d\d/.test(W.busiest?.date || ''), dur: () => W.dayLine ? 7500 : 5500, chrome: 'ink',
518
628
  html: () => {
519
- const h = hours(), peak = h ? h.indexOf(Math.max(...h)) : num(AW('peakHour')?.value) ?? 0;
520
- const title = peak >= 5 && peak < 9 ? 'Early<br>bird.' : peak >= 9 && peak < 17 ? 'Day<br>shift.' : peak >= 17 && peak < 21 ? 'Prime<br>time.' : 'Night<br>owl.';
521
- const tot = h ? h.reduce((a, b) => a + b, 0) : 0, night = h ? Math.round(h.slice(0, 5).reduce((a, b) => a + b, 0) / tot * 100) : null;
522
- const wd = W.series?.weekdays, bd = wd?.length === 7 ? ['Mondays', 'Tuesdays', 'Wednesdays', 'Thursdays', 'Fridays', 'Saturdays', 'Sundays'][wd.indexOf(Math.max(...wd))] : '';
523
- const top3 = h ? order(h).slice(0, 3) : [peak], mx = h ? Math.max(...h) : 1;
524
- const nightTxt = night != null ? night + '% after midnight' : AW('peakHour')?.detail || '';
629
+ const b = W.busiest, d = new Date(b.date.slice(0, 10) + 'T12:00:00'), wd = isNaN(d) ? '' : DAYS[d.getDay()];
630
+ const line = typeof W.dayLine === 'string' && W.dayLine.trim(), hour = Number.isFinite(+b.peakHour) && b.peakHour != null ? String(Math.round(+b.peakHour)).padStart(2, '0') + ':00' : '';
631
+ return `<div class="slide" style="background:var(--lv);color:var(--ink)">${top(1)}
632
+ <div class="M in" style="font-size:40px">Your busiest day</div><div class="grow"></div>
633
+ <div class="H fit in" style="font-size:340px">${md(b.date)}</div>
634
+ ${wd ? `<div class="H in" style="font-size:110px;margin-top:14px">a ${wd}.</div>` : ''}
635
+ <div class="grow"></div>
636
+ <div class="row in" style="gap:22px">
637
+ ${b.prompts != null ? `<div class="tile" style="flex:1.25 1 0;min-width:0;background:var(--ink);color:var(--lv)"><div class="M" style="font-size:28px">prompts in one day</div><div class="H fit" style="font-size:150px;margin-top:26px">${cnt(b.prompts)}</div></div>` : ''}
638
+ ${hour ? `<div class="tile" style="flex:1 1 0;min-width:0;box-shadow:inset 0 0 0 5px var(--ink)"><div class="M" style="font-size:28px">mostly at</div><div class="H fit" style="font-size:150px;margin-top:26px">${hour}</div></div>` : ''}
639
+ </div>
640
+ ${line ? `<div class="in" style="margin-top:44px"><div style="font-size:50px;font-weight:700;line-height:1.2">“${esc(line)}”</div><div class="M" style="font-size:26px;margin-top:18px;opacity:.7">— ${esc(agentName())}’s guess</div></div>` : ''}
641
+ ${foot()}</div>`;
642
+ },
643
+ };
644
+
645
+ // top 5 skills and models, Spotify-style
646
+ S.top5 = {
647
+ ok: () => ['skills', 'models'].some(k => Array.isArray(W.top5?.[k]) && W.top5[k].length > 0), dur: 7500,
648
+ html: () => {
649
+ const t = W.top5, L = (k, title, f) => Array.isArray(t[k]) && t[k].length ? { title, rows: t[k].slice(0, 5).filter(r => Array.isArray(r)).map(([n, v]) => [n, f(v)]) } : null;
650
+ const cols = [L('skills', 'Skills', v => N(v) + ' runs'), L('models', 'Models', v => pct(v) + ' of tokens')].filter(Boolean), wide = cols.length < 2, fs = wide ? 110 : 76;
651
+ const col = c => `<div class="col" style="flex:1 1 0;min-width:0;justify-content:space-between;gap:30px"><div class="in"><span class="pill M">${c.title}</span></div>${c.rows.map(([n, v], i) => `<div class="row in" style="gap:20px;align-items:baseline"><span class="H" style="font-size:${fs}px;line-height:1;opacity:.35;flex:none;width:${wide ? 96 : 62}px">${i + 1}</span><div style="min-width:0;flex:1"><div class="H fit" style="font-size:${fs}px;line-height:1.05${i ? '' : ';color:var(--lit,var(--li))'}">${esc(n)}</div><div class="M N" style="font-size:${wide ? 30 : 26}px;opacity:.6;margin-top:10px">${v}</div></div></div>`).join('')}</div>`;
525
652
  return `<div class="slide">${top()}
526
- <div class="M lab in">When you prompt</div><div class="H in" style="font-size:170px;margin-top:24px">${title}</div>
527
- <div class="grow in" style="display:grid;place-items:center;min-height:700px">
528
- <svg viewBox="-500 -500 1000 1000" style="width:min(100%,900px);height:min(100%,900px);overflow:visible">
529
- ${[0, 6, 12, 18].map(k => { const a = k / 24 * Math.PI * 2 - Math.PI / 2; return `<text x="${(Math.cos(a) * 180).toFixed(1)}" y="${(Math.sin(a) * 180 + 10).toFixed(1)}" text-anchor="middle" font-size="28" fill="currentColor" opacity=".45" style="font-family:var(--fm)">${String(k).padStart(2, '0')}</text>`; }).join('')}
530
- ${(h || Array.from({ length: 24 }, (_, k) => k === peak ? 1 : .12)).map((v, k) => `<g transform="rotate(${k * 15 - 90})"><rect class="hb" x="230" y="-15" width="${Math.max(30, v / mx * 250).toFixed(1)}" height="30" rx="15" fill="${top3.includes(k) ? C('li') : C('lv')}" style="transform-box:fill-box;transform-origin:0 50%"/></g>`).join('')}
531
- <text y="-6" text-anchor="middle" font-size="120" fill="currentColor" style="font-family:var(--fd);font-weight:var(--fw);letter-spacing:var(--ls);font-style:var(--fst)">${String(peak).padStart(2, '0')}:00</text>
532
- <text y="58" text-anchor="middle" font-size="28" fill="currentColor" opacity=".6" letter-spacing="5" style="font-family:var(--fm)">PEAK HOUR</text></svg></div>
533
- <div class="row in" style="justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:10px 30px"><span class="M" style="font-size:32px">${esc(nightTxt)}</span>${bd ? `<span class="M" style="font-size:32px;opacity:.6">Busiest on ${bd}</span>` : ''}</div>
653
+ <div class="M lab in">On repeat</div><div class="H in" style="font-size:170px;margin-top:24px">Top 5</div>
654
+ <div class="row grow" style="gap:44px;margin-top:64px;max-height:1150px">${cols.map(col).join('')}</div>
534
655
  ${foot()}</div>`;
535
656
  },
536
- run: el => $$('.hb', el).forEach((b, i) => grow(b, 'scaleX', 400 + i * 28)),
537
657
  };
538
658
 
539
659
  // manners: please vs Esc
@@ -575,17 +695,17 @@ S.age = {
575
695
  const wp = why.map(w => /(\d+)-word prompts/.exec(w)).find(Boolean), late = why.some(w => /after 2[2-4]/.test(w));
576
696
  const line = [wp ? `Old enough for <span style="white-space:nowrap">${wp[1]}-word</span> prompts.` : '', late ? 'Young enough to code at 2 a.m.' : ''].filter(Boolean).join(' ');
577
697
  return `<div class="slide" style="padding:0">
578
- ${A ? `<div class="col pt" style="flex:${X ? 1.15 : 1};background:var(--pk);color:var(--ink);padding:104px 44px 50px;min-height:0">${top(1)}
698
+ ${A ? `<div class="col pt" style="flex:1;background:var(--pk);color:var(--ink);padding:104px 44px 50px;min-height:0">${top(1)}
579
699
  <div class="M in" style="font-size:34px">Your agentic age is</div>
580
- <div class="row" style="align-items:flex-end;gap:40px;flex:1;min-height:0"><div class="H in" style="font-size:${X ? 460 : 640}px;letter-spacing:-.07em;line-height:.8">${cnt(A.years)}</div>
581
- ${line ? `<div class="in" style="font-size:46px;font-weight:800;line-height:1.12;padding-bottom:20px">${line}</div>` : ''}</div>
700
+ <div class="row" style="align-items:flex-end;gap:40px;flex:1;min-height:0"><div class="H in" style="flex:none;font-size:${Math.round((X ? 460 : 640) * Math.min(1, 2 / String(Math.round(A.years)).length))}px;letter-spacing:-.07em;line-height:.8;padding-right:.1em">${cnt(A.years)}</div>
701
+ ${line ? `<div class="in" style="min-width:0;font-size:46px;font-weight:800;line-height:1.12;padding-bottom:20px">${line}</div>` : ''}</div>
582
702
  ${why.length ? `<div class="row in" style="flex-wrap:wrap;gap:14px;margin-top:34px">${why.map(w => `<span class="pill M N" style="font-size:28px;background:var(--ink);color:var(--pk)">${esc(w)}</span>`).join('')}</div>` : ''}</div>` : ''}
583
703
  ${X ? `<div class="col${A ? '' : ' pt'}" style="flex:1;padding:${A ? 60 : 104}px 44px 44px;min-height:0">${A ? '' : top()}
584
704
  <div class="M lab in">Your agent twin</div><div class="H fit in" style="font-size:120px;margin-top:20px">${esc(X.name)}</div>
585
- <div class="row" style="gap:30px;margin-top:50px;flex:1;min-height:240px;max-height:420px">
586
- <div class="tile in" style="flex:1;background:var(--li);color:var(--ink);transform:rotate(-3deg);display:flex;flex-direction:column;justify-content:space-between"><span class="M" style="font-size:26px">you</span><span class="H" style="font-size:150px">✦</span><span class="M N gh" style="font-size:26px">${GH(26)}${esc(handle())}</span></div>
705
+ <div class="row" style="gap:30px;margin-top:36px;flex:1;min-height:240px;max-height:420px">
706
+ <div class="tile in" style="flex:1;background:var(--li);color:var(--ink);transform:rotate(-3deg);display:flex;flex-direction:column;justify-content:space-between"><span class="M" style="font-size:26px">you</span><span class="H" style="font-size:150px">✦</span><span class="M N gh" style="font-size:26px;max-width:100%">${GH(26)}<span style="overflow:hidden;text-overflow:ellipsis">${esc(handle())}</span></span></div>
587
707
  <div class="tile in" style="flex:1;background:var(--lv);color:var(--ink);transform:rotate(3deg);display:flex;flex-direction:column;justify-content:space-between"><span class="M" style="font-size:26px">twin</span><span class="H" style="font-size:150px">∞</span><span class="M N" style="font-size:26px">${esc(X.why || X.name)}</span></div></div>
588
- <div class="row in" style="align-items:baseline;gap:20px;margin-top:40px"><span class="H" style="font-size:150px">${cnt(X.match || 0)}</span><span class="M" style="font-size:34px">% match</span></div>
708
+ <div class="row in" style="align-items:baseline;gap:20px;margin-top:28px"><span class="H" style="font-size:150px">${cnt(X.match || 0)}</span><span class="M" style="font-size:34px">% match</span></div>
589
709
  ${foot()}</div>` : ''}
590
710
  ${X ? '' : `<div style="padding:0 44px 44px">${foot()}</div>`}</div>`;
591
711
  },
@@ -607,8 +727,8 @@ S.spend = {
607
727
  <div class="paper" style="width:840px;max-height:100%"><div style="text-align:center;font-size:46px;font-weight:800">SPENDINGS ${W.year || ''}</div><div style="text-align:center;opacity:.6;font-size:26px">${esc(handle())} · AT API LIST PRICES</div><hr>
608
728
  ${shown.map(([a, b, c]) => `<div class="ln"><span style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${esc(a)}</span><span style="flex:none">${b}</span></div>${c ? `<div class="sub"> ${c}</div>` : ''}`).join('')}${more > 0 ? `<div class="sub">+ ${more} more</div>` : ''}
609
729
  <hr><div class="ln" style="font-size:46px;font-weight:800"><span>TOTAL</span><span>${esc(total)}</span></div>
610
- ${s.perDay ? `<div class="tot" style="margin:36px 0 30px;background:#111;color:var(--li);text-align:center;border-radius:20px;padding:30px"><div class="H" style="font-size:110px">${USD(s.perDay)}/day</div><div style="font-size:26px;margin-top:8px">IF YOU PAID PER TOKEN</div></div>` : ''}
611
- <div style="height:96px;flex:none;margin-top:${s.perDay ? 0 : 30}px;background:repeating-linear-gradient(90deg,#111 0 4px,transparent 4px 9px,#111 9px 11px,transparent 11px 17px)"></div>
730
+ ${s.perDay ? `<div class="tot" style="margin:26px 0 22px;background:#111;color:var(--li);text-align:center;border-radius:20px;padding:30px"><div class="H fit" style="font-size:110px">${USD(s.perDay)}/day</div><div style="font-size:26px;margin-top:8px">IF YOU PAID PER TOKEN</div></div>` : ''}
731
+ <div style="height:80px;flex:none;margin-top:${s.perDay ? 0 : 30}px;background:repeating-linear-gradient(90deg,#111 0 4px,transparent 4px 9px,#111 9px 11px,transparent 11px 17px)"></div>
612
732
  <div style="text-align:center;opacity:.6;font-size:22px;margin-top:10px">${[pd && 'LIST PRICES ' + pd, cache].filter(Boolean).join(' · ')}</div></div></div>
613
733
  ${foot()}</div>`;
614
734
  },
@@ -650,7 +770,7 @@ S.share = {
650
770
  <div class="row grow" style="margin-top:56px;gap:40px;align-items:center;min-height:620px">
651
771
  <button class="in ctl" data-act="wall" aria-label="Wall" style="flex:none;width:346px;height:615px;position:relative;border-radius:calc(var(--r) * .6 + 8px);overflow:hidden;transform:rotate(-3deg);box-shadow:0 40px 120px #0009"><div class="mini" style="position:absolute;left:0;top:0;width:1080px;height:1920px;transform:scale(.3204);transform-origin:0 0;pointer-events:none">${miniCard() || wallHTML({ mini: 1 })}</div></button>
652
772
  <div class="col in" style="flex:1;min-width:0;gap:26px;align-items:flex-start">
653
- ${VIEWER ? `<div class="H" style="font-size:72px">Get yours</div><div class="M N" style="font-size:30px;line-height:1.5;overflow-wrap:anywhere;opacity:.8">${INSTALL}</div>`
773
+ ${VIEWER ? `<div class="H" style="font-size:72px">${CTA()}</div><div class="M N" style="font-size:30px;line-height:1.5;overflow-wrap:anywhere;opacity:.8">${INSTALL}</div>`
654
774
  : `<div class="qr" style="width:100%;max-width:420px;aspect-ratio:1">${qrSVG(shareURL(W))}</div><div class="M N" style="font-size:30px;display:flex;gap:14px;align-items:center"><svg viewBox="0 0 24 24" style="width:38px;height:38px" fill="none" stroke="currentColor" stroke-width="2"><rect x="6" y="2" width="12" height="20" rx="3"/><path d="M10 18h4"/></svg>→ phone</div>`}
655
775
  </div></div>
656
776
  <div class="seg3 in ctl" role="group" aria-label="Size" style="margin-top:46px">${Object.entries(SIZES).map(([k, [w, h, l]]) => `<button data-size="${k}" aria-pressed="${k === size}">${l} <span style="opacity:.55">${w}×${h}</span></button>`).join('')}</div>
@@ -667,7 +787,8 @@ S.share = {
667
787
  // wall: every award on one card (the share image)
668
788
  function miniCard() { try { return S.bento.html().replace('<div class="slide', '<div class="slide x'); } catch { return ''; } }
669
789
  function wallHTML({ mini } = {}) {
670
- const aw = (W.awards || []).filter(a => a.value).map(a => [a.label || LABELS[a.id] || a.id, red(a.value)]);
790
+ const first = ['harness', 'model', 'skill', 'rateLimits'], rank = a => first.indexOf(a.id) + 1 || 9; // the card's four lead; no sessions / active days / subagents / tool / prompts tiles
791
+ const aw = (W.awards || []).filter(a => a.value && !['sessions', 'activeDays', 'subagents', 'tool', 'prompts'].includes(a.id)).sort((a, b) => rank(a) - rank(b)).map(a => [a.label || LABELS[a.id] || a.id, red(a.value)]);
671
792
  if (W.roast) aw.push(['Roast', '“' + (W.roast.split(/(?<=[.!?])\s/)[0] || W.roast).slice(0, 40) + '”']);
672
793
  const hs = (W.harnesses || []).map(h => h.label || HARNESS[h.id] || h.id).slice(0, 4).join(' · ');
673
794
  return `<div class="slide${mini ? ' x' : ''}" style="padding-top:${mini ? 60 : ''}px">${head(String(W.year || ''))}
@@ -700,9 +821,11 @@ const grow = (el, axis, delay) => anim(el, [{ transform: `${axis}(0)` }, { trans
700
821
  // a tiny clock for JS-driven tweens (count-ups, race). Runs only while a tween is alive; freezes on pause
701
822
  const TK = { list: [], raf: 0, t: 0, last: 0 };
702
823
  function tween(ms, fn, delay = 0) { if (STATIC) return fn(1, 0); if (reduced()) return fn(1, 0); TK.list.push({ start: TK.t + delay, ms, fn, done: false }); kick(); }
703
- function kick() { if (!TK.raf && !paused()) { TK.last = performance.now(); TK.raf = requestAnimationFrame(tick); } }
824
+ // a one-shot on the same clock, so it waits while the story is paused (unlike setTimeout) and dies with its slide
825
+ function after(ms, fn) { if (STATIC) return; TK.list.push({ start: TK.t + ms, ms: 1, fn: p => p >= 1 && fn() }); kick(); }
826
+ function kick() { if (!TK.raf && !paused()) { TK.last = 0; TK.raf = requestAnimationFrame(tick); } } // the first frame after a (re)start only sets the clock
704
827
  function tick(now) {
705
- TK.raf = 0; const dt = Math.min(50, now - TK.last); TK.last = now; TK.t += dt;
828
+ TK.raf = 0; const dt = TK.last ? Math.max(0, Math.min(50, now - TK.last)) : 0; TK.last = now; TK.t += dt;
706
829
  TK.list = TK.list.filter(tw => { const p = (TK.t - tw.start) / tw.ms; if (p < 0) return true; tw.fn(Math.min(1, p), dt); return p < 1; });
707
830
  if (TK.list.length && !paused()) TK.raf = requestAnimationFrame(tick);
708
831
  }
@@ -726,11 +849,13 @@ function enter(el, def) {
726
849
  function fit(root) {
727
850
  $$('.fit', root).forEach(el => {
728
851
  if (el.dataset.fs) el.style.fontSize = el.dataset.fs; else el.dataset.fs = el.style.fontSize || getComputedStyle(el).fontSize;
729
- let fs = parseFloat(getComputedStyle(el).fontSize);
852
+ let fs = parseFloat(getComputedStyle(el).fontSize); const min = Math.ceil(fs * .4); // below 40% a name is unreadable: stop shrinking and end it with an ellipsis
730
853
  for (let i = 0; i < 5; i++) {
731
854
  const max = el.clientWidth || el.parentElement.clientWidth, w = el.scrollWidth;
732
855
  if (!max || w <= max + 1) break;
733
- fs = Math.floor(fs * max / w * .985); el.style.fontSize = fs + 'px';
856
+ fs = Math.floor(fs * max / w * .985);
857
+ if (fs <= min) { el.style.fontSize = min + 'px'; el.style.overflow = 'hidden'; el.style.textOverflow = 'ellipsis'; break; }
858
+ el.style.fontSize = fs + 'px';
734
859
  }
735
860
  });
736
861
  }
@@ -741,8 +866,9 @@ let list = [], cur = 0, prog = null, LW = 1080, LH = 1920;
741
866
  const why = new Set();
742
867
  const paused = () => why.size > 0;
743
868
  const durOf = d => typeof d.dur === 'function' ? d.dur() : d.dur;
869
+ const ORDER = ['tokens', 'quiz', 'race', 'harness', 'day', 'top5', 'manners', 'right', 'age', 'spend', 'roast', 'bento', 'share'];
744
870
  function build() {
745
- list = Object.entries(S).filter(([, d]) => { try { return d.ok(); } catch (e) { return false; } }).map(([key, d]) => ({ key, ...d }));
871
+ list = ORDER.filter(key => { try { return S[key].ok(); } catch (e) { return false; } }).map(key => ({ key, ...S[key] }));
746
872
  segEl.innerHTML = list.map(() => '<b><i></i></b>').join('');
747
873
  }
748
874
  function slideHTML(key) { return key === 'wall' ? wallHTML() : S[key].html(); }
@@ -759,6 +885,7 @@ function mount(i, animate) {
759
885
  function go(i, dir = 1, animate = !STATIC) {
760
886
  i = Math.max(0, Math.min(list.length - 1, i));
761
887
  TK.list.length = 0; cur = i;
888
+ list[i].reset && list[i].reset();
762
889
  const old = $$('.slide.live', view);
763
890
  const el = mount(i, animate);
764
891
  old.forEach(o => {
@@ -772,7 +899,7 @@ function go(i, dir = 1, animate = !STATIC) {
772
899
  progress();
773
900
  $('#b-prev').hidden = cur === 0; $('#b-next').hidden = cur === list.length - 1;
774
901
  $('#b-save').hidden = false;
775
- if (paused()) pauseSlide(true);
902
+ if (paused()) pauseSlide();
776
903
  }
777
904
  const next = () => cur < list.length - 1 && go(cur + 1, 1);
778
905
  const prev = () => go(cur - 1, -1);
@@ -782,18 +909,21 @@ function progress() {
782
909
  segs.forEach((s, k) => s.style.transform = k < cur || (k === cur && (!d || STATIC)) ? 'scaleX(1)' : 'scaleX(0)');
783
910
  if (!d || STATIC) return;
784
911
  prog = segs[cur].animate([{ transform: 'scaleX(0)' }, { transform: 'scaleX(1)' }], { duration: d, easing: 'linear', fill: 'forwards' });
785
- prog.onfinish = () => next();
786
- if (paused()) prog.pause();
787
- }
788
- function pauseSlide(on) {
789
- const el = $('.slide.live', view);
790
- el && el.getAnimations({ subtree: true }).forEach(a => on ? a.pause() : a.play());
912
+ prog.onfinish = () => (list[cur].end ? list[cur].end() : next());
913
+ if (paused()) hold(prog);
791
914
  }
915
+ // pause()/play() only take effect on the next frame, and a hidden tab paints none: the pause stayed pending, play() on return
916
+ // dropped it, and every animation jumped ahead by the time spent away. Setting currentTime completes the pause at once.
917
+ // Only what was really running is held, so finished fill:both animations are never replayed on resume.
918
+ const held = new Set();
919
+ const hold = a => { if (!a || a.playState !== 'running') return; a.pause(); try { a.currentTime = a.currentTime; } catch (e) { } held.add(a); };
920
+ const release = () => { for (const a of held) a.playState === 'paused' && a.play(); held.clear(); };
921
+ function pauseSlide() { const el = $('.slide.live', view); el && el.getAnimations({ subtree: true }).forEach(hold); }
792
922
  function setPause(reason, on) {
793
923
  const was = paused(); on ? why.add(reason) : why.delete(reason);
794
924
  if (was === paused()) return;
795
- if (paused()) { prog?.pause(); pauseSlide(true); cancelAnimationFrame(TK.raf); TK.raf = 0; }
796
- else { prog?.play(); pauseSlide(false); TK.list.length && kick(); }
925
+ if (paused()) { hold(prog); pauseSlide(); cancelAnimationFrame(TK.raf); TK.raf = 0; }
926
+ else { release(); TK.list.length && kick(); }
797
927
  }
798
928
  function remountCurrent() { if (!list[cur]) return; const el = $('.slide.live', view); el && el.remove(); mount(cur, false); }
799
929
  function setSkin(k) {
@@ -807,6 +937,7 @@ function layout() {
807
937
  let fw, fh;
808
938
  if (r <= 9 / 16 + .001) { fw = vw; LW = 1080; LH = Math.min(2400, Math.round(1080 * vh / vw)); fh = Math.round(fw * LH / LW); frame.classList.remove('boxed'); }
809
939
  else { const m = vw > 700 ? 48 : 0; fh = vh - m; fw = Math.round(fh * 9 / 16); LW = 1080; LH = 1920; frame.classList.toggle('boxed', m > 0); }
940
+ $('#stage').classList.toggle('full', fw >= vw && fh >= vh);
810
941
  const s = fw / LW;
811
942
  frame.style.width = fw + 'px'; frame.style.height = fh + 'px';
812
943
  view.style.width = LW + 'px'; view.style.height = LH + 'px'; view.style.transform = `scale(${s})`;
@@ -828,6 +959,7 @@ frame.addEventListener('pointerdown', e => {
828
959
  frame.addEventListener('pointermove', e => { if (ptr && Math.hypot(e.clientX - ptr.x, e.clientY - ptr.y) > 14) cancelPtr(); });
829
960
  const cancelPtr = () => { clearTimeout(holdT); if (ptr?.held) setPause('hold', false); ptr = null; };
830
961
  frame.addEventListener('pointercancel', cancelPtr);
962
+ addEventListener('blur', cancelPtr); // a press that ends in another window never sends pointerup
831
963
  frame.addEventListener('pointerleave', e => e.pointerType === 'mouse' && cancelPtr());
832
964
  frame.addEventListener('pointerup', e => {
833
965
  if (!ptr) return; clearTimeout(holdT);
@@ -840,7 +972,8 @@ frame.addEventListener('contextmenu', e => e.preventDefault());
840
972
  $('#b-prev').onclick = () => prev(); $('#b-next').onclick = () => next();
841
973
  $('#b-save').onclick = () => saveCurrent();
842
974
  document.addEventListener('click', e => {
843
- const b = e.target.closest('[data-act],[data-size],[data-skin]'); if (!b) return;
975
+ const b = e.target.closest('[data-act],[data-size],[data-skin],[data-quiz]'); if (!b) return;
976
+ if (b.dataset.quiz) return quizReveal(W.quiz.choices[+b.dataset.quiz]);
844
977
  if (b.dataset.size) { size = b.dataset.size; $$('[data-size]').forEach(x => x.setAttribute('aria-pressed', x.dataset.size === size)); return; }
845
978
  if (b.dataset.skin) { setSkin(b.dataset.skin); return; }
846
979
  const a = b.dataset.act;
@@ -862,6 +995,7 @@ addEventListener('keydown', e => {
862
995
  if (k === 's') return $('#wall').hidden ? saveCurrent() : save('wall');
863
996
  if (k === 'r') return $('#report').scrollIntoView({ behavior: reduced() ? 'auto' : 'smooth' });
864
997
  if (!inStory || !$('#wall').hidden) return;
998
+ if (list[cur]?.key === 'quiz' && W.quiz.choices[+k - 1] != null && +k <= 3) return quizReveal(W.quiz.choices[+k - 1]);
865
999
  if (k === 'ArrowRight' || k === ' ' || k === 'l') { e.preventDefault(); next(); }
866
1000
  else if (k === 'ArrowLeft' || k === 'h') { e.preventDefault(); prev(); }
867
1001
  else if (k === 'p' || k === 'k') setPause('user', !why.has('user'));
@@ -898,21 +1032,19 @@ function fontsFor(css) {
898
1032
  }
899
1033
  function vars() {
900
1034
  const cs = getComputedStyle(document.documentElement);
901
- return ['paper', 'body', ...TOKENS].map(t => `--${t}:${cs.getPropertyValue('--' + t).trim()}`).filter(s => !/:$/.test(s)).join(';');
1035
+ return ['paper', 'body', 'lgc', 'mkc', 'lit', ...TOKENS].map(t => `--${t}:${cs.getPropertyValue('--' + t).trim()}`).filter(s => !/:$/.test(s)).join(';');
902
1036
  }
903
1037
  function buildSVG(key, sz = size) {
904
1038
  const [w, h] = SIZES[sz] || sz, lw = Math.round(1920 * w / h), lh = 1920;
905
1039
  const host = $('#host'); host.style.width = lw + 'px'; host.style.height = lh + 'px';
906
- host.innerHTML = slideHTML(key);
1040
+ STILL = true; try { host.innerHTML = slideHTML(key); } finally { STILL = false; }
907
1041
  const el = host.firstElementChild; el.classList.add('x');
908
1042
  fit(el);
909
1043
  const v = vars(), css = $('#aw-css').textContent;
910
1044
  const fonts = fontsFor(getComputedStyle(document.documentElement).getPropertyValue('--fd') + ',' + getComputedStyle(document.documentElement).getPropertyValue('--fm') + ',"JetBrains Mono"');
911
1045
  const xhtml = new XMLSerializer().serializeToString(el);
912
1046
  host.innerHTML = '';
913
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}" viewBox="0 0 ${lw} ${lh}"><foreignObject x="0" y="0" width="${lw}" height="${lh}"><div xmlns="http://www.w3.org/1999/xhtml" style="position:relative;width:${lw}px;height:${lh}px;${esc(v)}"><style><![CDATA[${fonts}\n${css}]]>
914
- html.embed,html.embed body{overflow:hidden;height:100%}html.embed #report,html.embed [data-a="report"]{display:none!important}
915
- </style>${xhtml}</div></foreignObject></svg>`;
1047
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}" viewBox="0 0 ${lw} ${lh}"><foreignObject x="0" y="0" width="${lw}" height="${lh}"><div xmlns="http://www.w3.org/1999/xhtml" style="position:relative;width:${lw}px;height:${lh}px;${esc(v)}"><style><![CDATA[${fonts}\n${css}]]></style>${xhtml}</div></foreignObject></svg>`;
916
1048
  return { svg, w, h };
917
1049
  }
918
1050
  async function exportPNG(key, sz = size) {
@@ -930,7 +1062,7 @@ function download(blob, name) {
930
1062
  const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = name;
931
1063
  document.body.appendChild(a); a.click(); a.remove(); setTimeout(() => URL.revokeObjectURL(a.href), 5000);
932
1064
  }
933
- const CAPTION = () => `my ${W.year || ''} with AI agents 🫠 get yours: ${INSTALL}`;
1065
+ const CAPTION = () => `my ${W.year || ''} with AI agents 🫠 wrap yours: ${INSTALL}`;
934
1066
  async function copyCaption() {
935
1067
  try { await navigator.clipboard.writeText(CAPTION()); return true; }
936
1068
  catch (e) { const t = document.createElement('textarea'); t.value = CAPTION(); t.style.cssText = 'position:fixed;opacity:0'; document.body.appendChild(t); t.select(); let ok = false; try { ok = document.execCommand('copy'); } catch (_) { } t.remove(); return ok; }
package/src/cli.mjs CHANGED
@@ -23,6 +23,8 @@ usage: npx wrapped-agents [options]
23
23
  --json build wrapped.json only and print its path (for agents)
24
24
  --from <file> render from an existing wrapped.json instead of reading logs
25
25
  --roast "<line>" your agent's roast (≤ 12 words, numbers from this wrap)
26
+ --quip "<line>" your agent's funny line for the tokens slide (numbers from compare.options)
27
+ --day "<line>" your agent's guess at what happened on your busiest day
26
28
  --roast-by <name> who wrote it, e.g. "Claude Code" (shown under the roast)
27
29
  --no-roast no roast slide
28
30
  --show-projects show project names (hidden by default)
@@ -44,6 +46,8 @@ function args(argv) {
44
46
  else if (k === '--roast') a.roast = v();
45
47
  else if (k === '--no-roast') a.roast = '';
46
48
  else if (k === '--roast-by') a.roastBy = v();
49
+ else if (k === '--quip') a.quip = v();
50
+ else if (k === '--day') a.day = v();
47
51
  else if (k === '--show-projects') a.showProjects = true;
48
52
  else if (k === '--no-git') a.git = false;
49
53
  else if (k === '--no-open') a.open = false;
@@ -66,11 +70,11 @@ function openFile(file) {
66
70
  try { spawn(cmd[0], cmd[1], { detached: true, stdio: 'ignore' }).unref(); return true; } catch { return false; }
67
71
  }
68
72
 
69
- function cleanRoast(s) {
73
+ function cleanRoast(s, max = 14) {
70
74
  const r = String(s || '').replace(/\s+/g, ' ').trim();
71
75
  if (!r) return null;
72
76
  const words = r.split(' ');
73
- return words.length > 14 ? words.slice(0, 14).join(' ') + '…' : r;
77
+ return words.length > max ? words.slice(0, max).join(' ') + '…' : r;
74
78
  }
75
79
 
76
80
  async function main() {
@@ -99,6 +103,7 @@ async function main() {
99
103
  log(` done in ${((Date.now() - t0) / 1000).toFixed(1)} s`);
100
104
  }
101
105
 
106
+ delete wrapped.letter; // retired: no agent letter slide
102
107
  if (a.handle) wrapped.handle = { ...(wrapped.handle || {}), github: a.handle, display: a.handle };
103
108
  if (a.skin) wrapped.theme = { ...(wrapped.theme || {}), skin: a.skin };
104
109
  if (a.roast !== undefined) {
@@ -107,6 +112,17 @@ async function main() {
107
112
  // every number in the roast must exist in this wrap (agents sometimes reuse numbers from an older run)
108
113
  if (wrapped.roast && !roastNumbersOk(wrapped, wrapped.roast)) log(`warning: the roast cites numbers that aren't in this wrap; please re-write it from wrapped-${wrapped.year}.json`);
109
114
  }
115
+ if (a.quip !== undefined && wrapped.compare) {
116
+ const q = cleanRoast(a.quip, 18);
117
+ if (q && !roastNumbersOk(wrapped, q)) log(`warning: the quip cites numbers that aren't in this wrap (use compare.options); please re-write it`);
118
+ if (q) { wrapped.compare.text = q; wrapped.compare.by = a.roastBy || 'your agent'; }
119
+ }
120
+ for (const [key, val, max] of [['dayLine', a.day, 20]]) {
121
+ if (val === undefined) continue;
122
+ const t = String(val).replace(/\s+/g, ' ').trim(), words = t.split(' ');
123
+ wrapped[key] = t ? (words.length > max ? words.slice(0, max).join(' ') + '…' : t) : null;
124
+ if (wrapped[key] && !roastNumbersOk(wrapped, wrapped[key])) log(`warning: --${key === 'dayLine' ? 'day' : key} cites numbers that aren't in this wrap; please re-write it`);
125
+ }
110
126
  if (a.showProjects) wrapped.privacy = { ...(wrapped.privacy || {}), projectsHidden: false };
111
127
 
112
128
  fs.mkdirSync(a.out, { recursive: true });
@@ -79,7 +79,9 @@ const when = v => (typeof v === 'number' ? (v > 1e12 ? v : NaN) : typeof v === '
79
79
  const firstOk = (...v) => { for (const x of v) { const t = when(x); if (Number.isFinite(t)) return t; } return NaN; };
80
80
 
81
81
  function uriPath(u) {
82
- try { const x = new URL(u); return x.protocol === 'file:' ? fileURLToPath(x) : decodeURIComponent(x.pathname || ''); } catch { return null; }
82
+ let x; try { x = new URL(u); } catch { return null; }
83
+ if (x.protocol === 'file:') try { return fileURLToPath(x); } catch { /* a POSIX file URL read on Windows */ }
84
+ try { return decodeURIComponent(x.pathname || ''); } catch { return x.pathname || null; }
83
85
  }
84
86
 
85
87
  class Acc {
@@ -133,7 +135,7 @@ async function workspaceFolders(userDir) {
133
135
  let ids = []; try { ids = await fsp.readdir(root); } catch { return { folders, chatWs }; }
134
136
  for (const ws of ids) {
135
137
  const wj = await readJSON(path.join(root, ws, 'workspace.json'));
136
- const u = wj && (wj.folder || wj.workspace); if (u) folders.set(ws, basename(uriPath(u) || '').replace(/\.code-workspace$/, '') || null);
138
+ const u = wj && (wj.folder || wj.workspace); if (u) folders.set(ws, (basename(uriPath(u) || '') || '').replace(/\.code-workspace$/, '') || null);
137
139
  const db = await openRO(path.join(root, ws, 'state.vscdb')); if (!db) continue;
138
140
  try {
139
141
  for (const r of rows(db, "select cast(value as text) as v from ItemTable where key = 'composer.composerData'")) {
@@ -2,7 +2,7 @@
2
2
  // An award whose data is unknown (null) is omitted, never invented.
3
3
 
4
4
  export const AWARD_IDS = ['harness', 'model', 'tokens', 'spendings', 'prompts', 'sessions', 'streak', 'marathon', 'swarm',
5
- 'peakHour', 'politeness', 'backseat', 'lines', 'mostResumed', 'wordOfYear', 'agentClass', 'tier', 'skill', 'rateLimits',
5
+ 'peakHour', 'politeness', 'backseat', 'lines', 'mostResumed', 'wordOfYear', 'agentClass', 'tier', 'skill', 'tool', 'rateLimits',
6
6
  'age', 'twin', 'youreRight', 'modelRace', 'caps', 'screenshots', 'compactions', 'prs', 'ctrlZ', 'roast'];
7
7
 
8
8
  export const num = n => Math.round(n).toLocaleString('en-US');
@@ -83,8 +83,13 @@ export function buildAwards(ctx) {
83
83
  if (sk) add('skill', 'Skill of the Year', sk[0], `${num(sk[1])} runs`, 'skill calls');
84
84
  else if (mcp) add('skill', 'Skill of the Year', mcp[0], `${num(mcp[1])} MCP calls`, 'MCP calls');
85
85
 
86
- if (m.rateLimits) add('rateLimits', 'Rate limits', `${num(m.rateLimits.hits)} hit${m.rateLimits.hits === 1 ? '' : 's'}`,
87
- m.rateLimits.days ? `on ${m.rateLimits.days}+ days` : '', 'limit messages');
86
+ // Tool of the Year
87
+ const tools = mergeTools(m.tools);
88
+ const tl = top(tools);
89
+ if (tl) add('tool', 'Tool of the Year', tl[0], `${num(tl[1])} calls`, 'tool calls, merged across harnesses');
90
+
91
+ if (m.rateLimits) add('rateLimits', 'Limits reached', `${num(m.rateLimits.hits)} hit${m.rateLimits.hits === 1 ? '' : 's'}`,
92
+ m.rateLimits.days ? `on ${m.rateLimits.days}+ days · plan maxed` : 'plan maxed', 'limit messages');
88
93
 
89
94
  if (w.age) add('age', 'Agentic Age', w.age.years, w.age.why.join(' · '), 'rule table');
90
95
  if (w.twin) add('twin', 'Agent Twin', w.twin.name, `${w.twin.match}% match · ${w.twin.why}`, 'rule table');
@@ -130,3 +135,9 @@ function top(map) {
130
135
  for (const [k, v] of Object.entries(map)) if (v > 0 && (!best || v > best[1])) best = [k, v];
131
136
  return best;
132
137
  }
138
+
139
+ // same tool under different harness names counts once (Bash / exec / bash / run_shell_command …)
140
+ const TOOL = { bash: 'Bash', exec: 'Bash', shell: 'Bash', local_shell: 'Bash', run_shell_command: 'Bash', exec_command: 'Bash', terminal: 'Bash',
141
+ read: 'Read', read_file: 'Read', view: 'Read', edit: 'Edit', multiedit: 'Edit', str_replace: 'Edit', apply_patch: 'Edit', replace: 'Edit', write: 'Write', write_file: 'Write',
142
+ grep: 'Grep', search: 'Grep', glob: 'Glob', websearch: 'WebSearch', web_search: 'WebSearch', webfetch: 'WebFetch', web_fetch: 'WebFetch', agent: 'Agent', task: 'Agent', spawn_agent: 'Agent', send_message: 'SendMessage', sendmessage: 'SendMessage', todowrite: 'TodoWrite', todo_write: 'TodoWrite' };
143
+ export function mergeTools(t) { const out = {}; for (const [k, v] of Object.entries(t || {})) { const n = TOOL[k.toLowerCase()] || k; out[n] = (out[n] || 0) + v; } return out; }
@@ -0,0 +1,24 @@
1
+ // Facts for the tokens slide's comparison line. The joke itself is written by the user's own agent (SKILL.md, --quip);
2
+ // without an agent the page shows a plain factual line. Compares only what was read + written (input + output), never cache.
3
+ // Token counts ≈ words × 1.33 (English prose, modern BPE tokenizers); words from public word counts.
4
+ export const WORKS = [
5
+ ['Pride and Prejudice', 122_000], ['The Great Gatsby', 47_000], ['Moby-Dick', 210_000], ['Dune', 188_000],
6
+ ['War and Peace', 587_000], ['The Lord of the Rings', 481_000], ['every Harry Potter book', 1_084_000],
7
+ ['the complete works of Shakespeare', 884_000], ['the King James Bible', 783_000], ['The Hobbit', 95_000],
8
+ ['Frankenstein', 75_000], ['Crime and Punishment', 211_000], ['Don Quixote', 430_000], ['Ulysses', 265_000],
9
+ ['The Odyssey', 134_000], ['A Game of Thrones', 298_000], ['Les Misérables', 545_000], ['Alice in Wonderland', 27_000],
10
+ ['The Hitchhiker’s Guide to the Galaxy', 46_000], ['1984', 89_000], ['English Wikipedia', 4_900_000_000],
11
+ ].map(([name, words]) => ({ name, tokens: Math.round(words * 1.33) }));
12
+
13
+ const fmt = x => x >= 100 ? Math.round(x).toLocaleString('en-US') : x >= 10 ? x.toFixed(0) : x.toFixed(1);
14
+
15
+ /** up to 6 random works whose multiple reads well (3×–200k×), plus a plain factual default line; rnd injectable */
16
+ export function tokenComparison(ioTokens, rnd = Math.random) {
17
+ if (!ioTokens) return null;
18
+ const fits = WORKS.filter(w => { const x = ioTokens / w.tokens; return x >= 3 && x <= 200_000; });
19
+ const pool = (fits.length ? fits : WORKS).slice();
20
+ for (let i = pool.length - 1; i > 0; i--) { const j = Math.floor(rnd() * (i + 1)); [pool[i], pool[j]] = [pool[j], pool[i]]; }
21
+ const options = pool.slice(0, 6).map(w => ({ work: w.name, times: fmt(+(ioTokens / w.tokens).toPrecision(2)) }));
22
+ const o = options[0];
23
+ return { ioTokens, options, text: `That’s ${o.work}, ${o.times} times.`, by: null };
24
+ }
@@ -1,3 +1,5 @@
1
+ import { tokenComparison } from './compare.mjs';
2
+ import { mergeTools } from './awards.mjs';
1
3
  // Stats engine: HarnessFacts[] (+ optional Extras) → Wrapped (CONTRACT §4). Pure: no I/O, no network.
2
4
  import { spendings, normalizeModel, modelLabel, PRICES } from './spendings.mjs';
3
5
  import { tierFor } from './tiers.mjs';
@@ -154,12 +156,13 @@ export function buildWrapped(facts, { year, extras = null, handle = null, now =
154
156
  const modelIds = Object.keys(m.models);
155
157
  const tokens = facts.some(f => f.models) ? modelIds.reduce((a, id) => a + tokSum(m.models[id]), 0) : null;
156
158
  const cacheRead = modelIds.reduce((a, id) => a + (m.models[id].cacheRead || 0), 0);
159
+ const io = modelIds.reduce((a, id) => a + (m.models[id].input || 0) + (m.models[id].output || 0), 0);
157
160
  // readers report toolCalls incl. counts from before tool names exist (e.g. Claude Code stats-cache); fall back to summing names
158
161
  const toolCalls = facts.some(f => f.toolCalls) ? facts.reduce((a, f) => a + (f.toolCalls || (f.tools ? Object.values(f.tools).reduce((x, y) => x + y, 0) : 0)), 0) : (m.tools ? Object.values(m.tools).reduce((a, b) => a + b, 0) : null);
159
162
  const totals = {
160
163
  prompts: m.prompts, sessions: m.sessions, activeDays: activeDates.length,
161
164
  streak: { days: streak.days, from: streak.from, to: streak.to },
162
- tokens, cacheShare: tokens ? r2(cacheRead / tokens) : null,
165
+ tokens, ioTokens: io || null, cacheShare: tokens ? r2(cacheRead / tokens) : null,
163
166
  toolCalls, subagents: m.subagents,
164
167
  };
165
168
 
@@ -182,8 +185,24 @@ export function buildWrapped(facts, { year, extras = null, handle = null, now =
182
185
  };
183
186
  const raceWinners = raceWinnersOf(series.race);
184
187
 
188
+ // story extras: busiest day, top 5 lists, "guess your #1 model" quiz
189
+ const dayList = Object.entries(series.days).sort((a, b) => b[1] - a[1]);
190
+ const busiest = dayList.length ? { date: dayList[0][0], prompts: dayList[0][1],
191
+ peakHour: (m.hours || []).indexOf(Math.max(...(m.hours || [0]))) } : null;
192
+ const topN = (o, n = 5) => Object.entries(o || {}).filter(([, v]) => v > 0).sort((a, b) => b[1] - a[1]).slice(0, n);
193
+ const top5 = { tools: topN(mergeTools(m.tools)), skills: topN(m.skills), models: models.slice(0, 5).map(x => [x.label, x.share]) };
194
+ const DECOYS = ['Opus 5.5', 'Sonnet 5.5', 'GPT-6 Astra', 'Gemini 3 Pro', 'Opus 5', 'Devstral 2', 'Qwen3 Coder', 'Haiku 5.5'];
195
+ let quiz = null;
196
+ if (models.length) {
197
+ const answer = models[0].label;
198
+ const pool = [...models.slice(1, 3).map(x => x.label), ...DECOYS].filter((x, i, a) => x !== answer && a.indexOf(x) === i);
199
+ const choices = [answer, ...pool.slice(0, 2)];
200
+ for (let i = choices.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [choices[i], choices[j]] = [choices[j], choices[i]]; }
201
+ quiz = { question: 'Which model did you use most?', choices, answer, share: models[0].share };
202
+ }
203
+
185
204
  // tier, age, twin
186
- const tier = tierFor(m.prompts, totals.activeDays);
205
+ const tier = tierFor(m.prompts, totals.activeDays, totals.tokens);
187
206
  const hTot = m.hours ? m.hours.reduce((a, b) => a + b, 0) : 0;
188
207
  const wTot = m.weekdays ? m.weekdays.reduce((a, b) => a + b, 0) : 0;
189
208
  const shares = {
@@ -196,7 +215,7 @@ export function buildWrapped(facts, { year, extras = null, handle = null, now =
196
215
  const ageR = m.prompts ? agenticAge({ ...shares, streakDays: streak.days }) : null;
197
216
  const coAuthored = extras && extras.commits ? Object.values(extras.commits.coAuthored || {}).reduce((a, b) => a + b, 0) : null;
198
217
  const twin = m.prompts ? agentTwin({
199
- ...shares, agentClass: tier.power,
218
+ ...shares, agentClass: tier.power, topTier: tier.top === 1,
200
219
  subagentsPerSession: m.subagents != null && m.sessions ? m.subagents / m.sessions : null,
201
220
  longestActiveHours: m.longest ? m.longest.activeHours : null,
202
221
  harnessShares: harnesses.map(h => h.share), coAuthoredCommits: coAuthored,
@@ -208,6 +227,8 @@ export function buildWrapped(facts, { year, extras = null, handle = null, now =
208
227
 
209
228
  const w = {
210
229
  schema: 1, year, generatedAt: now.toISOString(),
230
+ compare: tokenComparison(totals.ioTokens),
231
+ busiest, top5, quiz, dayLine: null,
211
232
  handle: h,
212
233
  coverage: facts.map(f => ({ harness: f.harness, label: f.label, from: f.coverage?.from ?? null, to: f.coverage?.to ?? null, notes: f.coverage?.notes || [] })),
213
234
  theme: pickTheme(top),
@@ -1,6 +1,6 @@
1
1
  // The roast is written by the user's own agent (see SKILL.md). We only check it cites numbers that exist in this wrap.
2
2
  export function roastNumbersOk(w, roast) {
3
- const hay = JSON.stringify(w.awards || []) + JSON.stringify(w.totals || {});
3
+ const hay = JSON.stringify(w.awards || []) + JSON.stringify(w.totals || {}) + JSON.stringify(w.compare?.options || []) + JSON.stringify(w.busiest || {}) + JSON.stringify(w.top5 || {});
4
4
  const nums = String(roast || '').match(/\d[\d,.]*/g) || [];
5
5
  return nums.every(n => { const t = n.replace(/[.,]$/, ''); return hay.includes(t) || hay.includes(t.replace(/[,.]/g, '')); });
6
6
  }
@@ -1,16 +1,19 @@
1
1
  // Top X%: fixed tiers on score = prompts × active days (spec §16). Thresholds are published, not percentiles.
2
2
  export const TIERS = [
3
- { top: 1, min: 1_000_000, power: 'Swarm Commander', line: 'You don’t code. You conduct.' },
4
- { top: 5, min: 300_000, power: 'Fleet Admiral', line: 'Your agents work shifts.' },
5
- { top: 10, min: 100_000, power: 'Agent Wrangler', line: 'Many agents, one lasso.' },
6
- { top: 25, min: 20_000, power: 'Prompt Smith', line: 'You forge prompts daily.' },
7
- { top: 50, min: 3_000, power: 'Pair Programmer', line: 'Two heads, one keyboard.' },
8
- { top: 80, min: 0, power: 'Side Quester', line: 'Agents on the weekend, legend in the making.' },
3
+ { top: 1, min: 1_000_000, power: 'Tokenmaxxer', line: 'Limits are a suggestion.' },
4
+ { top: 5, min: 300_000, power: 'Vibe Engineer', line: 'Vibes, but with tests.' },
5
+ { top: 10, min: 100_000, power: 'Agentic Engineer', line: 'Ships first, reads the diff later.' },
6
+ { top: 25, min: 20_000, power: 'Vibecoder', line: 'Accept all. Pray.' },
7
+ { top: 50, min: 3_000, power: 'Prompt Enjoyer', line: 'Two heads, one keyboard.' },
8
+ { top: 80, min: 0, power: 'Vibe Tourist', line: 'Just here for the vibes.' },
9
9
  ];
10
+ // past this many tokens (all of them, cache included) the class is the meme itself
11
+ export const UNLIMITED = { tokens: 200_000_000_000, power: 'Unlimited Tokens', line: 'Rate limits fear you.' };
10
12
 
11
13
  /** → { score, top, label, power } (line is extra, used by the agentClass award, not in wrapped.tier) */
12
- export function tierFor(prompts, activeDays) {
14
+ export function tierFor(prompts, activeDays, tokens = 0) {
13
15
  const score = Math.max(0, Math.round((prompts || 0) * (activeDays || 0)));
14
16
  const t = TIERS.find(t => score >= t.min);
15
- return { score, top: t.top, label: `Top ${t.top}%`, power: t.power, line: t.line };
17
+ const c = tokens >= UNLIMITED.tokens ? UNLIMITED : t;
18
+ return { score, top: t.top, label: `Top ${t.top}%`, power: c.power, line: c.line };
16
19
  }
@@ -1,5 +1,5 @@
1
1
  // Agent Twin (spec §17, draft archetypes). First match wins; Swarm Conductor is skipped when the
2
- // agent class already is a swarm (top tier "Swarm Commander").
2
+ // agent class is already top tier.
3
3
  // Match % = 60 + 10 × (value − threshold) / threshold, rounded, capped at 99 (Tinkerer = 60).
4
4
  // Owner 2026: The Marathoner, 60 + 10 × (197.85 − 48) / 48 = 91.2 → 91.
5
5
 
@@ -8,7 +8,7 @@ const pct = x => Math.round(x * 100);
8
8
  const match = (v, t) => Math.min(99, Math.max(60, Math.round(60 + 10 * (v - t) / t)));
9
9
 
10
10
  export const ARCHETYPES = [
11
- { name: 'The Swarm Conductor', test: p => !/swarm/i.test(p.agentClass || '') && p.subagentsPerSession != null && p.subagentsPerSession > 2,
11
+ { name: 'The Swarm Conductor', test: p => !p.topTier && !/swarm/i.test(p.agentClass || '') && p.subagentsPerSession != null && p.subagentsPerSession > 2,
12
12
  match: p => match(p.subagentsPerSession, 2), why: p => `${p.subagentsPerSession.toFixed(1)} subagents per session` },
13
13
  { name: 'The Night Architect', test: p => p.lateShare != null && p.lateShare > 0.30,
14
14
  match: p => match(p.lateShare, 0.30), why: p => `${pct(p.lateShare)}% after 22:00` },