diff --git a/package-lock.json b/package-lock.json index 6b6ad853..826c8e5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1140,13 +1140,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/winreg": { - "version": "1.2.36", - "resolved": "https://registry.npmjs.org/@types/winreg/-/winreg-1.2.36.tgz", - "integrity": "sha512-DtafHy5A8hbaosXrbr7YdjQZaqVewXmiasRS5J4tYMzt3s1gkh40ixpxgVFfKiQ0JIYetTJABat47v9cpr/sQg==", - "dev": true, - "license": "MIT" - }, "node_modules/ajv": { "version": "8.17.1", "license": "MIT", @@ -1171,7 +1164,6 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -1203,6 +1195,59 @@ "node": ">= 8" } }, + "node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "license": "ISC" + }, + "node_modules/are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/are-we-there-yet/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/are-we-there-yet/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/are-we-there-yet/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/argparse": { "version": "2.0.1", "dev": true, @@ -1252,6 +1297,24 @@ "dev": true, "license": "MIT" }, + "node_modules/base64-js": { + "version": "1.5.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/binary-extensions": { "version": "2.3.0", "dev": true, @@ -1263,6 +1326,64 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bl/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", @@ -1382,6 +1503,12 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, "node_modules/cliui": { "version": "7.0.4", "dev": true, @@ -1392,6 +1519,15 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "dev": true, @@ -1422,6 +1558,12 @@ "dev": true, "license": "MIT" }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC" + }, "node_modules/conventional-changelog-angular": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", @@ -1537,7 +1679,6 @@ }, "node_modules/core-util-is": { "version": "1.0.3", - "dev": true, "license": "MIT" }, "node_modules/cosmiconfig": { @@ -1639,6 +1780,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "license": "MIT", + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "dev": true, @@ -1671,6 +1833,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "license": "Apache-2.0", + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/diff": { "version": "5.2.0", "dev": true, @@ -1692,14 +1872,12 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, "license": "MIT" }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "license": "MIT", "dependencies": { "once": "^1.4.0" @@ -1763,6 +1941,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "license": "MIT" @@ -1840,6 +2027,12 @@ "is-callable": "^1.1.3" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, "node_modules/fs.realpath": { "version": "1.0.0", "dev": true, @@ -1868,6 +2061,70 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/gauge/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gauge/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "license": "MIT", + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gauge/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "license": "MIT", + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gauge/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "dev": true, @@ -1912,6 +2169,12 @@ "node": ">=16" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, "node_modules/glob": { "version": "8.1.0", "dev": true, @@ -2029,6 +2292,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC" + }, "node_modules/hasown": { "version": "2.0.2", "dev": true, @@ -2069,6 +2338,10 @@ "url": "https://github.com/sponsors/typicode" } }, + "node_modules/ieee754": { + "version": "1.1.13", + "license": "BSD-3-Clause" + }, "node_modules/ignore": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.3.tgz", @@ -2128,7 +2401,6 @@ }, "node_modules/inherits": { "version": "2.0.4", - "dev": true, "license": "ISC" }, "node_modules/ini": { @@ -2223,7 +2495,6 @@ }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -2604,6 +2875,18 @@ "node": ">=8.6" } }, + "node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "5.1.6", "dev": true, @@ -2617,7 +2900,6 @@ }, "node_modules/minimist": { "version": "1.2.8", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2634,6 +2916,12 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, "node_modules/mocha": { "version": "10.8.2", "dev": true, @@ -2690,6 +2978,36 @@ "dev": true, "license": "MIT" }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "license": "MIT" + }, + "node_modules/node-abi": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", + "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", + "license": "MIT", + "dependencies": { + "semver": "^5.4.1" + } + }, + "node_modules/node-abi/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "license": "MIT" + }, "node_modules/node-forge": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz", @@ -2708,6 +3026,12 @@ "readable-stream": "~1.0.31" } }, + "node_modules/noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha512-6kM8CLXvuW5crTxsAtva2YLrRrDaiTIkIePWs9moLHqbFWT94WpNFjwS/5dfLfECg5i/lkmw3aoqVidxt23TEQ==", + "license": "MIT" + }, "node_modules/normalize-path": { "version": "3.0.0", "dev": true, @@ -2716,6 +3040,37 @@ "node": ">=0.10.0" } }, + "node_modules/npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-is": { "version": "1.1.6", "dev": true, @@ -2758,7 +3113,6 @@ }, "node_modules/once": { "version": "1.4.0", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -2894,6 +3248,35 @@ "node": ">= 0.4" } }, + "node_modules/prebuild-install": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", + "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", + "license": "MIT", + "dependencies": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/prettier": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", @@ -2951,7 +3334,6 @@ }, "node_modules/process-nextick-args": { "version": "2.0.1", - "dev": true, "license": "MIT" }, "node_modules/protobufjs": { @@ -2981,7 +3363,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", - "dev": true, "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", @@ -3017,6 +3398,36 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/readable-stream": { "version": "1.0.34", "dev": true, @@ -3051,6 +3462,17 @@ "node": ">= 0.10" } }, + "node_modules/registry-js": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/registry-js/-/registry-js-1.16.1.tgz", + "integrity": "sha512-pQ2kD36lh+YNtpaXm6HCCb0QZtV/zQEeKnkfEIj5FDSpF/oFts7pwizEUkWSvP8IbGb4A4a5iBhhS9eUearMmQ==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^3.2.1", + "prebuild-install": "^5.3.5" + } + }, "node_modules/require-directory": { "version": "2.1.1", "dev": true, @@ -3138,7 +3560,6 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "dev": true, "funding": [ { "type": "github", @@ -3176,6 +3597,12 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, "node_modules/set-function-length": { "version": "1.2.2", "dev": true, @@ -3314,9 +3741,39 @@ }, "node_modules/signal-exit": { "version": "3.0.7", - "dev": true, "license": "ISC" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "license": "MIT", + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/sinon": { "version": "20.0.0", "resolved": "https://registry.npmjs.org/sinon/-/sinon-20.0.0.tgz", @@ -3398,7 +3855,6 @@ }, "node_modules/string-width": { "version": "4.2.3", - "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -3411,7 +3867,6 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -3466,6 +3921,57 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tar-fs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tar-stream/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/text-extensions": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", @@ -3738,6 +4244,18 @@ "version": "2.8.1", "license": "0BSD" }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-detect": { "version": "4.0.8", "dev": true, @@ -3811,7 +4329,6 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "dev": true, "license": "MIT" }, "node_modules/vscode-jsonrpc": { @@ -3866,6 +4383,15 @@ "node": ">= 8" } }, + "node_modules/which-pm-runs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/which-typed-array": { "version": "1.1.16", "dev": true, @@ -3884,6 +4410,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/win-ca": { "version": "3.5.1", "hasInstallScript": true, @@ -3895,12 +4430,6 @@ "split": "^1.0.1" } }, - "node_modules/winreg": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.5.tgz", - "integrity": "sha512-uf7tHf+tw0B1y+x+mKTLHkykBgK2KMs3g+KlzmyMbLvICSHQyB/xOFjTT8qZ3oeTFyU7Bbj4FzXitGG6jvKhYw==", - "license": "BSD-2-Clause" - }, "node_modules/workerpool": { "version": "6.5.1", "dev": true, @@ -3924,7 +4453,6 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "dev": true, "license": "ISC" }, "node_modules/xtend": { @@ -4020,19 +4548,18 @@ "hpagent": "^1.2.0", "jose": "^5.9.6", "mac-ca": "^3.1.1", + "registry-js": "^1.16.1", "rxjs": "^7.8.2", "vscode-languageserver": "^9.0.1", "vscode-languageserver-protocol": "^3.17.5", "vscode-uri": "^3.1.0", - "win-ca": "^3.5.1", - "winreg": "^1.2.5" + "win-ca": "^3.5.1" }, "devDependencies": { "@types/mocha": "^10.0.9", "@types/mock-fs": "^4.13.4", "@types/node": "^22.15.17", "@types/node-forge": "^1.3.11", - "@types/winreg": "^1.2.36", "assert": "^2.0.0", "copyfiles": "^2.4.1", "husky": "^9.1.7", diff --git a/runtimes/package.json b/runtimes/package.json index 0496a2e3..2a58c97f 100644 --- a/runtimes/package.json +++ b/runtimes/package.json @@ -49,14 +49,13 @@ "vscode-languageserver-protocol": "^3.17.5", "vscode-uri": "^3.1.0", "win-ca": "^3.5.1", - "winreg": "^1.2.5" + "registry-js": "^1.16.1" }, "devDependencies": { "@types/mocha": "^10.0.9", "@types/mock-fs": "^4.13.4", "@types/node": "^22.15.17", "@types/node-forge": "^1.3.11", - "@types/winreg": "^1.2.36", "assert": "^2.0.0", "copyfiles": "^2.4.1", "husky": "^9.1.7", diff --git a/runtimes/runtimes/standalone.test.ts b/runtimes/runtimes/standalone.test.ts index b3825a2e..7abc0878 100644 --- a/runtimes/runtimes/standalone.test.ts +++ b/runtimes/runtimes/standalone.test.ts @@ -47,7 +47,7 @@ describe('standalone', () => { let chatStub: sinon.SinonStubbedInstance & encryptedChatModule.EncryptedChat let baseChatStub: sinon.SinonStubbedInstance & baseChatModule.BaseChat - it('should initialize without encryption when no key is present', async () => { + it('should initialize without encryption when no key is present', () => { sinon.stub(authEncryptionModule, 'shouldWaitForEncryptionKey').returns(false) authStub = stubInterface() authStub.getCredentialsProvider.returns({ @@ -61,7 +61,7 @@ describe('standalone', () => { baseChatStub = stubInterface() sinon.stub(baseChatModule, 'BaseChat').returns(baseChatStub) - await standalone(props) + standalone(props) sinon.assert.calledWithExactly(authModule.Auth as unknown as sinon.SinonStub, stubConnection, lspRouterStub) sinon.assert.calledWithExactly( @@ -126,8 +126,8 @@ describe('standalone', () => { describe('features', () => { let features: Features - beforeEach(async () => { - await standalone(props) + beforeEach(() => { + standalone(props) features = stubServer.getCall(0).args[0] }) diff --git a/runtimes/runtimes/standalone.ts b/runtimes/runtimes/standalone.ts index 517931b8..5286c8f2 100644 --- a/runtimes/runtimes/standalone.ts +++ b/runtimes/runtimes/standalone.ts @@ -169,7 +169,7 @@ function setupCrashMonitoring(telemetryEmitter?: (metric: MetricEvent) => void) * @param props.servers The list of servers to initialize and run * @returns */ -export const standalone = async (props: RuntimeProps) => { +export const standalone = (props: RuntimeProps) => { handleVersionArgument(props.version) const lspConnection = createConnection(ProposedFeatures.all) @@ -179,34 +179,40 @@ export const standalone = async (props: RuntimeProps) => { let auth: Auth let chat: Chat - await initializeAuth() + initializeAuth() // Initialize Auth service - async function initializeAuth() { + function initializeAuth() { if (shouldWaitForEncryptionKey()) { // Before starting the runtime, accept encryption initialization details // directly from the destination for standalone runtimes. // Contract: Only read up to (and including) the first newline (\n). - try { - const encryptionDetails: EncryptionInitialization = await readEncryptionDetails(process.stdin) - validateEncryptionDetails(encryptionDetails) - lspConnection.console.info('Runtime: Initializing runtime with encryption') - auth = new Auth(lspConnection, lspRouter, encryptionDetails.key, encryptionDetails.mode) - chat = new EncryptedChat(lspConnection, encryptionDetails.key, encryptionDetails.mode) - await initializeRuntime(encryptionDetails.key) - } catch (error) { - console.error(error) - // arbitrary 5 second timeout to ensure console.error flushes before process exit - // note: webpacked version may output exclusively to stdout, not stderr. - setTimeout(() => { - process.exit(10) - }, 5000) - } + readEncryptionDetails(process.stdin) + .then( + (encryptionDetails: EncryptionInitialization) => { + validateEncryptionDetails(encryptionDetails) + lspConnection.console.info('Runtime: Initializing runtime with encryption') + auth = new Auth(lspConnection, lspRouter, encryptionDetails.key, encryptionDetails.mode) + chat = new EncryptedChat(lspConnection, encryptionDetails.key, encryptionDetails.mode) + initializeRuntime(encryptionDetails.key) + }, + error => { + console.error(error) + // arbitrary 5 second timeout to ensure console.error flushes before process exit + // note: webpacked version may output exclusively to stdout, not stderr. + setTimeout(() => { + process.exit(10) + }, 5000) + } + ) + .catch((error: Error) => { + console.error('Error at runtime initialization:', error.message) + }) } else { lspConnection.console.info('Runtime: Initializing runtime without encryption') auth = new Auth(lspConnection, lspRouter) - await initializeRuntime() + initializeRuntime() } } @@ -214,7 +220,7 @@ export const standalone = async (props: RuntimeProps) => { // TODO: make this dependent on the actual requirements of the // capabilities parameter. - async function initializeRuntime(encryptionKey?: string) { + function initializeRuntime(encryptionKey?: string) { const documents = new TextDocuments(TextDocument) // Set up telemetry over LSP const telemetry: Telemetry = { @@ -367,8 +373,6 @@ export const standalone = async (props: RuntimeProps) => { const agent = newAgent() - const v3ProxyConfig = await sdkProxyConfigManager.getV3ProxyConfig() - // Initialize every Server const disposables = props.servers.map(s => { // Create LSP server representation that holds internal server state @@ -455,7 +459,9 @@ export const standalone = async (props: RuntimeProps) => { current_config: P ): T => { try { - const requestHandler = isExperimentalProxy ? v3ProxyConfig : makeProxyConfigv3Standalone(workspace) + const requestHandler = isExperimentalProxy + ? sdkProxyConfigManager.getV3ProxyConfig() + : makeProxyConfigv3Standalone(workspace) logging.log(`Using ${isExperimentalProxy ? 'experimental' : 'standard'} proxy util`) diff --git a/runtimes/runtimes/util/standalone/experimentalProxyUtil.test.ts b/runtimes/runtimes/util/standalone/experimentalProxyUtil.test.ts index 4df1ecb6..790df3af 100644 --- a/runtimes/runtimes/util/standalone/experimentalProxyUtil.test.ts +++ b/runtimes/runtimes/util/standalone/experimentalProxyUtil.test.ts @@ -53,6 +53,7 @@ describe('ProxyConfigManager', function () { beforeEach(() => { originalEnv = { ...process.env } + process.env = {} telemetryStub = { emitMetric: sinon.stub(), @@ -71,16 +72,16 @@ describe('ProxyConfigManager', function () { mockFs.restore() }) - it('should cache and return same V3 config', async () => { - const config1 = await proxyManager.getV3ProxyConfig() - const config2 = await proxyManager.getV3ProxyConfig() + it('should cache and return same V3 config', () => { + const config1 = proxyManager.getV3ProxyConfig() + const config2 = proxyManager.getV3ProxyConfig() assert.strictEqual(config1, config2) }) - it('should use secure agent for V3 config', async () => { + it('should use secure agent for V3 config', () => { const getAgentSpy = sinon.spy(proxyManager, 'getSecureAgent') - await proxyManager.getV3ProxyConfig() + proxyManager.getV3ProxyConfig() assert(getAgentSpy.calledOnce) }) @@ -263,8 +264,8 @@ describe('ProxyConfigManager', function () { readLinuxCertificatesStub.returns(sysCerts) }) - it('should create HttpsAgent when no proxy set', async () => { - const agent = await proxyManager.createSecureAgent() + it('should create HttpsAgent when no proxy set', () => { + const agent = proxyManager.createSecureAgent() assert(agent instanceof HttpsAgent) assert.strictEqual((agent as HttpsAgent).options.rejectUnauthorized, true) @@ -283,9 +284,9 @@ describe('ProxyConfigManager', function () { ) }) - it('should create HttpsProxyAgent when proxy set', async () => { + it('should create HttpsProxyAgent when proxy set', () => { process.env.HTTPS_PROXY = 'https://proxy' - const agent = await proxyManager.createSecureAgent() + const agent = proxyManager.createSecureAgent() assert(agent instanceof HttpsProxyAgent) assert.strictEqual(agent.options.rejectUnauthorized, true) diff --git a/runtimes/runtimes/util/standalone/experimentalProxyUtil.ts b/runtimes/runtimes/util/standalone/experimentalProxyUtil.ts index d5333dab..67d43749 100644 --- a/runtimes/runtimes/util/standalone/experimentalProxyUtil.ts +++ b/runtimes/runtimes/util/standalone/experimentalProxyUtil.ts @@ -25,16 +25,16 @@ export class ProxyConfigManager { constructor(private readonly telemetry: Telemetry) {} - async getSecureAgent(): Promise { + getSecureAgent(): HttpsAgent | HttpsProxyAgent { if (!this.cachedAgent) { - this.cachedAgent = await this.createSecureAgent() + this.cachedAgent = this.createSecureAgent() } return this.cachedAgent } - public async getV3ProxyConfig(): Promise { + public getV3ProxyConfig(): NodeHttpHandler { if (!this.cachedV3Config) { - const agent = await this.getSecureAgent() + const agent = this.getSecureAgent() this.cachedV3Config = new NodeHttpHandler({ httpAgent: agent, httpsAgent: agent, @@ -57,12 +57,12 @@ export class ProxyConfigManager { return undefined } - private static async getSystemProxy(): Promise { + private static getSystemProxy(): string | undefined { switch (process.platform) { case 'darwin': return getMacSystemProxy()?.proxyUrl case 'win32': - return (await getWindowsSystemProxy())?.proxyUrl + return getWindowsSystemProxy()?.proxyUrl default: return undefined } @@ -166,7 +166,7 @@ export class ProxyConfigManager { * * @returns {HttpsAgent | HttpsProxyAgent} */ - async createSecureAgent(): Promise { + createSecureAgent(): HttpsAgent | HttpsProxyAgent { const certs = this.getCertificates() const agentOptions = { ca: certs, @@ -184,7 +184,7 @@ export class ProxyConfigManager { } // Fall back to OS auto‑detect (HTTP or HTTPS only) - const sysProxyUrl = await ProxyConfigManager.getSystemProxy() + const sysProxyUrl = ProxyConfigManager.getSystemProxy() if (sysProxyUrl) { this.emitProxyMetric('AutoDetect', certs.length, sysProxyUrl) return new HttpsProxyAgent({ ...agentOptions, proxy: sysProxyUrl }) diff --git a/runtimes/runtimes/util/standalone/getProxySettings/getWindowsProxySettings.test.ts b/runtimes/runtimes/util/standalone/getProxySettings/getWindowsProxySettings.test.ts index afdb202e..3e38afe6 100644 --- a/runtimes/runtimes/util/standalone/getProxySettings/getWindowsProxySettings.test.ts +++ b/runtimes/runtimes/util/standalone/getProxySettings/getWindowsProxySettings.test.ts @@ -6,10 +6,10 @@ import * as assert from 'assert' import { getWindowsSystemProxy } from './getWindowsProxySettings' describe('getWindowsSystemProxy', () => { - it('can get the Windows system proxy', async function () { + it('can get the Windows system proxy', function () { if (process.platform !== 'win32') return this.skip() - const result = await getWindowsSystemProxy() + const result = getWindowsSystemProxy() assert.ok(result === undefined || (typeof result === 'object' && result !== null)) if (result) { @@ -18,15 +18,15 @@ describe('getWindowsSystemProxy', () => { } }) - it('returns undefined on non-Windows platforms', async function () { + it('returns undefined on non-Windows platforms', function () { if (process.platform === 'win32') return this.skip() - const result = await getWindowsSystemProxy() + const result = getWindowsSystemProxy() assert.strictEqual(result, undefined) }) - it('handles registry access failure gracefully', async function () { + it('handles registry access failure gracefully', function () { // This test verifies the function doesn't throw - assert.doesNotThrow(async () => await getWindowsSystemProxy()) + assert.doesNotThrow(() => getWindowsSystemProxy()) }) }) diff --git a/runtimes/runtimes/util/standalone/getProxySettings/getWindowsProxySettings.ts b/runtimes/runtimes/util/standalone/getProxySettings/getWindowsProxySettings.ts index a11ab428..7ba6c951 100644 --- a/runtimes/runtimes/util/standalone/getProxySettings/getWindowsProxySettings.ts +++ b/runtimes/runtimes/util/standalone/getProxySettings/getWindowsProxySettings.ts @@ -5,73 +5,36 @@ * Based on windows-system-proxy 1.0.0 (Apache-2.0). Modified for synchronous use * https://github.com/httptoolkit/windows-system-proxy/blob/main/src/index.ts */ -import winreg from 'winreg' +import { enumerateValues, HKEY, RegistryValue } from 'registry-js' export interface ProxyConfig { proxyUrl: string noProxy: string[] } -const KEY_PROXY_ENABLE = 'ProxyEnable' -const KEY_PROXY_SERVER = 'ProxyServer' -const KEY_PROXY_OVERRIDE = 'ProxyOverride' - -type WindowsProxyRegistryKeys = { - proxyEnable: string | undefined - proxyServer: string | undefined - proxyOverride: string | undefined -} - -function readWindowsRegistry(): Promise { - return new Promise((resolve, reject) => { - const regKey = new winreg({ - hive: winreg.HKCU, - key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings', - }) - - regKey.values((err: Error, items: winreg.RegistryItem[]) => { - if (err) { - console.warn('', err.message) - resolve({ - proxyEnable: undefined, - proxyServer: undefined, - proxyOverride: undefined, - }) - return - } - - const results: Record = {} - - items.forEach((item: winreg.RegistryItem) => { - results[item.name] = item.value as string - }) - - resolve({ - proxyEnable: results[KEY_PROXY_ENABLE], - proxyServer: results[KEY_PROXY_SERVER], - proxyOverride: results[KEY_PROXY_OVERRIDE], - }) - }) - }) -} +export function getWindowsSystemProxy(): ProxyConfig | undefined { + const proxyValues = enumerateValues( + HKEY.HKEY_CURRENT_USER, + 'Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings' + ) + console.debug(`Retrieved ${proxyValues.length} registry values for proxy settings`) -export async function getWindowsSystemProxy(): Promise { - const registryValues = await readWindowsRegistry() - const proxyEnabled = registryValues.proxyEnable - const proxyServer = registryValues.proxyServer - const proxyOverride = registryValues.proxyOverride + const proxyEnabled = getValue(proxyValues, 'ProxyEnable') + const proxyServer = getValue(proxyValues, 'ProxyServer') - if (!proxyEnabled || !proxyServer) { + if (!proxyEnabled || !proxyEnabled.data || !proxyServer || !proxyServer.data) { console.debug('Proxy not enabled or server not configured') return undefined } + // Build noProxy list from ProxyOverride (semicolon-separated, with → localhost,127.0.0.1,::1) + const proxyOverride = getValue(proxyValues, 'ProxyOverride')?.data const noProxy = (proxyOverride ? (proxyOverride as string).split(';') : []).flatMap(host => host === '' ? ['localhost', '127.0.0.1', '::1'] : [host] ) // Parse proxy configuration which can be in multiple formats - const proxyConfigString = proxyServer + const proxyConfigString = proxyServer.data as string if (proxyConfigString.startsWith('http://') || proxyConfigString.startsWith('https://')) { console.debug('Using full URL format proxy configuration') @@ -115,3 +78,5 @@ export async function getWindowsSystemProxy(): Promise } } } + +const getValue = (values: readonly RegistryValue[], name: string) => values.find(value => value?.name === name)