visionclaw 0.1.185 → 0.1.186
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/CHANGELOG.md +3 -0
- package/dist/obs/notify.d.ts.map +1 -1
- package/dist/obs/notify.js +5 -0
- package/dist/obs/notify.js.map +1 -1
- package/dist/obs/server.d.ts.map +1 -1
- package/dist/obs/server.js +248 -17
- package/dist/obs/server.js.map +1 -1
- package/dist-agent/bundle.cjs +387 -652
- package/package.json +1 -1
package/dist-agent/bundle.cjs
CHANGED
|
@@ -20414,7 +20414,7 @@ var require_prompts3 = __commonJS({
|
|
|
20414
20414
|
|
|
20415
20415
|
// dist/utils/version-check.js
|
|
20416
20416
|
function isBundled() {
|
|
20417
|
-
const v15 = "0.1.
|
|
20417
|
+
const v15 = "0.1.186";
|
|
20418
20418
|
return typeof v15 === "string" && v15 !== "undefined";
|
|
20419
20419
|
}
|
|
20420
20420
|
function getPackageRoot() {
|
|
@@ -20431,7 +20431,7 @@ function getInstallationInfo() {
|
|
|
20431
20431
|
};
|
|
20432
20432
|
}
|
|
20433
20433
|
function getCurrentVersion() {
|
|
20434
|
-
const bundledVersion = "0.1.
|
|
20434
|
+
const bundledVersion = "0.1.186";
|
|
20435
20435
|
if (bundledVersion && bundledVersion !== "undefined") {
|
|
20436
20436
|
return bundledVersion;
|
|
20437
20437
|
}
|
|
@@ -29748,22 +29748,22 @@ var require_crypto2 = __commonJS({
|
|
|
29748
29748
|
"use strict";
|
|
29749
29749
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
29750
29750
|
exports2.NodeCrypto = void 0;
|
|
29751
|
-
var
|
|
29751
|
+
var crypto20 = require("crypto");
|
|
29752
29752
|
var NodeCrypto = class {
|
|
29753
29753
|
async sha256DigestBase64(str3) {
|
|
29754
|
-
return
|
|
29754
|
+
return crypto20.createHash("sha256").update(str3).digest("base64");
|
|
29755
29755
|
}
|
|
29756
29756
|
randomBytesBase64(count) {
|
|
29757
|
-
return
|
|
29757
|
+
return crypto20.randomBytes(count).toString("base64");
|
|
29758
29758
|
}
|
|
29759
29759
|
async verify(pubkey, data2, signature) {
|
|
29760
|
-
const verifier =
|
|
29760
|
+
const verifier = crypto20.createVerify("RSA-SHA256");
|
|
29761
29761
|
verifier.update(data2);
|
|
29762
29762
|
verifier.end();
|
|
29763
29763
|
return verifier.verify(pubkey, signature, "base64");
|
|
29764
29764
|
}
|
|
29765
29765
|
async sign(privateKey, data2) {
|
|
29766
|
-
const signer =
|
|
29766
|
+
const signer = crypto20.createSign("RSA-SHA256");
|
|
29767
29767
|
signer.update(data2);
|
|
29768
29768
|
signer.end();
|
|
29769
29769
|
return signer.sign(privateKey, "base64");
|
|
@@ -29781,7 +29781,7 @@ var require_crypto2 = __commonJS({
|
|
|
29781
29781
|
* string in hexadecimal encoding.
|
|
29782
29782
|
*/
|
|
29783
29783
|
async sha256DigestHex(str3) {
|
|
29784
|
-
return
|
|
29784
|
+
return crypto20.createHash("sha256").update(str3).digest("hex");
|
|
29785
29785
|
}
|
|
29786
29786
|
/**
|
|
29787
29787
|
* Computes the HMAC hash of a message using the provided crypto key and the
|
|
@@ -29793,7 +29793,7 @@ var require_crypto2 = __commonJS({
|
|
|
29793
29793
|
*/
|
|
29794
29794
|
async signWithHmacSha256(key, msg) {
|
|
29795
29795
|
const cryptoKey = typeof key === "string" ? key : toBuffer(key);
|
|
29796
|
-
return toArrayBuffer(
|
|
29796
|
+
return toArrayBuffer(crypto20.createHmac("sha256", cryptoKey).update(msg).digest());
|
|
29797
29797
|
}
|
|
29798
29798
|
};
|
|
29799
29799
|
exports2.NodeCrypto = NodeCrypto;
|
|
@@ -30571,10 +30571,10 @@ var require_oauth2client = __commonJS({
|
|
|
30571
30571
|
* https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2-codeVerifier.js
|
|
30572
30572
|
*/
|
|
30573
30573
|
async generateCodeVerifierAsync() {
|
|
30574
|
-
const
|
|
30575
|
-
const randomString2 =
|
|
30574
|
+
const crypto20 = (0, crypto_1.createCrypto)();
|
|
30575
|
+
const randomString2 = crypto20.randomBytesBase64(96);
|
|
30576
30576
|
const codeVerifier = randomString2.replace(/\+/g, "~").replace(/=/g, "_").replace(/\//g, "-");
|
|
30577
|
-
const unencodedCodeChallenge = await
|
|
30577
|
+
const unencodedCodeChallenge = await crypto20.sha256DigestBase64(codeVerifier);
|
|
30578
30578
|
const codeChallenge = unencodedCodeChallenge.split("=")[0].replace(/\+/g, "-").replace(/\//g, "_");
|
|
30579
30579
|
return { codeVerifier, codeChallenge };
|
|
30580
30580
|
}
|
|
@@ -31018,7 +31018,7 @@ var require_oauth2client = __commonJS({
|
|
|
31018
31018
|
* @return Returns a promise resolving to LoginTicket on verification.
|
|
31019
31019
|
*/
|
|
31020
31020
|
async verifySignedJwtWithCertsAsync(jwt2, certs, requiredAudience, issuers, maxExpiry) {
|
|
31021
|
-
const
|
|
31021
|
+
const crypto20 = (0, crypto_1.createCrypto)();
|
|
31022
31022
|
if (!maxExpiry) {
|
|
31023
31023
|
maxExpiry = _OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;
|
|
31024
31024
|
}
|
|
@@ -31031,7 +31031,7 @@ var require_oauth2client = __commonJS({
|
|
|
31031
31031
|
let envelope;
|
|
31032
31032
|
let payload2;
|
|
31033
31033
|
try {
|
|
31034
|
-
envelope = JSON.parse(
|
|
31034
|
+
envelope = JSON.parse(crypto20.decodeBase64StringUtf8(segments[0]));
|
|
31035
31035
|
} catch (err7) {
|
|
31036
31036
|
if (err7 instanceof Error) {
|
|
31037
31037
|
err7.message = `Can't parse token envelope: ${segments[0]}': ${err7.message}`;
|
|
@@ -31042,7 +31042,7 @@ var require_oauth2client = __commonJS({
|
|
|
31042
31042
|
throw new Error("Can't parse token envelope: " + segments[0]);
|
|
31043
31043
|
}
|
|
31044
31044
|
try {
|
|
31045
|
-
payload2 = JSON.parse(
|
|
31045
|
+
payload2 = JSON.parse(crypto20.decodeBase64StringUtf8(segments[1]));
|
|
31046
31046
|
} catch (err7) {
|
|
31047
31047
|
if (err7 instanceof Error) {
|
|
31048
31048
|
err7.message = `Can't parse token payload '${segments[0]}`;
|
|
@@ -31059,7 +31059,7 @@ var require_oauth2client = __commonJS({
|
|
|
31059
31059
|
if (envelope.alg === "ES256") {
|
|
31060
31060
|
signature = formatEcdsa.joseToDer(signature, "ES256").toString("base64");
|
|
31061
31061
|
}
|
|
31062
|
-
const verified = await
|
|
31062
|
+
const verified = await crypto20.verify(cert, signed, signature);
|
|
31063
31063
|
if (!verified) {
|
|
31064
31064
|
throw new Error("Invalid token signature: " + jwt2);
|
|
31065
31065
|
}
|
|
@@ -31427,14 +31427,14 @@ var require_buffer_equal_constant_time = __commonJS({
|
|
|
31427
31427
|
var require_jwa = __commonJS({
|
|
31428
31428
|
"node_modules/.pnpm/jwa@2.0.1/node_modules/jwa/index.js"(exports2, module2) {
|
|
31429
31429
|
var Buffer5 = require_safe_buffer().Buffer;
|
|
31430
|
-
var
|
|
31430
|
+
var crypto20 = require("crypto");
|
|
31431
31431
|
var formatEcdsa = require_ecdsa_sig_formatter();
|
|
31432
31432
|
var util2 = require("util");
|
|
31433
31433
|
var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".';
|
|
31434
31434
|
var MSG_INVALID_SECRET = "secret must be a string or buffer";
|
|
31435
31435
|
var MSG_INVALID_VERIFIER_KEY = "key must be a string or a buffer";
|
|
31436
31436
|
var MSG_INVALID_SIGNER_KEY = "key must be a string, a buffer or an object";
|
|
31437
|
-
var supportsKeyObjects = typeof
|
|
31437
|
+
var supportsKeyObjects = typeof crypto20.createPublicKey === "function";
|
|
31438
31438
|
if (supportsKeyObjects) {
|
|
31439
31439
|
MSG_INVALID_VERIFIER_KEY += " or a KeyObject";
|
|
31440
31440
|
MSG_INVALID_SECRET += "or a KeyObject";
|
|
@@ -31524,17 +31524,17 @@ var require_jwa = __commonJS({
|
|
|
31524
31524
|
return function sign(thing, secret) {
|
|
31525
31525
|
checkIsSecretKey(secret);
|
|
31526
31526
|
thing = normalizeInput2(thing);
|
|
31527
|
-
var hmac3 =
|
|
31527
|
+
var hmac3 = crypto20.createHmac("sha" + bits, secret);
|
|
31528
31528
|
var sig = (hmac3.update(thing), hmac3.digest("base64"));
|
|
31529
31529
|
return fromBase6410(sig);
|
|
31530
31530
|
};
|
|
31531
31531
|
}
|
|
31532
31532
|
var bufferEqual;
|
|
31533
|
-
var timingSafeEqual = "timingSafeEqual" in
|
|
31533
|
+
var timingSafeEqual = "timingSafeEqual" in crypto20 ? function timingSafeEqual2(a11, b11) {
|
|
31534
31534
|
if (a11.byteLength !== b11.byteLength) {
|
|
31535
31535
|
return false;
|
|
31536
31536
|
}
|
|
31537
|
-
return
|
|
31537
|
+
return crypto20.timingSafeEqual(a11, b11);
|
|
31538
31538
|
} : function timingSafeEqual2(a11, b11) {
|
|
31539
31539
|
if (!bufferEqual) {
|
|
31540
31540
|
bufferEqual = require_buffer_equal_constant_time();
|
|
@@ -31551,7 +31551,7 @@ var require_jwa = __commonJS({
|
|
|
31551
31551
|
return function sign(thing, privateKey) {
|
|
31552
31552
|
checkIsPrivateKey(privateKey);
|
|
31553
31553
|
thing = normalizeInput2(thing);
|
|
31554
|
-
var signer =
|
|
31554
|
+
var signer = crypto20.createSign("RSA-SHA" + bits);
|
|
31555
31555
|
var sig = (signer.update(thing), signer.sign(privateKey, "base64"));
|
|
31556
31556
|
return fromBase6410(sig);
|
|
31557
31557
|
};
|
|
@@ -31561,7 +31561,7 @@ var require_jwa = __commonJS({
|
|
|
31561
31561
|
checkIsPublicKey(publicKey);
|
|
31562
31562
|
thing = normalizeInput2(thing);
|
|
31563
31563
|
signature = toBase6410(signature);
|
|
31564
|
-
var verifier =
|
|
31564
|
+
var verifier = crypto20.createVerify("RSA-SHA" + bits);
|
|
31565
31565
|
verifier.update(thing);
|
|
31566
31566
|
return verifier.verify(publicKey, signature, "base64");
|
|
31567
31567
|
};
|
|
@@ -31570,11 +31570,11 @@ var require_jwa = __commonJS({
|
|
|
31570
31570
|
return function sign(thing, privateKey) {
|
|
31571
31571
|
checkIsPrivateKey(privateKey);
|
|
31572
31572
|
thing = normalizeInput2(thing);
|
|
31573
|
-
var signer =
|
|
31573
|
+
var signer = crypto20.createSign("RSA-SHA" + bits);
|
|
31574
31574
|
var sig = (signer.update(thing), signer.sign({
|
|
31575
31575
|
key: privateKey,
|
|
31576
|
-
padding:
|
|
31577
|
-
saltLength:
|
|
31576
|
+
padding: crypto20.constants.RSA_PKCS1_PSS_PADDING,
|
|
31577
|
+
saltLength: crypto20.constants.RSA_PSS_SALTLEN_DIGEST
|
|
31578
31578
|
}, "base64"));
|
|
31579
31579
|
return fromBase6410(sig);
|
|
31580
31580
|
};
|
|
@@ -31584,12 +31584,12 @@ var require_jwa = __commonJS({
|
|
|
31584
31584
|
checkIsPublicKey(publicKey);
|
|
31585
31585
|
thing = normalizeInput2(thing);
|
|
31586
31586
|
signature = toBase6410(signature);
|
|
31587
|
-
var verifier =
|
|
31587
|
+
var verifier = crypto20.createVerify("RSA-SHA" + bits);
|
|
31588
31588
|
verifier.update(thing);
|
|
31589
31589
|
return verifier.verify({
|
|
31590
31590
|
key: publicKey,
|
|
31591
|
-
padding:
|
|
31592
|
-
saltLength:
|
|
31591
|
+
padding: crypto20.constants.RSA_PKCS1_PSS_PADDING,
|
|
31592
|
+
saltLength: crypto20.constants.RSA_PSS_SALTLEN_DIGEST
|
|
31593
31593
|
}, signature, "base64");
|
|
31594
31594
|
};
|
|
31595
31595
|
}
|
|
@@ -33747,14 +33747,14 @@ var require_awsrequestsigner = __commonJS({
|
|
|
33747
33747
|
}
|
|
33748
33748
|
};
|
|
33749
33749
|
exports2.AwsRequestSigner = AwsRequestSigner;
|
|
33750
|
-
async function sign(
|
|
33751
|
-
return await
|
|
33752
|
-
}
|
|
33753
|
-
async function getSigningKey(
|
|
33754
|
-
const kDate = await sign(
|
|
33755
|
-
const kRegion = await sign(
|
|
33756
|
-
const kService = await sign(
|
|
33757
|
-
const kSigning = await sign(
|
|
33750
|
+
async function sign(crypto20, key, msg) {
|
|
33751
|
+
return await crypto20.signWithHmacSha256(key, msg);
|
|
33752
|
+
}
|
|
33753
|
+
async function getSigningKey(crypto20, key, dateStamp, region, serviceName) {
|
|
33754
|
+
const kDate = await sign(crypto20, `AWS4${key}`, dateStamp);
|
|
33755
|
+
const kRegion = await sign(crypto20, kDate, region);
|
|
33756
|
+
const kService = await sign(crypto20, kRegion, serviceName);
|
|
33757
|
+
const kSigning = await sign(crypto20, kService, "aws4_request");
|
|
33758
33758
|
return kSigning;
|
|
33759
33759
|
}
|
|
33760
33760
|
async function generateAuthenticationHeaderMap(options3) {
|
|
@@ -35339,24 +35339,24 @@ var require_googleauth = __commonJS({
|
|
|
35339
35339
|
const signed = await client.sign(data2);
|
|
35340
35340
|
return signed.signedBlob;
|
|
35341
35341
|
}
|
|
35342
|
-
const
|
|
35342
|
+
const crypto20 = (0, crypto_1.createCrypto)();
|
|
35343
35343
|
if (client instanceof jwtclient_1.JWT && client.key) {
|
|
35344
|
-
const sign = await
|
|
35344
|
+
const sign = await crypto20.sign(client.key, data2);
|
|
35345
35345
|
return sign;
|
|
35346
35346
|
}
|
|
35347
35347
|
const creds = await this.getCredentials();
|
|
35348
35348
|
if (!creds.client_email) {
|
|
35349
35349
|
throw new Error("Cannot sign data without `client_email`.");
|
|
35350
35350
|
}
|
|
35351
|
-
return this.signBlob(
|
|
35351
|
+
return this.signBlob(crypto20, creds.client_email, data2, endpoint);
|
|
35352
35352
|
}
|
|
35353
|
-
async signBlob(
|
|
35353
|
+
async signBlob(crypto20, emailOrUniqueId, data2, endpoint) {
|
|
35354
35354
|
const url2 = new URL(endpoint + `${emailOrUniqueId}:signBlob`);
|
|
35355
35355
|
const res = await this.request({
|
|
35356
35356
|
method: "POST",
|
|
35357
35357
|
url: url2.href,
|
|
35358
35358
|
data: {
|
|
35359
|
-
payload:
|
|
35359
|
+
payload: crypto20.encodeBase64StringUtf8(data2)
|
|
35360
35360
|
},
|
|
35361
35361
|
retry: true,
|
|
35362
35362
|
retryConfig: {
|
|
@@ -705612,7 +705612,7 @@ var require_dist_cjs53 = __commonJS({
|
|
|
705612
705612
|
var utilBufferFrom = require_dist_cjs7();
|
|
705613
705613
|
var utilUtf8 = require_dist_cjs8();
|
|
705614
705614
|
var buffer = require("buffer");
|
|
705615
|
-
var
|
|
705615
|
+
var crypto20 = require("crypto");
|
|
705616
705616
|
var Hash5 = class {
|
|
705617
705617
|
algorithmIdentifier;
|
|
705618
705618
|
secret;
|
|
@@ -705629,7 +705629,7 @@ var require_dist_cjs53 = __commonJS({
|
|
|
705629
705629
|
return Promise.resolve(this.hash.digest());
|
|
705630
705630
|
}
|
|
705631
705631
|
reset() {
|
|
705632
|
-
this.hash = this.secret ?
|
|
705632
|
+
this.hash = this.secret ? crypto20.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : crypto20.createHash(this.algorithmIdentifier);
|
|
705633
705633
|
}
|
|
705634
705634
|
};
|
|
705635
705635
|
function castSourceData(toCast, encoding) {
|
|
@@ -781502,22 +781502,22 @@ var require_crypto5 = __commonJS({
|
|
|
781502
781502
|
"use strict";
|
|
781503
781503
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
781504
781504
|
exports2.NodeCrypto = void 0;
|
|
781505
|
-
var
|
|
781505
|
+
var crypto20 = require("crypto");
|
|
781506
781506
|
var NodeCrypto = class {
|
|
781507
781507
|
async sha256DigestBase64(str3) {
|
|
781508
|
-
return
|
|
781508
|
+
return crypto20.createHash("sha256").update(str3).digest("base64");
|
|
781509
781509
|
}
|
|
781510
781510
|
randomBytesBase64(count) {
|
|
781511
|
-
return
|
|
781511
|
+
return crypto20.randomBytes(count).toString("base64");
|
|
781512
781512
|
}
|
|
781513
781513
|
async verify(pubkey, data2, signature) {
|
|
781514
|
-
const verifier =
|
|
781514
|
+
const verifier = crypto20.createVerify("RSA-SHA256");
|
|
781515
781515
|
verifier.update(data2);
|
|
781516
781516
|
verifier.end();
|
|
781517
781517
|
return verifier.verify(pubkey, signature, "base64");
|
|
781518
781518
|
}
|
|
781519
781519
|
async sign(privateKey, data2) {
|
|
781520
|
-
const signer =
|
|
781520
|
+
const signer = crypto20.createSign("RSA-SHA256");
|
|
781521
781521
|
signer.update(data2);
|
|
781522
781522
|
signer.end();
|
|
781523
781523
|
return signer.sign(privateKey, "base64");
|
|
@@ -781535,7 +781535,7 @@ var require_crypto5 = __commonJS({
|
|
|
781535
781535
|
* string in hexadecimal encoding.
|
|
781536
781536
|
*/
|
|
781537
781537
|
async sha256DigestHex(str3) {
|
|
781538
|
-
return
|
|
781538
|
+
return crypto20.createHash("sha256").update(str3).digest("hex");
|
|
781539
781539
|
}
|
|
781540
781540
|
/**
|
|
781541
781541
|
* Computes the HMAC hash of a message using the provided crypto key and the
|
|
@@ -781547,7 +781547,7 @@ var require_crypto5 = __commonJS({
|
|
|
781547
781547
|
*/
|
|
781548
781548
|
async signWithHmacSha256(key, msg) {
|
|
781549
781549
|
const cryptoKey = typeof key === "string" ? key : toBuffer(key);
|
|
781550
|
-
return toArrayBuffer(
|
|
781550
|
+
return toArrayBuffer(crypto20.createHmac("sha256", cryptoKey).update(msg).digest());
|
|
781551
781551
|
}
|
|
781552
781552
|
};
|
|
781553
781553
|
exports2.NodeCrypto = NodeCrypto;
|
|
@@ -782240,10 +782240,10 @@ var require_oauth2client2 = __commonJS({
|
|
|
782240
782240
|
* https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2-codeVerifier.js
|
|
782241
782241
|
*/
|
|
782242
782242
|
async generateCodeVerifierAsync() {
|
|
782243
|
-
const
|
|
782244
|
-
const randomString2 =
|
|
782243
|
+
const crypto20 = (0, crypto_1.createCrypto)();
|
|
782244
|
+
const randomString2 = crypto20.randomBytesBase64(96);
|
|
782245
782245
|
const codeVerifier = randomString2.replace(/\+/g, "~").replace(/=/g, "_").replace(/\//g, "-");
|
|
782246
|
-
const unencodedCodeChallenge = await
|
|
782246
|
+
const unencodedCodeChallenge = await crypto20.sha256DigestBase64(codeVerifier);
|
|
782247
782247
|
const codeChallenge = unencodedCodeChallenge.split("=")[0].replace(/\+/g, "-").replace(/\//g, "_");
|
|
782248
782248
|
return { codeVerifier, codeChallenge };
|
|
782249
782249
|
}
|
|
@@ -782684,7 +782684,7 @@ var require_oauth2client2 = __commonJS({
|
|
|
782684
782684
|
* @return Returns a promise resolving to LoginTicket on verification.
|
|
782685
782685
|
*/
|
|
782686
782686
|
async verifySignedJwtWithCertsAsync(jwt2, certs, requiredAudience, issuers, maxExpiry) {
|
|
782687
|
-
const
|
|
782687
|
+
const crypto20 = (0, crypto_1.createCrypto)();
|
|
782688
782688
|
if (!maxExpiry) {
|
|
782689
782689
|
maxExpiry = _OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;
|
|
782690
782690
|
}
|
|
@@ -782697,7 +782697,7 @@ var require_oauth2client2 = __commonJS({
|
|
|
782697
782697
|
let envelope;
|
|
782698
782698
|
let payload2;
|
|
782699
782699
|
try {
|
|
782700
|
-
envelope = JSON.parse(
|
|
782700
|
+
envelope = JSON.parse(crypto20.decodeBase64StringUtf8(segments[0]));
|
|
782701
782701
|
} catch (err7) {
|
|
782702
782702
|
if (err7 instanceof Error) {
|
|
782703
782703
|
err7.message = `Can't parse token envelope: ${segments[0]}': ${err7.message}`;
|
|
@@ -782708,7 +782708,7 @@ var require_oauth2client2 = __commonJS({
|
|
|
782708
782708
|
throw new Error("Can't parse token envelope: " + segments[0]);
|
|
782709
782709
|
}
|
|
782710
782710
|
try {
|
|
782711
|
-
payload2 = JSON.parse(
|
|
782711
|
+
payload2 = JSON.parse(crypto20.decodeBase64StringUtf8(segments[1]));
|
|
782712
782712
|
} catch (err7) {
|
|
782713
782713
|
if (err7 instanceof Error) {
|
|
782714
782714
|
err7.message = `Can't parse token payload '${segments[0]}`;
|
|
@@ -782725,7 +782725,7 @@ var require_oauth2client2 = __commonJS({
|
|
|
782725
782725
|
if (envelope.alg === "ES256") {
|
|
782726
782726
|
signature = formatEcdsa.joseToDer(signature, "ES256").toString("base64");
|
|
782727
782727
|
}
|
|
782728
|
-
const verified = await
|
|
782728
|
+
const verified = await crypto20.verify(cert, signed, signature);
|
|
782729
782729
|
if (!verified) {
|
|
782730
782730
|
throw new Error("Invalid token signature: " + jwt2);
|
|
782731
782731
|
}
|
|
@@ -785295,14 +785295,14 @@ var require_awsrequestsigner2 = __commonJS({
|
|
|
785295
785295
|
}
|
|
785296
785296
|
};
|
|
785297
785297
|
exports2.AwsRequestSigner = AwsRequestSigner;
|
|
785298
|
-
async function sign(
|
|
785299
|
-
return await
|
|
785300
|
-
}
|
|
785301
|
-
async function getSigningKey(
|
|
785302
|
-
const kDate = await sign(
|
|
785303
|
-
const kRegion = await sign(
|
|
785304
|
-
const kService = await sign(
|
|
785305
|
-
const kSigning = await sign(
|
|
785298
|
+
async function sign(crypto20, key, msg) {
|
|
785299
|
+
return await crypto20.signWithHmacSha256(key, msg);
|
|
785300
|
+
}
|
|
785301
|
+
async function getSigningKey(crypto20, key, dateStamp, region, serviceName) {
|
|
785302
|
+
const kDate = await sign(crypto20, `AWS4${key}`, dateStamp);
|
|
785303
|
+
const kRegion = await sign(crypto20, kDate, region);
|
|
785304
|
+
const kService = await sign(crypto20, kRegion, serviceName);
|
|
785305
|
+
const kSigning = await sign(crypto20, kService, "aws4_request");
|
|
785306
785306
|
return kSigning;
|
|
785307
785307
|
}
|
|
785308
785308
|
async function generateAuthenticationHeaderMap(options3) {
|
|
@@ -787021,24 +787021,24 @@ var require_googleauth2 = __commonJS({
|
|
|
787021
787021
|
const signed = await client.sign(data2);
|
|
787022
787022
|
return signed.signedBlob;
|
|
787023
787023
|
}
|
|
787024
|
-
const
|
|
787024
|
+
const crypto20 = (0, crypto_1.createCrypto)();
|
|
787025
787025
|
if (client instanceof jwtclient_1.JWT && client.key) {
|
|
787026
|
-
const sign = await
|
|
787026
|
+
const sign = await crypto20.sign(client.key, data2);
|
|
787027
787027
|
return sign;
|
|
787028
787028
|
}
|
|
787029
787029
|
const creds = await this.getCredentials();
|
|
787030
787030
|
if (!creds.client_email) {
|
|
787031
787031
|
throw new Error("Cannot sign data without `client_email`.");
|
|
787032
787032
|
}
|
|
787033
|
-
return this.signBlob(
|
|
787033
|
+
return this.signBlob(crypto20, creds.client_email, data2, endpoint);
|
|
787034
787034
|
}
|
|
787035
|
-
async signBlob(
|
|
787035
|
+
async signBlob(crypto20, emailOrUniqueId, data2, endpoint) {
|
|
787036
787036
|
const url2 = new URL(endpoint + `${emailOrUniqueId}:signBlob`);
|
|
787037
787037
|
const res = await this.request({
|
|
787038
787038
|
method: "POST",
|
|
787039
787039
|
url: url2.href,
|
|
787040
787040
|
data: {
|
|
787041
|
-
payload:
|
|
787041
|
+
payload: crypto20.encodeBase64StringUtf8(data2)
|
|
787042
787042
|
},
|
|
787043
787043
|
retry: true,
|
|
787044
787044
|
retryConfig: {
|
|
@@ -803498,13 +803498,13 @@ var init_node = __esm({
|
|
|
803498
803498
|
}
|
|
803499
803499
|
};
|
|
803500
803500
|
uuid4Internal = function() {
|
|
803501
|
-
const { crypto:
|
|
803502
|
-
if (
|
|
803503
|
-
uuid4Internal =
|
|
803504
|
-
return
|
|
803501
|
+
const { crypto: crypto20 } = globalThis;
|
|
803502
|
+
if (crypto20 === null || crypto20 === void 0 ? void 0 : crypto20.randomUUID) {
|
|
803503
|
+
uuid4Internal = crypto20.randomUUID.bind(crypto20);
|
|
803504
|
+
return crypto20.randomUUID();
|
|
803505
803505
|
}
|
|
803506
803506
|
const u82 = new Uint8Array(1);
|
|
803507
|
-
const randomByte =
|
|
803507
|
+
const randomByte = crypto20 ? () => crypto20.getRandomValues(u82)[0] : () => Math.random() * 255 & 255;
|
|
803508
803508
|
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c12) => (+c12 ^ randomByte() & 15 >> +c12 / 4).toString(16));
|
|
803509
803509
|
};
|
|
803510
803510
|
uuid44 = () => uuid4Internal();
|
|
@@ -826017,7 +826017,7 @@ var require_helpers2 = __commonJS({
|
|
|
826017
826017
|
"node_modules/.pnpm/@cypress+request@3.0.10/node_modules/@cypress/request/lib/helpers.js"(exports2) {
|
|
826018
826018
|
"use strict";
|
|
826019
826019
|
var jsonSafeStringify = require_stringify3();
|
|
826020
|
-
var
|
|
826020
|
+
var crypto20 = require("crypto");
|
|
826021
826021
|
var Buffer5 = require_safe_buffer().Buffer;
|
|
826022
826022
|
var defer = typeof setImmediate === "undefined" ? process.nextTick : setImmediate;
|
|
826023
826023
|
function paramsHaveRequestBody(params) {
|
|
@@ -826033,7 +826033,7 @@ var require_helpers2 = __commonJS({
|
|
|
826033
826033
|
return ret2;
|
|
826034
826034
|
}
|
|
826035
826035
|
function md53(str3) {
|
|
826036
|
-
return
|
|
826036
|
+
return crypto20.createHash("md5").update(str3).digest("hex");
|
|
826037
826037
|
}
|
|
826038
826038
|
function isReadStream(rs) {
|
|
826039
826039
|
return rs.readable && rs.path && rs.mode;
|
|
@@ -826070,7 +826070,7 @@ var require_helpers2 = __commonJS({
|
|
|
826070
826070
|
// node_modules/.pnpm/aws-sign2@0.7.0/node_modules/aws-sign2/index.js
|
|
826071
826071
|
var require_aws_sign2 = __commonJS({
|
|
826072
826072
|
"node_modules/.pnpm/aws-sign2@0.7.0/node_modules/aws-sign2/index.js"(exports2, module2) {
|
|
826073
|
-
var
|
|
826073
|
+
var crypto20 = require("crypto");
|
|
826074
826074
|
var parse5 = require("url").parse;
|
|
826075
826075
|
var keys = [
|
|
826076
826076
|
"acl",
|
|
@@ -826094,7 +826094,7 @@ var require_aws_sign2 = __commonJS({
|
|
|
826094
826094
|
module2.exports = authorization;
|
|
826095
826095
|
module2.exports.authorization = authorization;
|
|
826096
826096
|
function hmacSha1(options3) {
|
|
826097
|
-
return
|
|
826097
|
+
return crypto20.createHmac("sha1", options3.secret).update(options3.message).digest("base64");
|
|
826098
826098
|
}
|
|
826099
826099
|
module2.exports.hmacSha1 = hmacSha1;
|
|
826100
826100
|
function sign(options3) {
|
|
@@ -826241,14 +826241,14 @@ var require_aws4 = __commonJS({
|
|
|
826241
826241
|
var aws4 = exports2;
|
|
826242
826242
|
var url2 = require("url");
|
|
826243
826243
|
var querystring = require("querystring");
|
|
826244
|
-
var
|
|
826244
|
+
var crypto20 = require("crypto");
|
|
826245
826245
|
var lru = require_lru();
|
|
826246
826246
|
var credentialsCache = lru(1e3);
|
|
826247
826247
|
function hmac3(key, string6, encoding) {
|
|
826248
|
-
return
|
|
826248
|
+
return crypto20.createHmac("sha256", key).update(string6, "utf8").digest(encoding);
|
|
826249
826249
|
}
|
|
826250
826250
|
function hash3(string6, encoding) {
|
|
826251
|
-
return
|
|
826251
|
+
return crypto20.createHash("sha256").update(string6, "utf8").digest(encoding);
|
|
826252
826252
|
}
|
|
826253
826253
|
function encodeRfc3986(urlEncodedString) {
|
|
826254
826254
|
return urlEncodedString.replace(/[!'()*]/g, function(c12) {
|
|
@@ -831291,22 +831291,22 @@ var require_nacl_fast = __commonJS({
|
|
|
831291
831291
|
randombytes = fn2;
|
|
831292
831292
|
};
|
|
831293
831293
|
(function() {
|
|
831294
|
-
var
|
|
831295
|
-
if (
|
|
831294
|
+
var crypto20 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null;
|
|
831295
|
+
if (crypto20 && crypto20.getRandomValues) {
|
|
831296
831296
|
var QUOTA = 65536;
|
|
831297
831297
|
nacl.setPRNG(function(x14, n6) {
|
|
831298
831298
|
var i11, v15 = new Uint8Array(n6);
|
|
831299
831299
|
for (i11 = 0; i11 < n6; i11 += QUOTA) {
|
|
831300
|
-
|
|
831300
|
+
crypto20.getRandomValues(v15.subarray(i11, i11 + Math.min(n6 - i11, QUOTA)));
|
|
831301
831301
|
}
|
|
831302
831302
|
for (i11 = 0; i11 < n6; i11++) x14[i11] = v15[i11];
|
|
831303
831303
|
cleanup(v15);
|
|
831304
831304
|
});
|
|
831305
831305
|
} else if (typeof require !== "undefined") {
|
|
831306
|
-
|
|
831307
|
-
if (
|
|
831306
|
+
crypto20 = require("crypto");
|
|
831307
|
+
if (crypto20 && crypto20.randomBytes) {
|
|
831308
831308
|
nacl.setPRNG(function(x14, n6) {
|
|
831309
|
-
var i11, v15 =
|
|
831309
|
+
var i11, v15 = crypto20.randomBytes(n6);
|
|
831310
831310
|
for (i11 = 0; i11 < n6; i11++) x14[i11] = v15[i11];
|
|
831311
831311
|
cleanup(v15);
|
|
831312
831312
|
});
|
|
@@ -831344,7 +831344,7 @@ var require_utils7 = __commonJS({
|
|
|
831344
831344
|
var Buffer5 = require_safer().Buffer;
|
|
831345
831345
|
var PrivateKey = require_private_key();
|
|
831346
831346
|
var Key = require_key();
|
|
831347
|
-
var
|
|
831347
|
+
var crypto20 = require("crypto");
|
|
831348
831348
|
var algs = require_algs();
|
|
831349
831349
|
var asn1 = require_lib7();
|
|
831350
831350
|
var ec = require_ec();
|
|
@@ -831428,7 +831428,7 @@ var require_utils7 = __commonJS({
|
|
|
831428
831428
|
bufs.push(salt);
|
|
831429
831429
|
D8 = Buffer5.concat(bufs);
|
|
831430
831430
|
for (var j8 = 0; j8 < count; ++j8)
|
|
831431
|
-
D8 =
|
|
831431
|
+
D8 = crypto20.createHash("md5").update(D8).digest();
|
|
831432
831432
|
material = Buffer5.concat([material, D8]);
|
|
831433
831433
|
D_prev = D8;
|
|
831434
831434
|
}
|
|
@@ -831450,13 +831450,13 @@ var require_utils7 = __commonJS({
|
|
|
831450
831450
|
return Buffer5.concat(ts).slice(0, size);
|
|
831451
831451
|
function T13(I11) {
|
|
831452
831452
|
hkey.writeUInt32BE(I11, hkey.length - 4);
|
|
831453
|
-
var hmac3 =
|
|
831453
|
+
var hmac3 = crypto20.createHmac(hashAlg, passphrase);
|
|
831454
831454
|
hmac3.update(hkey);
|
|
831455
831455
|
var Ti = hmac3.digest();
|
|
831456
831456
|
var Uc = Ti;
|
|
831457
831457
|
var c12 = 1;
|
|
831458
831458
|
while (c12++ < iterations) {
|
|
831459
|
-
hmac3 =
|
|
831459
|
+
hmac3 = crypto20.createHmac(hashAlg, passphrase);
|
|
831460
831460
|
hmac3.update(Uc);
|
|
831461
831461
|
Uc = hmac3.digest();
|
|
831462
831462
|
for (var x14 = 0; x14 < Ti.length; ++x14)
|
|
@@ -831825,7 +831825,7 @@ var require_signature = __commonJS({
|
|
|
831825
831825
|
var assert4 = require_assert();
|
|
831826
831826
|
var Buffer5 = require_safer().Buffer;
|
|
831827
831827
|
var algs = require_algs();
|
|
831828
|
-
var
|
|
831828
|
+
var crypto20 = require("crypto");
|
|
831829
831829
|
var errs = require_errors8();
|
|
831830
831830
|
var utils = require_utils7();
|
|
831831
831831
|
var asn1 = require_lib7();
|
|
@@ -832203,7 +832203,7 @@ var require_sec = __commonJS({
|
|
|
832203
832203
|
// node_modules/.pnpm/ecc-jsbn@0.1.2/node_modules/ecc-jsbn/index.js
|
|
832204
832204
|
var require_ecc_jsbn = __commonJS({
|
|
832205
832205
|
"node_modules/.pnpm/ecc-jsbn@0.1.2/node_modules/ecc-jsbn/index.js"(exports2) {
|
|
832206
|
-
var
|
|
832206
|
+
var crypto20 = require("crypto");
|
|
832207
832207
|
var BigInteger = require_jsbn().BigInteger;
|
|
832208
832208
|
var ECPointFp = require_ec().ECPointFp;
|
|
832209
832209
|
var Buffer5 = require_safer().Buffer;
|
|
@@ -832226,7 +832226,7 @@ var require_ecc_jsbn = __commonJS({
|
|
|
832226
832226
|
}
|
|
832227
832227
|
} else {
|
|
832228
832228
|
var n1 = n6.subtract(BigInteger.ONE);
|
|
832229
|
-
var r11 = new BigInteger(
|
|
832229
|
+
var r11 = new BigInteger(crypto20.randomBytes(n6.bitLength()));
|
|
832230
832230
|
priv = r11.mod(n1).add(BigInteger.ONE);
|
|
832231
832231
|
this.P = c12.getG().multiply(priv);
|
|
832232
832232
|
}
|
|
@@ -832254,14 +832254,14 @@ var require_dhe = __commonJS({
|
|
|
832254
832254
|
generateED25519
|
|
832255
832255
|
};
|
|
832256
832256
|
var assert4 = require_assert();
|
|
832257
|
-
var
|
|
832257
|
+
var crypto20 = require("crypto");
|
|
832258
832258
|
var Buffer5 = require_safer().Buffer;
|
|
832259
832259
|
var algs = require_algs();
|
|
832260
832260
|
var utils = require_utils7();
|
|
832261
832261
|
var nacl = require_nacl_fast();
|
|
832262
832262
|
var Key = require_key();
|
|
832263
832263
|
var PrivateKey = require_private_key();
|
|
832264
|
-
var CRYPTO_HAVE_ECDH =
|
|
832264
|
+
var CRYPTO_HAVE_ECDH = crypto20.createECDH !== void 0;
|
|
832265
832265
|
var ecdh = require_ecc_jsbn();
|
|
832266
832266
|
var ec = require_ec();
|
|
832267
832267
|
var jsbn = require_jsbn().BigInteger;
|
|
@@ -832275,7 +832275,7 @@ var require_dhe = __commonJS({
|
|
|
832275
832275
|
if (!CRYPTO_HAVE_ECDH) {
|
|
832276
832276
|
throw new Error("Due to bugs in the node 0.10 crypto API, node 0.12.x or later is required to use DH");
|
|
832277
832277
|
}
|
|
832278
|
-
this._dh =
|
|
832278
|
+
this._dh = crypto20.createDiffieHellman(
|
|
832279
832279
|
key.part.p.data,
|
|
832280
832280
|
void 0,
|
|
832281
832281
|
key.part.g.data,
|
|
@@ -832302,7 +832302,7 @@ var require_dhe = __commonJS({
|
|
|
832302
832302
|
"nistp384": "secp384r1",
|
|
832303
832303
|
"nistp521": "secp521r1"
|
|
832304
832304
|
}[key.curve];
|
|
832305
|
-
this._dh =
|
|
832305
|
+
this._dh = crypto20.createECDH(curve);
|
|
832306
832306
|
if (typeof this._dh !== "object" || typeof this._dh.setPrivateKey !== "function") {
|
|
832307
832307
|
CRYPTO_HAVE_ECDH = false;
|
|
832308
832308
|
DiffieHellman.call(this, key);
|
|
@@ -832454,7 +832454,7 @@ var require_dhe = __commonJS({
|
|
|
832454
832454
|
return this._key;
|
|
832455
832455
|
} else {
|
|
832456
832456
|
var n6 = this._ecParams.getN();
|
|
832457
|
-
var r11 = new jsbn(
|
|
832457
|
+
var r11 = new jsbn(crypto20.randomBytes(n6.bitLength()));
|
|
832458
832458
|
var n1 = n6.subtract(jsbn.ONE);
|
|
832459
832459
|
priv = r11.mod(n1).add(jsbn.ONE);
|
|
832460
832460
|
pub = this._ecParams.getG().multiply(priv);
|
|
@@ -832560,7 +832560,7 @@ var require_dhe = __commonJS({
|
|
|
832560
832560
|
"nistp384": "secp384r1",
|
|
832561
832561
|
"nistp521": "secp521r1"
|
|
832562
832562
|
}[curve];
|
|
832563
|
-
var dh =
|
|
832563
|
+
var dh = crypto20.createECDH(osCurve);
|
|
832564
832564
|
dh.generateKeys();
|
|
832565
832565
|
parts.push({
|
|
832566
832566
|
name: "curve",
|
|
@@ -832578,7 +832578,7 @@ var require_dhe = __commonJS({
|
|
|
832578
832578
|
var ecParams = new X9ECParameters(curve);
|
|
832579
832579
|
var n6 = ecParams.getN();
|
|
832580
832580
|
var cByteLen = Math.ceil((n6.bitLength() + 64) / 8);
|
|
832581
|
-
var c12 = new jsbn(
|
|
832581
|
+
var c12 = new jsbn(crypto20.randomBytes(cByteLen));
|
|
832582
832582
|
var n1 = n6.subtract(jsbn.ONE);
|
|
832583
832583
|
var priv = c12.mod(n1).add(jsbn.ONE);
|
|
832584
832584
|
var pub = ecParams.getG().multiply(priv);
|
|
@@ -834927,7 +834927,7 @@ var require_ssh_private = __commonJS({
|
|
|
834927
834927
|
var Buffer5 = require_safer().Buffer;
|
|
834928
834928
|
var algs = require_algs();
|
|
834929
834929
|
var utils = require_utils7();
|
|
834930
|
-
var
|
|
834930
|
+
var crypto20 = require("crypto");
|
|
834931
834931
|
var Key = require_key();
|
|
834932
834932
|
var PrivateKey = require_private_key();
|
|
834933
834933
|
var pem = require_pem();
|
|
@@ -835001,7 +835001,7 @@ var require_ssh_private = __commonJS({
|
|
|
835001
835001
|
out = Buffer5.from(out);
|
|
835002
835002
|
var ckey = out.slice(0, cinf.keySize);
|
|
835003
835003
|
var iv2 = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
|
|
835004
|
-
var cipherStream =
|
|
835004
|
+
var cipherStream = crypto20.createDecipheriv(
|
|
835005
835005
|
cinf.opensslName,
|
|
835006
835006
|
ckey,
|
|
835007
835007
|
iv2
|
|
@@ -835066,7 +835066,7 @@ var require_ssh_private = __commonJS({
|
|
|
835066
835066
|
var privBuf;
|
|
835067
835067
|
if (PrivateKey.isPrivateKey(key)) {
|
|
835068
835068
|
privBuf = new SSHBuffer({});
|
|
835069
|
-
var checkInt =
|
|
835069
|
+
var checkInt = crypto20.randomBytes(4).readUInt32BE(0);
|
|
835070
835070
|
privBuf.writeInt(checkInt);
|
|
835071
835071
|
privBuf.writeInt(checkInt);
|
|
835072
835072
|
privBuf.write(key.toBuffer("rfc4253"));
|
|
@@ -835080,7 +835080,7 @@ var require_ssh_private = __commonJS({
|
|
|
835080
835080
|
case "none":
|
|
835081
835081
|
break;
|
|
835082
835082
|
case "bcrypt":
|
|
835083
|
-
var salt =
|
|
835083
|
+
var salt = crypto20.randomBytes(16);
|
|
835084
835084
|
var rounds = 16;
|
|
835085
835085
|
var kdfssh = new SSHBuffer({});
|
|
835086
835086
|
kdfssh.writeBuffer(salt);
|
|
@@ -835107,7 +835107,7 @@ var require_ssh_private = __commonJS({
|
|
|
835107
835107
|
out = Buffer5.from(out);
|
|
835108
835108
|
var ckey = out.slice(0, cinf.keySize);
|
|
835109
835109
|
var iv2 = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
|
|
835110
|
-
var cipherStream =
|
|
835110
|
+
var cipherStream = crypto20.createCipheriv(
|
|
835111
835111
|
cinf.opensslName,
|
|
835112
835112
|
ckey,
|
|
835113
835113
|
iv2
|
|
@@ -835169,7 +835169,7 @@ var require_pem = __commonJS({
|
|
|
835169
835169
|
};
|
|
835170
835170
|
var assert4 = require_assert();
|
|
835171
835171
|
var asn1 = require_lib7();
|
|
835172
|
-
var
|
|
835172
|
+
var crypto20 = require("crypto");
|
|
835173
835173
|
var Buffer5 = require_safer().Buffer;
|
|
835174
835174
|
var algs = require_algs();
|
|
835175
835175
|
var utils = require_utils7();
|
|
@@ -835337,7 +835337,7 @@ var require_pem = __commonJS({
|
|
|
835337
835337
|
alg = void 0;
|
|
835338
835338
|
}
|
|
835339
835339
|
if (cipher && key && iv2) {
|
|
835340
|
-
var cipherStream =
|
|
835340
|
+
var cipherStream = crypto20.createDecipheriv(cipher, key, iv2);
|
|
835341
835341
|
var chunk, chunks = [];
|
|
835342
835342
|
cipherStream.once("error", function(e11) {
|
|
835343
835343
|
if (e11.toString().indexOf("bad decrypt") !== -1) {
|
|
@@ -835762,7 +835762,7 @@ var require_putty = __commonJS({
|
|
|
835762
835762
|
var rfc4253 = require_rfc4253();
|
|
835763
835763
|
var Key = require_key();
|
|
835764
835764
|
var SSHBuffer = require_ssh_buffer();
|
|
835765
|
-
var
|
|
835765
|
+
var crypto20 = require("crypto");
|
|
835766
835766
|
var PrivateKey = require_private_key();
|
|
835767
835767
|
var errors2 = require_errors8();
|
|
835768
835768
|
function read(buf, options3) {
|
|
@@ -835832,7 +835832,7 @@ var require_putty = __commonJS({
|
|
|
835832
835832
|
);
|
|
835833
835833
|
}
|
|
835834
835834
|
var iv2 = Buffer5.alloc(16, 0);
|
|
835835
|
-
var decipher =
|
|
835835
|
+
var decipher = crypto20.createDecipheriv(
|
|
835836
835836
|
"aes-256-cbc",
|
|
835837
835837
|
derivePPK2EncryptionKey(options3.passphrase),
|
|
835838
835838
|
iv2
|
|
@@ -835883,11 +835883,11 @@ var require_putty = __commonJS({
|
|
|
835883
835883
|
return key;
|
|
835884
835884
|
}
|
|
835885
835885
|
function derivePPK2EncryptionKey(passphrase) {
|
|
835886
|
-
var hash1 =
|
|
835886
|
+
var hash1 = crypto20.createHash("sha1").update(Buffer5.concat([
|
|
835887
835887
|
Buffer5.from([0, 0, 0, 0]),
|
|
835888
835888
|
Buffer5.from(passphrase)
|
|
835889
835889
|
])).digest();
|
|
835890
|
-
var hash22 =
|
|
835890
|
+
var hash22 = crypto20.createHash("sha1").update(Buffer5.concat([
|
|
835891
835891
|
Buffer5.from([0, 0, 0, 1]),
|
|
835892
835892
|
Buffer5.from(passphrase)
|
|
835893
835893
|
])).digest();
|
|
@@ -836041,7 +836041,7 @@ var require_private_key = __commonJS({
|
|
|
836041
836041
|
var assert4 = require_assert();
|
|
836042
836042
|
var Buffer5 = require_safer().Buffer;
|
|
836043
836043
|
var algs = require_algs();
|
|
836044
|
-
var
|
|
836044
|
+
var crypto20 = require("crypto");
|
|
836045
836045
|
var Fingerprint = require_fingerprint();
|
|
836046
836046
|
var Signature2 = require_signature();
|
|
836047
836047
|
var errs = require_errors8();
|
|
@@ -836152,14 +836152,14 @@ var require_private_key = __commonJS({
|
|
|
836152
836152
|
var v15, nm, err7;
|
|
836153
836153
|
try {
|
|
836154
836154
|
nm = hashAlgo.toUpperCase();
|
|
836155
|
-
v15 =
|
|
836155
|
+
v15 = crypto20.createSign(nm);
|
|
836156
836156
|
} catch (e11) {
|
|
836157
836157
|
err7 = e11;
|
|
836158
836158
|
}
|
|
836159
836159
|
if (v15 === void 0 || err7 instanceof Error && err7.message.match(/Unknown message digest/)) {
|
|
836160
836160
|
nm = "RSA-";
|
|
836161
836161
|
nm += hashAlgo.toUpperCase();
|
|
836162
|
-
v15 =
|
|
836162
|
+
v15 = crypto20.createSign(nm);
|
|
836163
836163
|
}
|
|
836164
836164
|
assert4.ok(v15, "failed to create verifier");
|
|
836165
836165
|
var oldSign = v15.sign.bind(v15);
|
|
@@ -836244,7 +836244,7 @@ var require_identity = __commonJS({
|
|
|
836244
836244
|
module2.exports = Identity;
|
|
836245
836245
|
var assert4 = require_assert();
|
|
836246
836246
|
var algs = require_algs();
|
|
836247
|
-
var
|
|
836247
|
+
var crypto20 = require("crypto");
|
|
836248
836248
|
var Fingerprint = require_fingerprint();
|
|
836249
836249
|
var Signature2 = require_signature();
|
|
836250
836250
|
var errs = require_errors8();
|
|
@@ -836561,7 +836561,7 @@ var require_openssh_cert = __commonJS({
|
|
|
836561
836561
|
};
|
|
836562
836562
|
var assert4 = require_assert();
|
|
836563
836563
|
var SSHBuffer = require_ssh_buffer();
|
|
836564
|
-
var
|
|
836564
|
+
var crypto20 = require("crypto");
|
|
836565
836565
|
var Buffer5 = require_safer().Buffer;
|
|
836566
836566
|
var algs = require_algs();
|
|
836567
836567
|
var Key = require_key();
|
|
@@ -836750,7 +836750,7 @@ var require_openssh_cert = __commonJS({
|
|
|
836750
836750
|
assert4.object(cert.signatures.openssh, "signature for openssh format");
|
|
836751
836751
|
var sig = cert.signatures.openssh;
|
|
836752
836752
|
if (sig.nonce === void 0)
|
|
836753
|
-
sig.nonce =
|
|
836753
|
+
sig.nonce = crypto20.randomBytes(16);
|
|
836754
836754
|
var buf = new SSHBuffer({});
|
|
836755
836755
|
buf.writeString(getCertType(cert.subjectKey));
|
|
836756
836756
|
buf.writeBuffer(sig.nonce);
|
|
@@ -837553,7 +837553,7 @@ var require_certificate = __commonJS({
|
|
|
837553
837553
|
var assert4 = require_assert();
|
|
837554
837554
|
var Buffer5 = require_safer().Buffer;
|
|
837555
837555
|
var algs = require_algs();
|
|
837556
|
-
var
|
|
837556
|
+
var crypto20 = require("crypto");
|
|
837557
837557
|
var Fingerprint = require_fingerprint();
|
|
837558
837558
|
var Signature2 = require_signature();
|
|
837559
837559
|
var errs = require_errors8();
|
|
@@ -837640,7 +837640,7 @@ var require_certificate = __commonJS({
|
|
|
837640
837640
|
throw new InvalidAlgorithmError(algo);
|
|
837641
837641
|
if (this._hashCache[algo])
|
|
837642
837642
|
return this._hashCache[algo];
|
|
837643
|
-
var hash3 =
|
|
837643
|
+
var hash3 = crypto20.createHash(algo).update(this.toBuffer("x509")).digest();
|
|
837644
837644
|
this._hashCache[algo] = hash3;
|
|
837645
837645
|
return hash3;
|
|
837646
837646
|
};
|
|
@@ -837910,7 +837910,7 @@ var require_fingerprint = __commonJS({
|
|
|
837910
837910
|
var assert4 = require_assert();
|
|
837911
837911
|
var Buffer5 = require_safer().Buffer;
|
|
837912
837912
|
var algs = require_algs();
|
|
837913
|
-
var
|
|
837913
|
+
var crypto20 = require("crypto");
|
|
837914
837914
|
var errs = require_errors8();
|
|
837915
837915
|
var Key = require_key();
|
|
837916
837916
|
var PrivateKey = require_private_key();
|
|
@@ -837977,9 +837977,9 @@ var require_fingerprint = __commonJS({
|
|
|
837977
837977
|
);
|
|
837978
837978
|
}
|
|
837979
837979
|
var theirHash = other.hash(this.algorithm, this.hashType);
|
|
837980
|
-
var theirHash2 =
|
|
837980
|
+
var theirHash2 = crypto20.createHash(this.algorithm).update(theirHash).digest("base64");
|
|
837981
837981
|
if (this.hash2 === void 0)
|
|
837982
|
-
this.hash2 =
|
|
837982
|
+
this.hash2 = crypto20.createHash(this.algorithm).update(this.hash).digest("base64");
|
|
837983
837983
|
return this.hash2 === theirHash2;
|
|
837984
837984
|
};
|
|
837985
837985
|
var base64RE = /^[A-Za-z0-9+\/=]+$/;
|
|
@@ -838104,7 +838104,7 @@ var require_key = __commonJS({
|
|
|
838104
838104
|
module2.exports = Key;
|
|
838105
838105
|
var assert4 = require_assert();
|
|
838106
838106
|
var algs = require_algs();
|
|
838107
|
-
var
|
|
838107
|
+
var crypto20 = require("crypto");
|
|
838108
838108
|
var Fingerprint = require_fingerprint();
|
|
838109
838109
|
var Signature2 = require_signature();
|
|
838110
838110
|
var DiffieHellman = require_dhe().DiffieHellman;
|
|
@@ -838202,7 +838202,7 @@ var require_key = __commonJS({
|
|
|
838202
838202
|
} else {
|
|
838203
838203
|
throw new Error("Hash type " + type + " not supported");
|
|
838204
838204
|
}
|
|
838205
|
-
var hash3 =
|
|
838205
|
+
var hash3 = crypto20.createHash(algo).update(buf).digest();
|
|
838206
838206
|
this._hashCache[cacheKey] = hash3;
|
|
838207
838207
|
return hash3;
|
|
838208
838208
|
};
|
|
@@ -838250,14 +838250,14 @@ var require_key = __commonJS({
|
|
|
838250
838250
|
var v15, nm, err7;
|
|
838251
838251
|
try {
|
|
838252
838252
|
nm = hashAlgo.toUpperCase();
|
|
838253
|
-
v15 =
|
|
838253
|
+
v15 = crypto20.createVerify(nm);
|
|
838254
838254
|
} catch (e11) {
|
|
838255
838255
|
err7 = e11;
|
|
838256
838256
|
}
|
|
838257
838257
|
if (v15 === void 0 || err7 instanceof Error && err7.message.match(/Unknown message digest/)) {
|
|
838258
838258
|
nm = "RSA-";
|
|
838259
838259
|
nm += hashAlgo.toUpperCase();
|
|
838260
|
-
v15 =
|
|
838260
|
+
v15 = crypto20.createVerify(nm);
|
|
838261
838261
|
}
|
|
838262
838262
|
assert4.ok(v15, "failed to create verifier");
|
|
838263
838263
|
var oldVerify = v15.verify.bind(v15);
|
|
@@ -839927,7 +839927,7 @@ var require_jsprim = __commonJS({
|
|
|
839927
839927
|
var require_signer = __commonJS({
|
|
839928
839928
|
"node_modules/.pnpm/http-signature@1.4.0/node_modules/http-signature/lib/signer.js"(exports2, module2) {
|
|
839929
839929
|
var assert4 = require_assert();
|
|
839930
|
-
var
|
|
839930
|
+
var crypto20 = require("crypto");
|
|
839931
839931
|
var util2 = require("util");
|
|
839932
839932
|
var sshpk = require_lib8();
|
|
839933
839933
|
var jsprim = require_jsprim();
|
|
@@ -839990,7 +839990,7 @@ var require_signer = __commonJS({
|
|
|
839990
839990
|
this.rs_keyId = options3.keyId;
|
|
839991
839991
|
if (typeof options3.key !== "string" && !Buffer.isBuffer(options3.key))
|
|
839992
839992
|
throw new TypeError("options.key for HMAC must be a string or Buffer");
|
|
839993
|
-
this.rs_signer =
|
|
839993
|
+
this.rs_signer = crypto20.createHmac(alg[1].toUpperCase(), options3.key);
|
|
839994
839994
|
this.rs_signer.sign = function() {
|
|
839995
839995
|
var digest = this.digest("base64");
|
|
839996
839996
|
return {
|
|
@@ -840271,7 +840271,7 @@ var require_signer = __commonJS({
|
|
|
840271
840271
|
}
|
|
840272
840272
|
var signature;
|
|
840273
840273
|
if (alg[0] === "hmac") {
|
|
840274
|
-
var hmac3 =
|
|
840274
|
+
var hmac3 = crypto20.createHmac(alg[1].toUpperCase(), key);
|
|
840275
840275
|
hmac3.update(stringToSign);
|
|
840276
840276
|
signature = hmac3.digest("base64");
|
|
840277
840277
|
} else {
|
|
@@ -840307,7 +840307,7 @@ var require_signer = __commonJS({
|
|
|
840307
840307
|
var require_verify = __commonJS({
|
|
840308
840308
|
"node_modules/.pnpm/http-signature@1.4.0/node_modules/http-signature/lib/verify.js"(exports2, module2) {
|
|
840309
840309
|
var assert4 = require_assert();
|
|
840310
|
-
var
|
|
840310
|
+
var crypto20 = require("crypto");
|
|
840311
840311
|
var sshpk = require_lib8();
|
|
840312
840312
|
var utils = require_utils8();
|
|
840313
840313
|
var HASH_ALGOS = utils.HASH_ALGOS;
|
|
@@ -840355,12 +840355,12 @@ var require_verify = __commonJS({
|
|
|
840355
840355
|
if (alg[0] !== "hmac")
|
|
840356
840356
|
return false;
|
|
840357
840357
|
var hashAlg = alg[1].toUpperCase();
|
|
840358
|
-
var hmac3 =
|
|
840358
|
+
var hmac3 = crypto20.createHmac(hashAlg, secret);
|
|
840359
840359
|
hmac3.update(parsedSignature.signingString);
|
|
840360
|
-
var h14 =
|
|
840360
|
+
var h14 = crypto20.createHmac(hashAlg, secret);
|
|
840361
840361
|
h14.update(hmac3.digest());
|
|
840362
840362
|
h14 = h14.digest();
|
|
840363
|
-
var h23 =
|
|
840363
|
+
var h23 = crypto20.createHmac(hashAlg, secret);
|
|
840364
840364
|
h23.update(new Buffer(parsedSignature.params.signature, "base64"));
|
|
840365
840365
|
h23 = h23.digest();
|
|
840366
840366
|
if (typeof h14 === "string")
|
|
@@ -849731,7 +849731,7 @@ var require_form_data = __commonJS({
|
|
|
849731
849731
|
var parseUrl4 = require("url").parse;
|
|
849732
849732
|
var fs80 = require("fs");
|
|
849733
849733
|
var Stream7 = require("stream").Stream;
|
|
849734
|
-
var
|
|
849734
|
+
var crypto20 = require("crypto");
|
|
849735
849735
|
var mime = require_mime_types();
|
|
849736
849736
|
var asynckit = require_asynckit();
|
|
849737
849737
|
var setToStringTag = require_es_set_tostringtag();
|
|
@@ -849937,7 +849937,7 @@ var require_form_data = __commonJS({
|
|
|
849937
849937
|
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
849938
849938
|
};
|
|
849939
849939
|
FormData4.prototype._generateBoundary = function() {
|
|
849940
|
-
this._boundary = "--------------------------" +
|
|
849940
|
+
this._boundary = "--------------------------" + crypto20.randomBytes(12).toString("hex");
|
|
849941
849941
|
};
|
|
849942
849942
|
FormData4.prototype.getLengthSync = function() {
|
|
849943
849943
|
var knownLength = this._overheadLength + this._valueLength;
|
|
@@ -851698,15 +851698,15 @@ var require_auth = __commonJS({
|
|
|
851698
851698
|
var require_hawk = __commonJS({
|
|
851699
851699
|
"node_modules/.pnpm/@cypress+request@3.0.10/node_modules/@cypress/request/lib/hawk.js"(exports2) {
|
|
851700
851700
|
"use strict";
|
|
851701
|
-
var
|
|
851701
|
+
var crypto20 = require("crypto");
|
|
851702
851702
|
function randomString2(size) {
|
|
851703
851703
|
var bits = (size + 1) * 6;
|
|
851704
|
-
var buffer =
|
|
851704
|
+
var buffer = crypto20.randomBytes(Math.ceil(bits / 8));
|
|
851705
851705
|
var string6 = buffer.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
851706
851706
|
return string6.slice(0, size);
|
|
851707
851707
|
}
|
|
851708
851708
|
function calculatePayloadHash(payload2, algorithm, contentType) {
|
|
851709
|
-
var hash3 =
|
|
851709
|
+
var hash3 = crypto20.createHash(algorithm);
|
|
851710
851710
|
hash3.update("hawk.1.payload\n");
|
|
851711
851711
|
hash3.update((contentType ? contentType.split(";")[0].trim().toLowerCase() : "") + "\n");
|
|
851712
851712
|
hash3.update(payload2 || "");
|
|
@@ -851722,7 +851722,7 @@ var require_hawk = __commonJS({
|
|
|
851722
851722
|
if (opts.app) {
|
|
851723
851723
|
normalized = normalized + opts.app + "\n" + (opts.dlg || "") + "\n";
|
|
851724
851724
|
}
|
|
851725
|
-
var hmac3 =
|
|
851725
|
+
var hmac3 = crypto20.createHmac(credentials.algorithm, credentials.key).update(normalized);
|
|
851726
851726
|
var digest = hmac3.digest("base64");
|
|
851727
851727
|
return digest;
|
|
851728
851728
|
};
|
|
@@ -869742,11 +869742,11 @@ var require_util12 = __commonJS({
|
|
|
869742
869742
|
var { isUint8Array } = require("node:util/types");
|
|
869743
869743
|
var { webidl } = require_webidl();
|
|
869744
869744
|
var supportedHashes = [];
|
|
869745
|
-
var
|
|
869745
|
+
var crypto20;
|
|
869746
869746
|
try {
|
|
869747
|
-
|
|
869747
|
+
crypto20 = require("node:crypto");
|
|
869748
869748
|
const possibleRelevantHashes = ["sha256", "sha384", "sha512"];
|
|
869749
|
-
supportedHashes =
|
|
869749
|
+
supportedHashes = crypto20.getHashes().filter((hash3) => possibleRelevantHashes.includes(hash3));
|
|
869750
869750
|
} catch {
|
|
869751
869751
|
}
|
|
869752
869752
|
function responseURL(response) {
|
|
@@ -870019,7 +870019,7 @@ var require_util12 = __commonJS({
|
|
|
870019
870019
|
}
|
|
870020
870020
|
}
|
|
870021
870021
|
function bytesMatch(bytes2, metadataList) {
|
|
870022
|
-
if (
|
|
870022
|
+
if (crypto20 === void 0) {
|
|
870023
870023
|
return true;
|
|
870024
870024
|
}
|
|
870025
870025
|
const parsedMetadata = parseMetadata(metadataList);
|
|
@@ -870034,7 +870034,7 @@ var require_util12 = __commonJS({
|
|
|
870034
870034
|
for (const item of metadata) {
|
|
870035
870035
|
const algorithm = item.algo;
|
|
870036
870036
|
const expectedValue = item.hash;
|
|
870037
|
-
let actualValue =
|
|
870037
|
+
let actualValue = crypto20.createHash(algorithm).update(bytes2).digest("base64");
|
|
870038
870038
|
if (actualValue[actualValue.length - 1] === "=") {
|
|
870039
870039
|
if (actualValue[actualValue.length - 2] === "=") {
|
|
870040
870040
|
actualValue = actualValue.slice(0, -2);
|
|
@@ -871098,8 +871098,8 @@ var require_body = __commonJS({
|
|
|
871098
871098
|
var { multipartFormDataParser } = require_formdata_parser();
|
|
871099
871099
|
var random2;
|
|
871100
871100
|
try {
|
|
871101
|
-
const
|
|
871102
|
-
random2 = (max) =>
|
|
871101
|
+
const crypto20 = require("node:crypto");
|
|
871102
|
+
random2 = (max) => crypto20.randomInt(0, max);
|
|
871103
871103
|
} catch {
|
|
871104
871104
|
random2 = (max) => Math.floor(Math.random(max));
|
|
871105
871105
|
}
|
|
@@ -882507,13 +882507,13 @@ var require_frame = __commonJS({
|
|
|
882507
882507
|
"use strict";
|
|
882508
882508
|
var { maxUnsigned16Bit } = require_constants8();
|
|
882509
882509
|
var BUFFER_SIZE = 16386;
|
|
882510
|
-
var
|
|
882510
|
+
var crypto20;
|
|
882511
882511
|
var buffer = null;
|
|
882512
882512
|
var bufIdx = BUFFER_SIZE;
|
|
882513
882513
|
try {
|
|
882514
|
-
|
|
882514
|
+
crypto20 = require("node:crypto");
|
|
882515
882515
|
} catch {
|
|
882516
|
-
|
|
882516
|
+
crypto20 = {
|
|
882517
882517
|
// not full compatibility, but minimum.
|
|
882518
882518
|
randomFillSync: function randomFillSync(buffer2, _offset2, _size2) {
|
|
882519
882519
|
for (let i11 = 0; i11 < buffer2.length; ++i11) {
|
|
@@ -882526,7 +882526,7 @@ var require_frame = __commonJS({
|
|
|
882526
882526
|
function generateMask() {
|
|
882527
882527
|
if (bufIdx === BUFFER_SIZE) {
|
|
882528
882528
|
bufIdx = 0;
|
|
882529
|
-
|
|
882529
|
+
crypto20.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE);
|
|
882530
882530
|
}
|
|
882531
882531
|
return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]];
|
|
882532
882532
|
}
|
|
@@ -882598,9 +882598,9 @@ var require_connection = __commonJS({
|
|
|
882598
882598
|
var { Headers: Headers3, getHeadersList } = require_headers();
|
|
882599
882599
|
var { getDecodeSplit } = require_util12();
|
|
882600
882600
|
var { WebsocketFrameSend } = require_frame();
|
|
882601
|
-
var
|
|
882601
|
+
var crypto20;
|
|
882602
882602
|
try {
|
|
882603
|
-
|
|
882603
|
+
crypto20 = require("node:crypto");
|
|
882604
882604
|
} catch {
|
|
882605
882605
|
}
|
|
882606
882606
|
function establishWebSocketConnection(url2, protocols, client, ws, onEstablish, options3) {
|
|
@@ -882620,7 +882620,7 @@ var require_connection = __commonJS({
|
|
|
882620
882620
|
const headersList = getHeadersList(new Headers3(options3.headers));
|
|
882621
882621
|
request.headersList = headersList;
|
|
882622
882622
|
}
|
|
882623
|
-
const keyValue =
|
|
882623
|
+
const keyValue = crypto20.randomBytes(16).toString("base64");
|
|
882624
882624
|
request.headersList.append("sec-websocket-key", keyValue);
|
|
882625
882625
|
request.headersList.append("sec-websocket-version", "13");
|
|
882626
882626
|
for (const protocol of protocols) {
|
|
@@ -882650,7 +882650,7 @@ var require_connection = __commonJS({
|
|
|
882650
882650
|
return;
|
|
882651
882651
|
}
|
|
882652
882652
|
const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");
|
|
882653
|
-
const digest =
|
|
882653
|
+
const digest = crypto20.createHash("sha1").update(keyValue + uid).digest("base64");
|
|
882654
882654
|
if (secWSAccept !== digest) {
|
|
882655
882655
|
failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header.");
|
|
882656
882656
|
return;
|
|
@@ -948171,7 +948171,7 @@ function copyToImagesDir(archiveId, cachedPath, mediaType, cache5) {
|
|
|
948171
948171
|
return `images/${filename}`;
|
|
948172
948172
|
}
|
|
948173
948173
|
function externalizeBase64Image(base64Data, mediaType, cache5) {
|
|
948174
|
-
const hash3 = (0,
|
|
948174
|
+
const hash3 = (0, import_node_crypto17.createHash)("sha256").update(base64Data).digest("hex").slice(0, 12);
|
|
948175
948175
|
const ext = mediaType === "image/jpeg" ? ".jpg" : mediaType === "image/webp" ? ".webp" : ".png";
|
|
948176
948176
|
const filename = `raw_${hash3}${ext}`;
|
|
948177
948177
|
if (!cache5.written.has(filename)) {
|
|
@@ -948335,11 +948335,11 @@ async function recoverImagesInContent(content, sidecarIndex, stats, cache5) {
|
|
|
948335
948335
|
}
|
|
948336
948336
|
return out;
|
|
948337
948337
|
}
|
|
948338
|
-
var
|
|
948338
|
+
var import_node_crypto17, import_node_child_process29, import_node_fs59, import_node_path60, import_node_readline4, DEFAULT_TOSUTIL_PATH, DEFAULT_BUCKET, TEXT_CHUNK_KEYWORD2;
|
|
948339
948339
|
var init_image_recovery = __esm({
|
|
948340
948340
|
"dist/data-processing/image-recovery.js"() {
|
|
948341
948341
|
"use strict";
|
|
948342
|
-
|
|
948342
|
+
import_node_crypto17 = require("node:crypto");
|
|
948343
948343
|
import_node_child_process29 = require("node:child_process");
|
|
948344
948344
|
import_node_fs59 = __toESM(require("node:fs"), 1);
|
|
948345
948345
|
import_node_path60 = __toESM(require("node:path"), 1);
|
|
@@ -950150,7 +950150,7 @@ function convertRecord(record2, fallbackSystemPrompt, seq) {
|
|
|
950150
950150
|
if (record2.wake_cycle_id) {
|
|
950151
950151
|
uid = seq === 0 ? record2.wake_cycle_id : `${record2.wake_cycle_id}#${seq}`;
|
|
950152
950152
|
} else {
|
|
950153
|
-
uid = (0,
|
|
950153
|
+
uid = (0, import_node_crypto18.randomUUID)();
|
|
950154
950154
|
}
|
|
950155
950155
|
return {
|
|
950156
950156
|
uid,
|
|
@@ -950257,14 +950257,14 @@ async function convertOpenaiChat(opts) {
|
|
|
950257
950257
|
}
|
|
950258
950258
|
console.log(` Total: ${totalRecords} records`);
|
|
950259
950259
|
}
|
|
950260
|
-
var import_node_fs64, import_node_path65, import_node_readline7,
|
|
950260
|
+
var import_node_fs64, import_node_path65, import_node_readline7, import_node_crypto18;
|
|
950261
950261
|
var init_convert_openai_chat = __esm({
|
|
950262
950262
|
"dist/data-processing/convert-openai-chat.js"() {
|
|
950263
950263
|
"use strict";
|
|
950264
950264
|
import_node_fs64 = __toESM(require("node:fs"), 1);
|
|
950265
950265
|
import_node_path65 = __toESM(require("node:path"), 1);
|
|
950266
950266
|
import_node_readline7 = __toESM(require("node:readline"), 1);
|
|
950267
|
-
|
|
950267
|
+
import_node_crypto18 = require("node:crypto");
|
|
950268
950268
|
}
|
|
950269
950269
|
});
|
|
950270
950270
|
|
|
@@ -950947,7 +950947,7 @@ function convertSubAgentTranscript(transcriptPath, parentUid, subagentIndex, des
|
|
|
950947
950947
|
chatMessages.push({
|
|
950948
950948
|
role: "tool",
|
|
950949
950949
|
content: resultContent,
|
|
950950
|
-
tool_call_id: tr3.tool_use_id ?? `call_${(0,
|
|
950950
|
+
tool_call_id: tr3.tool_use_id ?? `call_${(0, import_node_crypto19.randomUUID)().slice(0, 8)}`
|
|
950951
950951
|
});
|
|
950952
950952
|
}
|
|
950953
950953
|
} else if (textBlocks.length > 0) {
|
|
@@ -950975,7 +950975,7 @@ function convertSubAgentTranscript(transcriptPath, parentUid, subagentIndex, des
|
|
|
950975
950975
|
textBuf += block.text ?? "";
|
|
950976
950976
|
} else if (block.type === "tool_use") {
|
|
950977
950977
|
toolCalls.push({
|
|
950978
|
-
id: block.id ?? `call_${(0,
|
|
950978
|
+
id: block.id ?? `call_${(0, import_node_crypto19.randomUUID)().slice(0, 8)}`,
|
|
950979
950979
|
type: "function",
|
|
950980
950980
|
function: {
|
|
950981
950981
|
name: block.name ?? "unknown",
|
|
@@ -950995,7 +950995,7 @@ function convertSubAgentTranscript(transcriptPath, parentUid, subagentIndex, des
|
|
|
950995
950995
|
const lastMsg = chatMessages[chatMessages.length - 1];
|
|
950996
950996
|
const success2 = lastMsg.role === "assistant" && !!lastMsg.content;
|
|
950997
950997
|
return {
|
|
950998
|
-
uid: (0,
|
|
950998
|
+
uid: (0, import_node_crypto19.randomUUID)(),
|
|
950999
950999
|
agent_type: "subagent",
|
|
951000
951000
|
subagent_index: subagentIndex,
|
|
951001
951001
|
parent_uid: parentUid,
|
|
@@ -951129,7 +951129,7 @@ async function runExpandSubagents(args) {
|
|
|
951129
951129
|
parent_uid: null
|
|
951130
951130
|
};
|
|
951131
951131
|
if (!mainOutput.uid)
|
|
951132
|
-
mainOutput.uid = (0,
|
|
951132
|
+
mainOutput.uid = (0, import_node_crypto19.randomUUID)();
|
|
951133
951133
|
allOutput.push(mainOutput);
|
|
951134
951134
|
const groupSubagents = [];
|
|
951135
951135
|
for (let si = 0; si < entry.agentCalls.length; si++) {
|
|
@@ -951205,14 +951205,14 @@ Wrote output files:`);
|
|
|
951205
951205
|
console.log(` ${groupsFile} (${groups.length} groups)`);
|
|
951206
951206
|
console.log(` ${summaryFile}`);
|
|
951207
951207
|
}
|
|
951208
|
-
var import_node_fs69, import_node_path70, import_node_readline8,
|
|
951208
|
+
var import_node_fs69, import_node_path70, import_node_readline8, import_node_crypto19;
|
|
951209
951209
|
var init_subagent_expand = __esm({
|
|
951210
951210
|
"dist/data-processing/subagent-expand.js"() {
|
|
951211
951211
|
"use strict";
|
|
951212
951212
|
import_node_fs69 = __toESM(require("node:fs"), 1);
|
|
951213
951213
|
import_node_path70 = __toESM(require("node:path"), 1);
|
|
951214
951214
|
import_node_readline8 = __toESM(require("node:readline"), 1);
|
|
951215
|
-
|
|
951215
|
+
import_node_crypto19 = require("node:crypto");
|
|
951216
951216
|
}
|
|
951217
951217
|
});
|
|
951218
951218
|
|
|
@@ -953448,13 +953448,13 @@ function __classPrivateFieldGet5(receiver2, state2, kind, f13) {
|
|
|
953448
953448
|
|
|
953449
953449
|
// node_modules/.pnpm/@anthropic-ai+sdk@0.78.0_zod@4.3.6/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs
|
|
953450
953450
|
var uuid42 = function() {
|
|
953451
|
-
const { crypto:
|
|
953452
|
-
if (
|
|
953453
|
-
uuid42 =
|
|
953454
|
-
return
|
|
953451
|
+
const { crypto: crypto20 } = globalThis;
|
|
953452
|
+
if (crypto20?.randomUUID) {
|
|
953453
|
+
uuid42 = crypto20.randomUUID.bind(crypto20);
|
|
953454
|
+
return crypto20.randomUUID();
|
|
953455
953455
|
}
|
|
953456
953456
|
const u82 = new Uint8Array(1);
|
|
953457
|
-
const randomByte =
|
|
953457
|
+
const randomByte = crypto20 ? () => crypto20.getRandomValues(u82)[0] : () => Math.random() * 255 & 255;
|
|
953458
953458
|
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c12) => (+c12 ^ randomByte() & 15 >> +c12 / 4).toString(16));
|
|
953459
953459
|
};
|
|
953460
953460
|
|
|
@@ -959096,13 +959096,13 @@ function __classPrivateFieldGet8(receiver2, state2, kind, f13) {
|
|
|
959096
959096
|
|
|
959097
959097
|
// node_modules/.pnpm/openai@6.34.0_ws@8.20.0_zod@4.3.6/node_modules/openai/internal/utils/uuid.mjs
|
|
959098
959098
|
var uuid43 = function() {
|
|
959099
|
-
const { crypto:
|
|
959100
|
-
if (
|
|
959101
|
-
uuid43 =
|
|
959102
|
-
return
|
|
959099
|
+
const { crypto: crypto20 } = globalThis;
|
|
959100
|
+
if (crypto20?.randomUUID) {
|
|
959101
|
+
uuid43 = crypto20.randomUUID.bind(crypto20);
|
|
959102
|
+
return crypto20.randomUUID();
|
|
959103
959103
|
}
|
|
959104
959104
|
const u82 = new Uint8Array(1);
|
|
959105
|
-
const randomByte =
|
|
959105
|
+
const randomByte = crypto20 ? () => crypto20.getRandomValues(u82)[0] : () => Math.random() * 255 & 255;
|
|
959106
959106
|
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c12) => (+c12 ^ randomByte() & 15 >> +c12 / 4).toString(16));
|
|
959107
959107
|
};
|
|
959108
959108
|
|
|
@@ -1033447,6 +1033447,7 @@ var import_node_fs55 = __toESM(require("node:fs"), 1);
|
|
|
1033447
1033447
|
var import_node_http5 = __toESM(require("node:http"), 1);
|
|
1033448
1033448
|
var import_node_os28 = __toESM(require("node:os"), 1);
|
|
1033449
1033449
|
var import_node_path56 = __toESM(require("node:path"), 1);
|
|
1033450
|
+
var import_node_crypto16 = __toESM(require("node:crypto"), 1);
|
|
1033450
1033451
|
var import_node_url7 = require("node:url");
|
|
1033451
1033452
|
init_config();
|
|
1033452
1033453
|
init_version_check();
|
|
@@ -1034040,7 +1034041,6 @@ async function startTunnel(port, provider, options3) {
|
|
|
1034040
1034041
|
}
|
|
1034041
1034042
|
|
|
1034042
1034043
|
// dist/obs/server.js
|
|
1034043
|
-
init_notify();
|
|
1034044
1034044
|
init_state();
|
|
1034045
1034045
|
|
|
1034046
1034046
|
// dist/obs/ui.js
|
|
@@ -1035094,464 +1035094,6 @@ function renderIndexHtml() {
|
|
|
1035094
1035094
|
</html>`;
|
|
1035095
1035095
|
}
|
|
1035096
1035096
|
|
|
1035097
|
-
// dist/obs/console/ui.js
|
|
1035098
|
-
function renderConsoleHtml() {
|
|
1035099
|
-
return `<!doctype html>
|
|
1035100
|
-
<html lang="en">
|
|
1035101
|
-
<head>
|
|
1035102
|
-
<meta charset="utf-8" />
|
|
1035103
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
1035104
|
-
<title>VisionClaw Console</title>
|
|
1035105
|
-
<link rel="icon" type="image/png" href="https://files.catbox.moe/au9xqh.png" />
|
|
1035106
|
-
<style>
|
|
1035107
|
-
:root {
|
|
1035108
|
-
--bg: #0b1020;
|
|
1035109
|
-
--border: rgba(255,255,255,0.10);
|
|
1035110
|
-
--text: rgba(255,255,255,0.92);
|
|
1035111
|
-
--muted: rgba(255,255,255,0.70);
|
|
1035112
|
-
--dim: rgba(255,255,255,0.55);
|
|
1035113
|
-
--good: #31d0aa;
|
|
1035114
|
-
--warn: #ffcc66;
|
|
1035115
|
-
--bad: #ff5c7a;
|
|
1035116
|
-
--accent: #7aa2ff;
|
|
1035117
|
-
--sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
|
|
1035118
|
-
--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
1035119
|
-
}
|
|
1035120
|
-
*, *::before, *::after { box-sizing: border-box; }
|
|
1035121
|
-
body {
|
|
1035122
|
-
margin: 0;
|
|
1035123
|
-
background: radial-gradient(1200px 800px at 15% 10%, rgba(122,162,255,0.18), transparent 60%), var(--bg);
|
|
1035124
|
-
color: var(--text);
|
|
1035125
|
-
font-family: var(--sans);
|
|
1035126
|
-
min-height: 100vh;
|
|
1035127
|
-
}
|
|
1035128
|
-
|
|
1035129
|
-
/* \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1035130
|
-
header {
|
|
1035131
|
-
position: sticky; top: 0; z-index: 10;
|
|
1035132
|
-
backdrop-filter: blur(10px);
|
|
1035133
|
-
background: rgba(22,32,55,0.55);
|
|
1035134
|
-
border-bottom: 1px solid var(--border);
|
|
1035135
|
-
}
|
|
1035136
|
-
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
|
|
1035137
|
-
.header-inner { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
|
|
1035138
|
-
h1 { margin: 0; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
|
|
1035139
|
-
.logo { width: 36px; height: 36px; border-radius: 8px; }
|
|
1035140
|
-
.spacer { flex: 1; }
|
|
1035141
|
-
|
|
1035142
|
-
/* \u2500\u2500 Status (in header) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1035143
|
-
.status-indicator { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
|
|
1035144
|
-
.dot { width: 9px; height: 9px; border-radius: 999px; background: var(--dim); flex-shrink: 0; }
|
|
1035145
|
-
.dot.idle { background: var(--good); box-shadow: 0 0 0 3px rgba(49,208,170,0.20); }
|
|
1035146
|
-
.dot.busy { background: var(--accent); box-shadow: 0 0 0 3px rgba(122,162,255,0.22); animation: pulse 1.4s ease-in-out infinite; }
|
|
1035147
|
-
.dot.stop { background: var(--warn); box-shadow: 0 0 0 3px rgba(255,204,102,0.22); }
|
|
1035148
|
-
.dot.disconnected { background: var(--bad); box-shadow: 0 0 0 3px rgba(255,92,122,0.20); }
|
|
1035149
|
-
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.45} }
|
|
1035150
|
-
.status-label { color: var(--text); }
|
|
1035151
|
-
.stop-btn {
|
|
1035152
|
-
cursor: pointer;
|
|
1035153
|
-
border: 1px solid rgba(255,92,122,0.45); background: rgba(255,92,122,0.10); color: #ff5c7a;
|
|
1035154
|
-
padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; font-family: var(--sans);
|
|
1035155
|
-
transition: background 0.15s, transform 0.1s;
|
|
1035156
|
-
}
|
|
1035157
|
-
.stop-btn:hover:not(:disabled) { background: rgba(255,92,122,0.20); }
|
|
1035158
|
-
.stop-btn:active:not(:disabled) { transform: translateY(1px); }
|
|
1035159
|
-
.stop-btn:disabled { opacity: 0.38; cursor: not-allowed; }
|
|
1035160
|
-
.stop-btn.stopping { border-color: rgba(255,204,102,0.5); background: rgba(255,204,102,0.12); color: var(--warn); }
|
|
1035161
|
-
|
|
1035162
|
-
/* \u2500\u2500 Feed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1035163
|
-
.feed { padding: 16px 0 24px; }
|
|
1035164
|
-
.feed-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }
|
|
1035165
|
-
.feed-empty { padding: 48px 24px; text-align: center; color: var(--dim); font-size: 14px; }
|
|
1035166
|
-
|
|
1035167
|
-
/* \u2500\u2500 Bubble \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1035168
|
-
.bubble {
|
|
1035169
|
-
padding: 10px 14px; border-radius: 12px;
|
|
1035170
|
-
font-size: 13px; line-height: 1.5;
|
|
1035171
|
-
max-width: 100%; animation: fadeIn 0.15s ease;
|
|
1035172
|
-
}
|
|
1035173
|
-
@keyframes fadeIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
|
|
1035174
|
-
|
|
1035175
|
-
.bubble .time { font-size: 10px; color: var(--dim); margin-top: 4px; }
|
|
1035176
|
-
|
|
1035177
|
-
/* Type variants */
|
|
1035178
|
-
.bubble.wake {
|
|
1035179
|
-
background: rgba(49,208,170,0.08); border: 1px solid rgba(49,208,170,0.18);
|
|
1035180
|
-
color: var(--good); font-weight: 600; font-size: 12px; text-align: center;
|
|
1035181
|
-
align-self: center; padding: 6px 16px;
|
|
1035182
|
-
}
|
|
1035183
|
-
.bubble.thinking {
|
|
1035184
|
-
background: rgba(208,156,240,0.08); border: 1px solid rgba(208,156,240,0.14); color: var(--text);
|
|
1035185
|
-
}
|
|
1035186
|
-
.bubble.tool {
|
|
1035187
|
-
background: rgba(92,201,245,0.06); border: 1px solid rgba(92,201,245,0.14);
|
|
1035188
|
-
font-family: var(--mono); font-size: 12px; color: var(--muted);
|
|
1035189
|
-
}
|
|
1035190
|
-
.bubble.tool .tool-name { color: #5cc9f5; font-weight: 600; }
|
|
1035191
|
-
.bubble.tool .tool-input { color: var(--dim); margin-top: 2px; word-break: break-word; }
|
|
1035192
|
-
.bubble.message {
|
|
1035193
|
-
background: rgba(102,224,184,0.08); border: 1px solid rgba(102,224,184,0.16); color: var(--text);
|
|
1035194
|
-
}
|
|
1035195
|
-
.bubble.message .sender { color: #66e0b8; font-weight: 600; font-size: 12px; }
|
|
1035196
|
-
.bubble.reply {
|
|
1035197
|
-
background: rgba(122,200,255,0.08); border: 1px solid rgba(122,200,255,0.14); color: var(--text);
|
|
1035198
|
-
}
|
|
1035199
|
-
.bubble.error {
|
|
1035200
|
-
background: rgba(255,92,122,0.08); border: 1px solid rgba(255,92,122,0.18); color: var(--bad);
|
|
1035201
|
-
}
|
|
1035202
|
-
.bubble.done {
|
|
1035203
|
-
background: rgba(255,255,255,0.04); border: 1px solid var(--border);
|
|
1035204
|
-
color: var(--dim); font-size: 12px; text-align: center;
|
|
1035205
|
-
align-self: center; padding: 6px 16px;
|
|
1035206
|
-
}
|
|
1035207
|
-
.bubble.done .cost { color: var(--muted); font-weight: 600; }
|
|
1035208
|
-
.bubble.screenshot {
|
|
1035209
|
-
background: rgba(255,255,255,0.03); border: 1px solid var(--border); padding: 8px;
|
|
1035210
|
-
}
|
|
1035211
|
-
.bubble.screenshot .screenshot-label { font-size: 11px; color: var(--dim); margin-bottom: 6px; }
|
|
1035212
|
-
.bubble.screenshot img {
|
|
1035213
|
-
display: block; max-width: 100%; height: auto; border-radius: 8px;
|
|
1035214
|
-
border: 1px solid rgba(255,255,255,0.08); cursor: pointer;
|
|
1035215
|
-
}
|
|
1035216
|
-
.bubble.info {
|
|
1035217
|
-
background: rgba(255,255,255,0.03); border: 1px solid var(--border);
|
|
1035218
|
-
color: var(--muted); font-size: 12px;
|
|
1035219
|
-
}
|
|
1035220
|
-
|
|
1035221
|
-
/* \u2500\u2500 Lightbox \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1035222
|
-
.lightbox {
|
|
1035223
|
-
display: none; position: fixed; inset: 0; z-index: 200;
|
|
1035224
|
-
background: rgba(0,0,0,0.85); align-items: center; justify-content: center; cursor: zoom-out;
|
|
1035225
|
-
}
|
|
1035226
|
-
.lightbox.open { display: flex; }
|
|
1035227
|
-
.lightbox img { max-width: 95vw; max-height: 95vh; border-radius: 8px; }
|
|
1035228
|
-
|
|
1035229
|
-
/* \u2500\u2500 Toast \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1035230
|
-
.toast {
|
|
1035231
|
-
position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
|
|
1035232
|
-
background: rgba(30,40,60,0.96); border: 1px solid var(--border);
|
|
1035233
|
-
color: var(--text); padding: 10px 20px; border-radius: 10px;
|
|
1035234
|
-
font-size: 13px; z-index: 100; pointer-events: none;
|
|
1035235
|
-
opacity: 0; transition: opacity 0.2s;
|
|
1035236
|
-
}
|
|
1035237
|
-
.toast.show { opacity: 1; }
|
|
1035238
|
-
|
|
1035239
|
-
@media (max-width: 600px) {
|
|
1035240
|
-
.bubble { font-size: 13px; }
|
|
1035241
|
-
}
|
|
1035242
|
-
</style>
|
|
1035243
|
-
</head>
|
|
1035244
|
-
<body>
|
|
1035245
|
-
<header>
|
|
1035246
|
-
<div class="wrap">
|
|
1035247
|
-
<div class="header-inner">
|
|
1035248
|
-
<h1><img class="logo" src="https://files.catbox.moe/au9xqh.png" alt="" />VisionClaw Console</h1>
|
|
1035249
|
-
<span class="spacer"></span>
|
|
1035250
|
-
<div class="status-indicator">
|
|
1035251
|
-
<div class="dot" id="status-dot"></div>
|
|
1035252
|
-
<span class="status-label" id="status-label">Unknown</span>
|
|
1035253
|
-
</div>
|
|
1035254
|
-
<button class="stop-btn" id="stop-btn" disabled>Stop Agent</button>
|
|
1035255
|
-
</div>
|
|
1035256
|
-
</div>
|
|
1035257
|
-
</header>
|
|
1035258
|
-
|
|
1035259
|
-
<main>
|
|
1035260
|
-
<div class="wrap">
|
|
1035261
|
-
<div class="feed">
|
|
1035262
|
-
<div class="feed-list" id="feed-list">
|
|
1035263
|
-
<div class="feed-empty" id="feed-empty">Waiting for activity\u2026</div>
|
|
1035264
|
-
</div>
|
|
1035265
|
-
</div>
|
|
1035266
|
-
</div>
|
|
1035267
|
-
</main>
|
|
1035268
|
-
|
|
1035269
|
-
<div class="lightbox" id="lightbox"><img id="lightbox-img" /></div>
|
|
1035270
|
-
<div class="toast" id="toast"></div>
|
|
1035271
|
-
|
|
1035272
|
-
<script>
|
|
1035273
|
-
const MAX = 80;
|
|
1035274
|
-
let agentBusy = false, stopRequested = false, sseConnected = false, stopInFlight = false, count = 0;
|
|
1035275
|
-
|
|
1035276
|
-
const $ = (id) => document.getElementById(id);
|
|
1035277
|
-
const $dot = $('status-dot'), $label = $('status-label');
|
|
1035278
|
-
const $btn = $('stop-btn'), $list = $('feed-list'), $empty = $('feed-empty');
|
|
1035279
|
-
const $toast = $('toast');
|
|
1035280
|
-
const $lightbox = $('lightbox'), $lbImg = $('lightbox-img');
|
|
1035281
|
-
|
|
1035282
|
-
// \u2500\u2500 Lightbox \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035283
|
-
$lightbox.addEventListener('click', () => $lightbox.classList.remove('open'));
|
|
1035284
|
-
|
|
1035285
|
-
function openLightbox(src) {
|
|
1035286
|
-
$lbImg.src = src;
|
|
1035287
|
-
$lightbox.classList.add('open');
|
|
1035288
|
-
}
|
|
1035289
|
-
|
|
1035290
|
-
// \u2500\u2500 Toast \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035291
|
-
let toastT = null;
|
|
1035292
|
-
function showToast(msg) {
|
|
1035293
|
-
$toast.textContent = msg;
|
|
1035294
|
-
$toast.classList.add('show');
|
|
1035295
|
-
if (toastT) clearTimeout(toastT);
|
|
1035296
|
-
toastT = setTimeout(() => $toast.classList.remove('show'), 3000);
|
|
1035297
|
-
}
|
|
1035298
|
-
|
|
1035299
|
-
// \u2500\u2500 Status \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035300
|
-
function renderStatus() {
|
|
1035301
|
-
if (!sseConnected) {
|
|
1035302
|
-
$dot.className = 'dot disconnected'; $label.textContent = 'Disconnected';
|
|
1035303
|
-
$btn.disabled = true;
|
|
1035304
|
-
} else if (stopRequested || stopInFlight) {
|
|
1035305
|
-
$dot.className = 'dot stop'; $label.textContent = 'Stopping\u2026';
|
|
1035306
|
-
$btn.disabled = true;
|
|
1035307
|
-
} else if (agentBusy) {
|
|
1035308
|
-
$dot.className = 'dot busy'; $label.textContent = 'Working';
|
|
1035309
|
-
$btn.disabled = false;
|
|
1035310
|
-
} else {
|
|
1035311
|
-
$dot.className = 'dot idle'; $label.textContent = 'Idle';
|
|
1035312
|
-
$btn.disabled = true;
|
|
1035313
|
-
}
|
|
1035314
|
-
$btn.textContent = (stopRequested || stopInFlight) ? 'Stopping\u2026' : 'Stop Agent';
|
|
1035315
|
-
$btn.className = (stopRequested || stopInFlight) ? 'stop-btn stopping' : 'stop-btn';
|
|
1035316
|
-
}
|
|
1035317
|
-
|
|
1035318
|
-
// \u2500\u2500 Stop \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035319
|
-
$btn.addEventListener('click', async () => {
|
|
1035320
|
-
if ($btn.disabled || stopInFlight) return;
|
|
1035321
|
-
stopInFlight = true;
|
|
1035322
|
-
$btn.disabled = true;
|
|
1035323
|
-
$btn.textContent = 'Stopping\u2026';
|
|
1035324
|
-
$btn.className = 'stop-btn stopping';
|
|
1035325
|
-
try {
|
|
1035326
|
-
const res = await fetch('/console/stop', { method: 'POST' });
|
|
1035327
|
-
if (res.ok) { stopRequested = true; renderStatus(); showToast('Stop signal sent'); }
|
|
1035328
|
-
else { showToast('Stop failed (' + res.status + ')'); }
|
|
1035329
|
-
} catch { showToast('Stop failed (network)'); }
|
|
1035330
|
-
stopInFlight = false;
|
|
1035331
|
-
});
|
|
1035332
|
-
|
|
1035333
|
-
// \u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035334
|
-
function fmtTime(iso) {
|
|
1035335
|
-
if (!iso) return '';
|
|
1035336
|
-
const d = new Date(iso);
|
|
1035337
|
-
const h = String(d.getHours()).padStart(2,'0');
|
|
1035338
|
-
const m = String(d.getMinutes()).padStart(2,'0');
|
|
1035339
|
-
return h + ':' + m;
|
|
1035340
|
-
}
|
|
1035341
|
-
|
|
1035342
|
-
function esc(s) {
|
|
1035343
|
-
const el = document.createElement('span');
|
|
1035344
|
-
el.textContent = s;
|
|
1035345
|
-
return el.innerHTML;
|
|
1035346
|
-
}
|
|
1035347
|
-
|
|
1035348
|
-
function safeStr(v) {
|
|
1035349
|
-
if (v == null) return '';
|
|
1035350
|
-
if (typeof v === 'string') return v;
|
|
1035351
|
-
try { return JSON.stringify(v); } catch { return String(v); }
|
|
1035352
|
-
}
|
|
1035353
|
-
|
|
1035354
|
-
function addBubble(html, cls) {
|
|
1035355
|
-
if ($empty && $empty.parentNode) $empty.remove();
|
|
1035356
|
-
const el = document.createElement('div');
|
|
1035357
|
-
el.className = 'bubble ' + cls;
|
|
1035358
|
-
el.innerHTML = html;
|
|
1035359
|
-
$list.appendChild(el);
|
|
1035360
|
-
count++;
|
|
1035361
|
-
while ($list.childElementCount > MAX) { $list.removeChild($list.firstChild); count--; }
|
|
1035362
|
-
$list.scrollTop = $list.scrollHeight;
|
|
1035363
|
-
|
|
1035364
|
-
// Wire up any screenshot click-to-zoom
|
|
1035365
|
-
el.querySelectorAll('img.ss-img').forEach(img => {
|
|
1035366
|
-
img.addEventListener('click', () => openLightbox(img.src));
|
|
1035367
|
-
});
|
|
1035368
|
-
}
|
|
1035369
|
-
|
|
1035370
|
-
// \u2500\u2500 Entry processing \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035371
|
-
function processEntry(entry) {
|
|
1035372
|
-
const cat = entry.category || '';
|
|
1035373
|
-
const lvl = entry.level || 'info';
|
|
1035374
|
-
const msg = entry.message || '';
|
|
1035375
|
-
const d = entry.data || {};
|
|
1035376
|
-
const t = fmtTime(entry.timestamp);
|
|
1035377
|
-
|
|
1035378
|
-
// Skip debug-level entries entirely
|
|
1035379
|
-
if (lvl === 'debug') return;
|
|
1035380
|
-
|
|
1035381
|
-
switch (cat) {
|
|
1035382
|
-
case 'wake': {
|
|
1035383
|
-
const trigger = d.trigger || '';
|
|
1035384
|
-
const label = trigger === 'heartbeat' ? 'Heartbeat check' : 'New message received';
|
|
1035385
|
-
addBubble(esc(label), 'wake');
|
|
1035386
|
-
return;
|
|
1035387
|
-
}
|
|
1035388
|
-
|
|
1035389
|
-
case 'assistant': {
|
|
1035390
|
-
if (!msg || msg.startsWith('[thinking]') || msg.startsWith('[subagent')) return;
|
|
1035391
|
-
addBubble(esc(msg) + '<div class="time">' + esc(t) + '</div>', 'thinking');
|
|
1035392
|
-
return;
|
|
1035393
|
-
}
|
|
1035394
|
-
|
|
1035395
|
-
case 'tool_call': {
|
|
1035396
|
-
const name = safeStr(d.name || '');
|
|
1035397
|
-
if (!name) return;
|
|
1035398
|
-
// Skip internal/noisy tools
|
|
1035399
|
-
if (['finish', 'mcp__visionclaw__finish'].includes(name)) return;
|
|
1035400
|
-
|
|
1035401
|
-
const friendly = friendlyToolName(name);
|
|
1035402
|
-
const input = d.input ? friendlyToolInput(name, d.input) : '';
|
|
1035403
|
-
let html = '<span class="tool-name">' + esc(friendly) + '</span>';
|
|
1035404
|
-
if (input) html += '<div class="tool-input">' + esc(input) + '</div>';
|
|
1035405
|
-
addBubble(html, 'tool');
|
|
1035406
|
-
return;
|
|
1035407
|
-
}
|
|
1035408
|
-
|
|
1035409
|
-
case 'screenshot': {
|
|
1035410
|
-
const b64 = d.base64;
|
|
1035411
|
-
if (!b64) return;
|
|
1035412
|
-
addBubble(
|
|
1035413
|
-
'<div class="screenshot-label">Desktop screenshot</div>' +
|
|
1035414
|
-
'<img class="ss-img" src="data:image/png;base64,' + b64 + '" alt="Desktop screenshot" loading="lazy" />',
|
|
1035415
|
-
'screenshot'
|
|
1035416
|
-
);
|
|
1035417
|
-
return;
|
|
1035418
|
-
}
|
|
1035419
|
-
|
|
1035420
|
-
case 'incoming': {
|
|
1035421
|
-
const sender = safeStr(d.sender || '');
|
|
1035422
|
-
const channel = safeStr(d.channel || '');
|
|
1035423
|
-
const text = safeStr(d.text || msg);
|
|
1035424
|
-
addBubble(
|
|
1035425
|
-
'<div class="sender">' + esc(sender) + ' via ' + esc(channel) + '</div>' +
|
|
1035426
|
-
esc(text) +
|
|
1035427
|
-
'<div class="time">' + esc(t) + '</div>',
|
|
1035428
|
-
'message'
|
|
1035429
|
-
);
|
|
1035430
|
-
return;
|
|
1035431
|
-
}
|
|
1035432
|
-
|
|
1035433
|
-
case 'fast_response': {
|
|
1035434
|
-
if (!msg) return;
|
|
1035435
|
-
addBubble(esc(msg) + '<div class="time">' + esc(t) + '</div>', 'reply');
|
|
1035436
|
-
return;
|
|
1035437
|
-
}
|
|
1035438
|
-
|
|
1035439
|
-
case 'result': {
|
|
1035440
|
-
const cost = d.cost != null ? '$' + d.cost : '';
|
|
1035441
|
-
const turns = d.turns != null ? d.turns + ' steps' : '';
|
|
1035442
|
-
const parts = [turns, cost].filter(Boolean).join(' \xB7 ');
|
|
1035443
|
-
addBubble('Done' + (parts ? ' <span class="cost">(' + esc(parts) + ')</span>' : ''), 'done');
|
|
1035444
|
-
return;
|
|
1035445
|
-
}
|
|
1035446
|
-
|
|
1035447
|
-
case 'error': {
|
|
1035448
|
-
addBubble(esc(msg) + '<div class="time">' + esc(t) + '</div>', 'error');
|
|
1035449
|
-
return;
|
|
1035450
|
-
}
|
|
1035451
|
-
|
|
1035452
|
-
case 'channel': {
|
|
1035453
|
-
if (lvl === 'warn' || lvl === 'error') {
|
|
1035454
|
-
addBubble(esc(msg), 'error');
|
|
1035455
|
-
}
|
|
1035456
|
-
return;
|
|
1035457
|
-
}
|
|
1035458
|
-
|
|
1035459
|
-
case 'system': {
|
|
1035460
|
-
if (lvl === 'warn' || lvl === 'error') {
|
|
1035461
|
-
addBubble(esc(msg), 'error');
|
|
1035462
|
-
}
|
|
1035463
|
-
// Silently skip info-level system messages (startup noise, compaction, etc.)
|
|
1035464
|
-
return;
|
|
1035465
|
-
}
|
|
1035466
|
-
|
|
1035467
|
-
// Everything else (send, tool_result, etc.) is hidden
|
|
1035468
|
-
default:
|
|
1035469
|
-
return;
|
|
1035470
|
-
}
|
|
1035471
|
-
}
|
|
1035472
|
-
|
|
1035473
|
-
// \u2500\u2500 Friendly tool names \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035474
|
-
function friendlyToolName(name) {
|
|
1035475
|
-
const map = {
|
|
1035476
|
-
'mcp__visionclaw__notify_user': 'Sending notification',
|
|
1035477
|
-
'mcp__visionclaw__manage_skills': 'Managing skills',
|
|
1035478
|
-
'mcp__visionclaw__upgrade': 'Checking for updates',
|
|
1035479
|
-
'mcp__visionclaw__manage_calendar': 'Managing calendar',
|
|
1035480
|
-
'mcp__visionclaw__memory': 'Accessing memory',
|
|
1035481
|
-
'mcp__visionclaw__computer_use_click': 'Clicking on screen',
|
|
1035482
|
-
'mcp__visionclaw__computer_use_scroll': 'Scrolling',
|
|
1035483
|
-
'mcp__visionclaw__computer_use_drag': 'Dragging',
|
|
1035484
|
-
'mcp__visionclaw__computer_use_type': 'Typing text',
|
|
1035485
|
-
'mcp__visionclaw__computer_use_key': 'Pressing keys',
|
|
1035486
|
-
'mcp__visionclaw__computer_use_screenshot': 'Taking screenshot',
|
|
1035487
|
-
'mcp__playwright__browser_navigate': 'Opening webpage',
|
|
1035488
|
-
'mcp__playwright__browser_click': 'Clicking in browser',
|
|
1035489
|
-
'mcp__playwright__browser_fill_form': 'Filling form',
|
|
1035490
|
-
'mcp__playwright__browser_snapshot': 'Reading page',
|
|
1035491
|
-
'mcp__playwright__browser_take_screenshot': 'Browser screenshot',
|
|
1035492
|
-
'mcp__playwright__browser_hover': 'Hovering in browser',
|
|
1035493
|
-
'mcp__playwright__browser_press_key': 'Pressing key in browser',
|
|
1035494
|
-
'mcp__playwright__browser_evaluate': 'Running browser script',
|
|
1035495
|
-
'mcp__playwright__browser_tabs': 'Managing browser tabs',
|
|
1035496
|
-
'mcp__playwright__browser_close': 'Closing browser',
|
|
1035497
|
-
'mcp__playwright__browser_wait': 'Waiting for page',
|
|
1035498
|
-
'Bash': 'Running command',
|
|
1035499
|
-
'Read': 'Reading file',
|
|
1035500
|
-
'Write': 'Writing file',
|
|
1035501
|
-
'Edit': 'Editing file',
|
|
1035502
|
-
'Glob': 'Searching files',
|
|
1035503
|
-
'Grep': 'Searching in files',
|
|
1035504
|
-
'WebSearch': 'Searching the web',
|
|
1035505
|
-
'web_search': 'Searching the web',
|
|
1035506
|
-
'WebFetch': 'Fetching webpage',
|
|
1035507
|
-
'Task': 'Running sub-task',
|
|
1035508
|
-
};
|
|
1035509
|
-
return map[name] || name.replace(/^mcp__\\w+__/, '').replace(/_/g, ' ');
|
|
1035510
|
-
}
|
|
1035511
|
-
|
|
1035512
|
-
function friendlyToolInput(name, input) {
|
|
1035513
|
-
if (!input || typeof input !== 'object') return '';
|
|
1035514
|
-
if (input.url) return input.url;
|
|
1035515
|
-
if (input.path) return input.path;
|
|
1035516
|
-
if (input.command) return input.command.length > 80 ? input.command.substring(0, 80) + '\u2026' : input.command;
|
|
1035517
|
-
if (input.query) return input.query;
|
|
1035518
|
-
if (input.text && typeof input.text === 'string') return input.text.length > 80 ? input.text.substring(0, 80) + '\u2026' : input.text;
|
|
1035519
|
-
if (input.action) return input.action;
|
|
1035520
|
-
return '';
|
|
1035521
|
-
}
|
|
1035522
|
-
|
|
1035523
|
-
// \u2500\u2500 Status polling \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035524
|
-
function pollStatus() {
|
|
1035525
|
-
fetch('/console/status').then(r => r.json()).then(d => {
|
|
1035526
|
-
agentBusy = !!d.busy; stopRequested = !!d.stopRequested; renderStatus();
|
|
1035527
|
-
}).catch(() => {});
|
|
1035528
|
-
}
|
|
1035529
|
-
pollStatus();
|
|
1035530
|
-
setInterval(pollStatus, 3000);
|
|
1035531
|
-
|
|
1035532
|
-
// \u2500\u2500 SSE + snapshot \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1035533
|
-
fetch('/obs/snapshot').then(r => r.json()).then(items => {
|
|
1035534
|
-
for (const e of items) processEntry(e);
|
|
1035535
|
-
}).catch(() => {});
|
|
1035536
|
-
|
|
1035537
|
-
const es = new EventSource('/obs/events');
|
|
1035538
|
-
es.onopen = () => { sseConnected = true; renderStatus(); };
|
|
1035539
|
-
es.onerror = () => { sseConnected = false; renderStatus(); };
|
|
1035540
|
-
es.onmessage = (ev) => {
|
|
1035541
|
-
try {
|
|
1035542
|
-
const entry = JSON.parse(ev.data);
|
|
1035543
|
-
processEntry(entry);
|
|
1035544
|
-
if (entry.category === 'wake') { agentBusy = true; stopRequested = false; renderStatus(); }
|
|
1035545
|
-
if (entry.category === 'result') { agentBusy = false; stopRequested = false; renderStatus(); }
|
|
1035546
|
-
} catch {}
|
|
1035547
|
-
};
|
|
1035548
|
-
|
|
1035549
|
-
renderStatus();
|
|
1035550
|
-
</script>
|
|
1035551
|
-
</body>
|
|
1035552
|
-
</html>`;
|
|
1035553
|
-
}
|
|
1035554
|
-
|
|
1035555
1035097
|
// dist/obs/server.js
|
|
1035556
1035098
|
init_wrapper();
|
|
1035557
1035099
|
init_token();
|
|
@@ -1036300,6 +1035842,7 @@ function renderDesktopHtml(wsUrl, expiresAt, screens = [], opts = {}) {
|
|
|
1036300
1035842
|
}
|
|
1036301
1035843
|
|
|
1036302
1035844
|
// dist/obs/server.js
|
|
1035845
|
+
var OBS_AUTH_COOKIE = "visionclaw_obs_auth";
|
|
1036303
1035846
|
function escHtml(s11) {
|
|
1036304
1035847
|
return s11.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
1036305
1035848
|
}
|
|
@@ -1036373,6 +1035916,114 @@ function maskSecret(val) {
|
|
|
1036373
1035916
|
return "****";
|
|
1036374
1035917
|
return val.slice(0, 4) + "\u2026" + val.slice(-4);
|
|
1036375
1035918
|
}
|
|
1035919
|
+
function getObsOwnerEmail() {
|
|
1035920
|
+
try {
|
|
1035921
|
+
const ownerEmail = loadOwnerConfig().ownerEmail.trim().toLowerCase();
|
|
1035922
|
+
return ownerEmail && ownerEmail.length > 0 ? ownerEmail : null;
|
|
1035923
|
+
} catch {
|
|
1035924
|
+
return null;
|
|
1035925
|
+
}
|
|
1035926
|
+
}
|
|
1035927
|
+
function parseCookies(header) {
|
|
1035928
|
+
const cookies = /* @__PURE__ */ new Map();
|
|
1035929
|
+
if (!header)
|
|
1035930
|
+
return cookies;
|
|
1035931
|
+
for (const part of header.split(";")) {
|
|
1035932
|
+
const trimmed = part.trim();
|
|
1035933
|
+
if (!trimmed)
|
|
1035934
|
+
continue;
|
|
1035935
|
+
const eq2 = trimmed.indexOf("=");
|
|
1035936
|
+
if (eq2 <= 0)
|
|
1035937
|
+
continue;
|
|
1035938
|
+
const key = trimmed.slice(0, eq2).trim();
|
|
1035939
|
+
const value = trimmed.slice(eq2 + 1).trim();
|
|
1035940
|
+
if (!key)
|
|
1035941
|
+
continue;
|
|
1035942
|
+
cookies.set(key, value);
|
|
1035943
|
+
}
|
|
1035944
|
+
return cookies;
|
|
1035945
|
+
}
|
|
1035946
|
+
function renderObsLoginHtml(errorMessage) {
|
|
1035947
|
+
const errorBlock = errorMessage ? `<p style="margin:0 0 16px;color:#b91c1c;">${escHtml(errorMessage)}</p>` : "";
|
|
1035948
|
+
return `<!doctype html>
|
|
1035949
|
+
<html lang="en">
|
|
1035950
|
+
<head>
|
|
1035951
|
+
<meta charset="utf-8">
|
|
1035952
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1035953
|
+
<title>VisionClaw OBS Access</title>
|
|
1035954
|
+
<style>
|
|
1035955
|
+
:root {
|
|
1035956
|
+
color-scheme: light;
|
|
1035957
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
1035958
|
+
background: #f5f1e8;
|
|
1035959
|
+
color: #1f2937;
|
|
1035960
|
+
}
|
|
1035961
|
+
body {
|
|
1035962
|
+
margin: 0;
|
|
1035963
|
+
min-height: 100vh;
|
|
1035964
|
+
display: grid;
|
|
1035965
|
+
place-items: center;
|
|
1035966
|
+
background:
|
|
1035967
|
+
radial-gradient(circle at top, rgba(196, 181, 253, 0.14), transparent 32rem),
|
|
1035968
|
+
linear-gradient(180deg, #f7f4ed 0%, #efe8dc 100%);
|
|
1035969
|
+
}
|
|
1035970
|
+
main {
|
|
1035971
|
+
width: min(28rem, calc(100vw - 2rem));
|
|
1035972
|
+
padding: 2rem;
|
|
1035973
|
+
background: rgba(255, 255, 255, 0.92);
|
|
1035974
|
+
border: 1px solid rgba(15, 23, 42, 0.08);
|
|
1035975
|
+
border-radius: 1rem;
|
|
1035976
|
+
box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
|
|
1035977
|
+
}
|
|
1035978
|
+
h1 {
|
|
1035979
|
+
margin: 0 0 0.75rem;
|
|
1035980
|
+
font-size: 1.5rem;
|
|
1035981
|
+
}
|
|
1035982
|
+
p {
|
|
1035983
|
+
margin: 0 0 1rem;
|
|
1035984
|
+
line-height: 1.5;
|
|
1035985
|
+
}
|
|
1035986
|
+
label {
|
|
1035987
|
+
display: block;
|
|
1035988
|
+
margin: 0 0 0.5rem;
|
|
1035989
|
+
font-weight: 600;
|
|
1035990
|
+
}
|
|
1035991
|
+
input {
|
|
1035992
|
+
width: 100%;
|
|
1035993
|
+
box-sizing: border-box;
|
|
1035994
|
+
padding: 0.8rem 0.9rem;
|
|
1035995
|
+
border: 1px solid #cbd5e1;
|
|
1035996
|
+
border-radius: 0.75rem;
|
|
1035997
|
+
font: inherit;
|
|
1035998
|
+
}
|
|
1035999
|
+
button {
|
|
1036000
|
+
margin-top: 1rem;
|
|
1036001
|
+
width: 100%;
|
|
1036002
|
+
border: 0;
|
|
1036003
|
+
border-radius: 0.75rem;
|
|
1036004
|
+
padding: 0.85rem 1rem;
|
|
1036005
|
+
font: inherit;
|
|
1036006
|
+
font-weight: 600;
|
|
1036007
|
+
color: white;
|
|
1036008
|
+
background: #0f766e;
|
|
1036009
|
+
cursor: pointer;
|
|
1036010
|
+
}
|
|
1036011
|
+
</style>
|
|
1036012
|
+
</head>
|
|
1036013
|
+
<body>
|
|
1036014
|
+
<main>
|
|
1036015
|
+
<h1>VisionClaw OBS</h1>
|
|
1036016
|
+
<p>Enter the owner's email to access the observability console.</p>
|
|
1036017
|
+
${errorBlock}
|
|
1036018
|
+
<form method="POST" action="/obs/login">
|
|
1036019
|
+
<label for="ownerEmail">Owner email</label>
|
|
1036020
|
+
<input id="ownerEmail" name="ownerEmail" type="email" autocomplete="email" required>
|
|
1036021
|
+
<button type="submit">Continue</button>
|
|
1036022
|
+
</form>
|
|
1036023
|
+
</main>
|
|
1036024
|
+
</body>
|
|
1036025
|
+
</html>`;
|
|
1036026
|
+
}
|
|
1036376
1036027
|
function readConfigInfo() {
|
|
1036377
1036028
|
try {
|
|
1036378
1036029
|
const config2 = loadConfig();
|
|
@@ -1036477,6 +1036128,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036477
1036128
|
}
|
|
1036478
1036129
|
});
|
|
1036479
1036130
|
const rdpStreamManager = new StreamManager();
|
|
1036131
|
+
const obsOwnerEmail = getObsOwnerEmail();
|
|
1036132
|
+
const obsOwnerEmailHash = obsOwnerEmail ? import_node_crypto16.default.createHash("sha256").update(obsOwnerEmail).digest("hex") : null;
|
|
1036480
1036133
|
const server = import_node_http5.default.createServer((req, res) => {
|
|
1036481
1036134
|
try {
|
|
1036482
1036135
|
handleRequest(req, res);
|
|
@@ -1036492,7 +1036145,70 @@ function startObsServer(options3 = {}) {
|
|
|
1036492
1036145
|
try {
|
|
1036493
1036146
|
const url2 = new import_node_url7.URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
|
|
1036494
1036147
|
const pathname = url2.pathname;
|
|
1036495
|
-
|
|
1036148
|
+
const cookies = parseCookies(req.headers.cookie);
|
|
1036149
|
+
const hasObsSession = obsOwnerEmailHash !== null && cookies.get(OBS_AUTH_COOKIE) === obsOwnerEmailHash;
|
|
1036150
|
+
const requireObsAuth = () => {
|
|
1036151
|
+
if (hasObsSession)
|
|
1036152
|
+
return true;
|
|
1036153
|
+
res.statusCode = 401;
|
|
1036154
|
+
res.setHeader("content-type", "text/html; charset=utf-8");
|
|
1036155
|
+
res.setHeader("cache-control", "no-store");
|
|
1036156
|
+
res.end(renderObsLoginHtml());
|
|
1036157
|
+
return false;
|
|
1036158
|
+
};
|
|
1036159
|
+
if (pathname === "/") {
|
|
1036160
|
+
res.statusCode = 404;
|
|
1036161
|
+
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
1036162
|
+
res.setHeader("cache-control", "no-store");
|
|
1036163
|
+
res.end("Not found");
|
|
1036164
|
+
return;
|
|
1036165
|
+
}
|
|
1036166
|
+
if (pathname === "/obs/login" && req.method === "GET") {
|
|
1036167
|
+
if (hasObsSession) {
|
|
1036168
|
+
res.statusCode = 302;
|
|
1036169
|
+
res.setHeader("location", "/obs");
|
|
1036170
|
+
res.end();
|
|
1036171
|
+
return;
|
|
1036172
|
+
}
|
|
1036173
|
+
res.statusCode = 200;
|
|
1036174
|
+
res.setHeader("content-type", "text/html; charset=utf-8");
|
|
1036175
|
+
res.setHeader("cache-control", "no-store");
|
|
1036176
|
+
res.end(renderObsLoginHtml());
|
|
1036177
|
+
return;
|
|
1036178
|
+
}
|
|
1036179
|
+
if (pathname === "/obs/login" && req.method === "POST") {
|
|
1036180
|
+
const chunks = [];
|
|
1036181
|
+
req.on("data", (chunk) => {
|
|
1036182
|
+
chunks.push(chunk);
|
|
1036183
|
+
});
|
|
1036184
|
+
req.on("end", () => {
|
|
1036185
|
+
const body = Buffer.concat(chunks).toString("utf8");
|
|
1036186
|
+
const form = new URLSearchParams(body);
|
|
1036187
|
+
const submittedEmail = form.get("ownerEmail")?.trim().toLowerCase() ?? "";
|
|
1036188
|
+
if (obsOwnerEmail && submittedEmail === obsOwnerEmail) {
|
|
1036189
|
+
res.statusCode = 302;
|
|
1036190
|
+
res.setHeader("location", "/obs");
|
|
1036191
|
+
res.setHeader("set-cookie", `${OBS_AUTH_COOKIE}=${obsOwnerEmailHash}; Path=/obs; HttpOnly; SameSite=Strict`);
|
|
1036192
|
+
res.end();
|
|
1036193
|
+
return;
|
|
1036194
|
+
}
|
|
1036195
|
+
res.statusCode = 401;
|
|
1036196
|
+
res.setHeader("content-type", "text/html; charset=utf-8");
|
|
1036197
|
+
res.setHeader("cache-control", "no-store");
|
|
1036198
|
+
res.end(renderObsLoginHtml("That email does not match the configured owner."));
|
|
1036199
|
+
});
|
|
1036200
|
+
return;
|
|
1036201
|
+
}
|
|
1036202
|
+
if (pathname === "/obs/logout" && req.method === "POST") {
|
|
1036203
|
+
res.statusCode = 302;
|
|
1036204
|
+
res.setHeader("location", "/obs/login");
|
|
1036205
|
+
res.setHeader("set-cookie", `${OBS_AUTH_COOKIE}=; Path=/obs; HttpOnly; SameSite=Strict; Max-Age=0`);
|
|
1036206
|
+
res.end();
|
|
1036207
|
+
return;
|
|
1036208
|
+
}
|
|
1036209
|
+
if (pathname === "/obs" || pathname === "/obs/") {
|
|
1036210
|
+
if (!requireObsAuth())
|
|
1036211
|
+
return;
|
|
1036496
1036212
|
const html = renderIndexHtml();
|
|
1036497
1036213
|
res.statusCode = 200;
|
|
1036498
1036214
|
res.setHeader("content-type", "text/html; charset=utf-8");
|
|
@@ -1036501,6 +1036217,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036501
1036217
|
return;
|
|
1036502
1036218
|
}
|
|
1036503
1036219
|
if (pathname === "/obs/health") {
|
|
1036220
|
+
if (!requireObsAuth())
|
|
1036221
|
+
return;
|
|
1036504
1036222
|
res.statusCode = 200;
|
|
1036505
1036223
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036506
1036224
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036508,6 +1036226,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036508
1036226
|
return;
|
|
1036509
1036227
|
}
|
|
1036510
1036228
|
if (pathname === "/obs/snapshot") {
|
|
1036229
|
+
if (!requireObsAuth())
|
|
1036230
|
+
return;
|
|
1036511
1036231
|
res.statusCode = 200;
|
|
1036512
1036232
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036513
1036233
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036515,6 +1036235,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036515
1036235
|
return;
|
|
1036516
1036236
|
}
|
|
1036517
1036237
|
if (pathname === "/obs/memory") {
|
|
1036238
|
+
if (!requireObsAuth())
|
|
1036239
|
+
return;
|
|
1036518
1036240
|
res.statusCode = 200;
|
|
1036519
1036241
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036520
1036242
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036522,6 +1036244,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036522
1036244
|
return;
|
|
1036523
1036245
|
}
|
|
1036524
1036246
|
if (pathname === "/obs/skills") {
|
|
1036247
|
+
if (!requireObsAuth())
|
|
1036248
|
+
return;
|
|
1036525
1036249
|
res.statusCode = 200;
|
|
1036526
1036250
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036527
1036251
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036529,6 +1036253,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036529
1036253
|
return;
|
|
1036530
1036254
|
}
|
|
1036531
1036255
|
if (pathname === "/obs/config") {
|
|
1036256
|
+
if (!requireObsAuth())
|
|
1036257
|
+
return;
|
|
1036532
1036258
|
res.statusCode = 200;
|
|
1036533
1036259
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036534
1036260
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036536,6 +1036262,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036536
1036262
|
return;
|
|
1036537
1036263
|
}
|
|
1036538
1036264
|
if (pathname === "/obs/todos") {
|
|
1036265
|
+
if (!requireObsAuth())
|
|
1036266
|
+
return;
|
|
1036539
1036267
|
res.statusCode = 200;
|
|
1036540
1036268
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036541
1036269
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036548,6 +1036276,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036548
1036276
|
return;
|
|
1036549
1036277
|
}
|
|
1036550
1036278
|
if (pathname === "/obs/tunnel-url") {
|
|
1036279
|
+
if (!requireObsAuth())
|
|
1036280
|
+
return;
|
|
1036551
1036281
|
res.statusCode = 200;
|
|
1036552
1036282
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036553
1036283
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036555,6 +1036285,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036555
1036285
|
return;
|
|
1036556
1036286
|
}
|
|
1036557
1036287
|
if (pathname === "/obs/status") {
|
|
1036288
|
+
if (!requireObsAuth())
|
|
1036289
|
+
return;
|
|
1036558
1036290
|
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
1036559
1036291
|
res.setHeader("cache-control", "no-store");
|
|
1036560
1036292
|
const forceRefresh = url2.searchParams.get("refresh") === "1";
|
|
@@ -1036573,6 +1036305,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036573
1036305
|
return;
|
|
1036574
1036306
|
}
|
|
1036575
1036307
|
if (pathname === "/obs/events") {
|
|
1036308
|
+
if (!requireObsAuth())
|
|
1036309
|
+
return;
|
|
1036576
1036310
|
res.statusCode = 200;
|
|
1036577
1036311
|
res.setHeader("content-type", "text/event-stream; charset=utf-8");
|
|
1036578
1036312
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036599,11 +1036333,10 @@ function startObsServer(options3 = {}) {
|
|
|
1036599
1036333
|
return;
|
|
1036600
1036334
|
}
|
|
1036601
1036335
|
if (pathname === "/console" || pathname === "/console/") {
|
|
1036602
|
-
|
|
1036603
|
-
res.
|
|
1036604
|
-
res.setHeader("content-type", "text/html; charset=utf-8");
|
|
1036336
|
+
res.statusCode = 501;
|
|
1036337
|
+
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
1036605
1036338
|
res.setHeader("cache-control", "no-store");
|
|
1036606
|
-
res.end(
|
|
1036339
|
+
res.end("Not implemented");
|
|
1036607
1036340
|
return;
|
|
1036608
1036341
|
}
|
|
1036609
1036342
|
if (pathname === "/console/status") {
|
|
@@ -1036632,6 +1036365,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036632
1036365
|
return;
|
|
1036633
1036366
|
}
|
|
1036634
1036367
|
if (pathname === "/obs/tunnel/status") {
|
|
1036368
|
+
if (!requireObsAuth())
|
|
1036369
|
+
return;
|
|
1036635
1036370
|
res.statusCode = 200;
|
|
1036636
1036371
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036637
1036372
|
res.setHeader("cache-control", "no-store");
|
|
@@ -1036643,6 +1036378,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036643
1036378
|
return;
|
|
1036644
1036379
|
}
|
|
1036645
1036380
|
if (pathname === "/obs/tunnel/start" && req.method === "POST") {
|
|
1036381
|
+
if (!requireObsAuth())
|
|
1036382
|
+
return;
|
|
1036646
1036383
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036647
1036384
|
if (!tunnelProvider) {
|
|
1036648
1036385
|
res.statusCode = 400;
|
|
@@ -1036654,7 +1036391,7 @@ function startObsServer(options3 = {}) {
|
|
|
1036654
1036391
|
res.end(JSON.stringify({ ok: false, error: "server not yet bound" }));
|
|
1036655
1036392
|
return;
|
|
1036656
1036393
|
}
|
|
1036657
|
-
doStartTunnel(boundPort
|
|
1036394
|
+
doStartTunnel(boundPort).then((url3) => {
|
|
1036658
1036395
|
res.statusCode = 200;
|
|
1036659
1036396
|
res.end(JSON.stringify({ ok: true, url: url3 }));
|
|
1036660
1036397
|
}).catch((err7) => {
|
|
@@ -1036664,6 +1036401,8 @@ function startObsServer(options3 = {}) {
|
|
|
1036664
1036401
|
return;
|
|
1036665
1036402
|
}
|
|
1036666
1036403
|
if (pathname === "/obs/tunnel/stop" && req.method === "POST") {
|
|
1036404
|
+
if (!requireObsAuth())
|
|
1036405
|
+
return;
|
|
1036667
1036406
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
1036668
1036407
|
if (tunnelStop) {
|
|
1036669
1036408
|
tunnelStop().then(() => {
|
|
@@ -1036830,7 +1036569,7 @@ function startObsServer(options3 = {}) {
|
|
|
1036830
1036569
|
};
|
|
1036831
1036570
|
}
|
|
1036832
1036571
|
let tunnelLifecycleChain = Promise.resolve(null);
|
|
1036833
|
-
async function doStartTunnelInner(actualPort2
|
|
1036572
|
+
async function doStartTunnelInner(actualPort2) {
|
|
1036834
1036573
|
if (!tunnelProvider)
|
|
1036835
1036574
|
return null;
|
|
1036836
1036575
|
let url2 = null;
|
|
@@ -1036856,14 +1036595,10 @@ function startObsServer(options3 = {}) {
|
|
|
1036856
1036595
|
getAgentState().consoleUrl = url2 ?? void 0;
|
|
1036857
1036596
|
} catch {
|
|
1036858
1036597
|
}
|
|
1036859
|
-
if (opts?.notify && options3.config) {
|
|
1036860
|
-
notifyOwnerTunnelUrl(url2, options3.config).catch((_err) => {
|
|
1036861
|
-
});
|
|
1036862
|
-
}
|
|
1036863
1036598
|
return url2;
|
|
1036864
1036599
|
}
|
|
1036865
|
-
function doStartTunnel(actualPort2
|
|
1036866
|
-
const next = tunnelLifecycleChain.catch(() => null).then(() => doStartTunnelInner(actualPort2
|
|
1036600
|
+
function doStartTunnel(actualPort2) {
|
|
1036601
|
+
const next = tunnelLifecycleChain.catch(() => null).then(() => doStartTunnelInner(actualPort2));
|
|
1036867
1036602
|
tunnelLifecycleChain = next;
|
|
1036868
1036603
|
return next;
|
|
1036869
1036604
|
}
|
|
@@ -1036889,7 +1036624,7 @@ function startObsServer(options3 = {}) {
|
|
|
1036889
1036624
|
if (!p10 || !tunnelProvider)
|
|
1036890
1036625
|
return null;
|
|
1036891
1036626
|
logger.system("Restarting tunnel...");
|
|
1036892
|
-
const url2 = await doStartTunnel(p10
|
|
1036627
|
+
const url2 = await doStartTunnel(p10);
|
|
1036893
1036628
|
if (url2) {
|
|
1036894
1036629
|
logger.system(`Tunnel restarted: ${url2}`);
|
|
1036895
1036630
|
}
|