claude-use 9.4.0 → 9.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +198 -168
- package/dist/index.cjs +8 -4
- package/dist/index.mjs +8 -4
- package/dist/types/index.d.ts +4 -4
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -20585,7 +20585,7 @@ var require_snippet = __commonJS({
|
|
|
20585
20585
|
"node_modules/.pnpm/js-yaml@4.3.2/node_modules/js-yaml/lib/snippet.js"(exports2, module2) {
|
|
20586
20586
|
"use strict";
|
|
20587
20587
|
var common = require_common();
|
|
20588
|
-
function getLine(
|
|
20588
|
+
function getLine(buffer2, lineStart, lineEnd, position, maxLineLength) {
|
|
20589
20589
|
let head = "";
|
|
20590
20590
|
let tail = "";
|
|
20591
20591
|
const maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
@@ -20598,7 +20598,7 @@ var require_snippet = __commonJS({
|
|
|
20598
20598
|
lineEnd = position + maxHalfLength - tail.length;
|
|
20599
20599
|
}
|
|
20600
20600
|
return {
|
|
20601
|
-
str: head +
|
|
20601
|
+
str: head + buffer2.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
|
|
20602
20602
|
pos: position - lineStart + head.length
|
|
20603
20603
|
// relative position
|
|
20604
20604
|
};
|
|
@@ -23828,14 +23828,14 @@ var require_util = __commonJS({
|
|
|
23828
23828
|
}, source);
|
|
23829
23829
|
}
|
|
23830
23830
|
exports2.getPropertyByPath = getPropertyByPath;
|
|
23831
|
-
function decodeFileContent(
|
|
23832
|
-
if (
|
|
23833
|
-
return new TextDecoder("utf-16le").decode(
|
|
23831
|
+
function decodeFileContent(buffer2) {
|
|
23832
|
+
if (buffer2[0] === 255 && buffer2[1] === 254) {
|
|
23833
|
+
return new TextDecoder("utf-16le").decode(buffer2);
|
|
23834
23834
|
}
|
|
23835
|
-
if (
|
|
23836
|
-
return new TextDecoder("utf-16be").decode(
|
|
23835
|
+
if (buffer2[0] === 254 && buffer2[1] === 255) {
|
|
23836
|
+
return new TextDecoder("utf-16be").decode(buffer2);
|
|
23837
23837
|
}
|
|
23838
|
-
return
|
|
23838
|
+
return buffer2.toString("utf-8");
|
|
23839
23839
|
}
|
|
23840
23840
|
exports2.decodeFileContent = decodeFileContent;
|
|
23841
23841
|
function removeUndefinedValuesFromObject(options) {
|
|
@@ -33224,7 +33224,7 @@ var init_package = __esm({
|
|
|
33224
33224
|
"package.json"() {
|
|
33225
33225
|
package_default = {
|
|
33226
33226
|
name: "claude-use",
|
|
33227
|
-
version: "9.4.
|
|
33227
|
+
version: "9.4.2",
|
|
33228
33228
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
33229
33229
|
license: "MIT",
|
|
33230
33230
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -35947,11 +35947,11 @@ var require_constants2 = __commonJS({
|
|
|
35947
35947
|
var wellknownHeaderNameBuffers = {};
|
|
35948
35948
|
Object.setPrototypeOf(wellknownHeaderNameBuffers, null);
|
|
35949
35949
|
function getHeaderNameAsBuffer(header) {
|
|
35950
|
-
let
|
|
35951
|
-
if (
|
|
35952
|
-
|
|
35950
|
+
let buffer2 = wellknownHeaderNameBuffers[header];
|
|
35951
|
+
if (buffer2 === void 0) {
|
|
35952
|
+
buffer2 = Buffer.from(header);
|
|
35953
35953
|
}
|
|
35954
|
-
return
|
|
35954
|
+
return buffer2;
|
|
35955
35955
|
}
|
|
35956
35956
|
for (let i10 = 0; i10 < wellknownHeaderNames.length; ++i10) {
|
|
35957
35957
|
const key = wellknownHeaderNames[i10];
|
|
@@ -36382,8 +36382,8 @@ var require_util2 = __commonJS({
|
|
|
36382
36382
|
}
|
|
36383
36383
|
return headers.map((x) => Buffer.from(x));
|
|
36384
36384
|
}
|
|
36385
|
-
function isBuffer(
|
|
36386
|
-
return
|
|
36385
|
+
function isBuffer(buffer2) {
|
|
36386
|
+
return buffer2 instanceof Uint8Array || Buffer.isBuffer(buffer2);
|
|
36387
36387
|
}
|
|
36388
36388
|
function assertRequestHandler(handler, method, upgrade) {
|
|
36389
36389
|
if (!handler || typeof handler !== "object") {
|
|
@@ -38984,14 +38984,14 @@ var require_encoding = __commonJS({
|
|
|
38984
38984
|
"node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/encoding/index.js"(exports2, module2) {
|
|
38985
38985
|
"use strict";
|
|
38986
38986
|
var textDecoder = new TextDecoder();
|
|
38987
|
-
function utf8DecodeBytes(
|
|
38988
|
-
if (
|
|
38987
|
+
function utf8DecodeBytes(buffer2) {
|
|
38988
|
+
if (buffer2.length === 0) {
|
|
38989
38989
|
return "";
|
|
38990
38990
|
}
|
|
38991
|
-
if (
|
|
38992
|
-
|
|
38991
|
+
if (buffer2[0] === 239 && buffer2[1] === 187 && buffer2[2] === 191) {
|
|
38992
|
+
buffer2 = buffer2.subarray(3);
|
|
38993
38993
|
}
|
|
38994
|
-
const output2 = textDecoder.decode(
|
|
38994
|
+
const output2 = textDecoder.decode(buffer2);
|
|
38995
38995
|
return output2;
|
|
38996
38996
|
}
|
|
38997
38997
|
module2.exports = {
|
|
@@ -39042,8 +39042,8 @@ var require_infra = __commonJS({
|
|
|
39042
39042
|
if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {
|
|
39043
39043
|
return "failure";
|
|
39044
39044
|
}
|
|
39045
|
-
const
|
|
39046
|
-
return new Uint8Array(
|
|
39045
|
+
const buffer2 = Buffer.from(data, "base64");
|
|
39046
|
+
return new Uint8Array(buffer2.buffer, buffer2.byteOffset, buffer2.byteLength);
|
|
39047
39047
|
}
|
|
39048
39048
|
function isASCIIWhitespace(char) {
|
|
39049
39049
|
return char === 9 || // \t
|
|
@@ -41309,12 +41309,12 @@ var require_formdata_parser = __commonJS({
|
|
|
41309
41309
|
}
|
|
41310
41310
|
return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1);
|
|
41311
41311
|
}
|
|
41312
|
-
function bufferStartsWith(
|
|
41313
|
-
if (
|
|
41312
|
+
function bufferStartsWith(buffer2, start, position) {
|
|
41313
|
+
if (buffer2.length < start.length) {
|
|
41314
41314
|
return false;
|
|
41315
41315
|
}
|
|
41316
41316
|
for (let i10 = 0; i10 < start.length; i10++) {
|
|
41317
|
-
if (start[i10] !==
|
|
41317
|
+
if (start[i10] !== buffer2[position.position + i10]) {
|
|
41318
41318
|
return false;
|
|
41319
41319
|
}
|
|
41320
41320
|
}
|
|
@@ -42739,14 +42739,14 @@ upgrade: ${upgrade}\r
|
|
|
42739
42739
|
if (contentLength != null && contentLength !== body.size) {
|
|
42740
42740
|
throw new RequestContentLengthMismatchError();
|
|
42741
42741
|
}
|
|
42742
|
-
const
|
|
42742
|
+
const buffer2 = Buffer.from(await body.arrayBuffer());
|
|
42743
42743
|
socket.cork();
|
|
42744
42744
|
socket.write(`${header}content-length: ${contentLength}\r
|
|
42745
42745
|
\r
|
|
42746
42746
|
`, "latin1");
|
|
42747
|
-
socket.write(
|
|
42747
|
+
socket.write(buffer2);
|
|
42748
42748
|
socket.uncork();
|
|
42749
|
-
request7.onBodySent(
|
|
42749
|
+
request7.onBodySent(buffer2);
|
|
42750
42750
|
request7.onRequestSent();
|
|
42751
42751
|
if (!expectsPayload && request7.reset !== false) {
|
|
42752
42752
|
socket[kReset] = true;
|
|
@@ -43622,12 +43622,12 @@ var require_client_h2 = __commonJS({
|
|
|
43622
43622
|
if (contentLength != null && contentLength !== body.size) {
|
|
43623
43623
|
throw new RequestContentLengthMismatchError();
|
|
43624
43624
|
}
|
|
43625
|
-
const
|
|
43625
|
+
const buffer2 = Buffer.from(await body.arrayBuffer());
|
|
43626
43626
|
h2stream.cork();
|
|
43627
|
-
h2stream.write(
|
|
43627
|
+
h2stream.write(buffer2);
|
|
43628
43628
|
h2stream.uncork();
|
|
43629
43629
|
h2stream.end();
|
|
43630
|
-
request7.onBodySent(
|
|
43630
|
+
request7.onBodySent(buffer2);
|
|
43631
43631
|
request7.onRequestSent();
|
|
43632
43632
|
if (!expectsPayload) {
|
|
43633
43633
|
socket[kReset] = true;
|
|
@@ -44997,7 +44997,7 @@ var require_socks5_utils = __commonJS({
|
|
|
44997
44997
|
};
|
|
44998
44998
|
}
|
|
44999
44999
|
function parseIPv6(address) {
|
|
45000
|
-
const
|
|
45000
|
+
const buffer2 = Buffer3.alloc(16);
|
|
45001
45001
|
let normalizedAddress = address;
|
|
45002
45002
|
if (address.includes(".")) {
|
|
45003
45003
|
const lastColonIndex = address.lastIndexOf(":");
|
|
@@ -45017,21 +45017,21 @@ var require_socks5_utils = __commonJS({
|
|
|
45017
45017
|
const afterParts = after === "" ? [] : after.split(":");
|
|
45018
45018
|
let bufferIndex = 0;
|
|
45019
45019
|
for (const part of beforeParts) {
|
|
45020
|
-
|
|
45020
|
+
buffer2.writeUInt16BE(parseInt(part, 16), bufferIndex);
|
|
45021
45021
|
bufferIndex += 2;
|
|
45022
45022
|
}
|
|
45023
45023
|
bufferIndex = 16 - afterParts.length * 2;
|
|
45024
45024
|
for (const part of afterParts) {
|
|
45025
|
-
|
|
45025
|
+
buffer2.writeUInt16BE(parseInt(part, 16), bufferIndex);
|
|
45026
45026
|
bufferIndex += 2;
|
|
45027
45027
|
}
|
|
45028
45028
|
} else {
|
|
45029
45029
|
const parts = normalizedAddress.split(":");
|
|
45030
45030
|
for (let i10 = 0; i10 < parts.length; i10++) {
|
|
45031
|
-
|
|
45031
|
+
buffer2.writeUInt16BE(parseInt(parts[i10], 16), i10 * 2);
|
|
45032
45032
|
}
|
|
45033
45033
|
}
|
|
45034
|
-
return
|
|
45034
|
+
return buffer2;
|
|
45035
45035
|
}
|
|
45036
45036
|
function buildAddressBuffer(type2, addressBuffer, port) {
|
|
45037
45037
|
const portBuffer = Buffer3.allocUnsafe(2);
|
|
@@ -45042,42 +45042,42 @@ var require_socks5_utils = __commonJS({
|
|
|
45042
45042
|
portBuffer
|
|
45043
45043
|
]);
|
|
45044
45044
|
}
|
|
45045
|
-
function parseResponseAddress(
|
|
45046
|
-
if (
|
|
45045
|
+
function parseResponseAddress(buffer2, offset = 0) {
|
|
45046
|
+
if (buffer2.length < offset + 1) {
|
|
45047
45047
|
throw new InvalidArgumentError2("Buffer too small to contain address type");
|
|
45048
45048
|
}
|
|
45049
|
-
const addressType =
|
|
45049
|
+
const addressType = buffer2[offset];
|
|
45050
45050
|
let address;
|
|
45051
45051
|
let currentOffset = offset + 1;
|
|
45052
45052
|
switch (addressType) {
|
|
45053
45053
|
case 1: {
|
|
45054
|
-
if (
|
|
45054
|
+
if (buffer2.length < currentOffset + 6) {
|
|
45055
45055
|
throw new InvalidArgumentError2("Buffer too small for IPv4 address");
|
|
45056
45056
|
}
|
|
45057
|
-
address = Array.from(
|
|
45057
|
+
address = Array.from(buffer2.subarray(currentOffset, currentOffset + 4)).join(".");
|
|
45058
45058
|
currentOffset += 4;
|
|
45059
45059
|
break;
|
|
45060
45060
|
}
|
|
45061
45061
|
case 3: {
|
|
45062
|
-
if (
|
|
45062
|
+
if (buffer2.length < currentOffset + 1) {
|
|
45063
45063
|
throw new InvalidArgumentError2("Buffer too small for domain length");
|
|
45064
45064
|
}
|
|
45065
|
-
const domainLength =
|
|
45065
|
+
const domainLength = buffer2[currentOffset];
|
|
45066
45066
|
currentOffset += 1;
|
|
45067
|
-
if (
|
|
45067
|
+
if (buffer2.length < currentOffset + domainLength + 2) {
|
|
45068
45068
|
throw new InvalidArgumentError2("Buffer too small for domain address");
|
|
45069
45069
|
}
|
|
45070
|
-
address =
|
|
45070
|
+
address = buffer2.subarray(currentOffset, currentOffset + domainLength).toString("utf8");
|
|
45071
45071
|
currentOffset += domainLength;
|
|
45072
45072
|
break;
|
|
45073
45073
|
}
|
|
45074
45074
|
case 4: {
|
|
45075
|
-
if (
|
|
45075
|
+
if (buffer2.length < currentOffset + 18) {
|
|
45076
45076
|
throw new InvalidArgumentError2("Buffer too small for IPv6 address");
|
|
45077
45077
|
}
|
|
45078
45078
|
const parts = [];
|
|
45079
45079
|
for (let i10 = 0; i10 < 8; i10++) {
|
|
45080
|
-
const value2 =
|
|
45080
|
+
const value2 = buffer2.readUInt16BE(currentOffset + i10 * 2);
|
|
45081
45081
|
parts.push(value2.toString(16));
|
|
45082
45082
|
}
|
|
45083
45083
|
address = parts.join(":");
|
|
@@ -45087,10 +45087,10 @@ var require_socks5_utils = __commonJS({
|
|
|
45087
45087
|
default:
|
|
45088
45088
|
throw new InvalidArgumentError2(`Invalid address type: ${addressType}`);
|
|
45089
45089
|
}
|
|
45090
|
-
if (
|
|
45090
|
+
if (buffer2.length < currentOffset + 2) {
|
|
45091
45091
|
throw new InvalidArgumentError2("Buffer too small for port");
|
|
45092
45092
|
}
|
|
45093
|
-
const port =
|
|
45093
|
+
const port = buffer2.readUInt16BE(currentOffset);
|
|
45094
45094
|
currentOffset += 2;
|
|
45095
45095
|
return {
|
|
45096
45096
|
address,
|
|
@@ -46803,13 +46803,13 @@ var require_readable = __commonJS({
|
|
|
46803
46803
|
if (chunks.length === 0 || length === 0) {
|
|
46804
46804
|
return "";
|
|
46805
46805
|
}
|
|
46806
|
-
const
|
|
46807
|
-
const bufferLength =
|
|
46808
|
-
const start = bufferLength > 2 &&
|
|
46806
|
+
const buffer2 = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length);
|
|
46807
|
+
const bufferLength = buffer2.length;
|
|
46808
|
+
const start = bufferLength > 2 && buffer2[0] === 239 && buffer2[1] === 187 && buffer2[2] === 191 ? 3 : 0;
|
|
46809
46809
|
if (!encoding || encoding === "utf8" || encoding === "utf-8") {
|
|
46810
|
-
return
|
|
46810
|
+
return buffer2.utf8Slice(start, bufferLength);
|
|
46811
46811
|
} else {
|
|
46812
|
-
return
|
|
46812
|
+
return buffer2.subarray(start, bufferLength).toString(encoding);
|
|
46813
46813
|
}
|
|
46814
46814
|
}
|
|
46815
46815
|
function chunksConcat(chunks, length) {
|
|
@@ -46819,14 +46819,14 @@ var require_readable = __commonJS({
|
|
|
46819
46819
|
if (chunks.length === 1) {
|
|
46820
46820
|
return new Uint8Array(chunks[0]);
|
|
46821
46821
|
}
|
|
46822
|
-
const
|
|
46822
|
+
const buffer2 = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer);
|
|
46823
46823
|
let offset = 0;
|
|
46824
46824
|
for (let i10 = 0; i10 < chunks.length; ++i10) {
|
|
46825
46825
|
const chunk = chunks[i10];
|
|
46826
|
-
|
|
46826
|
+
buffer2.set(chunk, offset);
|
|
46827
46827
|
offset += chunk.length;
|
|
46828
46828
|
}
|
|
46829
|
-
return
|
|
46829
|
+
return buffer2;
|
|
46830
46830
|
}
|
|
46831
46831
|
function consumeEnd(consume2, encoding) {
|
|
46832
46832
|
const { type: type2, body, resolve: resolve2, stream, length } = consume2;
|
|
@@ -56525,9 +56525,9 @@ var require_fetch = __commonJS({
|
|
|
56525
56525
|
fetchParams.controller.terminate(bytes);
|
|
56526
56526
|
return;
|
|
56527
56527
|
}
|
|
56528
|
-
const
|
|
56529
|
-
if (
|
|
56530
|
-
fetchParams.controller.controller.enqueue(
|
|
56528
|
+
const buffer2 = new Uint8Array(bytes);
|
|
56529
|
+
if (buffer2.byteLength) {
|
|
56530
|
+
fetchParams.controller.controller.enqueue(buffer2);
|
|
56531
56531
|
}
|
|
56532
56532
|
if (isErrored(stream)) {
|
|
56533
56533
|
fetchParams.controller.terminate();
|
|
@@ -58279,11 +58279,11 @@ var require_util6 = __commonJS({
|
|
|
58279
58279
|
function websocketMessageReceived(handler, type2, data) {
|
|
58280
58280
|
handler.onMessage(type2, data);
|
|
58281
58281
|
}
|
|
58282
|
-
function toArrayBuffer(
|
|
58283
|
-
if (
|
|
58284
|
-
return
|
|
58282
|
+
function toArrayBuffer(buffer2) {
|
|
58283
|
+
if (buffer2.byteLength === buffer2.buffer.byteLength) {
|
|
58284
|
+
return buffer2.buffer;
|
|
58285
58285
|
}
|
|
58286
|
-
return new Uint8Array(
|
|
58286
|
+
return new Uint8Array(buffer2).buffer;
|
|
58287
58287
|
}
|
|
58288
58288
|
function isValidSubprotocol(protocol) {
|
|
58289
58289
|
if (protocol.length === 0) {
|
|
@@ -58399,9 +58399,9 @@ var require_util6 = __commonJS({
|
|
|
58399
58399
|
const fatalDecoder = new TextDecoder("utf-8", { fatal: true });
|
|
58400
58400
|
return fatalDecoder.decode.bind(fatalDecoder);
|
|
58401
58401
|
}
|
|
58402
|
-
return function(
|
|
58403
|
-
if (isUtf8(
|
|
58404
|
-
return
|
|
58402
|
+
return function(buffer2) {
|
|
58403
|
+
if (isUtf8(buffer2)) {
|
|
58404
|
+
return buffer2.toString("utf-8");
|
|
58405
58405
|
}
|
|
58406
58406
|
throw new TypeError("Invalid utf-8 received.");
|
|
58407
58407
|
};
|
|
@@ -58436,20 +58436,20 @@ var require_frame = __commonJS({
|
|
|
58436
58436
|
var { runtimeFeatures } = require_runtime_features();
|
|
58437
58437
|
var { maxUnsigned16Bit, opcodes } = require_constants6();
|
|
58438
58438
|
var BUFFER_SIZE = 8 * 1024;
|
|
58439
|
-
var
|
|
58439
|
+
var buffer2 = null;
|
|
58440
58440
|
var bufIdx = BUFFER_SIZE;
|
|
58441
|
-
var randomFillSync = runtimeFeatures.has("crypto") ? require("node:crypto").randomFillSync : function randomFillSync2(
|
|
58442
|
-
for (let i10 = 0; i10 <
|
|
58443
|
-
|
|
58441
|
+
var randomFillSync = runtimeFeatures.has("crypto") ? require("node:crypto").randomFillSync : function randomFillSync2(buffer3, _offset, _size2) {
|
|
58442
|
+
for (let i10 = 0; i10 < buffer3.length; ++i10) {
|
|
58443
|
+
buffer3[i10] = Math.random() * 255 | 0;
|
|
58444
58444
|
}
|
|
58445
|
-
return
|
|
58445
|
+
return buffer3;
|
|
58446
58446
|
};
|
|
58447
58447
|
function generateMask() {
|
|
58448
58448
|
if (bufIdx === BUFFER_SIZE) {
|
|
58449
58449
|
bufIdx = 0;
|
|
58450
|
-
randomFillSync(
|
|
58450
|
+
randomFillSync(buffer2 ??= Buffer.allocUnsafeSlow(BUFFER_SIZE), 0, BUFFER_SIZE);
|
|
58451
58451
|
}
|
|
58452
|
-
return [
|
|
58452
|
+
return [buffer2[bufIdx++], buffer2[bufIdx++], buffer2[bufIdx++], buffer2[bufIdx++]];
|
|
58453
58453
|
}
|
|
58454
58454
|
var WebsocketFrameSend = class {
|
|
58455
58455
|
/**
|
|
@@ -58471,35 +58471,35 @@ var require_frame = __commonJS({
|
|
|
58471
58471
|
offset += 2;
|
|
58472
58472
|
payloadLength = 126;
|
|
58473
58473
|
}
|
|
58474
|
-
const
|
|
58475
|
-
|
|
58476
|
-
|
|
58477
|
-
|
|
58478
|
-
|
|
58479
|
-
|
|
58480
|
-
|
|
58481
|
-
|
|
58482
|
-
|
|
58474
|
+
const buffer3 = Buffer.allocUnsafe(bodyLength + offset);
|
|
58475
|
+
buffer3[0] = buffer3[1] = 0;
|
|
58476
|
+
buffer3[0] |= 128;
|
|
58477
|
+
buffer3[0] = (buffer3[0] & 240) + opcode;
|
|
58478
|
+
buffer3[offset - 4] = maskKey[0];
|
|
58479
|
+
buffer3[offset - 3] = maskKey[1];
|
|
58480
|
+
buffer3[offset - 2] = maskKey[2];
|
|
58481
|
+
buffer3[offset - 1] = maskKey[3];
|
|
58482
|
+
buffer3[1] = payloadLength;
|
|
58483
58483
|
if (payloadLength === 126) {
|
|
58484
|
-
|
|
58484
|
+
buffer3.writeUInt16BE(bodyLength, 2);
|
|
58485
58485
|
} else if (payloadLength === 127) {
|
|
58486
|
-
|
|
58487
|
-
|
|
58486
|
+
buffer3[2] = buffer3[3] = 0;
|
|
58487
|
+
buffer3.writeUIntBE(bodyLength, 4, 6);
|
|
58488
58488
|
}
|
|
58489
|
-
|
|
58489
|
+
buffer3[1] |= 128;
|
|
58490
58490
|
for (let i10 = 0; i10 < bodyLength; ++i10) {
|
|
58491
|
-
|
|
58491
|
+
buffer3[offset + i10] = frameData[i10] ^ maskKey[i10 & 3];
|
|
58492
58492
|
}
|
|
58493
|
-
return
|
|
58493
|
+
return buffer3;
|
|
58494
58494
|
}
|
|
58495
58495
|
/**
|
|
58496
58496
|
* @param {Uint8Array} buffer
|
|
58497
58497
|
*/
|
|
58498
|
-
static createFastTextFrame(
|
|
58498
|
+
static createFastTextFrame(buffer3) {
|
|
58499
58499
|
const maskKey = generateMask();
|
|
58500
|
-
const bodyLength =
|
|
58500
|
+
const bodyLength = buffer3.length;
|
|
58501
58501
|
for (let i10 = 0; i10 < bodyLength; ++i10) {
|
|
58502
|
-
|
|
58502
|
+
buffer3[i10] ^= maskKey[i10 & 3];
|
|
58503
58503
|
}
|
|
58504
58504
|
let payloadLength = bodyLength;
|
|
58505
58505
|
let offset = 6;
|
|
@@ -58523,7 +58523,7 @@ var require_frame = __commonJS({
|
|
|
58523
58523
|
head[2] = head[3] = 0;
|
|
58524
58524
|
head.writeUIntBE(bodyLength, 4, 6);
|
|
58525
58525
|
}
|
|
58526
|
-
return [head,
|
|
58526
|
+
return [head, buffer3];
|
|
58527
58527
|
}
|
|
58528
58528
|
};
|
|
58529
58529
|
module2.exports = {
|
|
@@ -58851,15 +58851,15 @@ var require_receiver = __commonJS({
|
|
|
58851
58851
|
if (this.#byteOffset < 2) {
|
|
58852
58852
|
return callback();
|
|
58853
58853
|
}
|
|
58854
|
-
const
|
|
58855
|
-
const fin = (
|
|
58856
|
-
const opcode =
|
|
58857
|
-
const masked = (
|
|
58854
|
+
const buffer2 = this.consume(2);
|
|
58855
|
+
const fin = (buffer2[0] & 128) !== 0;
|
|
58856
|
+
const opcode = buffer2[0] & 15;
|
|
58857
|
+
const masked = (buffer2[1] & 128) === 128;
|
|
58858
58858
|
const fragmented = !fin && opcode !== opcodes.CONTINUATION;
|
|
58859
|
-
const payloadLength =
|
|
58860
|
-
const rsv1 =
|
|
58861
|
-
const rsv2 =
|
|
58862
|
-
const rsv3 =
|
|
58859
|
+
const payloadLength = buffer2[1] & 127;
|
|
58860
|
+
const rsv1 = buffer2[0] & 64;
|
|
58861
|
+
const rsv2 = buffer2[0] & 32;
|
|
58862
|
+
const rsv3 = buffer2[0] & 16;
|
|
58863
58863
|
if (!isValidOpcode(opcode)) {
|
|
58864
58864
|
failWebsocketConnection(this.#handler, 1002, "Invalid opcode received");
|
|
58865
58865
|
return callback();
|
|
@@ -58919,8 +58919,8 @@ var require_receiver = __commonJS({
|
|
|
58919
58919
|
if (this.#byteOffset < 2) {
|
|
58920
58920
|
return callback();
|
|
58921
58921
|
}
|
|
58922
|
-
const
|
|
58923
|
-
this.#info.payloadLength =
|
|
58922
|
+
const buffer2 = this.consume(2);
|
|
58923
|
+
this.#info.payloadLength = buffer2.readUInt16BE(0);
|
|
58924
58924
|
this.#state = parserStates.READ_DATA;
|
|
58925
58925
|
if (!this.#validatePayloadLength()) {
|
|
58926
58926
|
return;
|
|
@@ -58929,9 +58929,9 @@ var require_receiver = __commonJS({
|
|
|
58929
58929
|
if (this.#byteOffset < 8) {
|
|
58930
58930
|
return callback();
|
|
58931
58931
|
}
|
|
58932
|
-
const
|
|
58933
|
-
const upper =
|
|
58934
|
-
const lower =
|
|
58932
|
+
const buffer2 = this.consume(8);
|
|
58933
|
+
const upper = buffer2.readUInt32BE(0);
|
|
58934
|
+
const lower = buffer2.readUInt32BE(4);
|
|
58935
58935
|
if (upper !== 0 || lower > 2 ** 31 - 1) {
|
|
58936
58936
|
failWebsocketConnection(this.#handler, 1009, "Received payload length > 2^31 bytes.");
|
|
58937
58937
|
return;
|
|
@@ -59015,23 +59015,23 @@ var require_receiver = __commonJS({
|
|
|
59015
59015
|
return this.#buffers.shift();
|
|
59016
59016
|
} else {
|
|
59017
59017
|
let offset = 0;
|
|
59018
|
-
const
|
|
59018
|
+
const buffer2 = Buffer.allocUnsafeSlow(n10);
|
|
59019
59019
|
while (offset !== n10) {
|
|
59020
59020
|
const next = this.#buffers[0];
|
|
59021
59021
|
const length = next.length;
|
|
59022
59022
|
if (length + offset === n10) {
|
|
59023
|
-
|
|
59023
|
+
buffer2.set(this.#buffers.shift(), offset);
|
|
59024
59024
|
break;
|
|
59025
59025
|
} else if (length + offset > n10) {
|
|
59026
|
-
|
|
59026
|
+
buffer2.set(next.subarray(0, n10 - offset), offset);
|
|
59027
59027
|
this.#buffers[0] = next.subarray(n10 - offset);
|
|
59028
59028
|
break;
|
|
59029
59029
|
} else {
|
|
59030
|
-
|
|
59030
|
+
buffer2.set(this.#buffers.shift(), offset);
|
|
59031
59031
|
offset += length;
|
|
59032
59032
|
}
|
|
59033
59033
|
}
|
|
59034
|
-
return
|
|
59034
|
+
return buffer2;
|
|
59035
59035
|
}
|
|
59036
59036
|
}
|
|
59037
59037
|
writeFragments(fragment) {
|
|
@@ -59052,9 +59052,9 @@ var require_receiver = __commonJS({
|
|
|
59052
59052
|
let offset = 0;
|
|
59053
59053
|
const output2 = Buffer.allocUnsafeSlow(this.#fragmentsBytes);
|
|
59054
59054
|
for (let i10 = 0; i10 < fragments.length; ++i10) {
|
|
59055
|
-
const
|
|
59056
|
-
output2.set(
|
|
59057
|
-
offset +=
|
|
59055
|
+
const buffer2 = fragments[i10];
|
|
59056
|
+
output2.set(buffer2, offset);
|
|
59057
|
+
offset += buffer2.length;
|
|
59058
59058
|
}
|
|
59059
59059
|
this.#fragments = [];
|
|
59060
59060
|
this.#fragmentsBytes = 0;
|
|
@@ -59381,10 +59381,10 @@ var require_websocket = __commonJS({
|
|
|
59381
59381
|
return;
|
|
59382
59382
|
}
|
|
59383
59383
|
if (typeof data === "string") {
|
|
59384
|
-
const
|
|
59385
|
-
this.#bufferedAmount +=
|
|
59386
|
-
this.#sendQueue.add(
|
|
59387
|
-
this.#bufferedAmount -=
|
|
59384
|
+
const buffer2 = Buffer.from(data);
|
|
59385
|
+
this.#bufferedAmount += buffer2.byteLength;
|
|
59386
|
+
this.#sendQueue.add(buffer2, () => {
|
|
59387
|
+
this.#bufferedAmount -= buffer2.byteLength;
|
|
59388
59388
|
}, sendHints.text);
|
|
59389
59389
|
} else if (isArrayBuffer(data)) {
|
|
59390
59390
|
this.#bufferedAmount += data.byteLength;
|
|
@@ -59608,17 +59608,17 @@ var require_websocket = __commonJS({
|
|
|
59608
59608
|
* @param {WebSocket} ws
|
|
59609
59609
|
* @param {Buffer|undefined} buffer
|
|
59610
59610
|
*/
|
|
59611
|
-
static ping(ws,
|
|
59612
|
-
if (Buffer.isBuffer(
|
|
59613
|
-
if (
|
|
59611
|
+
static ping(ws, buffer2) {
|
|
59612
|
+
if (Buffer.isBuffer(buffer2)) {
|
|
59613
|
+
if (buffer2.length > 125) {
|
|
59614
59614
|
throw new TypeError("A PING frame cannot have a body larger than 125 bytes.");
|
|
59615
59615
|
}
|
|
59616
|
-
} else if (
|
|
59616
|
+
} else if (buffer2 !== void 0) {
|
|
59617
59617
|
throw new TypeError("Expected buffer payload");
|
|
59618
59618
|
}
|
|
59619
59619
|
const readyState = ws.#handler.readyState;
|
|
59620
59620
|
if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) {
|
|
59621
|
-
const frame = new WebsocketFrameSend(
|
|
59621
|
+
const frame = new WebsocketFrameSend(buffer2);
|
|
59622
59622
|
ws.#handler.socket.write(frame.createFrame(opcodes.PING));
|
|
59623
59623
|
}
|
|
59624
59624
|
}
|
|
@@ -60135,20 +60135,20 @@ var require_eventsource_stream = __commonJS({
|
|
|
60135
60135
|
var EVENT = Buffer.from("event");
|
|
60136
60136
|
var ID2 = Buffer.from("id");
|
|
60137
60137
|
var RETRY = Buffer.from("retry");
|
|
60138
|
-
function isASCIINumberBytes(
|
|
60139
|
-
if (start >=
|
|
60138
|
+
function isASCIINumberBytes(buffer2, start) {
|
|
60139
|
+
if (start >= buffer2.length) {
|
|
60140
60140
|
return false;
|
|
60141
60141
|
}
|
|
60142
|
-
for (let i10 = start; i10 <
|
|
60143
|
-
if (
|
|
60142
|
+
for (let i10 = start; i10 < buffer2.length; i10++) {
|
|
60143
|
+
if (buffer2[i10] < 48 || buffer2[i10] > 57) {
|
|
60144
60144
|
return false;
|
|
60145
60145
|
}
|
|
60146
60146
|
}
|
|
60147
60147
|
return true;
|
|
60148
60148
|
}
|
|
60149
|
-
function isValidLastEventIdBytes(
|
|
60150
|
-
for (let i10 = start; i10 <
|
|
60151
|
-
if (
|
|
60149
|
+
function isValidLastEventIdBytes(buffer2, start) {
|
|
60150
|
+
for (let i10 = start; i10 < buffer2.length; i10++) {
|
|
60151
|
+
if (buffer2[i10] === 0) {
|
|
60152
60152
|
return false;
|
|
60153
60153
|
}
|
|
60154
60154
|
}
|
|
@@ -104432,9 +104432,9 @@ function ipBytes(address) {
|
|
|
104432
104432
|
function keyIdentifier(publicKey) {
|
|
104433
104433
|
return (0, import_node_crypto16.createHash)("sha1").update(publicKey.export({ type: "pkcs1", format: "der" })).digest();
|
|
104434
104434
|
}
|
|
104435
|
-
function readElement(
|
|
104436
|
-
const tag =
|
|
104437
|
-
const first =
|
|
104435
|
+
function readElement(buffer2, offset) {
|
|
104436
|
+
const tag = buffer2[offset];
|
|
104437
|
+
const first = buffer2[offset + 1];
|
|
104438
104438
|
if (tag === void 0 || first === void 0) {
|
|
104439
104439
|
throw new Error("truncated DER");
|
|
104440
104440
|
}
|
|
@@ -104444,7 +104444,7 @@ function readElement(buffer, offset) {
|
|
|
104444
104444
|
const count = first & BASE_128_PAYLOAD_MASK;
|
|
104445
104445
|
length = 0;
|
|
104446
104446
|
for (let index = 0; index < count; index += 1) {
|
|
104447
|
-
length = length * (BYTE_MASK + 1) + (
|
|
104447
|
+
length = length * (BYTE_MASK + 1) + (buffer2[offset + 2 + index] ?? 0);
|
|
104448
104448
|
}
|
|
104449
104449
|
contentStart = offset + 2 + count;
|
|
104450
104450
|
}
|
|
@@ -105000,11 +105000,11 @@ function handleConnect(socket, context) {
|
|
|
105000
105000
|
socket.destroy();
|
|
105001
105001
|
});
|
|
105002
105002
|
context.ledger.accept(socket);
|
|
105003
|
-
let
|
|
105003
|
+
let buffer2 = Buffer.alloc(0);
|
|
105004
105004
|
const onData = (chunk) => {
|
|
105005
|
-
|
|
105006
|
-
const headEnd =
|
|
105007
|
-
if (headEnd === -1 ?
|
|
105005
|
+
buffer2 = Buffer.concat([buffer2, chunk]);
|
|
105006
|
+
const headEnd = buffer2.indexOf(HEAD_TERMINATOR);
|
|
105007
|
+
if (headEnd === -1 ? buffer2.length > MAX_CONNECT_HEAD_BYTES : headEnd > MAX_CONNECT_HEAD_BYTES) {
|
|
105008
105008
|
context.ledger.headReceived(socket);
|
|
105009
105009
|
refuse(socket, REFUSAL.headTooLarge);
|
|
105010
105010
|
return;
|
|
@@ -105015,8 +105015,8 @@ function handleConnect(socket, context) {
|
|
|
105015
105015
|
socket.removeListener("data", onData);
|
|
105016
105016
|
socket.pause();
|
|
105017
105017
|
context.ledger.headReceived(socket);
|
|
105018
|
-
const head =
|
|
105019
|
-
socket.unshift(
|
|
105018
|
+
const head = buffer2.subarray(0, headEnd).toString("utf8");
|
|
105019
|
+
socket.unshift(buffer2.subarray(headEnd + HEAD_TERMINATOR.length));
|
|
105020
105020
|
routeConnect(socket, head, context);
|
|
105021
105021
|
};
|
|
105022
105022
|
socket.on("data", onData);
|
|
@@ -106542,8 +106542,12 @@ var SourcePortRange = class {
|
|
|
106542
106542
|
}
|
|
106543
106543
|
};
|
|
106544
106544
|
var DOOR_SOURCE_PORT_START = 47900;
|
|
106545
|
-
var
|
|
106545
|
+
var DOOR_SOURCE_PORT_COUNT = 1e3;
|
|
106546
|
+
var DOOR_SOURCE_PORT_END = DOOR_SOURCE_PORT_START + DOOR_SOURCE_PORT_COUNT - 1;
|
|
106546
106547
|
var DOOR_SOURCE_PORTS = new SourcePortRange(DOOR_SOURCE_PORT_START, DOOR_SOURCE_PORT_END);
|
|
106548
|
+
var POOLED_SOCKET_IDLE_MS = 3e4;
|
|
106549
|
+
var POOLED_SOCKETS_KEPT_IDLE = 2;
|
|
106550
|
+
var POOLING = { keepAlive: true, timeout: POOLED_SOCKET_IDLE_MS, maxFreeSockets: POOLED_SOCKETS_KEPT_IDLE };
|
|
106547
106551
|
var realAddressLookup = (host, _options, callback) => {
|
|
106548
106552
|
if (net2.isIP(host) !== 0) {
|
|
106549
106553
|
callback(null, [{ address: host, family: net2.isIP(host) }]);
|
|
@@ -106598,7 +106602,7 @@ function requestServername(options, fallback) {
|
|
|
106598
106602
|
}
|
|
106599
106603
|
var ExemptHttpAgent = class extends http3.Agent {
|
|
106600
106604
|
constructor(ports = DOOR_SOURCE_PORTS) {
|
|
106601
|
-
super();
|
|
106605
|
+
super(POOLING);
|
|
106602
106606
|
this.ports = ports;
|
|
106603
106607
|
}
|
|
106604
106608
|
ports;
|
|
@@ -106616,7 +106620,7 @@ var ExemptHttpAgent = class extends http3.Agent {
|
|
|
106616
106620
|
};
|
|
106617
106621
|
var ExemptTlsAgent = class extends https3.Agent {
|
|
106618
106622
|
constructor(ports = DOOR_SOURCE_PORTS) {
|
|
106619
|
-
super();
|
|
106623
|
+
super(POOLING);
|
|
106620
106624
|
this.ports = ports;
|
|
106621
106625
|
}
|
|
106622
106626
|
ports;
|
|
@@ -113315,6 +113319,7 @@ function createLaunchEventPublisher(hub, now) {
|
|
|
113315
113319
|
|
|
113316
113320
|
// src/frontdoor/headroomHop.ts
|
|
113317
113321
|
var http4 = __toESM(require("node:http"), 1);
|
|
113322
|
+
var import_consumers = require("node:stream/consumers");
|
|
113318
113323
|
init_route();
|
|
113319
113324
|
var HTTP_BAD_GATEWAY2 = HTTP_STATUS.badGateway;
|
|
113320
113325
|
function responseHeaders(headers) {
|
|
@@ -113376,9 +113381,31 @@ async function answerBadGateway(response, message) {
|
|
|
113376
113381
|
response.end();
|
|
113377
113382
|
}
|
|
113378
113383
|
var HOP_AGENT = new http4.Agent({ keepAlive: false });
|
|
113384
|
+
var HOP_RESET_RETRIES = 1;
|
|
113385
|
+
var HOP_RESET_CODES = /* @__PURE__ */ new Set(["ECONNRESET", "EPIPE"]);
|
|
113386
|
+
async function collectBody(request7) {
|
|
113387
|
+
try {
|
|
113388
|
+
return await (0, import_consumers.buffer)(request7.body);
|
|
113389
|
+
} catch {
|
|
113390
|
+
return void 0;
|
|
113391
|
+
}
|
|
113392
|
+
}
|
|
113379
113393
|
async function forwardThroughHeadroom(request7, response, target) {
|
|
113394
|
+
const body = await collectBody(request7);
|
|
113395
|
+
if (body === void 0) {
|
|
113396
|
+
response.destroy();
|
|
113397
|
+
return;
|
|
113398
|
+
}
|
|
113399
|
+
for (let retriesLeft = HOP_RESET_RETRIES; ; retriesLeft -= 1) {
|
|
113400
|
+
const outcome = await hopOnce(request7, response, target, body, retriesLeft > 0);
|
|
113401
|
+
if (outcome === "settled") {
|
|
113402
|
+
return;
|
|
113403
|
+
}
|
|
113404
|
+
}
|
|
113405
|
+
}
|
|
113406
|
+
async function hopOnce(request7, response, target, body, mayRetry) {
|
|
113380
113407
|
const { socketPath, headers } = target;
|
|
113381
|
-
await new Promise((resolve2) => {
|
|
113408
|
+
return await new Promise((resolve2) => {
|
|
113382
113409
|
const onUpstreamResponse = (upstreamResponse) => {
|
|
113383
113410
|
response.start(upstreamResponse.statusCode ?? HTTP_BAD_GATEWAY2, responseHeaders(upstreamResponse.headers));
|
|
113384
113411
|
response.flush();
|
|
@@ -113399,12 +113426,18 @@ async function forwardThroughHeadroom(request7, response, target) {
|
|
|
113399
113426
|
}
|
|
113400
113427
|
response.destroy();
|
|
113401
113428
|
}
|
|
113402
|
-
resolve2(
|
|
113429
|
+
resolve2("settled");
|
|
113403
113430
|
};
|
|
113404
113431
|
void stream();
|
|
113405
113432
|
};
|
|
113406
113433
|
const hop = http4.request({ socketPath, method: request7.method, path: request7.url, headers, agent: HOP_AGENT }, onUpstreamResponse);
|
|
113407
113434
|
hop.on("error", (error62) => {
|
|
113435
|
+
const resetCode = "code" in error62 && typeof error62.code === "string" ? error62.code : void 0;
|
|
113436
|
+
if (mayRetry && !response.headersSent && !request7.signal.aborted && resetCode !== void 0 && HOP_RESET_CODES.has(resetCode)) {
|
|
113437
|
+
target.log(`front door: headroom hop to ${socketPath} reset before the response started (${request7.method} ${new URL(request7.url, "http://127.0.0.1").pathname}, ${String(body.length)} request bytes): ${error62.message} ${resetCode}; replaying once`);
|
|
113438
|
+
resolve2("retry");
|
|
113439
|
+
return;
|
|
113440
|
+
}
|
|
113408
113441
|
const phase = response.headersSent ? "mid-stream" : "before the response started";
|
|
113409
113442
|
const code = "code" in error62 && typeof error62.code === "string" ? ` ${error62.code}` : "";
|
|
113410
113443
|
target.log(`front door: headroom hop to ${socketPath} failed (${request7.method} ${new URL(request7.url, "http://127.0.0.1").pathname}, ${phase}): ${error62.message}${code}`);
|
|
@@ -113416,15 +113449,12 @@ async function forwardThroughHeadroom(request7, response, target) {
|
|
|
113416
113449
|
} else {
|
|
113417
113450
|
response.destroy();
|
|
113418
113451
|
}
|
|
113419
|
-
resolve2(
|
|
113452
|
+
resolve2("settled");
|
|
113420
113453
|
});
|
|
113421
113454
|
request7.signal.addEventListener("abort", () => {
|
|
113422
113455
|
hop.destroy();
|
|
113423
113456
|
});
|
|
113424
|
-
|
|
113425
|
-
request7.body.on("error", () => {
|
|
113426
|
-
hop.destroy();
|
|
113427
|
-
});
|
|
113457
|
+
hop.end(body);
|
|
113428
113458
|
});
|
|
113429
113459
|
}
|
|
113430
113460
|
|
|
@@ -113906,7 +113936,7 @@ var CodexErrorEnvelopeSchema = external_exports.looseObject({
|
|
|
113906
113936
|
});
|
|
113907
113937
|
async function* parseSse(body) {
|
|
113908
113938
|
const decoder = new TextDecoder();
|
|
113909
|
-
let
|
|
113939
|
+
let buffer2 = "";
|
|
113910
113940
|
let data = "";
|
|
113911
113941
|
const parsed = function* (raw) {
|
|
113912
113942
|
try {
|
|
@@ -113915,11 +113945,11 @@ async function* parseSse(body) {
|
|
|
113915
113945
|
}
|
|
113916
113946
|
};
|
|
113917
113947
|
for await (const chunk of body) {
|
|
113918
|
-
|
|
113919
|
-
let newline =
|
|
113948
|
+
buffer2 += decoder.decode(chunk, { stream: true });
|
|
113949
|
+
let newline = buffer2.indexOf("\n");
|
|
113920
113950
|
while (newline !== -1) {
|
|
113921
|
-
const line =
|
|
113922
|
-
|
|
113951
|
+
const line = buffer2.slice(0, newline).replace(/\r$/, "");
|
|
113952
|
+
buffer2 = buffer2.slice(newline + 1);
|
|
113923
113953
|
if (line === "") {
|
|
113924
113954
|
if (data !== "") {
|
|
113925
113955
|
yield* parsed(data);
|
|
@@ -113928,10 +113958,10 @@ async function* parseSse(body) {
|
|
|
113928
113958
|
} else if (line.startsWith("data:")) {
|
|
113929
113959
|
data += line.slice("data:".length).trimStart();
|
|
113930
113960
|
}
|
|
113931
|
-
newline =
|
|
113961
|
+
newline = buffer2.indexOf("\n");
|
|
113932
113962
|
}
|
|
113933
113963
|
}
|
|
113934
|
-
const tail = (
|
|
113964
|
+
const tail = (buffer2 + decoder.decode()).replace(/\r$/, "");
|
|
113935
113965
|
if (tail.startsWith("data:")) {
|
|
113936
113966
|
data += tail.slice("data:".length).trimStart();
|
|
113937
113967
|
}
|
|
@@ -117168,7 +117198,7 @@ function isSuccessful4(status) {
|
|
|
117168
117198
|
return status >= HTTP_STATUS.ok && status < SUCCESS_STATUS_MAX_EXCLUSIVE4;
|
|
117169
117199
|
}
|
|
117170
117200
|
function createSseParser() {
|
|
117171
|
-
let
|
|
117201
|
+
let buffer2 = "";
|
|
117172
117202
|
let eventName;
|
|
117173
117203
|
let eventId;
|
|
117174
117204
|
let dataLines = [];
|
|
@@ -117180,21 +117210,21 @@ function createSseParser() {
|
|
|
117180
117210
|
seenAnyText = true;
|
|
117181
117211
|
incoming = incoming.charCodeAt(0) === SSE_BYTE_ORDER_MARK ? incoming.slice(1) : incoming;
|
|
117182
117212
|
}
|
|
117183
|
-
|
|
117213
|
+
buffer2 += incoming;
|
|
117184
117214
|
const completed = [];
|
|
117185
117215
|
for (; ; ) {
|
|
117186
|
-
const carriage =
|
|
117187
|
-
const lineFeed =
|
|
117216
|
+
const carriage = buffer2.indexOf("\r");
|
|
117217
|
+
const lineFeed = buffer2.indexOf("\n");
|
|
117188
117218
|
const end = carriage === -1 ? lineFeed : lineFeed === -1 ? carriage : carriage < lineFeed ? carriage : lineFeed;
|
|
117189
117219
|
if (end === -1) {
|
|
117190
117220
|
break;
|
|
117191
117221
|
}
|
|
117192
|
-
if (
|
|
117222
|
+
if (buffer2[end] === "\r" && end === buffer2.length - 1) {
|
|
117193
117223
|
break;
|
|
117194
117224
|
}
|
|
117195
|
-
const after =
|
|
117196
|
-
const line =
|
|
117197
|
-
|
|
117225
|
+
const after = buffer2[end] === "\r" && buffer2[end + 1] === "\n" ? end + 2 : end + 1;
|
|
117226
|
+
const line = buffer2.slice(0, end);
|
|
117227
|
+
buffer2 = buffer2.slice(after);
|
|
117198
117228
|
if (line === "") {
|
|
117199
117229
|
if (dataLines.length > 0) {
|
|
117200
117230
|
completed.push({ event: eventName, id: eventId, data: dataLines.join("\n") });
|
|
@@ -119000,9 +119030,9 @@ var realUpdatePorts = {
|
|
|
119000
119030
|
throw error62;
|
|
119001
119031
|
}
|
|
119002
119032
|
try {
|
|
119003
|
-
const
|
|
119004
|
-
const read = import_node_fs18.default.readSync(descriptor,
|
|
119005
|
-
return read === 0 ? "" :
|
|
119033
|
+
const buffer2 = Buffer.alloc(length);
|
|
119034
|
+
const read = import_node_fs18.default.readSync(descriptor, buffer2, 0, length, 0);
|
|
119035
|
+
return read === 0 ? "" : buffer2.toString("latin1", 0, read);
|
|
119006
119036
|
} finally {
|
|
119007
119037
|
import_node_fs18.default.closeSync(descriptor);
|
|
119008
119038
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -2649,7 +2649,7 @@ var init_package = __esm({
|
|
|
2649
2649
|
"package.json"() {
|
|
2650
2650
|
package_default = {
|
|
2651
2651
|
name: "claude-use",
|
|
2652
|
-
version: "9.4.
|
|
2652
|
+
version: "9.4.2",
|
|
2653
2653
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
2654
2654
|
license: "MIT",
|
|
2655
2655
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -10198,8 +10198,12 @@ var SourcePortRange = class {
|
|
|
10198
10198
|
}
|
|
10199
10199
|
};
|
|
10200
10200
|
var DOOR_SOURCE_PORT_START = 47900;
|
|
10201
|
-
var
|
|
10201
|
+
var DOOR_SOURCE_PORT_COUNT = 1e3;
|
|
10202
|
+
var DOOR_SOURCE_PORT_END = DOOR_SOURCE_PORT_START + DOOR_SOURCE_PORT_COUNT - 1;
|
|
10202
10203
|
var DOOR_SOURCE_PORTS = new SourcePortRange(DOOR_SOURCE_PORT_START, DOOR_SOURCE_PORT_END);
|
|
10204
|
+
var POOLED_SOCKET_IDLE_MS = 3e4;
|
|
10205
|
+
var POOLED_SOCKETS_KEPT_IDLE = 2;
|
|
10206
|
+
var POOLING = { keepAlive: true, timeout: POOLED_SOCKET_IDLE_MS, maxFreeSockets: POOLED_SOCKETS_KEPT_IDLE };
|
|
10203
10207
|
var realAddressLookup = (host, _options, callback) => {
|
|
10204
10208
|
if (net2.isIP(host) !== 0) {
|
|
10205
10209
|
callback(null, [{ address: host, family: net2.isIP(host) }]);
|
|
@@ -10254,7 +10258,7 @@ function requestServername(options, fallback) {
|
|
|
10254
10258
|
}
|
|
10255
10259
|
var ExemptHttpAgent = class extends http.Agent {
|
|
10256
10260
|
constructor(ports = DOOR_SOURCE_PORTS) {
|
|
10257
|
-
super();
|
|
10261
|
+
super(POOLING);
|
|
10258
10262
|
this.ports = ports;
|
|
10259
10263
|
}
|
|
10260
10264
|
ports;
|
|
@@ -10272,7 +10276,7 @@ var ExemptHttpAgent = class extends http.Agent {
|
|
|
10272
10276
|
};
|
|
10273
10277
|
var ExemptTlsAgent = class extends https2.Agent {
|
|
10274
10278
|
constructor(ports = DOOR_SOURCE_PORTS) {
|
|
10275
|
-
super();
|
|
10279
|
+
super(POOLING);
|
|
10276
10280
|
this.ports = ports;
|
|
10277
10281
|
}
|
|
10278
10282
|
ports;
|
package/dist/index.mjs
CHANGED
|
@@ -2625,7 +2625,7 @@ var init_package = __esm({
|
|
|
2625
2625
|
"package.json"() {
|
|
2626
2626
|
package_default = {
|
|
2627
2627
|
name: "claude-use",
|
|
2628
|
-
version: "9.4.
|
|
2628
|
+
version: "9.4.2",
|
|
2629
2629
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
2630
2630
|
license: "MIT",
|
|
2631
2631
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -9873,8 +9873,12 @@ var SourcePortRange = class {
|
|
|
9873
9873
|
}
|
|
9874
9874
|
};
|
|
9875
9875
|
var DOOR_SOURCE_PORT_START = 47900;
|
|
9876
|
-
var
|
|
9876
|
+
var DOOR_SOURCE_PORT_COUNT = 1e3;
|
|
9877
|
+
var DOOR_SOURCE_PORT_END = DOOR_SOURCE_PORT_START + DOOR_SOURCE_PORT_COUNT - 1;
|
|
9877
9878
|
var DOOR_SOURCE_PORTS = new SourcePortRange(DOOR_SOURCE_PORT_START, DOOR_SOURCE_PORT_END);
|
|
9879
|
+
var POOLED_SOCKET_IDLE_MS = 3e4;
|
|
9880
|
+
var POOLED_SOCKETS_KEPT_IDLE = 2;
|
|
9881
|
+
var POOLING = { keepAlive: true, timeout: POOLED_SOCKET_IDLE_MS, maxFreeSockets: POOLED_SOCKETS_KEPT_IDLE };
|
|
9878
9882
|
var realAddressLookup = (host, _options, callback) => {
|
|
9879
9883
|
if (net2.isIP(host) !== 0) {
|
|
9880
9884
|
callback(null, [{ address: host, family: net2.isIP(host) }]);
|
|
@@ -9929,7 +9933,7 @@ function requestServername(options, fallback) {
|
|
|
9929
9933
|
}
|
|
9930
9934
|
var ExemptHttpAgent = class extends http.Agent {
|
|
9931
9935
|
constructor(ports = DOOR_SOURCE_PORTS) {
|
|
9932
|
-
super();
|
|
9936
|
+
super(POOLING);
|
|
9933
9937
|
this.ports = ports;
|
|
9934
9938
|
}
|
|
9935
9939
|
ports;
|
|
@@ -9947,7 +9951,7 @@ var ExemptHttpAgent = class extends http.Agent {
|
|
|
9947
9951
|
};
|
|
9948
9952
|
var ExemptTlsAgent = class extends https2.Agent {
|
|
9949
9953
|
constructor(ports = DOOR_SOURCE_PORTS) {
|
|
9950
|
-
super();
|
|
9954
|
+
super(POOLING);
|
|
9951
9955
|
this.ports = ports;
|
|
9952
9956
|
}
|
|
9953
9957
|
ports;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5526,12 +5526,12 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
|
|
|
5526
5526
|
identity: "identity";
|
|
5527
5527
|
provider: "provider";
|
|
5528
5528
|
pool: "pool";
|
|
5529
|
-
keychain: "keychain";
|
|
5530
5529
|
"ambient-credential": "ambient-credential";
|
|
5531
5530
|
"binary-discovery": "binary-discovery";
|
|
5532
5531
|
"claude-shim": "claude-shim";
|
|
5533
5532
|
"path-resolution": "path-resolution";
|
|
5534
5533
|
"legacy-name": "legacy-name";
|
|
5534
|
+
keychain: "keychain";
|
|
5535
5535
|
"directory-rules": "directory-rules";
|
|
5536
5536
|
"categories-local": "categories-local";
|
|
5537
5537
|
"active-identity": "active-identity";
|
|
@@ -6134,12 +6134,12 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
6134
6134
|
identity: "identity";
|
|
6135
6135
|
provider: "provider";
|
|
6136
6136
|
pool: "pool";
|
|
6137
|
-
keychain: "keychain";
|
|
6138
6137
|
"ambient-credential": "ambient-credential";
|
|
6139
6138
|
"binary-discovery": "binary-discovery";
|
|
6140
6139
|
"claude-shim": "claude-shim";
|
|
6141
6140
|
"path-resolution": "path-resolution";
|
|
6142
6141
|
"legacy-name": "legacy-name";
|
|
6142
|
+
keychain: "keychain";
|
|
6143
6143
|
"directory-rules": "directory-rules";
|
|
6144
6144
|
"categories-local": "categories-local";
|
|
6145
6145
|
"active-identity": "active-identity";
|
|
@@ -6674,12 +6674,12 @@ declare const DoctorFindingSchema: z.ZodObject<{
|
|
|
6674
6674
|
identity: "identity";
|
|
6675
6675
|
provider: "provider";
|
|
6676
6676
|
pool: "pool";
|
|
6677
|
-
keychain: "keychain";
|
|
6678
6677
|
"ambient-credential": "ambient-credential";
|
|
6679
6678
|
"binary-discovery": "binary-discovery";
|
|
6680
6679
|
"claude-shim": "claude-shim";
|
|
6681
6680
|
"path-resolution": "path-resolution";
|
|
6682
6681
|
"legacy-name": "legacy-name";
|
|
6682
|
+
keychain: "keychain";
|
|
6683
6683
|
"directory-rules": "directory-rules";
|
|
6684
6684
|
"categories-local": "categories-local";
|
|
6685
6685
|
"active-identity": "active-identity";
|
|
@@ -6703,12 +6703,12 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
|
|
|
6703
6703
|
identity: "identity";
|
|
6704
6704
|
provider: "provider";
|
|
6705
6705
|
pool: "pool";
|
|
6706
|
-
keychain: "keychain";
|
|
6707
6706
|
"ambient-credential": "ambient-credential";
|
|
6708
6707
|
"binary-discovery": "binary-discovery";
|
|
6709
6708
|
"claude-shim": "claude-shim";
|
|
6710
6709
|
"path-resolution": "path-resolution";
|
|
6711
6710
|
"legacy-name": "legacy-name";
|
|
6711
|
+
keychain: "keychain";
|
|
6712
6712
|
"directory-rules": "directory-rules";
|
|
6713
6713
|
"categories-local": "categories-local";
|
|
6714
6714
|
"active-identity": "active-identity";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-use",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.2",
|
|
4
4
|
"description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Joseph Mearman <joseph@mearman.co.uk>",
|