pi-readseek 0.6.12 → 0.6.13
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/readseek-client.ts +29 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-readseek",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.13",
|
|
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.6.
|
|
42
|
+
"@jarkkojs/readseek": "^0.6.13",
|
|
43
43
|
"diff": "^8.0.3",
|
|
44
44
|
"xxhash-wasm": "^1.1.0"
|
|
45
45
|
},
|
package/src/readseek-client.ts
CHANGED
|
@@ -358,6 +358,7 @@ function defaultReadSeekDir(): string | null {
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
const DEFAULT_READSEEK_TIMEOUT_MS = 120_000;
|
|
361
|
+
const DEFAULT_READSEEK_VISION_TIMEOUT_MS = 30 * 60_000;
|
|
361
362
|
|
|
362
363
|
function readSeekTimeoutMs(): number {
|
|
363
364
|
return resolveReadSeekTimeoutMs() ?? DEFAULT_READSEEK_TIMEOUT_MS;
|
|
@@ -493,11 +494,36 @@ async function runReadSeekVision(args: string[], options: RunReadSeekOptions = {
|
|
|
493
494
|
});
|
|
494
495
|
const predecessor = visionInvocationTail;
|
|
495
496
|
visionInvocationTail = predecessor.then(() => gate);
|
|
497
|
+
const signal = options.signal;
|
|
496
498
|
|
|
497
|
-
await predecessor;
|
|
498
499
|
try {
|
|
499
|
-
|
|
500
|
-
|
|
500
|
+
if (signal) {
|
|
501
|
+
signal.throwIfAborted();
|
|
502
|
+
await new Promise<void>((resolve, reject) => {
|
|
503
|
+
const onAbort = (): void => {
|
|
504
|
+
signal.removeEventListener("abort", onAbort);
|
|
505
|
+
reject(signal.reason);
|
|
506
|
+
};
|
|
507
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
508
|
+
predecessor.then(
|
|
509
|
+
() => {
|
|
510
|
+
signal.removeEventListener("abort", onAbort);
|
|
511
|
+
resolve();
|
|
512
|
+
},
|
|
513
|
+
(error) => {
|
|
514
|
+
signal.removeEventListener("abort", onAbort);
|
|
515
|
+
reject(error);
|
|
516
|
+
},
|
|
517
|
+
);
|
|
518
|
+
});
|
|
519
|
+
} else {
|
|
520
|
+
await predecessor;
|
|
521
|
+
}
|
|
522
|
+
signal?.throwIfAborted();
|
|
523
|
+
return await runReadSeek(args, {
|
|
524
|
+
...options,
|
|
525
|
+
timeoutMs: options.timeoutMs ?? resolveReadSeekTimeoutMs() ?? DEFAULT_READSEEK_VISION_TIMEOUT_MS,
|
|
526
|
+
});
|
|
501
527
|
} finally {
|
|
502
528
|
release();
|
|
503
529
|
}
|