omegon 0.6.8 → 0.6.9
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/extensions/cleave/dispatcher.ts +32 -6
- package/extensions/cleave/index.ts +21 -3
- package/extensions/cleave/subprocess-tracker.ts +72 -0
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/README.md +3 -0
- package/node_modules/@mariozechner/clipboard-linux-x64-gnu/clipboard.linux-x64-gnu.node +0 -0
- package/node_modules/@mariozechner/{clipboard-darwin-arm64 → clipboard-linux-x64-gnu}/package.json +8 -5
- package/node_modules/@styrene-lab/pi-ai/dist/cli.js +0 -0
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert/strict.d.ts +5 -11
- package/node_modules/@types/node/assert.d.ts +11 -171
- package/node_modules/@types/node/async_hooks.d.ts +8 -8
- package/node_modules/@types/node/buffer.buffer.d.ts +1 -7
- package/node_modules/@types/node/buffer.d.ts +44 -168
- package/node_modules/@types/node/child_process.d.ts +21 -64
- package/node_modules/@types/node/cluster.d.ts +240 -332
- package/node_modules/@types/node/console.d.ts +49 -351
- package/node_modules/@types/node/constants.d.ts +3 -4
- package/node_modules/@types/node/crypto.d.ts +287 -1639
- package/node_modules/@types/node/dgram.d.ts +15 -51
- package/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
- package/node_modules/@types/node/dns/promises.d.ts +3 -3
- package/node_modules/@types/node/dns.d.ts +131 -132
- package/node_modules/@types/node/domain.d.ts +13 -17
- package/node_modules/@types/node/events.d.ts +866 -795
- package/node_modules/@types/node/fs/promises.d.ts +7 -8
- package/node_modules/@types/node/fs.d.ts +419 -455
- package/node_modules/@types/node/globals.d.ts +6 -26
- package/node_modules/@types/node/globals.typedarray.d.ts +60 -0
- package/node_modules/@types/node/http.d.ts +310 -276
- package/node_modules/@types/node/http2.d.ts +528 -804
- package/node_modules/@types/node/https.d.ts +63 -243
- package/node_modules/@types/node/index.d.ts +15 -1
- package/node_modules/@types/node/inspector/promises.d.ts +41 -0
- package/node_modules/@types/node/inspector.d.ts +42 -50
- package/node_modules/@types/node/inspector.generated.d.ts +572 -417
- package/node_modules/@types/node/module.d.ts +47 -195
- package/node_modules/@types/node/net.d.ts +68 -189
- package/node_modules/@types/node/os.d.ts +6 -6
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +120 -133
- package/node_modules/@types/node/perf_hooks.d.ts +244 -643
- package/node_modules/@types/node/process.d.ts +219 -127
- package/node_modules/@types/node/punycode.d.ts +5 -5
- package/node_modules/@types/node/querystring.d.ts +4 -4
- package/node_modules/@types/node/quic.d.ts +910 -0
- package/node_modules/@types/node/readline/promises.d.ts +3 -3
- package/node_modules/@types/node/readline.d.ts +68 -120
- package/node_modules/@types/node/repl.d.ts +75 -98
- package/node_modules/@types/node/sea.d.ts +1 -1
- package/node_modules/@types/node/sqlite.d.ts +137 -30
- package/node_modules/@types/node/stream/consumers.d.ts +10 -10
- package/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/node/stream/web.d.ts +176 -453
- package/node_modules/@types/node/stream.d.ts +565 -478
- package/node_modules/@types/node/string_decoder.d.ts +4 -4
- package/node_modules/@types/node/test/reporters.d.ts +96 -0
- package/node_modules/@types/node/test.d.ts +134 -199
- package/node_modules/@types/node/timers/promises.d.ts +4 -4
- package/node_modules/@types/node/timers.d.ts +4 -130
- package/node_modules/@types/node/tls.d.ts +109 -179
- package/node_modules/@types/node/trace_events.d.ts +9 -9
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -7
- package/node_modules/@types/node/ts5.6/index.d.ts +15 -1
- package/node_modules/@types/node/ts5.7/index.d.ts +15 -1
- package/node_modules/@types/node/tty.d.ts +58 -16
- package/node_modules/@types/node/url.d.ts +78 -594
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +150 -796
- package/node_modules/@types/node/v8.d.ts +31 -21
- package/node_modules/@types/node/vm.d.ts +43 -30
- package/node_modules/@types/node/wasi.d.ts +4 -4
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +7 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +7 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +93 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +186 -363
- package/node_modules/@types/node/zlib.d.ts +8 -71
- package/node_modules/cliui/CHANGELOG.md +121 -0
- package/node_modules/color-convert/CHANGELOG.md +54 -0
- package/node_modules/esprima/ChangeLog +235 -0
- package/node_modules/mz/HISTORY.md +66 -0
- package/node_modules/proper-lockfile/CHANGELOG.md +108 -0
- package/node_modules/source-map/CHANGELOG.md +301 -0
- package/node_modules/thenify/History.md +11 -0
- package/node_modules/thenify-all/History.md +11 -0
- package/node_modules/undici-types/agent.d.ts +1 -1
- package/node_modules/undici-types/api.d.ts +2 -2
- package/node_modules/undici-types/balanced-pool.d.ts +2 -1
- package/node_modules/undici-types/cache-interceptor.d.ts +1 -0
- package/node_modules/undici-types/client.d.ts +1 -1
- package/node_modules/undici-types/connector.d.ts +2 -2
- package/node_modules/undici-types/diagnostics-channel.d.ts +2 -2
- package/node_modules/undici-types/dispatcher.d.ts +12 -12
- package/node_modules/undici-types/fetch.d.ts +4 -4
- package/node_modules/undici-types/formdata.d.ts +1 -1
- package/node_modules/undici-types/h2c-client.d.ts +1 -1
- package/node_modules/undici-types/index.d.ts +9 -1
- package/node_modules/undici-types/interceptors.d.ts +36 -2
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +1 -1
- package/node_modules/undici-types/readable.d.ts +2 -2
- package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/node_modules/undici-types/websocket.d.ts +9 -9
- package/node_modules/which/CHANGELOG.md +166 -0
- package/node_modules/y18n/CHANGELOG.md +100 -0
- package/node_modules/yargs/CHANGELOG.md +88 -0
- package/node_modules/yargs-parser/CHANGELOG.md +263 -0
- package/package.json +5 -5
- package/extensions/render/composition/package-lock.json +0 -534
- package/node_modules/@mariozechner/clipboard-darwin-arm64/README.md +0 -3
- package/node_modules/@mariozechner/clipboard-darwin-arm64/clipboard.darwin-arm64.node +0 -0
- package/node_modules/@mariozechner/clipboard-darwin-universal/README.md +0 -3
- package/node_modules/@mariozechner/clipboard-darwin-universal/clipboard.darwin-universal.node +0 -0
- package/node_modules/@mariozechner/clipboard-darwin-universal/package.json +0 -19
- /package/node_modules/{p-retry/node_modules/@types → @types}/retry/LICENSE +0 -0
- /package/node_modules/{p-retry/node_modules/@types → @types}/retry/README.md +0 -0
- /package/node_modules/{p-retry/node_modules/@types → @types}/retry/index.d.ts +0 -0
- /package/node_modules/{p-retry/node_modules/@types → @types}/retry/package.json +0 -0
|
@@ -27,6 +27,7 @@ import { executeWithReview, type ReviewConfig, type ReviewExecutor, DEFAULT_REVI
|
|
|
27
27
|
import { saveState } from "./workspace.ts";
|
|
28
28
|
import { resolveTier, getDefaultPolicy, getViableModels, type ProviderRoutingPolicy, type RegistryModel } from "../lib/model-routing.ts";
|
|
29
29
|
import { resolveOmegonSubprocess } from "../lib/omegon-subprocess.ts";
|
|
30
|
+
import { registerCleaveProc, deregisterCleaveProc, killCleaveProc } from "./subprocess-tracker.ts";
|
|
30
31
|
|
|
31
32
|
// ─── Large-run threshold ────────────────────────────────────────────────────
|
|
32
33
|
|
|
@@ -385,6 +386,7 @@ async function spawnChild(
|
|
|
385
386
|
const proc = spawn(omegon.command, args, {
|
|
386
387
|
cwd,
|
|
387
388
|
stdio: ["pipe", "pipe", "pipe"],
|
|
389
|
+
detached: true,
|
|
388
390
|
env: {
|
|
389
391
|
...process.env,
|
|
390
392
|
// Prevent nested detection issues
|
|
@@ -393,6 +395,7 @@ async function spawnChild(
|
|
|
393
395
|
I_AM: "alpharius",
|
|
394
396
|
},
|
|
395
397
|
});
|
|
398
|
+
registerCleaveProc(proc);
|
|
396
399
|
|
|
397
400
|
// Write prompt to stdin
|
|
398
401
|
if (proc.stdin) {
|
|
@@ -417,24 +420,43 @@ async function spawnChild(
|
|
|
417
420
|
});
|
|
418
421
|
proc.stderr?.on("data", (data) => { stderr += data.toString(); });
|
|
419
422
|
|
|
423
|
+
// SIGKILL escalation helper — sends SIGKILL by process group with fallback
|
|
424
|
+
let escalationTimer: ReturnType<typeof setTimeout> | undefined;
|
|
425
|
+
const scheduleEscalation = () => {
|
|
426
|
+
escalationTimer = setTimeout(() => {
|
|
427
|
+
if (!proc.killed) {
|
|
428
|
+
try {
|
|
429
|
+
if (proc.pid) process.kill(-proc.pid, "SIGKILL");
|
|
430
|
+
} catch {
|
|
431
|
+
try { proc.kill("SIGKILL"); } catch { /* already dead */ }
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}, 5_000);
|
|
435
|
+
};
|
|
436
|
+
|
|
420
437
|
// Timeout enforcement
|
|
421
438
|
const timer = setTimeout(() => {
|
|
422
439
|
killed = true;
|
|
423
|
-
proc
|
|
424
|
-
|
|
425
|
-
if (!proc.killed) proc.kill("SIGKILL");
|
|
426
|
-
}, 5_000);
|
|
440
|
+
killCleaveProc(proc);
|
|
441
|
+
scheduleEscalation();
|
|
427
442
|
}, timeoutMs);
|
|
428
443
|
|
|
429
|
-
// Abort signal support
|
|
444
|
+
// Abort signal support (with SIGKILL escalation — detached processes
|
|
445
|
+
// won't receive SIGHUP on parent exit, so SIGTERM alone is insufficient)
|
|
430
446
|
const onAbort = () => {
|
|
431
447
|
killed = true;
|
|
432
|
-
proc
|
|
448
|
+
killCleaveProc(proc);
|
|
449
|
+
scheduleEscalation();
|
|
433
450
|
};
|
|
434
451
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
435
452
|
|
|
453
|
+
let settled = false;
|
|
436
454
|
proc.on("close", (code) => {
|
|
455
|
+
if (settled) return;
|
|
456
|
+
settled = true;
|
|
457
|
+
deregisterCleaveProc(proc);
|
|
437
458
|
clearTimeout(timer);
|
|
459
|
+
clearTimeout(escalationTimer);
|
|
438
460
|
signal?.removeEventListener("abort", onAbort);
|
|
439
461
|
resolve({
|
|
440
462
|
exitCode: killed ? -1 : (code ?? 1),
|
|
@@ -444,7 +466,11 @@ async function spawnChild(
|
|
|
444
466
|
});
|
|
445
467
|
|
|
446
468
|
proc.on("error", (err) => {
|
|
469
|
+
if (settled) return;
|
|
470
|
+
settled = true;
|
|
471
|
+
deregisterCleaveProc(proc);
|
|
447
472
|
clearTimeout(timer);
|
|
473
|
+
clearTimeout(escalationTimer);
|
|
448
474
|
signal?.removeEventListener("abort", onAbort);
|
|
449
475
|
resolve({
|
|
450
476
|
exitCode: 1,
|
|
@@ -20,6 +20,7 @@ import { truncateTail, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize } from "
|
|
|
20
20
|
import { Text } from "@styrene-lab/pi-tui";
|
|
21
21
|
import { Type } from "@sinclair/typebox";
|
|
22
22
|
import { spawn, execFile } from "node:child_process";
|
|
23
|
+
import { registerCleaveProc, deregisterCleaveProc, killCleaveProc, killAllCleaveSubprocesses } from "./subprocess-tracker.ts";
|
|
23
24
|
import * as fs from "node:fs";
|
|
24
25
|
import * as path from "node:path";
|
|
25
26
|
import { promisify } from "node:util";
|
|
@@ -766,12 +767,14 @@ async function runSpecAssessmentSubprocess(
|
|
|
766
767
|
cwd: input.repoPath,
|
|
767
768
|
shell: false,
|
|
768
769
|
stdio: ["pipe", "pipe", "pipe"],
|
|
770
|
+
detached: true,
|
|
769
771
|
env: {
|
|
770
772
|
...process.env,
|
|
771
773
|
PI_CHILD: "1",
|
|
772
774
|
TERM: process.env.TERM ?? "dumb",
|
|
773
775
|
},
|
|
774
776
|
});
|
|
777
|
+
registerCleaveProc(proc);
|
|
775
778
|
let stdout = "";
|
|
776
779
|
let stderr = "";
|
|
777
780
|
let buffer = "";
|
|
@@ -789,10 +792,17 @@ async function runSpecAssessmentSubprocess(
|
|
|
789
792
|
clearTimeout(timer);
|
|
790
793
|
resolve(value);
|
|
791
794
|
};
|
|
795
|
+
let escalationTimer: ReturnType<typeof setTimeout> | undefined;
|
|
792
796
|
const timer = setTimeout(() => {
|
|
793
|
-
proc
|
|
794
|
-
setTimeout(() => {
|
|
795
|
-
if (!proc.killed)
|
|
797
|
+
killCleaveProc(proc);
|
|
798
|
+
escalationTimer = setTimeout(() => {
|
|
799
|
+
if (!proc.killed) {
|
|
800
|
+
try {
|
|
801
|
+
if (proc.pid) process.kill(-proc.pid, "SIGKILL");
|
|
802
|
+
} catch {
|
|
803
|
+
try { proc.kill("SIGKILL"); } catch { /* already dead */ }
|
|
804
|
+
}
|
|
805
|
+
}
|
|
796
806
|
}, 5_000);
|
|
797
807
|
settleReject(new Error(`Timed out after 120s while assessing ${input.changeName}.`));
|
|
798
808
|
}, 120_000);
|
|
@@ -823,9 +833,13 @@ async function runSpecAssessmentSubprocess(
|
|
|
823
833
|
stderr += data.toString();
|
|
824
834
|
});
|
|
825
835
|
proc.on("error", (error) => {
|
|
836
|
+
deregisterCleaveProc(proc);
|
|
837
|
+
clearTimeout(escalationTimer);
|
|
826
838
|
settleReject(error);
|
|
827
839
|
});
|
|
828
840
|
proc.on("close", (code) => {
|
|
841
|
+
deregisterCleaveProc(proc);
|
|
842
|
+
clearTimeout(escalationTimer);
|
|
829
843
|
if (buffer.trim()) processLine(buffer.trim());
|
|
830
844
|
if ((code ?? 1) !== 0) {
|
|
831
845
|
settleReject(new Error(stderr.trim() || `Assessment subprocess exited with code ${code ?? 1}.`));
|
|
@@ -1688,6 +1702,10 @@ export default function cleaveExtension(pi: ExtensionAPI) {
|
|
|
1688
1702
|
}
|
|
1689
1703
|
});
|
|
1690
1704
|
|
|
1705
|
+
// ── Subprocess cleanup on session exit ───────────────────────────────
|
|
1706
|
+
pi.on("session_shutdown", () => {
|
|
1707
|
+
killAllCleaveSubprocesses();
|
|
1708
|
+
});
|
|
1691
1709
|
|
|
1692
1710
|
// ── cleave_assess tool ───────────────────────────────────────────────
|
|
1693
1711
|
pi.registerTool({
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cleave/subprocess-tracker — Process registry for cleave subprocesses.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the extraction-v2 pattern: all spawned child processes are tracked
|
|
5
|
+
* in a Set, killed by process group (SIGTERM to -pid), and cleaned up on
|
|
6
|
+
* session_shutdown. Prevents orphaned `pi` processes when assessments time
|
|
7
|
+
* out or sessions exit mid-dispatch.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { ChildProcess } from "node:child_process";
|
|
11
|
+
|
|
12
|
+
const allCleaveProcs = new Set<ChildProcess>();
|
|
13
|
+
|
|
14
|
+
/** Kill a single subprocess by process group, with fallback to direct kill. */
|
|
15
|
+
export function killCleaveProc(proc: ChildProcess): void {
|
|
16
|
+
try {
|
|
17
|
+
if (proc.pid) process.kill(-proc.pid, "SIGTERM");
|
|
18
|
+
} catch {
|
|
19
|
+
try { proc.kill("SIGTERM"); } catch { /* already dead */ }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Add a subprocess to the tracked set. */
|
|
24
|
+
export function registerCleaveProc(proc: ChildProcess): void {
|
|
25
|
+
allCleaveProcs.add(proc);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Remove a subprocess from the tracked set. */
|
|
29
|
+
export function deregisterCleaveProc(proc: ChildProcess): void {
|
|
30
|
+
allCleaveProcs.delete(proc);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Force-kill a single subprocess (SIGKILL) by process group, with fallback.
|
|
35
|
+
* Used for escalation when SIGTERM is ignored.
|
|
36
|
+
*/
|
|
37
|
+
function forceKillCleaveProc(proc: ChildProcess): void {
|
|
38
|
+
try {
|
|
39
|
+
if (proc.pid) process.kill(-proc.pid, "SIGKILL");
|
|
40
|
+
} catch {
|
|
41
|
+
try { proc.kill("SIGKILL"); } catch { /* already dead */ }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Kill all tracked cleave subprocesses and clear the registry.
|
|
47
|
+
* Sends SIGTERM immediately, then SIGKILL after 5 seconds to any survivors.
|
|
48
|
+
* Because cleave subprocesses are spawned with `detached: true`, they will
|
|
49
|
+
* NOT receive SIGHUP when the parent exits — SIGKILL escalation is required.
|
|
50
|
+
*/
|
|
51
|
+
export function killAllCleaveSubprocesses(): void {
|
|
52
|
+
const snapshot = [...allCleaveProcs];
|
|
53
|
+
for (const proc of snapshot) {
|
|
54
|
+
killCleaveProc(proc);
|
|
55
|
+
}
|
|
56
|
+
// Escalate: SIGKILL after 5s for any process that ignored SIGTERM.
|
|
57
|
+
// The timer is unref'd so it does not keep the Node.js event loop alive.
|
|
58
|
+
if (snapshot.length > 0) {
|
|
59
|
+
const escalation = setTimeout(() => {
|
|
60
|
+
for (const proc of snapshot) {
|
|
61
|
+
if (!proc.killed) forceKillCleaveProc(proc);
|
|
62
|
+
}
|
|
63
|
+
}, 5_000);
|
|
64
|
+
escalation.unref();
|
|
65
|
+
}
|
|
66
|
+
allCleaveProcs.clear();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Number of currently tracked subprocesses (for diagnostics). */
|
|
70
|
+
export function cleaveTrackedProcCount(): number {
|
|
71
|
+
return allCleaveProcs.size;
|
|
72
|
+
}
|
|
Binary file
|
package/node_modules/@mariozechner/{clipboard-darwin-arm64 → clipboard-linux-x64-gnu}/package.json
RENAMED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@mariozechner/clipboard-
|
|
2
|
+
"name": "@mariozechner/clipboard-linux-x64-gnu",
|
|
3
3
|
"version": "0.3.2",
|
|
4
4
|
"os": [
|
|
5
|
-
"
|
|
5
|
+
"linux"
|
|
6
6
|
],
|
|
7
7
|
"cpu": [
|
|
8
|
-
"
|
|
8
|
+
"x64"
|
|
9
9
|
],
|
|
10
|
-
"main": "clipboard.
|
|
10
|
+
"main": "clipboard.linux-x64-gnu.node",
|
|
11
11
|
"files": [
|
|
12
|
-
"clipboard.
|
|
12
|
+
"clipboard.linux-x64-gnu.node"
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">= 10"
|
|
17
17
|
},
|
|
18
|
+
"libc": [
|
|
19
|
+
"glibc"
|
|
20
|
+
],
|
|
18
21
|
"repository": {
|
|
19
22
|
"type": "git",
|
|
20
23
|
"url": "https://github.com/badlogic/clipboard.git"
|
|
File without changes
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
This package contains type definitions for node (https://nodejs.org/).
|
|
6
6
|
|
|
7
7
|
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 12 Mar 2026 15:47:58 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS`
|
|
41
41
|
* environment variables. This will also deactivate the colors in the REPL. For
|
|
42
42
|
* more on color support in terminal environments, read the tty
|
|
43
|
-
* [`getColorDepth()`](https://nodejs.org/docs/latest-
|
|
43
|
+
* [`getColorDepth()`](https://nodejs.org/docs/latest-v25.x/api/tty.html#writestreamgetcolordepthenv) documentation.
|
|
44
44
|
* @since v15.0.0
|
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert/strict.js)
|
|
46
46
|
*/
|
|
47
|
-
declare module "assert/strict" {
|
|
47
|
+
declare module "node:assert/strict" {
|
|
48
48
|
import {
|
|
49
49
|
Assert,
|
|
50
50
|
AssertionError,
|
|
@@ -52,9 +52,6 @@ declare module "assert/strict" {
|
|
|
52
52
|
AssertOptions,
|
|
53
53
|
AssertPredicate,
|
|
54
54
|
AssertStrict,
|
|
55
|
-
CallTracker,
|
|
56
|
-
CallTrackerCall,
|
|
57
|
-
CallTrackerReportInformation,
|
|
58
55
|
deepStrictEqual,
|
|
59
56
|
doesNotMatch,
|
|
60
57
|
doesNotReject,
|
|
@@ -79,9 +76,6 @@ declare module "assert/strict" {
|
|
|
79
76
|
AssertOptions,
|
|
80
77
|
AssertPredicate,
|
|
81
78
|
AssertStrict,
|
|
82
|
-
CallTracker,
|
|
83
|
-
CallTrackerCall,
|
|
84
|
-
CallTrackerReportInformation,
|
|
85
79
|
deepStrictEqual,
|
|
86
80
|
deepStrictEqual as deepEqual,
|
|
87
81
|
doesNotMatch,
|
|
@@ -105,7 +99,7 @@ declare module "assert/strict" {
|
|
|
105
99
|
}
|
|
106
100
|
export = strict;
|
|
107
101
|
}
|
|
108
|
-
declare module "
|
|
109
|
-
import strict = require("assert/strict");
|
|
102
|
+
declare module "assert/strict" {
|
|
103
|
+
import strict = require("node:assert/strict");
|
|
110
104
|
export = strict;
|
|
111
105
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `node:assert` module provides a set of assertion functions for verifying
|
|
3
3
|
* invariants.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert.js)
|
|
5
5
|
*/
|
|
6
|
-
declare module "assert" {
|
|
7
|
-
import strict = require("assert/strict");
|
|
6
|
+
declare module "node:assert" {
|
|
7
|
+
import strict = require("node:assert/strict");
|
|
8
8
|
/**
|
|
9
9
|
* An alias of {@link assert.ok}.
|
|
10
10
|
* @since v0.5.9
|
|
@@ -182,154 +182,6 @@ declare module "assert" {
|
|
|
182
182
|
*/
|
|
183
183
|
operator: string;
|
|
184
184
|
}
|
|
185
|
-
/**
|
|
186
|
-
* This feature is deprecated and will be removed in a future version.
|
|
187
|
-
* Please consider using alternatives such as the `mock` helper function.
|
|
188
|
-
* @since v14.2.0, v12.19.0
|
|
189
|
-
* @deprecated Deprecated
|
|
190
|
-
*/
|
|
191
|
-
class CallTracker {
|
|
192
|
-
/**
|
|
193
|
-
* The wrapper function is expected to be called exactly `exact` times. If the
|
|
194
|
-
* function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an
|
|
195
|
-
* error.
|
|
196
|
-
*
|
|
197
|
-
* ```js
|
|
198
|
-
* import assert from 'node:assert';
|
|
199
|
-
*
|
|
200
|
-
* // Creates call tracker.
|
|
201
|
-
* const tracker = new assert.CallTracker();
|
|
202
|
-
*
|
|
203
|
-
* function func() {}
|
|
204
|
-
*
|
|
205
|
-
* // Returns a function that wraps func() that must be called exact times
|
|
206
|
-
* // before tracker.verify().
|
|
207
|
-
* const callsfunc = tracker.calls(func);
|
|
208
|
-
* ```
|
|
209
|
-
* @since v14.2.0, v12.19.0
|
|
210
|
-
* @param [fn='A no-op function']
|
|
211
|
-
* @param [exact=1]
|
|
212
|
-
* @return A function that wraps `fn`.
|
|
213
|
-
*/
|
|
214
|
-
calls(exact?: number): () => void;
|
|
215
|
-
calls(fn: undefined, exact?: number): () => void;
|
|
216
|
-
calls<Func extends (...args: any[]) => any>(fn: Func, exact?: number): Func;
|
|
217
|
-
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func | (() => void);
|
|
218
|
-
/**
|
|
219
|
-
* Example:
|
|
220
|
-
*
|
|
221
|
-
* ```js
|
|
222
|
-
* import assert from 'node:assert';
|
|
223
|
-
*
|
|
224
|
-
* const tracker = new assert.CallTracker();
|
|
225
|
-
*
|
|
226
|
-
* function func() {}
|
|
227
|
-
* const callsfunc = tracker.calls(func);
|
|
228
|
-
* callsfunc(1, 2, 3);
|
|
229
|
-
*
|
|
230
|
-
* assert.deepStrictEqual(tracker.getCalls(callsfunc),
|
|
231
|
-
* [{ thisArg: undefined, arguments: [1, 2, 3] }]);
|
|
232
|
-
* ```
|
|
233
|
-
* @since v18.8.0, v16.18.0
|
|
234
|
-
* @return An array with all the calls to a tracked function.
|
|
235
|
-
*/
|
|
236
|
-
getCalls(fn: Function): CallTrackerCall[];
|
|
237
|
-
/**
|
|
238
|
-
* The arrays contains information about the expected and actual number of calls of
|
|
239
|
-
* the functions that have not been called the expected number of times.
|
|
240
|
-
*
|
|
241
|
-
* ```js
|
|
242
|
-
* import assert from 'node:assert';
|
|
243
|
-
*
|
|
244
|
-
* // Creates call tracker.
|
|
245
|
-
* const tracker = new assert.CallTracker();
|
|
246
|
-
*
|
|
247
|
-
* function func() {}
|
|
248
|
-
*
|
|
249
|
-
* // Returns a function that wraps func() that must be called exact times
|
|
250
|
-
* // before tracker.verify().
|
|
251
|
-
* const callsfunc = tracker.calls(func, 2);
|
|
252
|
-
*
|
|
253
|
-
* // Returns an array containing information on callsfunc()
|
|
254
|
-
* console.log(tracker.report());
|
|
255
|
-
* // [
|
|
256
|
-
* // {
|
|
257
|
-
* // message: 'Expected the func function to be executed 2 time(s) but was
|
|
258
|
-
* // executed 0 time(s).',
|
|
259
|
-
* // actual: 0,
|
|
260
|
-
* // expected: 2,
|
|
261
|
-
* // operator: 'func',
|
|
262
|
-
* // stack: stack trace
|
|
263
|
-
* // }
|
|
264
|
-
* // ]
|
|
265
|
-
* ```
|
|
266
|
-
* @since v14.2.0, v12.19.0
|
|
267
|
-
* @return An array of objects containing information about the wrapper functions returned by {@link tracker.calls()}.
|
|
268
|
-
*/
|
|
269
|
-
report(): CallTrackerReportInformation[];
|
|
270
|
-
/**
|
|
271
|
-
* Reset calls of the call tracker. If a tracked function is passed as an argument, the calls will be reset for it.
|
|
272
|
-
* If no arguments are passed, all tracked functions will be reset.
|
|
273
|
-
*
|
|
274
|
-
* ```js
|
|
275
|
-
* import assert from 'node:assert';
|
|
276
|
-
*
|
|
277
|
-
* const tracker = new assert.CallTracker();
|
|
278
|
-
*
|
|
279
|
-
* function func() {}
|
|
280
|
-
* const callsfunc = tracker.calls(func);
|
|
281
|
-
*
|
|
282
|
-
* callsfunc();
|
|
283
|
-
* // Tracker was called once
|
|
284
|
-
* assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
|
|
285
|
-
*
|
|
286
|
-
* tracker.reset(callsfunc);
|
|
287
|
-
* assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
|
|
288
|
-
* ```
|
|
289
|
-
* @since v18.8.0, v16.18.0
|
|
290
|
-
* @param fn a tracked function to reset.
|
|
291
|
-
*/
|
|
292
|
-
reset(fn?: Function): void;
|
|
293
|
-
/**
|
|
294
|
-
* Iterates through the list of functions passed to {@link tracker.calls()} and will throw an error for functions that
|
|
295
|
-
* have not been called the expected number of times.
|
|
296
|
-
*
|
|
297
|
-
* ```js
|
|
298
|
-
* import assert from 'node:assert';
|
|
299
|
-
*
|
|
300
|
-
* // Creates call tracker.
|
|
301
|
-
* const tracker = new assert.CallTracker();
|
|
302
|
-
*
|
|
303
|
-
* function func() {}
|
|
304
|
-
*
|
|
305
|
-
* // Returns a function that wraps func() that must be called exact times
|
|
306
|
-
* // before tracker.verify().
|
|
307
|
-
* const callsfunc = tracker.calls(func, 2);
|
|
308
|
-
*
|
|
309
|
-
* callsfunc();
|
|
310
|
-
*
|
|
311
|
-
* // Will throw an error since callsfunc() was only called once.
|
|
312
|
-
* tracker.verify();
|
|
313
|
-
* ```
|
|
314
|
-
* @since v14.2.0, v12.19.0
|
|
315
|
-
*/
|
|
316
|
-
verify(): void;
|
|
317
|
-
}
|
|
318
|
-
interface CallTrackerCall {
|
|
319
|
-
thisArg: object;
|
|
320
|
-
arguments: unknown[];
|
|
321
|
-
}
|
|
322
|
-
interface CallTrackerReportInformation {
|
|
323
|
-
message: string;
|
|
324
|
-
/** The actual number of times the function was called. */
|
|
325
|
-
actual: number;
|
|
326
|
-
/** The number of times the function was expected to be called. */
|
|
327
|
-
expected: number;
|
|
328
|
-
/** The name of the function that is wrapped. */
|
|
329
|
-
operator: string;
|
|
330
|
-
/** A stack trace of the function. */
|
|
331
|
-
stack: object;
|
|
332
|
-
}
|
|
333
185
|
type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
|
|
334
186
|
/**
|
|
335
187
|
* Throws an `AssertionError` with the provided error message or a default
|
|
@@ -348,22 +200,10 @@ declare module "assert" {
|
|
|
348
200
|
* assert.fail(new TypeError('need array'));
|
|
349
201
|
* // TypeError: need array
|
|
350
202
|
* ```
|
|
351
|
-
*
|
|
352
|
-
* Using `assert.fail()` with more than two arguments is possible but deprecated.
|
|
353
|
-
* See below for further details.
|
|
354
203
|
* @since v0.1.21
|
|
355
204
|
* @param [message='Failed']
|
|
356
205
|
*/
|
|
357
206
|
function fail(message?: string | Error): never;
|
|
358
|
-
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
|
359
|
-
function fail(
|
|
360
|
-
actual: unknown,
|
|
361
|
-
expected: unknown,
|
|
362
|
-
message?: string | Error,
|
|
363
|
-
operator?: string,
|
|
364
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
365
|
-
stackStartFn?: Function,
|
|
366
|
-
): never;
|
|
367
207
|
/**
|
|
368
208
|
* Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`.
|
|
369
209
|
*
|
|
@@ -413,10 +253,10 @@ declare module "assert" {
|
|
|
413
253
|
* import assert from 'node:assert/strict';
|
|
414
254
|
*
|
|
415
255
|
* // Using `assert()` works the same:
|
|
416
|
-
* assert(
|
|
256
|
+
* assert(2 + 2 > 5);;
|
|
417
257
|
* // AssertionError: The expression evaluated to a falsy value:
|
|
418
258
|
* //
|
|
419
|
-
* // assert(
|
|
259
|
+
* // assert(2 + 2 > 5)
|
|
420
260
|
* ```
|
|
421
261
|
* @since v0.1.21
|
|
422
262
|
*/
|
|
@@ -931,7 +771,7 @@ declare module "assert" {
|
|
|
931
771
|
* check that the promise is rejected.
|
|
932
772
|
*
|
|
933
773
|
* If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the
|
|
934
|
-
* function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-
|
|
774
|
+
* function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v25.x/api/errors.html#err_invalid_return_value)
|
|
935
775
|
* error. In both cases the error handler is skipped.
|
|
936
776
|
*
|
|
937
777
|
* Besides the async nature to await the completion behaves identically to {@link throws}.
|
|
@@ -1001,7 +841,7 @@ declare module "assert" {
|
|
|
1001
841
|
*
|
|
1002
842
|
* If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If
|
|
1003
843
|
* the function does not return a promise, `assert.doesNotReject()` will return a
|
|
1004
|
-
* rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-
|
|
844
|
+
* rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v25.x/api/errors.html#err_invalid_return_value) error. In both cases
|
|
1005
845
|
* the error handler is skipped.
|
|
1006
846
|
*
|
|
1007
847
|
* Using `assert.doesNotReject()` is actually not useful because there is little
|
|
@@ -1064,7 +904,7 @@ declare module "assert" {
|
|
|
1064
904
|
* If the values do not match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal
|
|
1065
905
|
* to the value of the `message` parameter. If the `message` parameter is
|
|
1066
906
|
* undefined, a default error message is assigned. If the `message` parameter is an
|
|
1067
|
-
* instance of an [Error](https://nodejs.org/docs/latest-
|
|
907
|
+
* instance of an [Error](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
|
|
1068
908
|
* @since v13.6.0, v12.16.0
|
|
1069
909
|
*/
|
|
1070
910
|
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
|
@@ -1087,7 +927,7 @@ declare module "assert" {
|
|
|
1087
927
|
* If the values do match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal
|
|
1088
928
|
* to the value of the `message` parameter. If the `message` parameter is
|
|
1089
929
|
* undefined, a default error message is assigned. If the `message` parameter is an
|
|
1090
|
-
* instance of an [Error](https://nodejs.org/docs/latest-
|
|
930
|
+
* instance of an [Error](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
|
|
1091
931
|
* @since v13.6.0, v12.16.0
|
|
1092
932
|
*/
|
|
1093
933
|
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
|
@@ -1109,7 +949,7 @@ declare module "assert" {
|
|
|
1109
949
|
}
|
|
1110
950
|
export = assert;
|
|
1111
951
|
}
|
|
1112
|
-
declare module "
|
|
1113
|
-
import assert = require("assert");
|
|
952
|
+
declare module "assert" {
|
|
953
|
+
import assert = require("node:assert");
|
|
1114
954
|
export = assert;
|
|
1115
955
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* We strongly discourage the use of the `async_hooks` API.
|
|
3
3
|
* Other APIs that can cover most of its use cases include:
|
|
4
4
|
*
|
|
5
|
-
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-
|
|
6
|
-
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-
|
|
5
|
+
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v25.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
|
6
|
+
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
|
7
7
|
*
|
|
8
8
|
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
|
9
9
|
* It can be accessed using:
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* import async_hooks from 'node:async_hooks';
|
|
13
13
|
* ```
|
|
14
14
|
* @experimental
|
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/async_hooks.js)
|
|
16
16
|
*/
|
|
17
|
-
declare module "async_hooks" {
|
|
17
|
+
declare module "node:async_hooks" {
|
|
18
18
|
/**
|
|
19
19
|
* ```js
|
|
20
20
|
* import { executionAsyncId } from 'node:async_hooks';
|
|
@@ -44,7 +44,7 @@ declare module "async_hooks" {
|
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
46
|
* Promise contexts may not get precise `executionAsyncIds` by default.
|
|
47
|
-
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-
|
|
47
|
+
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking).
|
|
48
48
|
* @since v8.1.0
|
|
49
49
|
* @return The `asyncId` of the current execution context. Useful to track when something calls.
|
|
50
50
|
*/
|
|
@@ -117,7 +117,7 @@ declare module "async_hooks" {
|
|
|
117
117
|
* ```
|
|
118
118
|
*
|
|
119
119
|
* Promise contexts may not get valid `triggerAsyncId`s by default. See
|
|
120
|
-
* the section on [promise execution tracking](https://nodejs.org/docs/latest-
|
|
120
|
+
* the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking).
|
|
121
121
|
* @return The ID of the resource responsible for calling the callback that is currently being executed.
|
|
122
122
|
*/
|
|
123
123
|
function triggerAsyncId(): number;
|
|
@@ -618,6 +618,6 @@ declare module "async_hooks" {
|
|
|
618
618
|
const VERIFYREQUEST: number;
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
declare module "
|
|
622
|
-
export * from "async_hooks";
|
|
621
|
+
declare module "async_hooks" {
|
|
622
|
+
export * from "node:async_hooks";
|
|
623
623
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare module "buffer" {
|
|
1
|
+
declare module "node:buffer" {
|
|
2
2
|
type ImplicitArrayBuffer<T extends WithImplicitCoercion<ArrayBufferLike>> = T extends
|
|
3
3
|
{ valueOf(): infer V extends ArrayBufferLike } ? V : T;
|
|
4
4
|
global {
|
|
@@ -463,10 +463,4 @@ declare module "buffer" {
|
|
|
463
463
|
*/
|
|
464
464
|
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
|
|
465
465
|
}
|
|
466
|
-
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
467
|
-
var SlowBuffer: {
|
|
468
|
-
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
469
|
-
new(size: number): Buffer<ArrayBuffer>;
|
|
470
|
-
prototype: Buffer;
|
|
471
|
-
};
|
|
472
466
|
}
|