pi-lean-ctx 1.0.3 → 1.0.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.
@@ -31,6 +31,8 @@ const FULL_READ_EXTENSIONS = new Set([
31
31
  ]);
32
32
 
33
33
  const IMAGE_EXTENSIONS = new Set([".png", ".jpg", ".jpeg", ".gif", ".webp"]);
34
+ const CODE_FULL_READ_MAX_BYTES = 8 * 1024;
35
+ const CODE_SIGNATURES_MIN_BYTES = 96 * 1024;
34
36
 
35
37
  const readSchema = Type.Object({
36
38
  path: Type.String({ description: "Path to the file to read (relative or absolute)" }),
@@ -101,8 +103,8 @@ async function chooseReadMode(path: string): Promise<"full" | "map" | "signature
101
103
  const size = fileStat.size;
102
104
 
103
105
  if (!CODE_EXTENSIONS.has(ext)) return size > 48 * 1024 ? "map" : "full";
104
- if (size >= 160 * 1024) return "signatures";
105
- if (size >= 24 * 1024) return "map";
106
+ if (size >= CODE_SIGNATURES_MIN_BYTES) return "signatures";
107
+ if (size >= CODE_FULL_READ_MAX_BYTES) return "map";
106
108
  return "full";
107
109
  }
108
110
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lean-ctx",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Pi Coding Agent extension that routes bash, read, grep, find, and ls through lean-ctx for 60-90% token savings",
5
5
  "keywords": ["pi-package", "lean-ctx", "token-optimization", "compression"],
6
6
  "license": "MIT",