coreblow 1.0.0-rc.4 → 1.0.0-rc.6

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 (28) hide show
  1. package/extensions/bluebubbles/src/channel.ts +20 -0
  2. package/extensions/feishu/src/channel.ts +20 -0
  3. package/extensions/googlechat/src/channel.ts +20 -0
  4. package/extensions/imessage/src/channel.ts +20 -0
  5. package/extensions/imessage/src/runtime.ts +5 -0
  6. package/extensions/irc/src/channel.ts +20 -0
  7. package/extensions/line/src/channel.ts +20 -0
  8. package/extensions/mattermost/src/channel.ts +20 -0
  9. package/extensions/msteams/src/channel.ts +20 -0
  10. package/extensions/nextcloud-talk/src/channel.ts +20 -0
  11. package/extensions/nostr/src/channel.ts +20 -0
  12. package/extensions/signal/src/channel.ts +20 -0
  13. package/extensions/synology-chat/src/channel.ts +20 -0
  14. package/extensions/tlon/src/channel.ts +20 -0
  15. package/extensions/whatsapp/src/channel.ts +20 -0
  16. package/extensions/zalo/src/channel.ts +20 -0
  17. package/extensions/zalouser/src/channel.ts +20 -0
  18. package/extensions/zalouser/src/runtime.ts +5 -0
  19. package/package.json +34 -5
  20. package/src/media-understanding/defaults.ts +17 -0
  21. package/extensions/discord/node_modules/agent-base/dist/helpers.d.ts +0 -10
  22. package/extensions/discord/node_modules/agent-base/dist/index.d.ts +0 -37
  23. package/extensions/discord/node_modules/https-proxy-agent/dist/index.d.ts +0 -43
  24. package/extensions/discord/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +0 -12
  25. package/extensions/feishu/node_modules/agent-base/dist/helpers.d.ts +0 -10
  26. package/extensions/feishu/node_modules/agent-base/dist/index.d.ts +0 -37
  27. package/extensions/feishu/node_modules/https-proxy-agent/dist/index.d.ts +0 -43
  28. package/extensions/feishu/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +0 -12
@@ -357,3 +357,23 @@ export const bluebubblesPlugin: ChannelPlugin<ResolvedBlueBubblesAccount, BlueBu
357
357
  },
358
358
  },
359
359
  });
360
+
361
+ /**
362
+ * Channel implementation used by BluebubblesRuntime for per-channel state.
363
+ */
364
+ export class BluebubblesChannelImpl {
365
+ readonly id: string;
366
+ private connected = false;
367
+
368
+ constructor(id: string) {
369
+ this.id = id;
370
+ }
371
+
372
+ async disconnect(): Promise<void> {
373
+ this.connected = false;
374
+ }
375
+
376
+ isConnected(): boolean {
377
+ return this.connected;
378
+ }
379
+ }
@@ -1184,3 +1184,23 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount, FeishuProbeResul
1184
1184
  }),
1185
1185
  },
1186
1186
  });
1187
+
1188
+ /**
1189
+ * Channel implementation used by feishu runtime for per-channel state.
1190
+ */
1191
+ export class FeishuChannelImpl {
1192
+ readonly id: string;
1193
+ private connected = false;
1194
+
1195
+ constructor(id: string) {
1196
+ this.id = id;
1197
+ }
1198
+
1199
+ async disconnect(): Promise<void> {
1200
+ this.connected = false;
1201
+ }
1202
+
1203
+ isConnected(): boolean {
1204
+ return this.connected;
1205
+ }
1206
+ }
@@ -465,3 +465,23 @@ export const googlechatPlugin = createChatChannelPlugin({
465
465
  },
466
466
  },
467
467
  });
468
+
469
+ /**
470
+ * Channel implementation used by googlechat runtime for per-channel state.
471
+ */
472
+ export class GooglechatChannelImpl {
473
+ readonly id: string;
474
+ private connected = false;
475
+
476
+ constructor(id: string) {
477
+ this.id = id;
478
+ }
479
+
480
+ async disconnect(): Promise<void> {
481
+ this.connected = false;
482
+ }
483
+
484
+ isConnected(): boolean {
485
+ return this.connected;
486
+ }
487
+ }
@@ -270,3 +270,23 @@ export const imessagePlugin: ChannelPlugin<ResolvedIMessageAccount, IMessageProb
270
270
  },
271
271
  },
272
272
  });
273
+
274
+ /**
275
+ * Channel implementation used by imessage runtime for per-channel state.
276
+ */
277
+ export class ImessageChannelImpl {
278
+ readonly id: string;
279
+ private connected = false;
280
+
281
+ constructor(id: string) {
282
+ this.id = id;
283
+ }
284
+
285
+ async disconnect(): Promise<void> {
286
+ this.connected = false;
287
+ }
288
+
289
+ isConnected(): boolean {
290
+ return this.connected;
291
+ }
292
+ }
@@ -44,3 +44,8 @@ export class ImessageRuntime {
44
44
  return { handled: true, extension: this.extension.name };
45
45
  }
46
46
  }
47
+
48
+ // Runtime setter for index.ts
49
+ export function setIMessageRuntime(runtime: any): void {
50
+ // Placeholder — called by extension index to wire runtime
51
+ }
@@ -355,3 +355,23 @@ export const ircPlugin: ChannelPlugin<ResolvedIrcAccount, IrcProbe> = createChat
355
355
  },
356
356
  },
357
357
  });
358
+
359
+ /**
360
+ * Channel implementation used by irc runtime for per-channel state.
361
+ */
362
+ export class IrcChannelImpl {
363
+ readonly id: string;
364
+ private connected = false;
365
+
366
+ constructor(id: string) {
367
+ this.id = id;
368
+ }
369
+
370
+ async disconnect(): Promise<void> {
371
+ this.connected = false;
372
+ }
373
+
374
+ isConnected(): boolean {
375
+ return this.connected;
376
+ }
377
+ }
@@ -522,3 +522,23 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = createChatChannelP
522
522
  }),
523
523
  },
524
524
  });
525
+
526
+ /**
527
+ * Channel implementation used by line runtime for per-channel state.
528
+ */
529
+ export class LineChannelImpl {
530
+ readonly id: string;
531
+ private connected = false;
532
+
533
+ constructor(id: string) {
534
+ this.id = id;
535
+ }
536
+
537
+ async disconnect(): Promise<void> {
538
+ this.connected = false;
539
+ }
540
+
541
+ isConnected(): boolean {
542
+ return this.connected;
543
+ }
544
+ }
@@ -482,3 +482,23 @@ export const mattermostPlugin: ChannelPlugin<ResolvedMattermostAccount> = create
482
482
  },
483
483
  },
484
484
  });
485
+
486
+ /**
487
+ * Channel implementation used by mattermost runtime for per-channel state.
488
+ */
489
+ export class MattermostChannelImpl {
490
+ readonly id: string;
491
+ private connected = false;
492
+
493
+ constructor(id: string) {
494
+ this.id = id;
495
+ }
496
+
497
+ async disconnect(): Promise<void> {
498
+ this.connected = false;
499
+ }
500
+
501
+ isConnected(): boolean {
502
+ return this.connected;
503
+ }
504
+ }
@@ -951,3 +951,23 @@ export const msteamsPlugin: ChannelPlugin<ResolvedMSTeamsAccount, ProbeMSTeamsRe
951
951
  }),
952
952
  },
953
953
  });
954
+
955
+ /**
956
+ * Channel implementation used by msteams runtime for per-channel state.
957
+ */
958
+ export class MsteamsChannelImpl {
959
+ readonly id: string;
960
+ private connected = false;
961
+
962
+ constructor(id: string) {
963
+ this.id = id;
964
+ }
965
+
966
+ async disconnect(): Promise<void> {
967
+ this.connected = false;
968
+ }
969
+
970
+ isConnected(): boolean {
971
+ return this.connected;
972
+ }
973
+ }
@@ -327,3 +327,23 @@ export const nextcloudTalkPlugin: ChannelPlugin<ResolvedNextcloudTalkAccount> =
327
327
  },
328
328
  },
329
329
  });
330
+
331
+ /**
332
+ * Channel implementation used by nextcloud-talk runtime for per-channel state.
333
+ */
334
+ export class NextcloudTalkChannelImpl {
335
+ readonly id: string;
336
+ private connected = false;
337
+
338
+ constructor(id: string) {
339
+ this.id = id;
340
+ }
341
+
342
+ async disconnect(): Promise<void> {
343
+ this.connected = false;
344
+ }
345
+
346
+ isConnected(): boolean {
347
+ return this.connected;
348
+ }
349
+ }
@@ -501,3 +501,23 @@ export async function getNostrProfileState(accountId: string = DEFAULT_ACCOUNT_I
501
501
  }
502
502
  return bus.getProfileState();
503
503
  }
504
+
505
+ /**
506
+ * Channel implementation used by nostr runtime for per-channel state.
507
+ */
508
+ export class NostrChannelImpl {
509
+ readonly id: string;
510
+ private connected = false;
511
+
512
+ constructor(id: string) {
513
+ this.id = id;
514
+ }
515
+
516
+ async disconnect(): Promise<void> {
517
+ this.connected = false;
518
+ }
519
+
520
+ isConnected(): boolean {
521
+ return this.connected;
522
+ }
523
+ }
@@ -363,3 +363,23 @@ export const signalPlugin: ChannelPlugin<ResolvedSignalAccount, SignalProbe> =
363
363
  },
364
364
  },
365
365
  });
366
+
367
+ /**
368
+ * Channel implementation used by signal runtime for per-channel state.
369
+ */
370
+ export class SignalChannelImpl {
371
+ readonly id: string;
372
+ private connected = false;
373
+
374
+ constructor(id: string) {
375
+ this.id = id;
376
+ }
377
+
378
+ async disconnect(): Promise<void> {
379
+ this.connected = false;
380
+ }
381
+
382
+ isConnected(): boolean {
383
+ return this.connected;
384
+ }
385
+ }
@@ -349,3 +349,23 @@ export function createSynologyChatPlugin(): SynologyChatPlugin {
349
349
  }
350
350
 
351
351
  export const synologyChatPlugin = createSynologyChatPlugin();
352
+
353
+ /**
354
+ * Channel implementation used by synology-chat runtime for per-channel state.
355
+ */
356
+ export class SynologyChatChannelImpl {
357
+ readonly id: string;
358
+ private connected = false;
359
+
360
+ constructor(id: string) {
361
+ this.id = id;
362
+ }
363
+
364
+ async disconnect(): Promise<void> {
365
+ this.connected = false;
366
+ }
367
+
368
+ isConnected(): boolean {
369
+ return this.connected;
370
+ }
371
+ }
@@ -169,3 +169,23 @@ export const tlonPlugin = createChatChannelPlugin({
169
169
  }),
170
170
  },
171
171
  });
172
+
173
+ /**
174
+ * Channel implementation used by tlon runtime for per-channel state.
175
+ */
176
+ export class TlonChannelImpl {
177
+ readonly id: string;
178
+ private connected = false;
179
+
180
+ constructor(id: string) {
181
+ this.id = id;
182
+ }
183
+
184
+ async disconnect(): Promise<void> {
185
+ this.connected = false;
186
+ }
187
+
188
+ isConnected(): boolean {
189
+ return this.connected;
190
+ }
191
+ }
@@ -330,3 +330,23 @@ export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> =
330
330
  },
331
331
  },
332
332
  });
333
+
334
+ /**
335
+ * Channel implementation used by whatsapp runtime for per-channel state.
336
+ */
337
+ export class WhatsappChannelImpl {
338
+ readonly id: string;
339
+ private connected = false;
340
+
341
+ constructor(id: string) {
342
+ this.id = id;
343
+ }
344
+
345
+ async disconnect(): Promise<void> {
346
+ this.connected = false;
347
+ }
348
+
349
+ isConnected(): boolean {
350
+ return this.connected;
351
+ }
352
+ }
@@ -261,3 +261,23 @@ export const zaloPlugin: ChannelPlugin<ResolvedZaloAccount, ZaloProbeResult> =
261
261
  ...zaloRawSendResultAdapter,
262
262
  },
263
263
  });
264
+
265
+ /**
266
+ * Channel implementation used by zalo runtime for per-channel state.
267
+ */
268
+ export class ZaloChannelImpl {
269
+ readonly id: string;
270
+ private connected = false;
271
+
272
+ constructor(id: string) {
273
+ this.id = id;
274
+ }
275
+
276
+ async disconnect(): Promise<void> {
277
+ this.connected = false;
278
+ }
279
+
280
+ isConnected(): boolean {
281
+ return this.connected;
282
+ }
283
+ }
@@ -525,3 +525,23 @@ export const zalouserPlugin: ChannelPlugin<ResolvedZalouserAccount, ZalouserProb
525
525
  });
526
526
 
527
527
  export type { ResolvedZalouserAccount };
528
+
529
+ /**
530
+ * Channel implementation used by zalouser runtime for per-channel state.
531
+ */
532
+ export class ZalouserChannelImpl {
533
+ readonly id: string;
534
+ private connected = false;
535
+
536
+ constructor(id: string) {
537
+ this.id = id;
538
+ }
539
+
540
+ async disconnect(): Promise<void> {
541
+ this.connected = false;
542
+ }
543
+
544
+ isConnected(): boolean {
545
+ return this.connected;
546
+ }
547
+ }
@@ -44,3 +44,8 @@ export class ZalouserRuntime {
44
44
  return { handled: true, extension: this.extension.name };
45
45
  }
46
46
  }
47
+
48
+ // Runtime setter for index.ts
49
+ export function setZalouserRuntime(runtime: any): void {
50
+ // Placeholder — called by extension index to wire runtime
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coreblow",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0-rc.6",
4
4
  "description": "CoreBlow — personal AI assistant with multi-channel support",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,25 +31,48 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@agentclientprotocol/sdk": "^0.18.2",
34
+ "@anthropic-ai/vertex-sdk": "^0.16.0",
34
35
  "@aws-sdk/client-bedrock": "^3.1030.0",
36
+ "@aws-sdk/client-s3": "^3.1038.0",
37
+ "@aws-sdk/s3-request-presigner": "^3.1038.0",
35
38
  "@buape/carbon": "^0.15.0",
36
39
  "@clack/prompts": "^1.1.0",
37
40
  "@discordjs/voice": "^0.19.2",
38
41
  "@grammyjs/runner": "^2.0.3",
42
+ "@grammyjs/transformer-throttler": "^1.2.1",
43
+ "@grammyjs/types": "^3.26.0",
44
+ "@lancedb/lancedb": "^0.27.2",
39
45
  "@larksuiteoapi/node-sdk": "^1.60.0",
40
46
  "@line/bot-sdk": "^11.0.0",
41
47
  "@mariozechner/pi-agent-core": "0.70.2",
42
48
  "@mariozechner/pi-ai": "0.70.2",
43
49
  "@mariozechner/pi-coding-agent": "0.70.2",
44
50
  "@mariozechner/pi-tui": "0.70.2",
51
+ "@matrix-org/matrix-sdk-crypto-nodejs": "^0.5.1",
45
52
  "@modelcontextprotocol/sdk": "^1.29.0",
53
+ "@opentelemetry/api": "^1.9.1",
54
+ "@opentelemetry/api-logs": "^0.215.0",
55
+ "@opentelemetry/exporter-logs-otlp-proto": "^0.215.0",
56
+ "@opentelemetry/exporter-metrics-otlp-proto": "^0.215.0",
57
+ "@opentelemetry/exporter-trace-otlp-proto": "^0.215.0",
58
+ "@opentelemetry/resources": "^2.7.0",
59
+ "@opentelemetry/sdk-logs": "^0.215.0",
60
+ "@opentelemetry/sdk-metrics": "^2.7.0",
61
+ "@opentelemetry/sdk-node": "^0.215.0",
62
+ "@opentelemetry/sdk-trace-base": "^2.7.0",
63
+ "@opentelemetry/semantic-conventions": "^1.40.0",
64
+ "@pierre/diffs": "^1.1.19",
46
65
  "@react-three/drei": "^10.7.7",
47
66
  "@react-three/fiber": "^9.5.0",
48
67
  "@slack/bolt": "^4.7.0",
49
68
  "@slack/web-api": "^7.15.0",
50
69
  "@splinetool/react-spline": "^4.1.0",
51
70
  "@splinetool/runtime": "^1.12.58",
71
+ "@twurple/api": "^8.1.3",
52
72
  "@twurple/auth": "^8.1.3",
73
+ "@twurple/chat": "^8.1.3",
74
+ "@urbit/aura": "^3.0.0",
75
+ "@whiskeysockets/baileys": "7.0.0-rc.9",
53
76
  "ajv": "^8.18.0",
54
77
  "chalk": "^5.6.2",
55
78
  "chokidar": "^5.0.0",
@@ -59,17 +82,25 @@
59
82
  "discord-api-types": "^0.38.45",
60
83
  "dotenv": "^16.6.1",
61
84
  "express": "^4.22.1",
85
+ "fake-indexeddb": "^6.2.5",
62
86
  "file-type": "^22.0.1",
87
+ "google-auth-library": "^10.6.2",
63
88
  "grammy": "^1.41.1",
89
+ "https-proxy-agent": "^9.0.0",
90
+ "ipaddr.js": "^2.3.0",
64
91
  "jiti": "^2.6.1",
65
92
  "json5": "^2.2.3",
66
93
  "jszip": "^3.10.1",
67
94
  "linkedom": "^0.18.12",
68
95
  "markdown-it": "^14.1.1",
69
96
  "matrix-js-sdk": "^41.3.0",
97
+ "music-metadata": "^11.12.3",
98
+ "node-edge-tts": "^1.2.10",
70
99
  "nostr-tools": "^2.23.3",
100
+ "openai": "^6.34.0",
71
101
  "osc-progress": "^0.3.0",
72
102
  "pino": "^9.14.0",
103
+ "playwright-core": "^1.59.1",
73
104
  "qrcode-terminal": "^0.12.0",
74
105
  "react": "^19.2.0",
75
106
  "react-dom": "^19.2.0",
@@ -78,8 +109,9 @@
78
109
  "tar": "^7.5.13",
79
110
  "three": "^0.183.0",
80
111
  "tslog": "^4.10.2",
81
- "typebox": "1.1.24",
82
112
  "tsx": "^4.21.0",
113
+ "typebox": "1.1.24",
114
+ "undici": "^8.1.0",
83
115
  "ws": "^8.19.0",
84
116
  "yaml": "^2.8.3",
85
117
  "zod": "^4.3.6"
@@ -89,7 +121,6 @@
89
121
  "@ai-sdk/provider": "^3.0.8",
90
122
  "@anthropic-ai/bedrock-sdk": "^0.28.1",
91
123
  "@anthropic-ai/sdk": "^0.90.0",
92
- "@anthropic-ai/vertex-sdk": "^0.16.0",
93
124
  "@types/express": "^5.0.6",
94
125
  "@types/ws": "^8.18.1",
95
126
  "@vitejs/plugin-react": "^5.1.1",
@@ -97,11 +128,9 @@
97
128
  "ai": "^6.0.168",
98
129
  "bonjour-service": "^1.3.0",
99
130
  "ciao": "^2.0.0",
100
- "google-auth-library": "^10.6.2",
101
131
  "jscpd": "4.0.8",
102
132
  "jsdom": "^29.0.1",
103
133
  "ollama": "^0.6.3",
104
- "openai": "^6.34.0",
105
134
  "oxlint": "^1.57.0",
106
135
  "pino-pretty": "^13.1.3",
107
136
  "tsdown": "0.21.5",
@@ -4,6 +4,23 @@
4
4
  * Ported from CoreBlow reference src/media-understanding/defaults.ts.
5
5
  */
6
6
 
7
+ /** Maximum file size for media analysis (20 MB). */
8
+ export const DEFAULT_MAX_BYTES = 20 * 1024 * 1024;
9
+
10
+ /** Maximum character limits for text extraction by capability. */
11
+ export const DEFAULT_MAX_CHARS_BY_CAPABILITY: Record<string, number> = {
12
+ image: 50_000,
13
+ audio: 100_000,
14
+ video: 100_000,
15
+ document: 200_000,
16
+ };
17
+
18
+ /** Number of concurrent media analysis operations. */
19
+ export const DEFAULT_MEDIA_CONCURRENCY = 3;
20
+
21
+ /** Default prompt for generic media analysis. */
22
+ export const DEFAULT_PROMPT = "Describe the contents of this media.";
23
+
7
24
  export const DEFAULT_IMAGE_PROMPT = 'Describe this image in detail. Include all visible text, important visual elements, colors, and layout.';
8
25
  export const DEFAULT_AUDIO_PROMPT = 'Transcribe this audio. Include timestamps if available.';
9
26
  export const DEFAULT_VIDEO_PROMPT = 'Describe the contents of this video, including visual elements, audio, and key events.';
@@ -1,10 +0,0 @@
1
- import * as http from 'http';
2
- import * as https from 'https';
3
- import type { Readable } from 'stream';
4
- export type ThenableRequest = http.ClientRequest & {
5
- then: Promise<http.IncomingMessage>['then'];
6
- };
7
- export declare function toBuffer(stream: Readable): Promise<Buffer>;
8
- export declare function json(stream: Readable): Promise<any>;
9
- export declare function req(url: string | URL, opts?: https.RequestOptions): ThenableRequest;
10
- //# sourceMappingURL=helpers.d.ts.map
@@ -1,37 +0,0 @@
1
- import * as net from 'net';
2
- import * as tls from 'tls';
3
- import * as http from 'http';
4
- import type { Duplex } from 'stream';
5
- export * from './helpers.js';
6
- interface HttpConnectOpts extends net.TcpNetConnectOpts {
7
- secureEndpoint: false;
8
- protocol?: string;
9
- }
10
- interface HttpsConnectOpts extends tls.ConnectionOptions {
11
- secureEndpoint: true;
12
- protocol?: string;
13
- port: number;
14
- }
15
- export type AgentConnectOpts = HttpConnectOpts | HttpsConnectOpts;
16
- declare const INTERNAL: unique symbol;
17
- export declare abstract class Agent extends http.Agent {
18
- private [INTERNAL];
19
- options: Partial<net.TcpNetConnectOpts & tls.ConnectionOptions>;
20
- keepAlive: boolean;
21
- constructor(opts?: http.AgentOptions);
22
- abstract connect(req: http.ClientRequest, options: AgentConnectOpts): Promise<Duplex | http.Agent> | Duplex | http.Agent;
23
- /**
24
- * Determine whether this is an `http` or `https` request.
25
- */
26
- isSecureEndpoint(options?: AgentConnectOpts): boolean;
27
- private incrementSockets;
28
- private decrementSockets;
29
- getName(options?: AgentConnectOpts): string;
30
- createSocket(req: http.ClientRequest, options: AgentConnectOpts, cb: (err: Error | null, s?: Duplex) => void): void;
31
- createConnection(): Duplex;
32
- get defaultPort(): number;
33
- set defaultPort(v: number);
34
- get protocol(): string;
35
- set protocol(v: string);
36
- }
37
- //# sourceMappingURL=index.d.ts.map
@@ -1,43 +0,0 @@
1
- import * as net from 'net';
2
- import * as tls from 'tls';
3
- import * as http from 'http';
4
- import { Agent, AgentConnectOpts } from 'agent-base';
5
- import { URL } from 'url';
6
- import type { OutgoingHttpHeaders } from 'http';
7
- type Protocol<T> = T extends `${infer Protocol}:${infer _}` ? Protocol : never;
8
- type ConnectOptsMap = {
9
- http: Omit<net.TcpNetConnectOpts, 'host' | 'port'>;
10
- https: Omit<tls.ConnectionOptions, 'host' | 'port'>;
11
- };
12
- type ConnectOpts<T> = {
13
- [P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never;
14
- }[keyof ConnectOptsMap];
15
- export type HttpsProxyAgentOptions<T> = ConnectOpts<T> & http.AgentOptions & {
16
- headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
17
- };
18
- /**
19
- * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
20
- * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
21
- *
22
- * Outgoing HTTP requests are first tunneled through the proxy server using the
23
- * `CONNECT` HTTP request method to establish a connection to the proxy server,
24
- * and then the proxy server connects to the destination target and issues the
25
- * HTTP request from the proxy server.
26
- *
27
- * `https:` requests have their socket connection upgraded to TLS once
28
- * the connection to the proxy server has been established.
29
- */
30
- export declare class HttpsProxyAgent<Uri extends string> extends Agent {
31
- static protocols: readonly ["http", "https"];
32
- readonly proxy: URL;
33
- proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
34
- connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;
35
- constructor(proxy: Uri | URL, opts?: HttpsProxyAgentOptions<Uri>);
36
- /**
37
- * Called when the node-core HTTP client library is creating a
38
- * new HTTP request.
39
- */
40
- connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
41
- }
42
- export {};
43
- //# sourceMappingURL=index.d.ts.map
@@ -1,12 +0,0 @@
1
- import { IncomingHttpHeaders } from 'http';
2
- import { Readable } from 'stream';
3
- export interface ConnectResponse {
4
- statusCode: number;
5
- statusText: string;
6
- headers: IncomingHttpHeaders;
7
- }
8
- export declare function parseProxyResponse(socket: Readable): Promise<{
9
- connect: ConnectResponse;
10
- buffered: Buffer;
11
- }>;
12
- //# sourceMappingURL=parse-proxy-response.d.ts.map
@@ -1,10 +0,0 @@
1
- import * as http from 'http';
2
- import * as https from 'https';
3
- import type { Readable } from 'stream';
4
- export type ThenableRequest = http.ClientRequest & {
5
- then: Promise<http.IncomingMessage>['then'];
6
- };
7
- export declare function toBuffer(stream: Readable): Promise<Buffer>;
8
- export declare function json(stream: Readable): Promise<any>;
9
- export declare function req(url: string | URL, opts?: https.RequestOptions): ThenableRequest;
10
- //# sourceMappingURL=helpers.d.ts.map
@@ -1,37 +0,0 @@
1
- import * as net from 'net';
2
- import * as tls from 'tls';
3
- import * as http from 'http';
4
- import type { Duplex } from 'stream';
5
- export * from './helpers.js';
6
- interface HttpConnectOpts extends net.TcpNetConnectOpts {
7
- secureEndpoint: false;
8
- protocol?: string;
9
- }
10
- interface HttpsConnectOpts extends tls.ConnectionOptions {
11
- secureEndpoint: true;
12
- protocol?: string;
13
- port: number;
14
- }
15
- export type AgentConnectOpts = HttpConnectOpts | HttpsConnectOpts;
16
- declare const INTERNAL: unique symbol;
17
- export declare abstract class Agent extends http.Agent {
18
- private [INTERNAL];
19
- options: Partial<net.TcpNetConnectOpts & tls.ConnectionOptions>;
20
- keepAlive: boolean;
21
- constructor(opts?: http.AgentOptions);
22
- abstract connect(req: http.ClientRequest, options: AgentConnectOpts): Promise<Duplex | http.Agent> | Duplex | http.Agent;
23
- /**
24
- * Determine whether this is an `http` or `https` request.
25
- */
26
- isSecureEndpoint(options?: AgentConnectOpts): boolean;
27
- private incrementSockets;
28
- private decrementSockets;
29
- getName(options?: AgentConnectOpts): string;
30
- createSocket(req: http.ClientRequest, options: AgentConnectOpts, cb: (err: Error | null, s?: Duplex) => void): void;
31
- createConnection(): Duplex;
32
- get defaultPort(): number;
33
- set defaultPort(v: number);
34
- get protocol(): string;
35
- set protocol(v: string);
36
- }
37
- //# sourceMappingURL=index.d.ts.map
@@ -1,43 +0,0 @@
1
- import * as net from 'net';
2
- import * as tls from 'tls';
3
- import * as http from 'http';
4
- import { Agent, AgentConnectOpts } from 'agent-base';
5
- import { URL } from 'url';
6
- import type { OutgoingHttpHeaders } from 'http';
7
- type Protocol<T> = T extends `${infer Protocol}:${infer _}` ? Protocol : never;
8
- type ConnectOptsMap = {
9
- http: Omit<net.TcpNetConnectOpts, 'host' | 'port'>;
10
- https: Omit<tls.ConnectionOptions, 'host' | 'port'>;
11
- };
12
- type ConnectOpts<T> = {
13
- [P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never;
14
- }[keyof ConnectOptsMap];
15
- export type HttpsProxyAgentOptions<T> = ConnectOpts<T> & http.AgentOptions & {
16
- headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
17
- };
18
- /**
19
- * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
20
- * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
21
- *
22
- * Outgoing HTTP requests are first tunneled through the proxy server using the
23
- * `CONNECT` HTTP request method to establish a connection to the proxy server,
24
- * and then the proxy server connects to the destination target and issues the
25
- * HTTP request from the proxy server.
26
- *
27
- * `https:` requests have their socket connection upgraded to TLS once
28
- * the connection to the proxy server has been established.
29
- */
30
- export declare class HttpsProxyAgent<Uri extends string> extends Agent {
31
- static protocols: readonly ["http", "https"];
32
- readonly proxy: URL;
33
- proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
34
- connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;
35
- constructor(proxy: Uri | URL, opts?: HttpsProxyAgentOptions<Uri>);
36
- /**
37
- * Called when the node-core HTTP client library is creating a
38
- * new HTTP request.
39
- */
40
- connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
41
- }
42
- export {};
43
- //# sourceMappingURL=index.d.ts.map
@@ -1,12 +0,0 @@
1
- import { IncomingHttpHeaders } from 'http';
2
- import { Readable } from 'stream';
3
- export interface ConnectResponse {
4
- statusCode: number;
5
- statusText: string;
6
- headers: IncomingHttpHeaders;
7
- }
8
- export declare function parseProxyResponse(socket: Readable): Promise<{
9
- connect: ConnectResponse;
10
- buffered: Buffer;
11
- }>;
12
- //# sourceMappingURL=parse-proxy-response.d.ts.map