@shawnstack/quickforge 1.3.12 → 1.3.13
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/README.md +348 -348
- package/dist/assets/{anthropic-xAV_KBCN.js → anthropic-Ckozj5YL.js} +1 -1
- package/dist/assets/{azure-openai-responses-BczDocGX.js → azure-openai-responses-BwnfX0zX.js} +1 -1
- package/dist/assets/{google-DlBM2UuM.js → google-C68FfCgv.js} +1 -1
- package/dist/assets/{google-gemini-cli-BNOncgB1.js → google-gemini-cli-Bvmj_VP7.js} +1 -1
- package/dist/assets/{google-vertex-B9BjJowW.js → google-vertex-DfBcqFGy.js} +1 -1
- package/dist/assets/{icons-pEANlMqZ.js → icons-BHkxP7oT.js} +1 -1
- package/dist/assets/{index-Cq4dknqT.js → index-Bx9iFrzC.js} +527 -520
- package/dist/assets/index-kYsI9py3.css +3 -0
- package/dist/assets/{mistral-Dldc_EeW.js → mistral-soe30nal.js} +1 -1
- package/dist/assets/{openai-codex-responses-vFjB6yfe.js → openai-codex-responses-BX3Fx3LC.js} +1 -1
- package/dist/assets/{openai-completions-DPFPTHxA.js → openai-completions-CYI6ynqy.js} +1 -1
- package/dist/assets/{openai-responses-B9SrG5r6.js → openai-responses-X7pjajQb.js} +1 -1
- package/dist/assets/{openai-responses-shared-DCiYCDet.js → openai-responses-shared-Cx1dCwfa.js} +1 -1
- package/dist/assets/{react-vendor-ORf0unE-.js → react-vendor-CmyL2roG.js} +1 -1
- package/dist/index.html +10 -4
- package/dist/manifest.webmanifest +30 -0
- package/dist/pwa-icon-192.png +0 -0
- package/dist/pwa-icon-512.png +0 -0
- package/dist/pwa-maskable-512.png +0 -0
- package/dist/sw.js +79 -0
- package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/LICENSE +201 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +62 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +156 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +16 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +80 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +11 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +10 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +69 -0
- package/node_modules/@aws-sdk/token-providers/package.json +1 -1
- package/node_modules/es-object-atoms/CHANGELOG.md +21 -14
- package/node_modules/es-object-atoms/package.json +6 -7
- package/node_modules/es-object-atoms/tsconfig.json +1 -0
- package/node_modules/hono/dist/adapter/deno/websocket.js +5 -1
- package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +5 -1
- package/node_modules/hono/dist/cjs/index.js +3 -0
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +31 -5
- package/node_modules/hono/dist/cjs/utils/compress.js +1 -1
- package/node_modules/hono/dist/cjs/utils/filepath.js +1 -1
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +1 -1
- package/node_modules/hono/dist/cjs/utils/mime.js +15 -17
- package/node_modules/hono/dist/index.js +2 -0
- package/node_modules/hono/dist/middleware/compress/index.js +30 -5
- package/node_modules/hono/dist/utils/compress.js +1 -1
- package/node_modules/hono/dist/utils/filepath.js +1 -1
- package/node_modules/hono/dist/utils/ipaddr.js +1 -1
- package/node_modules/hono/dist/utils/mime.js +15 -17
- package/node_modules/hono/package.json +3 -3
- package/node_modules/ws/lib/receiver.js +54 -0
- package/node_modules/ws/lib/websocket-server.js +8 -0
- package/node_modules/ws/lib/websocket.js +14 -0
- package/node_modules/ws/package.json +1 -1
- package/package.json +1 -1
- package/server/routes/workspace.mjs +33 -1
- package/dist/assets/index-Dq1Kwzwg.css +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/utils/compress.ts
|
|
2
|
-
var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i;
|
|
2
|
+
var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|msgpack|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|vnd\.msgpack|wasm|x-httpd-php|x-javascript|x-msgpack|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml|msgpack))(?:[;\s]|$)/i;
|
|
3
3
|
export {
|
|
4
4
|
COMPRESSIBLE_CONTENT_TYPE_REGEX
|
|
5
5
|
};
|
|
@@ -20,7 +20,7 @@ var getFilePathWithoutDefaultDocument = (options) => {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
filename = filename.replace(/^\.?[\/\\]/, "");
|
|
23
|
-
filename = filename.replace(
|
|
23
|
+
filename = filename.replace(/\\/g, "/");
|
|
24
24
|
root = root.replace(/\/$/, "");
|
|
25
25
|
let path = root ? root + "/" + filename : filename;
|
|
26
26
|
path = path.replace(/^\.?\//, "");
|
|
@@ -265,7 +265,7 @@ var convertIPv6BinaryToString = (ipV6) => {
|
|
|
265
265
|
maxZeroEnd = 8;
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
if (maxZeroStart !== -1) {
|
|
268
|
+
if (maxZeroStart !== -1 && maxZeroEnd - maxZeroStart > 1) {
|
|
269
269
|
sections.splice(maxZeroStart, maxZeroEnd - maxZeroStart, ":");
|
|
270
270
|
}
|
|
271
271
|
return sections.join(":").replace(/:{2,}/g, "::");
|
|
@@ -5,15 +5,13 @@ var getMimeType = (filename, mimes = baseMimes) => {
|
|
|
5
5
|
if (!match) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
if (mimeType && mimeType.startsWith("text")) {
|
|
10
|
-
mimeType += "; charset=utf-8";
|
|
11
|
-
}
|
|
12
|
-
return mimeType;
|
|
8
|
+
return mimes[match[1].toLowerCase()];
|
|
13
9
|
};
|
|
14
10
|
var getExtension = (mimeType) => {
|
|
11
|
+
const baseType = mimeType.split(";", 1)[0].trim();
|
|
15
12
|
for (const ext in baseMimes) {
|
|
16
|
-
|
|
13
|
+
const stored = baseMimes[ext];
|
|
14
|
+
if (stored === mimeType || stored.split(";", 1)[0].trim() === baseType) {
|
|
17
15
|
return ext;
|
|
18
16
|
}
|
|
19
17
|
}
|
|
@@ -25,25 +23,25 @@ var _baseMimes = {
|
|
|
25
23
|
av1: "video/av1",
|
|
26
24
|
bin: "application/octet-stream",
|
|
27
25
|
bmp: "image/bmp",
|
|
28
|
-
css: "text/css",
|
|
29
|
-
csv: "text/csv",
|
|
26
|
+
css: "text/css; charset=utf-8",
|
|
27
|
+
csv: "text/csv; charset=utf-8",
|
|
30
28
|
eot: "application/vnd.ms-fontobject",
|
|
31
29
|
epub: "application/epub+zip",
|
|
32
30
|
gif: "image/gif",
|
|
33
31
|
gz: "application/gzip",
|
|
34
|
-
htm: "text/html",
|
|
35
|
-
html: "text/html",
|
|
32
|
+
htm: "text/html; charset=utf-8",
|
|
33
|
+
html: "text/html; charset=utf-8",
|
|
36
34
|
ico: "image/x-icon",
|
|
37
|
-
ics: "text/calendar",
|
|
35
|
+
ics: "text/calendar; charset=utf-8",
|
|
38
36
|
jpeg: "image/jpeg",
|
|
39
37
|
jpg: "image/jpeg",
|
|
40
|
-
js: "text/javascript",
|
|
38
|
+
js: "text/javascript; charset=utf-8",
|
|
41
39
|
json: "application/json",
|
|
42
40
|
jsonld: "application/ld+json",
|
|
43
41
|
map: "application/json",
|
|
44
42
|
mid: "audio/x-midi",
|
|
45
43
|
midi: "audio/x-midi",
|
|
46
|
-
mjs: "text/javascript",
|
|
44
|
+
mjs: "text/javascript; charset=utf-8",
|
|
47
45
|
mp3: "audio/mpeg",
|
|
48
46
|
mp4: "video/mp4",
|
|
49
47
|
mpeg: "video/mpeg",
|
|
@@ -55,12 +53,12 @@ var _baseMimes = {
|
|
|
55
53
|
pdf: "application/pdf",
|
|
56
54
|
png: "image/png",
|
|
57
55
|
rtf: "application/rtf",
|
|
58
|
-
svg: "image/svg+xml",
|
|
56
|
+
svg: "image/svg+xml; charset=utf-8",
|
|
59
57
|
tif: "image/tiff",
|
|
60
58
|
tiff: "image/tiff",
|
|
61
59
|
ts: "video/mp2t",
|
|
62
60
|
ttf: "font/ttf",
|
|
63
|
-
txt: "text/plain",
|
|
61
|
+
txt: "text/plain; charset=utf-8",
|
|
64
62
|
wasm: "application/wasm",
|
|
65
63
|
webm: "video/webm",
|
|
66
64
|
weba: "audio/webm",
|
|
@@ -68,8 +66,8 @@ var _baseMimes = {
|
|
|
68
66
|
webp: "image/webp",
|
|
69
67
|
woff: "font/woff",
|
|
70
68
|
woff2: "font/woff2",
|
|
71
|
-
xhtml: "application/xhtml+xml",
|
|
72
|
-
xml: "application/xml",
|
|
69
|
+
xhtml: "application/xhtml+xml; charset=utf-8",
|
|
70
|
+
xml: "application/xml; charset=utf-8",
|
|
73
71
|
zip: "application/zip",
|
|
74
72
|
"3gp": "video/3gpp",
|
|
75
73
|
"3g2": "video/3gpp2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hono",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.23",
|
|
4
4
|
"description": "Web framework built on Web Standards",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -663,7 +663,7 @@
|
|
|
663
663
|
"@types/node": "^24.3.0",
|
|
664
664
|
"@types/ws": "^8.18.1",
|
|
665
665
|
"@typescript/native-preview": "7.0.0-dev.20260210.1",
|
|
666
|
-
"@vitest/coverage-v8": "^
|
|
666
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
667
667
|
"arg": "^5.0.2",
|
|
668
668
|
"bun-types": "^1.2.20",
|
|
669
669
|
"editorconfig-checker": "6.1.1",
|
|
@@ -680,7 +680,7 @@
|
|
|
680
680
|
"typescript": "^5.9.2",
|
|
681
681
|
"undici": "^6.21.3",
|
|
682
682
|
"vite-plugin-fastly-js-compute": "^0.4.2",
|
|
683
|
-
"vitest": "^
|
|
683
|
+
"vitest": "^4.1.7",
|
|
684
684
|
"wrangler": "4.12.0",
|
|
685
685
|
"ws": "^8.18.0",
|
|
686
686
|
"zod": "^3.23.8"
|
|
@@ -40,6 +40,10 @@ class Receiver extends Writable {
|
|
|
40
40
|
* extensions
|
|
41
41
|
* @param {Boolean} [options.isServer=false] Specifies whether to operate in
|
|
42
42
|
* client or server mode
|
|
43
|
+
* @param {Number} [options.maxBufferedChunks=0] The maximum number of
|
|
44
|
+
* buffered data chunks
|
|
45
|
+
* @param {Number} [options.maxFragments=0] The maximum number of message
|
|
46
|
+
* fragments
|
|
43
47
|
* @param {Number} [options.maxPayload=0] The maximum allowed message length
|
|
44
48
|
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
|
|
45
49
|
* not to skip UTF-8 validation for text and close messages
|
|
@@ -54,6 +58,8 @@ class Receiver extends Writable {
|
|
|
54
58
|
this._binaryType = options.binaryType || BINARY_TYPES[0];
|
|
55
59
|
this._extensions = options.extensions || {};
|
|
56
60
|
this._isServer = !!options.isServer;
|
|
61
|
+
this._maxBufferedChunks = options.maxBufferedChunks | 0;
|
|
62
|
+
this._maxFragments = options.maxFragments | 0;
|
|
57
63
|
this._maxPayload = options.maxPayload | 0;
|
|
58
64
|
this._skipUTF8Validation = !!options.skipUTF8Validation;
|
|
59
65
|
this[kWebSocket] = undefined;
|
|
@@ -89,6 +95,22 @@ class Receiver extends Writable {
|
|
|
89
95
|
_write(chunk, encoding, cb) {
|
|
90
96
|
if (this._opcode === 0x08 && this._state == GET_INFO) return cb();
|
|
91
97
|
|
|
98
|
+
if (
|
|
99
|
+
this._maxBufferedChunks > 0 &&
|
|
100
|
+
this._buffers.length >= this._maxBufferedChunks
|
|
101
|
+
) {
|
|
102
|
+
cb(
|
|
103
|
+
this.createError(
|
|
104
|
+
RangeError,
|
|
105
|
+
'Too many buffered chunks',
|
|
106
|
+
false,
|
|
107
|
+
1008,
|
|
108
|
+
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
109
|
+
)
|
|
110
|
+
);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
92
114
|
this._bufferedBytes += chunk.length;
|
|
93
115
|
this._buffers.push(chunk);
|
|
94
116
|
this.startLoop(cb);
|
|
@@ -485,6 +507,22 @@ class Receiver extends Writable {
|
|
|
485
507
|
}
|
|
486
508
|
|
|
487
509
|
if (data.length) {
|
|
510
|
+
if (
|
|
511
|
+
this._maxFragments > 0 &&
|
|
512
|
+
this._fragments.length >= this._maxFragments
|
|
513
|
+
) {
|
|
514
|
+
const error = this.createError(
|
|
515
|
+
RangeError,
|
|
516
|
+
'Too many message fragments',
|
|
517
|
+
false,
|
|
518
|
+
1008,
|
|
519
|
+
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
520
|
+
);
|
|
521
|
+
|
|
522
|
+
cb(error);
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
|
|
488
526
|
//
|
|
489
527
|
// This message is not compressed so its length is the sum of the payload
|
|
490
528
|
// length of all fragments.
|
|
@@ -524,6 +562,22 @@ class Receiver extends Writable {
|
|
|
524
562
|
return;
|
|
525
563
|
}
|
|
526
564
|
|
|
565
|
+
if (
|
|
566
|
+
this._maxFragments > 0 &&
|
|
567
|
+
this._fragments.length >= this._maxFragments
|
|
568
|
+
) {
|
|
569
|
+
const error = this.createError(
|
|
570
|
+
RangeError,
|
|
571
|
+
'Too many message fragments',
|
|
572
|
+
false,
|
|
573
|
+
1008,
|
|
574
|
+
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
575
|
+
);
|
|
576
|
+
|
|
577
|
+
cb(error);
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
|
|
527
581
|
this._fragments.push(buf);
|
|
528
582
|
}
|
|
529
583
|
|
|
@@ -43,6 +43,10 @@ class WebSocketServer extends EventEmitter {
|
|
|
43
43
|
* called
|
|
44
44
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
45
45
|
* @param {String} [options.host] The hostname where to bind the server
|
|
46
|
+
* @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
|
|
47
|
+
* buffered data chunks
|
|
48
|
+
* @param {Number} [options.maxFragments=131072] The maximum number of message
|
|
49
|
+
* fragments
|
|
46
50
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
47
51
|
* size
|
|
48
52
|
* @param {Boolean} [options.noServer=false] Enable no server mode
|
|
@@ -65,6 +69,8 @@ class WebSocketServer extends EventEmitter {
|
|
|
65
69
|
options = {
|
|
66
70
|
allowSynchronousEvents: true,
|
|
67
71
|
autoPong: true,
|
|
72
|
+
maxBufferedChunks: 1024 * 1024,
|
|
73
|
+
maxFragments: 128 * 1024,
|
|
68
74
|
maxPayload: 100 * 1024 * 1024,
|
|
69
75
|
skipUTF8Validation: false,
|
|
70
76
|
perMessageDeflate: false,
|
|
@@ -424,6 +430,8 @@ class WebSocketServer extends EventEmitter {
|
|
|
424
430
|
|
|
425
431
|
ws.setSocket(socket, head, {
|
|
426
432
|
allowSynchronousEvents: this.options.allowSynchronousEvents,
|
|
433
|
+
maxBufferedChunks: this.options.maxBufferedChunks,
|
|
434
|
+
maxFragments: this.options.maxFragments,
|
|
427
435
|
maxPayload: this.options.maxPayload,
|
|
428
436
|
skipUTF8Validation: this.options.skipUTF8Validation
|
|
429
437
|
});
|
|
@@ -201,6 +201,10 @@ class WebSocket extends EventEmitter {
|
|
|
201
201
|
* multiple times in the same tick
|
|
202
202
|
* @param {Function} [options.generateMask] The function used to generate the
|
|
203
203
|
* masking key
|
|
204
|
+
* @param {Number} [options.maxBufferedChunks=0] The maximum number of
|
|
205
|
+
* buffered data chunks
|
|
206
|
+
* @param {Number} [options.maxFragments=0] The maximum number of message
|
|
207
|
+
* fragments
|
|
204
208
|
* @param {Number} [options.maxPayload=0] The maximum allowed message size
|
|
205
209
|
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
|
|
206
210
|
* not to skip UTF-8 validation for text and close messages
|
|
@@ -212,6 +216,8 @@ class WebSocket extends EventEmitter {
|
|
|
212
216
|
binaryType: this.binaryType,
|
|
213
217
|
extensions: this._extensions,
|
|
214
218
|
isServer: this._isServer,
|
|
219
|
+
maxBufferedChunks: options.maxBufferedChunks,
|
|
220
|
+
maxFragments: options.maxFragments,
|
|
215
221
|
maxPayload: options.maxPayload,
|
|
216
222
|
skipUTF8Validation: options.skipUTF8Validation
|
|
217
223
|
});
|
|
@@ -640,6 +646,10 @@ module.exports = WebSocket;
|
|
|
640
646
|
* masking key
|
|
641
647
|
* @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
|
|
642
648
|
* handshake request
|
|
649
|
+
* @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
|
|
650
|
+
* buffered data chunks
|
|
651
|
+
* @param {Number} [options.maxFragments=131072] The maximum number of message
|
|
652
|
+
* fragments
|
|
643
653
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
644
654
|
* size
|
|
645
655
|
* @param {Number} [options.maxRedirects=10] The maximum number of redirects
|
|
@@ -660,6 +670,8 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
660
670
|
autoPong: true,
|
|
661
671
|
closeTimeout: CLOSE_TIMEOUT,
|
|
662
672
|
protocolVersion: protocolVersions[1],
|
|
673
|
+
maxBufferedChunks: 1024 * 1024,
|
|
674
|
+
maxFragments: 128 * 1024,
|
|
663
675
|
maxPayload: 100 * 1024 * 1024,
|
|
664
676
|
skipUTF8Validation: false,
|
|
665
677
|
perMessageDeflate: true,
|
|
@@ -1017,6 +1029,8 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
1017
1029
|
websocket.setSocket(socket, head, {
|
|
1018
1030
|
allowSynchronousEvents: opts.allowSynchronousEvents,
|
|
1019
1031
|
generateMask: opts.generateMask,
|
|
1032
|
+
maxBufferedChunks: opts.maxBufferedChunks,
|
|
1033
|
+
maxFragments: opts.maxFragments,
|
|
1020
1034
|
maxPayload: opts.maxPayload,
|
|
1021
1035
|
skipUTF8Validation: opts.skipUTF8Validation
|
|
1022
1036
|
});
|
package/package.json
CHANGED
|
@@ -85,6 +85,7 @@ async function isGitRepository(workspaceRoot) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
function classifyStatus(x, y) {
|
|
88
|
+
if (x === 'U' || y === 'U' || (x === 'A' && y === 'A') || (x === 'D' && y === 'D')) return 'conflicted'
|
|
88
89
|
if (x === '?' && y === '?') return 'untracked'
|
|
89
90
|
if (x === 'R' || y === 'R') return 'renamed'
|
|
90
91
|
if (x === 'A' || y === 'A') return 'added'
|
|
@@ -105,6 +106,9 @@ function parseGitStatus(buffer) {
|
|
|
105
106
|
status,
|
|
106
107
|
staged: x !== ' ' && x !== '?',
|
|
107
108
|
unstaged: y !== ' ' && y !== '?',
|
|
109
|
+
conflict: status === 'conflicted',
|
|
110
|
+
x,
|
|
111
|
+
y,
|
|
108
112
|
}
|
|
109
113
|
if (status === 'renamed') {
|
|
110
114
|
const oldPath = entries[index + 1]
|
|
@@ -118,10 +122,38 @@ function parseGitStatus(buffer) {
|
|
|
118
122
|
return files.sort((left, right) => left.path.localeCompare(right.path, undefined, { sensitivity: 'base' }))
|
|
119
123
|
}
|
|
120
124
|
|
|
125
|
+
async function currentGitBranch(workspaceRoot) {
|
|
126
|
+
const result = await git(['branch', '--show-current'], workspaceRoot, { allowFailure: true })
|
|
127
|
+
const branch = result.stdout.toString('utf8').trim()
|
|
128
|
+
if (branch) return branch
|
|
129
|
+
const head = await git(['rev-parse', '--short', 'HEAD'], workspaceRoot, { allowFailure: true })
|
|
130
|
+
const commit = head.stdout.toString('utf8').trim()
|
|
131
|
+
return commit ? `HEAD ${commit}` : undefined
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function countGitStatus(files) {
|
|
135
|
+
return files.reduce((counts, file) => {
|
|
136
|
+
if (file.conflict) counts.conflicts += 1
|
|
137
|
+
else if (file.status === 'untracked') counts.untracked += 1
|
|
138
|
+
else {
|
|
139
|
+
if (file.staged) counts.staged += 1
|
|
140
|
+
if (file.unstaged) counts.unstaged += 1
|
|
141
|
+
}
|
|
142
|
+
counts.total += 1
|
|
143
|
+
return counts
|
|
144
|
+
}, { staged: 0, unstaged: 0, untracked: 0, conflicts: 0, total: 0 })
|
|
145
|
+
}
|
|
146
|
+
|
|
121
147
|
async function listGitStatus(context) {
|
|
122
148
|
if (!(await isGitRepository(context.workspaceRoot))) return { isGitRepository: false, files: [] }
|
|
123
149
|
const result = await git(['status', '--porcelain=v1', '-z'], context.workspaceRoot)
|
|
124
|
-
|
|
150
|
+
const files = parseGitStatus(result.stdout)
|
|
151
|
+
return {
|
|
152
|
+
isGitRepository: true,
|
|
153
|
+
branch: await currentGitBranch(context.workspaceRoot),
|
|
154
|
+
counts: countGitStatus(files),
|
|
155
|
+
files,
|
|
156
|
+
}
|
|
125
157
|
}
|
|
126
158
|
|
|
127
159
|
async function readGitFile(workspaceRoot, ref, relativePath) {
|