@google/gemini-cli 0.69.0-preview.0 → 0.70.0-preview.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.
- package/bundle/{chunk-LYKP3S67.js → chunk-65MRMUKB.js} +625 -22
- package/bundle/{chunk-CGQSFR2I.js → chunk-6XLLXGZQ.js} +1 -1
- package/bundle/{chunk-U5FJ6OGB.js → chunk-AMGYQYS7.js} +35 -29
- package/bundle/{chunk-SYOIMUZI.js → chunk-BCL7DJOQ.js} +1165 -21669
- package/bundle/{chunk-6KCLIS6W.js → chunk-BOYVA4SV.js} +1 -1
- package/bundle/{chunk-YODS6HR2.js → chunk-CJ7YZ55P.js} +3 -3
- package/bundle/{chunk-BRHBBQC5.js → chunk-CMUPNBQQ.js} +35 -29
- package/bundle/{chunk-V7L3FMBE.js → chunk-ECLDXLDB.js} +3 -3
- package/bundle/{chunk-VQTELFV3.js → chunk-F6P6PQSG.js} +1 -1
- package/bundle/{chunk-CWHEOJXF.js → chunk-FDIF7V5C.js} +1 -1
- package/bundle/{chunk-UW3ZS3BH.js → chunk-FGTABIOQ.js} +1 -1
- package/bundle/{chunk-2ONJU4V7.js → chunk-HBTS2REO.js} +1 -1
- package/bundle/{chunk-DWMZSQYG.js → chunk-I5QSCSQU.js} +65559 -51236
- package/bundle/{chunk-4SOPZCNA.js → chunk-IS5SQ7HP.js} +625 -22
- package/bundle/{chunk-RBDD6IBU.js → chunk-L5UVIFFB.js} +1165 -21669
- package/bundle/{chunk-IUUIT4SU.js → chunk-N7J54YNL.js} +1 -0
- package/bundle/{chunk-PH5XENTH.js → chunk-NFAJ5FW5.js} +1 -1
- package/bundle/{chunk-GQ7FZNO2.js → chunk-NFBC76U4.js} +1 -1
- package/bundle/{chunk-KUXCUQKX.js → chunk-O2DXIYZO.js} +65411 -51125
- package/bundle/{chunk-C5BED6L6.js → chunk-O5EBPO5F.js} +35 -29
- package/bundle/{chunk-2KKDGWF2.js → chunk-RTIGPATB.js} +1 -1
- package/bundle/{chunk-JJWPYMIO.js → chunk-RVYQZ73V.js} +3 -3
- package/bundle/{chunk-MP4TVGOP.js → chunk-SA2VIQNQ.js} +65559 -51236
- package/bundle/{chunk-GDCMMKZ2.js → chunk-STY67ND2.js} +1 -1
- package/bundle/{chunk-3HEOCQDN.js → chunk-SXOGAWDG.js} +1 -1
- package/bundle/{chunk-UAHZWXSG.js → chunk-T7277DWX.js} +1 -1
- package/bundle/{chunk-U3FFDEKY.js → chunk-TX3SX2WI.js} +625 -22
- package/bundle/{chunk-664ZODQF.js → chunk-W2AJR23G.js} +137 -58
- package/bundle/{chunk-YP5TA33N.js → chunk-ZUQTNDGH.js} +1165 -21669
- package/bundle/{cleanup-3T2KXSP4.js → cleanup-44LV7E4R.js} +4 -4
- package/bundle/{cleanup-NNQCI4KC.js → cleanup-O4QBMRVU.js} +4 -4
- package/bundle/{cleanup-TA4VYDXQ.js → cleanup-WMYSWXJR.js} +4 -4
- package/bundle/{core-TUJHM7E7.js → core-DJ7VMWCC.js} +13 -3
- package/bundle/{core-6XF5EO7Z.js → core-LJXCBOFM.js} +13 -3
- package/bundle/{devtools-TYCPOPV3.js → devtools-WUGMIOCT.js} +1 -1
- package/bundle/devtoolsService-D4VCGQMJ.js +919 -0
- package/bundle/devtoolsService-EBOCEFTO.js +918 -0
- package/bundle/devtoolsService-G4CPAW3U.js +918 -0
- package/bundle/{dist-OSQFIX7F.js → dist-QSS2VWMY.js} +13 -3
- package/bundle/docs/changelogs/index.md +22 -0
- package/bundle/docs/changelogs/latest.md +100 -92
- package/bundle/docs/changelogs/preview.md +116 -104
- package/bundle/docs/cli/enterprise.md +23 -5
- package/bundle/docs/ide-integration/ide-companion-spec.md +10 -4
- package/bundle/docs/reference/policy-engine.md +45 -6
- package/bundle/docs/tools/shell.md +2 -1
- package/bundle/{formatError-LJFIC7G3.js → formatError-3QIVJAE5.js} +4 -4
- package/bundle/{formatError-MIUNQEYE.js → formatError-I5Q2HGMN.js} +4 -4
- package/bundle/{formatError-KEQ3HU3Y.js → formatError-NLKMYJNL.js} +4 -4
- package/bundle/{gemini-ZZZEFPSK.js → gemini-4325ARIU.js} +676 -288
- package/bundle/{gemini-22ON2CZG.js → gemini-J7ZRUAXR.js} +676 -288
- package/bundle/{gemini-HLS52ZNZ.js → gemini-LOYZXP6I.js} +676 -288
- package/bundle/gemini.js +35 -17
- package/bundle/{getMachineId-bsd-TXG52NKR.js → getMachineId-bsd-3TGNBDZQ.js} +1 -1
- package/bundle/{getMachineId-darwin-7OE4DDZ6.js → getMachineId-darwin-2CFT4JKO.js} +1 -1
- package/bundle/{getMachineId-linux-SHIFKOOX.js → getMachineId-linux-BXATTKN2.js} +1 -1
- package/bundle/{getMachineId-unsupported-5U5DOEYY.js → getMachineId-unsupported-VHPOSMKR.js} +1 -1
- package/bundle/{getMachineId-win-6KLLGOI4.js → getMachineId-win-IGXROMTR.js} +1 -1
- package/bundle/{interactiveCli-5HMWVTK2.js → interactiveCli-AQ67IY7V.js} +36 -18
- package/bundle/{interactiveCli-NKFQZXB5.js → interactiveCli-CEIWZCYF.js} +36 -18
- package/bundle/{interactiveCli-HQBE3C3C.js → interactiveCli-O2L63RLG.js} +36 -18
- package/bundle/{liteRtServerManager-AG4Y5JMZ.js → liteRtServerManager-EZFHT2B3.js} +6 -6
- package/bundle/{liteRtServerManager-OFNVXXQ4.js → liteRtServerManager-HMCB6A65.js} +6 -6
- package/bundle/{liteRtServerManager-2IOXWO76.js → liteRtServerManager-MH32CAZ5.js} +6 -6
- package/bundle/{oauth2-provider-2DHNJ2S3.js → oauth2-provider-3TFNA7VY.js} +3 -3
- package/bundle/{oauth2-provider-YDNSNN32.js → oauth2-provider-NPOZQDQO.js} +3 -3
- package/bundle/{oauth2-provider-OEGXLWIL.js → oauth2-provider-UXC7XFV6.js} +3 -3
- package/bundle/{src-XZYPU6PJ.js → src-MVBNXN6P.js} +3 -3504
- package/bundle/{start-JSVKPUTV.js → start-I2GOKFKQ.js} +8 -8
- package/bundle/{start-N33LF5WK.js → start-JIKLB3S3.js} +8 -8
- package/bundle/{start-7GJH3MKY.js → start-NSYEL7UE.js} +8 -8
- package/package.json +1 -1
- package/bundle/devtoolsService-7EMPANTX.js +0 -4421
- package/bundle/devtoolsService-I7WFRUEA.js +0 -4422
- package/bundle/devtoolsService-RCBUZGYD.js +0 -4421
|
@@ -14,6 +14,7 @@ var require_constants = __commonJS({
|
|
|
14
14
|
if (hasBlob) BINARY_TYPES.push("blob");
|
|
15
15
|
module.exports = {
|
|
16
16
|
BINARY_TYPES,
|
|
17
|
+
CLOSE_TIMEOUT: 3e4,
|
|
17
18
|
EMPTY_BUFFER: Buffer.alloc(0),
|
|
18
19
|
GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
|
|
19
20
|
hasBlob,
|
|
@@ -168,7 +169,7 @@ var require_permessage_deflate = __commonJS({
|
|
|
168
169
|
var kBuffers = Symbol("buffers");
|
|
169
170
|
var kError = Symbol("error");
|
|
170
171
|
var zlibLimiter;
|
|
171
|
-
var
|
|
172
|
+
var PerMessageDeflate2 = class {
|
|
172
173
|
/**
|
|
173
174
|
* Creates a PerMessageDeflate instance.
|
|
174
175
|
*
|
|
@@ -179,6 +180,9 @@ var require_permessage_deflate = __commonJS({
|
|
|
179
180
|
* acknowledge disabling of client context takeover
|
|
180
181
|
* @param {Number} [options.concurrencyLimit=10] The number of concurrent
|
|
181
182
|
* calls to zlib
|
|
183
|
+
* @param {Boolean} [options.isServer=false] Create the instance in either
|
|
184
|
+
* server or client mode
|
|
185
|
+
* @param {Number} [options.maxPayload=0] The maximum allowed message length
|
|
182
186
|
* @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
|
|
183
187
|
* use of a custom server window size
|
|
184
188
|
* @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
|
|
@@ -189,15 +193,12 @@ var require_permessage_deflate = __commonJS({
|
|
|
189
193
|
* deflate
|
|
190
194
|
* @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
|
|
191
195
|
* inflate
|
|
192
|
-
* @param {Boolean} [isServer=false] Create the instance in either server or
|
|
193
|
-
* client mode
|
|
194
|
-
* @param {Number} [maxPayload=0] The maximum allowed message length
|
|
195
196
|
*/
|
|
196
|
-
constructor(options
|
|
197
|
-
this._maxPayload = maxPayload | 0;
|
|
197
|
+
constructor(options) {
|
|
198
198
|
this._options = options || {};
|
|
199
199
|
this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024;
|
|
200
|
-
this.
|
|
200
|
+
this._maxPayload = this._options.maxPayload | 0;
|
|
201
|
+
this._isServer = !!this._options.isServer;
|
|
201
202
|
this._deflate = null;
|
|
202
203
|
this._inflate = null;
|
|
203
204
|
this.params = null;
|
|
@@ -281,7 +282,7 @@ var require_permessage_deflate = __commonJS({
|
|
|
281
282
|
acceptAsServer(offers) {
|
|
282
283
|
const opts = this._options;
|
|
283
284
|
const accepted = offers.find((params) => {
|
|
284
|
-
if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) {
|
|
285
|
+
if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && (typeof params.client_max_window_bits === "number" ? opts.clientMaxWindowBits > params.client_max_window_bits : !params.client_max_window_bits)) {
|
|
285
286
|
return false;
|
|
286
287
|
}
|
|
287
288
|
return true;
|
|
@@ -506,7 +507,7 @@ var require_permessage_deflate = __commonJS({
|
|
|
506
507
|
});
|
|
507
508
|
}
|
|
508
509
|
};
|
|
509
|
-
module.exports =
|
|
510
|
+
module.exports = PerMessageDeflate2;
|
|
510
511
|
function deflateOnData(chunk) {
|
|
511
512
|
this[kBuffers].push(chunk);
|
|
512
513
|
this[kTotalLength] += chunk.length;
|
|
@@ -741,7 +742,7 @@ var require_receiver = __commonJS({
|
|
|
741
742
|
"node_modules/ws/lib/receiver.js"(exports, module) {
|
|
742
743
|
"use strict";
|
|
743
744
|
var { Writable } = __require("stream");
|
|
744
|
-
var
|
|
745
|
+
var PerMessageDeflate2 = require_permessage_deflate();
|
|
745
746
|
var {
|
|
746
747
|
BINARY_TYPES,
|
|
747
748
|
EMPTY_BUFFER,
|
|
@@ -771,6 +772,10 @@ var require_receiver = __commonJS({
|
|
|
771
772
|
* extensions
|
|
772
773
|
* @param {Boolean} [options.isServer=false] Specifies whether to operate in
|
|
773
774
|
* client or server mode
|
|
775
|
+
* @param {Number} [options.maxBufferedChunks=0] The maximum number of
|
|
776
|
+
* buffered data chunks
|
|
777
|
+
* @param {Number} [options.maxFragments=0] The maximum number of message
|
|
778
|
+
* fragments
|
|
774
779
|
* @param {Number} [options.maxPayload=0] The maximum allowed message length
|
|
775
780
|
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
|
|
776
781
|
* not to skip UTF-8 validation for text and close messages
|
|
@@ -781,6 +786,8 @@ var require_receiver = __commonJS({
|
|
|
781
786
|
this._binaryType = options.binaryType || BINARY_TYPES[0];
|
|
782
787
|
this._extensions = options.extensions || {};
|
|
783
788
|
this._isServer = !!options.isServer;
|
|
789
|
+
this._maxBufferedChunks = options.maxBufferedChunks | 0;
|
|
790
|
+
this._maxFragments = options.maxFragments | 0;
|
|
784
791
|
this._maxPayload = options.maxPayload | 0;
|
|
785
792
|
this._skipUTF8Validation = !!options.skipUTF8Validation;
|
|
786
793
|
this[kWebSocket] = void 0;
|
|
@@ -795,6 +802,7 @@ var require_receiver = __commonJS({
|
|
|
795
802
|
this._opcode = 0;
|
|
796
803
|
this._totalPayloadLength = 0;
|
|
797
804
|
this._messageLength = 0;
|
|
805
|
+
this._numFragments = 0;
|
|
798
806
|
this._fragments = [];
|
|
799
807
|
this._errored = false;
|
|
800
808
|
this._loop = false;
|
|
@@ -810,6 +818,18 @@ var require_receiver = __commonJS({
|
|
|
810
818
|
*/
|
|
811
819
|
_write(chunk, encoding, cb) {
|
|
812
820
|
if (this._opcode === 8 && this._state == GET_INFO) return cb();
|
|
821
|
+
if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) {
|
|
822
|
+
cb(
|
|
823
|
+
this.createError(
|
|
824
|
+
RangeError,
|
|
825
|
+
"Too many buffered chunks",
|
|
826
|
+
false,
|
|
827
|
+
1008,
|
|
828
|
+
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
829
|
+
)
|
|
830
|
+
);
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
813
833
|
this._bufferedBytes += chunk.length;
|
|
814
834
|
this._buffers.push(chunk);
|
|
815
835
|
this.startLoop(cb);
|
|
@@ -908,7 +928,7 @@ var require_receiver = __commonJS({
|
|
|
908
928
|
return;
|
|
909
929
|
}
|
|
910
930
|
const compressed = (buf[0] & 64) === 64;
|
|
911
|
-
if (compressed && !this._extensions[
|
|
931
|
+
if (compressed && !this._extensions[PerMessageDeflate2.extensionName]) {
|
|
912
932
|
const error = this.createError(
|
|
913
933
|
RangeError,
|
|
914
934
|
"RSV1 must be clear",
|
|
@@ -1133,6 +1153,17 @@ var require_receiver = __commonJS({
|
|
|
1133
1153
|
this.controlMessage(data, cb);
|
|
1134
1154
|
return;
|
|
1135
1155
|
}
|
|
1156
|
+
if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
|
|
1157
|
+
const error = this.createError(
|
|
1158
|
+
RangeError,
|
|
1159
|
+
"Too many message fragments",
|
|
1160
|
+
false,
|
|
1161
|
+
1008,
|
|
1162
|
+
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
1163
|
+
);
|
|
1164
|
+
cb(error);
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1136
1167
|
if (this._compressed) {
|
|
1137
1168
|
this._state = INFLATING;
|
|
1138
1169
|
this.decompress(data, cb);
|
|
@@ -1152,7 +1183,7 @@ var require_receiver = __commonJS({
|
|
|
1152
1183
|
* @private
|
|
1153
1184
|
*/
|
|
1154
1185
|
decompress(data, cb) {
|
|
1155
|
-
const perMessageDeflate = this._extensions[
|
|
1186
|
+
const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName];
|
|
1156
1187
|
perMessageDeflate.decompress(data, this._fin, (err, buf) => {
|
|
1157
1188
|
if (err) return cb(err);
|
|
1158
1189
|
if (buf.length) {
|
|
@@ -1190,6 +1221,7 @@ var require_receiver = __commonJS({
|
|
|
1190
1221
|
this._totalPayloadLength = 0;
|
|
1191
1222
|
this._messageLength = 0;
|
|
1192
1223
|
this._fragmented = 0;
|
|
1224
|
+
this._numFragments = 0;
|
|
1193
1225
|
this._fragments = [];
|
|
1194
1226
|
if (this._opcode === 2) {
|
|
1195
1227
|
let data;
|
|
@@ -1334,7 +1366,10 @@ var require_sender = __commonJS({
|
|
|
1334
1366
|
"use strict";
|
|
1335
1367
|
var { Duplex } = __require("stream");
|
|
1336
1368
|
var { randomFillSync } = __require("crypto");
|
|
1337
|
-
var
|
|
1369
|
+
var {
|
|
1370
|
+
types: { isUint8Array }
|
|
1371
|
+
} = __require("util");
|
|
1372
|
+
var PerMessageDeflate2 = require_permessage_deflate();
|
|
1338
1373
|
var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants();
|
|
1339
1374
|
var { isBlob, isValidStatusCode } = require_validation();
|
|
1340
1375
|
var { mask: applyMask, toBuffer } = require_buffer_util();
|
|
@@ -1487,8 +1522,10 @@ var require_sender = __commonJS({
|
|
|
1487
1522
|
buf.writeUInt16BE(code, 0);
|
|
1488
1523
|
if (typeof data === "string") {
|
|
1489
1524
|
buf.write(data, 2);
|
|
1490
|
-
} else {
|
|
1525
|
+
} else if (isUint8Array(data)) {
|
|
1491
1526
|
buf.set(data, 2);
|
|
1527
|
+
} else {
|
|
1528
|
+
throw new TypeError("Second argument must be a string or a Uint8Array");
|
|
1492
1529
|
}
|
|
1493
1530
|
}
|
|
1494
1531
|
const options = {
|
|
@@ -1618,7 +1655,7 @@ var require_sender = __commonJS({
|
|
|
1618
1655
|
* @public
|
|
1619
1656
|
*/
|
|
1620
1657
|
send(data, options, cb) {
|
|
1621
|
-
const perMessageDeflate = this._extensions[
|
|
1658
|
+
const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName];
|
|
1622
1659
|
let opcode = options.binary ? 2 : 1;
|
|
1623
1660
|
let rsv1 = options.compress;
|
|
1624
1661
|
let byteLength;
|
|
@@ -1742,7 +1779,7 @@ var require_sender = __commonJS({
|
|
|
1742
1779
|
this.sendFrame(_Sender.frame(data, options), cb);
|
|
1743
1780
|
return;
|
|
1744
1781
|
}
|
|
1745
|
-
const perMessageDeflate = this._extensions[
|
|
1782
|
+
const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName];
|
|
1746
1783
|
this._bufferedBytes += options[kByteLength];
|
|
1747
1784
|
this._state = DEFLATING;
|
|
1748
1785
|
perMessageDeflate.compress(data, options.fin, (_, buf) => {
|
|
@@ -2180,11 +2217,11 @@ var require_extension = __commonJS({
|
|
|
2180
2217
|
return offers;
|
|
2181
2218
|
}
|
|
2182
2219
|
function format(extensions) {
|
|
2183
|
-
return Object.keys(extensions).map((
|
|
2184
|
-
let configurations = extensions[
|
|
2220
|
+
return Object.keys(extensions).map((extension2) => {
|
|
2221
|
+
let configurations = extensions[extension2];
|
|
2185
2222
|
if (!Array.isArray(configurations)) configurations = [configurations];
|
|
2186
2223
|
return configurations.map((params) => {
|
|
2187
|
-
return [
|
|
2224
|
+
return [extension2].concat(
|
|
2188
2225
|
Object.keys(params).map((k) => {
|
|
2189
2226
|
let values = params[k];
|
|
2190
2227
|
if (!Array.isArray(values)) values = [values];
|
|
@@ -2210,12 +2247,13 @@ var require_websocket = __commonJS({
|
|
|
2210
2247
|
var { randomBytes, createHash } = __require("crypto");
|
|
2211
2248
|
var { Duplex, Readable } = __require("stream");
|
|
2212
2249
|
var { URL } = __require("url");
|
|
2213
|
-
var
|
|
2250
|
+
var PerMessageDeflate2 = require_permessage_deflate();
|
|
2214
2251
|
var Receiver2 = require_receiver();
|
|
2215
2252
|
var Sender2 = require_sender();
|
|
2216
2253
|
var { isBlob } = require_validation();
|
|
2217
2254
|
var {
|
|
2218
2255
|
BINARY_TYPES,
|
|
2256
|
+
CLOSE_TIMEOUT,
|
|
2219
2257
|
EMPTY_BUFFER,
|
|
2220
2258
|
GUID,
|
|
2221
2259
|
kForOnEventAttribute,
|
|
@@ -2229,7 +2267,6 @@ var require_websocket = __commonJS({
|
|
|
2229
2267
|
} = require_event_target();
|
|
2230
2268
|
var { format, parse } = require_extension();
|
|
2231
2269
|
var { toBuffer } = require_buffer_util();
|
|
2232
|
-
var closeTimeout = 30 * 1e3;
|
|
2233
2270
|
var kAborted = Symbol("kAborted");
|
|
2234
2271
|
var protocolVersions = [8, 13];
|
|
2235
2272
|
var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
|
|
@@ -2263,11 +2300,23 @@ var require_websocket = __commonJS({
|
|
|
2263
2300
|
this._isServer = false;
|
|
2264
2301
|
this._redirects = 0;
|
|
2265
2302
|
if (protocols === void 0) {
|
|
2266
|
-
protocols
|
|
2303
|
+
if (!options || options.protocols === void 0) {
|
|
2304
|
+
protocols = [];
|
|
2305
|
+
} else if (Array.isArray(options.protocols)) {
|
|
2306
|
+
protocols = options.protocols;
|
|
2307
|
+
} else {
|
|
2308
|
+
protocols = [options.protocols];
|
|
2309
|
+
}
|
|
2267
2310
|
} else if (!Array.isArray(protocols)) {
|
|
2268
2311
|
if (typeof protocols === "object" && protocols !== null) {
|
|
2269
2312
|
options = protocols;
|
|
2270
|
-
protocols
|
|
2313
|
+
if (options.protocols === void 0) {
|
|
2314
|
+
protocols = [];
|
|
2315
|
+
} else if (Array.isArray(options.protocols)) {
|
|
2316
|
+
protocols = options.protocols;
|
|
2317
|
+
} else {
|
|
2318
|
+
protocols = [options.protocols];
|
|
2319
|
+
}
|
|
2271
2320
|
} else {
|
|
2272
2321
|
protocols = [protocols];
|
|
2273
2322
|
}
|
|
@@ -2275,6 +2324,7 @@ var require_websocket = __commonJS({
|
|
|
2275
2324
|
initAsClient(this, address, protocols, options);
|
|
2276
2325
|
} else {
|
|
2277
2326
|
this._autoPong = options.autoPong;
|
|
2327
|
+
this._closeTimeout = options.closeTimeout;
|
|
2278
2328
|
this._isServer = true;
|
|
2279
2329
|
}
|
|
2280
2330
|
}
|
|
@@ -2368,6 +2418,10 @@ var require_websocket = __commonJS({
|
|
|
2368
2418
|
* multiple times in the same tick
|
|
2369
2419
|
* @param {Function} [options.generateMask] The function used to generate the
|
|
2370
2420
|
* masking key
|
|
2421
|
+
* @param {Number} [options.maxBufferedChunks=0] The maximum number of
|
|
2422
|
+
* buffered data chunks
|
|
2423
|
+
* @param {Number} [options.maxFragments=0] The maximum number of message
|
|
2424
|
+
* fragments
|
|
2371
2425
|
* @param {Number} [options.maxPayload=0] The maximum allowed message size
|
|
2372
2426
|
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
|
|
2373
2427
|
* not to skip UTF-8 validation for text and close messages
|
|
@@ -2379,6 +2433,8 @@ var require_websocket = __commonJS({
|
|
|
2379
2433
|
binaryType: this.binaryType,
|
|
2380
2434
|
extensions: this._extensions,
|
|
2381
2435
|
isServer: this._isServer,
|
|
2436
|
+
maxBufferedChunks: options.maxBufferedChunks,
|
|
2437
|
+
maxFragments: options.maxFragments,
|
|
2382
2438
|
maxPayload: options.maxPayload,
|
|
2383
2439
|
skipUTF8Validation: options.skipUTF8Validation
|
|
2384
2440
|
});
|
|
@@ -2417,8 +2473,8 @@ var require_websocket = __commonJS({
|
|
|
2417
2473
|
this.emit("close", this._closeCode, this._closeMessage);
|
|
2418
2474
|
return;
|
|
2419
2475
|
}
|
|
2420
|
-
if (this._extensions[
|
|
2421
|
-
this._extensions[
|
|
2476
|
+
if (this._extensions[PerMessageDeflate2.extensionName]) {
|
|
2477
|
+
this._extensions[PerMessageDeflate2.extensionName].cleanup();
|
|
2422
2478
|
}
|
|
2423
2479
|
this._receiver.removeAllListeners();
|
|
2424
2480
|
this._readyState = _WebSocket.CLOSED;
|
|
@@ -2457,7 +2513,6 @@ var require_websocket = __commonJS({
|
|
|
2457
2513
|
}
|
|
2458
2514
|
return;
|
|
2459
2515
|
}
|
|
2460
|
-
this._readyState = _WebSocket.CLOSING;
|
|
2461
2516
|
this._sender.close(code, data, !this._isServer, (err) => {
|
|
2462
2517
|
if (err) return;
|
|
2463
2518
|
this._closeFrameSent = true;
|
|
@@ -2465,6 +2520,7 @@ var require_websocket = __commonJS({
|
|
|
2465
2520
|
this._socket.end();
|
|
2466
2521
|
}
|
|
2467
2522
|
});
|
|
2523
|
+
this._readyState = _WebSocket.CLOSING;
|
|
2468
2524
|
setCloseTimer(this);
|
|
2469
2525
|
}
|
|
2470
2526
|
/**
|
|
@@ -2580,7 +2636,7 @@ var require_websocket = __commonJS({
|
|
|
2580
2636
|
fin: true,
|
|
2581
2637
|
...options
|
|
2582
2638
|
};
|
|
2583
|
-
if (!this._extensions[
|
|
2639
|
+
if (!this._extensions[PerMessageDeflate2.extensionName]) {
|
|
2584
2640
|
opts.compress = false;
|
|
2585
2641
|
}
|
|
2586
2642
|
this._sender.send(data || EMPTY_BUFFER, opts, cb);
|
|
@@ -2676,7 +2732,10 @@ var require_websocket = __commonJS({
|
|
|
2676
2732
|
const opts = {
|
|
2677
2733
|
allowSynchronousEvents: true,
|
|
2678
2734
|
autoPong: true,
|
|
2735
|
+
closeTimeout: CLOSE_TIMEOUT,
|
|
2679
2736
|
protocolVersion: protocolVersions[1],
|
|
2737
|
+
maxBufferedChunks: 256 * 1024,
|
|
2738
|
+
maxFragments: 16 * 1024,
|
|
2680
2739
|
maxPayload: 100 * 1024 * 1024,
|
|
2681
2740
|
skipUTF8Validation: false,
|
|
2682
2741
|
perMessageDeflate: true,
|
|
@@ -2686,6 +2745,7 @@ var require_websocket = __commonJS({
|
|
|
2686
2745
|
socketPath: void 0,
|
|
2687
2746
|
hostname: void 0,
|
|
2688
2747
|
protocol: void 0,
|
|
2748
|
+
protocols: void 0,
|
|
2689
2749
|
timeout: void 0,
|
|
2690
2750
|
method: "GET",
|
|
2691
2751
|
host: void 0,
|
|
@@ -2693,6 +2753,7 @@ var require_websocket = __commonJS({
|
|
|
2693
2753
|
port: void 0
|
|
2694
2754
|
};
|
|
2695
2755
|
websocket._autoPong = opts.autoPong;
|
|
2756
|
+
websocket._closeTimeout = opts.closeTimeout;
|
|
2696
2757
|
if (!protocolVersions.includes(opts.protocolVersion)) {
|
|
2697
2758
|
throw new RangeError(
|
|
2698
2759
|
`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`
|
|
@@ -2704,7 +2765,7 @@ var require_websocket = __commonJS({
|
|
|
2704
2765
|
} else {
|
|
2705
2766
|
try {
|
|
2706
2767
|
parsedUrl = new URL(address);
|
|
2707
|
-
} catch
|
|
2768
|
+
} catch {
|
|
2708
2769
|
throw new SyntaxError(`Invalid URL: ${address}`);
|
|
2709
2770
|
}
|
|
2710
2771
|
}
|
|
@@ -2752,13 +2813,13 @@ var require_websocket = __commonJS({
|
|
|
2752
2813
|
opts.path = parsedUrl.pathname + parsedUrl.search;
|
|
2753
2814
|
opts.timeout = opts.handshakeTimeout;
|
|
2754
2815
|
if (opts.perMessageDeflate) {
|
|
2755
|
-
perMessageDeflate = new
|
|
2756
|
-
opts.perMessageDeflate
|
|
2757
|
-
false,
|
|
2758
|
-
opts.maxPayload
|
|
2759
|
-
);
|
|
2816
|
+
perMessageDeflate = new PerMessageDeflate2({
|
|
2817
|
+
...opts.perMessageDeflate,
|
|
2818
|
+
isServer: false,
|
|
2819
|
+
maxPayload: opts.maxPayload
|
|
2820
|
+
});
|
|
2760
2821
|
opts.headers["Sec-WebSocket-Extensions"] = format({
|
|
2761
|
-
[
|
|
2822
|
+
[PerMessageDeflate2.extensionName]: perMessageDeflate.offer()
|
|
2762
2823
|
});
|
|
2763
2824
|
}
|
|
2764
2825
|
if (protocols.length) {
|
|
@@ -2901,23 +2962,25 @@ var require_websocket = __commonJS({
|
|
|
2901
2962
|
return;
|
|
2902
2963
|
}
|
|
2903
2964
|
const extensionNames = Object.keys(extensions);
|
|
2904
|
-
if (extensionNames.length !== 1 || extensionNames[0] !==
|
|
2965
|
+
if (extensionNames.length !== 1 || extensionNames[0] !== PerMessageDeflate2.extensionName) {
|
|
2905
2966
|
const message = "Server indicated an extension that was not requested";
|
|
2906
2967
|
abortHandshake(websocket, socket, message);
|
|
2907
2968
|
return;
|
|
2908
2969
|
}
|
|
2909
2970
|
try {
|
|
2910
|
-
perMessageDeflate.accept(extensions[
|
|
2971
|
+
perMessageDeflate.accept(extensions[PerMessageDeflate2.extensionName]);
|
|
2911
2972
|
} catch (err) {
|
|
2912
2973
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
|
2913
2974
|
abortHandshake(websocket, socket, message);
|
|
2914
2975
|
return;
|
|
2915
2976
|
}
|
|
2916
|
-
websocket._extensions[
|
|
2977
|
+
websocket._extensions[PerMessageDeflate2.extensionName] = perMessageDeflate;
|
|
2917
2978
|
}
|
|
2918
2979
|
websocket.setSocket(socket, head, {
|
|
2919
2980
|
allowSynchronousEvents: opts.allowSynchronousEvents,
|
|
2920
2981
|
generateMask: opts.generateMask,
|
|
2982
|
+
maxBufferedChunks: opts.maxBufferedChunks,
|
|
2983
|
+
maxFragments: opts.maxFragments,
|
|
2921
2984
|
maxPayload: opts.maxPayload,
|
|
2922
2985
|
skipUTF8Validation: opts.skipUTF8Validation
|
|
2923
2986
|
});
|
|
@@ -3035,7 +3098,7 @@ var require_websocket = __commonJS({
|
|
|
3035
3098
|
function setCloseTimer(websocket) {
|
|
3036
3099
|
websocket._closeTimer = setTimeout(
|
|
3037
3100
|
websocket._socket.destroy.bind(websocket._socket),
|
|
3038
|
-
|
|
3101
|
+
websocket._closeTimeout
|
|
3039
3102
|
);
|
|
3040
3103
|
}
|
|
3041
3104
|
function socketOnClose() {
|
|
@@ -3044,8 +3107,8 @@ var require_websocket = __commonJS({
|
|
|
3044
3107
|
this.removeListener("data", socketOnData);
|
|
3045
3108
|
this.removeListener("end", socketOnEnd);
|
|
3046
3109
|
websocket._readyState = WebSocket2.CLOSING;
|
|
3047
|
-
|
|
3048
|
-
|
|
3110
|
+
if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) {
|
|
3111
|
+
const chunk = this.read(this._readableState.length);
|
|
3049
3112
|
websocket._receiver.write(chunk);
|
|
3050
3113
|
}
|
|
3051
3114
|
websocket._receiver.end();
|
|
@@ -3232,11 +3295,11 @@ var require_websocket_server = __commonJS({
|
|
|
3232
3295
|
var http = __require("http");
|
|
3233
3296
|
var { Duplex } = __require("stream");
|
|
3234
3297
|
var { createHash } = __require("crypto");
|
|
3235
|
-
var
|
|
3236
|
-
var
|
|
3237
|
-
var
|
|
3298
|
+
var extension2 = require_extension();
|
|
3299
|
+
var PerMessageDeflate2 = require_permessage_deflate();
|
|
3300
|
+
var subprotocol2 = require_subprotocol();
|
|
3238
3301
|
var WebSocket2 = require_websocket();
|
|
3239
|
-
var { GUID, kWebSocket } = require_constants();
|
|
3302
|
+
var { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants();
|
|
3240
3303
|
var keyRegex = /^[+/0-9A-Za-z]{22}==$/;
|
|
3241
3304
|
var RUNNING = 0;
|
|
3242
3305
|
var CLOSING = 1;
|
|
@@ -3255,8 +3318,15 @@ var require_websocket_server = __commonJS({
|
|
|
3255
3318
|
* pending connections
|
|
3256
3319
|
* @param {Boolean} [options.clientTracking=true] Specifies whether or not to
|
|
3257
3320
|
* track clients
|
|
3321
|
+
* @param {Number} [options.closeTimeout=30000] Duration in milliseconds to
|
|
3322
|
+
* wait for the closing handshake to finish after `websocket.close()` is
|
|
3323
|
+
* called
|
|
3258
3324
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
3259
3325
|
* @param {String} [options.host] The hostname where to bind the server
|
|
3326
|
+
* @param {Number} [options.maxBufferedChunks=262144] The maximum number of
|
|
3327
|
+
* buffered data chunks
|
|
3328
|
+
* @param {Number} [options.maxFragments=16384] The maximum number of message
|
|
3329
|
+
* fragments
|
|
3260
3330
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
3261
3331
|
* size
|
|
3262
3332
|
* @param {Boolean} [options.noServer=false] Enable no server mode
|
|
@@ -3278,11 +3348,14 @@ var require_websocket_server = __commonJS({
|
|
|
3278
3348
|
options = {
|
|
3279
3349
|
allowSynchronousEvents: true,
|
|
3280
3350
|
autoPong: true,
|
|
3351
|
+
maxBufferedChunks: 256 * 1024,
|
|
3352
|
+
maxFragments: 16 * 1024,
|
|
3281
3353
|
maxPayload: 100 * 1024 * 1024,
|
|
3282
3354
|
skipUTF8Validation: false,
|
|
3283
3355
|
perMessageDeflate: false,
|
|
3284
3356
|
handleProtocols: null,
|
|
3285
3357
|
clientTracking: true,
|
|
3358
|
+
closeTimeout: CLOSE_TIMEOUT,
|
|
3286
3359
|
verifyClient: null,
|
|
3287
3360
|
noServer: false,
|
|
3288
3361
|
backlog: null,
|
|
@@ -3453,7 +3526,7 @@ var require_websocket_server = __commonJS({
|
|
|
3453
3526
|
let protocols = /* @__PURE__ */ new Set();
|
|
3454
3527
|
if (secWebSocketProtocol !== void 0) {
|
|
3455
3528
|
try {
|
|
3456
|
-
protocols =
|
|
3529
|
+
protocols = subprotocol2.parse(secWebSocketProtocol);
|
|
3457
3530
|
} catch (err) {
|
|
3458
3531
|
const message = "Invalid Sec-WebSocket-Protocol header";
|
|
3459
3532
|
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
|
|
@@ -3463,16 +3536,16 @@ var require_websocket_server = __commonJS({
|
|
|
3463
3536
|
const secWebSocketExtensions = req.headers["sec-websocket-extensions"];
|
|
3464
3537
|
const extensions = {};
|
|
3465
3538
|
if (this.options.perMessageDeflate && secWebSocketExtensions !== void 0) {
|
|
3466
|
-
const perMessageDeflate = new
|
|
3467
|
-
this.options.perMessageDeflate,
|
|
3468
|
-
true,
|
|
3469
|
-
this.options.maxPayload
|
|
3470
|
-
);
|
|
3539
|
+
const perMessageDeflate = new PerMessageDeflate2({
|
|
3540
|
+
...this.options.perMessageDeflate,
|
|
3541
|
+
isServer: true,
|
|
3542
|
+
maxPayload: this.options.maxPayload
|
|
3543
|
+
});
|
|
3471
3544
|
try {
|
|
3472
|
-
const offers =
|
|
3473
|
-
if (offers[
|
|
3474
|
-
perMessageDeflate.accept(offers[
|
|
3475
|
-
extensions[
|
|
3545
|
+
const offers = extension2.parse(secWebSocketExtensions);
|
|
3546
|
+
if (offers[PerMessageDeflate2.extensionName]) {
|
|
3547
|
+
perMessageDeflate.accept(offers[PerMessageDeflate2.extensionName]);
|
|
3548
|
+
extensions[PerMessageDeflate2.extensionName] = perMessageDeflate;
|
|
3476
3549
|
}
|
|
3477
3550
|
} catch (err) {
|
|
3478
3551
|
const message = "Invalid or unacceptable Sec-WebSocket-Extensions header";
|
|
@@ -3543,10 +3616,10 @@ var require_websocket_server = __commonJS({
|
|
|
3543
3616
|
ws._protocol = protocol;
|
|
3544
3617
|
}
|
|
3545
3618
|
}
|
|
3546
|
-
if (extensions[
|
|
3547
|
-
const params = extensions[
|
|
3548
|
-
const value =
|
|
3549
|
-
[
|
|
3619
|
+
if (extensions[PerMessageDeflate2.extensionName]) {
|
|
3620
|
+
const params = extensions[PerMessageDeflate2.extensionName].params;
|
|
3621
|
+
const value = extension2.format({
|
|
3622
|
+
[PerMessageDeflate2.extensionName]: [params]
|
|
3550
3623
|
});
|
|
3551
3624
|
headers.push(`Sec-WebSocket-Extensions: ${value}`);
|
|
3552
3625
|
ws._extensions = extensions;
|
|
@@ -3556,6 +3629,8 @@ var require_websocket_server = __commonJS({
|
|
|
3556
3629
|
socket.removeListener("error", socketOnError);
|
|
3557
3630
|
ws.setSocket(socket, head, {
|
|
3558
3631
|
allowSynchronousEvents: this.options.allowSynchronousEvents,
|
|
3632
|
+
maxBufferedChunks: this.options.maxBufferedChunks,
|
|
3633
|
+
maxFragments: this.options.maxFragments,
|
|
3559
3634
|
maxPayload: this.options.maxPayload,
|
|
3560
3635
|
skipUTF8Validation: this.options.skipUTF8Validation
|
|
3561
3636
|
});
|
|
@@ -3615,13 +3690,17 @@ var require_websocket_server = __commonJS({
|
|
|
3615
3690
|
|
|
3616
3691
|
// node_modules/ws/wrapper.mjs
|
|
3617
3692
|
var import_stream = __toESM(require_stream(), 1);
|
|
3693
|
+
var import_extension = __toESM(require_extension(), 1);
|
|
3694
|
+
var import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
|
|
3618
3695
|
var import_receiver = __toESM(require_receiver(), 1);
|
|
3619
3696
|
var import_sender = __toESM(require_sender(), 1);
|
|
3697
|
+
var import_subprotocol = __toESM(require_subprotocol(), 1);
|
|
3620
3698
|
var import_websocket = __toESM(require_websocket(), 1);
|
|
3621
3699
|
var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
3622
3700
|
var wrapper_default = import_websocket.default;
|
|
3623
3701
|
|
|
3624
3702
|
export {
|
|
3625
3703
|
import_websocket,
|
|
3704
|
+
import_websocket_server,
|
|
3626
3705
|
wrapper_default
|
|
3627
3706
|
};
|