pi-readseek 0.4.7 → 0.4.8

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/read.ts +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-readseek",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Pi extension for readseek-backed hash-anchored read/edit/grep, structural code maps, structural search, and file exploration",
5
5
  "type": "module",
6
6
  "exports": {
package/src/read.ts CHANGED
@@ -91,7 +91,7 @@ export async function executeRead(opts: ExecuteReadOptions): Promise<AgentToolRe
91
91
  const rawBundle = typeof rawParams.bundle === "string" ? rawParams.bundle.trim() : undefined;
92
92
  const requestedMapViaBundle =
93
93
  rawBundle === "map" ||
94
- (rawBundle === "local" && rawParams.symbol === undefined && rawParams.map !== false);
94
+ (rawBundle === "local" && rawParams.symbol === undefined && (rawParams.map ?? true));
95
95
  const p = {
96
96
  ...rawParams,
97
97
  offset: offset.value,
@@ -174,7 +174,8 @@ export async function executeRead(opts: ExecuteReadOptions): Promise<AgentToolRe
174
174
  }
175
175
  const hasBinaryContent = looksLikeBinary(rawBuffer);
176
176
  throwIfAborted(signal);
177
- const normalized = normalizeToLF(stripBom(rawBuffer.toString("utf-8")).text);
177
+ const rawText = rawBuffer.toString("utf-8");
178
+ const normalized = normalizeToLF(stripBom(rawText).text);
178
179
  const allLines = splitReadseekLines(normalized);
179
180
  const total = allLines.length;
180
181
  const structuredWarnings: ReadseekWarning[] = [];
@@ -370,7 +371,7 @@ export async function executeRead(opts: ExecuteReadOptions): Promise<AgentToolRe
370
371
  structuredWarnings.push(buildReadseekWarning("binary-content", warning));
371
372
  }
372
373
 
373
- if (hasBareCarriageReturn(rawBuffer.toString("utf-8"))) {
374
+ if (hasBareCarriageReturn(rawText)) {
374
375
  const warning = "[Warning: file contains bare CR (\\r) line endings — line numbering may be inconsistent with grep and other tools]";
375
376
  structuredWarnings.push(buildReadseekWarning("bare-cr", warning));
376
377
  }