omegon 0.8.3 → 0.9.0

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 (140) hide show
  1. package/extensions/cleave/dispatcher.ts +213 -20
  2. package/extensions/cleave/index.ts +24 -8
  3. package/extensions/cleave/rpc-child.ts +269 -0
  4. package/extensions/cleave/types.ts +52 -0
  5. package/extensions/openspec/spec.ts +3 -0
  6. package/node_modules/@types/node/README.md +3 -3
  7. package/node_modules/@types/node/assert/strict.d.ts +11 -5
  8. package/node_modules/@types/node/assert.d.ts +173 -50
  9. package/node_modules/@types/node/async_hooks.d.ts +8 -28
  10. package/node_modules/@types/node/buffer.buffer.d.ts +7 -1
  11. package/node_modules/@types/node/buffer.d.ts +168 -44
  12. package/node_modules/@types/node/child_process.d.ts +70 -27
  13. package/node_modules/@types/node/cluster.d.ts +332 -240
  14. package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  15. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  16. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  17. package/node_modules/@types/node/compatibility/iterators.d.ts +0 -1
  18. package/node_modules/@types/node/console.d.ts +350 -49
  19. package/node_modules/@types/node/constants.d.ts +4 -3
  20. package/node_modules/@types/node/crypto.d.ts +1110 -630
  21. package/node_modules/@types/node/dgram.d.ts +51 -15
  22. package/node_modules/@types/node/diagnostics_channel.d.ts +6 -4
  23. package/node_modules/@types/node/dns/promises.d.ts +4 -4
  24. package/node_modules/@types/node/dns.d.ts +133 -132
  25. package/node_modules/@types/node/domain.d.ts +17 -13
  26. package/node_modules/@types/node/events.d.ts +663 -734
  27. package/node_modules/@types/node/fs/promises.d.ts +9 -43
  28. package/node_modules/@types/node/fs.d.ts +411 -628
  29. package/node_modules/@types/node/globals.d.ts +30 -8
  30. package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
  31. package/node_modules/@types/node/http.d.ts +265 -364
  32. package/node_modules/@types/node/http2.d.ts +715 -551
  33. package/node_modules/@types/node/https.d.ts +239 -65
  34. package/node_modules/@types/node/index.d.ts +6 -24
  35. package/node_modules/@types/node/inspector.d.ts +53 -69
  36. package/node_modules/@types/node/inspector.generated.d.ts +410 -759
  37. package/node_modules/@types/node/module.d.ts +186 -52
  38. package/node_modules/@types/node/net.d.ts +194 -70
  39. package/node_modules/@types/node/os.d.ts +11 -12
  40. package/node_modules/@types/node/package.json +3 -13
  41. package/node_modules/@types/node/path.d.ts +133 -120
  42. package/node_modules/@types/node/perf_hooks.d.ts +643 -318
  43. package/node_modules/@types/node/process.d.ts +132 -223
  44. package/node_modules/@types/node/punycode.d.ts +5 -5
  45. package/node_modules/@types/node/querystring.d.ts +4 -4
  46. package/node_modules/@types/node/readline/promises.d.ts +3 -3
  47. package/node_modules/@types/node/readline.d.ts +120 -68
  48. package/node_modules/@types/node/repl.d.ts +100 -87
  49. package/node_modules/@types/node/sea.d.ts +1 -10
  50. package/node_modules/@types/node/sqlite.d.ts +19 -363
  51. package/node_modules/@types/node/stream/consumers.d.ts +10 -10
  52. package/node_modules/@types/node/stream/promises.d.ts +15 -136
  53. package/node_modules/@types/node/stream/web.d.ts +502 -176
  54. package/node_modules/@types/node/stream.d.ts +475 -581
  55. package/node_modules/@types/node/string_decoder.d.ts +4 -4
  56. package/node_modules/@types/node/test.d.ts +196 -308
  57. package/node_modules/@types/node/timers/promises.d.ts +4 -4
  58. package/node_modules/@types/node/timers.d.ts +132 -4
  59. package/node_modules/@types/node/tls.d.ts +226 -110
  60. package/node_modules/@types/node/trace_events.d.ts +9 -9
  61. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -1
  62. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
  63. package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
  64. package/node_modules/@types/node/tty.d.ts +16 -58
  65. package/node_modules/@types/node/url.d.ts +573 -130
  66. package/node_modules/@types/node/util.d.ts +1100 -181
  67. package/node_modules/@types/node/v8.d.ts +8 -76
  68. package/node_modules/@types/node/vm.d.ts +72 -280
  69. package/node_modules/@types/node/wasi.d.ts +4 -25
  70. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
  71. package/node_modules/@types/node/web-globals/events.d.ts +0 -9
  72. package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
  73. package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
  74. package/node_modules/@types/node/worker_threads.d.ts +335 -268
  75. package/node_modules/@types/node/zlib.d.ts +74 -9
  76. package/node_modules/undici-types/agent.d.ts +12 -13
  77. package/node_modules/undici-types/api.d.ts +26 -26
  78. package/node_modules/undici-types/balanced-pool.d.ts +12 -13
  79. package/node_modules/undici-types/client.d.ts +19 -19
  80. package/node_modules/undici-types/connector.d.ts +2 -2
  81. package/node_modules/undici-types/cookies.d.ts +0 -2
  82. package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  83. package/node_modules/undici-types/dispatcher.d.ts +103 -123
  84. package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  85. package/node_modules/undici-types/errors.d.ts +54 -66
  86. package/node_modules/undici-types/eventsource.d.ts +4 -9
  87. package/node_modules/undici-types/fetch.d.ts +20 -22
  88. package/node_modules/undici-types/file.d.ts +39 -0
  89. package/node_modules/undici-types/filereader.d.ts +54 -0
  90. package/node_modules/undici-types/formdata.d.ts +7 -7
  91. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  92. package/node_modules/undici-types/global-origin.d.ts +5 -5
  93. package/node_modules/undici-types/handlers.d.ts +8 -8
  94. package/node_modules/undici-types/header.d.ts +1 -157
  95. package/node_modules/undici-types/index.d.ts +47 -64
  96. package/node_modules/undici-types/interceptors.d.ts +8 -64
  97. package/node_modules/undici-types/mock-agent.d.ts +18 -36
  98. package/node_modules/undici-types/mock-client.d.ts +4 -6
  99. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  100. package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
  101. package/node_modules/undici-types/mock-pool.d.ts +4 -6
  102. package/node_modules/undici-types/package.json +1 -1
  103. package/node_modules/undici-types/patch.d.ts +4 -0
  104. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  105. package/node_modules/undici-types/pool.d.ts +13 -15
  106. package/node_modules/undici-types/proxy-agent.d.ts +4 -5
  107. package/node_modules/undici-types/readable.d.ts +16 -19
  108. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  109. package/node_modules/undici-types/retry-handler.d.ts +10 -19
  110. package/node_modules/undici-types/util.d.ts +3 -3
  111. package/node_modules/undici-types/webidl.d.ts +29 -142
  112. package/node_modules/undici-types/websocket.d.ts +10 -46
  113. package/package.json +2 -1
  114. package/skills/cleave/SKILL.md +62 -2
  115. package/node_modules/@types/node/inspector/promises.d.ts +0 -41
  116. package/node_modules/@types/node/path/posix.d.ts +0 -8
  117. package/node_modules/@types/node/path/win32.d.ts +0 -8
  118. package/node_modules/@types/node/quic.d.ts +0 -910
  119. package/node_modules/@types/node/test/reporters.d.ts +0 -96
  120. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  121. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  122. package/node_modules/@types/node/ts5.7/index.d.ts +0 -117
  123. package/node_modules/@types/node/util/types.d.ts +0 -558
  124. package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  125. package/node_modules/@types/node/web-globals/console.d.ts +0 -9
  126. package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  127. package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  128. package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  129. package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  130. package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  131. package/node_modules/@types/node/web-globals/streams.d.ts +0 -115
  132. package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  133. package/node_modules/@types/node/web-globals/url.d.ts +0 -24
  134. package/node_modules/undici-types/cache-interceptor.d.ts +0 -173
  135. package/node_modules/undici-types/client-stats.d.ts +0 -15
  136. package/node_modules/undici-types/h2c-client.d.ts +0 -73
  137. package/node_modules/undici-types/mock-call-history.d.ts +0 -111
  138. package/node_modules/undici-types/round-robin-pool.d.ts +0 -41
  139. package/node_modules/undici-types/snapshot-agent.d.ts +0 -109
  140. package/node_modules/undici-types/utility.d.ts +0 -7
@@ -237,6 +237,58 @@ export interface ReunificationResult {
237
237
  readyToClose: boolean;
238
238
  }
239
239
 
240
+ // ─── RPC Child Communication ─────────────────────────────────────────────────
241
+
242
+ /**
243
+ * Events received from a child process running in RPC mode.
244
+ *
245
+ * This is a discriminated union covering:
246
+ * - AgentEvent types (agent lifecycle, turn, message, tool execution)
247
+ * - AgentSessionEvent extensions (auto_compaction, auto_retry)
248
+ * - RPC response events (command acknowledgements)
249
+ * - Synthetic pipe_closed event (stdout closed)
250
+ *
251
+ * We define this as our own union rather than importing from pi-mono
252
+ * to avoid pulling in transitive dependencies and to add the synthetic
253
+ * pipe_closed event.
254
+ */
255
+ export type RpcChildEvent =
256
+ // Agent lifecycle
257
+ | { type: "agent_start" }
258
+ | { type: "agent_end"; messages: unknown[] }
259
+ // Turn lifecycle
260
+ | { type: "turn_start" }
261
+ | { type: "turn_end"; message: unknown; toolResults: unknown[] }
262
+ // Message lifecycle
263
+ | { type: "message_start"; message?: unknown }
264
+ | { type: "message_update"; message?: unknown; assistantMessageEvent?: unknown }
265
+ | { type: "message_end"; message?: unknown }
266
+ // Tool execution
267
+ | { type: "tool_execution_start"; toolCallId: string; toolName: string; args: unknown }
268
+ | { type: "tool_execution_update"; toolCallId: string; toolName: string; args: unknown; partialResult: unknown }
269
+ | { type: "tool_execution_end"; toolCallId: string; toolName: string; result: unknown; isError: boolean }
270
+ // Session extensions
271
+ | { type: "auto_compaction_start"; reason: "threshold" | "overflow" }
272
+ | { type: "auto_compaction_end"; result?: unknown; aborted: boolean; willRetry: boolean; errorMessage?: string }
273
+ | { type: "auto_retry_start"; attempt: number; maxAttempts: number; delayMs: number; errorMessage: string }
274
+ | { type: "auto_retry_end"; success: boolean; attempt: number; finalError?: string }
275
+ // Extension UI requests (from child extensions calling ui.select/ui.confirm)
276
+ | { type: "extension_ui_request"; requestId: string; extensionId: string; method: string; params: unknown }
277
+ // RPC command response
278
+ | { type: "response"; id?: string; command: string; success: boolean; data?: unknown; error?: string }
279
+ // Synthetic: stdout pipe closed (graceful degradation)
280
+ | { type: "pipe_closed" };
281
+
282
+ /**
283
+ * Structured progress update derived from an RPC child event.
284
+ * Used by the dashboard to display child status.
285
+ */
286
+ export interface RpcProgressUpdate {
287
+ kind: "tool" | "lifecycle" | "error";
288
+ summary: string;
289
+ toolName?: string;
290
+ }
291
+
240
292
  // ─── Config ──────────────────────────────────────────────────────────────────
241
293
 
242
294
  export interface CleaveConfig {
@@ -432,6 +432,9 @@ export function computeAssessmentSnapshot(repoPath: string, changeName: string):
432
432
  // assessment.json (which lives in-repo) changes HEAD, which invalidates
433
433
  // the fingerprint, making the assessment permanently stale.
434
434
  // Git HEAD is stored separately in the snapshot for informational use.
435
+ // The `dirty` flag still captures uncommitted-change state, which is
436
+ // the meaningful signal — it detects when scoped files have been
437
+ // modified since the last commit without requiring HEAD identity.
435
438
  const fingerprintSeed = JSON.stringify({
436
439
  changeName,
437
440
  dirty,
@@ -5,11 +5,11 @@
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/v22.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 12 Mar 2026 15:47:58 GMT
11
+ * Last updated: Fri, 06 Mar 2026 00:57:44 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
15
- These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yagiz Nizipli](https://github.com/anonrig).
15
+ These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), and [René](https://github.com/Renegade334).
@@ -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-v25.x/api/tty.html#writestreamgetcolordepthenv) documentation.
43
+ * [`getColorDepth()`](https://nodejs.org/docs/latest-v22.x/api/tty.html#writestreamgetcolordepthenv) documentation.
44
44
  * @since v15.0.0
45
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert/strict.js)
45
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/assert/strict.js)
46
46
  */
47
- declare module "node:assert/strict" {
47
+ declare module "assert/strict" {
48
48
  import {
49
49
  Assert,
50
50
  AssertionError,
@@ -52,6 +52,9 @@ declare module "node:assert/strict" {
52
52
  AssertOptions,
53
53
  AssertPredicate,
54
54
  AssertStrict,
55
+ CallTracker,
56
+ CallTrackerCall,
57
+ CallTrackerReportInformation,
55
58
  deepStrictEqual,
56
59
  doesNotMatch,
57
60
  doesNotReject,
@@ -76,6 +79,9 @@ declare module "node:assert/strict" {
76
79
  AssertOptions,
77
80
  AssertPredicate,
78
81
  AssertStrict,
82
+ CallTracker,
83
+ CallTrackerCall,
84
+ CallTrackerReportInformation,
79
85
  deepStrictEqual,
80
86
  deepStrictEqual as deepEqual,
81
87
  doesNotMatch,
@@ -99,7 +105,7 @@ declare module "node:assert/strict" {
99
105
  }
100
106
  export = strict;
101
107
  }
102
- declare module "assert/strict" {
103
- import strict = require("node:assert/strict");
108
+ declare module "node:assert/strict" {
109
+ import strict = require("assert/strict");
104
110
  export = strict;
105
111
  }
@@ -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/v25.x/lib/assert.js)
4
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/assert.js)
5
5
  */
6
- declare module "node:assert" {
7
- import strict = require("node:assert/strict");
6
+ declare module "assert" {
7
+ import strict = require("assert/strict");
8
8
  /**
9
9
  * An alias of {@link assert.ok}.
10
10
  * @since v0.5.9
@@ -44,13 +44,6 @@ declare module "node:assert" {
44
44
  * @default true
45
45
  */
46
46
  strict?: boolean | undefined;
47
- /**
48
- * If set to `true`, skips prototype and constructor
49
- * comparison in deep equality checks.
50
- * @since v24.9.0
51
- * @default false
52
- */
53
- skipPrototype?: boolean | undefined;
54
47
  }
55
48
  interface Assert extends Pick<typeof assert, AssertMethodNames> {
56
49
  readonly [kOptions]: AssertOptions & { strict: false };
@@ -60,7 +53,7 @@ declare module "node:assert" {
60
53
  }
61
54
  /**
62
55
  * The `Assert` class allows creating independent assertion instances with custom options.
63
- * @since v24.6.0
56
+ * @since v22.19.0
64
57
  */
65
58
  var Assert: {
66
59
  /**
@@ -74,8 +67,7 @@ declare module "node:assert" {
74
67
  * ```
75
68
  *
76
69
  * **Important**: When destructuring assertion methods from an `Assert` instance,
77
- * the methods lose their connection to the instance's configuration options (such
78
- * as `diff`, `strict`, and `skipPrototype` settings).
70
+ * the methods lose their connection to the instance's configuration options (such as `diff` and `strict` settings).
79
71
  * The destructured methods will fall back to default behavior instead.
80
72
  *
81
73
  * ```js
@@ -89,41 +81,14 @@ declare module "node:assert" {
89
81
  * strictEqual({ a: 1 }, { b: { c: 1 } });
90
82
  * ```
91
83
  *
92
- * The `skipPrototype` option affects all deep equality methods:
93
- *
94
- * ```js
95
- * class Foo {
96
- * constructor(a) {
97
- * this.a = a;
98
- * }
99
- * }
100
- *
101
- * class Bar {
102
- * constructor(a) {
103
- * this.a = a;
104
- * }
105
- * }
106
- *
107
- * const foo = new Foo(1);
108
- * const bar = new Bar(1);
109
- *
110
- * // Default behavior - fails due to different constructors
111
- * const assert1 = new Assert();
112
- * assert1.deepStrictEqual(foo, bar); // AssertionError
113
- *
114
- * // Skip prototype comparison - passes if properties are equal
115
- * const assert2 = new Assert({ skipPrototype: true });
116
- * assert2.deepStrictEqual(foo, bar); // OK
117
- * ```
118
- *
119
84
  * When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior
120
85
  * (diff: 'simple', non-strict mode).
121
86
  * To maintain custom options when using destructured methods, avoid
122
87
  * destructuring and call methods directly on the instance.
123
- * @since v24.6.0
88
+ * @since v22.19.0
124
89
  */
125
90
  new(
126
- options?: AssertOptions & { strict?: true | undefined },
91
+ options?: AssertOptions & { strict?: true },
127
92
  ): AssertStrict;
128
93
  new(
129
94
  options: AssertOptions,
@@ -182,6 +147,152 @@ declare module "node:assert" {
182
147
  */
183
148
  operator: string;
184
149
  }
150
+ /**
151
+ * This feature is deprecated and will be removed in a future version.
152
+ * Please consider using alternatives such as the `mock` helper function.
153
+ * @since v14.2.0, v12.19.0
154
+ * @deprecated Deprecated
155
+ */
156
+ class CallTracker {
157
+ /**
158
+ * The wrapper function is expected to be called exactly `exact` times. If the
159
+ * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an
160
+ * error.
161
+ *
162
+ * ```js
163
+ * import assert from 'node:assert';
164
+ *
165
+ * // Creates call tracker.
166
+ * const tracker = new assert.CallTracker();
167
+ *
168
+ * function func() {}
169
+ *
170
+ * // Returns a function that wraps func() that must be called exact times
171
+ * // before tracker.verify().
172
+ * const callsfunc = tracker.calls(func);
173
+ * ```
174
+ * @since v14.2.0, v12.19.0
175
+ * @param [fn='A no-op function']
176
+ * @param [exact=1]
177
+ * @return A function that wraps `fn`.
178
+ */
179
+ calls(exact?: number): () => void;
180
+ calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
181
+ /**
182
+ * Example:
183
+ *
184
+ * ```js
185
+ * import assert from 'node:assert';
186
+ *
187
+ * const tracker = new assert.CallTracker();
188
+ *
189
+ * function func() {}
190
+ * const callsfunc = tracker.calls(func);
191
+ * callsfunc(1, 2, 3);
192
+ *
193
+ * assert.deepStrictEqual(tracker.getCalls(callsfunc),
194
+ * [{ thisArg: undefined, arguments: [1, 2, 3] }]);
195
+ * ```
196
+ * @since v18.8.0, v16.18.0
197
+ * @return An array with all the calls to a tracked function.
198
+ */
199
+ getCalls(fn: Function): CallTrackerCall[];
200
+ /**
201
+ * The arrays contains information about the expected and actual number of calls of
202
+ * the functions that have not been called the expected number of times.
203
+ *
204
+ * ```js
205
+ * import assert from 'node:assert';
206
+ *
207
+ * // Creates call tracker.
208
+ * const tracker = new assert.CallTracker();
209
+ *
210
+ * function func() {}
211
+ *
212
+ * // Returns a function that wraps func() that must be called exact times
213
+ * // before tracker.verify().
214
+ * const callsfunc = tracker.calls(func, 2);
215
+ *
216
+ * // Returns an array containing information on callsfunc()
217
+ * console.log(tracker.report());
218
+ * // [
219
+ * // {
220
+ * // message: 'Expected the func function to be executed 2 time(s) but was
221
+ * // executed 0 time(s).',
222
+ * // actual: 0,
223
+ * // expected: 2,
224
+ * // operator: 'func',
225
+ * // stack: stack trace
226
+ * // }
227
+ * // ]
228
+ * ```
229
+ * @since v14.2.0, v12.19.0
230
+ * @return An array of objects containing information about the wrapper functions returned by {@link tracker.calls()}.
231
+ */
232
+ report(): CallTrackerReportInformation[];
233
+ /**
234
+ * Reset calls of the call tracker. If a tracked function is passed as an argument, the calls will be reset for it.
235
+ * If no arguments are passed, all tracked functions will be reset.
236
+ *
237
+ * ```js
238
+ * import assert from 'node:assert';
239
+ *
240
+ * const tracker = new assert.CallTracker();
241
+ *
242
+ * function func() {}
243
+ * const callsfunc = tracker.calls(func);
244
+ *
245
+ * callsfunc();
246
+ * // Tracker was called once
247
+ * assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
248
+ *
249
+ * tracker.reset(callsfunc);
250
+ * assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
251
+ * ```
252
+ * @since v18.8.0, v16.18.0
253
+ * @param fn a tracked function to reset.
254
+ */
255
+ reset(fn?: Function): void;
256
+ /**
257
+ * Iterates through the list of functions passed to {@link tracker.calls()} and will throw an error for functions that
258
+ * have not been called the expected number of times.
259
+ *
260
+ * ```js
261
+ * import assert from 'node:assert';
262
+ *
263
+ * // Creates call tracker.
264
+ * const tracker = new assert.CallTracker();
265
+ *
266
+ * function func() {}
267
+ *
268
+ * // Returns a function that wraps func() that must be called exact times
269
+ * // before tracker.verify().
270
+ * const callsfunc = tracker.calls(func, 2);
271
+ *
272
+ * callsfunc();
273
+ *
274
+ * // Will throw an error since callsfunc() was only called once.
275
+ * tracker.verify();
276
+ * ```
277
+ * @since v14.2.0, v12.19.0
278
+ */
279
+ verify(): void;
280
+ }
281
+ interface CallTrackerCall {
282
+ thisArg: object;
283
+ arguments: unknown[];
284
+ }
285
+ interface CallTrackerReportInformation {
286
+ message: string;
287
+ /** The actual number of times the function was called. */
288
+ actual: number;
289
+ /** The number of times the function was expected to be called. */
290
+ expected: number;
291
+ /** The name of the function that is wrapped. */
292
+ operator: string;
293
+ /** A stack trace of the function. */
294
+ stack: object;
295
+ }
185
296
  type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
186
297
  /**
187
298
  * Throws an `AssertionError` with the provided error message or a default
@@ -200,10 +311,22 @@ declare module "node:assert" {
200
311
  * assert.fail(new TypeError('need array'));
201
312
  * // TypeError: need array
202
313
  * ```
314
+ *
315
+ * Using `assert.fail()` with more than two arguments is possible but deprecated.
316
+ * See below for further details.
203
317
  * @since v0.1.21
204
318
  * @param [message='Failed']
205
319
  */
206
320
  function fail(message?: string | Error): never;
321
+ /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
322
+ function fail(
323
+ actual: unknown,
324
+ expected: unknown,
325
+ message?: string | Error,
326
+ operator?: string,
327
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
328
+ stackStartFn?: Function,
329
+ ): never;
207
330
  /**
208
331
  * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`.
209
332
  *
@@ -253,10 +376,10 @@ declare module "node:assert" {
253
376
  * import assert from 'node:assert/strict';
254
377
  *
255
378
  * // Using `assert()` works the same:
256
- * assert(2 + 2 > 5);;
379
+ * assert(0);
257
380
  * // AssertionError: The expression evaluated to a falsy value:
258
381
  * //
259
- * // assert(2 + 2 > 5)
382
+ * // assert(0)
260
383
  * ```
261
384
  * @since v0.1.21
262
385
  */
@@ -771,7 +894,7 @@ declare module "node:assert" {
771
894
  * check that the promise is rejected.
772
895
  *
773
896
  * If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the
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)
897
+ * function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v22.x/api/errors.html#err_invalid_return_value)
775
898
  * error. In both cases the error handler is skipped.
776
899
  *
777
900
  * Besides the async nature to await the completion behaves identically to {@link throws}.
@@ -841,7 +964,7 @@ declare module "node:assert" {
841
964
  *
842
965
  * If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If
843
966
  * the function does not return a promise, `assert.doesNotReject()` will return a
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
967
+ * rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v22.x/api/errors.html#err_invalid_return_value) error. In both cases
845
968
  * the error handler is skipped.
846
969
  *
847
970
  * Using `assert.doesNotReject()` is actually not useful because there is little
@@ -904,7 +1027,7 @@ declare module "node:assert" {
904
1027
  * 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
905
1028
  * to the value of the `message` parameter. If the `message` parameter is
906
1029
  * undefined, a default error message is assigned. If the `message` parameter is an
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}`.
1030
+ * instance of an [Error](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
908
1031
  * @since v13.6.0, v12.16.0
909
1032
  */
910
1033
  function match(value: string, regExp: RegExp, message?: string | Error): void;
@@ -927,7 +1050,7 @@ declare module "node:assert" {
927
1050
  * 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
928
1051
  * to the value of the `message` parameter. If the `message` parameter is
929
1052
  * undefined, a default error message is assigned. If the `message` parameter is an
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}`.
1053
+ * instance of an [Error](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
931
1054
  * @since v13.6.0, v12.16.0
932
1055
  */
933
1056
  function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
@@ -949,7 +1072,7 @@ declare module "node:assert" {
949
1072
  }
950
1073
  export = assert;
951
1074
  }
952
- declare module "assert" {
953
- import assert = require("node:assert");
1075
+ declare module "node:assert" {
1076
+ import assert = require("assert");
954
1077
  export = assert;
955
1078
  }
@@ -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-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
5
+ * * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v22.x/api/async_context.html#class-asynclocalstorage) tracks async context
6
+ * * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v22.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/v25.x/lib/async_hooks.js)
15
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/async_hooks.js)
16
16
  */
17
- declare module "node:async_hooks" {
17
+ declare module "async_hooks" {
18
18
  /**
19
19
  * ```js
20
20
  * import { executionAsyncId } from 'node:async_hooks';
@@ -44,7 +44,7 @@ declare module "node: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-v25.x/api/async_hooks.html#promise-execution-tracking).
47
+ * See the section on [promise execution tracking](https://nodejs.org/docs/latest-v22.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 "node: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-v25.x/api/async_hooks.html#promise-execution-tracking).
120
+ * the section on [promise execution tracking](https://nodejs.org/docs/latest-v22.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;
@@ -320,16 +320,6 @@ declare module "node:async_hooks" {
320
320
  */
321
321
  triggerAsyncId(): number;
322
322
  }
323
- interface AsyncLocalStorageOptions {
324
- /**
325
- * The default value to be used when no store is provided.
326
- */
327
- defaultValue?: any;
328
- /**
329
- * A name for the `AsyncLocalStorage` value.
330
- */
331
- name?: string | undefined;
332
- }
333
323
  /**
334
324
  * This class creates stores that stay coherent through asynchronous operations.
335
325
  *
@@ -379,11 +369,6 @@ declare module "node:async_hooks" {
379
369
  * @since v13.10.0, v12.17.0
380
370
  */
381
371
  class AsyncLocalStorage<T> {
382
- /**
383
- * Creates a new instance of `AsyncLocalStorage`. Store is only provided within a
384
- * `run()` call or after an `enterWith()` call.
385
- */
386
- constructor(options?: AsyncLocalStorageOptions);
387
372
  /**
388
373
  * Binds the given function to the current execution context.
389
374
  * @since v19.8.0
@@ -445,11 +430,6 @@ declare module "node:async_hooks" {
445
430
  * @since v13.10.0, v12.17.0
446
431
  */
447
432
  getStore(): T | undefined;
448
- /**
449
- * The name of the `AsyncLocalStorage` instance if provided.
450
- * @since v24.0.0
451
- */
452
- readonly name: string;
453
433
  /**
454
434
  * Runs a function synchronously within a context and returns its
455
435
  * return value. The store is not accessible outside of the callback function.
@@ -618,6 +598,6 @@ declare module "node:async_hooks" {
618
598
  const VERIFYREQUEST: number;
619
599
  }
620
600
  }
621
- declare module "async_hooks" {
622
- export * from "node:async_hooks";
601
+ declare module "node:async_hooks" {
602
+ export * from "async_hooks";
623
603
  }
@@ -1,4 +1,4 @@
1
- declare module "node:buffer" {
1
+ declare module "buffer" {
2
2
  type ImplicitArrayBuffer<T extends WithImplicitCoercion<ArrayBufferLike>> = T extends
3
3
  { valueOf(): infer V extends ArrayBufferLike } ? V : T;
4
4
  global {
@@ -463,4 +463,10 @@ declare module "node: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
+ };
466
472
  }