ai-wrapped 1.13.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +8 -3
  2. package/bin/cli.ts +10 -3
  3. package/bin/launcher.mjs +47 -0
  4. package/dist/assets/{BotAvatar-DBsbq7ca.js → BotAvatar-jAAwskyf.js} +1 -1
  5. package/dist/assets/{CrystalizedBall-Cpb3-_Ei.js → CrystalizedBall-B6zamRF3.js} +1 -1
  6. package/dist/assets/{EchoText-BGLBMBIB.js → EchoText-4xoktZq0.js} +1 -1
  7. package/dist/assets/{GlowCursor-CCIshutg.js → GlowCursor-BZTqQxxS.js} +1 -1
  8. package/dist/assets/{Heatwave-DOd4ZAV5.js → Heatwave-DfXXgJC0.js} +1 -1
  9. package/dist/assets/{LightTunnel-Cmhal5gj.js → LightTunnel-EZozMoED.js} +1 -1
  10. package/dist/assets/{LineSpiral-DGdfRPle.js → LineSpiral-Db8XN1bn.js} +1 -1
  11. package/dist/assets/{SideRays-Dy6_gRFG.js → SideRays-BAE7LEhp.js} +1 -1
  12. package/dist/assets/{SlicedWaves-BoYUO0Z_.js → SlicedWaves-DYJVYwCf.js} +1 -1
  13. package/dist/assets/{SplitFlapText-B4X0GqT2.js → SplitFlapText-Bvst7h5n.js} +1 -1
  14. package/dist/assets/{Strands-DO5P5Q2H.js → Strands-13hefXvF.js} +1 -1
  15. package/dist/assets/{TechText-CjMXCY_m.js → TechText-Ce5ji9Vm.js} +1 -1
  16. package/dist/assets/{index-DOJtWYpx.css → index-Cu2YFiKs.css} +1 -1
  17. package/dist/assets/index-s2JW0IAt.js +161 -0
  18. package/dist/index.html +2 -2
  19. package/package.json +2 -2
  20. package/skills/ai-wrapped/SKILL.md +13 -4
  21. package/src/bun/coverage.test.ts +47 -0
  22. package/src/bun/coverage.ts +39 -0
  23. package/src/bun/discovery/additional.ts +9 -0
  24. package/src/bun/discovery/index.ts +2 -0
  25. package/src/bun/headless.ts +17 -0
  26. package/src/bun/local.ts +28 -1
  27. package/src/bun/parsers/additional.test.ts +23 -0
  28. package/src/bun/parsers/additional.ts +68 -0
  29. package/src/bun/parsers/index.ts +3 -1
  30. package/src/shared/buildPayload.ts +1 -0
  31. package/src/shared/schema.ts +3 -1
  32. package/src/shared/shareData.test.ts +2 -2
  33. package/src/shared/shareData.ts +27 -1
  34. package/dist/assets/index-DlmdUHms.js +0 -161
package/README.md CHANGED
@@ -34,12 +34,15 @@ Built on top of [agent-sessions](https://github.com/jazzyalex/agent-sessions) se
34
34
  - **agy (Antigravity CLI)** — `~/.gemini/antigravity-cli/brain` transcripts
35
35
  - **DeepSeek Harness** — `~/.dsh/sessions` logs (plain or zstd)
36
36
  - **Grok CLI** — `~/.grok/sessions/*/*/updates.jsonl`
37
+ - **ZCode (Z.ai)** — `~/.zcode/cli/db/db.sqlite` (`model_usage` rows)
37
38
  - **Cursor CLI** — `~/.cursor/projects/*/agent-transcripts` (sessions, messages and tool calls; Cursor keeps token counts on its servers)
38
39
 
39
- The newer readers (agy, DeepSeek Harness, Grok, Cursor) take numbers only: tokens, models, times and counts, never message text.
40
+ The newer readers (agy, DeepSeek Harness, Grok, ZCode, Cursor) take numbers only: tokens, models, times and counts, never message text.
40
41
 
41
42
  Usage from chat apps and provider APIs (claude.ai, ChatGPT, Anthropic/OpenAI usage APIs, Cursor's dashboard) can be added as totals with `--cloud`; see [agents.md](https://ai-wrapped.com/agents.md). Missing a harness? Open an issue or a PR with a discoverer and parser in `src/bun/discovery/additional.ts` and `src/bun/parsers/additional.ts`.
42
43
 
44
+ > **Older sessions may be gone.** Some agents delete old logs; Claude Code keeps 30 days unless you raise `cleanupPeriodDays` in `~/.claude/settings.json` (e.g. `3650`). The wrapped notes which agents are affected and from which day their numbers start.
45
+
43
46
  ## What It Shows
44
47
 
45
48
  - Total sessions, messages, tool calls, tokens, and estimated cost
@@ -60,11 +63,13 @@ npx ai-wrapped@latest
60
63
  bunx ai-wrapped@latest
61
64
  ```
62
65
 
63
- Flags: `--no-open` (only print the link), `--no-scan`, `--version`, `--uninstall`
66
+ Works with Node.js or Bun. The app runs on [Bun](https://bun.sh); if it isn't installed, `npx` fetches it for the run.
67
+
68
+ Repository names show locally; when you share a link or image, it asks whether to hide them (as codes like `7f3a-c21e`). Flags: `--hide-repos` (codes locally too), `--no-open` (only print the link), `--no-scan`, `--version`, `--uninstall`
64
69
 
65
70
  ## For agents: the AI Wrapped skill
66
71
 
67
- Any coding agent with a shell (Claude Code, Codex, agy, DeepSeek Harness, Grok, Cursor, OpenCode, …) can build your wrapped, add its own commentary to every story, and publish a link. The skill is plain Markdown in [`skills/ai-wrapped/SKILL.md`](skills/ai-wrapped/SKILL.md).
72
+ Any coding agent with a shell (Claude Code, Codex, agy, DeepSeek Harness, Grok, ZCode, Cursor, OpenCode, …) can build your wrapped, add its own commentary to every story, and publish a link. The skill is plain Markdown in [`skills/ai-wrapped/SKILL.md`](skills/ai-wrapped/SKILL.md).
68
73
 
69
74
  ```bash
70
75
  bunx ai-wrapped@latest skill install # copies SKILL.md into ~/.claude/skills, ~/.codex/skills, ~/.agents/skills
package/bin/cli.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
- import { dirname, join } from "node:path";
3
+ import { join } from "node:path";
4
4
 
5
- const PKG_ROOT = join(dirname(Bun.main), "..");
5
+ const PKG_ROOT = join(import.meta.dir, "..");
6
6
  const HOME = Bun.env.HOME || Bun.env.USERPROFILE || "";
7
7
  const LEGACY_APP_DIR = `${HOME}/.ai-wrapped/app`;
8
8
  /** The built web app (vite build of src/mainview). */
@@ -110,6 +110,7 @@ async function main() {
110
110
  console.log(" Commands:");
111
111
  console.log(" (none) Open your wrapped in the browser (runs locally)");
112
112
  console.log(" [--no-open] Only print the link");
113
+ console.log(" [--hide-repos] Show repository names as codes (sharing asks either way)");
113
114
  console.log(" stats [--range R] Print a JSON summary (R: 2026, last7, last30, last90, last365)");
114
115
  console.log(" [--out file] Also write the full wrapped data to a file");
115
116
  console.log(" view [--range R] [--notes file|-] [--no-open]");
@@ -144,7 +145,13 @@ async function main() {
144
145
  await rm(LEGACY_APP_DIR, { recursive: true, force: true }).catch(() => undefined);
145
146
 
146
147
  const { runLocal } = await import("../src/bun/local");
147
- await runLocal({ appDir: APP_DIR, open: !has("no-open"), scan: !has("no-scan") });
148
+ await runLocal({
149
+ appDir: APP_DIR,
150
+ open: !has("no-open"),
151
+ scan: !has("no-scan"),
152
+ // Locally names are shown; sharing asks whether to hide them.
153
+ repoNames: has("hide-repos") ? "hide" : "show",
154
+ });
148
155
  }
149
156
 
150
157
  main().catch((err) => {
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ // Entry point for `npx ai-wrapped` / `bunx ai-wrapped`. The CLI itself runs on
3
+ // Bun (bun:sqlite, Bun.serve, zstd), so this small Node script finds Bun:
4
+ // 1. already running under Bun -> run the CLI in-process
5
+ // 2. `bun` on PATH -> run the CLI with it
6
+ // 3. otherwise -> `npx -y bun` (downloaded once, then cached)
7
+ import { spawn, spawnSync } from "node:child_process";
8
+ import { dirname, join } from "node:path";
9
+ import { fileURLToPath, pathToFileURL } from "node:url";
10
+
11
+ const cli = join(dirname(fileURLToPath(import.meta.url)), "cli.ts");
12
+ const args = process.argv.slice(2);
13
+ const isWindows = process.platform === "win32";
14
+
15
+ if (typeof globalThis.Bun !== "undefined") {
16
+ await import(pathToFileURL(cli).href);
17
+ } else {
18
+ const run = (command, commandArgs) =>
19
+ new Promise((resolve) => {
20
+ const child = spawn(command, commandArgs, { stdio: "inherit", shell: isWindows });
21
+ // Ctrl+C reaches the child directly; the launcher just waits for it.
22
+ const ignore = () => undefined;
23
+ process.on("SIGINT", ignore);
24
+ process.on("SIGTERM", ignore);
25
+ child.on("error", () => resolve(127));
26
+ child.on("exit", (code, signal) => resolve(signal ? 130 : (code ?? 0)));
27
+ });
28
+
29
+ const hasBun = spawnSync("bun", ["--version"], { stdio: "ignore", shell: isWindows }).status === 0;
30
+ let code;
31
+ if (hasBun) {
32
+ code = await run("bun", [cli, ...args]);
33
+ } else {
34
+ console.error("\n AI Wrapped runs on Bun, which isn't installed. Fetching it for this run (one-time download)…\n");
35
+ code = await run("npx", ["-y", "bun@^1.3", cli, ...args]);
36
+ if (code === 127) {
37
+ console.error("\n Couldn't start Bun. Install it once and try again:");
38
+ console.error(
39
+ isWindows
40
+ ? ' powershell -c "irm bun.sh/install.ps1 | iex"'
41
+ : " curl -fsSL https://bun.sh/install | bash",
42
+ );
43
+ console.error(" then run: npx ai-wrapped@latest\n");
44
+ }
45
+ }
46
+ process.exit(code);
47
+ }