pi-readseek 0.4.6 → 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.
- package/package.json +2 -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.
|
|
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": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"node": ">=20.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@jarkkojs/readseek": "^0.4.
|
|
42
|
+
"@jarkkojs/readseek": "^0.4.11",
|
|
43
43
|
"diff": "^8.0.3",
|
|
44
44
|
"ignore": "^7.0.5",
|
|
45
45
|
"picomatch": "^4.0.4",
|
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
|
|
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
|
|
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(
|
|
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
|
}
|