@mbeato/contextscope 0.1.1 → 0.1.3

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 (51) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  4. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
  13. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  14. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next/standalone/.next/server/app/context/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/items/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/page.js +3 -2
  22. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08jw6yr._.js +3 -0
  26. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__093.c8l._.js +1 -1
  27. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0duau-w._.js +1 -1
  28. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0el6bvo._.js +1 -1
  29. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta~v~j._.js +1 -1
  30. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ubqc9u._.js +1 -1
  31. package/.next/standalone/.next/server/chunks/ssr/_0j0avc7._.js +3 -0
  32. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  33. package/.next/standalone/.next/server/pages/404.html +1 -1
  34. package/.next/standalone/.next/server/pages/500.html +1 -1
  35. package/.next/standalone/app/actions.ts +37 -30
  36. package/.next/standalone/app/sessions/page.tsx +8 -2
  37. package/.next/standalone/bin/cli.js +4 -0
  38. package/.next/standalone/lib/files.ts +8 -2
  39. package/.next/standalone/lib/hooks.ts +27 -6
  40. package/.next/standalone/lib/inventory.ts +18 -4
  41. package/.next/standalone/lib/transcripts.ts +9 -0
  42. package/.next/standalone/package.json +1 -1
  43. package/.next/standalone/tsconfig.tsbuildinfo +1 -1
  44. package/.next/static/chunks/13525lf.7uo9s.css +1 -0
  45. package/bin/cli.js +4 -0
  46. package/package.json +1 -1
  47. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xin6g6._.js +0 -3
  48. package/.next/static/chunks/13twdc6z5jomc.css +0 -1
  49. /package/.next/static/{th1MKWNqUvonxGrsp9Ee6 → BT6H4g8OlEYi9snYU0PI-}/_buildManifest.js +0 -0
  50. /package/.next/static/{th1MKWNqUvonxGrsp9Ee6 → BT6H4g8OlEYi9snYU0PI-}/_clientMiddlewareManifest.js +0 -0
  51. /package/.next/static/{th1MKWNqUvonxGrsp9Ee6 → BT6H4g8OlEYi9snYU0PI-}/_ssgManifest.js +0 -0
@@ -40,7 +40,10 @@ export type TranscriptResult = {
40
40
 
41
41
  // Module-level cache: persists across server-component renders within the same
42
42
  // Next.js dev/prod process. Keyed by filePath; invalidated on mtime change.
43
+ // Capped via simple FIFO eviction (Map preserves insertion order) so a
44
+ // long-running process scanning thousands of transcripts can't grow unbounded.
43
45
  const cache = new Map<string, TranscriptResult>();
46
+ const MAX_CACHE_ENTRIES = 5000;
44
47
 
45
48
  function inferProjectPath(dirName: string): string {
46
49
  return dirName.replace(/^-/, "/").replaceAll("-", "/");
@@ -158,7 +161,13 @@ async function getFileResult(filePath: string, mtimeMs: number): Promise<Transcr
158
161
  const cached = cache.get(filePath);
159
162
  if (cached && cached.mtimeMs === mtimeMs) return cached;
160
163
  const fresh = await parseFile(filePath, mtimeMs);
164
+ if (cached) cache.delete(filePath); // re-insert at tail so FIFO eviction stays correct
161
165
  cache.set(filePath, fresh);
166
+ while (cache.size > MAX_CACHE_ENTRIES) {
167
+ const oldest = cache.keys().next().value;
168
+ if (oldest === undefined) break;
169
+ cache.delete(oldest);
170
+ }
162
171
  return fresh;
163
172
  }
164
173
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mbeato/contextscope",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Local dashboard auditing Claude Code's per-turn token context (skills, agents, commands, CLAUDE.md, MEMORY.md, hooks, MCP) with toggle-based disable and session analytics.",
5
5
  "type": "module",
6
6
  "bin": {