usehour 0.3.0 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/hour.mjs +5 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Your year of building with AI, as Wrapped-style cards.
4
4
 
5
5
  ```
6
- npx usehour@0.3.0
6
+ npx usehour@0.3.1
7
7
  ```
8
8
 
9
9
  - Asks before it reads anything, and lists the folders it will read.
package/hour.mjs CHANGED
@@ -30,7 +30,7 @@ import { spawn } from "node:child_process";
30
30
  import { Worker, isMainThread, parentPort, workerData } from "node:worker_threads";
31
31
  import { fileURLToPath } from "node:url";
32
32
 
33
- const VERSION = "0.3.0";
33
+ const VERSION = "0.3.1";
34
34
  const API_DEFAULT = "https://usehour.com/api";
35
35
 
36
36
  /* ------------------------------------------------------------------ patterns */
@@ -376,7 +376,7 @@ function cards(m, name) {
376
376
  if (m.proof.codingSessions >= 5) C.push({ id: "edge", bg: "#F7F3EC", fg: "#0B0B0A", dot: "#F2601F", pat: "ring", pct: tested, ask: tested < 0.75 ? "Your growth edge" : "Your strength", big: `${pct(tested)}%`, line: tested < 0.75 ? "of coding sessions ran a test. Push that higher." : "of coding sessions ran a test. Keep it that way.", bs: "30cqw" });
377
377
  if (m.promptProfile && m.promptProfile.length >= 3) {
378
378
  const hp = m.promptProfile, best = [...hp].sort((a, b) => b.value / b.notable - a.value / a.notable)[0];
379
- C.push({ id: "prompting", bg: "#F7F3EC", fg: "#0B0B0A", bs: "11cqw", rows: hp.map((h) => [h.label, habitFill(h), `${pct(h.value)}%`]), ask: "How you prompt", big: best.label, line: `Your strongest habit: ${pct(best.value)}% of ${best.what}.` });
379
+ C.push({ id: "prompting", bg: "#F7F3EC", fg: "#0B0B0A", bs: "8.6cqw", rows: hp.map((h) => [h.label, habitFill(h), `${pct(h.value)}%`]), ask: "How you prompt", big: best.label, line: `Your strongest habit.` });
380
380
  }
381
381
  C.push({ id: "summary", bg: "#0B0B0A", fg: "#F4F1EA", summary: true, who: name || "", period: `${monthYear(m.window.first)} – ${monthYear(m.window.last)}`, type: type.name,
382
382
  stats: [["Sessions", m.sessions.total.toLocaleString("en")], ["Busiest hour", hourLabel(m.busiestHour)], ["Go-to prompt", m.goToPrompt ? `“${m.goToPrompt.text}”` : "–"], ["Agents at once", String(m.parallelMax)], ["Made it prove it", `${pct(verify)}%`], ["Model", top ? top.name.replace(/^Claude /, "") : "–"]] });
@@ -392,7 +392,7 @@ const CLAIM_CSS = String.raw`
392
392
 
393
393
  .claimc .cdots{margin-top:4cqw;height:14cqw;background-image:radial-gradient(circle,rgba(244,241,234,.95) 0 .95cqw,transparent 1.05cqw);background-size:3.6cqw 3.6cqw;-webkit-mask-image:linear-gradient(115deg,transparent 8%,#000 55%,transparent 96%);mask-image:linear-gradient(115deg,transparent 8%,#000 55%,transparent 96%)}
394
394
  .claimc .pill{margin-top:4cqw;align-self:flex-start;padding:2cqw 3.6cqw;border-radius:999px;background:rgba(244,241,234,.1);box-shadow:inset 0 0 0 .3cqw rgba(244,241,234,.22);font:4.2cqw var(--mono)}.claimc .pill span{opacity:.6}.claimc .pill b{font-weight:500}
395
- .claimc .cta{position:relative;z-index:5;margin-top:5cqw;height:13cqw;border-radius:999px;border:0;background:#F4F1EA;color:#0B0B0A;font:600 4.6cqw var(--sans);cursor:pointer}
395
+ .claimc .cta{position:relative;z-index:5;margin-top:5cqw;min-height:15cqw;padding:3.4cqw 0;border-radius:999px;border:0;background:#F4F1EA;color:#0B0B0A;font:600 5.4cqw var(--sans);cursor:pointer}
396
396
  .claimbar{margin-top:28px;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;background:var(--ink);color:#F4F1EA;border-radius:22px;padding:22px 24px}.claimbar b{display:block;font-size:20px;letter-spacing:-.02em}.claimbar span{font-size:14px;opacity:.8}
397
397
  .claimbar button{height:48px;padding:0 22px;border-radius:999px;border:0;background:#F4F1EA;color:var(--ink);font:600 15px var(--sans);cursor:pointer}
398
398
  .cl{position:fixed;inset:0;z-index:50;background:rgba(11,11,10,.55);display:flex;align-items:center;justify-content:center;padding:16px}.cl[hidden]{display:none}
@@ -598,7 +598,7 @@ h2.sec{margin:64px 0 18px;font-size:30px;letter-spacing:-.04em;font-weight:650}
598
598
  .ft{display:flex;justify-content:space-between;align-items:center;margin-top:6cqw;font-size:3.4cqw;opacity:.8}.ft .b{display:flex;align-items:center;gap:1.6cqw;font-weight:600}.ft svg{width:4.6cqw;height:4.6cqw}.ft .u{font-family:var(--mono)}
599
599
  .sum{margin-top:auto;display:grid;grid-template-columns:1fr 1fr;gap:4.5cqw 5cqw}.sum div{border-top:.35cqw solid currentColor;padding-top:2cqw}.sum small{display:block;font-size:3.4cqw;opacity:.75;margin-bottom:.6cqw}.sum b{font-size:6.2cqw;letter-spacing:-.035em;font-weight:650;line-height:1}
600
600
  .arch{font-size:11.5cqw;line-height:.92;letter-spacing:-.05em;font-weight:650;margin:2cqw 0 6cqw}
601
- .rows{margin-top:7cqw;display:grid;gap:3.4cqw}.rows div{display:grid;grid-template-columns:1fr auto 10cqw;align-items:center;gap:3cqw;font-size:4.3cqw;font-weight:500}.rows em{display:flex;gap:1.1cqw}.rows u{width:2.7cqw;height:2.7cqw;border-radius:50%;background:currentColor;opacity:.14}.rows u.on{opacity:1;background:#8B5FD9}.rows b{text-align:right;font-weight:600}
601
+ .rows{margin-top:6cqw;display:grid;gap:3.2cqw}.rows div{display:grid;grid-template-columns:minmax(0,1fr) auto 9cqw;align-items:center;gap:2.6cqw;font-size:4cqw;font-weight:500;white-space:nowrap}.rows div>span{overflow:hidden;text-overflow:ellipsis}.rows em{display:flex;gap:.9cqw}.rows u{width:2.3cqw;height:2.3cqw;border-radius:50%;background:currentColor;opacity:.14}.rows u.on{opacity:1;background:#8B5FD9}.rows b{text-align:right;font-weight:600}
602
602
  ${api ? CLAIM_CSS : ""}
603
603
  .grad{background:linear-gradient(100deg,#4F88FF 0%,#B0ACFE 38%,#FB65C2 72%,#FD2980 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
604
604
  </style></head><body>
@@ -662,7 +662,7 @@ g.font="650 "+W*.115+"px "+F;g.fillStyle=grad();g.fillText(c.type,P,W*.33);g.fil
662
662
  g.font="450 "+W*.056+"px "+F;const L=wrapText(g,c.line,(W-2*P)*.92);L.reverse().forEach((l,i)=>g.fillText(l,P,y-i*W*.07));y-=L.length*W*.07+W*.034;
663
663
  let bs=parseFloat(c.bs||"19")/100*W;g.font="650 "+bs+"px "+F;let Bl=wrapText(g,c.big,W-2*P);while(Bl.length>1&&Bl[Bl.length-1].length<=2&&bs>W*.08){bs*=.92;g.font="650 "+bs+"px "+F;Bl=wrapText(g,c.big,W-2*P)}g.fillStyle=c.grad?grad():c.fg;Bl.reverse().forEach((l,i)=>g.fillText(l,P,y-i*bs*.9));
664
664
  g.fillStyle=c.fg;g.globalAlpha=.85;g.font="500 "+W*.044+"px "+F;wrapText(g,c.ask,(W-2*P)*.62).forEach((l,i)=>g.fillText(l,P,W*.16+i*W*.055));g.globalAlpha=1;
665
- if(c.rows){const d=W*.027,gap=W*.011,pw=W*.1,dx=W-P-pw-10*d-9*gap;c.rows.forEach((w,k)=>{const yy=W*.3+k*W*.1;g.fillStyle=c.fg;g.font="500 "+W*.043+"px "+F;g.fillText(w[0],P,yy);g.font="600 "+W*.043+"px "+F;g.textAlign="right";g.fillText(w[2],W-P,yy);g.textAlign="left";for(let q=0;q<10;q++){const on=q<Math.round(w[1]*10);g.globalAlpha=on?1:.14;g.fillStyle=on?"#8B5FD9":c.fg;g.beginPath();g.arc(dx+q*(d+gap)+d/2,yy-W*.015,d/2,0,7);g.fill()}g.globalAlpha=1})}}
665
+ if(c.rows){const d=W*.023,gap=W*.009,pw=W*.135,dx=W-P-pw-10*d-9*gap;c.rows.forEach((w,k)=>{const yy=W*.29+k*W*.083;g.fillStyle=c.fg;g.font="500 "+W*.04+"px "+F;g.fillText(w[0],P,yy);g.font="600 "+W*.04+"px "+F;g.textAlign="right";g.fillText(w[2],W-P,yy);g.textAlign="left";for(let q=0;q<10;q++){const on=q<Math.round(w[1]*10);g.globalAlpha=on?1:.14;g.fillStyle=on?"#8B5FD9":c.fg;g.beginPath();g.arc(dx+q*(d+gap)+d/2,yy-W*.015,d/2,0,7);g.fill()}g.globalAlpha=1})}}
666
666
  async function save(c){try{await document.fonts.ready}catch(e){}const cv=document.createElement("canvas");cv.width=1080;cv.height=1350;paint(cv.getContext("2d"),1080,1350,c);const a=document.createElement("a");a.download="hour-"+c.id+".png";a.href=cv.toDataURL("image/png");document.body.appendChild(a);a.click();a.remove()}
667
667
  let cur=0,timer=null,t0=0,paused=false;const DUR=6000;
668
668
  const $=id=>document.getElementById(id),slot=$("slot"),bars=$("bars"),grid=$("grid");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usehour",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Your year of building with AI, as Wrapped-style cards, and an optional private profile. Reads your Claude Code and Codex logs locally.",
5
5
  "type": "module",
6
6
  "bin": { "usehour": "hour.mjs" },