cascade-ai 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +318 -185
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +315 -182
- package/dist/cli.js.map +1 -1
- package/dist/desktop-core.cjs +887 -756
- package/dist/index.cjs +243 -112
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +241 -111
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/desktop-core.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var fs11 = require('fs');
|
|
4
|
-
var
|
|
4
|
+
var path23 = require('path');
|
|
5
5
|
var Stream2 = require('stream');
|
|
6
6
|
var util$1 = require('util');
|
|
7
7
|
var buffer = require('buffer');
|
|
@@ -48,7 +48,7 @@ function _interopNamespace(e) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
var fs11__namespace = /*#__PURE__*/_interopNamespace(fs11);
|
|
51
|
-
var
|
|
51
|
+
var path23__namespace = /*#__PURE__*/_interopNamespace(path23);
|
|
52
52
|
var Stream2__default = /*#__PURE__*/_interopDefault(Stream2);
|
|
53
53
|
var http2__default = /*#__PURE__*/_interopDefault(http2);
|
|
54
54
|
var net__default = /*#__PURE__*/_interopDefault(net);
|
|
@@ -833,14 +833,14 @@ var require_url_state_machine = __commonJS({
|
|
|
833
833
|
return url.replace(/\u0009|\u000A|\u000D/g, "");
|
|
834
834
|
}
|
|
835
835
|
function shortenPath(url) {
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
836
|
+
const path24 = url.path;
|
|
837
|
+
if (path24.length === 0) {
|
|
838
838
|
return;
|
|
839
839
|
}
|
|
840
|
-
if (url.scheme === "file" &&
|
|
840
|
+
if (url.scheme === "file" && path24.length === 1 && isNormalizedWindowsDriveLetter(path24[0])) {
|
|
841
841
|
return;
|
|
842
842
|
}
|
|
843
|
-
|
|
843
|
+
path24.pop();
|
|
844
844
|
}
|
|
845
845
|
function includesCredentials(url) {
|
|
846
846
|
return url.username !== "" || url.password !== "";
|
|
@@ -9588,14 +9588,14 @@ __export(fileFromPath_exports, {
|
|
|
9588
9588
|
fileFromPathSync: () => fileFromPathSync,
|
|
9589
9589
|
isFile: () => isFile
|
|
9590
9590
|
});
|
|
9591
|
-
function createFileFromPath(
|
|
9591
|
+
function createFileFromPath(path24, { mtimeMs, size }, filenameOrOptions, options = {}) {
|
|
9592
9592
|
let filename;
|
|
9593
9593
|
if (isPlainObject_default2(filenameOrOptions)) {
|
|
9594
9594
|
[options, filename] = [filenameOrOptions, void 0];
|
|
9595
9595
|
} else {
|
|
9596
9596
|
filename = filenameOrOptions;
|
|
9597
9597
|
}
|
|
9598
|
-
const file = new FileFromPath({ path:
|
|
9598
|
+
const file = new FileFromPath({ path: path24, size, lastModified: mtimeMs });
|
|
9599
9599
|
if (!filename) {
|
|
9600
9600
|
filename = file.name;
|
|
9601
9601
|
}
|
|
@@ -9604,13 +9604,13 @@ function createFileFromPath(path23, { mtimeMs, size }, filenameOrOptions, option
|
|
|
9604
9604
|
lastModified: file.lastModified
|
|
9605
9605
|
});
|
|
9606
9606
|
}
|
|
9607
|
-
function fileFromPathSync(
|
|
9608
|
-
const stats = fs11.statSync(
|
|
9609
|
-
return createFileFromPath(
|
|
9607
|
+
function fileFromPathSync(path24, filenameOrOptions, options = {}) {
|
|
9608
|
+
const stats = fs11.statSync(path24);
|
|
9609
|
+
return createFileFromPath(path24, stats, filenameOrOptions, options);
|
|
9610
9610
|
}
|
|
9611
|
-
async function fileFromPath2(
|
|
9612
|
-
const stats = await fs11.promises.stat(
|
|
9613
|
-
return createFileFromPath(
|
|
9611
|
+
async function fileFromPath2(path24, filenameOrOptions, options) {
|
|
9612
|
+
const stats = await fs11.promises.stat(path24);
|
|
9613
|
+
return createFileFromPath(path24, stats, filenameOrOptions, options);
|
|
9614
9614
|
}
|
|
9615
9615
|
var import_node_domexception, __classPrivateFieldSet5, __classPrivateFieldGet6, _FileFromPath_path, _FileFromPath_start, MESSAGE, FileFromPath;
|
|
9616
9616
|
var init_fileFromPath = __esm({
|
|
@@ -9637,7 +9637,7 @@ var init_fileFromPath = __esm({
|
|
|
9637
9637
|
_FileFromPath_start.set(this, void 0);
|
|
9638
9638
|
__classPrivateFieldSet5(this, _FileFromPath_path, input.path, "f");
|
|
9639
9639
|
__classPrivateFieldSet5(this, _FileFromPath_start, input.start || 0, "f");
|
|
9640
|
-
this.name =
|
|
9640
|
+
this.name = path23.basename(__classPrivateFieldGet6(this, _FileFromPath_path, "f"));
|
|
9641
9641
|
this.size = input.size;
|
|
9642
9642
|
this.lastModified = input.lastModified;
|
|
9643
9643
|
}
|
|
@@ -16564,22 +16564,22 @@ var init_from = __esm({
|
|
|
16564
16564
|
init_file();
|
|
16565
16565
|
init_fetch_blob();
|
|
16566
16566
|
({ stat } = fs11.promises);
|
|
16567
|
-
blobFromSync = (
|
|
16568
|
-
blobFrom = (
|
|
16569
|
-
fileFrom = (
|
|
16570
|
-
fileFromSync = (
|
|
16571
|
-
fromBlob = (stat3,
|
|
16572
|
-
path:
|
|
16567
|
+
blobFromSync = (path24, type) => fromBlob(fs11.statSync(path24), path24, type);
|
|
16568
|
+
blobFrom = (path24, type) => stat(path24).then((stat3) => fromBlob(stat3, path24, type));
|
|
16569
|
+
fileFrom = (path24, type) => stat(path24).then((stat3) => fromFile(stat3, path24, type));
|
|
16570
|
+
fileFromSync = (path24, type) => fromFile(fs11.statSync(path24), path24, type);
|
|
16571
|
+
fromBlob = (stat3, path24, type = "") => new fetch_blob_default([new BlobDataItem({
|
|
16572
|
+
path: path24,
|
|
16573
16573
|
size: stat3.size,
|
|
16574
16574
|
lastModified: stat3.mtimeMs,
|
|
16575
16575
|
start: 0
|
|
16576
16576
|
})], { type });
|
|
16577
|
-
fromFile = (stat3,
|
|
16578
|
-
path:
|
|
16577
|
+
fromFile = (stat3, path24, type = "") => new file_default([new BlobDataItem({
|
|
16578
|
+
path: path24,
|
|
16579
16579
|
size: stat3.size,
|
|
16580
16580
|
lastModified: stat3.mtimeMs,
|
|
16581
16581
|
start: 0
|
|
16582
|
-
})],
|
|
16582
|
+
})], path23.basename(path24), { type, lastModified: stat3.mtimeMs });
|
|
16583
16583
|
BlobDataItem = class _BlobDataItem {
|
|
16584
16584
|
#path;
|
|
16585
16585
|
#start;
|
|
@@ -21710,9 +21710,9 @@ var require_util2 = __commonJS({
|
|
|
21710
21710
|
exports.removeUndefinedValuesInObject = removeUndefinedValuesInObject;
|
|
21711
21711
|
exports.isValidFile = isValidFile;
|
|
21712
21712
|
exports.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
|
|
21713
|
-
var
|
|
21713
|
+
var fs27 = __require("fs");
|
|
21714
21714
|
var os8 = __require("os");
|
|
21715
|
-
var
|
|
21715
|
+
var path24 = __require("path");
|
|
21716
21716
|
var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
|
|
21717
21717
|
var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
|
|
21718
21718
|
function snakeToCamel(str2) {
|
|
@@ -21798,15 +21798,15 @@ var require_util2 = __commonJS({
|
|
|
21798
21798
|
}
|
|
21799
21799
|
async function isValidFile(filePath) {
|
|
21800
21800
|
try {
|
|
21801
|
-
const stats = await
|
|
21801
|
+
const stats = await fs27.promises.lstat(filePath);
|
|
21802
21802
|
return stats.isFile();
|
|
21803
21803
|
} catch (e3) {
|
|
21804
21804
|
return false;
|
|
21805
21805
|
}
|
|
21806
21806
|
}
|
|
21807
21807
|
function getWellKnownCertificateConfigFileLocation() {
|
|
21808
|
-
const configDir = process.env.CLOUDSDK_CONFIG || (_isWindows() ?
|
|
21809
|
-
return
|
|
21808
|
+
const configDir = process.env.CLOUDSDK_CONFIG || (_isWindows() ? path24.join(process.env.APPDATA || "", CLOUDSDK_CONFIG_DIRECTORY) : path24.join(process.env.HOME || "", ".config", CLOUDSDK_CONFIG_DIRECTORY));
|
|
21809
|
+
return path24.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
|
|
21810
21810
|
}
|
|
21811
21811
|
function _isWindows() {
|
|
21812
21812
|
return os8.platform().startsWith("win");
|
|
@@ -23739,11 +23739,11 @@ var require_getCredentials = __commonJS({
|
|
|
23739
23739
|
"node_modules/google-auth-library/build/src/gtoken/getCredentials.js"(exports) {
|
|
23740
23740
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23741
23741
|
exports.getCredentials = getCredentials;
|
|
23742
|
-
var
|
|
23743
|
-
var
|
|
23742
|
+
var path24 = __require("path");
|
|
23743
|
+
var fs27 = __require("fs");
|
|
23744
23744
|
var util_1 = __require("util");
|
|
23745
23745
|
var errorWithCode_1 = require_errorWithCode();
|
|
23746
|
-
var readFile =
|
|
23746
|
+
var readFile = fs27.readFile ? (0, util_1.promisify)(fs27.readFile) : async () => {
|
|
23747
23747
|
throw new errorWithCode_1.ErrorWithCode("use key rather than keyFile.", "MISSING_CREDENTIALS");
|
|
23748
23748
|
};
|
|
23749
23749
|
var ExtensionFiles;
|
|
@@ -23811,7 +23811,7 @@ var require_getCredentials = __commonJS({
|
|
|
23811
23811
|
* @returns An instance of a class that implements ICredentialsProvider.
|
|
23812
23812
|
*/
|
|
23813
23813
|
static create(keyFilePath) {
|
|
23814
|
-
const keyFileExtension =
|
|
23814
|
+
const keyFileExtension = path24.extname(keyFilePath);
|
|
23815
23815
|
switch (keyFileExtension) {
|
|
23816
23816
|
case ExtensionFiles.JSON:
|
|
23817
23817
|
return new JsonCredentialsProvider(keyFilePath);
|
|
@@ -25409,12 +25409,12 @@ var require_filesubjecttokensupplier = __commonJS({
|
|
|
25409
25409
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25410
25410
|
exports.FileSubjectTokenSupplier = void 0;
|
|
25411
25411
|
var util_1 = __require("util");
|
|
25412
|
-
var
|
|
25413
|
-
var readFile = (0, util_1.promisify)(
|
|
25412
|
+
var fs27 = __require("fs");
|
|
25413
|
+
var readFile = (0, util_1.promisify)(fs27.readFile ?? (() => {
|
|
25414
25414
|
}));
|
|
25415
|
-
var realpath = (0, util_1.promisify)(
|
|
25415
|
+
var realpath = (0, util_1.promisify)(fs27.realpath ?? (() => {
|
|
25416
25416
|
}));
|
|
25417
|
-
var lstat = (0, util_1.promisify)(
|
|
25417
|
+
var lstat = (0, util_1.promisify)(fs27.lstat ?? (() => {
|
|
25418
25418
|
}));
|
|
25419
25419
|
var FileSubjectTokenSupplier = class {
|
|
25420
25420
|
filePath;
|
|
@@ -25530,7 +25530,7 @@ var require_certificatesubjecttokensupplier = __commonJS({
|
|
|
25530
25530
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25531
25531
|
exports.CertificateSubjectTokenSupplier = exports.InvalidConfigurationError = exports.CertificateSourceUnavailableError = exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE = void 0;
|
|
25532
25532
|
var util_1 = require_util2();
|
|
25533
|
-
var
|
|
25533
|
+
var fs27 = __require("fs");
|
|
25534
25534
|
var crypto_1 = __require("crypto");
|
|
25535
25535
|
var https4 = __require("https");
|
|
25536
25536
|
exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE = "GOOGLE_API_CERTIFICATE_CONFIG";
|
|
@@ -25624,7 +25624,7 @@ var require_certificatesubjecttokensupplier = __commonJS({
|
|
|
25624
25624
|
const configPath = this.certificateConfigPath;
|
|
25625
25625
|
let fileContents;
|
|
25626
25626
|
try {
|
|
25627
|
-
fileContents = await
|
|
25627
|
+
fileContents = await fs27.promises.readFile(configPath, "utf8");
|
|
25628
25628
|
} catch (err) {
|
|
25629
25629
|
throw new CertificateSourceUnavailableError(`Failed to read certificate config file at: ${configPath}`);
|
|
25630
25630
|
}
|
|
@@ -25649,14 +25649,14 @@ var require_certificatesubjecttokensupplier = __commonJS({
|
|
|
25649
25649
|
async #getKeyAndCert(certPath, keyPath) {
|
|
25650
25650
|
let cert, key;
|
|
25651
25651
|
try {
|
|
25652
|
-
cert = await
|
|
25652
|
+
cert = await fs27.promises.readFile(certPath);
|
|
25653
25653
|
new crypto_1.X509Certificate(cert);
|
|
25654
25654
|
} catch (err) {
|
|
25655
25655
|
const message = err instanceof Error ? err.message : String(err);
|
|
25656
25656
|
throw new CertificateSourceUnavailableError(`Failed to read certificate file at ${certPath}: ${message}`);
|
|
25657
25657
|
}
|
|
25658
25658
|
try {
|
|
25659
|
-
key = await
|
|
25659
|
+
key = await fs27.promises.readFile(keyPath);
|
|
25660
25660
|
(0, crypto_1.createPrivateKey)(key);
|
|
25661
25661
|
} catch (err) {
|
|
25662
25662
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -25675,7 +25675,7 @@ var require_certificatesubjecttokensupplier = __commonJS({
|
|
|
25675
25675
|
return JSON.stringify([leafCert.raw.toString("base64")]);
|
|
25676
25676
|
}
|
|
25677
25677
|
try {
|
|
25678
|
-
const chainPems = await
|
|
25678
|
+
const chainPems = await fs27.promises.readFile(this.trustChainPath, "utf8");
|
|
25679
25679
|
const pemBlocks = chainPems.match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g) ?? [];
|
|
25680
25680
|
const chainCerts = pemBlocks.map((pem, index) => {
|
|
25681
25681
|
try {
|
|
@@ -26371,7 +26371,7 @@ var require_pluggable_auth_handler = __commonJS({
|
|
|
26371
26371
|
exports.PluggableAuthHandler = exports.ExecutableError = void 0;
|
|
26372
26372
|
var executable_response_1 = require_executable_response();
|
|
26373
26373
|
var childProcess = __require("child_process");
|
|
26374
|
-
var
|
|
26374
|
+
var fs27 = __require("fs");
|
|
26375
26375
|
var ExecutableError = class extends Error {
|
|
26376
26376
|
/**
|
|
26377
26377
|
* The exit code returned by the executable.
|
|
@@ -26456,14 +26456,14 @@ var require_pluggable_auth_handler = __commonJS({
|
|
|
26456
26456
|
}
|
|
26457
26457
|
let filePath;
|
|
26458
26458
|
try {
|
|
26459
|
-
filePath = await
|
|
26459
|
+
filePath = await fs27.promises.realpath(this.outputFile);
|
|
26460
26460
|
} catch {
|
|
26461
26461
|
return void 0;
|
|
26462
26462
|
}
|
|
26463
|
-
if (!(await
|
|
26463
|
+
if (!(await fs27.promises.lstat(filePath)).isFile()) {
|
|
26464
26464
|
return void 0;
|
|
26465
26465
|
}
|
|
26466
|
-
const responseString = await
|
|
26466
|
+
const responseString = await fs27.promises.readFile(filePath, {
|
|
26467
26467
|
encoding: "utf8"
|
|
26468
26468
|
});
|
|
26469
26469
|
if (responseString === "") {
|
|
@@ -26870,7 +26870,7 @@ var require_gdchclient = __commonJS({
|
|
|
26870
26870
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26871
26871
|
exports.GdchClient = exports.GDCH_SERVICE_ACCOUNT_TYPE = void 0;
|
|
26872
26872
|
var crypto8 = __require("crypto");
|
|
26873
|
-
var
|
|
26873
|
+
var fs27 = __require("fs");
|
|
26874
26874
|
var https4 = __require("https");
|
|
26875
26875
|
var oauth2client_1 = require_oauth2client();
|
|
26876
26876
|
var DEFAULT_LIFETIME_IN_SECONDS = 3600;
|
|
@@ -27093,7 +27093,7 @@ var require_gdchclient = __commonJS({
|
|
|
27093
27093
|
const currentPath = this.caCertPath;
|
|
27094
27094
|
this.caAgentPromise = (async () => {
|
|
27095
27095
|
try {
|
|
27096
|
-
const ca = await
|
|
27096
|
+
const ca = await fs27.promises.readFile(currentPath);
|
|
27097
27097
|
return new https4.Agent({ ca });
|
|
27098
27098
|
} catch (err) {
|
|
27099
27099
|
if (this.cachedCaCertPath === currentPath) {
|
|
@@ -27152,11 +27152,11 @@ var require_googleauth = __commonJS({
|
|
|
27152
27152
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27153
27153
|
exports.GoogleAuth = exports.GoogleAuthExceptionMessages = void 0;
|
|
27154
27154
|
var child_process_1 = __require("child_process");
|
|
27155
|
-
var
|
|
27155
|
+
var fs27 = __require("fs");
|
|
27156
27156
|
var gaxios_1 = require_src2();
|
|
27157
27157
|
var gcpMetadata = require_src4();
|
|
27158
27158
|
var os8 = __require("os");
|
|
27159
|
-
var
|
|
27159
|
+
var path24 = __require("path");
|
|
27160
27160
|
var crypto_1 = require_crypto3();
|
|
27161
27161
|
var computeclient_1 = require_computeclient();
|
|
27162
27162
|
var idtokenclient_1 = require_idtokenclient();
|
|
@@ -27418,12 +27418,12 @@ var require_googleauth = __commonJS({
|
|
|
27418
27418
|
* @api private
|
|
27419
27419
|
*/
|
|
27420
27420
|
async _tryGetApplicationCredentialsFromEnvironmentVariable(options) {
|
|
27421
|
-
const
|
|
27422
|
-
if (!
|
|
27421
|
+
const credentialsPath2 = process.env["GOOGLE_APPLICATION_CREDENTIALS"] || process.env["google_application_credentials"];
|
|
27422
|
+
if (!credentialsPath2 || credentialsPath2.length === 0) {
|
|
27423
27423
|
return null;
|
|
27424
27424
|
}
|
|
27425
27425
|
try {
|
|
27426
|
-
return this._getApplicationCredentialsFromFilePath(
|
|
27426
|
+
return this._getApplicationCredentialsFromFilePath(credentialsPath2, options);
|
|
27427
27427
|
} catch (e3) {
|
|
27428
27428
|
if (e3 instanceof Error) {
|
|
27429
27429
|
e3.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e3.message}`;
|
|
@@ -27443,12 +27443,12 @@ var require_googleauth = __commonJS({
|
|
|
27443
27443
|
} else {
|
|
27444
27444
|
const home = process.env["HOME"];
|
|
27445
27445
|
if (home) {
|
|
27446
|
-
location =
|
|
27446
|
+
location = path24.join(home, ".config");
|
|
27447
27447
|
}
|
|
27448
27448
|
}
|
|
27449
27449
|
if (location) {
|
|
27450
|
-
location =
|
|
27451
|
-
if (!
|
|
27450
|
+
location = path24.join(location, "gcloud", "application_default_credentials.json");
|
|
27451
|
+
if (!fs27.existsSync(location)) {
|
|
27452
27452
|
location = null;
|
|
27453
27453
|
}
|
|
27454
27454
|
}
|
|
@@ -27469,8 +27469,8 @@ var require_googleauth = __commonJS({
|
|
|
27469
27469
|
throw new Error("The file path is invalid.");
|
|
27470
27470
|
}
|
|
27471
27471
|
try {
|
|
27472
|
-
filePath =
|
|
27473
|
-
if (!
|
|
27472
|
+
filePath = fs27.realpathSync(filePath);
|
|
27473
|
+
if (!fs27.lstatSync(filePath).isFile()) {
|
|
27474
27474
|
throw new Error();
|
|
27475
27475
|
}
|
|
27476
27476
|
} catch (err) {
|
|
@@ -27479,7 +27479,7 @@ var require_googleauth = __commonJS({
|
|
|
27479
27479
|
}
|
|
27480
27480
|
throw err;
|
|
27481
27481
|
}
|
|
27482
|
-
const readStream =
|
|
27482
|
+
const readStream = fs27.createReadStream(filePath);
|
|
27483
27483
|
return this.fromStream(readStream, options);
|
|
27484
27484
|
}
|
|
27485
27485
|
/**
|
|
@@ -27806,8 +27806,8 @@ var require_googleauth = __commonJS({
|
|
|
27806
27806
|
if (this.jsonContent) {
|
|
27807
27807
|
return this._cacheClientFromJSON(this.jsonContent, this.clientOptions);
|
|
27808
27808
|
} else if (this.keyFilename) {
|
|
27809
|
-
const filePath =
|
|
27810
|
-
const stream2 =
|
|
27809
|
+
const filePath = path24.resolve(this.keyFilename);
|
|
27810
|
+
const stream2 = fs27.createReadStream(filePath);
|
|
27811
27811
|
return await this.fromStreamAsync(stream2, this.clientOptions);
|
|
27812
27812
|
} else if (this.apiKey) {
|
|
27813
27813
|
const client = await this.fromAPIKey(this.apiKey, this.clientOptions);
|
|
@@ -32245,17 +32245,17 @@ var require_ignore = __commonJS({
|
|
|
32245
32245
|
var throwError = (message, Ctor) => {
|
|
32246
32246
|
throw new Ctor(message);
|
|
32247
32247
|
};
|
|
32248
|
-
var checkPath = (
|
|
32249
|
-
if (!isString2(
|
|
32248
|
+
var checkPath = (path24, originalPath, doThrow) => {
|
|
32249
|
+
if (!isString2(path24)) {
|
|
32250
32250
|
return doThrow(
|
|
32251
32251
|
`path must be a string, but got \`${originalPath}\``,
|
|
32252
32252
|
TypeError
|
|
32253
32253
|
);
|
|
32254
32254
|
}
|
|
32255
|
-
if (!
|
|
32255
|
+
if (!path24) {
|
|
32256
32256
|
return doThrow(`path must not be empty`, TypeError);
|
|
32257
32257
|
}
|
|
32258
|
-
if (checkPath.isNotRelative(
|
|
32258
|
+
if (checkPath.isNotRelative(path24)) {
|
|
32259
32259
|
const r4 = "`path.relative()`d";
|
|
32260
32260
|
return doThrow(
|
|
32261
32261
|
`path should be a ${r4} string, but got "${originalPath}"`,
|
|
@@ -32264,7 +32264,7 @@ var require_ignore = __commonJS({
|
|
|
32264
32264
|
}
|
|
32265
32265
|
return true;
|
|
32266
32266
|
};
|
|
32267
|
-
var isNotRelative = (
|
|
32267
|
+
var isNotRelative = (path24) => REGEX_TEST_INVALID_PATH.test(path24);
|
|
32268
32268
|
checkPath.isNotRelative = isNotRelative;
|
|
32269
32269
|
checkPath.convert = (p3) => p3;
|
|
32270
32270
|
var Ignore = class {
|
|
@@ -32323,7 +32323,7 @@ var require_ignore = __commonJS({
|
|
|
32323
32323
|
// setting `checkUnignored` to `false` could reduce additional
|
|
32324
32324
|
// path matching.
|
|
32325
32325
|
// @returns {TestResult} true if a file is ignored
|
|
32326
|
-
_testOne(
|
|
32326
|
+
_testOne(path24, checkUnignored) {
|
|
32327
32327
|
let ignored = false;
|
|
32328
32328
|
let unignored = false;
|
|
32329
32329
|
this._rules.forEach((rule) => {
|
|
@@ -32331,7 +32331,7 @@ var require_ignore = __commonJS({
|
|
|
32331
32331
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
32332
32332
|
return;
|
|
32333
32333
|
}
|
|
32334
|
-
const matched = rule.regex.test(
|
|
32334
|
+
const matched = rule.regex.test(path24);
|
|
32335
32335
|
if (matched) {
|
|
32336
32336
|
ignored = !negative;
|
|
32337
32337
|
unignored = negative;
|
|
@@ -32344,24 +32344,24 @@ var require_ignore = __commonJS({
|
|
|
32344
32344
|
}
|
|
32345
32345
|
// @returns {TestResult}
|
|
32346
32346
|
_test(originalPath, cache, checkUnignored, slices) {
|
|
32347
|
-
const
|
|
32347
|
+
const path24 = originalPath && checkPath.convert(originalPath);
|
|
32348
32348
|
checkPath(
|
|
32349
|
-
|
|
32349
|
+
path24,
|
|
32350
32350
|
originalPath,
|
|
32351
32351
|
this._allowRelativePaths ? RETURN_FALSE : throwError
|
|
32352
32352
|
);
|
|
32353
|
-
return this._t(
|
|
32353
|
+
return this._t(path24, cache, checkUnignored, slices);
|
|
32354
32354
|
}
|
|
32355
|
-
_t(
|
|
32356
|
-
if (
|
|
32357
|
-
return cache[
|
|
32355
|
+
_t(path24, cache, checkUnignored, slices) {
|
|
32356
|
+
if (path24 in cache) {
|
|
32357
|
+
return cache[path24];
|
|
32358
32358
|
}
|
|
32359
32359
|
if (!slices) {
|
|
32360
|
-
slices =
|
|
32360
|
+
slices = path24.split(SLASH);
|
|
32361
32361
|
}
|
|
32362
32362
|
slices.pop();
|
|
32363
32363
|
if (!slices.length) {
|
|
32364
|
-
return cache[
|
|
32364
|
+
return cache[path24] = this._testOne(path24, checkUnignored);
|
|
32365
32365
|
}
|
|
32366
32366
|
const parent = this._t(
|
|
32367
32367
|
slices.join(SLASH) + SLASH,
|
|
@@ -32369,24 +32369,24 @@ var require_ignore = __commonJS({
|
|
|
32369
32369
|
checkUnignored,
|
|
32370
32370
|
slices
|
|
32371
32371
|
);
|
|
32372
|
-
return cache[
|
|
32372
|
+
return cache[path24] = parent.ignored ? parent : this._testOne(path24, checkUnignored);
|
|
32373
32373
|
}
|
|
32374
|
-
ignores(
|
|
32375
|
-
return this._test(
|
|
32374
|
+
ignores(path24) {
|
|
32375
|
+
return this._test(path24, this._ignoreCache, false).ignored;
|
|
32376
32376
|
}
|
|
32377
32377
|
createFilter() {
|
|
32378
|
-
return (
|
|
32378
|
+
return (path24) => !this.ignores(path24);
|
|
32379
32379
|
}
|
|
32380
32380
|
filter(paths) {
|
|
32381
32381
|
return makeArray(paths).filter(this.createFilter());
|
|
32382
32382
|
}
|
|
32383
32383
|
// @returns {TestResult}
|
|
32384
|
-
test(
|
|
32385
|
-
return this._test(
|
|
32384
|
+
test(path24) {
|
|
32385
|
+
return this._test(path24, this._testCache, true);
|
|
32386
32386
|
}
|
|
32387
32387
|
};
|
|
32388
32388
|
var factory = (options) => new Ignore(options);
|
|
32389
|
-
var isPathValid = (
|
|
32389
|
+
var isPathValid = (path24) => checkPath(path24 && checkPath.convert(path24), path24, RETURN_FALSE);
|
|
32390
32390
|
factory.isPathValid = isPathValid;
|
|
32391
32391
|
factory.default = factory;
|
|
32392
32392
|
module.exports = factory;
|
|
@@ -32397,7 +32397,7 @@ var require_ignore = __commonJS({
|
|
|
32397
32397
|
const makePosix = (str2) => /^\\\\\?\\/.test(str2) || /["<>|\u0000-\u001F]+/u.test(str2) ? str2 : str2.replace(/\\/g, "/");
|
|
32398
32398
|
checkPath.convert = makePosix;
|
|
32399
32399
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
32400
|
-
checkPath.isNotRelative = (
|
|
32400
|
+
checkPath.isNotRelative = (path24) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path24) || isNotRelative(path24);
|
|
32401
32401
|
}
|
|
32402
32402
|
}
|
|
32403
32403
|
});
|
|
@@ -33060,10 +33060,10 @@ var require_src7 = __commonJS({
|
|
|
33060
33060
|
var fs_1 = __require("fs");
|
|
33061
33061
|
var debug_1 = __importDefault(require_src6());
|
|
33062
33062
|
var log = debug_1.default("@kwsites/file-exists");
|
|
33063
|
-
function check2(
|
|
33064
|
-
log(`checking %s`,
|
|
33063
|
+
function check2(path24, isFile2, isDirectory) {
|
|
33064
|
+
log(`checking %s`, path24);
|
|
33065
33065
|
try {
|
|
33066
|
-
const stat3 = fs_1.statSync(
|
|
33066
|
+
const stat3 = fs_1.statSync(path24);
|
|
33067
33067
|
if (stat3.isFile() && isFile2) {
|
|
33068
33068
|
log(`[OK] path represents a file`);
|
|
33069
33069
|
return true;
|
|
@@ -33083,8 +33083,8 @@ var require_src7 = __commonJS({
|
|
|
33083
33083
|
throw e3;
|
|
33084
33084
|
}
|
|
33085
33085
|
}
|
|
33086
|
-
function exists2(
|
|
33087
|
-
return check2(
|
|
33086
|
+
function exists2(path24, type = exports.READABLE) {
|
|
33087
|
+
return check2(path24, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
|
|
33088
33088
|
}
|
|
33089
33089
|
exports.exists = exists2;
|
|
33090
33090
|
exports.FILE = 1;
|
|
@@ -164308,8 +164308,8 @@ var require_utils3 = __commonJS({
|
|
|
164308
164308
|
}
|
|
164309
164309
|
return ind;
|
|
164310
164310
|
}
|
|
164311
|
-
function removeDotSegments(
|
|
164312
|
-
let input =
|
|
164311
|
+
function removeDotSegments(path24) {
|
|
164312
|
+
let input = path24;
|
|
164313
164313
|
const output = [];
|
|
164314
164314
|
let nextSlash = -1;
|
|
164315
164315
|
let len = 0;
|
|
@@ -164560,8 +164560,8 @@ var require_schemes = __commonJS({
|
|
|
164560
164560
|
wsComponent.secure = void 0;
|
|
164561
164561
|
}
|
|
164562
164562
|
if (wsComponent.resourceName) {
|
|
164563
|
-
const [
|
|
164564
|
-
wsComponent.path =
|
|
164563
|
+
const [path24, query] = wsComponent.resourceName.split("?");
|
|
164564
|
+
wsComponent.path = path24 && path24 !== "/" ? path24 : void 0;
|
|
164565
164565
|
wsComponent.query = query;
|
|
164566
164566
|
wsComponent.resourceName = void 0;
|
|
164567
164567
|
}
|
|
@@ -167908,12 +167908,12 @@ var require_dist5 = __commonJS({
|
|
|
167908
167908
|
throw new Error(`Unknown format "${name}"`);
|
|
167909
167909
|
return f4;
|
|
167910
167910
|
};
|
|
167911
|
-
function addFormats(ajv, list,
|
|
167911
|
+
function addFormats(ajv, list, fs27, exportName) {
|
|
167912
167912
|
var _a5;
|
|
167913
167913
|
var _b;
|
|
167914
167914
|
(_a5 = (_b = ajv.opts.code).formats) !== null && _a5 !== void 0 ? _a5 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
167915
167915
|
for (const f4 of list)
|
|
167916
|
-
ajv.addFormat(f4,
|
|
167916
|
+
ajv.addFormat(f4, fs27[f4]);
|
|
167917
167917
|
}
|
|
167918
167918
|
module.exports = exports = formatsPlugin;
|
|
167919
167919
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -167926,8 +167926,8 @@ var require_windows = __commonJS({
|
|
|
167926
167926
|
"node_modules/isexe/windows.js"(exports, module) {
|
|
167927
167927
|
module.exports = isexe;
|
|
167928
167928
|
isexe.sync = sync;
|
|
167929
|
-
var
|
|
167930
|
-
function checkPathExt(
|
|
167929
|
+
var fs27 = __require("fs");
|
|
167930
|
+
function checkPathExt(path24, options) {
|
|
167931
167931
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
167932
167932
|
if (!pathext) {
|
|
167933
167933
|
return true;
|
|
@@ -167938,25 +167938,25 @@ var require_windows = __commonJS({
|
|
|
167938
167938
|
}
|
|
167939
167939
|
for (var i4 = 0; i4 < pathext.length; i4++) {
|
|
167940
167940
|
var p3 = pathext[i4].toLowerCase();
|
|
167941
|
-
if (p3 &&
|
|
167941
|
+
if (p3 && path24.substr(-p3.length).toLowerCase() === p3) {
|
|
167942
167942
|
return true;
|
|
167943
167943
|
}
|
|
167944
167944
|
}
|
|
167945
167945
|
return false;
|
|
167946
167946
|
}
|
|
167947
|
-
function checkStat(stat3,
|
|
167947
|
+
function checkStat(stat3, path24, options) {
|
|
167948
167948
|
if (!stat3.isSymbolicLink() && !stat3.isFile()) {
|
|
167949
167949
|
return false;
|
|
167950
167950
|
}
|
|
167951
|
-
return checkPathExt(
|
|
167951
|
+
return checkPathExt(path24, options);
|
|
167952
167952
|
}
|
|
167953
|
-
function isexe(
|
|
167954
|
-
|
|
167955
|
-
cb(er2, er2 ? false : checkStat(stat3,
|
|
167953
|
+
function isexe(path24, options, cb) {
|
|
167954
|
+
fs27.stat(path24, function(er2, stat3) {
|
|
167955
|
+
cb(er2, er2 ? false : checkStat(stat3, path24, options));
|
|
167956
167956
|
});
|
|
167957
167957
|
}
|
|
167958
|
-
function sync(
|
|
167959
|
-
return checkStat(
|
|
167958
|
+
function sync(path24, options) {
|
|
167959
|
+
return checkStat(fs27.statSync(path24), path24, options);
|
|
167960
167960
|
}
|
|
167961
167961
|
}
|
|
167962
167962
|
});
|
|
@@ -167966,14 +167966,14 @@ var require_mode = __commonJS({
|
|
|
167966
167966
|
"node_modules/isexe/mode.js"(exports, module) {
|
|
167967
167967
|
module.exports = isexe;
|
|
167968
167968
|
isexe.sync = sync;
|
|
167969
|
-
var
|
|
167970
|
-
function isexe(
|
|
167971
|
-
|
|
167969
|
+
var fs27 = __require("fs");
|
|
167970
|
+
function isexe(path24, options, cb) {
|
|
167971
|
+
fs27.stat(path24, function(er2, stat3) {
|
|
167972
167972
|
cb(er2, er2 ? false : checkStat(stat3, options));
|
|
167973
167973
|
});
|
|
167974
167974
|
}
|
|
167975
|
-
function sync(
|
|
167976
|
-
return checkStat(
|
|
167975
|
+
function sync(path24, options) {
|
|
167976
|
+
return checkStat(fs27.statSync(path24), options);
|
|
167977
167977
|
}
|
|
167978
167978
|
function checkStat(stat3, options) {
|
|
167979
167979
|
return stat3.isFile() && checkMode(stat3, options);
|
|
@@ -168006,7 +168006,7 @@ var require_isexe = __commonJS({
|
|
|
168006
168006
|
}
|
|
168007
168007
|
module.exports = isexe;
|
|
168008
168008
|
isexe.sync = sync;
|
|
168009
|
-
function isexe(
|
|
168009
|
+
function isexe(path24, options, cb) {
|
|
168010
168010
|
if (typeof options === "function") {
|
|
168011
168011
|
cb = options;
|
|
168012
168012
|
options = {};
|
|
@@ -168016,7 +168016,7 @@ var require_isexe = __commonJS({
|
|
|
168016
168016
|
throw new TypeError("callback not provided");
|
|
168017
168017
|
}
|
|
168018
168018
|
return new Promise(function(resolve, reject) {
|
|
168019
|
-
isexe(
|
|
168019
|
+
isexe(path24, options || {}, function(er2, is2) {
|
|
168020
168020
|
if (er2) {
|
|
168021
168021
|
reject(er2);
|
|
168022
168022
|
} else {
|
|
@@ -168025,7 +168025,7 @@ var require_isexe = __commonJS({
|
|
|
168025
168025
|
});
|
|
168026
168026
|
});
|
|
168027
168027
|
}
|
|
168028
|
-
core(
|
|
168028
|
+
core(path24, options || {}, function(er2, is2) {
|
|
168029
168029
|
if (er2) {
|
|
168030
168030
|
if (er2.code === "EACCES" || options && options.ignoreErrors) {
|
|
168031
168031
|
er2 = null;
|
|
@@ -168035,9 +168035,9 @@ var require_isexe = __commonJS({
|
|
|
168035
168035
|
cb(er2, is2);
|
|
168036
168036
|
});
|
|
168037
168037
|
}
|
|
168038
|
-
function sync(
|
|
168038
|
+
function sync(path24, options) {
|
|
168039
168039
|
try {
|
|
168040
|
-
return core.sync(
|
|
168040
|
+
return core.sync(path24, options || {});
|
|
168041
168041
|
} catch (er2) {
|
|
168042
168042
|
if (options && options.ignoreErrors || er2.code === "EACCES") {
|
|
168043
168043
|
return false;
|
|
@@ -168053,7 +168053,7 @@ var require_isexe = __commonJS({
|
|
|
168053
168053
|
var require_which = __commonJS({
|
|
168054
168054
|
"node_modules/which/which.js"(exports, module) {
|
|
168055
168055
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
168056
|
-
var
|
|
168056
|
+
var path24 = __require("path");
|
|
168057
168057
|
var COLON2 = isWindows ? ";" : ":";
|
|
168058
168058
|
var isexe = require_isexe();
|
|
168059
168059
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -168091,7 +168091,7 @@ var require_which = __commonJS({
|
|
|
168091
168091
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
168092
168092
|
const ppRaw = pathEnv[i4];
|
|
168093
168093
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
168094
|
-
const pCmd =
|
|
168094
|
+
const pCmd = path24.join(pathPart, cmd);
|
|
168095
168095
|
const p3 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
168096
168096
|
resolve(subStep(p3, i4, 0));
|
|
168097
168097
|
});
|
|
@@ -168118,7 +168118,7 @@ var require_which = __commonJS({
|
|
|
168118
168118
|
for (let i4 = 0; i4 < pathEnv.length; i4++) {
|
|
168119
168119
|
const ppRaw = pathEnv[i4];
|
|
168120
168120
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
168121
|
-
const pCmd =
|
|
168121
|
+
const pCmd = path24.join(pathPart, cmd);
|
|
168122
168122
|
const p3 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
168123
168123
|
for (let j4 = 0; j4 < pathExt.length; j4++) {
|
|
168124
168124
|
const cur = p3 + pathExt[j4];
|
|
@@ -168164,7 +168164,7 @@ var require_path_key = __commonJS({
|
|
|
168164
168164
|
// node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
168165
168165
|
var require_resolveCommand = __commonJS({
|
|
168166
168166
|
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
168167
|
-
var
|
|
168167
|
+
var path24 = __require("path");
|
|
168168
168168
|
var which = require_which();
|
|
168169
168169
|
var getPathKey = require_path_key();
|
|
168170
168170
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -168182,7 +168182,7 @@ var require_resolveCommand = __commonJS({
|
|
|
168182
168182
|
try {
|
|
168183
168183
|
resolved = which.sync(parsed.command, {
|
|
168184
168184
|
path: env[getPathKey({ env })],
|
|
168185
|
-
pathExt: withoutPathExt ?
|
|
168185
|
+
pathExt: withoutPathExt ? path24.delimiter : void 0
|
|
168186
168186
|
});
|
|
168187
168187
|
} catch (e3) {
|
|
168188
168188
|
} finally {
|
|
@@ -168191,7 +168191,7 @@ var require_resolveCommand = __commonJS({
|
|
|
168191
168191
|
}
|
|
168192
168192
|
}
|
|
168193
168193
|
if (resolved) {
|
|
168194
|
-
resolved =
|
|
168194
|
+
resolved = path24.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
168195
168195
|
}
|
|
168196
168196
|
return resolved;
|
|
168197
168197
|
}
|
|
@@ -168242,8 +168242,8 @@ var require_shebang_command = __commonJS({
|
|
|
168242
168242
|
if (!match) {
|
|
168243
168243
|
return null;
|
|
168244
168244
|
}
|
|
168245
|
-
const [
|
|
168246
|
-
const binary =
|
|
168245
|
+
const [path24, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
168246
|
+
const binary = path24.split("/").pop();
|
|
168247
168247
|
if (binary === "env") {
|
|
168248
168248
|
return argument;
|
|
168249
168249
|
}
|
|
@@ -168255,16 +168255,16 @@ var require_shebang_command = __commonJS({
|
|
|
168255
168255
|
// node_modules/cross-spawn/lib/util/readShebang.js
|
|
168256
168256
|
var require_readShebang = __commonJS({
|
|
168257
168257
|
"node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
168258
|
-
var
|
|
168258
|
+
var fs27 = __require("fs");
|
|
168259
168259
|
var shebangCommand = require_shebang_command();
|
|
168260
168260
|
function readShebang(command) {
|
|
168261
168261
|
const size = 150;
|
|
168262
168262
|
const buffer = Buffer.alloc(size);
|
|
168263
168263
|
let fd;
|
|
168264
168264
|
try {
|
|
168265
|
-
fd =
|
|
168266
|
-
|
|
168267
|
-
|
|
168265
|
+
fd = fs27.openSync(command, "r");
|
|
168266
|
+
fs27.readSync(fd, buffer, 0, size, 0);
|
|
168267
|
+
fs27.closeSync(fd);
|
|
168268
168268
|
} catch (e3) {
|
|
168269
168269
|
}
|
|
168270
168270
|
return shebangCommand(buffer.toString());
|
|
@@ -168276,7 +168276,7 @@ var require_readShebang = __commonJS({
|
|
|
168276
168276
|
// node_modules/cross-spawn/lib/parse.js
|
|
168277
168277
|
var require_parse2 = __commonJS({
|
|
168278
168278
|
"node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
168279
|
-
var
|
|
168279
|
+
var path24 = __require("path");
|
|
168280
168280
|
var resolveCommand = require_resolveCommand();
|
|
168281
168281
|
var escape2 = require_escape();
|
|
168282
168282
|
var readShebang = require_readShebang();
|
|
@@ -168301,7 +168301,7 @@ var require_parse2 = __commonJS({
|
|
|
168301
168301
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
168302
168302
|
if (parsed.options.forceShell || needsShell) {
|
|
168303
168303
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
168304
|
-
parsed.command =
|
|
168304
|
+
parsed.command = path24.normalize(parsed.command);
|
|
168305
168305
|
parsed.command = escape2.command(parsed.command);
|
|
168306
168306
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
168307
168307
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -168421,12 +168421,12 @@ var init_audit_logger = __esm({
|
|
|
168421
168421
|
constructor(workspacePath, debugMode = false) {
|
|
168422
168422
|
this.workspacePath = workspacePath;
|
|
168423
168423
|
this.debugMode = debugMode;
|
|
168424
|
-
const cascadeDir =
|
|
168424
|
+
const cascadeDir = path23__namespace.default.join(workspacePath, ".cascade");
|
|
168425
168425
|
if (!fs11__namespace.default.existsSync(cascadeDir)) {
|
|
168426
168426
|
fs11__namespace.default.mkdirSync(cascadeDir, { recursive: true });
|
|
168427
168427
|
}
|
|
168428
|
-
this.keyPath =
|
|
168429
|
-
this.dbPath =
|
|
168428
|
+
this.keyPath = path23__namespace.default.join(cascadeDir, "audit_log.key");
|
|
168429
|
+
this.dbPath = path23__namespace.default.join(cascadeDir, "audit_log.db");
|
|
168430
168430
|
this.initEncryptionKey();
|
|
168431
168431
|
this.db = new Database__default.default(this.dbPath);
|
|
168432
168432
|
this.db.pragma("journal_mode = WAL");
|
|
@@ -168538,7 +168538,7 @@ var init_audit_logger = __esm({
|
|
|
168538
168538
|
dumpDebugIfNeeded() {
|
|
168539
168539
|
if (!this.debugMode) return;
|
|
168540
168540
|
try {
|
|
168541
|
-
const dumpPath =
|
|
168541
|
+
const dumpPath = path23__namespace.default.join(os7__default.default.tmpdir(), "cascade_audit_logs_debug.json");
|
|
168542
168542
|
const entries = this.getAllLogs();
|
|
168543
168543
|
fs11__namespace.default.writeFileSync(dumpPath, JSON.stringify(entries, null, 2), "utf-8");
|
|
168544
168544
|
} catch (err) {
|
|
@@ -168558,12 +168558,12 @@ function createModulerModifier() {
|
|
|
168558
168558
|
return frames;
|
|
168559
168559
|
};
|
|
168560
168560
|
}
|
|
168561
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
168561
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? path23.dirname(process.argv[1]) : process.cwd(), isWindows = "\\" === path23.sep) {
|
|
168562
168562
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
168563
168563
|
return (filename) => {
|
|
168564
168564
|
if (!filename) return;
|
|
168565
168565
|
const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
|
|
168566
|
-
let { dir, base: file, ext } =
|
|
168566
|
+
let { dir, base: file, ext } = path23.posix.parse(normalizedFilename);
|
|
168567
168567
|
if (".js" === ext || ".mjs" === ext || ".cjs" === ext) file = file.slice(0, -1 * ext.length);
|
|
168568
168568
|
const decodedFile = decodeURIComponent(file);
|
|
168569
168569
|
if (!dir) dir = ".";
|
|
@@ -168576,8 +168576,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? path22.dirname
|
|
|
168576
168576
|
return decodedFile;
|
|
168577
168577
|
};
|
|
168578
168578
|
}
|
|
168579
|
-
function normalizeWindowsPath(
|
|
168580
|
-
return
|
|
168579
|
+
function normalizeWindowsPath(path24) {
|
|
168580
|
+
return path24.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
168581
168581
|
}
|
|
168582
168582
|
var init_module_node = __esm({
|
|
168583
168583
|
"node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
|
|
@@ -171211,9 +171211,9 @@ async function addSourceContext(frames) {
|
|
|
171211
171211
|
LRU_FILE_CONTENTS_CACHE.reduce();
|
|
171212
171212
|
return frames;
|
|
171213
171213
|
}
|
|
171214
|
-
function getContextLinesFromFile(
|
|
171214
|
+
function getContextLinesFromFile(path24, ranges, output) {
|
|
171215
171215
|
return new Promise((resolve) => {
|
|
171216
|
-
const stream2 = fs11.createReadStream(
|
|
171216
|
+
const stream2 = fs11.createReadStream(path24);
|
|
171217
171217
|
const lineReaded = readline.createInterface({
|
|
171218
171218
|
input: stream2
|
|
171219
171219
|
});
|
|
@@ -171228,7 +171228,7 @@ function getContextLinesFromFile(path23, ranges, output) {
|
|
|
171228
171228
|
let rangeStart = range[0];
|
|
171229
171229
|
let rangeEnd = range[1];
|
|
171230
171230
|
function onStreamError() {
|
|
171231
|
-
LRU_FILE_CONTENTS_FS_READ_FAILED.set(
|
|
171231
|
+
LRU_FILE_CONTENTS_FS_READ_FAILED.set(path24, 1);
|
|
171232
171232
|
lineReaded.close();
|
|
171233
171233
|
lineReaded.removeAllListeners();
|
|
171234
171234
|
destroyStreamAndResolve();
|
|
@@ -171289,8 +171289,8 @@ function clearLineContext(frame) {
|
|
|
171289
171289
|
delete frame.context_line;
|
|
171290
171290
|
delete frame.post_context;
|
|
171291
171291
|
}
|
|
171292
|
-
function shouldSkipContextLinesForFile(
|
|
171293
|
-
return
|
|
171292
|
+
function shouldSkipContextLinesForFile(path24) {
|
|
171293
|
+
return path24.startsWith("node:") || path24.endsWith(".min.js") || path24.endsWith(".min.cjs") || path24.endsWith(".min.mjs") || path24.startsWith("data:");
|
|
171294
171294
|
}
|
|
171295
171295
|
function shouldSkipContextLinesForFrame(frame) {
|
|
171296
171296
|
if (void 0 !== frame.lineno && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
|
|
@@ -171373,12 +171373,12 @@ var init_context_lines_node = __esm({
|
|
|
171373
171373
|
}
|
|
171374
171374
|
});
|
|
171375
171375
|
function createRelativePathModifier(basePath = process.cwd()) {
|
|
171376
|
-
const isWindows = "\\" ===
|
|
171376
|
+
const isWindows = "\\" === path23.sep;
|
|
171377
171377
|
const toUnix = (p3) => isWindows ? p3.replace(/\\/g, "/") : p3;
|
|
171378
171378
|
const normalizedBase = toUnix(basePath);
|
|
171379
171379
|
return async (frames) => {
|
|
171380
171380
|
for (const frame of frames) if (!(!frame.filename || frame.filename.startsWith("node:") || frame.filename.startsWith("data:"))) {
|
|
171381
|
-
if (
|
|
171381
|
+
if (path23.isAbsolute(frame.filename)) frame.filename = toUnix(path23.relative(normalizedBase, toUnix(frame.filename)));
|
|
171382
171382
|
}
|
|
171383
171383
|
return frames;
|
|
171384
171384
|
};
|
|
@@ -174837,8 +174837,8 @@ var require_node4 = __commonJS({
|
|
|
174837
174837
|
}
|
|
174838
174838
|
break;
|
|
174839
174839
|
case "FILE":
|
|
174840
|
-
var
|
|
174841
|
-
stream3 = new
|
|
174840
|
+
var fs27 = __require("fs");
|
|
174841
|
+
stream3 = new fs27.SyncWriteStream(fd2, { autoClose: false });
|
|
174842
174842
|
stream3._type = "fs";
|
|
174843
174843
|
break;
|
|
174844
174844
|
case "PIPE":
|
|
@@ -187531,11 +187531,11 @@ var require_mime_types = __commonJS({
|
|
|
187531
187531
|
}
|
|
187532
187532
|
return exts[0];
|
|
187533
187533
|
}
|
|
187534
|
-
function lookup(
|
|
187535
|
-
if (!
|
|
187534
|
+
function lookup(path24) {
|
|
187535
|
+
if (!path24 || typeof path24 !== "string") {
|
|
187536
187536
|
return false;
|
|
187537
187537
|
}
|
|
187538
|
-
var extension3 = extname("x." +
|
|
187538
|
+
var extension3 = extname("x." + path24).toLowerCase().substr(1);
|
|
187539
187539
|
if (!extension3) {
|
|
187540
187540
|
return false;
|
|
187541
187541
|
}
|
|
@@ -191019,7 +191019,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
191019
191019
|
"node_modules/path-to-regexp/index.js"(exports, module) {
|
|
191020
191020
|
module.exports = pathToRegexp;
|
|
191021
191021
|
var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g;
|
|
191022
|
-
function pathToRegexp(
|
|
191022
|
+
function pathToRegexp(path24, keys, options) {
|
|
191023
191023
|
options = options || {};
|
|
191024
191024
|
keys = keys || [];
|
|
191025
191025
|
var strict = options.strict;
|
|
@@ -191033,8 +191033,8 @@ var require_path_to_regexp = __commonJS({
|
|
|
191033
191033
|
var pos = 0;
|
|
191034
191034
|
var backtrack = "";
|
|
191035
191035
|
var m3;
|
|
191036
|
-
if (
|
|
191037
|
-
while (m3 = MATCHING_GROUP_REGEXP.exec(
|
|
191036
|
+
if (path24 instanceof RegExp) {
|
|
191037
|
+
while (m3 = MATCHING_GROUP_REGEXP.exec(path24.source)) {
|
|
191038
191038
|
if (m3[0][0] === "\\") continue;
|
|
191039
191039
|
keys.push({
|
|
191040
191040
|
name: m3[1] || name++,
|
|
@@ -191042,18 +191042,18 @@ var require_path_to_regexp = __commonJS({
|
|
|
191042
191042
|
offset: m3.index
|
|
191043
191043
|
});
|
|
191044
191044
|
}
|
|
191045
|
-
return
|
|
191045
|
+
return path24;
|
|
191046
191046
|
}
|
|
191047
|
-
if (Array.isArray(
|
|
191048
|
-
|
|
191047
|
+
if (Array.isArray(path24)) {
|
|
191048
|
+
path24 = path24.map(function(value) {
|
|
191049
191049
|
return pathToRegexp(value, keys, options).source;
|
|
191050
191050
|
});
|
|
191051
|
-
return new RegExp(
|
|
191051
|
+
return new RegExp(path24.join("|"), flags);
|
|
191052
191052
|
}
|
|
191053
|
-
if (typeof
|
|
191053
|
+
if (typeof path24 !== "string") {
|
|
191054
191054
|
throw new TypeError("path must be a string, array of strings, or regular expression");
|
|
191055
191055
|
}
|
|
191056
|
-
|
|
191056
|
+
path24 = path24.replace(
|
|
191057
191057
|
/\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g,
|
|
191058
191058
|
function(match, slash, format, key, capture, star, optional2, offset) {
|
|
191059
191059
|
if (match[0] === "\\") {
|
|
@@ -191070,7 +191070,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
191070
191070
|
if (slash || format) {
|
|
191071
191071
|
backtrack = "";
|
|
191072
191072
|
} else {
|
|
191073
|
-
backtrack +=
|
|
191073
|
+
backtrack += path24.slice(pos, offset);
|
|
191074
191074
|
}
|
|
191075
191075
|
pos = offset + match.length;
|
|
191076
191076
|
if (match === "*") {
|
|
@@ -191100,7 +191100,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
191100
191100
|
return result;
|
|
191101
191101
|
}
|
|
191102
191102
|
);
|
|
191103
|
-
while (m3 = MATCHING_GROUP_REGEXP.exec(
|
|
191103
|
+
while (m3 = MATCHING_GROUP_REGEXP.exec(path24)) {
|
|
191104
191104
|
if (m3[0][0] === "\\") continue;
|
|
191105
191105
|
if (keysOffset + i4 === keys.length || keys[keysOffset + i4].offset > m3.index) {
|
|
191106
191106
|
keys.splice(keysOffset + i4, 0, {
|
|
@@ -191112,13 +191112,13 @@ var require_path_to_regexp = __commonJS({
|
|
|
191112
191112
|
}
|
|
191113
191113
|
i4++;
|
|
191114
191114
|
}
|
|
191115
|
-
|
|
191115
|
+
path24 += strict ? "" : path24[path24.length - 1] === "/" ? "?" : "/?";
|
|
191116
191116
|
if (end) {
|
|
191117
|
-
|
|
191118
|
-
} else if (
|
|
191119
|
-
|
|
191117
|
+
path24 += "$";
|
|
191118
|
+
} else if (path24[path24.length - 1] !== "/") {
|
|
191119
|
+
path24 += lookahead ? "(?=/|$)" : "(?:/|$)";
|
|
191120
191120
|
}
|
|
191121
|
-
return new RegExp("^" +
|
|
191121
|
+
return new RegExp("^" + path24, flags);
|
|
191122
191122
|
}
|
|
191123
191123
|
}
|
|
191124
191124
|
});
|
|
@@ -191130,19 +191130,19 @@ var require_layer = __commonJS({
|
|
|
191130
191130
|
var debug3 = require_src9()("express:router:layer");
|
|
191131
191131
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
191132
191132
|
module.exports = Layer;
|
|
191133
|
-
function Layer(
|
|
191133
|
+
function Layer(path24, options, fn) {
|
|
191134
191134
|
if (!(this instanceof Layer)) {
|
|
191135
|
-
return new Layer(
|
|
191135
|
+
return new Layer(path24, options, fn);
|
|
191136
191136
|
}
|
|
191137
|
-
debug3("new %o",
|
|
191137
|
+
debug3("new %o", path24);
|
|
191138
191138
|
var opts = options || {};
|
|
191139
191139
|
this.handle = fn;
|
|
191140
191140
|
this.name = fn.name || "<anonymous>";
|
|
191141
191141
|
this.params = void 0;
|
|
191142
191142
|
this.path = void 0;
|
|
191143
|
-
this.regexp = pathRegexp(
|
|
191144
|
-
this.regexp.fast_star =
|
|
191145
|
-
this.regexp.fast_slash =
|
|
191143
|
+
this.regexp = pathRegexp(path24, this.keys = [], opts);
|
|
191144
|
+
this.regexp.fast_star = path24 === "*";
|
|
191145
|
+
this.regexp.fast_slash = path24 === "/" && opts.end === false;
|
|
191146
191146
|
}
|
|
191147
191147
|
Layer.prototype.handle_error = function handle_error(error2, req, res, next) {
|
|
191148
191148
|
var fn = this.handle;
|
|
@@ -191166,20 +191166,20 @@ var require_layer = __commonJS({
|
|
|
191166
191166
|
next(err);
|
|
191167
191167
|
}
|
|
191168
191168
|
};
|
|
191169
|
-
Layer.prototype.match = function match(
|
|
191169
|
+
Layer.prototype.match = function match(path24) {
|
|
191170
191170
|
var match2;
|
|
191171
|
-
if (
|
|
191171
|
+
if (path24 != null) {
|
|
191172
191172
|
if (this.regexp.fast_slash) {
|
|
191173
191173
|
this.params = {};
|
|
191174
191174
|
this.path = "";
|
|
191175
191175
|
return true;
|
|
191176
191176
|
}
|
|
191177
191177
|
if (this.regexp.fast_star) {
|
|
191178
|
-
this.params = { "0": decode_param(
|
|
191179
|
-
this.path =
|
|
191178
|
+
this.params = { "0": decode_param(path24) };
|
|
191179
|
+
this.path = path24;
|
|
191180
191180
|
return true;
|
|
191181
191181
|
}
|
|
191182
|
-
match2 = this.regexp.exec(
|
|
191182
|
+
match2 = this.regexp.exec(path24);
|
|
191183
191183
|
}
|
|
191184
191184
|
if (!match2) {
|
|
191185
191185
|
this.params = void 0;
|
|
@@ -191270,10 +191270,10 @@ var require_route = __commonJS({
|
|
|
191270
191270
|
var slice = Array.prototype.slice;
|
|
191271
191271
|
var toString = Object.prototype.toString;
|
|
191272
191272
|
module.exports = Route;
|
|
191273
|
-
function Route(
|
|
191274
|
-
this.path =
|
|
191273
|
+
function Route(path24) {
|
|
191274
|
+
this.path = path24;
|
|
191275
191275
|
this.stack = [];
|
|
191276
|
-
debug3("new %o",
|
|
191276
|
+
debug3("new %o", path24);
|
|
191277
191277
|
this.methods = {};
|
|
191278
191278
|
}
|
|
191279
191279
|
Route.prototype._handles_method = function _handles_method(method) {
|
|
@@ -191484,8 +191484,8 @@ var require_router = __commonJS({
|
|
|
191484
191484
|
if (++sync > 100) {
|
|
191485
191485
|
return setImmediate(next, err);
|
|
191486
191486
|
}
|
|
191487
|
-
var
|
|
191488
|
-
if (
|
|
191487
|
+
var path24 = getPathname(req);
|
|
191488
|
+
if (path24 == null) {
|
|
191489
191489
|
return done(layerError);
|
|
191490
191490
|
}
|
|
191491
191491
|
var layer;
|
|
@@ -191493,7 +191493,7 @@ var require_router = __commonJS({
|
|
|
191493
191493
|
var route;
|
|
191494
191494
|
while (match !== true && idx < stack.length) {
|
|
191495
191495
|
layer = stack[idx++];
|
|
191496
|
-
match = matchLayer(layer,
|
|
191496
|
+
match = matchLayer(layer, path24);
|
|
191497
191497
|
route = layer.route;
|
|
191498
191498
|
if (typeof match !== "boolean") {
|
|
191499
191499
|
layerError = layerError || match;
|
|
@@ -191531,18 +191531,18 @@ var require_router = __commonJS({
|
|
|
191531
191531
|
} else if (route) {
|
|
191532
191532
|
layer.handle_request(req, res, next);
|
|
191533
191533
|
} else {
|
|
191534
|
-
trim_prefix(layer, layerError, layerPath,
|
|
191534
|
+
trim_prefix(layer, layerError, layerPath, path24);
|
|
191535
191535
|
}
|
|
191536
191536
|
sync = 0;
|
|
191537
191537
|
});
|
|
191538
191538
|
}
|
|
191539
|
-
function trim_prefix(layer, layerError, layerPath,
|
|
191539
|
+
function trim_prefix(layer, layerError, layerPath, path24) {
|
|
191540
191540
|
if (layerPath.length !== 0) {
|
|
191541
|
-
if (layerPath !==
|
|
191541
|
+
if (layerPath !== path24.slice(0, layerPath.length)) {
|
|
191542
191542
|
next(layerError);
|
|
191543
191543
|
return;
|
|
191544
191544
|
}
|
|
191545
|
-
var c4 =
|
|
191545
|
+
var c4 = path24[layerPath.length];
|
|
191546
191546
|
if (c4 && c4 !== "/" && c4 !== ".") return next(layerError);
|
|
191547
191547
|
debug3("trim prefix (%s) from url %s", layerPath, req.url);
|
|
191548
191548
|
removed = layerPath;
|
|
@@ -191620,7 +191620,7 @@ var require_router = __commonJS({
|
|
|
191620
191620
|
};
|
|
191621
191621
|
proto.use = function use(fn) {
|
|
191622
191622
|
var offset = 0;
|
|
191623
|
-
var
|
|
191623
|
+
var path24 = "/";
|
|
191624
191624
|
if (typeof fn !== "function") {
|
|
191625
191625
|
var arg = fn;
|
|
191626
191626
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -191628,7 +191628,7 @@ var require_router = __commonJS({
|
|
|
191628
191628
|
}
|
|
191629
191629
|
if (typeof arg !== "function") {
|
|
191630
191630
|
offset = 1;
|
|
191631
|
-
|
|
191631
|
+
path24 = fn;
|
|
191632
191632
|
}
|
|
191633
191633
|
}
|
|
191634
191634
|
var callbacks = flatten(slice.call(arguments, offset));
|
|
@@ -191640,8 +191640,8 @@ var require_router = __commonJS({
|
|
|
191640
191640
|
if (typeof fn !== "function") {
|
|
191641
191641
|
throw new TypeError("Router.use() requires a middleware function but got a " + gettype(fn));
|
|
191642
191642
|
}
|
|
191643
|
-
debug3("use %o %s",
|
|
191644
|
-
var layer = new Layer(
|
|
191643
|
+
debug3("use %o %s", path24, fn.name || "<anonymous>");
|
|
191644
|
+
var layer = new Layer(path24, {
|
|
191645
191645
|
sensitive: this.caseSensitive,
|
|
191646
191646
|
strict: false,
|
|
191647
191647
|
end: false
|
|
@@ -191651,9 +191651,9 @@ var require_router = __commonJS({
|
|
|
191651
191651
|
}
|
|
191652
191652
|
return this;
|
|
191653
191653
|
};
|
|
191654
|
-
proto.route = function route(
|
|
191655
|
-
var route2 = new Route(
|
|
191656
|
-
var layer = new Layer(
|
|
191654
|
+
proto.route = function route(path24) {
|
|
191655
|
+
var route2 = new Route(path24);
|
|
191656
|
+
var layer = new Layer(path24, {
|
|
191657
191657
|
sensitive: this.caseSensitive,
|
|
191658
191658
|
strict: this.strict,
|
|
191659
191659
|
end: true
|
|
@@ -191663,8 +191663,8 @@ var require_router = __commonJS({
|
|
|
191663
191663
|
return route2;
|
|
191664
191664
|
};
|
|
191665
191665
|
methods.concat("all").forEach(function(method) {
|
|
191666
|
-
proto[method] = function(
|
|
191667
|
-
var route = this.route(
|
|
191666
|
+
proto[method] = function(path24) {
|
|
191667
|
+
var route = this.route(path24);
|
|
191668
191668
|
route[method].apply(route, slice.call(arguments, 1));
|
|
191669
191669
|
return this;
|
|
191670
191670
|
};
|
|
@@ -191700,9 +191700,9 @@ var require_router = __commonJS({
|
|
|
191700
191700
|
}
|
|
191701
191701
|
return toString.call(obj).replace(objectRegExp, "$1");
|
|
191702
191702
|
}
|
|
191703
|
-
function matchLayer(layer,
|
|
191703
|
+
function matchLayer(layer, path24) {
|
|
191704
191704
|
try {
|
|
191705
|
-
return layer.match(
|
|
191705
|
+
return layer.match(path24);
|
|
191706
191706
|
} catch (err) {
|
|
191707
191707
|
return err;
|
|
191708
191708
|
}
|
|
@@ -191817,13 +191817,13 @@ var require_query = __commonJS({
|
|
|
191817
191817
|
var require_view = __commonJS({
|
|
191818
191818
|
"node_modules/express/lib/view.js"(exports, module) {
|
|
191819
191819
|
var debug3 = require_src9()("express:view");
|
|
191820
|
-
var
|
|
191821
|
-
var
|
|
191822
|
-
var dirname2 =
|
|
191823
|
-
var basename4 =
|
|
191824
|
-
var extname =
|
|
191825
|
-
var join =
|
|
191826
|
-
var resolve =
|
|
191820
|
+
var path24 = __require("path");
|
|
191821
|
+
var fs27 = __require("fs");
|
|
191822
|
+
var dirname2 = path24.dirname;
|
|
191823
|
+
var basename4 = path24.basename;
|
|
191824
|
+
var extname = path24.extname;
|
|
191825
|
+
var join = path24.join;
|
|
191826
|
+
var resolve = path24.resolve;
|
|
191827
191827
|
module.exports = View;
|
|
191828
191828
|
function View(name, options) {
|
|
191829
191829
|
var opts = options || {};
|
|
@@ -191852,17 +191852,17 @@ var require_view = __commonJS({
|
|
|
191852
191852
|
this.path = this.lookup(fileName);
|
|
191853
191853
|
}
|
|
191854
191854
|
View.prototype.lookup = function lookup(name) {
|
|
191855
|
-
var
|
|
191855
|
+
var path25;
|
|
191856
191856
|
var roots = [].concat(this.root);
|
|
191857
191857
|
debug3('lookup "%s"', name);
|
|
191858
|
-
for (var i4 = 0; i4 < roots.length && !
|
|
191858
|
+
for (var i4 = 0; i4 < roots.length && !path25; i4++) {
|
|
191859
191859
|
var root = roots[i4];
|
|
191860
191860
|
var loc = resolve(root, name);
|
|
191861
191861
|
var dir = dirname2(loc);
|
|
191862
191862
|
var file = basename4(loc);
|
|
191863
|
-
|
|
191863
|
+
path25 = this.resolve(dir, file);
|
|
191864
191864
|
}
|
|
191865
|
-
return
|
|
191865
|
+
return path25;
|
|
191866
191866
|
};
|
|
191867
191867
|
View.prototype.render = function render(options, callback) {
|
|
191868
191868
|
debug3('render "%s"', this.path);
|
|
@@ -191870,21 +191870,21 @@ var require_view = __commonJS({
|
|
|
191870
191870
|
};
|
|
191871
191871
|
View.prototype.resolve = function resolve2(dir, file) {
|
|
191872
191872
|
var ext = this.ext;
|
|
191873
|
-
var
|
|
191874
|
-
var stat3 = tryStat(
|
|
191873
|
+
var path25 = join(dir, file);
|
|
191874
|
+
var stat3 = tryStat(path25);
|
|
191875
191875
|
if (stat3 && stat3.isFile()) {
|
|
191876
|
-
return
|
|
191876
|
+
return path25;
|
|
191877
191877
|
}
|
|
191878
|
-
|
|
191879
|
-
stat3 = tryStat(
|
|
191878
|
+
path25 = join(dir, basename4(file, ext), "index" + ext);
|
|
191879
|
+
stat3 = tryStat(path25);
|
|
191880
191880
|
if (stat3 && stat3.isFile()) {
|
|
191881
|
-
return
|
|
191881
|
+
return path25;
|
|
191882
191882
|
}
|
|
191883
191883
|
};
|
|
191884
|
-
function tryStat(
|
|
191885
|
-
debug3('stat "%s"',
|
|
191884
|
+
function tryStat(path25) {
|
|
191885
|
+
debug3('stat "%s"', path25);
|
|
191886
191886
|
try {
|
|
191887
|
-
return
|
|
191887
|
+
return fs27.statSync(path25);
|
|
191888
191888
|
} catch (e3) {
|
|
191889
191889
|
return void 0;
|
|
191890
191890
|
}
|
|
@@ -192178,7 +192178,7 @@ var require_types2 = __commonJS({
|
|
|
192178
192178
|
var require_mime = __commonJS({
|
|
192179
192179
|
"node_modules/mime/mime.js"(exports, module) {
|
|
192180
192180
|
__require("path");
|
|
192181
|
-
var
|
|
192181
|
+
var fs27 = __require("fs");
|
|
192182
192182
|
function Mime() {
|
|
192183
192183
|
this.types = /* @__PURE__ */ Object.create(null);
|
|
192184
192184
|
this.extensions = /* @__PURE__ */ Object.create(null);
|
|
@@ -192199,7 +192199,7 @@ var require_mime = __commonJS({
|
|
|
192199
192199
|
};
|
|
192200
192200
|
Mime.prototype.load = function(file) {
|
|
192201
192201
|
this._loading = file;
|
|
192202
|
-
var map = {}, content =
|
|
192202
|
+
var map = {}, content = fs27.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
|
|
192203
192203
|
lines.forEach(function(line) {
|
|
192204
192204
|
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/);
|
|
192205
192205
|
map[fields.shift()] = fields;
|
|
@@ -192207,8 +192207,8 @@ var require_mime = __commonJS({
|
|
|
192207
192207
|
this.define(map);
|
|
192208
192208
|
this._loading = null;
|
|
192209
192209
|
};
|
|
192210
|
-
Mime.prototype.lookup = function(
|
|
192211
|
-
var ext =
|
|
192210
|
+
Mime.prototype.lookup = function(path25, fallback) {
|
|
192211
|
+
var ext = path25.replace(/^.*[\.\/\\]/, "").toLowerCase();
|
|
192212
192212
|
return this.types[ext] || fallback || this.default_type;
|
|
192213
192213
|
};
|
|
192214
192214
|
Mime.prototype.extension = function(mimeType) {
|
|
@@ -192435,33 +192435,33 @@ var require_send = __commonJS({
|
|
|
192435
192435
|
var escapeHtml = require_escape_html();
|
|
192436
192436
|
var etag = require_etag();
|
|
192437
192437
|
var fresh = require_fresh();
|
|
192438
|
-
var
|
|
192438
|
+
var fs27 = __require("fs");
|
|
192439
192439
|
var mime = require_mime();
|
|
192440
192440
|
var ms2 = require_ms5();
|
|
192441
192441
|
var onFinished = require_on_finished();
|
|
192442
192442
|
var parseRange = require_range_parser();
|
|
192443
|
-
var
|
|
192443
|
+
var path24 = __require("path");
|
|
192444
192444
|
var statuses = require_statuses();
|
|
192445
192445
|
var Stream7 = __require("stream");
|
|
192446
192446
|
var util2 = __require("util");
|
|
192447
|
-
var extname =
|
|
192448
|
-
var join =
|
|
192449
|
-
var normalize2 =
|
|
192450
|
-
var resolve =
|
|
192451
|
-
var sep3 =
|
|
192447
|
+
var extname = path24.extname;
|
|
192448
|
+
var join = path24.join;
|
|
192449
|
+
var normalize2 = path24.normalize;
|
|
192450
|
+
var resolve = path24.resolve;
|
|
192451
|
+
var sep3 = path24.sep;
|
|
192452
192452
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
192453
192453
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
192454
192454
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
192455
192455
|
module.exports = send;
|
|
192456
192456
|
module.exports.mime = mime;
|
|
192457
|
-
function send(req,
|
|
192458
|
-
return new SendStream(req,
|
|
192457
|
+
function send(req, path25, options) {
|
|
192458
|
+
return new SendStream(req, path25, options);
|
|
192459
192459
|
}
|
|
192460
|
-
function SendStream(req,
|
|
192460
|
+
function SendStream(req, path25, options) {
|
|
192461
192461
|
Stream7.call(this);
|
|
192462
192462
|
var opts = options || {};
|
|
192463
192463
|
this.options = opts;
|
|
192464
|
-
this.path =
|
|
192464
|
+
this.path = path25;
|
|
192465
192465
|
this.req = req;
|
|
192466
192466
|
this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
|
|
192467
192467
|
this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
|
|
@@ -192507,8 +192507,8 @@ var require_send = __commonJS({
|
|
|
192507
192507
|
this._index = index2;
|
|
192508
192508
|
return this;
|
|
192509
192509
|
}, "send.index: pass index as option");
|
|
192510
|
-
SendStream.prototype.root = function root(
|
|
192511
|
-
this._root = resolve(String(
|
|
192510
|
+
SendStream.prototype.root = function root(path25) {
|
|
192511
|
+
this._root = resolve(String(path25));
|
|
192512
192512
|
debug3("root %s", this._root);
|
|
192513
192513
|
return this;
|
|
192514
192514
|
};
|
|
@@ -192621,10 +192621,10 @@ var require_send = __commonJS({
|
|
|
192621
192621
|
var lastModified = this.res.getHeader("Last-Modified");
|
|
192622
192622
|
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
192623
192623
|
};
|
|
192624
|
-
SendStream.prototype.redirect = function redirect(
|
|
192624
|
+
SendStream.prototype.redirect = function redirect(path25) {
|
|
192625
192625
|
var res = this.res;
|
|
192626
192626
|
if (hasListeners(this, "directory")) {
|
|
192627
|
-
this.emit("directory", res,
|
|
192627
|
+
this.emit("directory", res, path25);
|
|
192628
192628
|
return;
|
|
192629
192629
|
}
|
|
192630
192630
|
if (this.hasTrailingSlash()) {
|
|
@@ -192644,42 +192644,42 @@ var require_send = __commonJS({
|
|
|
192644
192644
|
SendStream.prototype.pipe = function pipe2(res) {
|
|
192645
192645
|
var root = this._root;
|
|
192646
192646
|
this.res = res;
|
|
192647
|
-
var
|
|
192648
|
-
if (
|
|
192647
|
+
var path25 = decode(this.path);
|
|
192648
|
+
if (path25 === -1) {
|
|
192649
192649
|
this.error(400);
|
|
192650
192650
|
return res;
|
|
192651
192651
|
}
|
|
192652
|
-
if (~
|
|
192652
|
+
if (~path25.indexOf("\0")) {
|
|
192653
192653
|
this.error(400);
|
|
192654
192654
|
return res;
|
|
192655
192655
|
}
|
|
192656
192656
|
var parts;
|
|
192657
192657
|
if (root !== null) {
|
|
192658
|
-
if (
|
|
192659
|
-
|
|
192658
|
+
if (path25) {
|
|
192659
|
+
path25 = normalize2("." + sep3 + path25);
|
|
192660
192660
|
}
|
|
192661
|
-
if (UP_PATH_REGEXP.test(
|
|
192662
|
-
debug3('malicious path "%s"',
|
|
192661
|
+
if (UP_PATH_REGEXP.test(path25)) {
|
|
192662
|
+
debug3('malicious path "%s"', path25);
|
|
192663
192663
|
this.error(403);
|
|
192664
192664
|
return res;
|
|
192665
192665
|
}
|
|
192666
|
-
parts =
|
|
192667
|
-
|
|
192666
|
+
parts = path25.split(sep3);
|
|
192667
|
+
path25 = normalize2(join(root, path25));
|
|
192668
192668
|
} else {
|
|
192669
|
-
if (UP_PATH_REGEXP.test(
|
|
192670
|
-
debug3('malicious path "%s"',
|
|
192669
|
+
if (UP_PATH_REGEXP.test(path25)) {
|
|
192670
|
+
debug3('malicious path "%s"', path25);
|
|
192671
192671
|
this.error(403);
|
|
192672
192672
|
return res;
|
|
192673
192673
|
}
|
|
192674
|
-
parts = normalize2(
|
|
192675
|
-
|
|
192674
|
+
parts = normalize2(path25).split(sep3);
|
|
192675
|
+
path25 = resolve(path25);
|
|
192676
192676
|
}
|
|
192677
192677
|
if (containsDotFile(parts)) {
|
|
192678
192678
|
var access = this._dotfiles;
|
|
192679
192679
|
if (access === void 0) {
|
|
192680
192680
|
access = parts[parts.length - 1][0] === "." ? this._hidden ? "allow" : "ignore" : "allow";
|
|
192681
192681
|
}
|
|
192682
|
-
debug3('%s dotfile "%s"', access,
|
|
192682
|
+
debug3('%s dotfile "%s"', access, path25);
|
|
192683
192683
|
switch (access) {
|
|
192684
192684
|
case "allow":
|
|
192685
192685
|
break;
|
|
@@ -192693,13 +192693,13 @@ var require_send = __commonJS({
|
|
|
192693
192693
|
}
|
|
192694
192694
|
}
|
|
192695
192695
|
if (this._index.length && this.hasTrailingSlash()) {
|
|
192696
|
-
this.sendIndex(
|
|
192696
|
+
this.sendIndex(path25);
|
|
192697
192697
|
return res;
|
|
192698
192698
|
}
|
|
192699
|
-
this.sendFile(
|
|
192699
|
+
this.sendFile(path25);
|
|
192700
192700
|
return res;
|
|
192701
192701
|
};
|
|
192702
|
-
SendStream.prototype.send = function send2(
|
|
192702
|
+
SendStream.prototype.send = function send2(path25, stat3) {
|
|
192703
192703
|
var len = stat3.size;
|
|
192704
192704
|
var options = this.options;
|
|
192705
192705
|
var opts = {};
|
|
@@ -192711,9 +192711,9 @@ var require_send = __commonJS({
|
|
|
192711
192711
|
this.headersAlreadySent();
|
|
192712
192712
|
return;
|
|
192713
192713
|
}
|
|
192714
|
-
debug3('pipe "%s"',
|
|
192715
|
-
this.setHeader(
|
|
192716
|
-
this.type(
|
|
192714
|
+
debug3('pipe "%s"', path25);
|
|
192715
|
+
this.setHeader(path25, stat3);
|
|
192716
|
+
this.type(path25);
|
|
192717
192717
|
if (this.isConditionalGET()) {
|
|
192718
192718
|
if (this.isPreconditionFailure()) {
|
|
192719
192719
|
this.error(412);
|
|
@@ -192762,28 +192762,28 @@ var require_send = __commonJS({
|
|
|
192762
192762
|
res.end();
|
|
192763
192763
|
return;
|
|
192764
192764
|
}
|
|
192765
|
-
this.stream(
|
|
192765
|
+
this.stream(path25, opts);
|
|
192766
192766
|
};
|
|
192767
|
-
SendStream.prototype.sendFile = function sendFile(
|
|
192767
|
+
SendStream.prototype.sendFile = function sendFile(path25) {
|
|
192768
192768
|
var i4 = 0;
|
|
192769
192769
|
var self2 = this;
|
|
192770
|
-
debug3('stat "%s"',
|
|
192771
|
-
|
|
192772
|
-
if (err && err.code === "ENOENT" && !extname(
|
|
192770
|
+
debug3('stat "%s"', path25);
|
|
192771
|
+
fs27.stat(path25, function onstat(err, stat3) {
|
|
192772
|
+
if (err && err.code === "ENOENT" && !extname(path25) && path25[path25.length - 1] !== sep3) {
|
|
192773
192773
|
return next(err);
|
|
192774
192774
|
}
|
|
192775
192775
|
if (err) return self2.onStatError(err);
|
|
192776
|
-
if (stat3.isDirectory()) return self2.redirect(
|
|
192777
|
-
self2.emit("file",
|
|
192778
|
-
self2.send(
|
|
192776
|
+
if (stat3.isDirectory()) return self2.redirect(path25);
|
|
192777
|
+
self2.emit("file", path25, stat3);
|
|
192778
|
+
self2.send(path25, stat3);
|
|
192779
192779
|
});
|
|
192780
192780
|
function next(err) {
|
|
192781
192781
|
if (self2._extensions.length <= i4) {
|
|
192782
192782
|
return err ? self2.onStatError(err) : self2.error(404);
|
|
192783
192783
|
}
|
|
192784
|
-
var p3 =
|
|
192784
|
+
var p3 = path25 + "." + self2._extensions[i4++];
|
|
192785
192785
|
debug3('stat "%s"', p3);
|
|
192786
|
-
|
|
192786
|
+
fs27.stat(p3, function(err2, stat3) {
|
|
192787
192787
|
if (err2) return next(err2);
|
|
192788
192788
|
if (stat3.isDirectory()) return next();
|
|
192789
192789
|
self2.emit("file", p3, stat3);
|
|
@@ -192791,7 +192791,7 @@ var require_send = __commonJS({
|
|
|
192791
192791
|
});
|
|
192792
192792
|
}
|
|
192793
192793
|
};
|
|
192794
|
-
SendStream.prototype.sendIndex = function sendIndex(
|
|
192794
|
+
SendStream.prototype.sendIndex = function sendIndex(path25) {
|
|
192795
192795
|
var i4 = -1;
|
|
192796
192796
|
var self2 = this;
|
|
192797
192797
|
function next(err) {
|
|
@@ -192799,9 +192799,9 @@ var require_send = __commonJS({
|
|
|
192799
192799
|
if (err) return self2.onStatError(err);
|
|
192800
192800
|
return self2.error(404);
|
|
192801
192801
|
}
|
|
192802
|
-
var p3 = join(
|
|
192802
|
+
var p3 = join(path25, self2._index[i4]);
|
|
192803
192803
|
debug3('stat "%s"', p3);
|
|
192804
|
-
|
|
192804
|
+
fs27.stat(p3, function(err2, stat3) {
|
|
192805
192805
|
if (err2) return next(err2);
|
|
192806
192806
|
if (stat3.isDirectory()) return next();
|
|
192807
192807
|
self2.emit("file", p3, stat3);
|
|
@@ -192810,10 +192810,10 @@ var require_send = __commonJS({
|
|
|
192810
192810
|
}
|
|
192811
192811
|
next();
|
|
192812
192812
|
};
|
|
192813
|
-
SendStream.prototype.stream = function stream2(
|
|
192813
|
+
SendStream.prototype.stream = function stream2(path25, options) {
|
|
192814
192814
|
var self2 = this;
|
|
192815
192815
|
var res = this.res;
|
|
192816
|
-
var stream3 =
|
|
192816
|
+
var stream3 = fs27.createReadStream(path25, options);
|
|
192817
192817
|
this.emit("stream", stream3);
|
|
192818
192818
|
stream3.pipe(res);
|
|
192819
192819
|
function cleanup() {
|
|
@@ -192828,10 +192828,10 @@ var require_send = __commonJS({
|
|
|
192828
192828
|
self2.emit("end");
|
|
192829
192829
|
});
|
|
192830
192830
|
};
|
|
192831
|
-
SendStream.prototype.type = function type(
|
|
192831
|
+
SendStream.prototype.type = function type(path25) {
|
|
192832
192832
|
var res = this.res;
|
|
192833
192833
|
if (res.getHeader("Content-Type")) return;
|
|
192834
|
-
var type2 = mime.lookup(
|
|
192834
|
+
var type2 = mime.lookup(path25);
|
|
192835
192835
|
if (!type2) {
|
|
192836
192836
|
debug3("no content-type");
|
|
192837
192837
|
return;
|
|
@@ -192840,9 +192840,9 @@ var require_send = __commonJS({
|
|
|
192840
192840
|
debug3("content-type %s", type2);
|
|
192841
192841
|
res.setHeader("Content-Type", type2 + (charset ? "; charset=" + charset : ""));
|
|
192842
192842
|
};
|
|
192843
|
-
SendStream.prototype.setHeader = function setHeader(
|
|
192843
|
+
SendStream.prototype.setHeader = function setHeader(path25, stat3) {
|
|
192844
192844
|
var res = this.res;
|
|
192845
|
-
this.emit("headers", res,
|
|
192845
|
+
this.emit("headers", res, path25, stat3);
|
|
192846
192846
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
192847
192847
|
debug3("accept ranges");
|
|
192848
192848
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -192901,9 +192901,9 @@ var require_send = __commonJS({
|
|
|
192901
192901
|
}
|
|
192902
192902
|
return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
|
|
192903
192903
|
}
|
|
192904
|
-
function decode(
|
|
192904
|
+
function decode(path25) {
|
|
192905
192905
|
try {
|
|
192906
|
-
return decodeURIComponent(
|
|
192906
|
+
return decodeURIComponent(path25);
|
|
192907
192907
|
} catch (err) {
|
|
192908
192908
|
return -1;
|
|
192909
192909
|
}
|
|
@@ -193801,10 +193801,10 @@ var require_utils5 = __commonJS({
|
|
|
193801
193801
|
var querystring = __require("querystring");
|
|
193802
193802
|
exports.etag = createETagGenerator({ weak: false });
|
|
193803
193803
|
exports.wetag = createETagGenerator({ weak: true });
|
|
193804
|
-
exports.isAbsolute = function(
|
|
193805
|
-
if ("/" ===
|
|
193806
|
-
if (":" ===
|
|
193807
|
-
if ("\\\\" ===
|
|
193804
|
+
exports.isAbsolute = function(path24) {
|
|
193805
|
+
if ("/" === path24[0]) return true;
|
|
193806
|
+
if (":" === path24[1] && ("\\" === path24[2] || "/" === path24[2])) return true;
|
|
193807
|
+
if ("\\\\" === path24.substring(0, 2)) return true;
|
|
193808
193808
|
};
|
|
193809
193809
|
exports.flatten = deprecate4.function(
|
|
193810
193810
|
flatten,
|
|
@@ -194015,7 +194015,7 @@ var require_application = __commonJS({
|
|
|
194015
194015
|
};
|
|
194016
194016
|
app.use = function use(fn) {
|
|
194017
194017
|
var offset = 0;
|
|
194018
|
-
var
|
|
194018
|
+
var path24 = "/";
|
|
194019
194019
|
if (typeof fn !== "function") {
|
|
194020
194020
|
var arg = fn;
|
|
194021
194021
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -194023,7 +194023,7 @@ var require_application = __commonJS({
|
|
|
194023
194023
|
}
|
|
194024
194024
|
if (typeof arg !== "function") {
|
|
194025
194025
|
offset = 1;
|
|
194026
|
-
|
|
194026
|
+
path24 = fn;
|
|
194027
194027
|
}
|
|
194028
194028
|
}
|
|
194029
194029
|
var fns = flatten(slice.call(arguments, offset));
|
|
@@ -194034,12 +194034,12 @@ var require_application = __commonJS({
|
|
|
194034
194034
|
var router = this._router;
|
|
194035
194035
|
fns.forEach(function(fn2) {
|
|
194036
194036
|
if (!fn2 || !fn2.handle || !fn2.set) {
|
|
194037
|
-
return router.use(
|
|
194037
|
+
return router.use(path24, fn2);
|
|
194038
194038
|
}
|
|
194039
|
-
debug3(".use app under %s",
|
|
194040
|
-
fn2.mountpath =
|
|
194039
|
+
debug3(".use app under %s", path24);
|
|
194040
|
+
fn2.mountpath = path24;
|
|
194041
194041
|
fn2.parent = this;
|
|
194042
|
-
router.use(
|
|
194042
|
+
router.use(path24, function mounted_app(req, res, next) {
|
|
194043
194043
|
var orig = req.app;
|
|
194044
194044
|
fn2.handle(req, res, function(err) {
|
|
194045
194045
|
setPrototypeOf(req, orig.request);
|
|
@@ -194051,9 +194051,9 @@ var require_application = __commonJS({
|
|
|
194051
194051
|
}, this);
|
|
194052
194052
|
return this;
|
|
194053
194053
|
};
|
|
194054
|
-
app.route = function route(
|
|
194054
|
+
app.route = function route(path24) {
|
|
194055
194055
|
this.lazyrouter();
|
|
194056
|
-
return this._router.route(
|
|
194056
|
+
return this._router.route(path24);
|
|
194057
194057
|
};
|
|
194058
194058
|
app.engine = function engine(ext, fn) {
|
|
194059
194059
|
if (typeof fn !== "function") {
|
|
@@ -194104,7 +194104,7 @@ var require_application = __commonJS({
|
|
|
194104
194104
|
}
|
|
194105
194105
|
return this;
|
|
194106
194106
|
};
|
|
194107
|
-
app.path = function
|
|
194107
|
+
app.path = function path24() {
|
|
194108
194108
|
return this.parent ? this.parent.path() + this.mountpath : "";
|
|
194109
194109
|
};
|
|
194110
194110
|
app.enabled = function enabled(setting) {
|
|
@@ -194120,19 +194120,19 @@ var require_application = __commonJS({
|
|
|
194120
194120
|
return this.set(setting, false);
|
|
194121
194121
|
};
|
|
194122
194122
|
methods.forEach(function(method) {
|
|
194123
|
-
app[method] = function(
|
|
194123
|
+
app[method] = function(path24) {
|
|
194124
194124
|
if (method === "get" && arguments.length === 1) {
|
|
194125
|
-
return this.set(
|
|
194125
|
+
return this.set(path24);
|
|
194126
194126
|
}
|
|
194127
194127
|
this.lazyrouter();
|
|
194128
|
-
var route = this._router.route(
|
|
194128
|
+
var route = this._router.route(path24);
|
|
194129
194129
|
route[method].apply(route, slice.call(arguments, 1));
|
|
194130
194130
|
return this;
|
|
194131
194131
|
};
|
|
194132
194132
|
});
|
|
194133
|
-
app.all = function all(
|
|
194133
|
+
app.all = function all(path24) {
|
|
194134
194134
|
this.lazyrouter();
|
|
194135
|
-
var route = this._router.route(
|
|
194135
|
+
var route = this._router.route(path24);
|
|
194136
194136
|
var args = slice.call(arguments, 1);
|
|
194137
194137
|
for (var i4 = 0; i4 < methods.length; i4++) {
|
|
194138
194138
|
route[methods[i4]].apply(route, args);
|
|
@@ -194884,7 +194884,7 @@ var require_request = __commonJS({
|
|
|
194884
194884
|
var subdomains2 = !isIP3(hostname2) ? hostname2.split(".").reverse() : [hostname2];
|
|
194885
194885
|
return subdomains2.slice(offset);
|
|
194886
194886
|
});
|
|
194887
|
-
defineGetter(req, "path", function
|
|
194887
|
+
defineGetter(req, "path", function path24() {
|
|
194888
194888
|
return parse5(this).pathname;
|
|
194889
194889
|
});
|
|
194890
194890
|
defineGetter(req, "hostname", function hostname2() {
|
|
@@ -195203,7 +195203,7 @@ var require_response = __commonJS({
|
|
|
195203
195203
|
var http5 = __require("http");
|
|
195204
195204
|
var isAbsolute2 = require_utils5().isAbsolute;
|
|
195205
195205
|
var onFinished = require_on_finished();
|
|
195206
|
-
var
|
|
195206
|
+
var path24 = __require("path");
|
|
195207
195207
|
var statuses = require_statuses();
|
|
195208
195208
|
var merge2 = require_utils_merge();
|
|
195209
195209
|
var sign = require_cookie_signature().sign;
|
|
@@ -195212,9 +195212,9 @@ var require_response = __commonJS({
|
|
|
195212
195212
|
var setCharset = require_utils5().setCharset;
|
|
195213
195213
|
var cookie = require_cookie();
|
|
195214
195214
|
var send = require_send();
|
|
195215
|
-
var extname =
|
|
195215
|
+
var extname = path24.extname;
|
|
195216
195216
|
var mime = send.mime;
|
|
195217
|
-
var resolve =
|
|
195217
|
+
var resolve = path24.resolve;
|
|
195218
195218
|
var vary = require_vary();
|
|
195219
195219
|
var res = Object.create(http5.ServerResponse.prototype);
|
|
195220
195220
|
module.exports = res;
|
|
@@ -195391,26 +195391,26 @@ var require_response = __commonJS({
|
|
|
195391
195391
|
this.type("txt");
|
|
195392
195392
|
return this.send(body);
|
|
195393
195393
|
};
|
|
195394
|
-
res.sendFile = function sendFile(
|
|
195394
|
+
res.sendFile = function sendFile(path25, options, callback) {
|
|
195395
195395
|
var done = callback;
|
|
195396
195396
|
var req = this.req;
|
|
195397
195397
|
var res2 = this;
|
|
195398
195398
|
var next = req.next;
|
|
195399
195399
|
var opts = options || {};
|
|
195400
|
-
if (!
|
|
195400
|
+
if (!path25) {
|
|
195401
195401
|
throw new TypeError("path argument is required to res.sendFile");
|
|
195402
195402
|
}
|
|
195403
|
-
if (typeof
|
|
195403
|
+
if (typeof path25 !== "string") {
|
|
195404
195404
|
throw new TypeError("path must be a string to res.sendFile");
|
|
195405
195405
|
}
|
|
195406
195406
|
if (typeof options === "function") {
|
|
195407
195407
|
done = options;
|
|
195408
195408
|
opts = {};
|
|
195409
195409
|
}
|
|
195410
|
-
if (!opts.root && !isAbsolute2(
|
|
195410
|
+
if (!opts.root && !isAbsolute2(path25)) {
|
|
195411
195411
|
throw new TypeError("path must be absolute or specify root to res.sendFile");
|
|
195412
195412
|
}
|
|
195413
|
-
var pathname = encodeURI(
|
|
195413
|
+
var pathname = encodeURI(path25);
|
|
195414
195414
|
var file = send(req, pathname, opts);
|
|
195415
195415
|
sendfile(res2, file, opts, function(err) {
|
|
195416
195416
|
if (done) return done(err);
|
|
@@ -195420,7 +195420,7 @@ var require_response = __commonJS({
|
|
|
195420
195420
|
}
|
|
195421
195421
|
});
|
|
195422
195422
|
};
|
|
195423
|
-
res.sendfile = function(
|
|
195423
|
+
res.sendfile = function(path25, options, callback) {
|
|
195424
195424
|
var done = callback;
|
|
195425
195425
|
var req = this.req;
|
|
195426
195426
|
var res2 = this;
|
|
@@ -195430,7 +195430,7 @@ var require_response = __commonJS({
|
|
|
195430
195430
|
done = options;
|
|
195431
195431
|
opts = {};
|
|
195432
195432
|
}
|
|
195433
|
-
var file = send(req,
|
|
195433
|
+
var file = send(req, path25, opts);
|
|
195434
195434
|
sendfile(res2, file, opts, function(err) {
|
|
195435
195435
|
if (done) return done(err);
|
|
195436
195436
|
if (err && err.code === "EISDIR") return next();
|
|
@@ -195443,7 +195443,7 @@ var require_response = __commonJS({
|
|
|
195443
195443
|
res.sendfile,
|
|
195444
195444
|
"res.sendfile: Use res.sendFile instead"
|
|
195445
195445
|
);
|
|
195446
|
-
res.download = function download(
|
|
195446
|
+
res.download = function download(path25, filename, options, callback) {
|
|
195447
195447
|
var done = callback;
|
|
195448
195448
|
var name = filename;
|
|
195449
195449
|
var opts = options || null;
|
|
@@ -195460,7 +195460,7 @@ var require_response = __commonJS({
|
|
|
195460
195460
|
opts = filename;
|
|
195461
195461
|
}
|
|
195462
195462
|
var headers = {
|
|
195463
|
-
"Content-Disposition": contentDisposition(name ||
|
|
195463
|
+
"Content-Disposition": contentDisposition(name || path25)
|
|
195464
195464
|
};
|
|
195465
195465
|
if (opts && opts.headers) {
|
|
195466
195466
|
var keys = Object.keys(opts.headers);
|
|
@@ -195473,7 +195473,7 @@ var require_response = __commonJS({
|
|
|
195473
195473
|
}
|
|
195474
195474
|
opts = Object.create(opts);
|
|
195475
195475
|
opts.headers = headers;
|
|
195476
|
-
var fullPath = !opts.root ? resolve(
|
|
195476
|
+
var fullPath = !opts.root ? resolve(path25) : path25;
|
|
195477
195477
|
return this.sendFile(fullPath, opts, done);
|
|
195478
195478
|
};
|
|
195479
195479
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -195773,11 +195773,11 @@ var require_serve_static = __commonJS({
|
|
|
195773
195773
|
}
|
|
195774
195774
|
var forwardError = !fallthrough;
|
|
195775
195775
|
var originalUrl = parseUrl.original(req);
|
|
195776
|
-
var
|
|
195777
|
-
if (
|
|
195778
|
-
|
|
195776
|
+
var path24 = parseUrl(req).pathname;
|
|
195777
|
+
if (path24 === "/" && originalUrl.pathname.substr(-1) !== "/") {
|
|
195778
|
+
path24 = "";
|
|
195779
195779
|
}
|
|
195780
|
-
var stream2 = send(req,
|
|
195780
|
+
var stream2 = send(req, path24, opts);
|
|
195781
195781
|
stream2.on("directory", onDirectory);
|
|
195782
195782
|
if (setHeaders) {
|
|
195783
195783
|
stream2.on("headers", setHeaders);
|
|
@@ -200627,11 +200627,11 @@ var require_server = __commonJS({
|
|
|
200627
200627
|
* @protected
|
|
200628
200628
|
*/
|
|
200629
200629
|
_computePath(options) {
|
|
200630
|
-
let
|
|
200630
|
+
let path24 = (options.path || "/engine.io").replace(/\/$/, "");
|
|
200631
200631
|
if (options.addTrailingSlash !== false) {
|
|
200632
|
-
|
|
200632
|
+
path24 += "/";
|
|
200633
200633
|
}
|
|
200634
|
-
return
|
|
200634
|
+
return path24;
|
|
200635
200635
|
}
|
|
200636
200636
|
/**
|
|
200637
200637
|
* Returns a list of available transports for upgrade given a certain transport.
|
|
@@ -201147,10 +201147,10 @@ var require_server = __commonJS({
|
|
|
201147
201147
|
* @param {Object} options
|
|
201148
201148
|
*/
|
|
201149
201149
|
attach(server, options = {}) {
|
|
201150
|
-
const
|
|
201150
|
+
const path24 = this._computePath(options);
|
|
201151
201151
|
const destroyUpgradeTimeout = options.destroyUpgradeTimeout || 1e3;
|
|
201152
201152
|
function check2(req) {
|
|
201153
|
-
return
|
|
201153
|
+
return path24 === req.url.slice(0, path24.length);
|
|
201154
201154
|
}
|
|
201155
201155
|
const listeners = server.listeners("request").slice(0);
|
|
201156
201156
|
server.removeAllListeners("request");
|
|
@@ -201158,7 +201158,7 @@ var require_server = __commonJS({
|
|
|
201158
201158
|
server.on("listening", this.init.bind(this));
|
|
201159
201159
|
server.on("request", (req, res) => {
|
|
201160
201160
|
if (check2(req)) {
|
|
201161
|
-
debug3('intercepting request for path "%s"',
|
|
201161
|
+
debug3('intercepting request for path "%s"', path24);
|
|
201162
201162
|
this.handleRequest(req, res);
|
|
201163
201163
|
} else {
|
|
201164
201164
|
let i4 = 0;
|
|
@@ -201994,8 +201994,8 @@ var require_userver = __commonJS({
|
|
|
201994
201994
|
* @param options
|
|
201995
201995
|
*/
|
|
201996
201996
|
attach(app, options = {}) {
|
|
201997
|
-
const
|
|
201998
|
-
app.any(
|
|
201997
|
+
const path24 = this._computePath(options);
|
|
201998
|
+
app.any(path24, this.handleRequest.bind(this)).ws(path24, {
|
|
201999
201999
|
compression: options.compression,
|
|
202000
202000
|
idleTimeout: options.idleTimeout,
|
|
202001
202001
|
maxBackpressure: options.maxBackpressure,
|
|
@@ -208350,7 +208350,7 @@ var require_dist7 = __commonJS({
|
|
|
208350
208350
|
var zlib_1 = __require("zlib");
|
|
208351
208351
|
var accepts = require_accepts();
|
|
208352
208352
|
var stream_1 = __require("stream");
|
|
208353
|
-
var
|
|
208353
|
+
var path24 = __require("path");
|
|
208354
208354
|
var engine_io_1 = require_engine_io();
|
|
208355
208355
|
var client_1 = require_client();
|
|
208356
208356
|
var events_1 = __require("events");
|
|
@@ -208545,7 +208545,7 @@ var require_dist7 = __commonJS({
|
|
|
208545
208545
|
res.writeHeader("cache-control", "public, max-age=0");
|
|
208546
208546
|
res.writeHeader("content-type", "application/" + (isMap ? "json" : "javascript") + "; charset=utf-8");
|
|
208547
208547
|
res.writeHeader("etag", expectedEtag);
|
|
208548
|
-
const filepath =
|
|
208548
|
+
const filepath = path24.join(__dirname, "../client-dist/", filename);
|
|
208549
208549
|
(0, uws_1.serveFile)(res, filepath);
|
|
208550
208550
|
});
|
|
208551
208551
|
}
|
|
@@ -208627,7 +208627,7 @@ var require_dist7 = __commonJS({
|
|
|
208627
208627
|
* @private
|
|
208628
208628
|
*/
|
|
208629
208629
|
static sendFile(filename, req, res) {
|
|
208630
|
-
const readStream = (0, fs_1.createReadStream)(
|
|
208630
|
+
const readStream = (0, fs_1.createReadStream)(path24.join(__dirname, "../client-dist/", filename));
|
|
208631
208631
|
const encoding = accepts(req).encodings(["br", "gzip", "deflate"]);
|
|
208632
208632
|
const onError2 = (err) => {
|
|
208633
208633
|
if (err) {
|
|
@@ -213615,7 +213615,7 @@ var require_scheduled_task = __commonJS({
|
|
|
213615
213615
|
var require_background_scheduled_task = __commonJS({
|
|
213616
213616
|
"node_modules/node-cron/src/background-scheduled-task/index.js"(exports, module) {
|
|
213617
213617
|
var EventEmitter9 = __require("events");
|
|
213618
|
-
var
|
|
213618
|
+
var path24 = __require("path");
|
|
213619
213619
|
var { fork } = __require("child_process");
|
|
213620
213620
|
var uuid2 = (init_esm_node(), __toCommonJS(esm_node_exports));
|
|
213621
213621
|
var daemonPath = `${__dirname}/daemon.js`;
|
|
@@ -213650,7 +213650,7 @@ var require_background_scheduled_task = __commonJS({
|
|
|
213650
213650
|
options.scheduled = true;
|
|
213651
213651
|
this.forkProcess.send({
|
|
213652
213652
|
type: "register",
|
|
213653
|
-
path:
|
|
213653
|
+
path: path24.resolve(this.taskPath),
|
|
213654
213654
|
cron: this.cronExpression,
|
|
213655
213655
|
options
|
|
213656
213656
|
});
|
|
@@ -215844,7 +215844,7 @@ var Pt = class n2 extends R {
|
|
|
215844
215844
|
return new n2(t4, e3, this.root, this.roots, this.nocase, this.childrenCache(), s3);
|
|
215845
215845
|
}
|
|
215846
215846
|
getRootString(t4) {
|
|
215847
|
-
return
|
|
215847
|
+
return path23.win32.parse(t4).root;
|
|
215848
215848
|
}
|
|
215849
215849
|
getRoot(t4) {
|
|
215850
215850
|
if (t4 = Ri(t4.toUpperCase()), t4 === this.root.name) return this.root;
|
|
@@ -216116,11 +216116,11 @@ var it = class extends It {
|
|
|
216116
216116
|
sep = "\\";
|
|
216117
216117
|
constructor(t4 = process.cwd(), e3 = {}) {
|
|
216118
216118
|
let { nocase: s3 = true } = e3;
|
|
216119
|
-
super(t4,
|
|
216119
|
+
super(t4, path23.win32, "\\", { ...e3, nocase: s3 }), this.nocase = s3;
|
|
216120
216120
|
for (let i4 = this.cwd; i4; i4 = i4.parent) i4.nocase = this.nocase;
|
|
216121
216121
|
}
|
|
216122
216122
|
parseRootPath(t4) {
|
|
216123
|
-
return
|
|
216123
|
+
return path23.win32.parse(t4).root.toUpperCase();
|
|
216124
216124
|
}
|
|
216125
216125
|
newRoot(t4) {
|
|
216126
216126
|
return new Pt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t4 });
|
|
@@ -216133,7 +216133,7 @@ var rt = class extends It {
|
|
|
216133
216133
|
sep = "/";
|
|
216134
216134
|
constructor(t4 = process.cwd(), e3 = {}) {
|
|
216135
216135
|
let { nocase: s3 = false } = e3;
|
|
216136
|
-
super(t4,
|
|
216136
|
+
super(t4, path23.posix, "/", { ...e3, nocase: s3 }), this.nocase = s3;
|
|
216137
216137
|
}
|
|
216138
216138
|
parseRootPath(t4) {
|
|
216139
216139
|
return "/";
|
|
@@ -217999,12 +217999,12 @@ function encodeURIPath(str2) {
|
|
|
217999
217999
|
return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
218000
218000
|
}
|
|
218001
218001
|
var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
218002
|
-
var createPathTagFunction = (pathEncoder = encodeURIPath) => function
|
|
218002
|
+
var createPathTagFunction = (pathEncoder = encodeURIPath) => function path24(statics, ...params) {
|
|
218003
218003
|
if (statics.length === 1)
|
|
218004
218004
|
return statics[0];
|
|
218005
218005
|
let postPath = false;
|
|
218006
218006
|
const invalidSegments = [];
|
|
218007
|
-
const
|
|
218007
|
+
const path25 = statics.reduce((previousValue, currentValue, index) => {
|
|
218008
218008
|
if (/[?#]/.test(currentValue)) {
|
|
218009
218009
|
postPath = true;
|
|
218010
218010
|
}
|
|
@@ -218021,7 +218021,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path23(sta
|
|
|
218021
218021
|
}
|
|
218022
218022
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
218023
218023
|
}, "");
|
|
218024
|
-
const pathOnly =
|
|
218024
|
+
const pathOnly = path25.split(/[?#]/, 1)[0];
|
|
218025
218025
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
218026
218026
|
let match;
|
|
218027
218027
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -218042,10 +218042,10 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path23(sta
|
|
|
218042
218042
|
}, "");
|
|
218043
218043
|
throw new AnthropicError(`Path parameters result in path with invalid segments:
|
|
218044
218044
|
${invalidSegments.map((e3) => e3.error).join("\n")}
|
|
218045
|
-
${
|
|
218045
|
+
${path25}
|
|
218046
218046
|
${underline}`);
|
|
218047
218047
|
}
|
|
218048
|
-
return
|
|
218048
|
+
return path25;
|
|
218049
218049
|
};
|
|
218050
218050
|
var path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
218051
218051
|
|
|
@@ -222241,9 +222241,9 @@ var BaseAnthropic = class {
|
|
|
222241
222241
|
makeStatusError(status, error2, message, headers) {
|
|
222242
222242
|
return APIError.generate(status, error2, message, headers);
|
|
222243
222243
|
}
|
|
222244
|
-
buildURL(
|
|
222244
|
+
buildURL(path24, query, defaultBaseURL) {
|
|
222245
222245
|
const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
222246
|
-
const url = isAbsoluteURL(
|
|
222246
|
+
const url = isAbsoluteURL(path24) ? new URL(path24) : new URL(baseURL + (baseURL.endsWith("/") && path24.startsWith("/") ? path24.slice(1) : path24));
|
|
222247
222247
|
const defaultQuery = this.defaultQuery();
|
|
222248
222248
|
const pathQuery = Object.fromEntries(url.searchParams);
|
|
222249
222249
|
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
@@ -222275,24 +222275,24 @@ var BaseAnthropic = class {
|
|
|
222275
222275
|
*/
|
|
222276
222276
|
async prepareRequest(request, { url, options }) {
|
|
222277
222277
|
}
|
|
222278
|
-
get(
|
|
222279
|
-
return this.methodRequest("get",
|
|
222278
|
+
get(path24, opts) {
|
|
222279
|
+
return this.methodRequest("get", path24, opts);
|
|
222280
222280
|
}
|
|
222281
|
-
post(
|
|
222282
|
-
return this.methodRequest("post",
|
|
222281
|
+
post(path24, opts) {
|
|
222282
|
+
return this.methodRequest("post", path24, opts);
|
|
222283
222283
|
}
|
|
222284
|
-
patch(
|
|
222285
|
-
return this.methodRequest("patch",
|
|
222284
|
+
patch(path24, opts) {
|
|
222285
|
+
return this.methodRequest("patch", path24, opts);
|
|
222286
222286
|
}
|
|
222287
|
-
put(
|
|
222288
|
-
return this.methodRequest("put",
|
|
222287
|
+
put(path24, opts) {
|
|
222288
|
+
return this.methodRequest("put", path24, opts);
|
|
222289
222289
|
}
|
|
222290
|
-
delete(
|
|
222291
|
-
return this.methodRequest("delete",
|
|
222290
|
+
delete(path24, opts) {
|
|
222291
|
+
return this.methodRequest("delete", path24, opts);
|
|
222292
222292
|
}
|
|
222293
|
-
methodRequest(method,
|
|
222293
|
+
methodRequest(method, path24, opts) {
|
|
222294
222294
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
222295
|
-
return { method, path:
|
|
222295
|
+
return { method, path: path24, ...opts2 };
|
|
222296
222296
|
}));
|
|
222297
222297
|
}
|
|
222298
222298
|
request(options, remainingRetries = null) {
|
|
@@ -222396,8 +222396,8 @@ var BaseAnthropic = class {
|
|
|
222396
222396
|
}));
|
|
222397
222397
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
222398
222398
|
}
|
|
222399
|
-
getAPIList(
|
|
222400
|
-
return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path:
|
|
222399
|
+
getAPIList(path24, Page3, opts) {
|
|
222400
|
+
return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path24, ...opts2 })) : { method: "get", path: path24, ...opts });
|
|
222401
222401
|
}
|
|
222402
222402
|
requestAPIList(Page3, options) {
|
|
222403
222403
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -222485,8 +222485,8 @@ var BaseAnthropic = class {
|
|
|
222485
222485
|
}
|
|
222486
222486
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
222487
222487
|
const options = { ...inputOptions };
|
|
222488
|
-
const { method, path:
|
|
222489
|
-
const url = this.buildURL(
|
|
222488
|
+
const { method, path: path24, query, defaultBaseURL } = options;
|
|
222489
|
+
const url = this.buildURL(path24, query, defaultBaseURL);
|
|
222490
222490
|
if ("timeout" in options)
|
|
222491
222491
|
validatePositiveInteger("timeout", options.timeout);
|
|
222492
222492
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -222595,7 +222595,7 @@ Anthropic.Models = Models2;
|
|
|
222595
222595
|
Anthropic.Beta = Beta;
|
|
222596
222596
|
|
|
222597
222597
|
// src/constants.ts
|
|
222598
|
-
var CASCADE_VERSION = "0.
|
|
222598
|
+
var CASCADE_VERSION = "0.18.0";
|
|
222599
222599
|
var CASCADE_CONFIG_DIR = ".cascade";
|
|
222600
222600
|
var CASCADE_MD_FILE = "CASCADE.md";
|
|
222601
222601
|
var CASCADE_IGNORE_FILE = ".cascadeignore";
|
|
@@ -222607,6 +222607,7 @@ var CASCADE_DASHBOARD_SECRET_FILE = ".cascade/dashboard-secret";
|
|
|
222607
222607
|
var GLOBAL_CONFIG_DIR = ".cascade-ai";
|
|
222608
222608
|
var GLOBAL_DB_FILE = "memory.db";
|
|
222609
222609
|
var GLOBAL_KEYSTORE_FILE = "keystore.enc";
|
|
222610
|
+
var GLOBAL_CREDENTIALS_FILE = "credentials.json";
|
|
222610
222611
|
var GLOBAL_RUNTIME_DB_FILE = "runtime.db";
|
|
222611
222612
|
var DEFAULT_DASHBOARD_PORT = 4891;
|
|
222612
222613
|
var DEFAULT_API_PORT = 4892;
|
|
@@ -225134,13 +225135,13 @@ var MultipartBody = class {
|
|
|
225134
225135
|
}
|
|
225135
225136
|
};
|
|
225136
225137
|
var fileFromPathWarned = false;
|
|
225137
|
-
async function fileFromPath3(
|
|
225138
|
+
async function fileFromPath3(path24, ...args) {
|
|
225138
225139
|
const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports));
|
|
225139
225140
|
if (!fileFromPathWarned) {
|
|
225140
|
-
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(
|
|
225141
|
+
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path24)}) instead`);
|
|
225141
225142
|
fileFromPathWarned = true;
|
|
225142
225143
|
}
|
|
225143
|
-
return await _fileFromPath(
|
|
225144
|
+
return await _fileFromPath(path24, ...args);
|
|
225144
225145
|
}
|
|
225145
225146
|
var defaultHttpAgent = new import_agentkeepalive.default({ keepAlive: true, timeout: 5 * 60 * 1e3 });
|
|
225146
225147
|
var defaultHttpsAgent = new import_agentkeepalive.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 });
|
|
@@ -225918,29 +225919,29 @@ var APIClient = class {
|
|
|
225918
225919
|
defaultIdempotencyKey() {
|
|
225919
225920
|
return `stainless-node-retry-${uuid42()}`;
|
|
225920
225921
|
}
|
|
225921
|
-
get(
|
|
225922
|
-
return this.methodRequest("get",
|
|
225922
|
+
get(path24, opts) {
|
|
225923
|
+
return this.methodRequest("get", path24, opts);
|
|
225923
225924
|
}
|
|
225924
|
-
post(
|
|
225925
|
-
return this.methodRequest("post",
|
|
225925
|
+
post(path24, opts) {
|
|
225926
|
+
return this.methodRequest("post", path24, opts);
|
|
225926
225927
|
}
|
|
225927
|
-
patch(
|
|
225928
|
-
return this.methodRequest("patch",
|
|
225928
|
+
patch(path24, opts) {
|
|
225929
|
+
return this.methodRequest("patch", path24, opts);
|
|
225929
225930
|
}
|
|
225930
|
-
put(
|
|
225931
|
-
return this.methodRequest("put",
|
|
225931
|
+
put(path24, opts) {
|
|
225932
|
+
return this.methodRequest("put", path24, opts);
|
|
225932
225933
|
}
|
|
225933
|
-
delete(
|
|
225934
|
-
return this.methodRequest("delete",
|
|
225934
|
+
delete(path24, opts) {
|
|
225935
|
+
return this.methodRequest("delete", path24, opts);
|
|
225935
225936
|
}
|
|
225936
|
-
methodRequest(method,
|
|
225937
|
+
methodRequest(method, path24, opts) {
|
|
225937
225938
|
return this.request(Promise.resolve(opts).then(async (opts2) => {
|
|
225938
225939
|
const body = opts2 && isBlobLike2(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body;
|
|
225939
|
-
return { method, path:
|
|
225940
|
+
return { method, path: path24, ...opts2, body };
|
|
225940
225941
|
}));
|
|
225941
225942
|
}
|
|
225942
|
-
getAPIList(
|
|
225943
|
-
return this.requestAPIList(Page3, { method: "get", path:
|
|
225943
|
+
getAPIList(path24, Page3, opts) {
|
|
225944
|
+
return this.requestAPIList(Page3, { method: "get", path: path24, ...opts });
|
|
225944
225945
|
}
|
|
225945
225946
|
calculateContentLength(body) {
|
|
225946
225947
|
if (typeof body === "string") {
|
|
@@ -225959,10 +225960,10 @@ var APIClient = class {
|
|
|
225959
225960
|
}
|
|
225960
225961
|
buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
225961
225962
|
const options = { ...inputOptions };
|
|
225962
|
-
const { method, path:
|
|
225963
|
+
const { method, path: path24, query, headers = {} } = options;
|
|
225963
225964
|
const body = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null;
|
|
225964
225965
|
const contentLength = this.calculateContentLength(body);
|
|
225965
|
-
const url = this.buildURL(
|
|
225966
|
+
const url = this.buildURL(path24, query);
|
|
225966
225967
|
if ("timeout" in options)
|
|
225967
225968
|
validatePositiveInteger2("timeout", options.timeout);
|
|
225968
225969
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -226078,8 +226079,8 @@ var APIClient = class {
|
|
|
226078
226079
|
const request = this.makeRequest(options, null);
|
|
226079
226080
|
return new PagePromise2(this, request, Page3);
|
|
226080
226081
|
}
|
|
226081
|
-
buildURL(
|
|
226082
|
-
const url = isAbsoluteURL2(
|
|
226082
|
+
buildURL(path24, query) {
|
|
226083
|
+
const url = isAbsoluteURL2(path24) ? new URL(path24) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path24.startsWith("/") ? path24.slice(1) : path24));
|
|
226083
226084
|
const defaultQuery = this.defaultQuery();
|
|
226084
226085
|
if (!isEmptyObj2(defaultQuery)) {
|
|
226085
226086
|
query = { ...defaultQuery, ...query };
|
|
@@ -234860,7 +234861,7 @@ var Batches4 = class extends BaseModule {
|
|
|
234860
234861
|
params
|
|
234861
234862
|
);
|
|
234862
234863
|
const urlParams = body["_url"];
|
|
234863
|
-
const
|
|
234864
|
+
const path24 = formatMap("{model}:batchGenerateContent", urlParams);
|
|
234864
234865
|
const batch = body["batch"];
|
|
234865
234866
|
const inputConfig = batch["inputConfig"];
|
|
234866
234867
|
const requestsWrapper = inputConfig["requests"];
|
|
@@ -234881,7 +234882,7 @@ var Batches4 = class extends BaseModule {
|
|
|
234881
234882
|
delete body["config"];
|
|
234882
234883
|
delete body["_url"];
|
|
234883
234884
|
delete body["_query"];
|
|
234884
|
-
return { path:
|
|
234885
|
+
return { path: path24, body };
|
|
234885
234886
|
}
|
|
234886
234887
|
// Helper function to get the first GCS URI
|
|
234887
234888
|
getGcsUri(src) {
|
|
@@ -234937,16 +234938,16 @@ var Batches4 = class extends BaseModule {
|
|
|
234937
234938
|
async createInternal(params) {
|
|
234938
234939
|
var _a5, _b, _c, _d;
|
|
234939
234940
|
let response;
|
|
234940
|
-
let
|
|
234941
|
+
let path24 = "";
|
|
234941
234942
|
let queryParams = {};
|
|
234942
234943
|
if (this.apiClient.isVertexAI()) {
|
|
234943
234944
|
const body = createBatchJobParametersToVertex(this.apiClient, params);
|
|
234944
|
-
|
|
234945
|
+
path24 = formatMap("batchPredictionJobs", body["_url"]);
|
|
234945
234946
|
queryParams = body["_query"];
|
|
234946
234947
|
delete body["_url"];
|
|
234947
234948
|
delete body["_query"];
|
|
234948
234949
|
response = this.apiClient.request({
|
|
234949
|
-
path:
|
|
234950
|
+
path: path24,
|
|
234950
234951
|
queryParams,
|
|
234951
234952
|
body: JSON.stringify(body),
|
|
234952
234953
|
httpMethod: "POST",
|
|
@@ -234961,12 +234962,12 @@ var Batches4 = class extends BaseModule {
|
|
|
234961
234962
|
});
|
|
234962
234963
|
} else {
|
|
234963
234964
|
const body = createBatchJobParametersToMldev(this.apiClient, params);
|
|
234964
|
-
|
|
234965
|
+
path24 = formatMap("{model}:batchGenerateContent", body["_url"]);
|
|
234965
234966
|
queryParams = body["_query"];
|
|
234966
234967
|
delete body["_url"];
|
|
234967
234968
|
delete body["_query"];
|
|
234968
234969
|
response = this.apiClient.request({
|
|
234969
|
-
path:
|
|
234970
|
+
path: path24,
|
|
234970
234971
|
queryParams,
|
|
234971
234972
|
body: JSON.stringify(body),
|
|
234972
234973
|
httpMethod: "POST",
|
|
@@ -234991,18 +234992,18 @@ var Batches4 = class extends BaseModule {
|
|
|
234991
234992
|
async createEmbeddingsInternal(params) {
|
|
234992
234993
|
var _a5, _b;
|
|
234993
234994
|
let response;
|
|
234994
|
-
let
|
|
234995
|
+
let path24 = "";
|
|
234995
234996
|
let queryParams = {};
|
|
234996
234997
|
if (this.apiClient.isVertexAI()) {
|
|
234997
234998
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
234998
234999
|
} else {
|
|
234999
235000
|
const body = createEmbeddingsBatchJobParametersToMldev(this.apiClient, params);
|
|
235000
|
-
|
|
235001
|
+
path24 = formatMap("{model}:asyncBatchEmbedContent", body["_url"]);
|
|
235001
235002
|
queryParams = body["_query"];
|
|
235002
235003
|
delete body["_url"];
|
|
235003
235004
|
delete body["_query"];
|
|
235004
235005
|
response = this.apiClient.request({
|
|
235005
|
-
path:
|
|
235006
|
+
path: path24,
|
|
235006
235007
|
queryParams,
|
|
235007
235008
|
body: JSON.stringify(body),
|
|
235008
235009
|
httpMethod: "POST",
|
|
@@ -235031,16 +235032,16 @@ var Batches4 = class extends BaseModule {
|
|
|
235031
235032
|
async get(params) {
|
|
235032
235033
|
var _a5, _b, _c, _d;
|
|
235033
235034
|
let response;
|
|
235034
|
-
let
|
|
235035
|
+
let path24 = "";
|
|
235035
235036
|
let queryParams = {};
|
|
235036
235037
|
if (this.apiClient.isVertexAI()) {
|
|
235037
235038
|
const body = getBatchJobParametersToVertex(this.apiClient, params);
|
|
235038
|
-
|
|
235039
|
+
path24 = formatMap("batchPredictionJobs/{name}", body["_url"]);
|
|
235039
235040
|
queryParams = body["_query"];
|
|
235040
235041
|
delete body["_url"];
|
|
235041
235042
|
delete body["_query"];
|
|
235042
235043
|
response = this.apiClient.request({
|
|
235043
|
-
path:
|
|
235044
|
+
path: path24,
|
|
235044
235045
|
queryParams,
|
|
235045
235046
|
body: JSON.stringify(body),
|
|
235046
235047
|
httpMethod: "GET",
|
|
@@ -235055,12 +235056,12 @@ var Batches4 = class extends BaseModule {
|
|
|
235055
235056
|
});
|
|
235056
235057
|
} else {
|
|
235057
235058
|
const body = getBatchJobParametersToMldev(this.apiClient, params);
|
|
235058
|
-
|
|
235059
|
+
path24 = formatMap("batches/{name}", body["_url"]);
|
|
235059
235060
|
queryParams = body["_query"];
|
|
235060
235061
|
delete body["_url"];
|
|
235061
235062
|
delete body["_query"];
|
|
235062
235063
|
response = this.apiClient.request({
|
|
235063
|
-
path:
|
|
235064
|
+
path: path24,
|
|
235064
235065
|
queryParams,
|
|
235065
235066
|
body: JSON.stringify(body),
|
|
235066
235067
|
httpMethod: "GET",
|
|
@@ -235088,16 +235089,16 @@ var Batches4 = class extends BaseModule {
|
|
|
235088
235089
|
*/
|
|
235089
235090
|
async cancel(params) {
|
|
235090
235091
|
var _a5, _b, _c, _d;
|
|
235091
|
-
let
|
|
235092
|
+
let path24 = "";
|
|
235092
235093
|
let queryParams = {};
|
|
235093
235094
|
if (this.apiClient.isVertexAI()) {
|
|
235094
235095
|
const body = cancelBatchJobParametersToVertex(this.apiClient, params);
|
|
235095
|
-
|
|
235096
|
+
path24 = formatMap("batchPredictionJobs/{name}:cancel", body["_url"]);
|
|
235096
235097
|
queryParams = body["_query"];
|
|
235097
235098
|
delete body["_url"];
|
|
235098
235099
|
delete body["_query"];
|
|
235099
235100
|
await this.apiClient.request({
|
|
235100
|
-
path:
|
|
235101
|
+
path: path24,
|
|
235101
235102
|
queryParams,
|
|
235102
235103
|
body: JSON.stringify(body),
|
|
235103
235104
|
httpMethod: "POST",
|
|
@@ -235106,12 +235107,12 @@ var Batches4 = class extends BaseModule {
|
|
|
235106
235107
|
});
|
|
235107
235108
|
} else {
|
|
235108
235109
|
const body = cancelBatchJobParametersToMldev(this.apiClient, params);
|
|
235109
|
-
|
|
235110
|
+
path24 = formatMap("batches/{name}:cancel", body["_url"]);
|
|
235110
235111
|
queryParams = body["_query"];
|
|
235111
235112
|
delete body["_url"];
|
|
235112
235113
|
delete body["_query"];
|
|
235113
235114
|
await this.apiClient.request({
|
|
235114
|
-
path:
|
|
235115
|
+
path: path24,
|
|
235115
235116
|
queryParams,
|
|
235116
235117
|
body: JSON.stringify(body),
|
|
235117
235118
|
httpMethod: "POST",
|
|
@@ -235123,16 +235124,16 @@ var Batches4 = class extends BaseModule {
|
|
|
235123
235124
|
async listInternal(params) {
|
|
235124
235125
|
var _a5, _b, _c, _d;
|
|
235125
235126
|
let response;
|
|
235126
|
-
let
|
|
235127
|
+
let path24 = "";
|
|
235127
235128
|
let queryParams = {};
|
|
235128
235129
|
if (this.apiClient.isVertexAI()) {
|
|
235129
235130
|
const body = listBatchJobsParametersToVertex(params);
|
|
235130
|
-
|
|
235131
|
+
path24 = formatMap("batchPredictionJobs", body["_url"]);
|
|
235131
235132
|
queryParams = body["_query"];
|
|
235132
235133
|
delete body["_url"];
|
|
235133
235134
|
delete body["_query"];
|
|
235134
235135
|
response = this.apiClient.request({
|
|
235135
|
-
path:
|
|
235136
|
+
path: path24,
|
|
235136
235137
|
queryParams,
|
|
235137
235138
|
body: JSON.stringify(body),
|
|
235138
235139
|
httpMethod: "GET",
|
|
@@ -235155,12 +235156,12 @@ var Batches4 = class extends BaseModule {
|
|
|
235155
235156
|
});
|
|
235156
235157
|
} else {
|
|
235157
235158
|
const body = listBatchJobsParametersToMldev(params);
|
|
235158
|
-
|
|
235159
|
+
path24 = formatMap("batches", body["_url"]);
|
|
235159
235160
|
queryParams = body["_query"];
|
|
235160
235161
|
delete body["_url"];
|
|
235161
235162
|
delete body["_query"];
|
|
235162
235163
|
response = this.apiClient.request({
|
|
235163
|
-
path:
|
|
235164
|
+
path: path24,
|
|
235164
235165
|
queryParams,
|
|
235165
235166
|
body: JSON.stringify(body),
|
|
235166
235167
|
httpMethod: "GET",
|
|
@@ -235197,16 +235198,16 @@ var Batches4 = class extends BaseModule {
|
|
|
235197
235198
|
async delete(params) {
|
|
235198
235199
|
var _a5, _b, _c, _d;
|
|
235199
235200
|
let response;
|
|
235200
|
-
let
|
|
235201
|
+
let path24 = "";
|
|
235201
235202
|
let queryParams = {};
|
|
235202
235203
|
if (this.apiClient.isVertexAI()) {
|
|
235203
235204
|
const body = deleteBatchJobParametersToVertex(this.apiClient, params);
|
|
235204
|
-
|
|
235205
|
+
path24 = formatMap("batchPredictionJobs/{name}", body["_url"]);
|
|
235205
235206
|
queryParams = body["_query"];
|
|
235206
235207
|
delete body["_url"];
|
|
235207
235208
|
delete body["_query"];
|
|
235208
235209
|
response = this.apiClient.request({
|
|
235209
|
-
path:
|
|
235210
|
+
path: path24,
|
|
235210
235211
|
queryParams,
|
|
235211
235212
|
body: JSON.stringify(body),
|
|
235212
235213
|
httpMethod: "DELETE",
|
|
@@ -235227,12 +235228,12 @@ var Batches4 = class extends BaseModule {
|
|
|
235227
235228
|
});
|
|
235228
235229
|
} else {
|
|
235229
235230
|
const body = deleteBatchJobParametersToMldev(this.apiClient, params);
|
|
235230
|
-
|
|
235231
|
+
path24 = formatMap("batches/{name}", body["_url"]);
|
|
235231
235232
|
queryParams = body["_query"];
|
|
235232
235233
|
delete body["_url"];
|
|
235233
235234
|
delete body["_query"];
|
|
235234
235235
|
response = this.apiClient.request({
|
|
235235
|
-
path:
|
|
235236
|
+
path: path24,
|
|
235236
235237
|
queryParams,
|
|
235237
235238
|
body: JSON.stringify(body),
|
|
235238
235239
|
httpMethod: "DELETE",
|
|
@@ -236121,16 +236122,16 @@ var Caches = class extends BaseModule {
|
|
|
236121
236122
|
async create(params) {
|
|
236122
236123
|
var _a5, _b, _c, _d;
|
|
236123
236124
|
let response;
|
|
236124
|
-
let
|
|
236125
|
+
let path24 = "";
|
|
236125
236126
|
let queryParams = {};
|
|
236126
236127
|
if (this.apiClient.isVertexAI()) {
|
|
236127
236128
|
const body = createCachedContentParametersToVertex(this.apiClient, params);
|
|
236128
|
-
|
|
236129
|
+
path24 = formatMap("cachedContents", body["_url"]);
|
|
236129
236130
|
queryParams = body["_query"];
|
|
236130
236131
|
delete body["_url"];
|
|
236131
236132
|
delete body["_query"];
|
|
236132
236133
|
response = this.apiClient.request({
|
|
236133
|
-
path:
|
|
236134
|
+
path: path24,
|
|
236134
236135
|
queryParams,
|
|
236135
236136
|
body: JSON.stringify(body),
|
|
236136
236137
|
httpMethod: "POST",
|
|
@@ -236144,12 +236145,12 @@ var Caches = class extends BaseModule {
|
|
|
236144
236145
|
});
|
|
236145
236146
|
} else {
|
|
236146
236147
|
const body = createCachedContentParametersToMldev(this.apiClient, params);
|
|
236147
|
-
|
|
236148
|
+
path24 = formatMap("cachedContents", body["_url"]);
|
|
236148
236149
|
queryParams = body["_query"];
|
|
236149
236150
|
delete body["_url"];
|
|
236150
236151
|
delete body["_query"];
|
|
236151
236152
|
response = this.apiClient.request({
|
|
236152
|
-
path:
|
|
236153
|
+
path: path24,
|
|
236153
236154
|
queryParams,
|
|
236154
236155
|
body: JSON.stringify(body),
|
|
236155
236156
|
httpMethod: "POST",
|
|
@@ -236177,16 +236178,16 @@ var Caches = class extends BaseModule {
|
|
|
236177
236178
|
async get(params) {
|
|
236178
236179
|
var _a5, _b, _c, _d;
|
|
236179
236180
|
let response;
|
|
236180
|
-
let
|
|
236181
|
+
let path24 = "";
|
|
236181
236182
|
let queryParams = {};
|
|
236182
236183
|
if (this.apiClient.isVertexAI()) {
|
|
236183
236184
|
const body = getCachedContentParametersToVertex(this.apiClient, params);
|
|
236184
|
-
|
|
236185
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
236185
236186
|
queryParams = body["_query"];
|
|
236186
236187
|
delete body["_url"];
|
|
236187
236188
|
delete body["_query"];
|
|
236188
236189
|
response = this.apiClient.request({
|
|
236189
|
-
path:
|
|
236190
|
+
path: path24,
|
|
236190
236191
|
queryParams,
|
|
236191
236192
|
body: JSON.stringify(body),
|
|
236192
236193
|
httpMethod: "GET",
|
|
@@ -236200,12 +236201,12 @@ var Caches = class extends BaseModule {
|
|
|
236200
236201
|
});
|
|
236201
236202
|
} else {
|
|
236202
236203
|
const body = getCachedContentParametersToMldev(this.apiClient, params);
|
|
236203
|
-
|
|
236204
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
236204
236205
|
queryParams = body["_query"];
|
|
236205
236206
|
delete body["_url"];
|
|
236206
236207
|
delete body["_query"];
|
|
236207
236208
|
response = this.apiClient.request({
|
|
236208
|
-
path:
|
|
236209
|
+
path: path24,
|
|
236209
236210
|
queryParams,
|
|
236210
236211
|
body: JSON.stringify(body),
|
|
236211
236212
|
httpMethod: "GET",
|
|
@@ -236233,16 +236234,16 @@ var Caches = class extends BaseModule {
|
|
|
236233
236234
|
async delete(params) {
|
|
236234
236235
|
var _a5, _b, _c, _d;
|
|
236235
236236
|
let response;
|
|
236236
|
-
let
|
|
236237
|
+
let path24 = "";
|
|
236237
236238
|
let queryParams = {};
|
|
236238
236239
|
if (this.apiClient.isVertexAI()) {
|
|
236239
236240
|
const body = deleteCachedContentParametersToVertex(this.apiClient, params);
|
|
236240
|
-
|
|
236241
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
236241
236242
|
queryParams = body["_query"];
|
|
236242
236243
|
delete body["_url"];
|
|
236243
236244
|
delete body["_query"];
|
|
236244
236245
|
response = this.apiClient.request({
|
|
236245
|
-
path:
|
|
236246
|
+
path: path24,
|
|
236246
236247
|
queryParams,
|
|
236247
236248
|
body: JSON.stringify(body),
|
|
236248
236249
|
httpMethod: "DELETE",
|
|
@@ -236265,12 +236266,12 @@ var Caches = class extends BaseModule {
|
|
|
236265
236266
|
});
|
|
236266
236267
|
} else {
|
|
236267
236268
|
const body = deleteCachedContentParametersToMldev(this.apiClient, params);
|
|
236268
|
-
|
|
236269
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
236269
236270
|
queryParams = body["_query"];
|
|
236270
236271
|
delete body["_url"];
|
|
236271
236272
|
delete body["_query"];
|
|
236272
236273
|
response = this.apiClient.request({
|
|
236273
|
-
path:
|
|
236274
|
+
path: path24,
|
|
236274
236275
|
queryParams,
|
|
236275
236276
|
body: JSON.stringify(body),
|
|
236276
236277
|
httpMethod: "DELETE",
|
|
@@ -236310,16 +236311,16 @@ var Caches = class extends BaseModule {
|
|
|
236310
236311
|
async update(params) {
|
|
236311
236312
|
var _a5, _b, _c, _d;
|
|
236312
236313
|
let response;
|
|
236313
|
-
let
|
|
236314
|
+
let path24 = "";
|
|
236314
236315
|
let queryParams = {};
|
|
236315
236316
|
if (this.apiClient.isVertexAI()) {
|
|
236316
236317
|
const body = updateCachedContentParametersToVertex(this.apiClient, params);
|
|
236317
|
-
|
|
236318
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
236318
236319
|
queryParams = body["_query"];
|
|
236319
236320
|
delete body["_url"];
|
|
236320
236321
|
delete body["_query"];
|
|
236321
236322
|
response = this.apiClient.request({
|
|
236322
|
-
path:
|
|
236323
|
+
path: path24,
|
|
236323
236324
|
queryParams,
|
|
236324
236325
|
body: JSON.stringify(body),
|
|
236325
236326
|
httpMethod: "PATCH",
|
|
@@ -236333,12 +236334,12 @@ var Caches = class extends BaseModule {
|
|
|
236333
236334
|
});
|
|
236334
236335
|
} else {
|
|
236335
236336
|
const body = updateCachedContentParametersToMldev(this.apiClient, params);
|
|
236336
|
-
|
|
236337
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
236337
236338
|
queryParams = body["_query"];
|
|
236338
236339
|
delete body["_url"];
|
|
236339
236340
|
delete body["_query"];
|
|
236340
236341
|
response = this.apiClient.request({
|
|
236341
|
-
path:
|
|
236342
|
+
path: path24,
|
|
236342
236343
|
queryParams,
|
|
236343
236344
|
body: JSON.stringify(body),
|
|
236344
236345
|
httpMethod: "PATCH",
|
|
@@ -236355,16 +236356,16 @@ var Caches = class extends BaseModule {
|
|
|
236355
236356
|
async listInternal(params) {
|
|
236356
236357
|
var _a5, _b, _c, _d;
|
|
236357
236358
|
let response;
|
|
236358
|
-
let
|
|
236359
|
+
let path24 = "";
|
|
236359
236360
|
let queryParams = {};
|
|
236360
236361
|
if (this.apiClient.isVertexAI()) {
|
|
236361
236362
|
const body = listCachedContentsParametersToVertex(params);
|
|
236362
|
-
|
|
236363
|
+
path24 = formatMap("cachedContents", body["_url"]);
|
|
236363
236364
|
queryParams = body["_query"];
|
|
236364
236365
|
delete body["_url"];
|
|
236365
236366
|
delete body["_query"];
|
|
236366
236367
|
response = this.apiClient.request({
|
|
236367
|
-
path:
|
|
236368
|
+
path: path24,
|
|
236368
236369
|
queryParams,
|
|
236369
236370
|
body: JSON.stringify(body),
|
|
236370
236371
|
httpMethod: "GET",
|
|
@@ -236387,12 +236388,12 @@ var Caches = class extends BaseModule {
|
|
|
236387
236388
|
});
|
|
236388
236389
|
} else {
|
|
236389
236390
|
const body = listCachedContentsParametersToMldev(params);
|
|
236390
|
-
|
|
236391
|
+
path24 = formatMap("cachedContents", body["_url"]);
|
|
236391
236392
|
queryParams = body["_query"];
|
|
236392
236393
|
delete body["_url"];
|
|
236393
236394
|
delete body["_query"];
|
|
236394
236395
|
response = this.apiClient.request({
|
|
236395
|
-
path:
|
|
236396
|
+
path: path24,
|
|
236396
236397
|
queryParams,
|
|
236397
236398
|
body: JSON.stringify(body),
|
|
236398
236399
|
httpMethod: "GET",
|
|
@@ -236988,18 +236989,18 @@ var Files5 = class extends BaseModule {
|
|
|
236988
236989
|
async listInternal(params) {
|
|
236989
236990
|
var _a5, _b;
|
|
236990
236991
|
let response;
|
|
236991
|
-
let
|
|
236992
|
+
let path24 = "";
|
|
236992
236993
|
let queryParams = {};
|
|
236993
236994
|
if (this.apiClient.isVertexAI()) {
|
|
236994
236995
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
236995
236996
|
} else {
|
|
236996
236997
|
const body = listFilesParametersToMldev(params);
|
|
236997
|
-
|
|
236998
|
+
path24 = formatMap("files", body["_url"]);
|
|
236998
236999
|
queryParams = body["_query"];
|
|
236999
237000
|
delete body["_url"];
|
|
237000
237001
|
delete body["_query"];
|
|
237001
237002
|
response = this.apiClient.request({
|
|
237002
|
-
path:
|
|
237003
|
+
path: path24,
|
|
237003
237004
|
queryParams,
|
|
237004
237005
|
body: JSON.stringify(body),
|
|
237005
237006
|
httpMethod: "GET",
|
|
@@ -237025,18 +237026,18 @@ var Files5 = class extends BaseModule {
|
|
|
237025
237026
|
async createInternal(params) {
|
|
237026
237027
|
var _a5, _b;
|
|
237027
237028
|
let response;
|
|
237028
|
-
let
|
|
237029
|
+
let path24 = "";
|
|
237029
237030
|
let queryParams = {};
|
|
237030
237031
|
if (this.apiClient.isVertexAI()) {
|
|
237031
237032
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
237032
237033
|
} else {
|
|
237033
237034
|
const body = createFileParametersToMldev(params);
|
|
237034
|
-
|
|
237035
|
+
path24 = formatMap("upload/v1beta/files", body["_url"]);
|
|
237035
237036
|
queryParams = body["_query"];
|
|
237036
237037
|
delete body["_url"];
|
|
237037
237038
|
delete body["_query"];
|
|
237038
237039
|
response = this.apiClient.request({
|
|
237039
|
-
path:
|
|
237040
|
+
path: path24,
|
|
237040
237041
|
queryParams,
|
|
237041
237042
|
body: JSON.stringify(body),
|
|
237042
237043
|
httpMethod: "POST",
|
|
@@ -237071,18 +237072,18 @@ var Files5 = class extends BaseModule {
|
|
|
237071
237072
|
async get(params) {
|
|
237072
237073
|
var _a5, _b;
|
|
237073
237074
|
let response;
|
|
237074
|
-
let
|
|
237075
|
+
let path24 = "";
|
|
237075
237076
|
let queryParams = {};
|
|
237076
237077
|
if (this.apiClient.isVertexAI()) {
|
|
237077
237078
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
237078
237079
|
} else {
|
|
237079
237080
|
const body = getFileParametersToMldev(params);
|
|
237080
|
-
|
|
237081
|
+
path24 = formatMap("files/{file}", body["_url"]);
|
|
237081
237082
|
queryParams = body["_query"];
|
|
237082
237083
|
delete body["_url"];
|
|
237083
237084
|
delete body["_query"];
|
|
237084
237085
|
response = this.apiClient.request({
|
|
237085
|
-
path:
|
|
237086
|
+
path: path24,
|
|
237086
237087
|
queryParams,
|
|
237087
237088
|
body: JSON.stringify(body),
|
|
237088
237089
|
httpMethod: "GET",
|
|
@@ -237112,18 +237113,18 @@ var Files5 = class extends BaseModule {
|
|
|
237112
237113
|
async delete(params) {
|
|
237113
237114
|
var _a5, _b;
|
|
237114
237115
|
let response;
|
|
237115
|
-
let
|
|
237116
|
+
let path24 = "";
|
|
237116
237117
|
let queryParams = {};
|
|
237117
237118
|
if (this.apiClient.isVertexAI()) {
|
|
237118
237119
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
237119
237120
|
} else {
|
|
237120
237121
|
const body = deleteFileParametersToMldev(params);
|
|
237121
|
-
|
|
237122
|
+
path24 = formatMap("files/{file}", body["_url"]);
|
|
237122
237123
|
queryParams = body["_query"];
|
|
237123
237124
|
delete body["_url"];
|
|
237124
237125
|
delete body["_query"];
|
|
237125
237126
|
response = this.apiClient.request({
|
|
237126
|
-
path:
|
|
237127
|
+
path: path24,
|
|
237127
237128
|
queryParams,
|
|
237128
237129
|
body: JSON.stringify(body),
|
|
237129
237130
|
httpMethod: "DELETE",
|
|
@@ -237149,18 +237150,18 @@ var Files5 = class extends BaseModule {
|
|
|
237149
237150
|
async registerFilesInternal(params) {
|
|
237150
237151
|
var _a5, _b;
|
|
237151
237152
|
let response;
|
|
237152
|
-
let
|
|
237153
|
+
let path24 = "";
|
|
237153
237154
|
let queryParams = {};
|
|
237154
237155
|
if (this.apiClient.isVertexAI()) {
|
|
237155
237156
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
237156
237157
|
} else {
|
|
237157
237158
|
const body = internalRegisterFilesParametersToMldev(params);
|
|
237158
|
-
|
|
237159
|
+
path24 = formatMap("files:register", body["_url"]);
|
|
237159
237160
|
queryParams = body["_query"];
|
|
237160
237161
|
delete body["_url"];
|
|
237161
237162
|
delete body["_query"];
|
|
237162
237163
|
response = this.apiClient.request({
|
|
237163
|
-
path:
|
|
237164
|
+
path: path24,
|
|
237164
237165
|
queryParams,
|
|
237165
237166
|
body: JSON.stringify(body),
|
|
237166
237167
|
httpMethod: "POST",
|
|
@@ -242315,13 +242316,13 @@ var ApiClient = class {
|
|
|
242315
242316
|
throw new Error("HTTP options are not correctly set.");
|
|
242316
242317
|
}
|
|
242317
242318
|
}
|
|
242318
|
-
constructUrl(
|
|
242319
|
+
constructUrl(path24, httpOptions, prependProjectLocation) {
|
|
242319
242320
|
const urlElement = [this.getRequestUrlInternal(httpOptions)];
|
|
242320
242321
|
if (prependProjectLocation) {
|
|
242321
242322
|
urlElement.push(this.getBaseResourcePath());
|
|
242322
242323
|
}
|
|
242323
|
-
if (
|
|
242324
|
-
urlElement.push(
|
|
242324
|
+
if (path24 !== "") {
|
|
242325
|
+
urlElement.push(path24);
|
|
242325
242326
|
}
|
|
242326
242327
|
const url = new URL(`${urlElement.join("/")}`);
|
|
242327
242328
|
return url;
|
|
@@ -242606,8 +242607,8 @@ var ApiClient = class {
|
|
|
242606
242607
|
file: fileToUpload
|
|
242607
242608
|
};
|
|
242608
242609
|
const fileName = this.getFileName(file);
|
|
242609
|
-
const
|
|
242610
|
-
const uploadUrl = await this.fetchUploadUrl(
|
|
242610
|
+
const path24 = formatMap("upload/v1beta/files", body["_url"]);
|
|
242611
|
+
const uploadUrl = await this.fetchUploadUrl(path24, fileToUpload.sizeBytes, fileToUpload.mimeType, fileName, body, config2 === null || config2 === void 0 ? void 0 : config2.httpOptions);
|
|
242611
242612
|
return uploader.upload(file, uploadUrl, this);
|
|
242612
242613
|
}
|
|
242613
242614
|
/**
|
|
@@ -242631,13 +242632,13 @@ var ApiClient = class {
|
|
|
242631
242632
|
if (mimeType === void 0 || mimeType === "") {
|
|
242632
242633
|
throw new Error("Can not determine mimeType. Please provide mimeType in the config.");
|
|
242633
242634
|
}
|
|
242634
|
-
const
|
|
242635
|
+
const path24 = `upload/v1beta/${fileSearchStoreName}:uploadToFileSearchStore`;
|
|
242635
242636
|
const fileName = this.getFileName(file);
|
|
242636
242637
|
const body = {};
|
|
242637
242638
|
if (config2 != null) {
|
|
242638
242639
|
uploadToFileSearchStoreConfigToMldev(config2, body);
|
|
242639
242640
|
}
|
|
242640
|
-
const uploadUrl = await this.fetchUploadUrl(
|
|
242641
|
+
const uploadUrl = await this.fetchUploadUrl(path24, sizeBytes, mimeType, fileName, body, config2 === null || config2 === void 0 ? void 0 : config2.httpOptions);
|
|
242641
242642
|
return uploader.uploadToFileSearchStore(file, uploadUrl, this);
|
|
242642
242643
|
}
|
|
242643
242644
|
/**
|
|
@@ -242650,7 +242651,7 @@ var ApiClient = class {
|
|
|
242650
242651
|
const downloader = this.clientOptions.downloader;
|
|
242651
242652
|
await downloader.download(params, this);
|
|
242652
242653
|
}
|
|
242653
|
-
async fetchUploadUrl(
|
|
242654
|
+
async fetchUploadUrl(path24, sizeBytes, mimeType, fileName, body, configHttpOptions) {
|
|
242654
242655
|
var _a5;
|
|
242655
242656
|
let httpOptions = {};
|
|
242656
242657
|
if (configHttpOptions) {
|
|
@@ -242663,7 +242664,7 @@ var ApiClient = class {
|
|
|
242663
242664
|
};
|
|
242664
242665
|
}
|
|
242665
242666
|
const httpResponse = await this.request({
|
|
242666
|
-
path:
|
|
242667
|
+
path: path24,
|
|
242667
242668
|
body: JSON.stringify(body),
|
|
242668
242669
|
httpMethod: "POST",
|
|
242669
242670
|
httpOptions
|
|
@@ -243859,16 +243860,16 @@ var Models4 = class extends BaseModule {
|
|
|
243859
243860
|
async generateContentInternal(params) {
|
|
243860
243861
|
var _a5, _b, _c, _d;
|
|
243861
243862
|
let response;
|
|
243862
|
-
let
|
|
243863
|
+
let path24 = "";
|
|
243863
243864
|
let queryParams = {};
|
|
243864
243865
|
if (this.apiClient.isVertexAI()) {
|
|
243865
243866
|
const body = generateContentParametersToVertex(this.apiClient, params);
|
|
243866
|
-
|
|
243867
|
+
path24 = formatMap("{model}:generateContent", body["_url"]);
|
|
243867
243868
|
queryParams = body["_query"];
|
|
243868
243869
|
delete body["_url"];
|
|
243869
243870
|
delete body["_query"];
|
|
243870
243871
|
response = this.apiClient.request({
|
|
243871
|
-
path:
|
|
243872
|
+
path: path24,
|
|
243872
243873
|
queryParams,
|
|
243873
243874
|
body: JSON.stringify(body),
|
|
243874
243875
|
httpMethod: "POST",
|
|
@@ -243891,12 +243892,12 @@ var Models4 = class extends BaseModule {
|
|
|
243891
243892
|
});
|
|
243892
243893
|
} else {
|
|
243893
243894
|
const body = generateContentParametersToMldev(this.apiClient, params);
|
|
243894
|
-
|
|
243895
|
+
path24 = formatMap("{model}:generateContent", body["_url"]);
|
|
243895
243896
|
queryParams = body["_query"];
|
|
243896
243897
|
delete body["_url"];
|
|
243897
243898
|
delete body["_query"];
|
|
243898
243899
|
response = this.apiClient.request({
|
|
243899
|
-
path:
|
|
243900
|
+
path: path24,
|
|
243900
243901
|
queryParams,
|
|
243901
243902
|
body: JSON.stringify(body),
|
|
243902
243903
|
httpMethod: "POST",
|
|
@@ -243922,17 +243923,17 @@ var Models4 = class extends BaseModule {
|
|
|
243922
243923
|
async generateContentStreamInternal(params) {
|
|
243923
243924
|
var _a5, _b, _c, _d;
|
|
243924
243925
|
let response;
|
|
243925
|
-
let
|
|
243926
|
+
let path24 = "";
|
|
243926
243927
|
let queryParams = {};
|
|
243927
243928
|
if (this.apiClient.isVertexAI()) {
|
|
243928
243929
|
const body = generateContentParametersToVertex(this.apiClient, params);
|
|
243929
|
-
|
|
243930
|
+
path24 = formatMap("{model}:streamGenerateContent?alt=sse", body["_url"]);
|
|
243930
243931
|
queryParams = body["_query"];
|
|
243931
243932
|
delete body["_url"];
|
|
243932
243933
|
delete body["_query"];
|
|
243933
243934
|
const apiClient = this.apiClient;
|
|
243934
243935
|
response = apiClient.requestStream({
|
|
243935
|
-
path:
|
|
243936
|
+
path: path24,
|
|
243936
243937
|
queryParams,
|
|
243937
243938
|
body: JSON.stringify(body),
|
|
243938
243939
|
httpMethod: "POST",
|
|
@@ -243968,13 +243969,13 @@ var Models4 = class extends BaseModule {
|
|
|
243968
243969
|
});
|
|
243969
243970
|
} else {
|
|
243970
243971
|
const body = generateContentParametersToMldev(this.apiClient, params);
|
|
243971
|
-
|
|
243972
|
+
path24 = formatMap("{model}:streamGenerateContent?alt=sse", body["_url"]);
|
|
243972
243973
|
queryParams = body["_query"];
|
|
243973
243974
|
delete body["_url"];
|
|
243974
243975
|
delete body["_query"];
|
|
243975
243976
|
const apiClient = this.apiClient;
|
|
243976
243977
|
response = apiClient.requestStream({
|
|
243977
|
-
path:
|
|
243978
|
+
path: path24,
|
|
243978
243979
|
queryParams,
|
|
243979
243980
|
body: JSON.stringify(body),
|
|
243980
243981
|
httpMethod: "POST",
|
|
@@ -244034,17 +244035,17 @@ var Models4 = class extends BaseModule {
|
|
|
244034
244035
|
async embedContentInternal(params) {
|
|
244035
244036
|
var _a5, _b, _c, _d;
|
|
244036
244037
|
let response;
|
|
244037
|
-
let
|
|
244038
|
+
let path24 = "";
|
|
244038
244039
|
let queryParams = {};
|
|
244039
244040
|
if (this.apiClient.isVertexAI()) {
|
|
244040
244041
|
const body = embedContentParametersPrivateToVertex(this.apiClient, params, params);
|
|
244041
244042
|
const endpointUrl = tIsVertexEmbedContentModel(params.model) ? "{model}:embedContent" : "{model}:predict";
|
|
244042
|
-
|
|
244043
|
+
path24 = formatMap(endpointUrl, body["_url"]);
|
|
244043
244044
|
queryParams = body["_query"];
|
|
244044
244045
|
delete body["_url"];
|
|
244045
244046
|
delete body["_query"];
|
|
244046
244047
|
response = this.apiClient.request({
|
|
244047
|
-
path:
|
|
244048
|
+
path: path24,
|
|
244048
244049
|
queryParams,
|
|
244049
244050
|
body: JSON.stringify(body),
|
|
244050
244051
|
httpMethod: "POST",
|
|
@@ -244067,12 +244068,12 @@ var Models4 = class extends BaseModule {
|
|
|
244067
244068
|
});
|
|
244068
244069
|
} else {
|
|
244069
244070
|
const body = embedContentParametersPrivateToMldev(this.apiClient, params);
|
|
244070
|
-
|
|
244071
|
+
path24 = formatMap("{model}:batchEmbedContents", body["_url"]);
|
|
244071
244072
|
queryParams = body["_query"];
|
|
244072
244073
|
delete body["_url"];
|
|
244073
244074
|
delete body["_query"];
|
|
244074
244075
|
response = this.apiClient.request({
|
|
244075
|
-
path:
|
|
244076
|
+
path: path24,
|
|
244076
244077
|
queryParams,
|
|
244077
244078
|
body: JSON.stringify(body),
|
|
244078
244079
|
httpMethod: "POST",
|
|
@@ -244101,16 +244102,16 @@ var Models4 = class extends BaseModule {
|
|
|
244101
244102
|
async generateImagesInternal(params) {
|
|
244102
244103
|
var _a5, _b, _c, _d;
|
|
244103
244104
|
let response;
|
|
244104
|
-
let
|
|
244105
|
+
let path24 = "";
|
|
244105
244106
|
let queryParams = {};
|
|
244106
244107
|
if (this.apiClient.isVertexAI()) {
|
|
244107
244108
|
const body = generateImagesParametersToVertex(this.apiClient, params);
|
|
244108
|
-
|
|
244109
|
+
path24 = formatMap("{model}:predict", body["_url"]);
|
|
244109
244110
|
queryParams = body["_query"];
|
|
244110
244111
|
delete body["_url"];
|
|
244111
244112
|
delete body["_query"];
|
|
244112
244113
|
response = this.apiClient.request({
|
|
244113
|
-
path:
|
|
244114
|
+
path: path24,
|
|
244114
244115
|
queryParams,
|
|
244115
244116
|
body: JSON.stringify(body),
|
|
244116
244117
|
httpMethod: "POST",
|
|
@@ -244133,12 +244134,12 @@ var Models4 = class extends BaseModule {
|
|
|
244133
244134
|
});
|
|
244134
244135
|
} else {
|
|
244135
244136
|
const body = generateImagesParametersToMldev(this.apiClient, params);
|
|
244136
|
-
|
|
244137
|
+
path24 = formatMap("{model}:predict", body["_url"]);
|
|
244137
244138
|
queryParams = body["_query"];
|
|
244138
244139
|
delete body["_url"];
|
|
244139
244140
|
delete body["_query"];
|
|
244140
244141
|
response = this.apiClient.request({
|
|
244141
|
-
path:
|
|
244142
|
+
path: path24,
|
|
244142
244143
|
queryParams,
|
|
244143
244144
|
body: JSON.stringify(body),
|
|
244144
244145
|
httpMethod: "POST",
|
|
@@ -244167,16 +244168,16 @@ var Models4 = class extends BaseModule {
|
|
|
244167
244168
|
async editImageInternal(params) {
|
|
244168
244169
|
var _a5, _b;
|
|
244169
244170
|
let response;
|
|
244170
|
-
let
|
|
244171
|
+
let path24 = "";
|
|
244171
244172
|
let queryParams = {};
|
|
244172
244173
|
if (this.apiClient.isVertexAI()) {
|
|
244173
244174
|
const body = editImageParametersInternalToVertex(this.apiClient, params);
|
|
244174
|
-
|
|
244175
|
+
path24 = formatMap("{model}:predict", body["_url"]);
|
|
244175
244176
|
queryParams = body["_query"];
|
|
244176
244177
|
delete body["_url"];
|
|
244177
244178
|
delete body["_query"];
|
|
244178
244179
|
response = this.apiClient.request({
|
|
244179
|
-
path:
|
|
244180
|
+
path: path24,
|
|
244180
244181
|
queryParams,
|
|
244181
244182
|
body: JSON.stringify(body),
|
|
244182
244183
|
httpMethod: "POST",
|
|
@@ -244207,16 +244208,16 @@ var Models4 = class extends BaseModule {
|
|
|
244207
244208
|
async upscaleImageInternal(params) {
|
|
244208
244209
|
var _a5, _b;
|
|
244209
244210
|
let response;
|
|
244210
|
-
let
|
|
244211
|
+
let path24 = "";
|
|
244211
244212
|
let queryParams = {};
|
|
244212
244213
|
if (this.apiClient.isVertexAI()) {
|
|
244213
244214
|
const body = upscaleImageAPIParametersInternalToVertex(this.apiClient, params);
|
|
244214
|
-
|
|
244215
|
+
path24 = formatMap("{model}:predict", body["_url"]);
|
|
244215
244216
|
queryParams = body["_query"];
|
|
244216
244217
|
delete body["_url"];
|
|
244217
244218
|
delete body["_query"];
|
|
244218
244219
|
response = this.apiClient.request({
|
|
244219
|
-
path:
|
|
244220
|
+
path: path24,
|
|
244220
244221
|
queryParams,
|
|
244221
244222
|
body: JSON.stringify(body),
|
|
244222
244223
|
httpMethod: "POST",
|
|
@@ -244268,16 +244269,16 @@ var Models4 = class extends BaseModule {
|
|
|
244268
244269
|
async recontextImage(params) {
|
|
244269
244270
|
var _a5, _b;
|
|
244270
244271
|
let response;
|
|
244271
|
-
let
|
|
244272
|
+
let path24 = "";
|
|
244272
244273
|
let queryParams = {};
|
|
244273
244274
|
if (this.apiClient.isVertexAI()) {
|
|
244274
244275
|
const body = recontextImageParametersToVertex(this.apiClient, params);
|
|
244275
|
-
|
|
244276
|
+
path24 = formatMap("{model}:predict", body["_url"]);
|
|
244276
244277
|
queryParams = body["_query"];
|
|
244277
244278
|
delete body["_url"];
|
|
244278
244279
|
delete body["_query"];
|
|
244279
244280
|
response = this.apiClient.request({
|
|
244280
|
-
path:
|
|
244281
|
+
path: path24,
|
|
244281
244282
|
queryParams,
|
|
244282
244283
|
body: JSON.stringify(body),
|
|
244283
244284
|
httpMethod: "POST",
|
|
@@ -244319,16 +244320,16 @@ var Models4 = class extends BaseModule {
|
|
|
244319
244320
|
async segmentImage(params) {
|
|
244320
244321
|
var _a5, _b;
|
|
244321
244322
|
let response;
|
|
244322
|
-
let
|
|
244323
|
+
let path24 = "";
|
|
244323
244324
|
let queryParams = {};
|
|
244324
244325
|
if (this.apiClient.isVertexAI()) {
|
|
244325
244326
|
const body = segmentImageParametersToVertex(this.apiClient, params);
|
|
244326
|
-
|
|
244327
|
+
path24 = formatMap("{model}:predict", body["_url"]);
|
|
244327
244328
|
queryParams = body["_query"];
|
|
244328
244329
|
delete body["_url"];
|
|
244329
244330
|
delete body["_query"];
|
|
244330
244331
|
response = this.apiClient.request({
|
|
244331
|
-
path:
|
|
244332
|
+
path: path24,
|
|
244332
244333
|
queryParams,
|
|
244333
244334
|
body: JSON.stringify(body),
|
|
244334
244335
|
httpMethod: "POST",
|
|
@@ -244358,16 +244359,16 @@ var Models4 = class extends BaseModule {
|
|
|
244358
244359
|
async get(params) {
|
|
244359
244360
|
var _a5, _b, _c, _d;
|
|
244360
244361
|
let response;
|
|
244361
|
-
let
|
|
244362
|
+
let path24 = "";
|
|
244362
244363
|
let queryParams = {};
|
|
244363
244364
|
if (this.apiClient.isVertexAI()) {
|
|
244364
244365
|
const body = getModelParametersToVertex(this.apiClient, params);
|
|
244365
|
-
|
|
244366
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
244366
244367
|
queryParams = body["_query"];
|
|
244367
244368
|
delete body["_url"];
|
|
244368
244369
|
delete body["_query"];
|
|
244369
244370
|
response = this.apiClient.request({
|
|
244370
|
-
path:
|
|
244371
|
+
path: path24,
|
|
244371
244372
|
queryParams,
|
|
244372
244373
|
body: JSON.stringify(body),
|
|
244373
244374
|
httpMethod: "GET",
|
|
@@ -244382,12 +244383,12 @@ var Models4 = class extends BaseModule {
|
|
|
244382
244383
|
});
|
|
244383
244384
|
} else {
|
|
244384
244385
|
const body = getModelParametersToMldev(this.apiClient, params);
|
|
244385
|
-
|
|
244386
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
244386
244387
|
queryParams = body["_query"];
|
|
244387
244388
|
delete body["_url"];
|
|
244388
244389
|
delete body["_query"];
|
|
244389
244390
|
response = this.apiClient.request({
|
|
244390
|
-
path:
|
|
244391
|
+
path: path24,
|
|
244391
244392
|
queryParams,
|
|
244392
244393
|
body: JSON.stringify(body),
|
|
244393
244394
|
httpMethod: "GET",
|
|
@@ -244405,16 +244406,16 @@ var Models4 = class extends BaseModule {
|
|
|
244405
244406
|
async listInternal(params) {
|
|
244406
244407
|
var _a5, _b, _c, _d;
|
|
244407
244408
|
let response;
|
|
244408
|
-
let
|
|
244409
|
+
let path24 = "";
|
|
244409
244410
|
let queryParams = {};
|
|
244410
244411
|
if (this.apiClient.isVertexAI()) {
|
|
244411
244412
|
const body = listModelsParametersToVertex(this.apiClient, params);
|
|
244412
|
-
|
|
244413
|
+
path24 = formatMap("{models_url}", body["_url"]);
|
|
244413
244414
|
queryParams = body["_query"];
|
|
244414
244415
|
delete body["_url"];
|
|
244415
244416
|
delete body["_query"];
|
|
244416
244417
|
response = this.apiClient.request({
|
|
244417
|
-
path:
|
|
244418
|
+
path: path24,
|
|
244418
244419
|
queryParams,
|
|
244419
244420
|
body: JSON.stringify(body),
|
|
244420
244421
|
httpMethod: "GET",
|
|
@@ -244437,12 +244438,12 @@ var Models4 = class extends BaseModule {
|
|
|
244437
244438
|
});
|
|
244438
244439
|
} else {
|
|
244439
244440
|
const body = listModelsParametersToMldev(this.apiClient, params);
|
|
244440
|
-
|
|
244441
|
+
path24 = formatMap("{models_url}", body["_url"]);
|
|
244441
244442
|
queryParams = body["_query"];
|
|
244442
244443
|
delete body["_url"];
|
|
244443
244444
|
delete body["_query"];
|
|
244444
244445
|
response = this.apiClient.request({
|
|
244445
|
-
path:
|
|
244446
|
+
path: path24,
|
|
244446
244447
|
queryParams,
|
|
244447
244448
|
body: JSON.stringify(body),
|
|
244448
244449
|
httpMethod: "GET",
|
|
@@ -244485,16 +244486,16 @@ var Models4 = class extends BaseModule {
|
|
|
244485
244486
|
async update(params) {
|
|
244486
244487
|
var _a5, _b, _c, _d;
|
|
244487
244488
|
let response;
|
|
244488
|
-
let
|
|
244489
|
+
let path24 = "";
|
|
244489
244490
|
let queryParams = {};
|
|
244490
244491
|
if (this.apiClient.isVertexAI()) {
|
|
244491
244492
|
const body = updateModelParametersToVertex(this.apiClient, params);
|
|
244492
|
-
|
|
244493
|
+
path24 = formatMap("{model}", body["_url"]);
|
|
244493
244494
|
queryParams = body["_query"];
|
|
244494
244495
|
delete body["_url"];
|
|
244495
244496
|
delete body["_query"];
|
|
244496
244497
|
response = this.apiClient.request({
|
|
244497
|
-
path:
|
|
244498
|
+
path: path24,
|
|
244498
244499
|
queryParams,
|
|
244499
244500
|
body: JSON.stringify(body),
|
|
244500
244501
|
httpMethod: "PATCH",
|
|
@@ -244509,12 +244510,12 @@ var Models4 = class extends BaseModule {
|
|
|
244509
244510
|
});
|
|
244510
244511
|
} else {
|
|
244511
244512
|
const body = updateModelParametersToMldev(this.apiClient, params);
|
|
244512
|
-
|
|
244513
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
244513
244514
|
queryParams = body["_query"];
|
|
244514
244515
|
delete body["_url"];
|
|
244515
244516
|
delete body["_query"];
|
|
244516
244517
|
response = this.apiClient.request({
|
|
244517
|
-
path:
|
|
244518
|
+
path: path24,
|
|
244518
244519
|
queryParams,
|
|
244519
244520
|
body: JSON.stringify(body),
|
|
244520
244521
|
httpMethod: "PATCH",
|
|
@@ -244543,16 +244544,16 @@ var Models4 = class extends BaseModule {
|
|
|
244543
244544
|
async delete(params) {
|
|
244544
244545
|
var _a5, _b, _c, _d;
|
|
244545
244546
|
let response;
|
|
244546
|
-
let
|
|
244547
|
+
let path24 = "";
|
|
244547
244548
|
let queryParams = {};
|
|
244548
244549
|
if (this.apiClient.isVertexAI()) {
|
|
244549
244550
|
const body = deleteModelParametersToVertex(this.apiClient, params);
|
|
244550
|
-
|
|
244551
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
244551
244552
|
queryParams = body["_query"];
|
|
244552
244553
|
delete body["_url"];
|
|
244553
244554
|
delete body["_query"];
|
|
244554
244555
|
response = this.apiClient.request({
|
|
244555
|
-
path:
|
|
244556
|
+
path: path24,
|
|
244556
244557
|
queryParams,
|
|
244557
244558
|
body: JSON.stringify(body),
|
|
244558
244559
|
httpMethod: "DELETE",
|
|
@@ -244575,12 +244576,12 @@ var Models4 = class extends BaseModule {
|
|
|
244575
244576
|
});
|
|
244576
244577
|
} else {
|
|
244577
244578
|
const body = deleteModelParametersToMldev(this.apiClient, params);
|
|
244578
|
-
|
|
244579
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
244579
244580
|
queryParams = body["_query"];
|
|
244580
244581
|
delete body["_url"];
|
|
244581
244582
|
delete body["_query"];
|
|
244582
244583
|
response = this.apiClient.request({
|
|
244583
|
-
path:
|
|
244584
|
+
path: path24,
|
|
244584
244585
|
queryParams,
|
|
244585
244586
|
body: JSON.stringify(body),
|
|
244586
244587
|
httpMethod: "DELETE",
|
|
@@ -244622,16 +244623,16 @@ var Models4 = class extends BaseModule {
|
|
|
244622
244623
|
async countTokens(params) {
|
|
244623
244624
|
var _a5, _b, _c, _d;
|
|
244624
244625
|
let response;
|
|
244625
|
-
let
|
|
244626
|
+
let path24 = "";
|
|
244626
244627
|
let queryParams = {};
|
|
244627
244628
|
if (this.apiClient.isVertexAI()) {
|
|
244628
244629
|
const body = countTokensParametersToVertex(this.apiClient, params);
|
|
244629
|
-
|
|
244630
|
+
path24 = formatMap("{model}:countTokens", body["_url"]);
|
|
244630
244631
|
queryParams = body["_query"];
|
|
244631
244632
|
delete body["_url"];
|
|
244632
244633
|
delete body["_query"];
|
|
244633
244634
|
response = this.apiClient.request({
|
|
244634
|
-
path:
|
|
244635
|
+
path: path24,
|
|
244635
244636
|
queryParams,
|
|
244636
244637
|
body: JSON.stringify(body),
|
|
244637
244638
|
httpMethod: "POST",
|
|
@@ -244654,12 +244655,12 @@ var Models4 = class extends BaseModule {
|
|
|
244654
244655
|
});
|
|
244655
244656
|
} else {
|
|
244656
244657
|
const body = countTokensParametersToMldev(this.apiClient, params);
|
|
244657
|
-
|
|
244658
|
+
path24 = formatMap("{model}:countTokens", body["_url"]);
|
|
244658
244659
|
queryParams = body["_query"];
|
|
244659
244660
|
delete body["_url"];
|
|
244660
244661
|
delete body["_query"];
|
|
244661
244662
|
response = this.apiClient.request({
|
|
244662
|
-
path:
|
|
244663
|
+
path: path24,
|
|
244663
244664
|
queryParams,
|
|
244664
244665
|
body: JSON.stringify(body),
|
|
244665
244666
|
httpMethod: "POST",
|
|
@@ -244703,16 +244704,16 @@ var Models4 = class extends BaseModule {
|
|
|
244703
244704
|
async computeTokens(params) {
|
|
244704
244705
|
var _a5, _b;
|
|
244705
244706
|
let response;
|
|
244706
|
-
let
|
|
244707
|
+
let path24 = "";
|
|
244707
244708
|
let queryParams = {};
|
|
244708
244709
|
if (this.apiClient.isVertexAI()) {
|
|
244709
244710
|
const body = computeTokensParametersToVertex(this.apiClient, params);
|
|
244710
|
-
|
|
244711
|
+
path24 = formatMap("{model}:computeTokens", body["_url"]);
|
|
244711
244712
|
queryParams = body["_query"];
|
|
244712
244713
|
delete body["_url"];
|
|
244713
244714
|
delete body["_query"];
|
|
244714
244715
|
response = this.apiClient.request({
|
|
244715
|
-
path:
|
|
244716
|
+
path: path24,
|
|
244716
244717
|
queryParams,
|
|
244717
244718
|
body: JSON.stringify(body),
|
|
244718
244719
|
httpMethod: "POST",
|
|
@@ -244743,16 +244744,16 @@ var Models4 = class extends BaseModule {
|
|
|
244743
244744
|
async generateVideosInternal(params) {
|
|
244744
244745
|
var _a5, _b, _c, _d;
|
|
244745
244746
|
let response;
|
|
244746
|
-
let
|
|
244747
|
+
let path24 = "";
|
|
244747
244748
|
let queryParams = {};
|
|
244748
244749
|
if (this.apiClient.isVertexAI()) {
|
|
244749
244750
|
const body = generateVideosParametersToVertex(this.apiClient, params);
|
|
244750
|
-
|
|
244751
|
+
path24 = formatMap("{model}:predictLongRunning", body["_url"]);
|
|
244751
244752
|
queryParams = body["_query"];
|
|
244752
244753
|
delete body["_url"];
|
|
244753
244754
|
delete body["_query"];
|
|
244754
244755
|
response = this.apiClient.request({
|
|
244755
|
-
path:
|
|
244756
|
+
path: path24,
|
|
244756
244757
|
queryParams,
|
|
244757
244758
|
body: JSON.stringify(body),
|
|
244758
244759
|
httpMethod: "POST",
|
|
@@ -244769,12 +244770,12 @@ var Models4 = class extends BaseModule {
|
|
|
244769
244770
|
});
|
|
244770
244771
|
} else {
|
|
244771
244772
|
const body = generateVideosParametersToMldev(this.apiClient, params);
|
|
244772
|
-
|
|
244773
|
+
path24 = formatMap("{model}:predictLongRunning", body["_url"]);
|
|
244773
244774
|
queryParams = body["_query"];
|
|
244774
244775
|
delete body["_url"];
|
|
244775
244776
|
delete body["_query"];
|
|
244776
244777
|
response = this.apiClient.request({
|
|
244777
|
-
path:
|
|
244778
|
+
path: path24,
|
|
244778
244779
|
queryParams,
|
|
244779
244780
|
body: JSON.stringify(body),
|
|
244780
244781
|
httpMethod: "POST",
|
|
@@ -244876,16 +244877,16 @@ var Operations = class extends BaseModule {
|
|
|
244876
244877
|
async getVideosOperationInternal(params) {
|
|
244877
244878
|
var _a5, _b, _c, _d;
|
|
244878
244879
|
let response;
|
|
244879
|
-
let
|
|
244880
|
+
let path24 = "";
|
|
244880
244881
|
let queryParams = {};
|
|
244881
244882
|
if (this.apiClient.isVertexAI()) {
|
|
244882
244883
|
const body = getOperationParametersToVertex(params);
|
|
244883
|
-
|
|
244884
|
+
path24 = formatMap("{operationName}", body["_url"]);
|
|
244884
244885
|
queryParams = body["_query"];
|
|
244885
244886
|
delete body["_url"];
|
|
244886
244887
|
delete body["_query"];
|
|
244887
244888
|
response = this.apiClient.request({
|
|
244888
|
-
path:
|
|
244889
|
+
path: path24,
|
|
244889
244890
|
queryParams,
|
|
244890
244891
|
body: JSON.stringify(body),
|
|
244891
244892
|
httpMethod: "GET",
|
|
@@ -244897,12 +244898,12 @@ var Operations = class extends BaseModule {
|
|
|
244897
244898
|
return response;
|
|
244898
244899
|
} else {
|
|
244899
244900
|
const body = getOperationParametersToMldev(params);
|
|
244900
|
-
|
|
244901
|
+
path24 = formatMap("{operationName}", body["_url"]);
|
|
244901
244902
|
queryParams = body["_query"];
|
|
244902
244903
|
delete body["_url"];
|
|
244903
244904
|
delete body["_query"];
|
|
244904
244905
|
response = this.apiClient.request({
|
|
244905
|
-
path:
|
|
244906
|
+
path: path24,
|
|
244906
244907
|
queryParams,
|
|
244907
244908
|
body: JSON.stringify(body),
|
|
244908
244909
|
httpMethod: "GET",
|
|
@@ -244917,16 +244918,16 @@ var Operations = class extends BaseModule {
|
|
|
244917
244918
|
async fetchPredictVideosOperationInternal(params) {
|
|
244918
244919
|
var _a5, _b;
|
|
244919
244920
|
let response;
|
|
244920
|
-
let
|
|
244921
|
+
let path24 = "";
|
|
244921
244922
|
let queryParams = {};
|
|
244922
244923
|
if (this.apiClient.isVertexAI()) {
|
|
244923
244924
|
const body = fetchPredictOperationParametersToVertex(params);
|
|
244924
|
-
|
|
244925
|
+
path24 = formatMap("{resourceName}:fetchPredictOperation", body["_url"]);
|
|
244925
244926
|
queryParams = body["_query"];
|
|
244926
244927
|
delete body["_url"];
|
|
244927
244928
|
delete body["_query"];
|
|
244928
244929
|
response = this.apiClient.request({
|
|
244929
|
-
path:
|
|
244930
|
+
path: path24,
|
|
244930
244931
|
queryParams,
|
|
244931
244932
|
body: JSON.stringify(body),
|
|
244932
244933
|
httpMethod: "POST",
|
|
@@ -245592,20 +245593,20 @@ var Tokens = class extends BaseModule {
|
|
|
245592
245593
|
async create(params) {
|
|
245593
245594
|
var _a5, _b;
|
|
245594
245595
|
let response;
|
|
245595
|
-
let
|
|
245596
|
+
let path24 = "";
|
|
245596
245597
|
let queryParams = {};
|
|
245597
245598
|
if (this.apiClient.isVertexAI()) {
|
|
245598
245599
|
throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");
|
|
245599
245600
|
} else {
|
|
245600
245601
|
const body = createAuthTokenParametersToMldev(this.apiClient, params);
|
|
245601
|
-
|
|
245602
|
+
path24 = formatMap("auth_tokens", body["_url"]);
|
|
245602
245603
|
queryParams = body["_query"];
|
|
245603
245604
|
delete body["config"];
|
|
245604
245605
|
delete body["_url"];
|
|
245605
245606
|
delete body["_query"];
|
|
245606
245607
|
const transformedBody = convertBidiSetupToTokenSetup(body, params.config);
|
|
245607
245608
|
response = this.apiClient.request({
|
|
245608
|
-
path:
|
|
245609
|
+
path: path24,
|
|
245609
245610
|
queryParams,
|
|
245610
245611
|
body: JSON.stringify(transformedBody),
|
|
245611
245612
|
httpMethod: "POST",
|
|
@@ -245715,18 +245716,18 @@ var Documents = class extends BaseModule {
|
|
|
245715
245716
|
async get(params) {
|
|
245716
245717
|
var _a5, _b;
|
|
245717
245718
|
let response;
|
|
245718
|
-
let
|
|
245719
|
+
let path24 = "";
|
|
245719
245720
|
let queryParams = {};
|
|
245720
245721
|
if (this.apiClient.isVertexAI()) {
|
|
245721
245722
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
245722
245723
|
} else {
|
|
245723
245724
|
const body = getDocumentParametersToMldev(params);
|
|
245724
|
-
|
|
245725
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
245725
245726
|
queryParams = body["_query"];
|
|
245726
245727
|
delete body["_url"];
|
|
245727
245728
|
delete body["_query"];
|
|
245728
245729
|
response = this.apiClient.request({
|
|
245729
|
-
path:
|
|
245730
|
+
path: path24,
|
|
245730
245731
|
queryParams,
|
|
245731
245732
|
body: JSON.stringify(body),
|
|
245732
245733
|
httpMethod: "GET",
|
|
@@ -245747,18 +245748,18 @@ var Documents = class extends BaseModule {
|
|
|
245747
245748
|
*/
|
|
245748
245749
|
async delete(params) {
|
|
245749
245750
|
var _a5, _b;
|
|
245750
|
-
let
|
|
245751
|
+
let path24 = "";
|
|
245751
245752
|
let queryParams = {};
|
|
245752
245753
|
if (this.apiClient.isVertexAI()) {
|
|
245753
245754
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
245754
245755
|
} else {
|
|
245755
245756
|
const body = deleteDocumentParametersToMldev(params);
|
|
245756
|
-
|
|
245757
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
245757
245758
|
queryParams = body["_query"];
|
|
245758
245759
|
delete body["_url"];
|
|
245759
245760
|
delete body["_query"];
|
|
245760
245761
|
await this.apiClient.request({
|
|
245761
|
-
path:
|
|
245762
|
+
path: path24,
|
|
245762
245763
|
queryParams,
|
|
245763
245764
|
body: JSON.stringify(body),
|
|
245764
245765
|
httpMethod: "DELETE",
|
|
@@ -245770,18 +245771,18 @@ var Documents = class extends BaseModule {
|
|
|
245770
245771
|
async listInternal(params) {
|
|
245771
245772
|
var _a5, _b;
|
|
245772
245773
|
let response;
|
|
245773
|
-
let
|
|
245774
|
+
let path24 = "";
|
|
245774
245775
|
let queryParams = {};
|
|
245775
245776
|
if (this.apiClient.isVertexAI()) {
|
|
245776
245777
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
245777
245778
|
} else {
|
|
245778
245779
|
const body = listDocumentsParametersToMldev(params);
|
|
245779
|
-
|
|
245780
|
+
path24 = formatMap("{parent}/documents", body["_url"]);
|
|
245780
245781
|
queryParams = body["_query"];
|
|
245781
245782
|
delete body["_url"];
|
|
245782
245783
|
delete body["_query"];
|
|
245783
245784
|
response = this.apiClient.request({
|
|
245784
|
-
path:
|
|
245785
|
+
path: path24,
|
|
245785
245786
|
queryParams,
|
|
245786
245787
|
body: JSON.stringify(body),
|
|
245787
245788
|
httpMethod: "GET",
|
|
@@ -245898,18 +245899,18 @@ var FileSearchStores = class extends BaseModule {
|
|
|
245898
245899
|
async create(params) {
|
|
245899
245900
|
var _a5, _b;
|
|
245900
245901
|
let response;
|
|
245901
|
-
let
|
|
245902
|
+
let path24 = "";
|
|
245902
245903
|
let queryParams = {};
|
|
245903
245904
|
if (this.apiClient.isVertexAI()) {
|
|
245904
245905
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
245905
245906
|
} else {
|
|
245906
245907
|
const body = createFileSearchStoreParametersToMldev(this.apiClient, params);
|
|
245907
|
-
|
|
245908
|
+
path24 = formatMap("fileSearchStores", body["_url"]);
|
|
245908
245909
|
queryParams = body["_query"];
|
|
245909
245910
|
delete body["_url"];
|
|
245910
245911
|
delete body["_query"];
|
|
245911
245912
|
response = this.apiClient.request({
|
|
245912
|
-
path:
|
|
245913
|
+
path: path24,
|
|
245913
245914
|
queryParams,
|
|
245914
245915
|
body: JSON.stringify(body),
|
|
245915
245916
|
httpMethod: "POST",
|
|
@@ -245932,18 +245933,18 @@ var FileSearchStores = class extends BaseModule {
|
|
|
245932
245933
|
async get(params) {
|
|
245933
245934
|
var _a5, _b;
|
|
245934
245935
|
let response;
|
|
245935
|
-
let
|
|
245936
|
+
let path24 = "";
|
|
245936
245937
|
let queryParams = {};
|
|
245937
245938
|
if (this.apiClient.isVertexAI()) {
|
|
245938
245939
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
245939
245940
|
} else {
|
|
245940
245941
|
const body = getFileSearchStoreParametersToMldev(params);
|
|
245941
|
-
|
|
245942
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
245942
245943
|
queryParams = body["_query"];
|
|
245943
245944
|
delete body["_url"];
|
|
245944
245945
|
delete body["_query"];
|
|
245945
245946
|
response = this.apiClient.request({
|
|
245946
|
-
path:
|
|
245947
|
+
path: path24,
|
|
245947
245948
|
queryParams,
|
|
245948
245949
|
body: JSON.stringify(body),
|
|
245949
245950
|
httpMethod: "GET",
|
|
@@ -245964,18 +245965,18 @@ var FileSearchStores = class extends BaseModule {
|
|
|
245964
245965
|
*/
|
|
245965
245966
|
async delete(params) {
|
|
245966
245967
|
var _a5, _b;
|
|
245967
|
-
let
|
|
245968
|
+
let path24 = "";
|
|
245968
245969
|
let queryParams = {};
|
|
245969
245970
|
if (this.apiClient.isVertexAI()) {
|
|
245970
245971
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
245971
245972
|
} else {
|
|
245972
245973
|
const body = deleteFileSearchStoreParametersToMldev(params);
|
|
245973
|
-
|
|
245974
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
245974
245975
|
queryParams = body["_query"];
|
|
245975
245976
|
delete body["_url"];
|
|
245976
245977
|
delete body["_query"];
|
|
245977
245978
|
await this.apiClient.request({
|
|
245978
|
-
path:
|
|
245979
|
+
path: path24,
|
|
245979
245980
|
queryParams,
|
|
245980
245981
|
body: JSON.stringify(body),
|
|
245981
245982
|
httpMethod: "DELETE",
|
|
@@ -245987,18 +245988,18 @@ var FileSearchStores = class extends BaseModule {
|
|
|
245987
245988
|
async listInternal(params) {
|
|
245988
245989
|
var _a5, _b;
|
|
245989
245990
|
let response;
|
|
245990
|
-
let
|
|
245991
|
+
let path24 = "";
|
|
245991
245992
|
let queryParams = {};
|
|
245992
245993
|
if (this.apiClient.isVertexAI()) {
|
|
245993
245994
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
245994
245995
|
} else {
|
|
245995
245996
|
const body = listFileSearchStoresParametersToMldev(params);
|
|
245996
|
-
|
|
245997
|
+
path24 = formatMap("fileSearchStores", body["_url"]);
|
|
245997
245998
|
queryParams = body["_query"];
|
|
245998
245999
|
delete body["_url"];
|
|
245999
246000
|
delete body["_query"];
|
|
246000
246001
|
response = this.apiClient.request({
|
|
246001
|
-
path:
|
|
246002
|
+
path: path24,
|
|
246002
246003
|
queryParams,
|
|
246003
246004
|
body: JSON.stringify(body),
|
|
246004
246005
|
httpMethod: "GET",
|
|
@@ -246018,18 +246019,18 @@ var FileSearchStores = class extends BaseModule {
|
|
|
246018
246019
|
async uploadToFileSearchStoreInternal(params) {
|
|
246019
246020
|
var _a5, _b;
|
|
246020
246021
|
let response;
|
|
246021
|
-
let
|
|
246022
|
+
let path24 = "";
|
|
246022
246023
|
let queryParams = {};
|
|
246023
246024
|
if (this.apiClient.isVertexAI()) {
|
|
246024
246025
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
246025
246026
|
} else {
|
|
246026
246027
|
const body = uploadToFileSearchStoreParametersToMldev(params);
|
|
246027
|
-
|
|
246028
|
+
path24 = formatMap("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore", body["_url"]);
|
|
246028
246029
|
queryParams = body["_query"];
|
|
246029
246030
|
delete body["_url"];
|
|
246030
246031
|
delete body["_query"];
|
|
246031
246032
|
response = this.apiClient.request({
|
|
246032
|
-
path:
|
|
246033
|
+
path: path24,
|
|
246033
246034
|
queryParams,
|
|
246034
246035
|
body: JSON.stringify(body),
|
|
246035
246036
|
httpMethod: "POST",
|
|
@@ -246057,18 +246058,18 @@ var FileSearchStores = class extends BaseModule {
|
|
|
246057
246058
|
async importFile(params) {
|
|
246058
246059
|
var _a5, _b;
|
|
246059
246060
|
let response;
|
|
246060
|
-
let
|
|
246061
|
+
let path24 = "";
|
|
246061
246062
|
let queryParams = {};
|
|
246062
246063
|
if (this.apiClient.isVertexAI()) {
|
|
246063
246064
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
246064
246065
|
} else {
|
|
246065
246066
|
const body = importFileParametersToMldev(params);
|
|
246066
|
-
|
|
246067
|
+
path24 = formatMap("{file_search_store_name}:importFile", body["_url"]);
|
|
246067
246068
|
queryParams = body["_query"];
|
|
246068
246069
|
delete body["_url"];
|
|
246069
246070
|
delete body["_query"];
|
|
246070
246071
|
response = this.apiClient.request({
|
|
246071
|
-
path:
|
|
246072
|
+
path: path24,
|
|
246072
246073
|
queryParams,
|
|
246073
246074
|
body: JSON.stringify(body),
|
|
246074
246075
|
httpMethod: "POST",
|
|
@@ -246431,12 +246432,12 @@ function encodeURIPath2(str2) {
|
|
|
246431
246432
|
return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
246432
246433
|
}
|
|
246433
246434
|
var EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
246434
|
-
var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => (function
|
|
246435
|
+
var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => (function path24(statics, ...params) {
|
|
246435
246436
|
if (statics.length === 1)
|
|
246436
246437
|
return statics[0];
|
|
246437
246438
|
let postPath = false;
|
|
246438
246439
|
const invalidSegments = [];
|
|
246439
|
-
const
|
|
246440
|
+
const path25 = statics.reduce((previousValue, currentValue, index) => {
|
|
246440
246441
|
var _a5, _b, _c;
|
|
246441
246442
|
if (/[?#]/.test(currentValue)) {
|
|
246442
246443
|
postPath = true;
|
|
@@ -246454,7 +246455,7 @@ var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => (function path23(
|
|
|
246454
246455
|
}
|
|
246455
246456
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
246456
246457
|
}, "");
|
|
246457
|
-
const pathOnly =
|
|
246458
|
+
const pathOnly = path25.split(/[?#]/, 1)[0];
|
|
246458
246459
|
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
246459
246460
|
let match;
|
|
246460
246461
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -246478,10 +246479,10 @@ var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => (function path23(
|
|
|
246478
246479
|
}, "");
|
|
246479
246480
|
throw new GeminiNextGenAPIClientError(`Path parameters result in path with invalid segments:
|
|
246480
246481
|
${invalidSegments.map((e3) => e3.error).join("\n")}
|
|
246481
|
-
${
|
|
246482
|
+
${path25}
|
|
246482
246483
|
${underline}`);
|
|
246483
246484
|
}
|
|
246484
|
-
return
|
|
246485
|
+
return path25;
|
|
246485
246486
|
});
|
|
246486
246487
|
var path2 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2);
|
|
246487
246488
|
var BaseInteractions = class extends APIResource3 {
|
|
@@ -247313,9 +247314,9 @@ var BaseGeminiNextGenAPIClient = class _BaseGeminiNextGenAPIClient {
|
|
|
247313
247314
|
makeStatusError(status, error2, message, headers) {
|
|
247314
247315
|
return APIError3.generate(status, error2, message, headers);
|
|
247315
247316
|
}
|
|
247316
|
-
buildURL(
|
|
247317
|
+
buildURL(path24, query, defaultBaseURL) {
|
|
247317
247318
|
const baseURL = !this.baseURLOverridden() && defaultBaseURL || this.baseURL;
|
|
247318
|
-
const url = isAbsoluteURL3(
|
|
247319
|
+
const url = isAbsoluteURL3(path24) ? new URL(path24) : new URL(baseURL + (baseURL.endsWith("/") && path24.startsWith("/") ? path24.slice(1) : path24));
|
|
247319
247320
|
const defaultQuery = this.defaultQuery();
|
|
247320
247321
|
const pathQuery = Object.fromEntries(url.searchParams);
|
|
247321
247322
|
if (!isEmptyObj3(defaultQuery) || !isEmptyObj3(pathQuery)) {
|
|
@@ -247344,24 +247345,24 @@ var BaseGeminiNextGenAPIClient = class _BaseGeminiNextGenAPIClient {
|
|
|
247344
247345
|
*/
|
|
247345
247346
|
async prepareRequest(request, { url, options }) {
|
|
247346
247347
|
}
|
|
247347
|
-
get(
|
|
247348
|
-
return this.methodRequest("get",
|
|
247348
|
+
get(path24, opts) {
|
|
247349
|
+
return this.methodRequest("get", path24, opts);
|
|
247349
247350
|
}
|
|
247350
|
-
post(
|
|
247351
|
-
return this.methodRequest("post",
|
|
247351
|
+
post(path24, opts) {
|
|
247352
|
+
return this.methodRequest("post", path24, opts);
|
|
247352
247353
|
}
|
|
247353
|
-
patch(
|
|
247354
|
-
return this.methodRequest("patch",
|
|
247354
|
+
patch(path24, opts) {
|
|
247355
|
+
return this.methodRequest("patch", path24, opts);
|
|
247355
247356
|
}
|
|
247356
|
-
put(
|
|
247357
|
-
return this.methodRequest("put",
|
|
247357
|
+
put(path24, opts) {
|
|
247358
|
+
return this.methodRequest("put", path24, opts);
|
|
247358
247359
|
}
|
|
247359
|
-
delete(
|
|
247360
|
-
return this.methodRequest("delete",
|
|
247360
|
+
delete(path24, opts) {
|
|
247361
|
+
return this.methodRequest("delete", path24, opts);
|
|
247361
247362
|
}
|
|
247362
|
-
methodRequest(method,
|
|
247363
|
+
methodRequest(method, path24, opts) {
|
|
247363
247364
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
247364
|
-
return Object.assign({ method, path:
|
|
247365
|
+
return Object.assign({ method, path: path24 }, opts2);
|
|
247365
247366
|
}));
|
|
247366
247367
|
}
|
|
247367
247368
|
request(options, remainingRetries = null) {
|
|
@@ -247535,8 +247536,8 @@ var BaseGeminiNextGenAPIClient = class _BaseGeminiNextGenAPIClient {
|
|
|
247535
247536
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
247536
247537
|
var _b, _c, _d;
|
|
247537
247538
|
const options = Object.assign({}, inputOptions);
|
|
247538
|
-
const { method, path:
|
|
247539
|
-
const url = this.buildURL(
|
|
247539
|
+
const { method, path: path24, query, defaultBaseURL } = options;
|
|
247540
|
+
const url = this.buildURL(path24, query, defaultBaseURL);
|
|
247540
247541
|
if ("timeout" in options)
|
|
247541
247542
|
validatePositiveInteger3("timeout", options.timeout);
|
|
247542
247543
|
options.timeout = (_b = options.timeout) !== null && _b !== void 0 ? _b : this.timeout;
|
|
@@ -248630,16 +248631,16 @@ var Tunings = class extends BaseModule {
|
|
|
248630
248631
|
async getInternal(params) {
|
|
248631
248632
|
var _a5, _b, _c, _d;
|
|
248632
248633
|
let response;
|
|
248633
|
-
let
|
|
248634
|
+
let path24 = "";
|
|
248634
248635
|
let queryParams = {};
|
|
248635
248636
|
if (this.apiClient.isVertexAI()) {
|
|
248636
248637
|
const body = getTuningJobParametersToVertex(params);
|
|
248637
|
-
|
|
248638
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
248638
248639
|
queryParams = body["_query"];
|
|
248639
248640
|
delete body["_url"];
|
|
248640
248641
|
delete body["_query"];
|
|
248641
248642
|
response = this.apiClient.request({
|
|
248642
|
-
path:
|
|
248643
|
+
path: path24,
|
|
248643
248644
|
queryParams,
|
|
248644
248645
|
body: JSON.stringify(body),
|
|
248645
248646
|
httpMethod: "GET",
|
|
@@ -248660,12 +248661,12 @@ var Tunings = class extends BaseModule {
|
|
|
248660
248661
|
});
|
|
248661
248662
|
} else {
|
|
248662
248663
|
const body = getTuningJobParametersToMldev(params);
|
|
248663
|
-
|
|
248664
|
+
path24 = formatMap("{name}", body["_url"]);
|
|
248664
248665
|
queryParams = body["_query"];
|
|
248665
248666
|
delete body["_url"];
|
|
248666
248667
|
delete body["_query"];
|
|
248667
248668
|
response = this.apiClient.request({
|
|
248668
|
-
path:
|
|
248669
|
+
path: path24,
|
|
248669
248670
|
queryParams,
|
|
248670
248671
|
body: JSON.stringify(body),
|
|
248671
248672
|
httpMethod: "GET",
|
|
@@ -248689,16 +248690,16 @@ var Tunings = class extends BaseModule {
|
|
|
248689
248690
|
async listInternal(params) {
|
|
248690
248691
|
var _a5, _b;
|
|
248691
248692
|
let response;
|
|
248692
|
-
let
|
|
248693
|
+
let path24 = "";
|
|
248693
248694
|
let queryParams = {};
|
|
248694
248695
|
if (this.apiClient.isVertexAI()) {
|
|
248695
248696
|
const body = listTuningJobsParametersToVertex(params);
|
|
248696
|
-
|
|
248697
|
+
path24 = formatMap("tuningJobs", body["_url"]);
|
|
248697
248698
|
queryParams = body["_query"];
|
|
248698
248699
|
delete body["_url"];
|
|
248699
248700
|
delete body["_query"];
|
|
248700
248701
|
response = this.apiClient.request({
|
|
248701
|
-
path:
|
|
248702
|
+
path: path24,
|
|
248702
248703
|
queryParams,
|
|
248703
248704
|
body: JSON.stringify(body),
|
|
248704
248705
|
httpMethod: "GET",
|
|
@@ -248737,16 +248738,16 @@ var Tunings = class extends BaseModule {
|
|
|
248737
248738
|
async cancel(params) {
|
|
248738
248739
|
var _a5, _b, _c, _d;
|
|
248739
248740
|
let response;
|
|
248740
|
-
let
|
|
248741
|
+
let path24 = "";
|
|
248741
248742
|
let queryParams = {};
|
|
248742
248743
|
if (this.apiClient.isVertexAI()) {
|
|
248743
248744
|
const body = cancelTuningJobParametersToVertex(params);
|
|
248744
|
-
|
|
248745
|
+
path24 = formatMap("{name}:cancel", body["_url"]);
|
|
248745
248746
|
queryParams = body["_query"];
|
|
248746
248747
|
delete body["_url"];
|
|
248747
248748
|
delete body["_query"];
|
|
248748
248749
|
response = this.apiClient.request({
|
|
248749
|
-
path:
|
|
248750
|
+
path: path24,
|
|
248750
248751
|
queryParams,
|
|
248751
248752
|
body: JSON.stringify(body),
|
|
248752
248753
|
httpMethod: "POST",
|
|
@@ -248769,12 +248770,12 @@ var Tunings = class extends BaseModule {
|
|
|
248769
248770
|
});
|
|
248770
248771
|
} else {
|
|
248771
248772
|
const body = cancelTuningJobParametersToMldev(params);
|
|
248772
|
-
|
|
248773
|
+
path24 = formatMap("{name}:cancel", body["_url"]);
|
|
248773
248774
|
queryParams = body["_query"];
|
|
248774
248775
|
delete body["_url"];
|
|
248775
248776
|
delete body["_query"];
|
|
248776
248777
|
response = this.apiClient.request({
|
|
248777
|
-
path:
|
|
248778
|
+
path: path24,
|
|
248778
248779
|
queryParams,
|
|
248779
248780
|
body: JSON.stringify(body),
|
|
248780
248781
|
httpMethod: "POST",
|
|
@@ -248800,16 +248801,16 @@ var Tunings = class extends BaseModule {
|
|
|
248800
248801
|
async tuneInternal(params) {
|
|
248801
248802
|
var _a5, _b;
|
|
248802
248803
|
let response;
|
|
248803
|
-
let
|
|
248804
|
+
let path24 = "";
|
|
248804
248805
|
let queryParams = {};
|
|
248805
248806
|
if (this.apiClient.isVertexAI()) {
|
|
248806
248807
|
const body = createTuningJobParametersPrivateToVertex(params, params);
|
|
248807
|
-
|
|
248808
|
+
path24 = formatMap("tuningJobs", body["_url"]);
|
|
248808
248809
|
queryParams = body["_query"];
|
|
248809
248810
|
delete body["_url"];
|
|
248810
248811
|
delete body["_query"];
|
|
248811
248812
|
response = this.apiClient.request({
|
|
248812
|
-
path:
|
|
248813
|
+
path: path24,
|
|
248813
248814
|
queryParams,
|
|
248814
248815
|
body: JSON.stringify(body),
|
|
248815
248816
|
httpMethod: "POST",
|
|
@@ -248835,18 +248836,18 @@ var Tunings = class extends BaseModule {
|
|
|
248835
248836
|
async tuneMldevInternal(params) {
|
|
248836
248837
|
var _a5, _b;
|
|
248837
248838
|
let response;
|
|
248838
|
-
let
|
|
248839
|
+
let path24 = "";
|
|
248839
248840
|
let queryParams = {};
|
|
248840
248841
|
if (this.apiClient.isVertexAI()) {
|
|
248841
248842
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
248842
248843
|
} else {
|
|
248843
248844
|
const body = createTuningJobParametersPrivateToMldev(params);
|
|
248844
|
-
|
|
248845
|
+
path24 = formatMap("tunedModels", body["_url"]);
|
|
248845
248846
|
queryParams = body["_query"];
|
|
248846
248847
|
delete body["_url"];
|
|
248847
248848
|
delete body["_query"];
|
|
248848
248849
|
response = this.apiClient.request({
|
|
248849
|
-
path:
|
|
248850
|
+
path: path24,
|
|
248850
248851
|
queryParams,
|
|
248851
248852
|
body: JSON.stringify(body),
|
|
248852
248853
|
httpMethod: "POST",
|
|
@@ -249101,7 +249102,7 @@ var NodeUploader = class {
|
|
|
249101
249102
|
let response = new HttpResponse(new Response());
|
|
249102
249103
|
let uploadCommand = "upload";
|
|
249103
249104
|
let fileHandle;
|
|
249104
|
-
const fileName =
|
|
249105
|
+
const fileName = path23__namespace.basename(file);
|
|
249105
249106
|
try {
|
|
249106
249107
|
fileHandle = await fs8__namespace.open(file, "r");
|
|
249107
249108
|
if (!fileHandle) {
|
|
@@ -250474,7 +250475,7 @@ function computeDelegationSavings(stats, t1Model) {
|
|
|
250474
250475
|
var DEFAULT_SNAPSHOT_URL = "https://raw.githubusercontent.com/Varun-SV/Cascade-AI/main/src/core/router/benchmark-data.json";
|
|
250475
250476
|
var OPENROUTER_MODELS_URL = "https://openrouter.ai/api/v1/models";
|
|
250476
250477
|
var FETCH_TIMEOUT_MS = 8e3;
|
|
250477
|
-
var DEFAULT_CACHE_FILE =
|
|
250478
|
+
var DEFAULT_CACHE_FILE = path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR, "benchmarks-cache.json");
|
|
250478
250479
|
function normalizeModelId(id) {
|
|
250479
250480
|
let s3 = id.toLowerCase();
|
|
250480
250481
|
const slash = s3.lastIndexOf("/");
|
|
@@ -250619,7 +250620,7 @@ var LiveDataProvider = class {
|
|
|
250619
250620
|
}
|
|
250620
250621
|
async saveCache() {
|
|
250621
250622
|
try {
|
|
250622
|
-
await fs8__namespace.default.mkdir(
|
|
250623
|
+
await fs8__namespace.default.mkdir(path23__namespace.default.dirname(this.opts.cacheFile), { recursive: true });
|
|
250623
250624
|
const cache = {
|
|
250624
250625
|
fetchedAt: this.fetchedAt,
|
|
250625
250626
|
snapshot: this.snapshot ?? void 0,
|
|
@@ -252522,8 +252523,8 @@ HIERARCHY CONTEXT: ${this.hierarchyContext}` : "") + textToolSuffix,
|
|
|
252522
252523
|
tierId: this.id,
|
|
252523
252524
|
sessionId: this.taskId,
|
|
252524
252525
|
requireApproval: false,
|
|
252525
|
-
saveSnapshot: async (
|
|
252526
|
-
this.store?.addFileSnapshot(this.taskId,
|
|
252526
|
+
saveSnapshot: async (path24, content) => {
|
|
252527
|
+
this.store?.addFileSnapshot(this.taskId, path24, content);
|
|
252527
252528
|
},
|
|
252528
252529
|
sendPeerSync: (to, syncType, content) => {
|
|
252529
252530
|
this.peerBus?.send(this.id, to, syncType, this.assignment?.subtaskId ?? "", content);
|
|
@@ -252693,7 +252694,7 @@ ${assignment.expectedOutput}`;
|
|
|
252693
252694
|
const { promisify: promisify5 } = await import('util');
|
|
252694
252695
|
const execAsync2 = promisify5(exec2);
|
|
252695
252696
|
for (const artifactPath of artifactPaths) {
|
|
252696
|
-
const absolutePath =
|
|
252697
|
+
const absolutePath = path23__namespace.default.resolve(process.cwd(), artifactPath);
|
|
252697
252698
|
try {
|
|
252698
252699
|
const stat3 = await fs8__namespace.default.stat(absolutePath);
|
|
252699
252700
|
if (!stat3.isFile()) {
|
|
@@ -252714,7 +252715,7 @@ ${assignment.expectedOutput}`;
|
|
|
252714
252715
|
issues.push(`PDF artifact looks too small to be valid: ${artifactPath}`);
|
|
252715
252716
|
continue;
|
|
252716
252717
|
}
|
|
252717
|
-
const ext =
|
|
252718
|
+
const ext = path23__namespace.default.extname(absolutePath).toLowerCase();
|
|
252718
252719
|
try {
|
|
252719
252720
|
if (ext === ".ts" || ext === ".tsx") {
|
|
252720
252721
|
await execAsync2(`npx tsc --noEmit ${absolutePath}`, { timeout: 1e4 });
|
|
@@ -254799,16 +254800,16 @@ function resolveInWorkspace(workspaceRoot, input) {
|
|
|
254799
254800
|
if (typeof input !== "string" || input.length === 0) {
|
|
254800
254801
|
throw new WorkspaceSandboxError(String(input), workspaceRoot);
|
|
254801
254802
|
}
|
|
254802
|
-
const root =
|
|
254803
|
-
const abs =
|
|
254804
|
-
const rel =
|
|
254805
|
-
if (rel === "" || rel === ".") ; else if (rel.startsWith("..") ||
|
|
254803
|
+
const root = path23__namespace.default.resolve(workspaceRoot);
|
|
254804
|
+
const abs = path23__namespace.default.isAbsolute(input) ? path23__namespace.default.resolve(input) : path23__namespace.default.resolve(root, input);
|
|
254805
|
+
const rel = path23__namespace.default.relative(root, abs);
|
|
254806
|
+
if (rel === "" || rel === ".") ; else if (rel.startsWith("..") || path23__namespace.default.isAbsolute(rel)) {
|
|
254806
254807
|
throw new WorkspaceSandboxError(input, root);
|
|
254807
254808
|
}
|
|
254808
254809
|
try {
|
|
254809
254810
|
const real = fs11__namespace.default.realpathSync(abs);
|
|
254810
|
-
const realRel =
|
|
254811
|
-
if (realRel !== "" && realRel !== "." && (realRel.startsWith("..") ||
|
|
254811
|
+
const realRel = path23__namespace.default.relative(root, real);
|
|
254812
|
+
if (realRel !== "" && realRel !== "." && (realRel.startsWith("..") || path23__namespace.default.isAbsolute(realRel))) {
|
|
254812
254813
|
throw new WorkspaceSandboxError(input, root);
|
|
254813
254814
|
}
|
|
254814
254815
|
} catch (e3) {
|
|
@@ -254869,7 +254870,7 @@ var FileWriteTool = class extends BaseTool {
|
|
|
254869
254870
|
} catch {
|
|
254870
254871
|
}
|
|
254871
254872
|
}
|
|
254872
|
-
await fs8__namespace.default.mkdir(
|
|
254873
|
+
await fs8__namespace.default.mkdir(path23__namespace.default.dirname(absPath), { recursive: true });
|
|
254873
254874
|
await fs8__namespace.default.writeFile(absPath, content, "utf-8");
|
|
254874
254875
|
return `Written ${content.length} characters to ${filePath}`;
|
|
254875
254876
|
}
|
|
@@ -255541,8 +255542,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
|
|
|
255541
255542
|
function forEachLineWithContent(input, callback) {
|
|
255542
255543
|
return toLinesWithContent(input, true).map((line) => callback(line));
|
|
255543
255544
|
}
|
|
255544
|
-
function folderExists(
|
|
255545
|
-
return (0, import_file_exists.exists)(
|
|
255545
|
+
function folderExists(path24) {
|
|
255546
|
+
return (0, import_file_exists.exists)(path24, import_file_exists.FOLDER);
|
|
255546
255547
|
}
|
|
255547
255548
|
function append(target, item) {
|
|
255548
255549
|
if (Array.isArray(target)) {
|
|
@@ -255935,8 +255936,8 @@ function checkIsRepoRootTask() {
|
|
|
255935
255936
|
commands,
|
|
255936
255937
|
format: "utf-8",
|
|
255937
255938
|
onError,
|
|
255938
|
-
parser(
|
|
255939
|
-
return /^\.(git)?$/.test(
|
|
255939
|
+
parser(path24) {
|
|
255940
|
+
return /^\.(git)?$/.test(path24.trim());
|
|
255940
255941
|
}
|
|
255941
255942
|
};
|
|
255942
255943
|
}
|
|
@@ -256363,11 +256364,11 @@ function parseGrep(grep) {
|
|
|
256363
256364
|
const paths = /* @__PURE__ */ new Set();
|
|
256364
256365
|
const results = {};
|
|
256365
256366
|
forEachLineWithContent(grep, (input) => {
|
|
256366
|
-
const [
|
|
256367
|
-
paths.add(
|
|
256368
|
-
(results[
|
|
256367
|
+
const [path24, line, preview] = input.split(NULL2);
|
|
256368
|
+
paths.add(path24);
|
|
256369
|
+
(results[path24] = results[path24] || []).push({
|
|
256369
256370
|
line: asNumber(line),
|
|
256370
|
-
path:
|
|
256371
|
+
path: path24,
|
|
256371
256372
|
preview
|
|
256372
256373
|
});
|
|
256373
256374
|
});
|
|
@@ -257117,14 +257118,14 @@ var init_hash_object = __esm2({
|
|
|
257117
257118
|
init_task();
|
|
257118
257119
|
}
|
|
257119
257120
|
});
|
|
257120
|
-
function parseInit(bare,
|
|
257121
|
+
function parseInit(bare, path24, text) {
|
|
257121
257122
|
const response = String(text).trim();
|
|
257122
257123
|
let result;
|
|
257123
257124
|
if (result = initResponseRegex.exec(response)) {
|
|
257124
|
-
return new InitSummary(bare,
|
|
257125
|
+
return new InitSummary(bare, path24, false, result[1]);
|
|
257125
257126
|
}
|
|
257126
257127
|
if (result = reInitResponseRegex.exec(response)) {
|
|
257127
|
-
return new InitSummary(bare,
|
|
257128
|
+
return new InitSummary(bare, path24, true, result[1]);
|
|
257128
257129
|
}
|
|
257129
257130
|
let gitDir = "";
|
|
257130
257131
|
const tokens = response.split(" ");
|
|
@@ -257135,7 +257136,7 @@ function parseInit(bare, path23, text) {
|
|
|
257135
257136
|
break;
|
|
257136
257137
|
}
|
|
257137
257138
|
}
|
|
257138
|
-
return new InitSummary(bare,
|
|
257139
|
+
return new InitSummary(bare, path24, /^re/i.test(response), gitDir);
|
|
257139
257140
|
}
|
|
257140
257141
|
var InitSummary;
|
|
257141
257142
|
var initResponseRegex;
|
|
@@ -257143,9 +257144,9 @@ var reInitResponseRegex;
|
|
|
257143
257144
|
var init_InitSummary = __esm2({
|
|
257144
257145
|
"src/lib/responses/InitSummary.ts"() {
|
|
257145
257146
|
InitSummary = class {
|
|
257146
|
-
constructor(bare,
|
|
257147
|
+
constructor(bare, path24, existing, gitDir) {
|
|
257147
257148
|
this.bare = bare;
|
|
257148
|
-
this.path =
|
|
257149
|
+
this.path = path24;
|
|
257149
257150
|
this.existing = existing;
|
|
257150
257151
|
this.gitDir = gitDir;
|
|
257151
257152
|
}
|
|
@@ -257157,7 +257158,7 @@ var init_InitSummary = __esm2({
|
|
|
257157
257158
|
function hasBareCommand(command) {
|
|
257158
257159
|
return command.includes(bareCommand);
|
|
257159
257160
|
}
|
|
257160
|
-
function initTask(bare = false,
|
|
257161
|
+
function initTask(bare = false, path24, customArgs) {
|
|
257161
257162
|
const commands = ["init", ...customArgs];
|
|
257162
257163
|
if (bare && !hasBareCommand(commands)) {
|
|
257163
257164
|
commands.splice(1, 0, bareCommand);
|
|
@@ -257166,7 +257167,7 @@ function initTask(bare = false, path23, customArgs) {
|
|
|
257166
257167
|
commands,
|
|
257167
257168
|
format: "utf-8",
|
|
257168
257169
|
parser(text) {
|
|
257169
|
-
return parseInit(commands.includes("--bare"),
|
|
257170
|
+
return parseInit(commands.includes("--bare"), path24, text);
|
|
257170
257171
|
}
|
|
257171
257172
|
};
|
|
257172
257173
|
}
|
|
@@ -257963,12 +257964,12 @@ var init_FileStatusSummary = __esm2({
|
|
|
257963
257964
|
"src/lib/responses/FileStatusSummary.ts"() {
|
|
257964
257965
|
fromPathRegex = /^(.+)\0(.+)$/;
|
|
257965
257966
|
FileStatusSummary = class {
|
|
257966
|
-
constructor(
|
|
257967
|
-
this.path =
|
|
257967
|
+
constructor(path24, index, working_dir) {
|
|
257968
|
+
this.path = path24;
|
|
257968
257969
|
this.index = index;
|
|
257969
257970
|
this.working_dir = working_dir;
|
|
257970
257971
|
if (index === "R" || working_dir === "R") {
|
|
257971
|
-
const detail = fromPathRegex.exec(
|
|
257972
|
+
const detail = fromPathRegex.exec(path24) || [null, path24, path24];
|
|
257972
257973
|
this.from = detail[2] || "";
|
|
257973
257974
|
this.path = detail[1] || "";
|
|
257974
257975
|
}
|
|
@@ -257999,14 +258000,14 @@ function splitLine(result, lineStr) {
|
|
|
257999
258000
|
default:
|
|
258000
258001
|
return;
|
|
258001
258002
|
}
|
|
258002
|
-
function data(index, workingDir,
|
|
258003
|
+
function data(index, workingDir, path24) {
|
|
258003
258004
|
const raw = `${index}${workingDir}`;
|
|
258004
258005
|
const handler = parsers6.get(raw);
|
|
258005
258006
|
if (handler) {
|
|
258006
|
-
handler(result,
|
|
258007
|
+
handler(result, path24);
|
|
258007
258008
|
}
|
|
258008
258009
|
if (raw !== "##" && raw !== "!!") {
|
|
258009
|
-
result.files.push(new FileStatusSummary(
|
|
258010
|
+
result.files.push(new FileStatusSummary(path24, index, workingDir));
|
|
258010
258011
|
}
|
|
258011
258012
|
}
|
|
258012
258013
|
}
|
|
@@ -258352,9 +258353,9 @@ var init_simple_git_api = __esm2({
|
|
|
258352
258353
|
next
|
|
258353
258354
|
);
|
|
258354
258355
|
}
|
|
258355
|
-
hashObject(
|
|
258356
|
+
hashObject(path24, write) {
|
|
258356
258357
|
return this._runTask(
|
|
258357
|
-
hashObjectTask(
|
|
258358
|
+
hashObjectTask(path24, write === true),
|
|
258358
258359
|
trailingFunctionArgument(arguments)
|
|
258359
258360
|
);
|
|
258360
258361
|
}
|
|
@@ -258701,8 +258702,8 @@ var init_branch = __esm2({
|
|
|
258701
258702
|
}
|
|
258702
258703
|
});
|
|
258703
258704
|
function toPath(input) {
|
|
258704
|
-
const
|
|
258705
|
-
return
|
|
258705
|
+
const path24 = input.trim().replace(/^["']|["']$/g, "");
|
|
258706
|
+
return path24 && path23.normalize(path24);
|
|
258706
258707
|
}
|
|
258707
258708
|
var parseCheckIgnore;
|
|
258708
258709
|
var init_CheckIgnore = __esm2({
|
|
@@ -258977,8 +258978,8 @@ __export2(sub_module_exports, {
|
|
|
258977
258978
|
subModuleTask: () => subModuleTask,
|
|
258978
258979
|
updateSubModuleTask: () => updateSubModuleTask
|
|
258979
258980
|
});
|
|
258980
|
-
function addSubModuleTask(repo,
|
|
258981
|
-
return subModuleTask(["add", repo,
|
|
258981
|
+
function addSubModuleTask(repo, path24) {
|
|
258982
|
+
return subModuleTask(["add", repo, path24]);
|
|
258982
258983
|
}
|
|
258983
258984
|
function initSubModuleTask(customArgs) {
|
|
258984
258985
|
return subModuleTask(["init", ...customArgs]);
|
|
@@ -259288,8 +259289,8 @@ var require_git = __commonJS2({
|
|
|
259288
259289
|
}
|
|
259289
259290
|
return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
|
|
259290
259291
|
};
|
|
259291
|
-
Git2.prototype.submoduleAdd = function(repo,
|
|
259292
|
-
return this._runTask(addSubModuleTask2(repo,
|
|
259292
|
+
Git2.prototype.submoduleAdd = function(repo, path24, then) {
|
|
259293
|
+
return this._runTask(addSubModuleTask2(repo, path24), trailingFunctionArgument2(arguments));
|
|
259293
259294
|
};
|
|
259294
259295
|
Git2.prototype.submoduleUpdate = function(args, then) {
|
|
259295
259296
|
return this._runTask(
|
|
@@ -260249,7 +260250,7 @@ var ImageAnalyzeTool = class extends BaseTool {
|
|
|
260249
260250
|
};
|
|
260250
260251
|
async function fileToImageAttachment(filePath) {
|
|
260251
260252
|
const data = await fs8__namespace.default.readFile(filePath);
|
|
260252
|
-
const ext =
|
|
260253
|
+
const ext = path23__namespace.default.extname(filePath).toLowerCase();
|
|
260253
260254
|
const mimeMap = {
|
|
260254
260255
|
".jpg": "image/jpeg",
|
|
260255
260256
|
".jpeg": "image/jpeg",
|
|
@@ -271543,16 +271544,16 @@ var $f43aec954cdfdf21$export$2e2bcd8739ae039 = class _$f43aec954cdfdf21$export$2
|
|
|
271543
271544
|
* @return {Path}
|
|
271544
271545
|
*/
|
|
271545
271546
|
mapPoints(fn) {
|
|
271546
|
-
let
|
|
271547
|
+
let path24 = new _$f43aec954cdfdf21$export$2e2bcd8739ae039();
|
|
271547
271548
|
for (let c4 of this.commands) {
|
|
271548
271549
|
let args = [];
|
|
271549
271550
|
for (let i4 = 0; i4 < c4.args.length; i4 += 2) {
|
|
271550
271551
|
let [x5, y3] = fn(c4.args[i4], c4.args[i4 + 1]);
|
|
271551
271552
|
args.push(x5, y3);
|
|
271552
271553
|
}
|
|
271553
|
-
|
|
271554
|
+
path24[c4.command](...args);
|
|
271554
271555
|
}
|
|
271555
|
-
return
|
|
271556
|
+
return path24;
|
|
271556
271557
|
}
|
|
271557
271558
|
/**
|
|
271558
271559
|
* Transforms the path by the given matrix.
|
|
@@ -272245,7 +272246,7 @@ var $69aac16029968692$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272245
272246
|
// Converts contours to a Path object that can be rendered
|
|
272246
272247
|
_getPath() {
|
|
272247
272248
|
let contours = this._getContours();
|
|
272248
|
-
let
|
|
272249
|
+
let path24 = new ($f43aec954cdfdf21$export$2e2bcd8739ae039)();
|
|
272249
272250
|
for (let i4 = 0; i4 < contours.length; i4++) {
|
|
272250
272251
|
let contour = contours[i4];
|
|
272251
272252
|
let firstPt = contour[0];
|
|
@@ -272261,26 +272262,26 @@ var $69aac16029968692$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272261
272262
|
firstPt = new $69aac16029968692$export$baf26146a414f24a(false, false, (firstPt.x + lastPt.x) / 2, (firstPt.y + lastPt.y) / 2);
|
|
272262
272263
|
var curvePt = firstPt;
|
|
272263
272264
|
}
|
|
272264
|
-
|
|
272265
|
+
path24.moveTo(firstPt.x, firstPt.y);
|
|
272265
272266
|
for (let j4 = start; j4 < contour.length; j4++) {
|
|
272266
272267
|
let pt3 = contour[j4];
|
|
272267
272268
|
let prevPt = j4 === 0 ? firstPt : contour[j4 - 1];
|
|
272268
|
-
if (prevPt.onCurve && pt3.onCurve)
|
|
272269
|
+
if (prevPt.onCurve && pt3.onCurve) path24.lineTo(pt3.x, pt3.y);
|
|
272269
272270
|
else if (prevPt.onCurve && !pt3.onCurve) var curvePt = pt3;
|
|
272270
272271
|
else if (!prevPt.onCurve && !pt3.onCurve) {
|
|
272271
272272
|
let midX = (prevPt.x + pt3.x) / 2;
|
|
272272
272273
|
let midY = (prevPt.y + pt3.y) / 2;
|
|
272273
|
-
|
|
272274
|
+
path24.quadraticCurveTo(prevPt.x, prevPt.y, midX, midY);
|
|
272274
272275
|
var curvePt = pt3;
|
|
272275
272276
|
} else if (!prevPt.onCurve && pt3.onCurve) {
|
|
272276
|
-
|
|
272277
|
+
path24.quadraticCurveTo(curvePt.x, curvePt.y, pt3.x, pt3.y);
|
|
272277
272278
|
var curvePt = null;
|
|
272278
272279
|
} else throw new Error("Unknown TTF path state");
|
|
272279
272280
|
}
|
|
272280
|
-
if (curvePt)
|
|
272281
|
-
|
|
272281
|
+
if (curvePt) path24.quadraticCurveTo(curvePt.x, curvePt.y, firstPt.x, firstPt.y);
|
|
272282
|
+
path24.closePath();
|
|
272282
272283
|
}
|
|
272283
|
-
return
|
|
272284
|
+
return path24;
|
|
272284
272285
|
}
|
|
272285
272286
|
constructor(...args) {
|
|
272286
272287
|
super(...args);
|
|
@@ -272303,7 +272304,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272303
272304
|
let str2 = cff.topDict.CharStrings[this.id];
|
|
272304
272305
|
let end = str2.offset + str2.length;
|
|
272305
272306
|
stream2.pos = str2.offset;
|
|
272306
|
-
let
|
|
272307
|
+
let path24 = new ($f43aec954cdfdf21$export$2e2bcd8739ae039)();
|
|
272307
272308
|
let stack = [];
|
|
272308
272309
|
let trans = [];
|
|
272309
272310
|
let width = null;
|
|
@@ -272331,8 +272332,8 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272331
272332
|
return stack.length = 0;
|
|
272332
272333
|
}
|
|
272333
272334
|
function moveTo(x6, y4) {
|
|
272334
|
-
if (open2)
|
|
272335
|
-
|
|
272335
|
+
if (open2) path24.closePath();
|
|
272336
|
+
path24.moveTo(x6, y4);
|
|
272336
272337
|
open2 = true;
|
|
272337
272338
|
}
|
|
272338
272339
|
let parse5 = function() {
|
|
@@ -272359,7 +272360,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272359
272360
|
while (stack.length >= 2) {
|
|
272360
272361
|
x5 += stack.shift();
|
|
272361
272362
|
y3 += stack.shift();
|
|
272362
|
-
|
|
272363
|
+
path24.lineTo(x5, y3);
|
|
272363
272364
|
}
|
|
272364
272365
|
break;
|
|
272365
272366
|
case 6:
|
|
@@ -272368,7 +272369,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272368
272369
|
while (stack.length >= 1) {
|
|
272369
272370
|
if (phase) x5 += stack.shift();
|
|
272370
272371
|
else y3 += stack.shift();
|
|
272371
|
-
|
|
272372
|
+
path24.lineTo(x5, y3);
|
|
272372
272373
|
phase = !phase;
|
|
272373
272374
|
}
|
|
272374
272375
|
break;
|
|
@@ -272380,7 +272381,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272380
272381
|
c2y = c1y + stack.shift();
|
|
272381
272382
|
x5 = c2x + stack.shift();
|
|
272382
272383
|
y3 = c2y + stack.shift();
|
|
272383
|
-
|
|
272384
|
+
path24.bezierCurveTo(c1x, c1y, c2x, c2y, x5, y3);
|
|
272384
272385
|
}
|
|
272385
272386
|
break;
|
|
272386
272387
|
case 10:
|
|
@@ -272404,7 +272405,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272404
272405
|
if (cff.version >= 2) break;
|
|
272405
272406
|
if (stack.length > 0) checkWidth();
|
|
272406
272407
|
if (open2) {
|
|
272407
|
-
|
|
272408
|
+
path24.closePath();
|
|
272408
272409
|
open2 = false;
|
|
272409
272410
|
}
|
|
272410
272411
|
break;
|
|
@@ -272452,17 +272453,17 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272452
272453
|
c2y = c1y + stack.shift();
|
|
272453
272454
|
x5 = c2x + stack.shift();
|
|
272454
272455
|
y3 = c2y + stack.shift();
|
|
272455
|
-
|
|
272456
|
+
path24.bezierCurveTo(c1x, c1y, c2x, c2y, x5, y3);
|
|
272456
272457
|
}
|
|
272457
272458
|
x5 += stack.shift();
|
|
272458
272459
|
y3 += stack.shift();
|
|
272459
|
-
|
|
272460
|
+
path24.lineTo(x5, y3);
|
|
272460
272461
|
break;
|
|
272461
272462
|
case 25:
|
|
272462
272463
|
while (stack.length >= 8) {
|
|
272463
272464
|
x5 += stack.shift();
|
|
272464
272465
|
y3 += stack.shift();
|
|
272465
|
-
|
|
272466
|
+
path24.lineTo(x5, y3);
|
|
272466
272467
|
}
|
|
272467
272468
|
c1x = x5 + stack.shift();
|
|
272468
272469
|
c1y = y3 + stack.shift();
|
|
@@ -272470,7 +272471,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272470
272471
|
c2y = c1y + stack.shift();
|
|
272471
272472
|
x5 = c2x + stack.shift();
|
|
272472
272473
|
y3 = c2y + stack.shift();
|
|
272473
|
-
|
|
272474
|
+
path24.bezierCurveTo(c1x, c1y, c2x, c2y, x5, y3);
|
|
272474
272475
|
break;
|
|
272475
272476
|
case 26:
|
|
272476
272477
|
if (stack.length % 2) x5 += stack.shift();
|
|
@@ -272481,7 +272482,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272481
272482
|
c2y = c1y + stack.shift();
|
|
272482
272483
|
x5 = c2x;
|
|
272483
272484
|
y3 = c2y + stack.shift();
|
|
272484
|
-
|
|
272485
|
+
path24.bezierCurveTo(c1x, c1y, c2x, c2y, x5, y3);
|
|
272485
272486
|
}
|
|
272486
272487
|
break;
|
|
272487
272488
|
case 27:
|
|
@@ -272493,7 +272494,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272493
272494
|
c2y = c1y + stack.shift();
|
|
272494
272495
|
x5 = c2x + stack.shift();
|
|
272495
272496
|
y3 = c2y;
|
|
272496
|
-
|
|
272497
|
+
path24.bezierCurveTo(c1x, c1y, c2x, c2y, x5, y3);
|
|
272497
272498
|
}
|
|
272498
272499
|
break;
|
|
272499
272500
|
case 28:
|
|
@@ -272532,7 +272533,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272532
272533
|
x5 = c2x + stack.shift();
|
|
272533
272534
|
y3 = c2y + (stack.length === 1 ? stack.shift() : 0);
|
|
272534
272535
|
}
|
|
272535
|
-
|
|
272536
|
+
path24.bezierCurveTo(c1x, c1y, c2x, c2y, x5, y3);
|
|
272536
272537
|
phase = !phase;
|
|
272537
272538
|
}
|
|
272538
272539
|
break;
|
|
@@ -272658,8 +272659,8 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272658
272659
|
c6y = c5y;
|
|
272659
272660
|
x5 = c6x;
|
|
272660
272661
|
y3 = c6y;
|
|
272661
|
-
|
|
272662
|
-
|
|
272662
|
+
path24.bezierCurveTo(c1x, c1y, c2x, c2y, c3x, c3y);
|
|
272663
|
+
path24.bezierCurveTo(c4x, c4y, c5x, c5y, c6x, c6y);
|
|
272663
272664
|
break;
|
|
272664
272665
|
case 35:
|
|
272665
272666
|
pts = [];
|
|
@@ -272668,8 +272669,8 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272668
272669
|
y3 += stack.shift();
|
|
272669
272670
|
pts.push(x5, y3);
|
|
272670
272671
|
}
|
|
272671
|
-
|
|
272672
|
-
|
|
272672
|
+
path24.bezierCurveTo(...pts.slice(0, 6));
|
|
272673
|
+
path24.bezierCurveTo(...pts.slice(6));
|
|
272673
272674
|
stack.shift();
|
|
272674
272675
|
break;
|
|
272675
272676
|
case 36:
|
|
@@ -272687,8 +272688,8 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272687
272688
|
c6y = c5y;
|
|
272688
272689
|
x5 = c6x;
|
|
272689
272690
|
y3 = c6y;
|
|
272690
|
-
|
|
272691
|
-
|
|
272691
|
+
path24.bezierCurveTo(c1x, c1y, c2x, c2y, c3x, c3y);
|
|
272692
|
+
path24.bezierCurveTo(c4x, c4y, c5x, c5y, c6x, c6y);
|
|
272692
272693
|
break;
|
|
272693
272694
|
case 37:
|
|
272694
272695
|
let startx = x5;
|
|
@@ -272707,8 +272708,8 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272707
272708
|
y3 += stack.shift();
|
|
272708
272709
|
}
|
|
272709
272710
|
pts.push(x5, y3);
|
|
272710
|
-
|
|
272711
|
-
|
|
272711
|
+
path24.bezierCurveTo(...pts.slice(0, 6));
|
|
272712
|
+
path24.bezierCurveTo(...pts.slice(6));
|
|
272712
272713
|
break;
|
|
272713
272714
|
default:
|
|
272714
272715
|
throw new Error(`Unknown op: 12 ${op}`);
|
|
@@ -272728,8 +272729,8 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends ($f92906be28e61769$
|
|
|
272728
272729
|
}
|
|
272729
272730
|
};
|
|
272730
272731
|
parse5();
|
|
272731
|
-
if (open2)
|
|
272732
|
-
return
|
|
272732
|
+
if (open2) path24.closePath();
|
|
272733
|
+
return path24;
|
|
272733
272734
|
}
|
|
272734
272735
|
constructor(...args) {
|
|
272735
272736
|
super(...args);
|
|
@@ -273189,7 +273190,7 @@ var $807e58506be70005$var$Glyf = new Struct({
|
|
|
273189
273190
|
yPoints: new ArrayT($807e58506be70005$var$Point, 0)
|
|
273190
273191
|
});
|
|
273191
273192
|
var $807e58506be70005$export$2e2bcd8739ae039 = class {
|
|
273192
|
-
encodeSimple(
|
|
273193
|
+
encodeSimple(path24, instructions = []) {
|
|
273193
273194
|
let endPtsOfContours = [];
|
|
273194
273195
|
let xPoints = [];
|
|
273195
273196
|
let yPoints = [];
|
|
@@ -273197,14 +273198,14 @@ var $807e58506be70005$export$2e2bcd8739ae039 = class {
|
|
|
273197
273198
|
let same = 0;
|
|
273198
273199
|
let lastX = 0, lastY = 0, lastFlag = 0;
|
|
273199
273200
|
let pointCount = 0;
|
|
273200
|
-
for (let i4 = 0; i4 <
|
|
273201
|
-
let c4 =
|
|
273201
|
+
for (let i4 = 0; i4 < path24.commands.length; i4++) {
|
|
273202
|
+
let c4 = path24.commands[i4];
|
|
273202
273203
|
for (let j4 = 0; j4 < c4.args.length; j4 += 2) {
|
|
273203
273204
|
let x5 = c4.args[j4];
|
|
273204
273205
|
let y3 = c4.args[j4 + 1];
|
|
273205
273206
|
let flag = 0;
|
|
273206
273207
|
if (c4.command === "quadraticCurveTo" && j4 === 2) {
|
|
273207
|
-
let next =
|
|
273208
|
+
let next = path24.commands[i4 + 1];
|
|
273208
273209
|
if (next && next.command === "quadraticCurveTo") {
|
|
273209
273210
|
let midX = (lastX + next.args[0]) / 2;
|
|
273210
273211
|
let midY = (lastY + next.args[1]) / 2;
|
|
@@ -273231,8 +273232,8 @@ var $807e58506be70005$export$2e2bcd8739ae039 = class {
|
|
|
273231
273232
|
}
|
|
273232
273233
|
if (c4.command === "closePath") endPtsOfContours.push(pointCount - 1);
|
|
273233
273234
|
}
|
|
273234
|
-
if (
|
|
273235
|
-
let bbox =
|
|
273235
|
+
if (path24.commands.length > 1 && path24.commands[path24.commands.length - 1].command !== "closePath") endPtsOfContours.push(pointCount - 1);
|
|
273236
|
+
let bbox = path24.bbox;
|
|
273236
273237
|
let glyf = {
|
|
273237
273238
|
numberOfContours: endPtsOfContours.length,
|
|
273238
273239
|
xMin: bbox.minX,
|
|
@@ -275691,17 +275692,17 @@ var $557adaaeb0c7885f$var$LineBreaker = class {
|
|
|
275691
275692
|
};
|
|
275692
275693
|
$557adaaeb0c7885f$exports = $557adaaeb0c7885f$var$LineBreaker;
|
|
275693
275694
|
var PNG = class _PNG {
|
|
275694
|
-
static decode(
|
|
275695
|
+
static decode(path24, fn) {
|
|
275695
275696
|
{
|
|
275696
|
-
return fs11__namespace.default.readFile(
|
|
275697
|
+
return fs11__namespace.default.readFile(path24, function(err, file) {
|
|
275697
275698
|
const png = new _PNG(file);
|
|
275698
275699
|
return png.decode((pixels) => fn(pixels));
|
|
275699
275700
|
});
|
|
275700
275701
|
}
|
|
275701
275702
|
}
|
|
275702
|
-
static load(
|
|
275703
|
+
static load(path24) {
|
|
275703
275704
|
{
|
|
275704
|
-
const file = fs11__namespace.default.readFileSync(
|
|
275705
|
+
const file = fs11__namespace.default.readFileSync(path24);
|
|
275705
275706
|
return new _PNG(file);
|
|
275706
275707
|
}
|
|
275707
275708
|
}
|
|
@@ -277572,15 +277573,15 @@ var readNumber = function(string3, cursor) {
|
|
|
277572
277573
|
}
|
|
277573
277574
|
return [i4 - 1, number4];
|
|
277574
277575
|
};
|
|
277575
|
-
var parse = function(
|
|
277576
|
+
var parse = function(path24) {
|
|
277576
277577
|
const pathData = [];
|
|
277577
277578
|
let command = null;
|
|
277578
277579
|
let args = [];
|
|
277579
277580
|
let argsCount = 0;
|
|
277580
277581
|
let canHaveComma = false;
|
|
277581
277582
|
let hadComma = false;
|
|
277582
|
-
for (let i4 = 0; i4 <
|
|
277583
|
-
const c4 =
|
|
277583
|
+
for (let i4 = 0; i4 < path24.length; i4 += 1) {
|
|
277584
|
+
const c4 = path24.charAt(i4);
|
|
277584
277585
|
if (isWsp(c4)) {
|
|
277585
277586
|
continue;
|
|
277586
277587
|
}
|
|
@@ -277625,11 +277626,11 @@ var parse = function(path23) {
|
|
|
277625
277626
|
const position = args.length;
|
|
277626
277627
|
if (position === 0 || position === 1) {
|
|
277627
277628
|
if (c4 !== "+" && c4 !== "-") {
|
|
277628
|
-
[newCursor, number4] = readNumber(
|
|
277629
|
+
[newCursor, number4] = readNumber(path24, i4);
|
|
277629
277630
|
}
|
|
277630
277631
|
}
|
|
277631
277632
|
if (position === 2 || position === 5 || position === 6) {
|
|
277632
|
-
[newCursor, number4] = readNumber(
|
|
277633
|
+
[newCursor, number4] = readNumber(path24, i4);
|
|
277633
277634
|
}
|
|
277634
277635
|
if (position === 3 || position === 4) {
|
|
277635
277636
|
if (c4 === "0") {
|
|
@@ -277640,7 +277641,7 @@ var parse = function(path23) {
|
|
|
277640
277641
|
}
|
|
277641
277642
|
}
|
|
277642
277643
|
} else {
|
|
277643
|
-
[newCursor, number4] = readNumber(
|
|
277644
|
+
[newCursor, number4] = readNumber(path24, i4);
|
|
277644
277645
|
}
|
|
277645
277646
|
if (number4 == null) {
|
|
277646
277647
|
return pathData;
|
|
@@ -277896,8 +277897,8 @@ var segmentToBezier = function(cx2, cy2, th0, th1, rx, ry, sin_th, cos_th) {
|
|
|
277896
277897
|
return [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x22 + a01 * y22, a10 * x22 + a11 * y22, a00 * x32 + a01 * y3, a10 * x32 + a11 * y3];
|
|
277897
277898
|
};
|
|
277898
277899
|
var SVGPath = class {
|
|
277899
|
-
static apply(doc,
|
|
277900
|
-
const commands = parse(
|
|
277900
|
+
static apply(doc, path24) {
|
|
277901
|
+
const commands = parse(path24);
|
|
277901
277902
|
apply(commands, doc);
|
|
277902
277903
|
}
|
|
277903
277904
|
};
|
|
@@ -278065,8 +278066,8 @@ var VectorMixin = {
|
|
|
278065
278066
|
}
|
|
278066
278067
|
return this.closePath();
|
|
278067
278068
|
},
|
|
278068
|
-
path(
|
|
278069
|
-
SVGPath.apply(this,
|
|
278069
|
+
path(path24) {
|
|
278070
|
+
SVGPath.apply(this, path24);
|
|
278070
278071
|
return this;
|
|
278071
278072
|
},
|
|
278072
278073
|
_windingRule(rule) {
|
|
@@ -282287,7 +282288,7 @@ var PDFCreateTool = class extends BaseTool {
|
|
|
282287
282288
|
const filePath = input["path"];
|
|
282288
282289
|
const content = input["content"];
|
|
282289
282290
|
const title = input["title"];
|
|
282290
|
-
const dir =
|
|
282291
|
+
const dir = path23__namespace.default.dirname(filePath);
|
|
282291
282292
|
if (!fs11__namespace.default.existsSync(dir)) {
|
|
282292
282293
|
fs11__namespace.default.mkdirSync(dir, { recursive: true });
|
|
282293
282294
|
}
|
|
@@ -282372,13 +282373,13 @@ var CodeInterpreterTool = class extends BaseTool {
|
|
|
282372
282373
|
}
|
|
282373
282374
|
cmdPrefix = NODE_CMD;
|
|
282374
282375
|
}
|
|
282375
|
-
const tmpDir =
|
|
282376
|
+
const tmpDir = path23__namespace.default.join(this.workspaceRoot, ".cascade", "tmp");
|
|
282376
282377
|
if (!fs11__namespace.default.existsSync(tmpDir)) {
|
|
282377
282378
|
fs11__namespace.default.mkdirSync(tmpDir, { recursive: true });
|
|
282378
282379
|
}
|
|
282379
282380
|
const extension2 = language === "python" ? "py" : "js";
|
|
282380
282381
|
const fileName = `intp_${crypto4.randomUUID().slice(0, 8)}.${extension2}`;
|
|
282381
|
-
const filePath =
|
|
282382
|
+
const filePath = path23__namespace.default.join(tmpDir, fileName);
|
|
282382
282383
|
fs11__namespace.default.writeFileSync(filePath, code, "utf-8");
|
|
282383
282384
|
const execArgs = [filePath, ...args];
|
|
282384
282385
|
return new Promise((resolve) => {
|
|
@@ -282666,7 +282667,7 @@ var GlobTool = class extends BaseTool {
|
|
|
282666
282667
|
};
|
|
282667
282668
|
async execute(input, _options) {
|
|
282668
282669
|
const pattern2 = input["pattern"];
|
|
282669
|
-
const searchPath = input["path"] ?
|
|
282670
|
+
const searchPath = input["path"] ? path23__namespace.default.resolve(this.workspaceRoot, input["path"]) : this.workspaceRoot;
|
|
282670
282671
|
const matches = await Ze(pattern2, {
|
|
282671
282672
|
cwd: searchPath,
|
|
282672
282673
|
ignore: ["node_modules/**", ".git/**", "dist/**", "build/**"],
|
|
@@ -282679,7 +282680,7 @@ var GlobTool = class extends BaseTool {
|
|
|
282679
282680
|
const withMtime = await Promise.all(
|
|
282680
282681
|
matches.map(async (rel) => {
|
|
282681
282682
|
try {
|
|
282682
|
-
const stat3 = await fs8__namespace.default.stat(
|
|
282683
|
+
const stat3 = await fs8__namespace.default.stat(path23__namespace.default.join(searchPath, rel));
|
|
282683
282684
|
return { rel, mtime: stat3.mtimeMs };
|
|
282684
282685
|
} catch {
|
|
282685
282686
|
return { rel, mtime: 0 };
|
|
@@ -282728,7 +282729,7 @@ var GrepTool = class extends BaseTool {
|
|
|
282728
282729
|
};
|
|
282729
282730
|
async execute(input, _options) {
|
|
282730
282731
|
const pattern2 = input["pattern"];
|
|
282731
|
-
const searchPath = input["path"] ?
|
|
282732
|
+
const searchPath = input["path"] ? path23__namespace.default.resolve(this.workspaceRoot, input["path"]) : this.workspaceRoot;
|
|
282732
282733
|
const globPattern = input["glob"];
|
|
282733
282734
|
const outputMode = input["output_mode"] ?? "content";
|
|
282734
282735
|
const context = input["context"] ?? 0;
|
|
@@ -282782,12 +282783,12 @@ var GrepTool = class extends BaseTool {
|
|
|
282782
282783
|
nodir: true
|
|
282783
282784
|
});
|
|
282784
282785
|
} catch {
|
|
282785
|
-
files = [
|
|
282786
|
+
files = [path23__namespace.default.relative(searchPath, searchPath) || "."];
|
|
282786
282787
|
}
|
|
282787
282788
|
const results = [];
|
|
282788
282789
|
let totalCount = 0;
|
|
282789
282790
|
for (const rel of files) {
|
|
282790
|
-
const abs =
|
|
282791
|
+
const abs = path23__namespace.default.join(searchPath, rel);
|
|
282791
282792
|
let content;
|
|
282792
282793
|
try {
|
|
282793
282794
|
content = await fs8__namespace.default.readFile(abs, "utf-8");
|
|
@@ -283149,10 +283150,10 @@ var ToolRegistry = class extends EventEmitter__default.default {
|
|
|
283149
283150
|
}
|
|
283150
283151
|
isIgnored(filePath) {
|
|
283151
283152
|
if (!filePath) return false;
|
|
283152
|
-
const abs =
|
|
283153
|
-
const rel =
|
|
283154
|
-
if (!rel || rel.startsWith("..") ||
|
|
283155
|
-
const posixRel = rel.split(
|
|
283153
|
+
const abs = path23__namespace.default.resolve(this.workspaceRoot, filePath);
|
|
283154
|
+
const rel = path23__namespace.default.relative(this.workspaceRoot, abs);
|
|
283155
|
+
if (!rel || rel.startsWith("..") || path23__namespace.default.isAbsolute(rel)) return true;
|
|
283156
|
+
const posixRel = rel.split(path23__namespace.default.sep).join("/");
|
|
283156
283157
|
return this.ignoreMatcher.ignores(posixRel);
|
|
283157
283158
|
}
|
|
283158
283159
|
};
|
|
@@ -283635,8 +283636,8 @@ function getErrorMap() {
|
|
|
283635
283636
|
|
|
283636
283637
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
283637
283638
|
var makeIssue = (params) => {
|
|
283638
|
-
const { data, path:
|
|
283639
|
-
const fullPath = [...
|
|
283639
|
+
const { data, path: path24, errorMaps, issueData } = params;
|
|
283640
|
+
const fullPath = [...path24, ...issueData.path || []];
|
|
283640
283641
|
const fullIssue = {
|
|
283641
283642
|
...issueData,
|
|
283642
283643
|
path: fullPath
|
|
@@ -283752,11 +283753,11 @@ var errorUtil;
|
|
|
283752
283753
|
|
|
283753
283754
|
// node_modules/zod/v3/types.js
|
|
283754
283755
|
var ParseInputLazyPath = class {
|
|
283755
|
-
constructor(parent, value,
|
|
283756
|
+
constructor(parent, value, path24, key) {
|
|
283756
283757
|
this._cachedPath = [];
|
|
283757
283758
|
this.parent = parent;
|
|
283758
283759
|
this.data = value;
|
|
283759
|
-
this._path =
|
|
283760
|
+
this._path = path24;
|
|
283760
283761
|
this._key = key;
|
|
283761
283762
|
}
|
|
283762
283763
|
get path() {
|
|
@@ -287383,10 +287384,10 @@ function assignProp(target, prop, value) {
|
|
|
287383
287384
|
configurable: true
|
|
287384
287385
|
});
|
|
287385
287386
|
}
|
|
287386
|
-
function getElementAtPath(obj,
|
|
287387
|
-
if (!
|
|
287387
|
+
function getElementAtPath(obj, path24) {
|
|
287388
|
+
if (!path24)
|
|
287388
287389
|
return obj;
|
|
287389
|
-
return
|
|
287390
|
+
return path24.reduce((acc, key) => acc?.[key], obj);
|
|
287390
287391
|
}
|
|
287391
287392
|
function promiseAllObject(promisesObj) {
|
|
287392
287393
|
const keys = Object.keys(promisesObj);
|
|
@@ -287706,11 +287707,11 @@ function aborted(x5, startIndex = 0) {
|
|
|
287706
287707
|
}
|
|
287707
287708
|
return false;
|
|
287708
287709
|
}
|
|
287709
|
-
function prefixIssues(
|
|
287710
|
+
function prefixIssues(path24, issues) {
|
|
287710
287711
|
return issues.map((iss) => {
|
|
287711
287712
|
var _a5;
|
|
287712
287713
|
(_a5 = iss).path ?? (_a5.path = []);
|
|
287713
|
-
iss.path.unshift(
|
|
287714
|
+
iss.path.unshift(path24);
|
|
287714
287715
|
return iss;
|
|
287715
287716
|
});
|
|
287716
287717
|
}
|
|
@@ -295271,7 +295272,7 @@ var TaskAnalyzer = class {
|
|
|
295271
295272
|
analysisCache.clear();
|
|
295272
295273
|
}
|
|
295273
295274
|
};
|
|
295274
|
-
var DEFAULT_STATS_FILE =
|
|
295275
|
+
var DEFAULT_STATS_FILE = path23__namespace.default.join(os7__default.default.homedir(), ".cascade", "model-perf.json");
|
|
295275
295276
|
var ModelPerformanceTracker = class {
|
|
295276
295277
|
stats = /* @__PURE__ */ new Map();
|
|
295277
295278
|
featureStats = /* @__PURE__ */ new Map();
|
|
@@ -295303,7 +295304,7 @@ var ModelPerformanceTracker = class {
|
|
|
295303
295304
|
}
|
|
295304
295305
|
async save() {
|
|
295305
295306
|
try {
|
|
295306
|
-
await fs8__namespace.default.mkdir(
|
|
295307
|
+
await fs8__namespace.default.mkdir(path23__namespace.default.dirname(this.statsFile), { recursive: true });
|
|
295307
295308
|
const modelsObj = {};
|
|
295308
295309
|
const featuresObj = {};
|
|
295309
295310
|
for (const [key, stat3] of this.stats) modelsObj[key] = stat3;
|
|
@@ -295842,7 +295843,7 @@ Required capability: ${description.slice(0, 300)}`;
|
|
|
295842
295843
|
* any dangerous action, so a silently-reloaded tool can't act without approval. */
|
|
295843
295844
|
async loadPersistedTools() {
|
|
295844
295845
|
if (!this.workspacePath || !this.persistEnabled) return;
|
|
295845
|
-
const file =
|
|
295846
|
+
const file = path23__namespace.default.join(this.workspacePath, ".cascade", DYNAMIC_TOOLS_FILE);
|
|
295846
295847
|
try {
|
|
295847
295848
|
const raw = await fs8__namespace.default.readFile(file, "utf-8");
|
|
295848
295849
|
const specs = JSON.parse(raw);
|
|
@@ -295866,8 +295867,8 @@ Required capability: ${description.slice(0, 300)}`;
|
|
|
295866
295867
|
}
|
|
295867
295868
|
async persist() {
|
|
295868
295869
|
if (!this.workspacePath || !this.persistEnabled) return;
|
|
295869
|
-
const dir =
|
|
295870
|
-
const file =
|
|
295870
|
+
const dir = path23__namespace.default.join(this.workspacePath, ".cascade");
|
|
295871
|
+
const file = path23__namespace.default.join(dir, DYNAMIC_TOOLS_FILE);
|
|
295871
295872
|
try {
|
|
295872
295873
|
await fs8__namespace.default.mkdir(dir, { recursive: true });
|
|
295873
295874
|
await fs8__namespace.default.writeFile(file, JSON.stringify(Array.from(this.specs.values()), null, 2), "utf-8");
|
|
@@ -295887,12 +295888,12 @@ var WorldStateDB = class {
|
|
|
295887
295888
|
constructor(workspacePath, debugMode = false) {
|
|
295888
295889
|
this.workspacePath = workspacePath;
|
|
295889
295890
|
this.debugMode = debugMode;
|
|
295890
|
-
const cascadeDir =
|
|
295891
|
+
const cascadeDir = path23__namespace.default.join(workspacePath, ".cascade");
|
|
295891
295892
|
if (!fs11__namespace.default.existsSync(cascadeDir)) {
|
|
295892
295893
|
fs11__namespace.default.mkdirSync(cascadeDir, { recursive: true });
|
|
295893
295894
|
}
|
|
295894
|
-
this.keyPath =
|
|
295895
|
-
this.dbPath =
|
|
295895
|
+
this.keyPath = path23__namespace.default.join(cascadeDir, "world_state.key");
|
|
295896
|
+
this.dbPath = path23__namespace.default.join(cascadeDir, "world_state.db");
|
|
295896
295897
|
this.initEncryptionKey();
|
|
295897
295898
|
this.db = new Database__default.default(this.dbPath);
|
|
295898
295899
|
this.db.pragma("journal_mode = WAL");
|
|
@@ -296067,6 +296068,22 @@ var WorldStateDB = class {
|
|
|
296067
296068
|
}
|
|
296068
296069
|
return selected.slice(0, limit2).map((f4) => `- ${f4.entity} ${f4.relation} ${f4.value}`).join("\n");
|
|
296069
296070
|
}
|
|
296071
|
+
/**
|
|
296072
|
+
* Delete one fact by its (normalized) entity + relation key. Returns whether
|
|
296073
|
+
* a row was actually removed. Powers the desktop Knowledge tab's per-fact
|
|
296074
|
+
* delete — users can prune what the planner remembers about their project.
|
|
296075
|
+
*/
|
|
296076
|
+
deleteFact(entity, relation) {
|
|
296077
|
+
const e3 = normalizeKey(entity);
|
|
296078
|
+
const r4 = normalizeKey(relation);
|
|
296079
|
+
if (!e3 || !r4) return false;
|
|
296080
|
+
const result = this.db.prepare("DELETE FROM facts WHERE entity = ? AND relation = ?").run(e3, r4);
|
|
296081
|
+
return result.changes > 0;
|
|
296082
|
+
}
|
|
296083
|
+
/** Delete every fact. Returns how many were removed. */
|
|
296084
|
+
clearFacts() {
|
|
296085
|
+
return this.db.prepare("DELETE FROM facts").run().changes;
|
|
296086
|
+
}
|
|
296070
296087
|
// ── Export / Import ──────────────────────────
|
|
296071
296088
|
//
|
|
296072
296089
|
// Knowledge travels DECRYPTED in the export bundle (a portable plaintext
|
|
@@ -296115,7 +296132,7 @@ var WorldStateDB = class {
|
|
|
296115
296132
|
dumpDebugIfNeeded() {
|
|
296116
296133
|
if (!this.debugMode) return;
|
|
296117
296134
|
try {
|
|
296118
|
-
const dumpPath =
|
|
296135
|
+
const dumpPath = path23__namespace.default.join(os7__default.default.tmpdir(), "cascade_world_state_debug.json");
|
|
296119
296136
|
const entries = this.getAllEntries();
|
|
296120
296137
|
fs11__namespace.default.writeFileSync(dumpPath, JSON.stringify(entries, null, 2), "utf-8");
|
|
296121
296138
|
} catch (err) {
|
|
@@ -297143,7 +297160,7 @@ var Keystore = class {
|
|
|
297143
297160
|
const ciphertext = Buffer.concat([cipher.update(plaintext), cipher.final()]);
|
|
297144
297161
|
const tag = cipher.getAuthTag();
|
|
297145
297162
|
const out = Buffer.concat([raw.salt, iv, tag, ciphertext]);
|
|
297146
|
-
fs11__namespace.default.mkdirSync(
|
|
297163
|
+
fs11__namespace.default.mkdirSync(path23__namespace.default.dirname(this.storePath), { recursive: true });
|
|
297147
297164
|
fs11__namespace.default.writeFileSync(this.storePath, out, { mode: 384 });
|
|
297148
297165
|
}
|
|
297149
297166
|
writeWithSalt(data, salt) {
|
|
@@ -297154,7 +297171,7 @@ var Keystore = class {
|
|
|
297154
297171
|
const ciphertext = Buffer.concat([cipher.update(plaintext), cipher.final()]);
|
|
297155
297172
|
const tag = cipher.getAuthTag();
|
|
297156
297173
|
const out = Buffer.concat([salt, iv, tag, ciphertext]);
|
|
297157
|
-
fs11__namespace.default.mkdirSync(
|
|
297174
|
+
fs11__namespace.default.mkdirSync(path23__namespace.default.dirname(this.storePath), { recursive: true });
|
|
297158
297175
|
fs11__namespace.default.writeFileSync(this.storePath, out, { mode: 384 });
|
|
297159
297176
|
}
|
|
297160
297177
|
readRaw() {
|
|
@@ -297194,7 +297211,7 @@ var CascadeIgnore = class {
|
|
|
297194
297211
|
]);
|
|
297195
297212
|
}
|
|
297196
297213
|
async load(workspacePath) {
|
|
297197
|
-
const filePath =
|
|
297214
|
+
const filePath = path23__namespace.default.join(workspacePath, ".cascadeignore");
|
|
297198
297215
|
try {
|
|
297199
297216
|
const content = await fs8__namespace.default.readFile(filePath, "utf-8");
|
|
297200
297217
|
const lines = content.split("\n").filter((l2) => l2.trim() && !l2.startsWith("#"));
|
|
@@ -297205,7 +297222,7 @@ var CascadeIgnore = class {
|
|
|
297205
297222
|
}
|
|
297206
297223
|
isIgnored(filePath, workspacePath) {
|
|
297207
297224
|
try {
|
|
297208
|
-
const relative2 = workspacePath ?
|
|
297225
|
+
const relative2 = workspacePath ? path23__namespace.default.relative(workspacePath, filePath) : filePath;
|
|
297209
297226
|
return this.ig.ignores(relative2);
|
|
297210
297227
|
} catch {
|
|
297211
297228
|
return false;
|
|
@@ -297216,7 +297233,7 @@ var CascadeIgnore = class {
|
|
|
297216
297233
|
}
|
|
297217
297234
|
};
|
|
297218
297235
|
async function loadCascadeMd(workspacePath) {
|
|
297219
|
-
const filePath =
|
|
297236
|
+
const filePath = path23__namespace.default.join(workspacePath, "CASCADE.md");
|
|
297220
297237
|
try {
|
|
297221
297238
|
const raw = await fs8__namespace.default.readFile(filePath, "utf-8");
|
|
297222
297239
|
return parseCascadeMd(raw);
|
|
@@ -297247,7 +297264,7 @@ ${raw.trim()}`;
|
|
|
297247
297264
|
var MemoryStore = class _MemoryStore {
|
|
297248
297265
|
db;
|
|
297249
297266
|
constructor(dbPath) {
|
|
297250
|
-
fs11__namespace.default.mkdirSync(
|
|
297267
|
+
fs11__namespace.default.mkdirSync(path23__namespace.default.dirname(dbPath), { recursive: true });
|
|
297251
297268
|
try {
|
|
297252
297269
|
this.db = new Database__default.default(dbPath, { timeout: 5e3 });
|
|
297253
297270
|
this.db.pragma("journal_mode = WAL");
|
|
@@ -298082,6 +298099,60 @@ Original error: ${err.message}`
|
|
|
298082
298099
|
};
|
|
298083
298100
|
}
|
|
298084
298101
|
};
|
|
298102
|
+
function credentialsPath(globalDir) {
|
|
298103
|
+
return path23__namespace.default.join(globalDir, GLOBAL_CREDENTIALS_FILE);
|
|
298104
|
+
}
|
|
298105
|
+
function providerKey(p3) {
|
|
298106
|
+
if (p3.type === "azure") {
|
|
298107
|
+
return `azure:${p3.deploymentName ?? p3.baseUrl ?? p3.label ?? ""}`;
|
|
298108
|
+
}
|
|
298109
|
+
return p3.type;
|
|
298110
|
+
}
|
|
298111
|
+
function isPersistable(p3) {
|
|
298112
|
+
return Boolean(p3.apiKey || p3.authToken || p3.type === "azure" || p3.baseUrl);
|
|
298113
|
+
}
|
|
298114
|
+
function loadGlobalCredentials(globalDir) {
|
|
298115
|
+
try {
|
|
298116
|
+
const raw = fs11__namespace.default.readFileSync(credentialsPath(globalDir), "utf-8");
|
|
298117
|
+
const parsed = JSON.parse(raw);
|
|
298118
|
+
if (!Array.isArray(parsed.providers)) return [];
|
|
298119
|
+
return parsed.providers.filter(
|
|
298120
|
+
(p3) => Boolean(p3) && typeof p3.type === "string"
|
|
298121
|
+
);
|
|
298122
|
+
} catch {
|
|
298123
|
+
return [];
|
|
298124
|
+
}
|
|
298125
|
+
}
|
|
298126
|
+
function saveGlobalCredentials(globalDir, providers) {
|
|
298127
|
+
const filePath = credentialsPath(globalDir);
|
|
298128
|
+
fs11__namespace.default.mkdirSync(globalDir, { recursive: true, mode: 448 });
|
|
298129
|
+
const body = { version: 1, providers: providers.filter(isPersistable) };
|
|
298130
|
+
const tmp = `${filePath}.tmp`;
|
|
298131
|
+
fs11__namespace.default.writeFileSync(tmp, JSON.stringify(body, null, 2), { encoding: "utf-8", mode: 384 });
|
|
298132
|
+
fs11__namespace.default.renameSync(tmp, filePath);
|
|
298133
|
+
try {
|
|
298134
|
+
fs11__namespace.default.chmodSync(filePath, 384);
|
|
298135
|
+
} catch {
|
|
298136
|
+
}
|
|
298137
|
+
}
|
|
298138
|
+
function mergeGlobalCredentials(workspaceProviders, globalProviders) {
|
|
298139
|
+
const merged = [...workspaceProviders];
|
|
298140
|
+
const byKey = new Map(merged.map((p3) => [providerKey(p3), p3]));
|
|
298141
|
+
for (const g2 of globalProviders) {
|
|
298142
|
+
const existing = byKey.get(providerKey(g2));
|
|
298143
|
+
if (!existing) {
|
|
298144
|
+
merged.push({ ...g2 });
|
|
298145
|
+
byKey.set(providerKey(g2), merged[merged.length - 1]);
|
|
298146
|
+
continue;
|
|
298147
|
+
}
|
|
298148
|
+
if (!existing.apiKey && g2.apiKey) existing.apiKey = g2.apiKey;
|
|
298149
|
+
if (!existing.authToken && g2.authToken) existing.authToken = g2.authToken;
|
|
298150
|
+
if (!existing.baseUrl && g2.baseUrl) existing.baseUrl = g2.baseUrl;
|
|
298151
|
+
if (!existing.apiVersion && g2.apiVersion) existing.apiVersion = g2.apiVersion;
|
|
298152
|
+
if (!existing.label && g2.label) existing.label = g2.label;
|
|
298153
|
+
}
|
|
298154
|
+
return merged;
|
|
298155
|
+
}
|
|
298085
298156
|
|
|
298086
298157
|
// src/config/index.ts
|
|
298087
298158
|
var ConfigManager = class {
|
|
@@ -298092,18 +298163,20 @@ var ConfigManager = class {
|
|
|
298092
298163
|
cascadeMd = null;
|
|
298093
298164
|
workspacePath;
|
|
298094
298165
|
globalDir;
|
|
298095
|
-
|
|
298166
|
+
/** `globalDirOverride` exists for tests — never point it at the real home dir there. */
|
|
298167
|
+
constructor(workspacePath = process.cwd(), globalDirOverride) {
|
|
298096
298168
|
this.workspacePath = workspacePath;
|
|
298097
|
-
this.globalDir =
|
|
298169
|
+
this.globalDir = globalDirOverride ?? path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR);
|
|
298098
298170
|
}
|
|
298099
298171
|
async load() {
|
|
298100
298172
|
this.config = await this.loadConfig();
|
|
298101
298173
|
this.ignore = new CascadeIgnore();
|
|
298102
298174
|
await this.ignore.load(this.workspacePath);
|
|
298103
298175
|
this.cascadeMd = await loadCascadeMd(this.workspacePath);
|
|
298104
|
-
this.keystore = new Keystore(
|
|
298105
|
-
this.store = new MemoryStore(
|
|
298176
|
+
this.keystore = new Keystore(path23__namespace.default.join(this.globalDir, GLOBAL_KEYSTORE_FILE));
|
|
298177
|
+
this.store = new MemoryStore(path23__namespace.default.join(this.workspacePath, CASCADE_DB_FILE));
|
|
298106
298178
|
await this.injectEnvKeys();
|
|
298179
|
+
this.config.providers = mergeGlobalCredentials(this.config.providers, loadGlobalCredentials(this.globalDir));
|
|
298107
298180
|
await this.ensureDefaultIdentity();
|
|
298108
298181
|
}
|
|
298109
298182
|
getConfig() {
|
|
@@ -298125,9 +298198,14 @@ var ConfigManager = class {
|
|
|
298125
298198
|
return this.workspacePath;
|
|
298126
298199
|
}
|
|
298127
298200
|
async save() {
|
|
298128
|
-
const configPath =
|
|
298129
|
-
await fs8__namespace.default.mkdir(
|
|
298201
|
+
const configPath = path23__namespace.default.join(this.workspacePath, CASCADE_CONFIG_FILE);
|
|
298202
|
+
await fs8__namespace.default.mkdir(path23__namespace.default.dirname(configPath), { recursive: true });
|
|
298130
298203
|
await fs8__namespace.default.writeFile(configPath, JSON.stringify(this.config, null, 2), "utf-8");
|
|
298204
|
+
try {
|
|
298205
|
+
saveGlobalCredentials(this.globalDir, this.config.providers);
|
|
298206
|
+
} catch (err) {
|
|
298207
|
+
console.warn(`Failed to sync credentials to global store: ${err instanceof Error ? err.message : String(err)}`);
|
|
298208
|
+
}
|
|
298131
298209
|
}
|
|
298132
298210
|
async updateConfig(updates) {
|
|
298133
298211
|
this.config = validateConfig({ ...this.config, ...updates });
|
|
@@ -298150,7 +298228,7 @@ var ConfigManager = class {
|
|
|
298150
298228
|
return configProvider?.apiKey;
|
|
298151
298229
|
}
|
|
298152
298230
|
async loadConfig() {
|
|
298153
|
-
const configPath =
|
|
298231
|
+
const configPath = path23__namespace.default.join(this.workspacePath, CASCADE_CONFIG_FILE);
|
|
298154
298232
|
try {
|
|
298155
298233
|
const raw = await fs8__namespace.default.readFile(configPath, "utf-8");
|
|
298156
298234
|
return validateConfig(JSON.parse(raw));
|
|
@@ -299038,6 +299116,11 @@ function authMiddleware(secret, required2 = true) {
|
|
|
299038
299116
|
}
|
|
299039
299117
|
const user = verifyToken(token, secret);
|
|
299040
299118
|
if (!user) {
|
|
299119
|
+
if (!required2) {
|
|
299120
|
+
req.user = void 0;
|
|
299121
|
+
next();
|
|
299122
|
+
return;
|
|
299123
|
+
}
|
|
299041
299124
|
res.status(401).json({ error: "Invalid or expired token" });
|
|
299042
299125
|
return;
|
|
299043
299126
|
}
|
|
@@ -299349,7 +299432,7 @@ function aggregateCostStats(sessions, opts = {}) {
|
|
|
299349
299432
|
}
|
|
299350
299433
|
|
|
299351
299434
|
// src/dashboard/server.ts
|
|
299352
|
-
var __dirname2 =
|
|
299435
|
+
var __dirname2 = path23__namespace.default.dirname(Url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('desktop-core.cjs', document.baseURI).href))));
|
|
299353
299436
|
var DashboardServer = class {
|
|
299354
299437
|
app;
|
|
299355
299438
|
httpServer;
|
|
@@ -299583,12 +299666,17 @@ var DashboardServer = class {
|
|
|
299583
299666
|
*/
|
|
299584
299667
|
persistConfig() {
|
|
299585
299668
|
try {
|
|
299586
|
-
const configPath =
|
|
299587
|
-
fs11__namespace.default.mkdirSync(
|
|
299669
|
+
const configPath = path23__namespace.default.join(this.workspacePath, CASCADE_CONFIG_FILE);
|
|
299670
|
+
fs11__namespace.default.mkdirSync(path23__namespace.default.dirname(configPath), { recursive: true });
|
|
299588
299671
|
fs11__namespace.default.writeFileSync(configPath, JSON.stringify(this.config, null, 2), "utf-8");
|
|
299589
299672
|
} catch (err) {
|
|
299590
299673
|
console.warn(`[dashboard] Failed to persist config: ${err instanceof Error ? err.message : String(err)}`);
|
|
299591
299674
|
}
|
|
299675
|
+
try {
|
|
299676
|
+
saveGlobalCredentials(path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR), this.config.providers ?? []);
|
|
299677
|
+
} catch (err) {
|
|
299678
|
+
console.warn(`[dashboard] Failed to sync global credentials: ${err instanceof Error ? err.message : String(err)}`);
|
|
299679
|
+
}
|
|
299592
299680
|
}
|
|
299593
299681
|
/**
|
|
299594
299682
|
* Produce a stable dashboard JWT signing secret.
|
|
@@ -299600,14 +299688,14 @@ var DashboardServer = class {
|
|
|
299600
299688
|
resolveDashboardSecret() {
|
|
299601
299689
|
const fromConfig = this.config.dashboard.secret ?? process.env["CASCADE_DASHBOARD_SECRET"];
|
|
299602
299690
|
if (fromConfig) return fromConfig;
|
|
299603
|
-
const secretPath =
|
|
299691
|
+
const secretPath = path23__namespace.default.join(this.workspacePath, CASCADE_DASHBOARD_SECRET_FILE);
|
|
299604
299692
|
try {
|
|
299605
299693
|
if (fs11__namespace.default.existsSync(secretPath)) {
|
|
299606
299694
|
const existing = fs11__namespace.default.readFileSync(secretPath, "utf-8").trim();
|
|
299607
299695
|
if (existing.length >= 16) return existing;
|
|
299608
299696
|
}
|
|
299609
299697
|
const generated = crypto4.randomUUID();
|
|
299610
|
-
fs11__namespace.default.mkdirSync(
|
|
299698
|
+
fs11__namespace.default.mkdirSync(path23__namespace.default.dirname(secretPath), { recursive: true });
|
|
299611
299699
|
fs11__namespace.default.writeFileSync(secretPath, generated, { encoding: "utf-8", mode: 384 });
|
|
299612
299700
|
if (this.config.dashboard.auth) {
|
|
299613
299701
|
console.warn(
|
|
@@ -299635,7 +299723,7 @@ var DashboardServer = class {
|
|
|
299635
299723
|
// ── Setup ─────────────────────────────────────
|
|
299636
299724
|
getGlobalStore() {
|
|
299637
299725
|
if (!this.globalStore) {
|
|
299638
|
-
const globalDbPath =
|
|
299726
|
+
const globalDbPath = path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR, GLOBAL_RUNTIME_DB_FILE);
|
|
299639
299727
|
this.globalStore = new MemoryStore(globalDbPath);
|
|
299640
299728
|
}
|
|
299641
299729
|
return this.globalStore;
|
|
@@ -299904,8 +299992,8 @@ ${prompt}`;
|
|
|
299904
299992
|
}
|
|
299905
299993
|
}
|
|
299906
299994
|
watchRuntimeChanges() {
|
|
299907
|
-
const workspaceDbPath =
|
|
299908
|
-
const globalDbPath =
|
|
299995
|
+
const workspaceDbPath = path23__namespace.default.join(this.workspacePath, CASCADE_DB_FILE);
|
|
299996
|
+
const globalDbPath = path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR, GLOBAL_RUNTIME_DB_FILE);
|
|
299909
299997
|
const watchPaths = [workspaceDbPath, globalDbPath].filter((p3, index, arr) => arr.indexOf(p3) === index);
|
|
299910
299998
|
for (const watchPath of watchPaths) {
|
|
299911
299999
|
if (!fs11__namespace.default.existsSync(watchPath)) continue;
|
|
@@ -300031,7 +300119,7 @@ ${prompt}`;
|
|
|
300031
300119
|
const sessionId = req.params.id;
|
|
300032
300120
|
this.store.deleteSession(sessionId);
|
|
300033
300121
|
this.store.deleteRuntimeSession(sessionId);
|
|
300034
|
-
const globalDbPath =
|
|
300122
|
+
const globalDbPath = path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR, GLOBAL_RUNTIME_DB_FILE);
|
|
300035
300123
|
const globalStore = new MemoryStore(globalDbPath);
|
|
300036
300124
|
try {
|
|
300037
300125
|
globalStore.deleteRuntimeSession(sessionId);
|
|
@@ -300124,7 +300212,7 @@ ${prompt}`;
|
|
|
300124
300212
|
});
|
|
300125
300213
|
this.app.delete("/api/sessions", auth, (req, res) => {
|
|
300126
300214
|
const body = req.body;
|
|
300127
|
-
const globalDbPath =
|
|
300215
|
+
const globalDbPath = path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR, GLOBAL_RUNTIME_DB_FILE);
|
|
300128
300216
|
if (body?.ids && Array.isArray(body.ids) && body.ids.length > 0) {
|
|
300129
300217
|
const globalStore = new MemoryStore(globalDbPath);
|
|
300130
300218
|
try {
|
|
@@ -300147,7 +300235,7 @@ ${prompt}`;
|
|
|
300147
300235
|
});
|
|
300148
300236
|
this.app.delete("/api/runtime", auth, (_req, res) => {
|
|
300149
300237
|
this.store.deleteAllRuntimeNodes();
|
|
300150
|
-
const globalDbPath =
|
|
300238
|
+
const globalDbPath = path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR, GLOBAL_RUNTIME_DB_FILE);
|
|
300151
300239
|
const globalStore = new MemoryStore(globalDbPath);
|
|
300152
300240
|
try {
|
|
300153
300241
|
globalStore.deleteAllRuntimeNodes();
|
|
@@ -300233,7 +300321,7 @@ ${prompt}`;
|
|
|
300233
300321
|
if (body["tierLimits"]) this.config.tierLimits = { ...this.config.tierLimits, ...body["tierLimits"] };
|
|
300234
300322
|
if (body["budget"]) this.config.budget = { ...this.config.budget, ...body["budget"] };
|
|
300235
300323
|
try {
|
|
300236
|
-
const configPath =
|
|
300324
|
+
const configPath = path23__namespace.default.join(this.workspacePath, CASCADE_CONFIG_FILE);
|
|
300237
300325
|
const existing = fs11__namespace.default.existsSync(configPath) ? JSON.parse(fs11__namespace.default.readFileSync(configPath, "utf-8")) : {};
|
|
300238
300326
|
const updated = { ...existing, tierLimits: this.config.tierLimits, budget: this.config.budget };
|
|
300239
300327
|
const tmp = configPath + ".tmp";
|
|
@@ -300266,7 +300354,7 @@ ${prompt}`;
|
|
|
300266
300354
|
this.app.get("/api/runtime", auth, (req, res) => {
|
|
300267
300355
|
const scope = req.query["scope"] ?? "workspace";
|
|
300268
300356
|
if (scope === "global") {
|
|
300269
|
-
const globalDbPath =
|
|
300357
|
+
const globalDbPath = path23__namespace.default.join(os7__default.default.homedir(), GLOBAL_CONFIG_DIR, GLOBAL_RUNTIME_DB_FILE);
|
|
300270
300358
|
const globalStore = new MemoryStore(globalDbPath);
|
|
300271
300359
|
try {
|
|
300272
300360
|
res.json({
|
|
@@ -300501,6 +300589,48 @@ ${prompt}`;
|
|
|
300501
300589
|
res.status(500).json({ error: err instanceof Error ? err.message : String(err) });
|
|
300502
300590
|
}
|
|
300503
300591
|
});
|
|
300592
|
+
this.app.get("/api/knowledge", auth, (_req, res) => {
|
|
300593
|
+
try {
|
|
300594
|
+
const ws2 = new WorldStateDB(this.workspacePath);
|
|
300595
|
+
try {
|
|
300596
|
+
const facts = ws2.getAllFacts();
|
|
300597
|
+
res.json({ total: facts.length, facts });
|
|
300598
|
+
} finally {
|
|
300599
|
+
ws2.close();
|
|
300600
|
+
}
|
|
300601
|
+
} catch (err) {
|
|
300602
|
+
res.status(500).json({ error: err instanceof Error ? err.message : String(err) });
|
|
300603
|
+
}
|
|
300604
|
+
});
|
|
300605
|
+
this.app.delete("/api/knowledge/fact", auth, mutationLimiter, (req, res) => {
|
|
300606
|
+
const body = req.body;
|
|
300607
|
+
if (!body.entity || !body.relation) {
|
|
300608
|
+
res.status(400).json({ error: "entity and relation are required" });
|
|
300609
|
+
return;
|
|
300610
|
+
}
|
|
300611
|
+
try {
|
|
300612
|
+
const ws2 = new WorldStateDB(this.workspacePath);
|
|
300613
|
+
try {
|
|
300614
|
+
res.json({ ok: true, deleted: ws2.deleteFact(body.entity, body.relation) });
|
|
300615
|
+
} finally {
|
|
300616
|
+
ws2.close();
|
|
300617
|
+
}
|
|
300618
|
+
} catch (err) {
|
|
300619
|
+
res.status(500).json({ error: err instanceof Error ? err.message : String(err) });
|
|
300620
|
+
}
|
|
300621
|
+
});
|
|
300622
|
+
this.app.delete("/api/knowledge", auth, mutationLimiter, (_req, res) => {
|
|
300623
|
+
try {
|
|
300624
|
+
const ws2 = new WorldStateDB(this.workspacePath);
|
|
300625
|
+
try {
|
|
300626
|
+
res.json({ ok: true, deleted: ws2.clearFacts() });
|
|
300627
|
+
} finally {
|
|
300628
|
+
ws2.close();
|
|
300629
|
+
}
|
|
300630
|
+
} catch (err) {
|
|
300631
|
+
res.status(500).json({ error: err instanceof Error ? err.message : String(err) });
|
|
300632
|
+
}
|
|
300633
|
+
});
|
|
300504
300634
|
this.app.get("/api/audit-chain", auth, async (req, res) => {
|
|
300505
300635
|
try {
|
|
300506
300636
|
const limit2 = Math.min(500, Math.max(1, parseInt(req.query["limit"] || "200", 10) || 200));
|
|
@@ -300519,13 +300649,13 @@ ${prompt}`;
|
|
|
300519
300649
|
res.status(500).json({ error: err instanceof Error ? err.message : String(err) });
|
|
300520
300650
|
}
|
|
300521
300651
|
});
|
|
300522
|
-
const prodPath =
|
|
300523
|
-
const devPath =
|
|
300652
|
+
const prodPath = path23__namespace.default.resolve(__dirname2, "../web/dist");
|
|
300653
|
+
const devPath = path23__namespace.default.resolve(__dirname2, "../../web/dist");
|
|
300524
300654
|
const webDistPath = fs11__namespace.default.existsSync(prodPath) ? prodPath : devPath;
|
|
300525
300655
|
if (fs11__namespace.default.existsSync(webDistPath)) {
|
|
300526
300656
|
this.app.use(import_express.default.static(webDistPath));
|
|
300527
300657
|
this.app.get("*", (_req, res) => {
|
|
300528
|
-
res.sendFile(
|
|
300658
|
+
res.sendFile(path23__namespace.default.join(webDistPath, "index.html"));
|
|
300529
300659
|
});
|
|
300530
300660
|
} else {
|
|
300531
300661
|
this.app.get("/", (_req, res) => {
|
|
@@ -301026,6 +301156,7 @@ exports.DEFAULT_RETENTION_DAYS = DEFAULT_RETENTION_DAYS;
|
|
|
301026
301156
|
exports.DEFAULT_THEME = DEFAULT_THEME;
|
|
301027
301157
|
exports.DashboardServer = DashboardServer;
|
|
301028
301158
|
exports.GLOBAL_CONFIG_DIR = GLOBAL_CONFIG_DIR;
|
|
301159
|
+
exports.GLOBAL_CREDENTIALS_FILE = GLOBAL_CREDENTIALS_FILE;
|
|
301029
301160
|
exports.GLOBAL_DB_FILE = GLOBAL_DB_FILE;
|
|
301030
301161
|
exports.GLOBAL_KEYSTORE_FILE = GLOBAL_KEYSTORE_FILE;
|
|
301031
301162
|
exports.GLOBAL_RUNTIME_DB_FILE = GLOBAL_RUNTIME_DB_FILE;
|