@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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/context/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/items/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page.js +3 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08jw6yr._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__093.c8l._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0duau-w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0el6bvo._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta~v~j._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ubqc9u._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0j0avc7._.js +3 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/app/actions.ts +37 -30
- package/.next/standalone/app/sessions/page.tsx +8 -2
- package/.next/standalone/bin/cli.js +4 -0
- package/.next/standalone/lib/files.ts +8 -2
- package/.next/standalone/lib/hooks.ts +27 -6
- package/.next/standalone/lib/inventory.ts +18 -4
- package/.next/standalone/lib/transcripts.ts +9 -0
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/tsconfig.tsbuildinfo +1 -1
- package/.next/static/chunks/13525lf.7uo9s.css +1 -0
- package/bin/cli.js +4 -0
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xin6g6._.js +0 -3
- package/.next/static/chunks/13twdc6z5jomc.css +0 -1
- /package/.next/static/{th1MKWNqUvonxGrsp9Ee6 → BT6H4g8OlEYi9snYU0PI-}/_buildManifest.js +0 -0
- /package/.next/static/{th1MKWNqUvonxGrsp9Ee6 → BT6H4g8OlEYi9snYU0PI-}/_clientMiddlewareManifest.js +0 -0
- /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.
|
|
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": {
|