agent-session-inspector 0.1.3 → 0.1.5

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 (143) hide show
  1. package/README.md +154 -64
  2. package/VERSION +1 -1
  3. package/app/.next/BUILD_ID +1 -1
  4. package/app/.next/app-path-routes-manifest.json +2 -0
  5. package/app/.next/build-manifest.json +3 -3
  6. package/app/.next/prerender-manifest.json +5 -5
  7. package/app/.next/required-server-files.json +1 -1
  8. package/app/.next/routes-manifest.json +15 -0
  9. package/app/.next/server/app/_global-error.html +1 -1
  10. package/app/.next/server/app/_global-error.rsc +1 -1
  11. package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/_not-found.html +1 -1
  17. package/app/.next/server/app/_not-found.rsc +16 -16
  18. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
  19. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +19 -18
  20. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -3
  21. package/app/.next/server/app/api/analytics/route.js +2 -2
  22. package/app/.next/server/app/api/analytics/route.js.nft.json +1 -1
  23. package/app/.next/server/app/api/logs/route.js +2 -2
  24. package/app/.next/server/app/api/logs/route.js.nft.json +1 -1
  25. package/app/.next/server/app/api/pricing/route/app-paths-manifest.json +3 -0
  26. package/app/.next/server/app/api/pricing/route/build-manifest.json +12 -0
  27. package/app/.next/server/app/api/pricing/route/server-reference-manifest.json +4 -0
  28. package/app/.next/server/app/api/pricing/route.js +6 -0
  29. package/app/.next/server/app/api/pricing/route.js.map +5 -0
  30. package/app/.next/server/app/api/pricing/route.js.nft.json +1 -0
  31. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +3 -0
  32. package/app/.next/server/app/api/providers/route.js +2 -2
  33. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  34. package/app/.next/server/app/api/search/route.js +2 -2
  35. package/app/.next/server/app/api/search/route.js.nft.json +1 -1
  36. package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route/app-paths-manifest.json +3 -0
  37. package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route/build-manifest.json +12 -0
  38. package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route/server-reference-manifest.json +4 -0
  39. package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route.js +7 -0
  40. package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route.js.map +5 -0
  41. package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route.js.nft.json +1 -0
  42. package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route_client-reference-manifest.js +3 -0
  43. package/app/.next/server/app/api/sessions/[provider]/[id]/route.js +2 -2
  44. package/app/.next/server/app/api/sessions/[provider]/[id]/route.js.nft.json +1 -1
  45. package/app/.next/server/app/api/sessions/route.js +2 -2
  46. package/app/.next/server/app/api/sessions/route.js.nft.json +1 -1
  47. package/app/.next/server/app/index.html +1 -1
  48. package/app/.next/server/app/index.rsc +18 -18
  49. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +16 -16
  50. package/app/.next/server/app/index.segments/_full.segment.rsc +18 -18
  51. package/app/.next/server/app/index.segments/_tree.segment.rsc +3 -3
  52. package/app/.next/server/app/page.js.nft.json +1 -1
  53. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/sessions/[provider]/[id]/page.js.nft.json +1 -1
  55. package/app/.next/server/app/sessions/[provider]/[id]/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app-paths-manifest.json +2 -0
  57. package/app/.next/server/chunks/1oeh_server_app_api_sessions_[provider]_[id]_reveal_route_actions_1mqlatn.js +3 -0
  58. package/app/.next/server/chunks/[root-of-the-server]__0dyq0rc._.js +3 -0
  59. package/app/.next/server/chunks/[root-of-the-server]__0kgkqhn._.js +3 -0
  60. package/app/.next/server/chunks/[root-of-the-server]__0yxic1z._.js +6 -0
  61. package/app/.next/server/chunks/[root-of-the-server]__10p8y9z._.js +3 -0
  62. package/app/.next/server/chunks/[root-of-the-server]__1cceere._.js +3 -0
  63. package/app/.next/server/chunks/[root-of-the-server]__1eclfq8._.js +3 -0
  64. package/app/.next/server/chunks/[root-of-the-server]__1lz20wm._.js +3 -0
  65. package/app/.next/server/chunks/[root-of-the-server]__1zdh1mi._.js +3 -0
  66. package/app/.next/server/chunks/[root-of-the-server]__20epvou._.js +3 -0
  67. package/app/.next/server/chunks/_next-internal_server_app_api_pricing_route_actions_06i5bdm.js +3 -0
  68. package/app/.next/server/chunks/ssr/[root-of-the-server]__1ei65vj._.js +1 -1
  69. package/app/.next/server/chunks/ssr/_0136j91._.js +1 -1
  70. package/app/.next/server/chunks/ssr/_0f8nmc3._.js +1 -1
  71. package/app/.next/server/chunks/ssr/_0o294sf._.js +3 -0
  72. package/app/.next/server/chunks/ssr/_1-5v1mi._.js +3 -0
  73. package/app/.next/server/chunks/ssr/_12__495._.js +1 -1
  74. package/app/.next/server/chunks/ssr/_1ck8cbf._.js +1 -1
  75. package/app/.next/server/chunks/ssr/src_app_page_tsx_1chiuah._.js +1 -1
  76. package/app/.next/server/chunks/ssr/src_app_sessions_[provider]_[id]_page_tsx_0uf635h._.js +3 -3
  77. package/app/.next/server/middleware-build-manifest.js +3 -3
  78. package/app/.next/server/pages/404.html +1 -1
  79. package/app/.next/server/pages/500.html +1 -1
  80. package/app/.next/server/server-reference-manifest.js +1 -1
  81. package/app/.next/server/server-reference-manifest.json +1 -1
  82. package/app/.next/static/chunks/043k5ranw7p1-.js +1 -0
  83. package/app/.next/static/chunks/0mihgzifdany7.js +1 -0
  84. package/app/.next/static/chunks/{367imffzz5g8x.css → 0ua57-s0meis5.css} +2 -2
  85. package/app/.next/static/chunks/{31hdfb4m8lwzz.js → 1fe2mxakoweia.js} +1 -1
  86. package/app/.next/static/chunks/1syzk-359a-tl.js +6 -0
  87. package/app/.next/static/chunks/23pvfhng1yidh.css +1 -0
  88. package/app/.next/static/chunks/2t205sbe-_sk4.js +1 -0
  89. package/app/.next/static/chunks/3-g9jvt_m-6_4.js +1 -0
  90. package/app/.next/static/chunks/{0u22wlboqnsjn.js → 3_e2d472hbms0.js} +1 -1
  91. package/app/AGENTS.md +9 -0
  92. package/app/CLAUDE.md +1 -0
  93. package/app/CONTRIBUTING.md +90 -0
  94. package/app/Dockerfile +34 -0
  95. package/app/LICENSE +21 -0
  96. package/app/README.md +367 -0
  97. package/app/bin/agent-session-inspector.mjs +185 -0
  98. package/app/components.json +25 -0
  99. package/app/docs/screenshots/analytics-dark.png +0 -0
  100. package/app/docs/screenshots/analytics.png +0 -0
  101. package/app/docs/screenshots/session-overview-dark.png +0 -0
  102. package/app/docs/screenshots/session-overview.png +0 -0
  103. package/app/docs/screenshots/sessions-dark.png +0 -0
  104. package/app/docs/screenshots/sessions.png +0 -0
  105. package/app/docs/screenshots/timeline-dark.png +0 -0
  106. package/app/docs/screenshots/timeline.png +0 -0
  107. package/app/docs/screenshots/token-optimizer-dark.png +0 -0
  108. package/app/docs/screenshots/token-optimizer.png +0 -0
  109. package/app/docs/social-preview.png +0 -0
  110. package/app/eslint.config.mjs +20 -0
  111. package/app/install.sh +85 -0
  112. package/app/next.config.ts +17 -0
  113. package/app/package.json +6 -2
  114. package/app/pnpm-lock.yaml +7031 -0
  115. package/app/pnpm-workspace.yaml +3 -0
  116. package/app/postcss.config.mjs +7 -0
  117. package/app/scripts/build-cli.mjs +26 -0
  118. package/app/scripts/demo-data.mjs +335 -0
  119. package/app/scripts/deploy-docker.sh +71 -0
  120. package/app/scripts/package-release.sh +86 -0
  121. package/app/server.js +1 -1
  122. package/app/tsconfig.json +34 -0
  123. package/bin/agent-session-inspector.mjs +37 -11
  124. package/cli/cli.mjs +7610 -0
  125. package/package.json +5 -2
  126. package/app/.next/server/chunks/[externals]__0xll52b._.js +0 -3
  127. package/app/.next/server/chunks/[root-of-the-server]__093lyxv._.js +0 -3
  128. package/app/.next/server/chunks/[root-of-the-server]__0ne74op._.js +0 -3
  129. package/app/.next/server/chunks/[root-of-the-server]__0uqb915._.js +0 -6
  130. package/app/.next/server/chunks/[root-of-the-server]__0uv5tnc._.js +0 -3
  131. package/app/.next/server/chunks/[root-of-the-server]__1lfc-ga._.js +0 -3
  132. package/app/.next/server/chunks/[root-of-the-server]__1n_sepq._.js +0 -3
  133. package/app/.next/server/chunks/ssr/_0w9kj20._.js +0 -3
  134. package/app/.next/server/chunks/ssr/_1te8t5n._.js +0 -3
  135. package/app/.next/static/chunks/105fms2oszpby.js +0 -1
  136. package/app/.next/static/chunks/13ads2-fzhdry.css +0 -1
  137. package/app/.next/static/chunks/1n1htnt-u9ghv.js +0 -6
  138. package/app/.next/static/chunks/2bron83qy3bb-.js +0 -1
  139. package/app/.next/static/chunks/2q8c3-tw6cvrv.js +0 -1
  140. package/app/.next/static/chunks/3rd1dhhkaulu1.js +0 -1
  141. /package/app/.next/static/{NMXKYaysRrCyMjSEbGwmR → -wq1RTFV0ts5s-g4PiOpq}/_buildManifest.js +0 -0
  142. /package/app/.next/static/{NMXKYaysRrCyMjSEbGwmR → -wq1RTFV0ts5s-g4PiOpq}/_clientMiddlewareManifest.js +0 -0
  143. /package/app/.next/static/{NMXKYaysRrCyMjSEbGwmR → -wq1RTFV0ts5s-g4PiOpq}/_ssgManifest.js +0 -0
@@ -7,17 +7,30 @@ import { existsSync, readFileSync } from "node:fs";
7
7
  import { createRequire } from "node:module";
8
8
  import net from "node:net";
9
9
  import path from "node:path";
10
- import { fileURLToPath } from "node:url";
10
+ import { fileURLToPath, pathToFileURL } from "node:url";
11
11
 
12
12
  const NAME = "agent-session-inspector";
13
13
  const MIN_NODE = [22, 13];
14
14
  const PKG_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
15
15
  const SERVER = path.join(PKG_DIR, "app", "server.js");
16
16
 
17
+ // Report commands print to the terminal instead of starting the server; they
18
+ // live in the bundle scripts/build-cli.mjs writes to <package>/cli/.
19
+ const CLI = path.join(PKG_DIR, "cli", "cli.mjs");
20
+ const COMMANDS = ["usage", "stats", "sessions"];
21
+
17
22
  const HELP = `Usage: ${NAME} [options]
23
+ ${NAME} <command> [options]
24
+
25
+ Browse Claude Code, Codex, Copilot, Cursor, Gemini CLI, OpenCode and Hermes
26
+ session transcripts in a local web UI, or print a report in the terminal.
27
+
28
+ Commands:
29
+ usage Tokens and estimated cost by day, model, project or agent
30
+ stats Sessions, messages, tool calls and time, by agent
31
+ sessions Recent sessions with their cost and health
18
32
 
19
- Browse Claude Code, Codex, Copilot, OpenCode and Hermes session transcripts in a
20
- local web UI.
33
+ Run a command with --help for its options.
21
34
 
22
35
  Options:
23
36
  -p, --port <port> Port to listen on (default: 3000, or the next free one)
@@ -118,7 +131,12 @@ function openBrowser(url) {
118
131
  .unref();
119
132
  }
120
133
 
121
- const opts = parseArgs(process.argv.slice(2));
134
+ const argv = process.argv.slice(2);
135
+ const command = COMMANDS.includes(argv[0]) ? argv[0] : null;
136
+ if (!command && argv[0] && !argv[0].startsWith("-")) {
137
+ fail(`unknown command ${argv[0]}\n\n${HELP}`);
138
+ }
139
+ const opts = command ? null : parseArgs(argv);
122
140
 
123
141
  // npx only warns about package.json "engines", and the app needs node:sqlite.
124
142
  const [major, minor] = process.versions.node.split(".").map(Number);
@@ -126,6 +144,21 @@ if (major < MIN_NODE[0] || (major === MIN_NODE[0] && minor < MIN_NODE[1])) {
126
144
  fail(`Node.js ${MIN_NODE.join(".")} or newer is required (found ${process.version}).`);
127
145
  }
128
146
 
147
+ // node:sqlite still announces itself as experimental on Node 22; not useful here.
148
+ const emitWarning = process.emitWarning;
149
+ process.emitWarning = (warning, ...rest) => {
150
+ if (String(warning).includes("SQLite is an experimental feature")) return;
151
+ emitWarning.call(process, warning, ...rest);
152
+ };
153
+
154
+ if (command) {
155
+ if (!existsSync(CLI)) {
156
+ fail(`no command bundle found at ${CLI}\nRun \`pnpm cli ${command}\` from a checkout.`);
157
+ }
158
+ const { run } = await import(pathToFileURL(CLI).href);
159
+ process.exit(run(command, argv.slice(1)));
160
+ }
161
+
129
162
  if (!existsSync(SERVER)) {
130
163
  fail(`no build found at ${SERVER}\nRun scripts/package-release.sh and use dist/${NAME}/bin/${NAME}.mjs.`);
131
164
  }
@@ -142,13 +175,6 @@ process.env.NEXT_TELEMETRY_DISABLED = "1";
142
175
  process.env.PORT = String(port);
143
176
  process.env.HOSTNAME = opts.host;
144
177
 
145
- // node:sqlite still announces itself as experimental on Node 22; not useful here.
146
- const emitWarning = process.emitWarning;
147
- process.emitWarning = (warning, ...rest) => {
148
- if (String(warning).includes("SQLite is an experimental feature")) return;
149
- emitWarning.call(process, warning, ...rest);
150
- };
151
-
152
178
  // server.js is CommonJS and starts listening on load.
153
179
  createRequire(import.meta.url)(SERVER);
154
180