@dam-agents/cli 0.2.6-rc1 → 0.2.7-rc1
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/bin.js +1670 -21
- package/package.json +3 -1
package/dist/bin.js
CHANGED
|
@@ -7204,6 +7204,1261 @@ var require_websocket_server = __commonJS({
|
|
|
7204
7204
|
}
|
|
7205
7205
|
});
|
|
7206
7206
|
|
|
7207
|
+
// ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
|
|
7208
|
+
var require_ms = __commonJS({
|
|
7209
|
+
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
|
|
7210
|
+
"use strict";
|
|
7211
|
+
var s = 1e3;
|
|
7212
|
+
var m = s * 60;
|
|
7213
|
+
var h2 = m * 60;
|
|
7214
|
+
var d2 = h2 * 24;
|
|
7215
|
+
var w3 = d2 * 7;
|
|
7216
|
+
var y = d2 * 365.25;
|
|
7217
|
+
module.exports = function(val, options) {
|
|
7218
|
+
options = options || {};
|
|
7219
|
+
var type = typeof val;
|
|
7220
|
+
if (type === "string" && val.length > 0) {
|
|
7221
|
+
return parse4(val);
|
|
7222
|
+
} else if (type === "number" && isFinite(val)) {
|
|
7223
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
7224
|
+
}
|
|
7225
|
+
throw new Error(
|
|
7226
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
7227
|
+
);
|
|
7228
|
+
};
|
|
7229
|
+
function parse4(str) {
|
|
7230
|
+
str = String(str);
|
|
7231
|
+
if (str.length > 100) {
|
|
7232
|
+
return;
|
|
7233
|
+
}
|
|
7234
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
7235
|
+
str
|
|
7236
|
+
);
|
|
7237
|
+
if (!match) {
|
|
7238
|
+
return;
|
|
7239
|
+
}
|
|
7240
|
+
var n = parseFloat(match[1]);
|
|
7241
|
+
var type = (match[2] || "ms").toLowerCase();
|
|
7242
|
+
switch (type) {
|
|
7243
|
+
case "years":
|
|
7244
|
+
case "year":
|
|
7245
|
+
case "yrs":
|
|
7246
|
+
case "yr":
|
|
7247
|
+
case "y":
|
|
7248
|
+
return n * y;
|
|
7249
|
+
case "weeks":
|
|
7250
|
+
case "week":
|
|
7251
|
+
case "w":
|
|
7252
|
+
return n * w3;
|
|
7253
|
+
case "days":
|
|
7254
|
+
case "day":
|
|
7255
|
+
case "d":
|
|
7256
|
+
return n * d2;
|
|
7257
|
+
case "hours":
|
|
7258
|
+
case "hour":
|
|
7259
|
+
case "hrs":
|
|
7260
|
+
case "hr":
|
|
7261
|
+
case "h":
|
|
7262
|
+
return n * h2;
|
|
7263
|
+
case "minutes":
|
|
7264
|
+
case "minute":
|
|
7265
|
+
case "mins":
|
|
7266
|
+
case "min":
|
|
7267
|
+
case "m":
|
|
7268
|
+
return n * m;
|
|
7269
|
+
case "seconds":
|
|
7270
|
+
case "second":
|
|
7271
|
+
case "secs":
|
|
7272
|
+
case "sec":
|
|
7273
|
+
case "s":
|
|
7274
|
+
return n * s;
|
|
7275
|
+
case "milliseconds":
|
|
7276
|
+
case "millisecond":
|
|
7277
|
+
case "msecs":
|
|
7278
|
+
case "msec":
|
|
7279
|
+
case "ms":
|
|
7280
|
+
return n;
|
|
7281
|
+
default:
|
|
7282
|
+
return void 0;
|
|
7283
|
+
}
|
|
7284
|
+
}
|
|
7285
|
+
function fmtShort(ms) {
|
|
7286
|
+
var msAbs = Math.abs(ms);
|
|
7287
|
+
if (msAbs >= d2) {
|
|
7288
|
+
return Math.round(ms / d2) + "d";
|
|
7289
|
+
}
|
|
7290
|
+
if (msAbs >= h2) {
|
|
7291
|
+
return Math.round(ms / h2) + "h";
|
|
7292
|
+
}
|
|
7293
|
+
if (msAbs >= m) {
|
|
7294
|
+
return Math.round(ms / m) + "m";
|
|
7295
|
+
}
|
|
7296
|
+
if (msAbs >= s) {
|
|
7297
|
+
return Math.round(ms / s) + "s";
|
|
7298
|
+
}
|
|
7299
|
+
return ms + "ms";
|
|
7300
|
+
}
|
|
7301
|
+
function fmtLong(ms) {
|
|
7302
|
+
var msAbs = Math.abs(ms);
|
|
7303
|
+
if (msAbs >= d2) {
|
|
7304
|
+
return plural(ms, msAbs, d2, "day");
|
|
7305
|
+
}
|
|
7306
|
+
if (msAbs >= h2) {
|
|
7307
|
+
return plural(ms, msAbs, h2, "hour");
|
|
7308
|
+
}
|
|
7309
|
+
if (msAbs >= m) {
|
|
7310
|
+
return plural(ms, msAbs, m, "minute");
|
|
7311
|
+
}
|
|
7312
|
+
if (msAbs >= s) {
|
|
7313
|
+
return plural(ms, msAbs, s, "second");
|
|
7314
|
+
}
|
|
7315
|
+
return ms + " ms";
|
|
7316
|
+
}
|
|
7317
|
+
function plural(ms, msAbs, n, name) {
|
|
7318
|
+
var isPlural = msAbs >= n * 1.5;
|
|
7319
|
+
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
7320
|
+
}
|
|
7321
|
+
}
|
|
7322
|
+
});
|
|
7323
|
+
|
|
7324
|
+
// ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
|
|
7325
|
+
var require_common = __commonJS({
|
|
7326
|
+
"../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports, module) {
|
|
7327
|
+
"use strict";
|
|
7328
|
+
function setup(env) {
|
|
7329
|
+
createDebug.debug = createDebug;
|
|
7330
|
+
createDebug.default = createDebug;
|
|
7331
|
+
createDebug.coerce = coerce;
|
|
7332
|
+
createDebug.disable = disable;
|
|
7333
|
+
createDebug.enable = enable;
|
|
7334
|
+
createDebug.enabled = enabled;
|
|
7335
|
+
createDebug.humanize = require_ms();
|
|
7336
|
+
createDebug.destroy = destroy;
|
|
7337
|
+
Object.keys(env).forEach((key) => {
|
|
7338
|
+
createDebug[key] = env[key];
|
|
7339
|
+
});
|
|
7340
|
+
createDebug.names = [];
|
|
7341
|
+
createDebug.skips = [];
|
|
7342
|
+
createDebug.formatters = {};
|
|
7343
|
+
function selectColor(namespace) {
|
|
7344
|
+
let hash2 = 0;
|
|
7345
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
7346
|
+
hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i);
|
|
7347
|
+
hash2 |= 0;
|
|
7348
|
+
}
|
|
7349
|
+
return createDebug.colors[Math.abs(hash2) % createDebug.colors.length];
|
|
7350
|
+
}
|
|
7351
|
+
createDebug.selectColor = selectColor;
|
|
7352
|
+
function createDebug(namespace) {
|
|
7353
|
+
let prevTime;
|
|
7354
|
+
let enableOverride = null;
|
|
7355
|
+
let namespacesCache;
|
|
7356
|
+
let enabledCache;
|
|
7357
|
+
function debug(...args) {
|
|
7358
|
+
if (!debug.enabled) {
|
|
7359
|
+
return;
|
|
7360
|
+
}
|
|
7361
|
+
const self = debug;
|
|
7362
|
+
const curr = Number(/* @__PURE__ */ new Date());
|
|
7363
|
+
const ms = curr - (prevTime || curr);
|
|
7364
|
+
self.diff = ms;
|
|
7365
|
+
self.prev = prevTime;
|
|
7366
|
+
self.curr = curr;
|
|
7367
|
+
prevTime = curr;
|
|
7368
|
+
args[0] = createDebug.coerce(args[0]);
|
|
7369
|
+
if (typeof args[0] !== "string") {
|
|
7370
|
+
args.unshift("%O");
|
|
7371
|
+
}
|
|
7372
|
+
let index = 0;
|
|
7373
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
7374
|
+
if (match === "%%") {
|
|
7375
|
+
return "%";
|
|
7376
|
+
}
|
|
7377
|
+
index++;
|
|
7378
|
+
const formatter = createDebug.formatters[format];
|
|
7379
|
+
if (typeof formatter === "function") {
|
|
7380
|
+
const val = args[index];
|
|
7381
|
+
match = formatter.call(self, val);
|
|
7382
|
+
args.splice(index, 1);
|
|
7383
|
+
index--;
|
|
7384
|
+
}
|
|
7385
|
+
return match;
|
|
7386
|
+
});
|
|
7387
|
+
createDebug.formatArgs.call(self, args);
|
|
7388
|
+
const logFn = self.log || createDebug.log;
|
|
7389
|
+
logFn.apply(self, args);
|
|
7390
|
+
}
|
|
7391
|
+
debug.namespace = namespace;
|
|
7392
|
+
debug.useColors = createDebug.useColors();
|
|
7393
|
+
debug.color = createDebug.selectColor(namespace);
|
|
7394
|
+
debug.extend = extend2;
|
|
7395
|
+
debug.destroy = createDebug.destroy;
|
|
7396
|
+
Object.defineProperty(debug, "enabled", {
|
|
7397
|
+
enumerable: true,
|
|
7398
|
+
configurable: false,
|
|
7399
|
+
get: () => {
|
|
7400
|
+
if (enableOverride !== null) {
|
|
7401
|
+
return enableOverride;
|
|
7402
|
+
}
|
|
7403
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
7404
|
+
namespacesCache = createDebug.namespaces;
|
|
7405
|
+
enabledCache = createDebug.enabled(namespace);
|
|
7406
|
+
}
|
|
7407
|
+
return enabledCache;
|
|
7408
|
+
},
|
|
7409
|
+
set: (v2) => {
|
|
7410
|
+
enableOverride = v2;
|
|
7411
|
+
}
|
|
7412
|
+
});
|
|
7413
|
+
if (typeof createDebug.init === "function") {
|
|
7414
|
+
createDebug.init(debug);
|
|
7415
|
+
}
|
|
7416
|
+
return debug;
|
|
7417
|
+
}
|
|
7418
|
+
function extend2(namespace, delimiter) {
|
|
7419
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
7420
|
+
newDebug.log = this.log;
|
|
7421
|
+
return newDebug;
|
|
7422
|
+
}
|
|
7423
|
+
function enable(namespaces) {
|
|
7424
|
+
createDebug.save(namespaces);
|
|
7425
|
+
createDebug.namespaces = namespaces;
|
|
7426
|
+
createDebug.names = [];
|
|
7427
|
+
createDebug.skips = [];
|
|
7428
|
+
const split2 = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
7429
|
+
for (const ns of split2) {
|
|
7430
|
+
if (ns[0] === "-") {
|
|
7431
|
+
createDebug.skips.push(ns.slice(1));
|
|
7432
|
+
} else {
|
|
7433
|
+
createDebug.names.push(ns);
|
|
7434
|
+
}
|
|
7435
|
+
}
|
|
7436
|
+
}
|
|
7437
|
+
function matchesTemplate(search, template) {
|
|
7438
|
+
let searchIndex = 0;
|
|
7439
|
+
let templateIndex = 0;
|
|
7440
|
+
let starIndex = -1;
|
|
7441
|
+
let matchIndex = 0;
|
|
7442
|
+
while (searchIndex < search.length) {
|
|
7443
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
7444
|
+
if (template[templateIndex] === "*") {
|
|
7445
|
+
starIndex = templateIndex;
|
|
7446
|
+
matchIndex = searchIndex;
|
|
7447
|
+
templateIndex++;
|
|
7448
|
+
} else {
|
|
7449
|
+
searchIndex++;
|
|
7450
|
+
templateIndex++;
|
|
7451
|
+
}
|
|
7452
|
+
} else if (starIndex !== -1) {
|
|
7453
|
+
templateIndex = starIndex + 1;
|
|
7454
|
+
matchIndex++;
|
|
7455
|
+
searchIndex = matchIndex;
|
|
7456
|
+
} else {
|
|
7457
|
+
return false;
|
|
7458
|
+
}
|
|
7459
|
+
}
|
|
7460
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
7461
|
+
templateIndex++;
|
|
7462
|
+
}
|
|
7463
|
+
return templateIndex === template.length;
|
|
7464
|
+
}
|
|
7465
|
+
function disable() {
|
|
7466
|
+
const namespaces = [
|
|
7467
|
+
...createDebug.names,
|
|
7468
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
7469
|
+
].join(",");
|
|
7470
|
+
createDebug.enable("");
|
|
7471
|
+
return namespaces;
|
|
7472
|
+
}
|
|
7473
|
+
function enabled(name) {
|
|
7474
|
+
for (const skip of createDebug.skips) {
|
|
7475
|
+
if (matchesTemplate(name, skip)) {
|
|
7476
|
+
return false;
|
|
7477
|
+
}
|
|
7478
|
+
}
|
|
7479
|
+
for (const ns of createDebug.names) {
|
|
7480
|
+
if (matchesTemplate(name, ns)) {
|
|
7481
|
+
return true;
|
|
7482
|
+
}
|
|
7483
|
+
}
|
|
7484
|
+
return false;
|
|
7485
|
+
}
|
|
7486
|
+
function coerce(val) {
|
|
7487
|
+
if (val instanceof Error) {
|
|
7488
|
+
return val.stack || val.message;
|
|
7489
|
+
}
|
|
7490
|
+
return val;
|
|
7491
|
+
}
|
|
7492
|
+
function destroy() {
|
|
7493
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
7494
|
+
}
|
|
7495
|
+
createDebug.enable(createDebug.load());
|
|
7496
|
+
return createDebug;
|
|
7497
|
+
}
|
|
7498
|
+
module.exports = setup;
|
|
7499
|
+
}
|
|
7500
|
+
});
|
|
7501
|
+
|
|
7502
|
+
// ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
|
|
7503
|
+
var require_browser = __commonJS({
|
|
7504
|
+
"../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports, module) {
|
|
7505
|
+
"use strict";
|
|
7506
|
+
exports.formatArgs = formatArgs;
|
|
7507
|
+
exports.save = save;
|
|
7508
|
+
exports.load = load;
|
|
7509
|
+
exports.useColors = useColors;
|
|
7510
|
+
exports.storage = localstorage();
|
|
7511
|
+
exports.destroy = /* @__PURE__ */ (() => {
|
|
7512
|
+
let warned = false;
|
|
7513
|
+
return () => {
|
|
7514
|
+
if (!warned) {
|
|
7515
|
+
warned = true;
|
|
7516
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
7517
|
+
}
|
|
7518
|
+
};
|
|
7519
|
+
})();
|
|
7520
|
+
exports.colors = [
|
|
7521
|
+
"#0000CC",
|
|
7522
|
+
"#0000FF",
|
|
7523
|
+
"#0033CC",
|
|
7524
|
+
"#0033FF",
|
|
7525
|
+
"#0066CC",
|
|
7526
|
+
"#0066FF",
|
|
7527
|
+
"#0099CC",
|
|
7528
|
+
"#0099FF",
|
|
7529
|
+
"#00CC00",
|
|
7530
|
+
"#00CC33",
|
|
7531
|
+
"#00CC66",
|
|
7532
|
+
"#00CC99",
|
|
7533
|
+
"#00CCCC",
|
|
7534
|
+
"#00CCFF",
|
|
7535
|
+
"#3300CC",
|
|
7536
|
+
"#3300FF",
|
|
7537
|
+
"#3333CC",
|
|
7538
|
+
"#3333FF",
|
|
7539
|
+
"#3366CC",
|
|
7540
|
+
"#3366FF",
|
|
7541
|
+
"#3399CC",
|
|
7542
|
+
"#3399FF",
|
|
7543
|
+
"#33CC00",
|
|
7544
|
+
"#33CC33",
|
|
7545
|
+
"#33CC66",
|
|
7546
|
+
"#33CC99",
|
|
7547
|
+
"#33CCCC",
|
|
7548
|
+
"#33CCFF",
|
|
7549
|
+
"#6600CC",
|
|
7550
|
+
"#6600FF",
|
|
7551
|
+
"#6633CC",
|
|
7552
|
+
"#6633FF",
|
|
7553
|
+
"#66CC00",
|
|
7554
|
+
"#66CC33",
|
|
7555
|
+
"#9900CC",
|
|
7556
|
+
"#9900FF",
|
|
7557
|
+
"#9933CC",
|
|
7558
|
+
"#9933FF",
|
|
7559
|
+
"#99CC00",
|
|
7560
|
+
"#99CC33",
|
|
7561
|
+
"#CC0000",
|
|
7562
|
+
"#CC0033",
|
|
7563
|
+
"#CC0066",
|
|
7564
|
+
"#CC0099",
|
|
7565
|
+
"#CC00CC",
|
|
7566
|
+
"#CC00FF",
|
|
7567
|
+
"#CC3300",
|
|
7568
|
+
"#CC3333",
|
|
7569
|
+
"#CC3366",
|
|
7570
|
+
"#CC3399",
|
|
7571
|
+
"#CC33CC",
|
|
7572
|
+
"#CC33FF",
|
|
7573
|
+
"#CC6600",
|
|
7574
|
+
"#CC6633",
|
|
7575
|
+
"#CC9900",
|
|
7576
|
+
"#CC9933",
|
|
7577
|
+
"#CCCC00",
|
|
7578
|
+
"#CCCC33",
|
|
7579
|
+
"#FF0000",
|
|
7580
|
+
"#FF0033",
|
|
7581
|
+
"#FF0066",
|
|
7582
|
+
"#FF0099",
|
|
7583
|
+
"#FF00CC",
|
|
7584
|
+
"#FF00FF",
|
|
7585
|
+
"#FF3300",
|
|
7586
|
+
"#FF3333",
|
|
7587
|
+
"#FF3366",
|
|
7588
|
+
"#FF3399",
|
|
7589
|
+
"#FF33CC",
|
|
7590
|
+
"#FF33FF",
|
|
7591
|
+
"#FF6600",
|
|
7592
|
+
"#FF6633",
|
|
7593
|
+
"#FF9900",
|
|
7594
|
+
"#FF9933",
|
|
7595
|
+
"#FFCC00",
|
|
7596
|
+
"#FFCC33"
|
|
7597
|
+
];
|
|
7598
|
+
function useColors() {
|
|
7599
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
7600
|
+
return true;
|
|
7601
|
+
}
|
|
7602
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
7603
|
+
return false;
|
|
7604
|
+
}
|
|
7605
|
+
let m;
|
|
7606
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
7607
|
+
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
7608
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
7609
|
+
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
7610
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
7611
|
+
}
|
|
7612
|
+
function formatArgs(args) {
|
|
7613
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
7614
|
+
if (!this.useColors) {
|
|
7615
|
+
return;
|
|
7616
|
+
}
|
|
7617
|
+
const c2 = "color: " + this.color;
|
|
7618
|
+
args.splice(1, 0, c2, "color: inherit");
|
|
7619
|
+
let index = 0;
|
|
7620
|
+
let lastC = 0;
|
|
7621
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
7622
|
+
if (match === "%%") {
|
|
7623
|
+
return;
|
|
7624
|
+
}
|
|
7625
|
+
index++;
|
|
7626
|
+
if (match === "%c") {
|
|
7627
|
+
lastC = index;
|
|
7628
|
+
}
|
|
7629
|
+
});
|
|
7630
|
+
args.splice(lastC, 0, c2);
|
|
7631
|
+
}
|
|
7632
|
+
exports.log = console.debug || console.log || (() => {
|
|
7633
|
+
});
|
|
7634
|
+
function save(namespaces) {
|
|
7635
|
+
try {
|
|
7636
|
+
if (namespaces) {
|
|
7637
|
+
exports.storage.setItem("debug", namespaces);
|
|
7638
|
+
} else {
|
|
7639
|
+
exports.storage.removeItem("debug");
|
|
7640
|
+
}
|
|
7641
|
+
} catch (error51) {
|
|
7642
|
+
}
|
|
7643
|
+
}
|
|
7644
|
+
function load() {
|
|
7645
|
+
let r;
|
|
7646
|
+
try {
|
|
7647
|
+
r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
|
|
7648
|
+
} catch (error51) {
|
|
7649
|
+
}
|
|
7650
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
7651
|
+
r = process.env.DEBUG;
|
|
7652
|
+
}
|
|
7653
|
+
return r;
|
|
7654
|
+
}
|
|
7655
|
+
function localstorage() {
|
|
7656
|
+
try {
|
|
7657
|
+
return localStorage;
|
|
7658
|
+
} catch (error51) {
|
|
7659
|
+
}
|
|
7660
|
+
}
|
|
7661
|
+
module.exports = require_common()(exports);
|
|
7662
|
+
var { formatters } = module.exports;
|
|
7663
|
+
formatters.j = function(v2) {
|
|
7664
|
+
try {
|
|
7665
|
+
return JSON.stringify(v2);
|
|
7666
|
+
} catch (error51) {
|
|
7667
|
+
return "[UnexpectedJSONParseError]: " + error51.message;
|
|
7668
|
+
}
|
|
7669
|
+
};
|
|
7670
|
+
}
|
|
7671
|
+
});
|
|
7672
|
+
|
|
7673
|
+
// ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
|
|
7674
|
+
var require_node = __commonJS({
|
|
7675
|
+
"../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports, module) {
|
|
7676
|
+
"use strict";
|
|
7677
|
+
var tty = __require("tty");
|
|
7678
|
+
var util = __require("util");
|
|
7679
|
+
exports.init = init;
|
|
7680
|
+
exports.log = log;
|
|
7681
|
+
exports.formatArgs = formatArgs;
|
|
7682
|
+
exports.save = save;
|
|
7683
|
+
exports.load = load;
|
|
7684
|
+
exports.useColors = useColors;
|
|
7685
|
+
exports.destroy = util.deprecate(
|
|
7686
|
+
() => {
|
|
7687
|
+
},
|
|
7688
|
+
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
7689
|
+
);
|
|
7690
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
7691
|
+
try {
|
|
7692
|
+
const supportsColor = __require("supports-color");
|
|
7693
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
7694
|
+
exports.colors = [
|
|
7695
|
+
20,
|
|
7696
|
+
21,
|
|
7697
|
+
26,
|
|
7698
|
+
27,
|
|
7699
|
+
32,
|
|
7700
|
+
33,
|
|
7701
|
+
38,
|
|
7702
|
+
39,
|
|
7703
|
+
40,
|
|
7704
|
+
41,
|
|
7705
|
+
42,
|
|
7706
|
+
43,
|
|
7707
|
+
44,
|
|
7708
|
+
45,
|
|
7709
|
+
56,
|
|
7710
|
+
57,
|
|
7711
|
+
62,
|
|
7712
|
+
63,
|
|
7713
|
+
68,
|
|
7714
|
+
69,
|
|
7715
|
+
74,
|
|
7716
|
+
75,
|
|
7717
|
+
76,
|
|
7718
|
+
77,
|
|
7719
|
+
78,
|
|
7720
|
+
79,
|
|
7721
|
+
80,
|
|
7722
|
+
81,
|
|
7723
|
+
92,
|
|
7724
|
+
93,
|
|
7725
|
+
98,
|
|
7726
|
+
99,
|
|
7727
|
+
112,
|
|
7728
|
+
113,
|
|
7729
|
+
128,
|
|
7730
|
+
129,
|
|
7731
|
+
134,
|
|
7732
|
+
135,
|
|
7733
|
+
148,
|
|
7734
|
+
149,
|
|
7735
|
+
160,
|
|
7736
|
+
161,
|
|
7737
|
+
162,
|
|
7738
|
+
163,
|
|
7739
|
+
164,
|
|
7740
|
+
165,
|
|
7741
|
+
166,
|
|
7742
|
+
167,
|
|
7743
|
+
168,
|
|
7744
|
+
169,
|
|
7745
|
+
170,
|
|
7746
|
+
171,
|
|
7747
|
+
172,
|
|
7748
|
+
173,
|
|
7749
|
+
178,
|
|
7750
|
+
179,
|
|
7751
|
+
184,
|
|
7752
|
+
185,
|
|
7753
|
+
196,
|
|
7754
|
+
197,
|
|
7755
|
+
198,
|
|
7756
|
+
199,
|
|
7757
|
+
200,
|
|
7758
|
+
201,
|
|
7759
|
+
202,
|
|
7760
|
+
203,
|
|
7761
|
+
204,
|
|
7762
|
+
205,
|
|
7763
|
+
206,
|
|
7764
|
+
207,
|
|
7765
|
+
208,
|
|
7766
|
+
209,
|
|
7767
|
+
214,
|
|
7768
|
+
215,
|
|
7769
|
+
220,
|
|
7770
|
+
221
|
|
7771
|
+
];
|
|
7772
|
+
}
|
|
7773
|
+
} catch (error51) {
|
|
7774
|
+
}
|
|
7775
|
+
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
7776
|
+
return /^debug_/i.test(key);
|
|
7777
|
+
}).reduce((obj, key) => {
|
|
7778
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k2) => {
|
|
7779
|
+
return k2.toUpperCase();
|
|
7780
|
+
});
|
|
7781
|
+
let val = process.env[key];
|
|
7782
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
7783
|
+
val = true;
|
|
7784
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
7785
|
+
val = false;
|
|
7786
|
+
} else if (val === "null") {
|
|
7787
|
+
val = null;
|
|
7788
|
+
} else {
|
|
7789
|
+
val = Number(val);
|
|
7790
|
+
}
|
|
7791
|
+
obj[prop] = val;
|
|
7792
|
+
return obj;
|
|
7793
|
+
}, {});
|
|
7794
|
+
function useColors() {
|
|
7795
|
+
return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
7796
|
+
}
|
|
7797
|
+
function formatArgs(args) {
|
|
7798
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
7799
|
+
if (useColors2) {
|
|
7800
|
+
const c2 = this.color;
|
|
7801
|
+
const colorCode = "\x1B[3" + (c2 < 8 ? c2 : "8;5;" + c2);
|
|
7802
|
+
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
7803
|
+
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
7804
|
+
args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
|
|
7805
|
+
} else {
|
|
7806
|
+
args[0] = getDate() + name + " " + args[0];
|
|
7807
|
+
}
|
|
7808
|
+
}
|
|
7809
|
+
function getDate() {
|
|
7810
|
+
if (exports.inspectOpts.hideDate) {
|
|
7811
|
+
return "";
|
|
7812
|
+
}
|
|
7813
|
+
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
7814
|
+
}
|
|
7815
|
+
function log(...args) {
|
|
7816
|
+
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
|
|
7817
|
+
}
|
|
7818
|
+
function save(namespaces) {
|
|
7819
|
+
if (namespaces) {
|
|
7820
|
+
process.env.DEBUG = namespaces;
|
|
7821
|
+
} else {
|
|
7822
|
+
delete process.env.DEBUG;
|
|
7823
|
+
}
|
|
7824
|
+
}
|
|
7825
|
+
function load() {
|
|
7826
|
+
return process.env.DEBUG;
|
|
7827
|
+
}
|
|
7828
|
+
function init(debug) {
|
|
7829
|
+
debug.inspectOpts = {};
|
|
7830
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
7831
|
+
for (let i = 0; i < keys.length; i++) {
|
|
7832
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
7833
|
+
}
|
|
7834
|
+
}
|
|
7835
|
+
module.exports = require_common()(exports);
|
|
7836
|
+
var { formatters } = module.exports;
|
|
7837
|
+
formatters.o = function(v2) {
|
|
7838
|
+
this.inspectOpts.colors = this.useColors;
|
|
7839
|
+
return util.inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
7840
|
+
};
|
|
7841
|
+
formatters.O = function(v2) {
|
|
7842
|
+
this.inspectOpts.colors = this.useColors;
|
|
7843
|
+
return util.inspect(v2, this.inspectOpts);
|
|
7844
|
+
};
|
|
7845
|
+
}
|
|
7846
|
+
});
|
|
7847
|
+
|
|
7848
|
+
// ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js
|
|
7849
|
+
var require_src2 = __commonJS({
|
|
7850
|
+
"../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports, module) {
|
|
7851
|
+
"use strict";
|
|
7852
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
7853
|
+
module.exports = require_browser();
|
|
7854
|
+
} else {
|
|
7855
|
+
module.exports = require_node();
|
|
7856
|
+
}
|
|
7857
|
+
}
|
|
7858
|
+
});
|
|
7859
|
+
|
|
7860
|
+
// ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js
|
|
7861
|
+
var require_helpers = __commonJS({
|
|
7862
|
+
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"(exports) {
|
|
7863
|
+
"use strict";
|
|
7864
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k2, k22) {
|
|
7865
|
+
if (k22 === void 0) k22 = k2;
|
|
7866
|
+
var desc = Object.getOwnPropertyDescriptor(m, k2);
|
|
7867
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7868
|
+
desc = { enumerable: true, get: function() {
|
|
7869
|
+
return m[k2];
|
|
7870
|
+
} };
|
|
7871
|
+
}
|
|
7872
|
+
Object.defineProperty(o, k22, desc);
|
|
7873
|
+
}) : (function(o, m, k2, k22) {
|
|
7874
|
+
if (k22 === void 0) k22 = k2;
|
|
7875
|
+
o[k22] = m[k2];
|
|
7876
|
+
}));
|
|
7877
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v2) {
|
|
7878
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v2 });
|
|
7879
|
+
}) : function(o, v2) {
|
|
7880
|
+
o["default"] = v2;
|
|
7881
|
+
});
|
|
7882
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
7883
|
+
if (mod && mod.__esModule) return mod;
|
|
7884
|
+
var result = {};
|
|
7885
|
+
if (mod != null) {
|
|
7886
|
+
for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2);
|
|
7887
|
+
}
|
|
7888
|
+
__setModuleDefault(result, mod);
|
|
7889
|
+
return result;
|
|
7890
|
+
};
|
|
7891
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7892
|
+
exports.req = exports.json = exports.toBuffer = void 0;
|
|
7893
|
+
var http = __importStar(__require("http"));
|
|
7894
|
+
var https = __importStar(__require("https"));
|
|
7895
|
+
async function toBuffer(stream) {
|
|
7896
|
+
let length = 0;
|
|
7897
|
+
const chunks = [];
|
|
7898
|
+
for await (const chunk of stream) {
|
|
7899
|
+
length += chunk.length;
|
|
7900
|
+
chunks.push(chunk);
|
|
7901
|
+
}
|
|
7902
|
+
return Buffer.concat(chunks, length);
|
|
7903
|
+
}
|
|
7904
|
+
exports.toBuffer = toBuffer;
|
|
7905
|
+
async function json2(stream) {
|
|
7906
|
+
const buf = await toBuffer(stream);
|
|
7907
|
+
const str = buf.toString("utf8");
|
|
7908
|
+
try {
|
|
7909
|
+
return JSON.parse(str);
|
|
7910
|
+
} catch (_err) {
|
|
7911
|
+
const err3 = _err;
|
|
7912
|
+
err3.message += ` (input: ${str})`;
|
|
7913
|
+
throw err3;
|
|
7914
|
+
}
|
|
7915
|
+
}
|
|
7916
|
+
exports.json = json2;
|
|
7917
|
+
function req(url2, opts = {}) {
|
|
7918
|
+
const href = typeof url2 === "string" ? url2 : url2.href;
|
|
7919
|
+
const req2 = (href.startsWith("https:") ? https : http).request(url2, opts);
|
|
7920
|
+
const promise2 = new Promise((resolve4, reject) => {
|
|
7921
|
+
req2.once("response", resolve4).once("error", reject).end();
|
|
7922
|
+
});
|
|
7923
|
+
req2.then = promise2.then.bind(promise2);
|
|
7924
|
+
return req2;
|
|
7925
|
+
}
|
|
7926
|
+
exports.req = req;
|
|
7927
|
+
}
|
|
7928
|
+
});
|
|
7929
|
+
|
|
7930
|
+
// ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js
|
|
7931
|
+
var require_dist = __commonJS({
|
|
7932
|
+
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js"(exports) {
|
|
7933
|
+
"use strict";
|
|
7934
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k2, k22) {
|
|
7935
|
+
if (k22 === void 0) k22 = k2;
|
|
7936
|
+
var desc = Object.getOwnPropertyDescriptor(m, k2);
|
|
7937
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7938
|
+
desc = { enumerable: true, get: function() {
|
|
7939
|
+
return m[k2];
|
|
7940
|
+
} };
|
|
7941
|
+
}
|
|
7942
|
+
Object.defineProperty(o, k22, desc);
|
|
7943
|
+
}) : (function(o, m, k2, k22) {
|
|
7944
|
+
if (k22 === void 0) k22 = k2;
|
|
7945
|
+
o[k22] = m[k2];
|
|
7946
|
+
}));
|
|
7947
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v2) {
|
|
7948
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v2 });
|
|
7949
|
+
}) : function(o, v2) {
|
|
7950
|
+
o["default"] = v2;
|
|
7951
|
+
});
|
|
7952
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
7953
|
+
if (mod && mod.__esModule) return mod;
|
|
7954
|
+
var result = {};
|
|
7955
|
+
if (mod != null) {
|
|
7956
|
+
for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2);
|
|
7957
|
+
}
|
|
7958
|
+
__setModuleDefault(result, mod);
|
|
7959
|
+
return result;
|
|
7960
|
+
};
|
|
7961
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
7962
|
+
for (var p2 in m) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2)) __createBinding(exports2, m, p2);
|
|
7963
|
+
};
|
|
7964
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7965
|
+
exports.Agent = void 0;
|
|
7966
|
+
var net = __importStar(__require("net"));
|
|
7967
|
+
var http = __importStar(__require("http"));
|
|
7968
|
+
var https_1 = __require("https");
|
|
7969
|
+
__exportStar(require_helpers(), exports);
|
|
7970
|
+
var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState");
|
|
7971
|
+
var Agent = class extends http.Agent {
|
|
7972
|
+
constructor(opts) {
|
|
7973
|
+
super(opts);
|
|
7974
|
+
this[INTERNAL] = {};
|
|
7975
|
+
}
|
|
7976
|
+
/**
|
|
7977
|
+
* Determine whether this is an `http` or `https` request.
|
|
7978
|
+
*/
|
|
7979
|
+
isSecureEndpoint(options) {
|
|
7980
|
+
if (options) {
|
|
7981
|
+
if (typeof options.secureEndpoint === "boolean") {
|
|
7982
|
+
return options.secureEndpoint;
|
|
7983
|
+
}
|
|
7984
|
+
if (typeof options.protocol === "string") {
|
|
7985
|
+
return options.protocol === "https:";
|
|
7986
|
+
}
|
|
7987
|
+
}
|
|
7988
|
+
const { stack } = new Error();
|
|
7989
|
+
if (typeof stack !== "string")
|
|
7990
|
+
return false;
|
|
7991
|
+
return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
|
|
7992
|
+
}
|
|
7993
|
+
// In order to support async signatures in `connect()` and Node's native
|
|
7994
|
+
// connection pooling in `http.Agent`, the array of sockets for each origin
|
|
7995
|
+
// has to be updated synchronously. This is so the length of the array is
|
|
7996
|
+
// accurate when `addRequest()` is next called. We achieve this by creating a
|
|
7997
|
+
// fake socket and adding it to `sockets[origin]` and incrementing
|
|
7998
|
+
// `totalSocketCount`.
|
|
7999
|
+
incrementSockets(name) {
|
|
8000
|
+
if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
|
|
8001
|
+
return null;
|
|
8002
|
+
}
|
|
8003
|
+
if (!this.sockets[name]) {
|
|
8004
|
+
this.sockets[name] = [];
|
|
8005
|
+
}
|
|
8006
|
+
const fakeSocket = new net.Socket({ writable: false });
|
|
8007
|
+
this.sockets[name].push(fakeSocket);
|
|
8008
|
+
this.totalSocketCount++;
|
|
8009
|
+
return fakeSocket;
|
|
8010
|
+
}
|
|
8011
|
+
decrementSockets(name, socket) {
|
|
8012
|
+
if (!this.sockets[name] || socket === null) {
|
|
8013
|
+
return;
|
|
8014
|
+
}
|
|
8015
|
+
const sockets = this.sockets[name];
|
|
8016
|
+
const index = sockets.indexOf(socket);
|
|
8017
|
+
if (index !== -1) {
|
|
8018
|
+
sockets.splice(index, 1);
|
|
8019
|
+
this.totalSocketCount--;
|
|
8020
|
+
if (sockets.length === 0) {
|
|
8021
|
+
delete this.sockets[name];
|
|
8022
|
+
}
|
|
8023
|
+
}
|
|
8024
|
+
}
|
|
8025
|
+
// In order to properly update the socket pool, we need to call `getName()` on
|
|
8026
|
+
// the core `https.Agent` if it is a secureEndpoint.
|
|
8027
|
+
getName(options) {
|
|
8028
|
+
const secureEndpoint = this.isSecureEndpoint(options);
|
|
8029
|
+
if (secureEndpoint) {
|
|
8030
|
+
return https_1.Agent.prototype.getName.call(this, options);
|
|
8031
|
+
}
|
|
8032
|
+
return super.getName(options);
|
|
8033
|
+
}
|
|
8034
|
+
createSocket(req, options, cb) {
|
|
8035
|
+
const connectOpts = {
|
|
8036
|
+
...options,
|
|
8037
|
+
secureEndpoint: this.isSecureEndpoint(options)
|
|
8038
|
+
};
|
|
8039
|
+
const name = this.getName(connectOpts);
|
|
8040
|
+
const fakeSocket = this.incrementSockets(name);
|
|
8041
|
+
Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
|
|
8042
|
+
this.decrementSockets(name, fakeSocket);
|
|
8043
|
+
if (socket instanceof http.Agent) {
|
|
8044
|
+
try {
|
|
8045
|
+
return socket.addRequest(req, connectOpts);
|
|
8046
|
+
} catch (err3) {
|
|
8047
|
+
return cb(err3);
|
|
8048
|
+
}
|
|
8049
|
+
}
|
|
8050
|
+
this[INTERNAL].currentSocket = socket;
|
|
8051
|
+
super.createSocket(req, options, cb);
|
|
8052
|
+
}, (err3) => {
|
|
8053
|
+
this.decrementSockets(name, fakeSocket);
|
|
8054
|
+
cb(err3);
|
|
8055
|
+
});
|
|
8056
|
+
}
|
|
8057
|
+
createConnection() {
|
|
8058
|
+
const socket = this[INTERNAL].currentSocket;
|
|
8059
|
+
this[INTERNAL].currentSocket = void 0;
|
|
8060
|
+
if (!socket) {
|
|
8061
|
+
throw new Error("No socket was returned in the `connect()` function");
|
|
8062
|
+
}
|
|
8063
|
+
return socket;
|
|
8064
|
+
}
|
|
8065
|
+
get defaultPort() {
|
|
8066
|
+
return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
|
|
8067
|
+
}
|
|
8068
|
+
set defaultPort(v2) {
|
|
8069
|
+
if (this[INTERNAL]) {
|
|
8070
|
+
this[INTERNAL].defaultPort = v2;
|
|
8071
|
+
}
|
|
8072
|
+
}
|
|
8073
|
+
get protocol() {
|
|
8074
|
+
return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
|
|
8075
|
+
}
|
|
8076
|
+
set protocol(v2) {
|
|
8077
|
+
if (this[INTERNAL]) {
|
|
8078
|
+
this[INTERNAL].protocol = v2;
|
|
8079
|
+
}
|
|
8080
|
+
}
|
|
8081
|
+
};
|
|
8082
|
+
exports.Agent = Agent;
|
|
8083
|
+
}
|
|
8084
|
+
});
|
|
8085
|
+
|
|
8086
|
+
// ../../node_modules/.pnpm/http-proxy-agent@7.0.2/node_modules/http-proxy-agent/dist/index.js
|
|
8087
|
+
var require_dist2 = __commonJS({
|
|
8088
|
+
"../../node_modules/.pnpm/http-proxy-agent@7.0.2/node_modules/http-proxy-agent/dist/index.js"(exports) {
|
|
8089
|
+
"use strict";
|
|
8090
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k2, k22) {
|
|
8091
|
+
if (k22 === void 0) k22 = k2;
|
|
8092
|
+
var desc = Object.getOwnPropertyDescriptor(m, k2);
|
|
8093
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8094
|
+
desc = { enumerable: true, get: function() {
|
|
8095
|
+
return m[k2];
|
|
8096
|
+
} };
|
|
8097
|
+
}
|
|
8098
|
+
Object.defineProperty(o, k22, desc);
|
|
8099
|
+
}) : (function(o, m, k2, k22) {
|
|
8100
|
+
if (k22 === void 0) k22 = k2;
|
|
8101
|
+
o[k22] = m[k2];
|
|
8102
|
+
}));
|
|
8103
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v2) {
|
|
8104
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v2 });
|
|
8105
|
+
}) : function(o, v2) {
|
|
8106
|
+
o["default"] = v2;
|
|
8107
|
+
});
|
|
8108
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
8109
|
+
if (mod && mod.__esModule) return mod;
|
|
8110
|
+
var result = {};
|
|
8111
|
+
if (mod != null) {
|
|
8112
|
+
for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2);
|
|
8113
|
+
}
|
|
8114
|
+
__setModuleDefault(result, mod);
|
|
8115
|
+
return result;
|
|
8116
|
+
};
|
|
8117
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
8118
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
8119
|
+
};
|
|
8120
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8121
|
+
exports.HttpProxyAgent = void 0;
|
|
8122
|
+
var net = __importStar(__require("net"));
|
|
8123
|
+
var tls = __importStar(__require("tls"));
|
|
8124
|
+
var debug_1 = __importDefault(require_src2());
|
|
8125
|
+
var events_1 = __require("events");
|
|
8126
|
+
var agent_base_1 = require_dist();
|
|
8127
|
+
var url_1 = __require("url");
|
|
8128
|
+
var debug = (0, debug_1.default)("http-proxy-agent");
|
|
8129
|
+
var HttpProxyAgent2 = class extends agent_base_1.Agent {
|
|
8130
|
+
constructor(proxy, opts) {
|
|
8131
|
+
super(opts);
|
|
8132
|
+
this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
|
|
8133
|
+
this.proxyHeaders = opts?.headers ?? {};
|
|
8134
|
+
debug("Creating new HttpProxyAgent instance: %o", this.proxy.href);
|
|
8135
|
+
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
|
8136
|
+
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
|
8137
|
+
this.connectOpts = {
|
|
8138
|
+
...opts ? omit2(opts, "headers") : null,
|
|
8139
|
+
host,
|
|
8140
|
+
port
|
|
8141
|
+
};
|
|
8142
|
+
}
|
|
8143
|
+
addRequest(req, opts) {
|
|
8144
|
+
req._header = null;
|
|
8145
|
+
this.setRequestProps(req, opts);
|
|
8146
|
+
super.addRequest(req, opts);
|
|
8147
|
+
}
|
|
8148
|
+
setRequestProps(req, opts) {
|
|
8149
|
+
const { proxy } = this;
|
|
8150
|
+
const protocol = opts.secureEndpoint ? "https:" : "http:";
|
|
8151
|
+
const hostname3 = req.getHeader("host") || "localhost";
|
|
8152
|
+
const base = `${protocol}//${hostname3}`;
|
|
8153
|
+
const url2 = new url_1.URL(req.path, base);
|
|
8154
|
+
if (opts.port !== 80) {
|
|
8155
|
+
url2.port = String(opts.port);
|
|
8156
|
+
}
|
|
8157
|
+
req.path = String(url2);
|
|
8158
|
+
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
8159
|
+
if (proxy.username || proxy.password) {
|
|
8160
|
+
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
8161
|
+
headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
|
|
8162
|
+
}
|
|
8163
|
+
if (!headers["Proxy-Connection"]) {
|
|
8164
|
+
headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
|
|
8165
|
+
}
|
|
8166
|
+
for (const name of Object.keys(headers)) {
|
|
8167
|
+
const value = headers[name];
|
|
8168
|
+
if (value) {
|
|
8169
|
+
req.setHeader(name, value);
|
|
8170
|
+
}
|
|
8171
|
+
}
|
|
8172
|
+
}
|
|
8173
|
+
async connect(req, opts) {
|
|
8174
|
+
req._header = null;
|
|
8175
|
+
if (!req.path.includes("://")) {
|
|
8176
|
+
this.setRequestProps(req, opts);
|
|
8177
|
+
}
|
|
8178
|
+
let first;
|
|
8179
|
+
let endOfHeaders;
|
|
8180
|
+
debug("Regenerating stored HTTP header string for request");
|
|
8181
|
+
req._implicitHeader();
|
|
8182
|
+
if (req.outputData && req.outputData.length > 0) {
|
|
8183
|
+
debug("Patching connection write() output buffer with updated header");
|
|
8184
|
+
first = req.outputData[0].data;
|
|
8185
|
+
endOfHeaders = first.indexOf("\r\n\r\n") + 4;
|
|
8186
|
+
req.outputData[0].data = req._header + first.substring(endOfHeaders);
|
|
8187
|
+
debug("Output buffer: %o", req.outputData[0].data);
|
|
8188
|
+
}
|
|
8189
|
+
let socket;
|
|
8190
|
+
if (this.proxy.protocol === "https:") {
|
|
8191
|
+
debug("Creating `tls.Socket`: %o", this.connectOpts);
|
|
8192
|
+
socket = tls.connect(this.connectOpts);
|
|
8193
|
+
} else {
|
|
8194
|
+
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
8195
|
+
socket = net.connect(this.connectOpts);
|
|
8196
|
+
}
|
|
8197
|
+
await (0, events_1.once)(socket, "connect");
|
|
8198
|
+
return socket;
|
|
8199
|
+
}
|
|
8200
|
+
};
|
|
8201
|
+
HttpProxyAgent2.protocols = ["http", "https"];
|
|
8202
|
+
exports.HttpProxyAgent = HttpProxyAgent2;
|
|
8203
|
+
function omit2(obj, ...keys) {
|
|
8204
|
+
const ret = {};
|
|
8205
|
+
let key;
|
|
8206
|
+
for (key in obj) {
|
|
8207
|
+
if (!keys.includes(key)) {
|
|
8208
|
+
ret[key] = obj[key];
|
|
8209
|
+
}
|
|
8210
|
+
}
|
|
8211
|
+
return ret;
|
|
8212
|
+
}
|
|
8213
|
+
}
|
|
8214
|
+
});
|
|
8215
|
+
|
|
8216
|
+
// ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js
|
|
8217
|
+
var require_parse_proxy_response = __commonJS({
|
|
8218
|
+
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports) {
|
|
8219
|
+
"use strict";
|
|
8220
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
8221
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
8222
|
+
};
|
|
8223
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8224
|
+
exports.parseProxyResponse = void 0;
|
|
8225
|
+
var debug_1 = __importDefault(require_src2());
|
|
8226
|
+
var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
8227
|
+
function parseProxyResponse(socket) {
|
|
8228
|
+
return new Promise((resolve4, reject) => {
|
|
8229
|
+
let buffersLength = 0;
|
|
8230
|
+
const buffers = [];
|
|
8231
|
+
function read() {
|
|
8232
|
+
const b2 = socket.read();
|
|
8233
|
+
if (b2)
|
|
8234
|
+
ondata(b2);
|
|
8235
|
+
else
|
|
8236
|
+
socket.once("readable", read);
|
|
8237
|
+
}
|
|
8238
|
+
function cleanup() {
|
|
8239
|
+
socket.removeListener("end", onend);
|
|
8240
|
+
socket.removeListener("error", onerror);
|
|
8241
|
+
socket.removeListener("readable", read);
|
|
8242
|
+
}
|
|
8243
|
+
function onend() {
|
|
8244
|
+
cleanup();
|
|
8245
|
+
debug("onend");
|
|
8246
|
+
reject(new Error("Proxy connection ended before receiving CONNECT response"));
|
|
8247
|
+
}
|
|
8248
|
+
function onerror(err3) {
|
|
8249
|
+
cleanup();
|
|
8250
|
+
debug("onerror %o", err3);
|
|
8251
|
+
reject(err3);
|
|
8252
|
+
}
|
|
8253
|
+
function ondata(b2) {
|
|
8254
|
+
buffers.push(b2);
|
|
8255
|
+
buffersLength += b2.length;
|
|
8256
|
+
const buffered = Buffer.concat(buffers, buffersLength);
|
|
8257
|
+
const endOfHeaders = buffered.indexOf("\r\n\r\n");
|
|
8258
|
+
if (endOfHeaders === -1) {
|
|
8259
|
+
debug("have not received end of HTTP headers yet...");
|
|
8260
|
+
read();
|
|
8261
|
+
return;
|
|
8262
|
+
}
|
|
8263
|
+
const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
|
|
8264
|
+
const firstLine = headerParts.shift();
|
|
8265
|
+
if (!firstLine) {
|
|
8266
|
+
socket.destroy();
|
|
8267
|
+
return reject(new Error("No header received from proxy CONNECT response"));
|
|
8268
|
+
}
|
|
8269
|
+
const firstLineParts = firstLine.split(" ");
|
|
8270
|
+
const statusCode = +firstLineParts[1];
|
|
8271
|
+
const statusText = firstLineParts.slice(2).join(" ");
|
|
8272
|
+
const headers = {};
|
|
8273
|
+
for (const header of headerParts) {
|
|
8274
|
+
if (!header)
|
|
8275
|
+
continue;
|
|
8276
|
+
const firstColon = header.indexOf(":");
|
|
8277
|
+
if (firstColon === -1) {
|
|
8278
|
+
socket.destroy();
|
|
8279
|
+
return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
8280
|
+
}
|
|
8281
|
+
const key = header.slice(0, firstColon).toLowerCase();
|
|
8282
|
+
const value = header.slice(firstColon + 1).trimStart();
|
|
8283
|
+
const current = headers[key];
|
|
8284
|
+
if (typeof current === "string") {
|
|
8285
|
+
headers[key] = [current, value];
|
|
8286
|
+
} else if (Array.isArray(current)) {
|
|
8287
|
+
current.push(value);
|
|
8288
|
+
} else {
|
|
8289
|
+
headers[key] = value;
|
|
8290
|
+
}
|
|
8291
|
+
}
|
|
8292
|
+
debug("got proxy server response: %o %o", firstLine, headers);
|
|
8293
|
+
cleanup();
|
|
8294
|
+
resolve4({
|
|
8295
|
+
connect: {
|
|
8296
|
+
statusCode,
|
|
8297
|
+
statusText,
|
|
8298
|
+
headers
|
|
8299
|
+
},
|
|
8300
|
+
buffered
|
|
8301
|
+
});
|
|
8302
|
+
}
|
|
8303
|
+
socket.on("error", onerror);
|
|
8304
|
+
socket.on("end", onend);
|
|
8305
|
+
read();
|
|
8306
|
+
});
|
|
8307
|
+
}
|
|
8308
|
+
exports.parseProxyResponse = parseProxyResponse;
|
|
8309
|
+
}
|
|
8310
|
+
});
|
|
8311
|
+
|
|
8312
|
+
// ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js
|
|
8313
|
+
var require_dist3 = __commonJS({
|
|
8314
|
+
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js"(exports) {
|
|
8315
|
+
"use strict";
|
|
8316
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k2, k22) {
|
|
8317
|
+
if (k22 === void 0) k22 = k2;
|
|
8318
|
+
var desc = Object.getOwnPropertyDescriptor(m, k2);
|
|
8319
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8320
|
+
desc = { enumerable: true, get: function() {
|
|
8321
|
+
return m[k2];
|
|
8322
|
+
} };
|
|
8323
|
+
}
|
|
8324
|
+
Object.defineProperty(o, k22, desc);
|
|
8325
|
+
}) : (function(o, m, k2, k22) {
|
|
8326
|
+
if (k22 === void 0) k22 = k2;
|
|
8327
|
+
o[k22] = m[k2];
|
|
8328
|
+
}));
|
|
8329
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v2) {
|
|
8330
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v2 });
|
|
8331
|
+
}) : function(o, v2) {
|
|
8332
|
+
o["default"] = v2;
|
|
8333
|
+
});
|
|
8334
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
8335
|
+
if (mod && mod.__esModule) return mod;
|
|
8336
|
+
var result = {};
|
|
8337
|
+
if (mod != null) {
|
|
8338
|
+
for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2);
|
|
8339
|
+
}
|
|
8340
|
+
__setModuleDefault(result, mod);
|
|
8341
|
+
return result;
|
|
8342
|
+
};
|
|
8343
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
8344
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
8345
|
+
};
|
|
8346
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8347
|
+
exports.HttpsProxyAgent = void 0;
|
|
8348
|
+
var net = __importStar(__require("net"));
|
|
8349
|
+
var tls = __importStar(__require("tls"));
|
|
8350
|
+
var assert_1 = __importDefault(__require("assert"));
|
|
8351
|
+
var debug_1 = __importDefault(require_src2());
|
|
8352
|
+
var agent_base_1 = require_dist();
|
|
8353
|
+
var url_1 = __require("url");
|
|
8354
|
+
var parse_proxy_response_1 = require_parse_proxy_response();
|
|
8355
|
+
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
8356
|
+
var setServernameFromNonIpHost = (options) => {
|
|
8357
|
+
if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
|
|
8358
|
+
return {
|
|
8359
|
+
...options,
|
|
8360
|
+
servername: options.host
|
|
8361
|
+
};
|
|
8362
|
+
}
|
|
8363
|
+
return options;
|
|
8364
|
+
};
|
|
8365
|
+
var HttpsProxyAgent2 = class extends agent_base_1.Agent {
|
|
8366
|
+
constructor(proxy, opts) {
|
|
8367
|
+
super(opts);
|
|
8368
|
+
this.options = { path: void 0 };
|
|
8369
|
+
this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
|
|
8370
|
+
this.proxyHeaders = opts?.headers ?? {};
|
|
8371
|
+
debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
|
|
8372
|
+
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
|
8373
|
+
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
|
8374
|
+
this.connectOpts = {
|
|
8375
|
+
// Attempt to negotiate http/1.1 for proxy servers that support http/2
|
|
8376
|
+
ALPNProtocols: ["http/1.1"],
|
|
8377
|
+
...opts ? omit2(opts, "headers") : null,
|
|
8378
|
+
host,
|
|
8379
|
+
port
|
|
8380
|
+
};
|
|
8381
|
+
}
|
|
8382
|
+
/**
|
|
8383
|
+
* Called when the node-core HTTP client library is creating a
|
|
8384
|
+
* new HTTP request.
|
|
8385
|
+
*/
|
|
8386
|
+
async connect(req, opts) {
|
|
8387
|
+
const { proxy } = this;
|
|
8388
|
+
if (!opts.host) {
|
|
8389
|
+
throw new TypeError('No "host" provided');
|
|
8390
|
+
}
|
|
8391
|
+
let socket;
|
|
8392
|
+
if (proxy.protocol === "https:") {
|
|
8393
|
+
debug("Creating `tls.Socket`: %o", this.connectOpts);
|
|
8394
|
+
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
8395
|
+
} else {
|
|
8396
|
+
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
8397
|
+
socket = net.connect(this.connectOpts);
|
|
8398
|
+
}
|
|
8399
|
+
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
8400
|
+
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
8401
|
+
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
|
|
8402
|
+
`;
|
|
8403
|
+
if (proxy.username || proxy.password) {
|
|
8404
|
+
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
8405
|
+
headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
|
|
8406
|
+
}
|
|
8407
|
+
headers.Host = `${host}:${opts.port}`;
|
|
8408
|
+
if (!headers["Proxy-Connection"]) {
|
|
8409
|
+
headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
|
|
8410
|
+
}
|
|
8411
|
+
for (const name of Object.keys(headers)) {
|
|
8412
|
+
payload += `${name}: ${headers[name]}\r
|
|
8413
|
+
`;
|
|
8414
|
+
}
|
|
8415
|
+
const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
|
|
8416
|
+
socket.write(`${payload}\r
|
|
8417
|
+
`);
|
|
8418
|
+
const { connect, buffered } = await proxyResponsePromise;
|
|
8419
|
+
req.emit("proxyConnect", connect);
|
|
8420
|
+
this.emit("proxyConnect", connect, req);
|
|
8421
|
+
if (connect.statusCode === 200) {
|
|
8422
|
+
req.once("socket", resume);
|
|
8423
|
+
if (opts.secureEndpoint) {
|
|
8424
|
+
debug("Upgrading socket connection to TLS");
|
|
8425
|
+
return tls.connect({
|
|
8426
|
+
...omit2(setServernameFromNonIpHost(opts), "host", "path", "port"),
|
|
8427
|
+
socket
|
|
8428
|
+
});
|
|
8429
|
+
}
|
|
8430
|
+
return socket;
|
|
8431
|
+
}
|
|
8432
|
+
socket.destroy();
|
|
8433
|
+
const fakeSocket = new net.Socket({ writable: false });
|
|
8434
|
+
fakeSocket.readable = true;
|
|
8435
|
+
req.once("socket", (s) => {
|
|
8436
|
+
debug("Replaying proxy buffer for failed request");
|
|
8437
|
+
(0, assert_1.default)(s.listenerCount("data") > 0);
|
|
8438
|
+
s.push(buffered);
|
|
8439
|
+
s.push(null);
|
|
8440
|
+
});
|
|
8441
|
+
return fakeSocket;
|
|
8442
|
+
}
|
|
8443
|
+
};
|
|
8444
|
+
HttpsProxyAgent2.protocols = ["http", "https"];
|
|
8445
|
+
exports.HttpsProxyAgent = HttpsProxyAgent2;
|
|
8446
|
+
function resume(socket) {
|
|
8447
|
+
socket.resume();
|
|
8448
|
+
}
|
|
8449
|
+
function omit2(obj, ...keys) {
|
|
8450
|
+
const ret = {};
|
|
8451
|
+
let key;
|
|
8452
|
+
for (key in obj) {
|
|
8453
|
+
if (!keys.includes(key)) {
|
|
8454
|
+
ret[key] = obj[key];
|
|
8455
|
+
}
|
|
8456
|
+
}
|
|
8457
|
+
return ret;
|
|
8458
|
+
}
|
|
8459
|
+
}
|
|
8460
|
+
});
|
|
8461
|
+
|
|
7207
8462
|
// ../../node_modules/.pnpm/events-universal@1.0.1/node_modules/events-universal/default.js
|
|
7208
8463
|
var require_default = __commonJS({
|
|
7209
8464
|
"../../node_modules/.pnpm/events-universal@1.0.1/node_modules/events-universal/default.js"(exports, module) {
|
|
@@ -25596,8 +26851,12 @@ var templateCategorySchema = external_exports.enum(["harness", "preconfigured"])
|
|
|
25596
26851
|
var templateSpecSchema = external_exports.object({
|
|
25597
26852
|
version: external_exports.string(),
|
|
25598
26853
|
image: external_exports.string(),
|
|
26854
|
+
name: external_exports.string().optional(),
|
|
25599
26855
|
description: external_exports.string().optional(),
|
|
25600
26856
|
category: templateCategorySchema,
|
|
26857
|
+
tags: external_exports.array(external_exports.string()).optional(),
|
|
26858
|
+
docsUrl: external_exports.string().optional(),
|
|
26859
|
+
setupNote: external_exports.object({ title: external_exports.string(), body: external_exports.string() }).optional(),
|
|
25601
26860
|
experimental: external_exports.boolean().optional(),
|
|
25602
26861
|
mounts: external_exports.array(mountSchema).optional(),
|
|
25603
26862
|
init: external_exports.string().optional(),
|
|
@@ -25609,6 +26868,10 @@ var templateSpecSchema = external_exports.object({
|
|
|
25609
26868
|
// (e.g. experimental external agents). Carried onto the agent spec so the
|
|
25610
26869
|
// pod can pull the image without the user entering registry credentials.
|
|
25611
26870
|
imagePullSecretRef: external_exports.string().optional(),
|
|
26871
|
+
// Seeds the created agent's per-agent hibernation override (Go duration):
|
|
26872
|
+
// "0s" never hibernates, omitted inherits the chart-wide default. A user's
|
|
26873
|
+
// explicit choice at create time still wins over this.
|
|
26874
|
+
hibernationTimeout: external_exports.string().optional(),
|
|
25612
26875
|
storageSize: external_exports.string().optional(),
|
|
25613
26876
|
runtimeClassName: external_exports.string().optional(),
|
|
25614
26877
|
nodeSelector: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
@@ -25731,9 +26994,11 @@ var envContribution = external_exports.object({
|
|
|
25731
26994
|
name: external_exports.string().min(1),
|
|
25732
26995
|
placeholder: external_exports.string()
|
|
25733
26996
|
});
|
|
26997
|
+
var egressPort = external_exports.number().int().min(1).max(65535).optional();
|
|
25734
26998
|
var egressAllowContribution = external_exports.object({
|
|
25735
26999
|
kind: external_exports.literal("egress-allow"),
|
|
25736
27000
|
host: external_exports.string().min(1),
|
|
27001
|
+
port: egressPort,
|
|
25737
27002
|
pathPattern: external_exports.string().optional()
|
|
25738
27003
|
});
|
|
25739
27004
|
var egressInjectContribution = external_exports.object({
|
|
@@ -25748,7 +27013,13 @@ var egressInjectContribution = external_exports.object({
|
|
|
25748
27013
|
// Terminate this host's gateway chain as HTTP/2 so injection lands on a gRPC
|
|
25749
27014
|
// stream (e.g. Modal's x-modal-token-* metadata). Flows to the injection-hosts
|
|
25750
27015
|
// annotation the controller reads. Omit for HTTP/1.1 REST hosts.
|
|
25751
|
-
http2: external_exports.boolean().optional()
|
|
27016
|
+
http2: external_exports.boolean().optional(),
|
|
27017
|
+
port: egressPort,
|
|
27018
|
+
// Tunnel WebSocket/SPDY upgrades (kubectl streaming); keeps the chain h1.
|
|
27019
|
+
upgrades: external_exports.boolean().optional(),
|
|
27020
|
+
// Validate the upstream against the CA in the connection Secret, not the
|
|
27021
|
+
// system store (self-signed cluster CAs).
|
|
27022
|
+
upstreamCa: external_exports.boolean().optional()
|
|
25752
27023
|
});
|
|
25753
27024
|
var fileContribution = external_exports.object({
|
|
25754
27025
|
kind: external_exports.literal("file"),
|
|
@@ -25948,6 +27219,8 @@ var egressRuleCurrentPresetInputSchema = external_exports.object({
|
|
|
25948
27219
|
var egressRuleCreateInputSchema = external_exports.object({
|
|
25949
27220
|
agentId: external_exports.string().min(1),
|
|
25950
27221
|
host: external_exports.string().min(1),
|
|
27222
|
+
// Upstream port; omit for 443. Promotes the host onto the L7 chain.
|
|
27223
|
+
port: external_exports.number().int().min(1).max(65535).optional(),
|
|
25951
27224
|
method: external_exports.string().min(1).default("*"),
|
|
25952
27225
|
pathPattern: external_exports.string().min(1).default("*"),
|
|
25953
27226
|
verdict: ruleVerdictSchema
|
|
@@ -25968,6 +27241,22 @@ var egressRuleApplyPresetInputSchema = external_exports.object({
|
|
|
25968
27241
|
|
|
25969
27242
|
// ../api-server-api/src/modules/agents/schemas.ts
|
|
25970
27243
|
var idSchema = external_exports.object({ id: external_exports.string().min(1) });
|
|
27244
|
+
var cpuQuantitySchema = external_exports.string().regex(/^\d+(\.\d+)?m?$/, "CPU must look like '2', '0.5' or '500m'").refine((v2) => toCpuMilli(v2) >= 100, {
|
|
27245
|
+
message: "CPU must be at least 100m"
|
|
27246
|
+
});
|
|
27247
|
+
var memoryQuantitySchema = external_exports.string().regex(/^\d+(Mi|Gi)$/, "memory must look like '512Mi' or '2Gi'").refine((v2) => toMemoryMi(v2) >= 128, {
|
|
27248
|
+
message: "memory must be at least 128Mi"
|
|
27249
|
+
});
|
|
27250
|
+
function toCpuMilli(v2) {
|
|
27251
|
+
return v2.endsWith("m") ? Number(v2.slice(0, -1)) : Number(v2) * 1e3;
|
|
27252
|
+
}
|
|
27253
|
+
function toMemoryMi(v2) {
|
|
27254
|
+
return v2.endsWith("Gi") ? Number(v2.slice(0, -2)) * 1024 : Number(v2.slice(0, -2));
|
|
27255
|
+
}
|
|
27256
|
+
var agentSizeSchema = external_exports.object({
|
|
27257
|
+
cpu: cpuQuantitySchema.optional(),
|
|
27258
|
+
memory: memoryQuantitySchema.optional()
|
|
27259
|
+
});
|
|
25971
27260
|
var agentCreateInputSchema = external_exports.object({
|
|
25972
27261
|
name: external_exports.string().min(1).refine((n) => !n.startsWith("agent-"), {
|
|
25973
27262
|
message: "agent name cannot start with 'agent-' (reserved for IDs)"
|
|
@@ -25995,7 +27284,13 @@ var agentCreateInputSchema = external_exports.object({
|
|
|
25995
27284
|
// Initial connection grants, settled into the spec at create so credentials
|
|
25996
27285
|
// ride the first snapshot and the gateway renders its chains once (no
|
|
25997
27286
|
// readiness flap).
|
|
25998
|
-
connectionIds: external_exports.array(external_exports.string()).optional()
|
|
27287
|
+
connectionIds: external_exports.array(external_exports.string()).optional(),
|
|
27288
|
+
// The agent's size (#1900): CPU/memory limits, the user-facing "power"
|
|
27289
|
+
// knob the Budget bounds (the UI renders it as sliders). Omitted
|
|
27290
|
+
// dimensions inherit the template's limits, else the chart default.
|
|
27291
|
+
// Requests are derived server-side — never a user concept. Floors match
|
|
27292
|
+
// the chart's derivation floors; the budget gate is the only ceiling.
|
|
27293
|
+
size: agentSizeSchema.optional()
|
|
25999
27294
|
}).refine((d2) => d2.templateId !== void 0 || d2.image !== void 0, {
|
|
26000
27295
|
message: "Either templateId or image is required"
|
|
26001
27296
|
});
|
|
@@ -26007,7 +27302,11 @@ var agentUpdateInputSchema = external_exports.object({
|
|
|
26007
27302
|
secretRef: external_exports.string().optional(),
|
|
26008
27303
|
allowedUserEmails: external_exports.array(external_exports.email()).optional(),
|
|
26009
27304
|
// Per-agent idle timeout override in minutes (0 = never hibernate); null clears it back to the global default.
|
|
26010
|
-
hibernationTimeoutMin: external_exports.number().int().min(0).nullable().optional()
|
|
27305
|
+
hibernationTimeoutMin: external_exports.number().int().min(0).nullable().optional(),
|
|
27306
|
+
// Resize (#1900). On a sleeping sandbox the new Size rides the next start
|
|
27307
|
+
// through the budget gate; on a running one the increase is gated
|
|
27308
|
+
// server-side and the pod restarts to apply it.
|
|
27309
|
+
size: agentSizeSchema.optional()
|
|
26011
27310
|
});
|
|
26012
27311
|
var agentConnectSlackInputSchema = external_exports.object({
|
|
26013
27312
|
id: external_exports.string().min(1),
|
|
@@ -29335,6 +30634,20 @@ var oauthAuth = external_exports.object({
|
|
|
29335
30634
|
host: external_exports.string().min(1).optional(),
|
|
29336
30635
|
appSlug: external_exports.string().min(1).optional()
|
|
29337
30636
|
});
|
|
30637
|
+
var clientCredentialsAuth = external_exports.object({
|
|
30638
|
+
kind: external_exports.literal("client-credentials"),
|
|
30639
|
+
clientId: external_exports.string(),
|
|
30640
|
+
clientSecretRef: secretRef,
|
|
30641
|
+
accessTokenRef: secretRef,
|
|
30642
|
+
issuerUrl: external_exports.string().url(),
|
|
30643
|
+
tokenUrl: external_exports.string().url(),
|
|
30644
|
+
scopes: external_exports.array(external_exports.string()).default([]),
|
|
30645
|
+
audience: external_exports.string().min(1).optional(),
|
|
30646
|
+
expiresAt: external_exports.number().int().optional(),
|
|
30647
|
+
connectedAt: external_exports.number().int().optional(),
|
|
30648
|
+
tokenEndpointAcceptJson: external_exports.boolean().optional(),
|
|
30649
|
+
host: external_exports.string().min(1).optional()
|
|
30650
|
+
});
|
|
29338
30651
|
var headerAuth = external_exports.object({
|
|
29339
30652
|
kind: external_exports.literal("header"),
|
|
29340
30653
|
valueRef: secretRef,
|
|
@@ -29346,6 +30659,7 @@ var noneAuth = external_exports.object({
|
|
|
29346
30659
|
});
|
|
29347
30660
|
var authConfig = external_exports.discriminatedUnion("kind", [
|
|
29348
30661
|
oauthAuth,
|
|
30662
|
+
clientCredentialsAuth,
|
|
29349
30663
|
headerAuth,
|
|
29350
30664
|
noneAuth
|
|
29351
30665
|
]);
|
|
@@ -29364,6 +30678,12 @@ var connectionStatus = external_exports.enum([
|
|
|
29364
30678
|
"pending",
|
|
29365
30679
|
"disconnected"
|
|
29366
30680
|
]);
|
|
30681
|
+
var authKind = external_exports.enum([
|
|
30682
|
+
"oauth",
|
|
30683
|
+
"client-credentials",
|
|
30684
|
+
"header",
|
|
30685
|
+
"none"
|
|
30686
|
+
]);
|
|
29367
30687
|
var connectionView = external_exports.object({
|
|
29368
30688
|
id: external_exports.string(),
|
|
29369
30689
|
ownerId: external_exports.string(),
|
|
@@ -29371,14 +30691,13 @@ var connectionView = external_exports.object({
|
|
|
29371
30691
|
category: connectionCategory,
|
|
29372
30692
|
name: external_exports.string(),
|
|
29373
30693
|
status: connectionStatus,
|
|
29374
|
-
authKind
|
|
30694
|
+
authKind,
|
|
29375
30695
|
contributions: external_exports.array(contribution),
|
|
29376
30696
|
connectedAt: external_exports.string().optional(),
|
|
29377
30697
|
hosts: external_exports.array(external_exports.string()),
|
|
29378
30698
|
host: external_exports.string().min(1).optional(),
|
|
29379
30699
|
appSlug: external_exports.string().min(1).optional()
|
|
29380
30700
|
});
|
|
29381
|
-
var authKind = external_exports.enum(["oauth", "header", "none"]);
|
|
29382
30701
|
var templateInputState = external_exports.enum([
|
|
29383
30702
|
"required",
|
|
29384
30703
|
"overridable",
|
|
@@ -29440,6 +30759,9 @@ var connectionStartOAuthInputSchema = external_exports.object({
|
|
|
29440
30759
|
var connectionDiscoverMcpInputSchema = external_exports.object({
|
|
29441
30760
|
url: external_exports.string().url()
|
|
29442
30761
|
});
|
|
30762
|
+
var connectionProbeClusterCaInputSchema = external_exports.object({
|
|
30763
|
+
host: external_exports.string().min(1)
|
|
30764
|
+
});
|
|
29443
30765
|
var connectionGetAgentConnectionsInputSchema = external_exports.object({
|
|
29444
30766
|
agentId: external_exports.string().min(1)
|
|
29445
30767
|
});
|
|
@@ -29476,7 +30798,30 @@ var headerCreateInput = external_exports.object({
|
|
|
29476
30798
|
).optional(),
|
|
29477
30799
|
// Values for the template's declared config inputs, keyed by input name.
|
|
29478
30800
|
configInputs: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
29479
|
-
value: external_exports.string().min(1)
|
|
30801
|
+
value: external_exports.string().min(1),
|
|
30802
|
+
// Upstream CA bundle for hosts whose TLS cert a public root can't verify
|
|
30803
|
+
// (self-signed cluster CAs). PEM, or base64 of PEM (kubeconfig
|
|
30804
|
+
// `certificate-authority-data`).
|
|
30805
|
+
caData: external_exports.string().optional()
|
|
30806
|
+
});
|
|
30807
|
+
var clientCredentialsCreateInput = external_exports.object({
|
|
30808
|
+
...commonFields,
|
|
30809
|
+
authKind: external_exports.literal("client-credentials"),
|
|
30810
|
+
host: external_exports.string().min(1).optional(),
|
|
30811
|
+
// The token endpoint is discovered from the issuer's OAuth metadata.
|
|
30812
|
+
issuerUrl: external_exports.string().url().optional(),
|
|
30813
|
+
clientId: external_exports.string().min(1).optional(),
|
|
30814
|
+
clientSecret: external_exports.string().min(1).optional(),
|
|
30815
|
+
// Space- or comma-separated; the server splits. A single string keeps the
|
|
30816
|
+
// schema-driven forms all-string.
|
|
30817
|
+
scopes: external_exports.string().optional(),
|
|
30818
|
+
audience: external_exports.string().min(1).optional(),
|
|
30819
|
+
headerName: external_exports.string().min(1).optional(),
|
|
30820
|
+
valueFormat: external_exports.string().min(1).optional(),
|
|
30821
|
+
envName: external_exports.string().regex(
|
|
30822
|
+
/^[A-Za-z_][A-Za-z0-9_]*$/,
|
|
30823
|
+
"env var name must be letters, digits, and underscores (not starting with a digit)"
|
|
30824
|
+
).optional()
|
|
29480
30825
|
});
|
|
29481
30826
|
var noneCreateInput = external_exports.object({
|
|
29482
30827
|
...commonFields,
|
|
@@ -29485,6 +30830,7 @@ var noneCreateInput = external_exports.object({
|
|
|
29485
30830
|
});
|
|
29486
30831
|
var connectionCreateInputSchema = external_exports.discriminatedUnion("authKind", [
|
|
29487
30832
|
oauthCreateInput,
|
|
30833
|
+
clientCredentialsCreateInput,
|
|
29488
30834
|
headerCreateInput,
|
|
29489
30835
|
noneCreateInput
|
|
29490
30836
|
]);
|
|
@@ -29609,15 +30955,20 @@ function formatEgressRuleSource(source) {
|
|
|
29609
30955
|
function formatEgressRuleInline(rule) {
|
|
29610
30956
|
const parts = [rule.verdict];
|
|
29611
30957
|
if (rule.method !== "*") parts.push(rule.method);
|
|
29612
|
-
parts.push(joinHostPath(rule.host, rule.pathPattern));
|
|
30958
|
+
parts.push(joinHostPath(rule.host, rule.pathPattern, rule.port));
|
|
29613
30959
|
return parts.join(" ");
|
|
29614
30960
|
}
|
|
29615
|
-
function joinHostPath(host, pathPattern) {
|
|
29616
|
-
const normalizedHost = host
|
|
30961
|
+
function joinHostPath(host, pathPattern, port) {
|
|
30962
|
+
const normalizedHost = stripTrailingSlashes(host) + (port ? `:${port}` : "");
|
|
29617
30963
|
if (pathPattern === "*") return normalizedHost;
|
|
29618
30964
|
const normalizedPath = pathPattern.startsWith("/") ? pathPattern : `/${pathPattern}`;
|
|
29619
30965
|
return `${normalizedHost}${normalizedPath}`;
|
|
29620
30966
|
}
|
|
30967
|
+
function stripTrailingSlashes(s) {
|
|
30968
|
+
let end = s.length;
|
|
30969
|
+
while (end > 0 && s[end - 1] === "/") end--;
|
|
30970
|
+
return s.slice(0, end);
|
|
30971
|
+
}
|
|
29621
30972
|
|
|
29622
30973
|
// ../api-server-api/src/modules/acp/types.ts
|
|
29623
30974
|
var platformTurnEndedParamsSchema = external_exports.object({
|
|
@@ -31302,6 +32653,11 @@ function createConnectionService(deps) {
|
|
|
31302
32653
|
async discoverMcp(url2) {
|
|
31303
32654
|
return trpcCall(() => deps.trpc.connections.discoverMcp.mutate({ url: url2 }));
|
|
31304
32655
|
},
|
|
32656
|
+
async probeClusterCa(host) {
|
|
32657
|
+
return trpcCall(
|
|
32658
|
+
() => deps.trpc.connections.probeClusterCa.mutate({ host })
|
|
32659
|
+
);
|
|
32660
|
+
},
|
|
31305
32661
|
async getConnection(id) {
|
|
31306
32662
|
return trpcCall(() => deps.trpc.connections.get.query({ id }));
|
|
31307
32663
|
},
|
|
@@ -38114,11 +39470,40 @@ var import_websocket = __toESM(require_websocket(), 1);
|
|
|
38114
39470
|
var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
38115
39471
|
var wrapper_default = import_websocket.default;
|
|
38116
39472
|
|
|
39473
|
+
// src/modules/shared/ws-proxy.ts
|
|
39474
|
+
var import_http_proxy_agent = __toESM(require_dist2(), 1);
|
|
39475
|
+
var import_https_proxy_agent = __toESM(require_dist3(), 1);
|
|
39476
|
+
function proxyAgentForUrl(url2, env = process.env) {
|
|
39477
|
+
let target;
|
|
39478
|
+
try {
|
|
39479
|
+
target = new URL(url2);
|
|
39480
|
+
} catch {
|
|
39481
|
+
return void 0;
|
|
39482
|
+
}
|
|
39483
|
+
const secure = target.protocol === "wss:" || target.protocol === "https:";
|
|
39484
|
+
const proxy = secure ? env.HTTPS_PROXY ?? env.https_proxy : env.HTTP_PROXY ?? env.http_proxy;
|
|
39485
|
+
if (!proxy) return void 0;
|
|
39486
|
+
if (isNoProxy(target.hostname, env.NO_PROXY ?? env.no_proxy))
|
|
39487
|
+
return void 0;
|
|
39488
|
+
return secure ? new import_https_proxy_agent.HttpsProxyAgent(proxy) : new import_http_proxy_agent.HttpProxyAgent(proxy);
|
|
39489
|
+
}
|
|
39490
|
+
function isNoProxy(host, noProxy) {
|
|
39491
|
+
if (!noProxy) return false;
|
|
39492
|
+
for (const raw of noProxy.split(",")) {
|
|
39493
|
+
const entry = raw.trim();
|
|
39494
|
+
if (entry === "") continue;
|
|
39495
|
+
if (entry === "*") return true;
|
|
39496
|
+
const bare = (entry.startsWith(".") ? entry.slice(1) : entry).toLowerCase();
|
|
39497
|
+
if (host === bare || host.endsWith(`.${bare}`)) return true;
|
|
39498
|
+
}
|
|
39499
|
+
return false;
|
|
39500
|
+
}
|
|
39501
|
+
|
|
38117
39502
|
// src/modules/chat/infrastructure/acp-session-client.ts
|
|
38118
39503
|
var TIMEOUT_MS = 12e4;
|
|
38119
39504
|
function wsStream(url2) {
|
|
38120
39505
|
return new Promise((resolve4, reject) => {
|
|
38121
|
-
const ws = new import_websocket.default(url2);
|
|
39506
|
+
const ws = new import_websocket.default(url2, { agent: proxyAgentForUrl(url2) });
|
|
38122
39507
|
ws.on("open", () => {
|
|
38123
39508
|
const readable = new ReadableStream({
|
|
38124
39509
|
start(controller) {
|
|
@@ -38274,9 +39659,8 @@ function connectTerminalBridge({
|
|
|
38274
39659
|
const proto = host.startsWith("https://") ? "wss:" : "ws:";
|
|
38275
39660
|
const base = host.replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
38276
39661
|
const sep = terminalPath.includes("?") ? "&" : "?";
|
|
38277
|
-
const
|
|
38278
|
-
|
|
38279
|
-
);
|
|
39662
|
+
const url2 = `${proto}//${base}${terminalPath}${sep}token=${encodeURIComponent(token)}`;
|
|
39663
|
+
const ws = new wrapper_default(url2, { agent: proxyAgentForUrl(url2) });
|
|
38280
39664
|
const onData = (chunk) => {
|
|
38281
39665
|
if (ws.readyState === wrapper_default.OPEN)
|
|
38282
39666
|
ws.send(encodeDataFrame(OP_INPUT, new Uint8Array(chunk)));
|
|
@@ -38496,13 +39880,13 @@ function createSessionsPort(deps) {
|
|
|
38496
39880
|
}
|
|
38497
39881
|
|
|
38498
39882
|
// src/modules/chat/compose.ts
|
|
39883
|
+
var buildSessionsPort = (host, token) => createSessionsPort({ acp: createAcpSessionClient({ host, token }) });
|
|
38499
39884
|
function composeChatModule({
|
|
38500
39885
|
compatService,
|
|
38501
39886
|
configService,
|
|
38502
39887
|
tokenProvider,
|
|
38503
39888
|
createAgentService: createAgentService2
|
|
38504
39889
|
}) {
|
|
38505
|
-
const buildSessionsPort = (host, token) => createSessionsPort({ acp: createAcpSessionClient({ host, token }) });
|
|
38506
39890
|
const chatService = createChatService({
|
|
38507
39891
|
compatService,
|
|
38508
39892
|
configService,
|
|
@@ -38790,7 +40174,7 @@ function createProcessEnvReader() {
|
|
|
38790
40174
|
|
|
38791
40175
|
// src/modules/cli/infrastructure/package-version.ts
|
|
38792
40176
|
function readPackageVersion() {
|
|
38793
|
-
return true ? "0.2.
|
|
40177
|
+
return true ? "0.2.7-rc1" : DEV_VERSION;
|
|
38794
40178
|
}
|
|
38795
40179
|
|
|
38796
40180
|
// src/modules/cli/infrastructure/version-probe.ts
|
|
@@ -39017,10 +40401,22 @@ function buildConnectCommand(deps) {
|
|
|
39017
40401
|
).option(
|
|
39018
40402
|
"--auth <mode>",
|
|
39019
40403
|
"MCP auth mode: oauth | none (default: auto-detect from the server)"
|
|
39020
|
-
).option("--url <url>", "input: url").option("--host <host>", "input: host").option("--client-id <id>", "input: OAuth client id").option("--client-secret <secret>", "input: OAuth client secret").option(
|
|
40404
|
+
).option("--url <url>", "input: url").option("--host <host>", "input: host").option("--client-id <id>", "input: OAuth client id").option("--client-secret <secret>", "input: OAuth client secret").option(
|
|
40405
|
+
"--issuer-url <url>",
|
|
40406
|
+
"input: OAuth issuer URL \u2014 the token endpoint is discovered from its metadata (client credentials)"
|
|
40407
|
+
).option(
|
|
40408
|
+
"--scopes <scopes>",
|
|
40409
|
+
"input: OAuth scopes, space- or comma-separated (client credentials)"
|
|
40410
|
+
).option(
|
|
40411
|
+
"--audience <audience>",
|
|
40412
|
+
"input: OAuth audience (client credentials)"
|
|
40413
|
+
).option("--app-slug <slug>", "input: GitHub App slug").option("--header-name <name>", "input: header name").option("--value-format <format>", "input: header value format").option(
|
|
39021
40414
|
"--env-name <name>",
|
|
39022
40415
|
"input: expose the credential to the agent as this env var (custom header credentials)"
|
|
39023
40416
|
).option("--value <value>", "input: header secret value").option(
|
|
40417
|
+
"--ca-data <data>",
|
|
40418
|
+
"input: upstream CA certificate \u2014 PEM or base64 (a kubeconfig's certificate-authority-data)"
|
|
40419
|
+
).option(
|
|
39024
40420
|
"-c, --config <key=value>",
|
|
39025
40421
|
"set an optional template config input (e.g. -c model=premium-shell), repeatable",
|
|
39026
40422
|
(val, prev) => [...prev, val],
|
|
@@ -39037,7 +40433,7 @@ function buildConnectCommand(deps) {
|
|
|
39037
40433
|
String(DEFAULT_TIMEOUT_SECONDS3)
|
|
39038
40434
|
).addHelpText(
|
|
39039
40435
|
"after",
|
|
39040
|
-
"\nExamples:\n dam connection connect github\n dam connection connect github --client-id Iv1.\u2026 --client-secret \u2026 # use your own OAuth app\n dam connection connect github --no-browser\n dam connection connect my-api --header-name X-API-Key --value sk-\u2026\n dam connection connect bob --value sk-\u2026 --config model=premium-shell --config chatMode=code\n dam connection connect https://mcp.example.com\n dam connection connect https://mcp.example.com --auth none\n"
|
|
40436
|
+
"\nExamples:\n dam connection connect github\n dam connection connect github --client-id Iv1.\u2026 --client-secret \u2026 # use your own OAuth app\n dam connection connect github --no-browser\n dam connection connect my-api --header-name X-API-Key --value sk-\u2026\n dam connection connect custom-client-credentials --host api.example.com \\\n --issuer-url https://auth.example.com/realms/main --client-id \u2026 --client-secret \u2026\n dam connection connect bob --value sk-\u2026 --config model=premium-shell --config chatMode=code\n dam connection connect https://mcp.example.com\n dam connection connect https://mcp.example.com --auth none\n"
|
|
39041
40437
|
).action(async (providerOrUrl, opts) => {
|
|
39042
40438
|
const json2 = opts.json ?? false;
|
|
39043
40439
|
const timeoutSeconds = parseTimeout2(opts.timeout);
|
|
@@ -39093,6 +40489,9 @@ function buildConnectCommand(deps) {
|
|
|
39093
40489
|
`);
|
|
39094
40490
|
process.exit(EXIT_INVALID_INPUT);
|
|
39095
40491
|
}
|
|
40492
|
+
if (template.id === "kubernetes" && payload.authKind === "header" && !payload.caData && values.host && !checkClusterTrust(await svc.probeClusterCa(values.host), values.host)) {
|
|
40493
|
+
process.exit(EXIT_INVALID_INPUT);
|
|
40494
|
+
}
|
|
39096
40495
|
const createRes = await svc.createConnection(payload);
|
|
39097
40496
|
if (!createRes.ok) {
|
|
39098
40497
|
printServiceError(createRes.error, host);
|
|
@@ -39282,6 +40681,20 @@ function buildPayload(template, name, values) {
|
|
|
39282
40681
|
...v2("clientSecret") ? { clientSecret: v2("clientSecret") } : {},
|
|
39283
40682
|
...v2("appSlug") ? { appSlug: v2("appSlug") } : {}
|
|
39284
40683
|
};
|
|
40684
|
+
case "client-credentials":
|
|
40685
|
+
return {
|
|
40686
|
+
...common2,
|
|
40687
|
+
authKind: "client-credentials",
|
|
40688
|
+
...v2("host") ? { host: v2("host") } : {},
|
|
40689
|
+
...v2("issuerUrl") ? { issuerUrl: v2("issuerUrl") } : {},
|
|
40690
|
+
...v2("clientId") ? { clientId: v2("clientId") } : {},
|
|
40691
|
+
...v2("clientSecret") ? { clientSecret: v2("clientSecret") } : {},
|
|
40692
|
+
...v2("scopes") ? { scopes: v2("scopes") } : {},
|
|
40693
|
+
...v2("audience") ? { audience: v2("audience") } : {},
|
|
40694
|
+
...v2("headerName") ? { headerName: v2("headerName") } : {},
|
|
40695
|
+
...v2("valueFormat") ? { valueFormat: v2("valueFormat") } : {},
|
|
40696
|
+
...v2("envName") ? { envName: v2("envName") } : {}
|
|
40697
|
+
};
|
|
39285
40698
|
case "header": {
|
|
39286
40699
|
const value = v2("value");
|
|
39287
40700
|
if (!value) return { error: "the secret value is required (--value)" };
|
|
@@ -39298,6 +40711,7 @@ function buildPayload(template, name, values) {
|
|
|
39298
40711
|
...v2("headerName") ? { headerName: v2("headerName") } : {},
|
|
39299
40712
|
...v2("valueFormat") ? { valueFormat: v2("valueFormat") } : {},
|
|
39300
40713
|
...v2("envName") ? { envName: v2("envName") } : {},
|
|
40714
|
+
...v2("caData") ? { caData: v2("caData") } : {},
|
|
39301
40715
|
...Object.keys(configInputs).length > 0 ? { configInputs } : {},
|
|
39302
40716
|
value
|
|
39303
40717
|
};
|
|
@@ -39310,6 +40724,24 @@ function buildPayload(template, name, values) {
|
|
|
39310
40724
|
};
|
|
39311
40725
|
}
|
|
39312
40726
|
}
|
|
40727
|
+
function checkClusterTrust(probeRes, host) {
|
|
40728
|
+
if (!probeRes.ok) return true;
|
|
40729
|
+
const probe = probeRes.value;
|
|
40730
|
+
if (probe.trusted) return true;
|
|
40731
|
+
if (probe.reachable) {
|
|
40732
|
+
process.stderr.write(
|
|
40733
|
+
`error: the API server at ${host} presents a certificate that isn't publicly trusted${probe.error ? ` (${probe.error})` : ""}.
|
|
40734
|
+
Pass --ca-data with the cluster CA \u2014 the certificate-authority-data value from your kubeconfig (base64 or PEM).
|
|
40735
|
+
`
|
|
40736
|
+
);
|
|
40737
|
+
return false;
|
|
40738
|
+
}
|
|
40739
|
+
process.stderr.write(
|
|
40740
|
+
`warning: couldn't reach ${host} to check its certificate${probe.error ? ` (${probe.error})` : ""}; continuing.
|
|
40741
|
+
`
|
|
40742
|
+
);
|
|
40743
|
+
return true;
|
|
40744
|
+
}
|
|
39313
40745
|
async function pollUntilActive(svc, id, timeoutSeconds) {
|
|
39314
40746
|
const deadline = Date.now() + timeoutSeconds * 1e3;
|
|
39315
40747
|
while (true) {
|
|
@@ -39376,13 +40808,17 @@ function flagListFor(inputs) {
|
|
|
39376
40808
|
var FIELD_LABELS = {
|
|
39377
40809
|
url: "URL",
|
|
39378
40810
|
host: "Host",
|
|
40811
|
+
issuerUrl: "Issuer URL",
|
|
39379
40812
|
headerName: "Header name",
|
|
39380
40813
|
valueFormat: "Value format",
|
|
39381
40814
|
value: "Secret value",
|
|
39382
40815
|
clientId: "Client ID",
|
|
39383
40816
|
clientSecret: "Client secret",
|
|
40817
|
+
scopes: "Scopes (space-separated)",
|
|
40818
|
+
audience: "Audience",
|
|
39384
40819
|
appSlug: "GitHub App slug",
|
|
39385
|
-
envName: "Env var name"
|
|
40820
|
+
envName: "Env var name",
|
|
40821
|
+
caData: "Cluster CA certificate"
|
|
39386
40822
|
};
|
|
39387
40823
|
function labelFor(key) {
|
|
39388
40824
|
return FIELD_LABELS[key] ?? key;
|
|
@@ -42876,9 +44312,8 @@ function connectRawBridge({
|
|
|
42876
44312
|
let settled = false;
|
|
42877
44313
|
const proto = host.startsWith("https://") ? "wss:" : "ws:";
|
|
42878
44314
|
const base = host.replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
42879
|
-
const
|
|
42880
|
-
|
|
42881
|
-
);
|
|
44315
|
+
const url2 = `${proto}//${base}/api/agents/${encodeURIComponent(agentId)}/ssh?token=${encodeURIComponent(token)}`;
|
|
44316
|
+
const ws = new wrapper_default(url2, { agent: proxyAgentForUrl(url2) });
|
|
42882
44317
|
ws.binaryType = "nodebuffer";
|
|
42883
44318
|
const onStdin = (chunk) => {
|
|
42884
44319
|
if (ws.readyState === wrapper_default.OPEN) ws.send(chunk, { binary: true });
|
|
@@ -43417,6 +44852,213 @@ function composeSshModule(opts) {
|
|
|
43417
44852
|
return { commands: [buildSshCommand(opts)] };
|
|
43418
44853
|
}
|
|
43419
44854
|
|
|
44855
|
+
// src/modules/metrics/commands/show.ts
|
|
44856
|
+
var secs = (ms) => `${(ms / 1e3).toFixed(1)}s`;
|
|
44857
|
+
function buildMetricsCommand(deps) {
|
|
44858
|
+
return new Command("metrics").description(
|
|
44859
|
+
"Show an Agent's run metrics \u2014 token spend, runtime, and context usage"
|
|
44860
|
+
).argument("<agent>", "Agent Ref \u2014 name or 'agent-\u2026' ID").option(
|
|
44861
|
+
"--since <hours>",
|
|
44862
|
+
"lookback window in hours (max 720; default: all time)"
|
|
44863
|
+
).option("--session <id>", "narrow to one session").option(
|
|
44864
|
+
"--limit <n>",
|
|
44865
|
+
"max recent calls to include (default 100, max 1000)"
|
|
44866
|
+
).option(
|
|
44867
|
+
"--server <url>",
|
|
44868
|
+
"override the configured server URL for this call"
|
|
44869
|
+
).option("--json", "emit raw JSON instead of the default report").addHelpText(
|
|
44870
|
+
"after",
|
|
44871
|
+
"\nExamples:\n dam metrics my-agent\n dam metrics my-agent --session sess-abc123\n dam metrics agent-abc123 --since 168 --json\n"
|
|
44872
|
+
).action(
|
|
44873
|
+
async (ref, opts) => {
|
|
44874
|
+
const host = await resolveActiveHost(deps, {
|
|
44875
|
+
flag: opts.server ? { server: opts.server } : void 0,
|
|
44876
|
+
exitCodes: {
|
|
44877
|
+
runtimeFailure: EXIT_RUNTIME_FAILURE,
|
|
44878
|
+
belowFloor: EXIT_BELOW_FLOOR
|
|
44879
|
+
}
|
|
44880
|
+
});
|
|
44881
|
+
const resolved = await createAgentResolver({
|
|
44882
|
+
agentService: deps.createAgentService(host)
|
|
44883
|
+
}).resolve(ref);
|
|
44884
|
+
if (!resolved.ok) {
|
|
44885
|
+
printResolveError(resolved.error, host);
|
|
44886
|
+
process.exit(exitCodeForResolveError(resolved.error));
|
|
44887
|
+
}
|
|
44888
|
+
const agent = resolved.value;
|
|
44889
|
+
const fetchTitles = async () => {
|
|
44890
|
+
const tok = await deps.tokenProvider.getValidAccessToken(host);
|
|
44891
|
+
if (!tok.ok) return /* @__PURE__ */ new Map();
|
|
44892
|
+
const sessions = await deps.createSessionsPort(host, tok.value).list(agent.id);
|
|
44893
|
+
if (!sessions.ok) return /* @__PURE__ */ new Map();
|
|
44894
|
+
return new Map(
|
|
44895
|
+
sessions.value.filter((s) => s.title).map((s) => [s.sessionId, s.title])
|
|
44896
|
+
);
|
|
44897
|
+
};
|
|
44898
|
+
const sinceHours = opts.since ? Number(opts.since) : void 0;
|
|
44899
|
+
const [result, titles] = await Promise.all([
|
|
44900
|
+
deps.createMetricsService(host).overview({
|
|
44901
|
+
agentId: agent.id,
|
|
44902
|
+
sessionId: opts.session,
|
|
44903
|
+
sinceHours,
|
|
44904
|
+
limit: opts.limit ? Number(opts.limit) : 100
|
|
44905
|
+
}),
|
|
44906
|
+
fetchTitles().catch(() => /* @__PURE__ */ new Map())
|
|
44907
|
+
]);
|
|
44908
|
+
if (!result.ok) {
|
|
44909
|
+
printServiceError(result.error, host);
|
|
44910
|
+
process.exit(EXIT_RUNTIME_FAILURE);
|
|
44911
|
+
}
|
|
44912
|
+
const { tokenSpendByModel, contextPerCall } = result.value;
|
|
44913
|
+
const runtimeBySession = result.value.runtimeBySession.map((r) => ({
|
|
44914
|
+
...r,
|
|
44915
|
+
title: titles.get(r.sessionId) ?? null
|
|
44916
|
+
}));
|
|
44917
|
+
const windowLabel = [
|
|
44918
|
+
opts.session && `session ${opts.session}`,
|
|
44919
|
+
sinceHours !== void 0 && `last ${sinceHours}h`
|
|
44920
|
+
].filter(Boolean).join(" \xB7 ") || "all time";
|
|
44921
|
+
if (opts.json) {
|
|
44922
|
+
return writeStdoutAndExit(
|
|
44923
|
+
`${JSON.stringify({
|
|
44924
|
+
agentId: agent.id,
|
|
44925
|
+
sessionId: opts.session,
|
|
44926
|
+
sinceHours,
|
|
44927
|
+
tokenSpendByModel,
|
|
44928
|
+
runtimeBySession,
|
|
44929
|
+
contextPerCall
|
|
44930
|
+
})}
|
|
44931
|
+
`,
|
|
44932
|
+
EXIT_SUCCESS
|
|
44933
|
+
);
|
|
44934
|
+
}
|
|
44935
|
+
if (tokenSpendByModel.length === 0) {
|
|
44936
|
+
process.stderr.write(
|
|
44937
|
+
`No metrics for ${agent.name} in ${windowLabel}.
|
|
44938
|
+
`
|
|
44939
|
+
);
|
|
44940
|
+
process.exit(EXIT_SUCCESS);
|
|
44941
|
+
}
|
|
44942
|
+
const totalCalls = tokenSpendByModel.reduce((n, r) => n + r.calls, 0);
|
|
44943
|
+
const totalCost = tokenSpendByModel.reduce((n, r) => n + r.costUsd, 0);
|
|
44944
|
+
const totalApiMs = runtimeBySession.reduce(
|
|
44945
|
+
(n, r) => n + r.totalDurationMs,
|
|
44946
|
+
0
|
|
44947
|
+
);
|
|
44948
|
+
const summary = renderTable([
|
|
44949
|
+
["AGENT", `${agent.name} (${agent.id})`],
|
|
44950
|
+
["WINDOW", windowLabel],
|
|
44951
|
+
["API CALLS", String(totalCalls)],
|
|
44952
|
+
["SESSIONS", String(runtimeBySession.length)],
|
|
44953
|
+
["API TIME", secs(totalApiMs)],
|
|
44954
|
+
["COST USD", totalCost.toFixed(4)]
|
|
44955
|
+
]);
|
|
44956
|
+
const byModel = renderTable([
|
|
44957
|
+
[
|
|
44958
|
+
"MODEL",
|
|
44959
|
+
"CALLS",
|
|
44960
|
+
"INPUT",
|
|
44961
|
+
"OUTPUT",
|
|
44962
|
+
"CACHE R",
|
|
44963
|
+
"CACHE W",
|
|
44964
|
+
"COST USD"
|
|
44965
|
+
],
|
|
44966
|
+
...tokenSpendByModel.map((r) => [
|
|
44967
|
+
r.model,
|
|
44968
|
+
String(r.calls),
|
|
44969
|
+
r.inputTokens.toLocaleString(),
|
|
44970
|
+
r.outputTokens.toLocaleString(),
|
|
44971
|
+
r.cacheReadTokens.toLocaleString(),
|
|
44972
|
+
r.cacheCreationTokens.toLocaleString(),
|
|
44973
|
+
r.costUsd.toFixed(4)
|
|
44974
|
+
])
|
|
44975
|
+
]);
|
|
44976
|
+
const bySession = renderFittedTable(
|
|
44977
|
+
[
|
|
44978
|
+
"SESSION",
|
|
44979
|
+
"CALLS",
|
|
44980
|
+
"API TIME",
|
|
44981
|
+
"INPUT",
|
|
44982
|
+
"OUTPUT",
|
|
44983
|
+
"CACHE R",
|
|
44984
|
+
"CACHE W",
|
|
44985
|
+
"COST USD",
|
|
44986
|
+
"LAST"
|
|
44987
|
+
],
|
|
44988
|
+
runtimeBySession.map((r) => [
|
|
44989
|
+
r.title ?? r.sessionId,
|
|
44990
|
+
String(r.calls),
|
|
44991
|
+
secs(r.totalDurationMs),
|
|
44992
|
+
r.inputTokens.toLocaleString(),
|
|
44993
|
+
r.outputTokens.toLocaleString(),
|
|
44994
|
+
r.cacheReadTokens.toLocaleString(),
|
|
44995
|
+
r.cacheCreationTokens.toLocaleString(),
|
|
44996
|
+
r.costUsd.toFixed(4),
|
|
44997
|
+
r.lastAt
|
|
44998
|
+
]),
|
|
44999
|
+
0
|
|
45000
|
+
);
|
|
45001
|
+
const recent = renderTable([
|
|
45002
|
+
[
|
|
45003
|
+
"TIME",
|
|
45004
|
+
"MODEL",
|
|
45005
|
+
"CONTEXT",
|
|
45006
|
+
"INPUT",
|
|
45007
|
+
"CACHE R",
|
|
45008
|
+
"OUTPUT",
|
|
45009
|
+
"COST USD"
|
|
45010
|
+
],
|
|
45011
|
+
...contextPerCall.map((r) => [
|
|
45012
|
+
r.at,
|
|
45013
|
+
r.model,
|
|
45014
|
+
r.contextTokens.toLocaleString(),
|
|
45015
|
+
r.inputTokens.toLocaleString(),
|
|
45016
|
+
r.cacheReadTokens.toLocaleString(),
|
|
45017
|
+
r.outputTokens.toLocaleString(),
|
|
45018
|
+
r.costUsd.toFixed(4)
|
|
45019
|
+
])
|
|
45020
|
+
]);
|
|
45021
|
+
return writeStdoutAndExit(
|
|
45022
|
+
`${summary}
|
|
45023
|
+
TOKEN SPEND BY MODEL
|
|
45024
|
+
${byModel}
|
|
45025
|
+
SESSIONS
|
|
45026
|
+
${bySession}
|
|
45027
|
+
RECENT CALLS (context per call)
|
|
45028
|
+
${recent}`,
|
|
45029
|
+
EXIT_SUCCESS
|
|
45030
|
+
);
|
|
45031
|
+
}
|
|
45032
|
+
);
|
|
45033
|
+
}
|
|
45034
|
+
|
|
45035
|
+
// src/modules/metrics/services/metrics-service.ts
|
|
45036
|
+
function createMetricsService(deps) {
|
|
45037
|
+
return {
|
|
45038
|
+
async overview(query) {
|
|
45039
|
+
return trpcCall(() => deps.trpc.metrics.overview.query(query));
|
|
45040
|
+
}
|
|
45041
|
+
};
|
|
45042
|
+
}
|
|
45043
|
+
|
|
45044
|
+
// src/modules/metrics/compose.ts
|
|
45045
|
+
function composeMetricsModule(opts) {
|
|
45046
|
+
return {
|
|
45047
|
+
commands: [
|
|
45048
|
+
buildMetricsCommand({
|
|
45049
|
+
compatService: opts.compatService,
|
|
45050
|
+
configService: opts.configService,
|
|
45051
|
+
tokenProvider: opts.tokenProvider,
|
|
45052
|
+
createAgentService: opts.createAgentService,
|
|
45053
|
+
createSessionsPort: buildSessionsPort,
|
|
45054
|
+
createMetricsService: (host) => createMetricsService({
|
|
45055
|
+
trpc: createTrpcClient({ host, tokenProvider: opts.tokenProvider })
|
|
45056
|
+
})
|
|
45057
|
+
})
|
|
45058
|
+
]
|
|
45059
|
+
};
|
|
45060
|
+
}
|
|
45061
|
+
|
|
43420
45062
|
// src/modules/template/commands/list.ts
|
|
43421
45063
|
var DESCRIPTION_MAX = 60;
|
|
43422
45064
|
function buildListCommand8(deps) {
|
|
@@ -43603,6 +45245,12 @@ function compose(opts = {}) {
|
|
|
43603
45245
|
compatService: cli.services.compatService,
|
|
43604
45246
|
createAgentService: agent.exports.createService
|
|
43605
45247
|
});
|
|
45248
|
+
const metrics = composeMetricsModule({
|
|
45249
|
+
tokenProvider: auth.exports.tokenProvider,
|
|
45250
|
+
configService: cli.services.configService,
|
|
45251
|
+
compatService: cli.services.compatService,
|
|
45252
|
+
createAgentService: agent.exports.createService
|
|
45253
|
+
});
|
|
43606
45254
|
const program3 = new Command();
|
|
43607
45255
|
program3.name("dam").description("Command-line client for a Platform deployment").version(cli.cliVersion);
|
|
43608
45256
|
for (const command of cli.commands) program3.addCommand(command);
|
|
@@ -43619,6 +45267,7 @@ function compose(opts = {}) {
|
|
|
43619
45267
|
for (const command of skill.commands) program3.addCommand(command);
|
|
43620
45268
|
for (const command of ssh.commands) program3.addCommand(command);
|
|
43621
45269
|
for (const command of channel.commands) program3.addCommand(command);
|
|
45270
|
+
for (const command of metrics.commands) program3.addCommand(command);
|
|
43622
45271
|
return program3;
|
|
43623
45272
|
}
|
|
43624
45273
|
|