@openclaw/slack 2026.6.5 → 2026.6.6-beta.2

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 (106) hide show
  1. package/dist/api.js +2 -2
  2. package/dist/{channel-C15EZbTc.js → channel-i43aT1rv.js} +1 -1
  3. package/dist/channel-plugin-api.js +1 -1
  4. package/dist/contract-api.js +1 -5
  5. package/dist/{monitor-C1P_IgPU.js → monitor-Szm2LjsM.js} +1 -1
  6. package/dist/{pipeline.runtime-DDELeqeP.js → pipeline.runtime-Dvqs0AT-.js} +1 -1
  7. package/dist/{provider-Cxqi3uh_.js → provider-LH_j-bLA.js} +2 -1
  8. package/dist/runtime-api.js +2 -2
  9. package/node_modules/@types/node/README.md +1 -1
  10. package/node_modules/@types/node/http2.d.ts +3 -0
  11. package/node_modules/@types/node/package.json +2 -2
  12. package/node_modules/@types/ws/node_modules/@types/node/LICENSE +21 -0
  13. package/node_modules/@types/ws/node_modules/@types/node/README.md +15 -0
  14. package/node_modules/@types/ws/node_modules/@types/node/assert/strict.d.ts +59 -0
  15. package/node_modules/@types/ws/node_modules/@types/node/assert.d.ts +950 -0
  16. package/node_modules/@types/ws/node_modules/@types/node/async_hooks.d.ts +711 -0
  17. package/node_modules/@types/ws/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  18. package/node_modules/@types/ws/node_modules/@types/node/buffer.d.ts +1765 -0
  19. package/node_modules/@types/ws/node_modules/@types/node/child_process.d.ts +1366 -0
  20. package/node_modules/@types/ws/node_modules/@types/node/cluster.d.ts +432 -0
  21. package/node_modules/@types/ws/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  22. package/node_modules/@types/ws/node_modules/@types/node/console.d.ts +93 -0
  23. package/node_modules/@types/ws/node_modules/@types/node/constants.d.ts +14 -0
  24. package/node_modules/@types/ws/node_modules/@types/node/crypto.d.ts +4058 -0
  25. package/node_modules/@types/ws/node_modules/@types/node/dgram.d.ts +537 -0
  26. package/node_modules/@types/ws/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
  27. package/node_modules/@types/ws/node_modules/@types/node/dns/promises.d.ts +497 -0
  28. package/node_modules/@types/ws/node_modules/@types/node/dns.d.ts +876 -0
  29. package/node_modules/@types/ws/node_modules/@types/node/domain.d.ts +150 -0
  30. package/node_modules/@types/ws/node_modules/@types/node/events.d.ts +1008 -0
  31. package/node_modules/@types/ws/node_modules/@types/node/fs/promises.d.ts +1468 -0
  32. package/node_modules/@types/ws/node_modules/@types/node/fs.d.ts +4780 -0
  33. package/node_modules/@types/ws/node_modules/@types/node/globals.d.ts +150 -0
  34. package/node_modules/@types/ws/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  35. package/node_modules/@types/ws/node_modules/@types/node/http.d.ts +2147 -0
  36. package/node_modules/@types/ws/node_modules/@types/node/http2.d.ts +2485 -0
  37. package/node_modules/@types/ws/node_modules/@types/node/https.d.ts +400 -0
  38. package/node_modules/@types/ws/node_modules/@types/node/index.d.ts +117 -0
  39. package/node_modules/@types/ws/node_modules/@types/node/inspector/promises.d.ts +35 -0
  40. package/node_modules/@types/ws/node_modules/@types/node/inspector.d.ts +264 -0
  41. package/node_modules/@types/ws/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  42. package/node_modules/@types/ws/node_modules/@types/node/module.d.ts +755 -0
  43. package/node_modules/@types/ws/node_modules/@types/node/net.d.ts +970 -0
  44. package/node_modules/@types/ws/node_modules/@types/node/os.d.ts +498 -0
  45. package/node_modules/@types/ws/node_modules/@types/node/package.json +155 -0
  46. package/node_modules/@types/ws/node_modules/@types/node/path/posix.d.ts +8 -0
  47. package/node_modules/@types/ws/node_modules/@types/node/path/win32.d.ts +8 -0
  48. package/node_modules/@types/ws/node_modules/@types/node/path.d.ts +178 -0
  49. package/node_modules/@types/ws/node_modules/@types/node/perf_hooks.d.ts +612 -0
  50. package/node_modules/@types/ws/node_modules/@types/node/process.d.ts +2204 -0
  51. package/node_modules/@types/ws/node_modules/@types/node/punycode.d.ts +89 -0
  52. package/node_modules/@types/ws/node_modules/@types/node/querystring.d.ts +139 -0
  53. package/node_modules/@types/ws/node_modules/@types/node/quic.d.ts +897 -0
  54. package/node_modules/@types/ws/node_modules/@types/node/readline/promises.d.ts +158 -0
  55. package/node_modules/@types/ws/node_modules/@types/node/readline.d.ts +507 -0
  56. package/node_modules/@types/ws/node_modules/@types/node/repl.d.ts +420 -0
  57. package/node_modules/@types/ws/node_modules/@types/node/sea.d.ts +47 -0
  58. package/node_modules/@types/ws/node_modules/@types/node/sqlite.d.ts +1068 -0
  59. package/node_modules/@types/ws/node_modules/@types/node/stream/consumers.d.ts +114 -0
  60. package/node_modules/@types/ws/node_modules/@types/node/stream/iter.d.ts +301 -0
  61. package/node_modules/@types/ws/node_modules/@types/node/stream/promises.d.ts +211 -0
  62. package/node_modules/@types/ws/node_modules/@types/node/stream/web.d.ts +300 -0
  63. package/node_modules/@types/ws/node_modules/@types/node/stream.d.ts +1774 -0
  64. package/node_modules/@types/ws/node_modules/@types/node/string_decoder.d.ts +27 -0
  65. package/node_modules/@types/ws/node_modules/@types/node/test/reporters.d.ts +59 -0
  66. package/node_modules/@types/ws/node_modules/@types/node/test.d.ts +2279 -0
  67. package/node_modules/@types/ws/node_modules/@types/node/timers/promises.d.ts +93 -0
  68. package/node_modules/@types/ws/node_modules/@types/node/timers.d.ts +149 -0
  69. package/node_modules/@types/ws/node_modules/@types/node/tls.d.ts +1193 -0
  70. package/node_modules/@types/ws/node_modules/@types/node/trace_events.d.ts +103 -0
  71. package/node_modules/@types/ws/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  72. package/node_modules/@types/ws/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  73. package/node_modules/@types/ws/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  74. package/node_modules/@types/ws/node_modules/@types/node/ts5.6/index.d.ts +119 -0
  75. package/node_modules/@types/ws/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  76. package/node_modules/@types/ws/node_modules/@types/node/ts5.7/index.d.ts +119 -0
  77. package/node_modules/@types/ws/node_modules/@types/node/tty.d.ts +225 -0
  78. package/node_modules/@types/ws/node_modules/@types/node/url.d.ts +556 -0
  79. package/node_modules/@types/ws/node_modules/@types/node/util/types.d.ts +558 -0
  80. package/node_modules/@types/ws/node_modules/@types/node/util.d.ts +1677 -0
  81. package/node_modules/@types/ws/node_modules/@types/node/v8.d.ts +980 -0
  82. package/node_modules/@types/ws/node_modules/@types/node/vm.d.ts +1136 -0
  83. package/node_modules/@types/ws/node_modules/@types/node/wasi.d.ts +131 -0
  84. package/node_modules/@types/ws/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  85. package/node_modules/@types/ws/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  86. package/node_modules/@types/ws/node_modules/@types/node/web-globals/console.d.ts +9 -0
  87. package/node_modules/@types/ws/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  88. package/node_modules/@types/ws/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  89. package/node_modules/@types/ws/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  90. package/node_modules/@types/ws/node_modules/@types/node/web-globals/events.d.ts +106 -0
  91. package/node_modules/@types/ws/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  92. package/node_modules/@types/ws/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  93. package/node_modules/@types/ws/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  94. package/node_modules/@types/ws/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  95. package/node_modules/@types/ws/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  96. package/node_modules/@types/ws/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  97. package/node_modules/@types/ws/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  98. package/node_modules/@types/ws/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  99. package/node_modules/@types/ws/node_modules/@types/node/web-globals/url.d.ts +24 -0
  100. package/node_modules/@types/ws/node_modules/@types/node/worker_threads.d.ts +671 -0
  101. package/node_modules/@types/ws/node_modules/@types/node/zlib/iter.d.ts +131 -0
  102. package/node_modules/@types/ws/node_modules/@types/node/zlib.d.ts +589 -0
  103. package/node_modules/semver/classes/semver.js +19 -2
  104. package/node_modules/semver/package.json +1 -1
  105. package/npm-shrinkwrap.json +18 -9
  106. package/package.json +4 -4
@@ -0,0 +1,114 @@
1
+ declare module "node:stream/consumers" {
2
+ import { Blob, NonSharedBuffer } from "node:buffer";
3
+ import { ReadableStream } from "node:stream/web";
4
+ /**
5
+ * ```js
6
+ * import { arrayBuffer } from 'node:stream/consumers';
7
+ * import { Readable } from 'node:stream';
8
+ * import { TextEncoder } from 'node:util';
9
+ *
10
+ * const encoder = new TextEncoder();
11
+ * const dataArray = encoder.encode('hello world from consumers!');
12
+ *
13
+ * const readable = Readable.from(dataArray);
14
+ * const data = await arrayBuffer(readable);
15
+ * console.log(`from readable: ${data.byteLength}`);
16
+ * // Prints: from readable: 76
17
+ * ```
18
+ * @since v16.7.0
19
+ * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream.
20
+ */
21
+ function arrayBuffer(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<ArrayBuffer>;
22
+ /**
23
+ * ```js
24
+ * import { blob } from 'node:stream/consumers';
25
+ *
26
+ * const dataBlob = new Blob(['hello world from consumers!']);
27
+ *
28
+ * const readable = dataBlob.stream();
29
+ * const data = await blob(readable);
30
+ * console.log(`from readable: ${data.size}`);
31
+ * // Prints: from readable: 27
32
+ * ```
33
+ * @since v16.7.0
34
+ * @returns Fulfills with a `Blob` containing the full contents of the stream.
35
+ */
36
+ function blob(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<Blob>;
37
+ /**
38
+ * ```js
39
+ * import { buffer } from 'node:stream/consumers';
40
+ * import { Readable } from 'node:stream';
41
+ * import { Buffer } from 'node:buffer';
42
+ *
43
+ * const dataBuffer = Buffer.from('hello world from consumers!');
44
+ *
45
+ * const readable = Readable.from(dataBuffer);
46
+ * const data = await buffer(readable);
47
+ * console.log(`from readable: ${data.length}`);
48
+ * // Prints: from readable: 27
49
+ * ```
50
+ * @since v16.7.0
51
+ * @returns Fulfills with a `Buffer` containing the full contents of the stream.
52
+ */
53
+ function buffer(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NonSharedBuffer>;
54
+ /**
55
+ * ```js
56
+ * import { bytes } from 'node:stream/consumers';
57
+ * import { Readable } from 'node:stream';
58
+ * import { Buffer } from 'node:buffer';
59
+ *
60
+ * const dataBuffer = Buffer.from('hello world from consumers!');
61
+ *
62
+ * const readable = Readable.from(dataBuffer);
63
+ * const data = await bytes(readable);
64
+ * console.log(`from readable: ${data.length}`);
65
+ * // Prints: from readable: 27
66
+ * ```
67
+ * @since v25.6.0
68
+ * @returns Fulfills with a `Uint8Array` containing the full contents of the stream.
69
+ */
70
+ function bytes(
71
+ stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>,
72
+ ): Promise<NodeJS.NonSharedUint8Array>;
73
+ /**
74
+ * ```js
75
+ * import { json } from 'node:stream/consumers';
76
+ * import { Readable } from 'node:stream';
77
+ *
78
+ * const items = Array.from(
79
+ * {
80
+ * length: 100,
81
+ * },
82
+ * () => ({
83
+ * message: 'hello world from consumers!',
84
+ * }),
85
+ * );
86
+ *
87
+ * const readable = Readable.from(JSON.stringify(items));
88
+ * const data = await json(readable);
89
+ * console.log(`from readable: ${data.length}`);
90
+ * // Prints: from readable: 100
91
+ * ```
92
+ * @since v16.7.0
93
+ * @returns Fulfills with the contents of the stream parsed as a
94
+ * UTF-8 encoded string that is then passed through `JSON.parse()`.
95
+ */
96
+ function json(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<unknown>;
97
+ /**
98
+ * ```js
99
+ * import { text } from 'node:stream/consumers';
100
+ * import { Readable } from 'node:stream';
101
+ *
102
+ * const readable = Readable.from('Hello world from consumers!');
103
+ * const data = await text(readable);
104
+ * console.log(`from readable: ${data.length}`);
105
+ * // Prints: from readable: 27
106
+ * ```
107
+ * @since v16.7.0
108
+ * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string.
109
+ */
110
+ function text(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<string>;
111
+ }
112
+ declare module "stream/consumers" {
113
+ export * from "node:stream/consumers";
114
+ }
@@ -0,0 +1,301 @@
1
+ declare module "node:stream/iter" {
2
+ // Symbols and custom typedefs
3
+ const broadcastProtocol: unique symbol;
4
+ const drainableProtocol: unique symbol;
5
+ const shareProtocol: unique symbol;
6
+ const shareSyncProtocol: unique symbol;
7
+ const toAsyncStreamable: unique symbol;
8
+ const toStreamable: unique symbol;
9
+ type Source =
10
+ | string
11
+ | ArrayBufferLike
12
+ | ArrayBufferView
13
+ | Iterable<SyncSource>
14
+ | AsyncIterable<Source>
15
+ | Streamable
16
+ | AsyncStreamable;
17
+ type SyncSource = string | ArrayBufferLike | ArrayBufferView | Iterable<SyncSource> | Streamable;
18
+ type Transform = StatelessTransformFn | StatefulTransform;
19
+ type SyncTransform = SyncStatelessTransformFn | SyncStatefulTransform;
20
+ type TransformResult =
21
+ | string
22
+ | ArrayBufferLike
23
+ | ArrayBufferView
24
+ | Iterable<SyncTransformResult>
25
+ | AsyncIterable<TransformResult>;
26
+ type SyncTransformResult = string | ArrayBufferLike | ArrayBufferView | Iterable<SyncTransformResult>;
27
+ interface AsyncStreamable {
28
+ [toAsyncStreamable](): Source;
29
+ }
30
+ interface Broadcastable {
31
+ [broadcastProtocol](options: BroadcastOptions): Broadcast;
32
+ }
33
+ interface Drainable {
34
+ [drainableProtocol](): Promise<boolean> | null;
35
+ }
36
+ interface Shareable {
37
+ [shareProtocol](options: ShareOptions): Share;
38
+ }
39
+ interface Streamable {
40
+ [toStreamable](): SyncSource;
41
+ }
42
+ interface SyncShareable {
43
+ [shareSyncProtocol](options: ShareSyncOptions): SyncShare;
44
+ }
45
+ // IDL dictionaries, enums, typedefs
46
+ type BackpressurePolicy = "strict" | "block" | "drop-oldest" | "drop-newest";
47
+ type ByteReadableStream = AsyncIterable<Uint8Array[]>;
48
+ type SyncByteReadableStream = Iterable<Uint8Array[]>;
49
+ interface WriteOptions {
50
+ signal?: AbortSignal;
51
+ }
52
+ interface PushStreamOptions {
53
+ highWaterMark?: number;
54
+ backpressure?: BackpressurePolicy;
55
+ signal?: AbortSignal;
56
+ }
57
+ interface PullOptions {
58
+ signal?: AbortSignal;
59
+ }
60
+ interface PipeToOptions {
61
+ signal?: AbortSignal;
62
+ preventClose?: boolean;
63
+ preventFail?: boolean;
64
+ }
65
+ interface PipeToSyncOptions {
66
+ preventClose?: boolean;
67
+ preventFail?: boolean;
68
+ }
69
+ interface ConsumeOptions {
70
+ signal?: AbortSignal;
71
+ limit?: number;
72
+ }
73
+ interface ConsumeSyncOptions {
74
+ limit?: number;
75
+ }
76
+ interface TextConsumeOptions extends ConsumeOptions {
77
+ encoding?: string;
78
+ }
79
+ interface TextConsumeSyncOptions extends ConsumeSyncOptions {
80
+ encoding?: string;
81
+ }
82
+ interface MergeOptions {
83
+ signal?: AbortSignal;
84
+ }
85
+ interface BroadcastOptions {
86
+ highWaterMark?: number;
87
+ backpressure?: BackpressurePolicy;
88
+ signal?: AbortSignal;
89
+ }
90
+ interface ShareOptions {
91
+ highWaterMark?: number;
92
+ backpressure?: BackpressurePolicy;
93
+ signal?: AbortSignal;
94
+ }
95
+ interface ShareSyncOptions {
96
+ highWaterMark?: number;
97
+ backpressure?: BackpressurePolicy;
98
+ }
99
+ interface DuplexDirectionOptions {
100
+ highWaterMark?: number;
101
+ backpressure?: BackpressurePolicy;
102
+ }
103
+ interface DuplexOptions {
104
+ highWaterMark?: number;
105
+ backpressure?: BackpressurePolicy;
106
+ a?: DuplexDirectionOptions;
107
+ b?: DuplexDirectionOptions;
108
+ signal?: AbortSignal;
109
+ }
110
+ interface TransformCallbackOptions {
111
+ signal: AbortSignal;
112
+ }
113
+ interface StatelessTransformFn {
114
+ (
115
+ chunks: Uint8Array[] | null,
116
+ options: TransformCallbackOptions,
117
+ ): Promise<TransformResult | null> | TransformResult | null;
118
+ }
119
+ interface SyncStatelessTransformFn {
120
+ (chunks: Uint8Array[] | null): SyncTransformResult | null;
121
+ }
122
+ interface StatefulTransform {
123
+ transform(
124
+ source: AsyncIterable<Uint8Array[] | null>,
125
+ options: TransformCallbackOptions,
126
+ ): AsyncIterable<TransformResult>;
127
+ }
128
+ interface SyncStatefulTransform {
129
+ transform(source: Iterable<Uint8Array[] | null>): Iterable<SyncTransformResult>;
130
+ }
131
+ // IDL interfaces
132
+ interface PushWriter extends Writer, Drainable {}
133
+ interface PushStreamResult {
134
+ writer: PushWriter;
135
+ readable: ByteReadableStream;
136
+ }
137
+ interface BroadcastWriter extends Writer, Drainable {}
138
+ interface BroadcastResult {
139
+ writer: BroadcastWriter;
140
+ broadcast: Broadcast;
141
+ }
142
+ interface Writer extends Disposable, AsyncDisposable {
143
+ readonly desiredSize: number | null;
144
+ write(chunk: Uint8Array | string, options?: WriteOptions): Promise<void>;
145
+ writev(chunks: Array<Uint8Array | string>, options?: WriteOptions): Promise<void>;
146
+ writeSync(chunk: Uint8Array | string): boolean;
147
+ writevSync(chunks: Array<Uint8Array | string>): boolean;
148
+ end(options?: WriteOptions): Promise<number>;
149
+ endSync(): number;
150
+ fail(reason?: any): void;
151
+ }
152
+ interface PartialWriter extends Partial<Writer> {
153
+ write(chunk: Uint8Array | string, options?: WriteOptions): Promise<void>;
154
+ }
155
+ interface SyncWriter extends Disposable {
156
+ readonly desiredSize: number | null;
157
+ writeSync(chunk: Uint8Array | string): number;
158
+ writevSync(chunks: Array<Uint8Array | string>): number;
159
+ endSync(): number;
160
+ fail(reason?: any): void;
161
+ }
162
+ interface PartialSyncWriter extends Partial<SyncWriter> {
163
+ writeSync(chunk: Uint8Array | string): number;
164
+ }
165
+ interface Broadcast extends Disposable {
166
+ readonly consumerCount: number;
167
+ readonly bufferSize: number;
168
+ push(...args: any[]): ByteReadableStream;
169
+ cancel(reason?: any): void;
170
+ }
171
+ interface Share extends Disposable {
172
+ readonly consumerCount: number;
173
+ readonly bufferSize: number;
174
+ pull(...args: any[]): ByteReadableStream;
175
+ cancel(reason?: any): void;
176
+ }
177
+ interface SyncShare extends Disposable {
178
+ readonly consumerCount: number;
179
+ readonly bufferSize: number;
180
+ pull(...args: any): SyncByteReadableStream;
181
+ cancel(reason?: any): void;
182
+ }
183
+ interface DuplexChannel extends AsyncDisposable {
184
+ readonly writer: Writer;
185
+ readonly readable: ByteReadableStream;
186
+ close(): Promise<void>;
187
+ }
188
+ // Push stream creation
189
+ function push(...transforms: Transform[]): PushStreamResult;
190
+ function push(...args: [...transforms: Transform[], options: PushStreamOptions]): PushStreamResult;
191
+ // Stream factories
192
+ function from(input: Source): ByteReadableStream;
193
+ function fromSync(input: SyncSource): SyncByteReadableStream;
194
+ // Pull pipelines
195
+ function pull(source: Source, ...transforms: Transform[]): ByteReadableStream;
196
+ function pull(
197
+ source: Source,
198
+ ...args: [...transforms: Transform[], options: PullOptions]
199
+ ): ByteReadableStream;
200
+ function pullSync(source: SyncSource, ...transforms: SyncTransform[]): SyncByteReadableStream;
201
+ // Pipe operations
202
+ function pipeTo(source: Source, writer: PartialWriter, options?: PipeToOptions): Promise<number>;
203
+ function pipeTo(source: Source, ...args: [...transforms: Transform[], writer: PartialWriter]): Promise<number>;
204
+ function pipeTo(
205
+ source: Source,
206
+ ...args: [...transforms: Transform[], writer: PartialWriter, options: PipeToOptions]
207
+ ): Promise<number>;
208
+ function pipeToSync(source: SyncSource, writer: PartialSyncWriter, options?: PipeToSyncOptions): number;
209
+ function pipeToSync(
210
+ source: SyncSource,
211
+ ...args: [...transforms: SyncTransform[], writer: PartialSyncWriter]
212
+ ): number;
213
+ function pipeToSync(
214
+ source: SyncSource,
215
+ ...args: [...transforms: SyncTransform[], writer: PartialSyncWriter, options: PipeToSyncOptions]
216
+ ): number;
217
+ // Consumers
218
+ function bytes(source: Source, options?: ConsumeOptions): Promise<Uint8Array>;
219
+ function bytesSync(source: SyncSource, options?: ConsumeSyncOptions): Uint8Array;
220
+ function text(source: Source, options?: TextConsumeOptions): Promise<string>;
221
+ function textSync(source: SyncSource, options?: TextConsumeSyncOptions): string;
222
+ function arrayBuffer(source: Source, options?: ConsumeOptions): Promise<ArrayBuffer>;
223
+ function arrayBufferSync(source: SyncSource, options?: ConsumeSyncOptions): ArrayBuffer;
224
+ function array(source: Source, options?: ConsumeOptions): Promise<Uint8Array[]>;
225
+ function arraySync(source: SyncSource, options?: ConsumeSyncOptions): Uint8Array[];
226
+ // Utilities
227
+ function tap(callback: StatelessTransformFn): StatelessTransformFn;
228
+ function tapSync(callback: SyncStatelessTransformFn): SyncStatelessTransformFn;
229
+ function merge(...sources: Source[]): ByteReadableStream;
230
+ function merge(...args: [...sources: Source[], options: MergeOptions]): ByteReadableStream;
231
+ function ondrain(drainable: any): Promise<boolean> | null;
232
+ // Multi-consumer
233
+ function broadcast(options?: BroadcastOptions): BroadcastResult;
234
+ function share(source: Source, options?: ShareOptions): Share;
235
+ function shareSync(source: SyncSource, options?: ShareSyncOptions): SyncShare;
236
+ // Duplex
237
+ function duplex(options?: DuplexOptions): [DuplexChannel, DuplexChannel];
238
+ // Node.js-specific extensions
239
+ namespace Broadcast {
240
+ /**
241
+ * Create a `Broadcast` from an existing source. The source is consumed
242
+ * automatically and pushed to all subscribers.
243
+ * @since v25.9.0
244
+ * @param options Same as `broadcast()`.
245
+ */
246
+ function from(
247
+ input: ByteReadableStream | SyncByteReadableStream | Broadcastable,
248
+ options?: BroadcastOptions,
249
+ ): BroadcastResult;
250
+ }
251
+ namespace Share {
252
+ /**
253
+ * Create a `Share` from an existing source.
254
+ * @since v25.9.0
255
+ * @param options Same as `share()`.
256
+ */
257
+ function from(input: ByteReadableStream | SyncByteReadableStream | Shareable, options?: ShareOptions): Share;
258
+ }
259
+ namespace SyncShare {
260
+ /**
261
+ * @since v25.9.0
262
+ */
263
+ function from(input: SyncByteReadableStream | SyncShareable, options?: ShareSyncOptions): SyncShare;
264
+ }
265
+ namespace Stream {
266
+ export {
267
+ array,
268
+ arrayBuffer,
269
+ arrayBufferSync,
270
+ arraySync,
271
+ broadcast,
272
+ broadcastProtocol,
273
+ bytes,
274
+ bytesSync,
275
+ drainableProtocol,
276
+ duplex,
277
+ from,
278
+ fromSync,
279
+ merge,
280
+ ondrain,
281
+ pipeTo,
282
+ pipeToSync,
283
+ pull,
284
+ pullSync,
285
+ push,
286
+ share,
287
+ shareProtocol,
288
+ shareSync,
289
+ shareSyncProtocol,
290
+ tap,
291
+ tapSync,
292
+ text,
293
+ textSync,
294
+ toAsyncStreamable,
295
+ toStreamable,
296
+ };
297
+ }
298
+ }
299
+ declare module "stream/iter" {
300
+ export * from "node:stream/iter";
301
+ }
@@ -0,0 +1,211 @@
1
+ declare module "node:stream/promises" {
2
+ import { Abortable } from "node:events";
3
+ import {
4
+ FinishedOptions as _FinishedOptions,
5
+ PipelineDestination,
6
+ PipelineSource,
7
+ PipelineTransform,
8
+ } from "node:stream";
9
+ import { ReadableStream, WritableStream } from "node:stream/web";
10
+ interface FinishedOptions extends _FinishedOptions {
11
+ /**
12
+ * If true, removes the listeners registered by this function before the promise is fulfilled.
13
+ * @default false
14
+ */
15
+ cleanup?: boolean | undefined;
16
+ }
17
+ /**
18
+ * ```js
19
+ * import { finished } from 'node:stream/promises';
20
+ * import { createReadStream } from 'node:fs';
21
+ *
22
+ * const rs = createReadStream('archive.tar');
23
+ *
24
+ * async function run() {
25
+ * await finished(rs);
26
+ * console.log('Stream is done reading.');
27
+ * }
28
+ *
29
+ * run().catch(console.error);
30
+ * rs.resume(); // Drain the stream.
31
+ * ```
32
+ *
33
+ * The `finished` API also provides a [callback version](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamfinishedstream-options-callback).
34
+ *
35
+ * `stream.finished()` leaves dangling event listeners (in particular
36
+ * `'error'`, `'end'`, `'finish'` and `'close'`) after the returned promise is
37
+ * resolved or rejected. The reason for this is so that unexpected `'error'`
38
+ * events (due to incorrect stream implementations) do not cause unexpected
39
+ * crashes. If this is unwanted behavior then `options.cleanup` should be set to
40
+ * `true`:
41
+ *
42
+ * ```js
43
+ * await finished(rs, { cleanup: true });
44
+ * ```
45
+ * @since v15.0.0
46
+ * @returns Fulfills when the stream is no longer readable or writable.
47
+ */
48
+ function finished(
49
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | ReadableStream | WritableStream,
50
+ options?: FinishedOptions,
51
+ ): Promise<void>;
52
+ interface PipelineOptions extends Abortable {
53
+ end?: boolean | undefined;
54
+ }
55
+ type PipelineResult<S extends PipelineDestination<any, any>> = S extends (...args: any[]) => PromiseLike<infer R>
56
+ ? Promise<R>
57
+ : Promise<void>;
58
+ /**
59
+ * ```js
60
+ * import { pipeline } from 'node:stream/promises';
61
+ * import { createReadStream, createWriteStream } from 'node:fs';
62
+ * import { createGzip } from 'node:zlib';
63
+ *
64
+ * await pipeline(
65
+ * createReadStream('archive.tar'),
66
+ * createGzip(),
67
+ * createWriteStream('archive.tar.gz'),
68
+ * );
69
+ * console.log('Pipeline succeeded.');
70
+ * ```
71
+ *
72
+ * To use an `AbortSignal`, pass it inside an options object, as the last argument.
73
+ * When the signal is aborted, `destroy` will be called on the underlying pipeline,
74
+ * with an `AbortError`.
75
+ *
76
+ * ```js
77
+ * import { pipeline } from 'node:stream/promises';
78
+ * import { createReadStream, createWriteStream } from 'node:fs';
79
+ * import { createGzip } from 'node:zlib';
80
+ *
81
+ * const ac = new AbortController();
82
+ * const { signal } = ac;
83
+ * setImmediate(() => ac.abort());
84
+ * try {
85
+ * await pipeline(
86
+ * createReadStream('archive.tar'),
87
+ * createGzip(),
88
+ * createWriteStream('archive.tar.gz'),
89
+ * { signal },
90
+ * );
91
+ * } catch (err) {
92
+ * console.error(err); // AbortError
93
+ * }
94
+ * ```
95
+ *
96
+ * The `pipeline` API also supports async generators:
97
+ *
98
+ * ```js
99
+ * import { pipeline } from 'node:stream/promises';
100
+ * import { createReadStream, createWriteStream } from 'node:fs';
101
+ *
102
+ * await pipeline(
103
+ * createReadStream('lowercase.txt'),
104
+ * async function* (source, { signal }) {
105
+ * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s.
106
+ * for await (const chunk of source) {
107
+ * yield await processChunk(chunk, { signal });
108
+ * }
109
+ * },
110
+ * createWriteStream('uppercase.txt'),
111
+ * );
112
+ * console.log('Pipeline succeeded.');
113
+ * ```
114
+ *
115
+ * Remember to handle the `signal` argument passed into the async generator.
116
+ * Especially in the case where the async generator is the source for the
117
+ * pipeline (i.e. first argument) or the pipeline will never complete.
118
+ *
119
+ * ```js
120
+ * import { pipeline } from 'node:stream/promises';
121
+ * import fs from 'node:fs';
122
+ * await pipeline(
123
+ * async function* ({ signal }) {
124
+ * await someLongRunningfn({ signal });
125
+ * yield 'asd';
126
+ * },
127
+ * fs.createWriteStream('uppercase.txt'),
128
+ * );
129
+ * console.log('Pipeline succeeded.');
130
+ * ```
131
+ *
132
+ * The `pipeline` API provides [callback version](https://nodejs.org/docs/latest-v25.x/api/stream.html#streampipelinesource-transforms-destination-callback):
133
+ * @since v15.0.0
134
+ * @returns Fulfills when the pipeline is complete.
135
+ */
136
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
137
+ source: A,
138
+ destination: B,
139
+ options?: PipelineOptions,
140
+ ): PipelineResult<B>;
141
+ function pipeline<
142
+ A extends PipelineSource<any>,
143
+ T1 extends PipelineTransform<A, any>,
144
+ B extends PipelineDestination<T1, any>,
145
+ >(
146
+ source: A,
147
+ transform1: T1,
148
+ destination: B,
149
+ options?: PipelineOptions,
150
+ ): PipelineResult<B>;
151
+ function pipeline<
152
+ A extends PipelineSource<any>,
153
+ T1 extends PipelineTransform<A, any>,
154
+ T2 extends PipelineTransform<T1, any>,
155
+ B extends PipelineDestination<T2, any>,
156
+ >(
157
+ source: A,
158
+ transform1: T1,
159
+ transform2: T2,
160
+ destination: B,
161
+ options?: PipelineOptions,
162
+ ): PipelineResult<B>;
163
+ function pipeline<
164
+ A extends PipelineSource<any>,
165
+ T1 extends PipelineTransform<A, any>,
166
+ T2 extends PipelineTransform<T1, any>,
167
+ T3 extends PipelineTransform<T2, any>,
168
+ B extends PipelineDestination<T3, any>,
169
+ >(
170
+ source: A,
171
+ transform1: T1,
172
+ transform2: T2,
173
+ transform3: T3,
174
+ destination: B,
175
+ options?: PipelineOptions,
176
+ ): PipelineResult<B>;
177
+ function pipeline<
178
+ A extends PipelineSource<any>,
179
+ T1 extends PipelineTransform<A, any>,
180
+ T2 extends PipelineTransform<T1, any>,
181
+ T3 extends PipelineTransform<T2, any>,
182
+ T4 extends PipelineTransform<T3, any>,
183
+ B extends PipelineDestination<T4, any>,
184
+ >(
185
+ source: A,
186
+ transform1: T1,
187
+ transform2: T2,
188
+ transform3: T3,
189
+ transform4: T4,
190
+ destination: B,
191
+ options?: PipelineOptions,
192
+ ): PipelineResult<B>;
193
+ function pipeline(
194
+ streams: readonly [PipelineSource<any>, ...PipelineTransform<any, any>[], PipelineDestination<any, any>],
195
+ options?: PipelineOptions,
196
+ ): Promise<void>;
197
+ function pipeline(
198
+ ...streams: [PipelineSource<any>, ...PipelineTransform<any, any>[], PipelineDestination<any, any>]
199
+ ): Promise<void>;
200
+ function pipeline(
201
+ ...streams: [
202
+ PipelineSource<any>,
203
+ ...PipelineTransform<any, any>[],
204
+ PipelineDestination<any, any>,
205
+ options: PipelineOptions,
206
+ ]
207
+ ): Promise<void>;
208
+ }
209
+ declare module "stream/promises" {
210
+ export * from "node:stream/promises";
211
+ }