@dam-agents/cli 0.2.5-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 +2157 -514
- package/package.json +5 -3
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) {
|
|
@@ -25469,6 +26724,107 @@ var envVarSchema = external_exports.object({
|
|
|
25469
26724
|
value: external_exports.string().max(1e4)
|
|
25470
26725
|
});
|
|
25471
26726
|
|
|
26727
|
+
// ../api-server-api/src/modules/skills/schemas.ts
|
|
26728
|
+
var skillSourcePathSchema = external_exports.string().transform((p2) => p2.trim().replace(/^\/+|\/+$/g, "")).refine((p2) => !p2.split("/").includes(".."), "path must not contain '..'");
|
|
26729
|
+
var skillSourceSchema = external_exports.object({
|
|
26730
|
+
id: external_exports.string(),
|
|
26731
|
+
name: external_exports.string(),
|
|
26732
|
+
gitUrl: external_exports.string(),
|
|
26733
|
+
path: external_exports.string().optional(),
|
|
26734
|
+
/** True when the source is managed by the cluster admin
|
|
26735
|
+
* (Helm-seeded). Users can't delete it. */
|
|
26736
|
+
system: external_exports.boolean().optional(),
|
|
26737
|
+
/** Present when the source was declared by an agent template
|
|
26738
|
+
* (spec.skillSources). UI-only hint for the "Agent" badge —
|
|
26739
|
+
* backend treats template sources as read-only. */
|
|
26740
|
+
fromTemplate: external_exports.object({ templateId: external_exports.string(), templateName: external_exports.string() }).optional(),
|
|
26741
|
+
canPublish: external_exports.boolean().optional()
|
|
26742
|
+
});
|
|
26743
|
+
var skillPublishResultSchema = external_exports.object({
|
|
26744
|
+
prUrl: external_exports.string().url(),
|
|
26745
|
+
branch: external_exports.string()
|
|
26746
|
+
});
|
|
26747
|
+
var skillSchema = external_exports.object({
|
|
26748
|
+
source: external_exports.string(),
|
|
26749
|
+
name: external_exports.string(),
|
|
26750
|
+
description: external_exports.string(),
|
|
26751
|
+
version: external_exports.string(),
|
|
26752
|
+
contentHash: external_exports.string()
|
|
26753
|
+
});
|
|
26754
|
+
var skillRefSchema = external_exports.object({
|
|
26755
|
+
source: external_exports.string(),
|
|
26756
|
+
name: external_exports.string(),
|
|
26757
|
+
version: external_exports.string(),
|
|
26758
|
+
/** Deterministic SHA-256 of the skill directory's file contents at
|
|
26759
|
+
* install time. Compared to the scanner's contentHash to flag drift.
|
|
26760
|
+
* Optional for backward compatibility with installs that pre-date
|
|
26761
|
+
* this field. */
|
|
26762
|
+
contentHash: external_exports.string().optional(),
|
|
26763
|
+
/** Source subdir the skill was installed from, denormalized so the apply
|
|
26764
|
+
* path resolves the skill dir without re-reading the source. */
|
|
26765
|
+
path: external_exports.string().optional()
|
|
26766
|
+
});
|
|
26767
|
+
var localSkillSchema = external_exports.object({
|
|
26768
|
+
name: external_exports.string(),
|
|
26769
|
+
description: external_exports.string(),
|
|
26770
|
+
skillPath: external_exports.string()
|
|
26771
|
+
});
|
|
26772
|
+
var skillPublishRecordSchema = external_exports.object({
|
|
26773
|
+
skillName: external_exports.string(),
|
|
26774
|
+
sourceId: external_exports.string(),
|
|
26775
|
+
sourceName: external_exports.string(),
|
|
26776
|
+
sourceGitUrl: external_exports.string(),
|
|
26777
|
+
prUrl: external_exports.string(),
|
|
26778
|
+
/** ISO 8601 timestamp. */
|
|
26779
|
+
publishedAt: external_exports.string()
|
|
26780
|
+
});
|
|
26781
|
+
var skillStateOutputSchema = external_exports.object({
|
|
26782
|
+
installed: external_exports.array(skillRefSchema),
|
|
26783
|
+
standalone: external_exports.array(localSkillSchema),
|
|
26784
|
+
instancePublishes: external_exports.array(skillPublishRecordSchema)
|
|
26785
|
+
});
|
|
26786
|
+
var skillListSourcesInputSchema = external_exports.object({ agentId: external_exports.string().min(1).optional() }).optional();
|
|
26787
|
+
var skillCreateSourceInputSchema = external_exports.object({
|
|
26788
|
+
name: external_exports.string().min(1).max(128),
|
|
26789
|
+
gitUrl: external_exports.string().url(),
|
|
26790
|
+
path: skillSourcePathSchema.optional()
|
|
26791
|
+
});
|
|
26792
|
+
var skillDeleteSourceInputSchema = external_exports.object({
|
|
26793
|
+
id: external_exports.string().min(1)
|
|
26794
|
+
});
|
|
26795
|
+
var skillRefreshSourceInputSchema = external_exports.object({
|
|
26796
|
+
id: external_exports.string().min(1)
|
|
26797
|
+
});
|
|
26798
|
+
var skillListInputSchema = external_exports.object({
|
|
26799
|
+
sourceId: external_exports.string().min(1),
|
|
26800
|
+
agentId: external_exports.string().min(1).optional()
|
|
26801
|
+
});
|
|
26802
|
+
var skillInstallInputSchema = external_exports.object({
|
|
26803
|
+
agentId: external_exports.string().min(1),
|
|
26804
|
+
source: external_exports.string().url(),
|
|
26805
|
+
name: external_exports.string().min(1),
|
|
26806
|
+
version: external_exports.string().min(1),
|
|
26807
|
+
contentHash: external_exports.string().optional()
|
|
26808
|
+
});
|
|
26809
|
+
var skillUninstallInputSchema = external_exports.object({
|
|
26810
|
+
agentId: external_exports.string().min(1),
|
|
26811
|
+
source: external_exports.string().url(),
|
|
26812
|
+
name: external_exports.string().min(1)
|
|
26813
|
+
});
|
|
26814
|
+
var skillListLocalInputSchema = external_exports.object({
|
|
26815
|
+
agentId: external_exports.string().min(1)
|
|
26816
|
+
});
|
|
26817
|
+
var skillStateInputSchema = external_exports.object({
|
|
26818
|
+
agentId: external_exports.string().min(1)
|
|
26819
|
+
});
|
|
26820
|
+
var skillPublishInputSchema = external_exports.object({
|
|
26821
|
+
agentId: external_exports.string().min(1),
|
|
26822
|
+
sourceId: external_exports.string().min(1),
|
|
26823
|
+
name: external_exports.string().min(1),
|
|
26824
|
+
title: external_exports.string().optional(),
|
|
26825
|
+
body: external_exports.string().optional()
|
|
26826
|
+
});
|
|
26827
|
+
|
|
25472
26828
|
// ../api-server-api/src/modules/templates/schemas.ts
|
|
25473
26829
|
var templateGetInputSchema = external_exports.object({
|
|
25474
26830
|
id: external_exports.string().min(1)
|
|
@@ -25488,14 +26844,19 @@ var envVarConfigMapSchema = external_exports.object({
|
|
|
25488
26844
|
});
|
|
25489
26845
|
var skillSourceSeedSchema = external_exports.object({
|
|
25490
26846
|
name: external_exports.string(),
|
|
25491
|
-
gitUrl: external_exports.string()
|
|
26847
|
+
gitUrl: external_exports.string(),
|
|
26848
|
+
path: skillSourcePathSchema.optional()
|
|
25492
26849
|
});
|
|
25493
26850
|
var templateCategorySchema = external_exports.enum(["harness", "preconfigured"]).default("harness");
|
|
25494
26851
|
var templateSpecSchema = external_exports.object({
|
|
25495
26852
|
version: external_exports.string(),
|
|
25496
26853
|
image: external_exports.string(),
|
|
26854
|
+
name: external_exports.string().optional(),
|
|
25497
26855
|
description: external_exports.string().optional(),
|
|
25498
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(),
|
|
25499
26860
|
experimental: external_exports.boolean().optional(),
|
|
25500
26861
|
mounts: external_exports.array(mountSchema).optional(),
|
|
25501
26862
|
init: external_exports.string().optional(),
|
|
@@ -25507,7 +26868,13 @@ var templateSpecSchema = external_exports.object({
|
|
|
25507
26868
|
// (e.g. experimental external agents). Carried onto the agent spec so the
|
|
25508
26869
|
// pod can pull the image without the user entering registry credentials.
|
|
25509
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(),
|
|
25510
26875
|
storageSize: external_exports.string().optional(),
|
|
26876
|
+
runtimeClassName: external_exports.string().optional(),
|
|
26877
|
+
nodeSelector: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
25511
26878
|
skillSources: external_exports.array(skillSourceSeedSchema).optional()
|
|
25512
26879
|
}).passthrough();
|
|
25513
26880
|
|
|
@@ -25525,6 +26892,321 @@ var repoSchema = external_exports.object({
|
|
|
25525
26892
|
compatibleTemplates: external_exports.array(external_exports.string()).default([])
|
|
25526
26893
|
});
|
|
25527
26894
|
|
|
26895
|
+
// ../agent-runtime-api/src/modules/files/schemas.ts
|
|
26896
|
+
var pathSchema = external_exports.string().min(1);
|
|
26897
|
+
var fileListDirsInputSchema = external_exports.object({
|
|
26898
|
+
paths: external_exports.array(external_exports.string()).max(500)
|
|
26899
|
+
});
|
|
26900
|
+
var fileReadInputSchema = external_exports.object({ path: pathSchema });
|
|
26901
|
+
var fileWriteInputSchema = external_exports.object({
|
|
26902
|
+
path: pathSchema,
|
|
26903
|
+
content: external_exports.string(),
|
|
26904
|
+
expectedMtimeMs: external_exports.number().optional()
|
|
26905
|
+
});
|
|
26906
|
+
var fileCreateInputSchema = external_exports.object({
|
|
26907
|
+
path: pathSchema,
|
|
26908
|
+
content: external_exports.string()
|
|
26909
|
+
});
|
|
26910
|
+
var fileMkdirInputSchema = external_exports.object({ path: pathSchema });
|
|
26911
|
+
var fileRenameInputSchema = external_exports.object({
|
|
26912
|
+
from: pathSchema,
|
|
26913
|
+
to: pathSchema,
|
|
26914
|
+
overwrite: external_exports.boolean().optional()
|
|
26915
|
+
});
|
|
26916
|
+
var fileRemoveInputSchema = external_exports.object({ path: pathSchema });
|
|
26917
|
+
var fileUploadInputSchema = external_exports.object({
|
|
26918
|
+
path: pathSchema,
|
|
26919
|
+
contentBase64: external_exports.string(),
|
|
26920
|
+
/** Browser-reported MIME (File.type). Carried in the API for observability
|
|
26921
|
+
* and forward-compat; server-side reads still detect MIME from magic
|
|
26922
|
+
* bytes so we don't need to persist this. */
|
|
26923
|
+
contentType: external_exports.string().max(255).optional(),
|
|
26924
|
+
overwrite: external_exports.boolean().optional()
|
|
26925
|
+
});
|
|
26926
|
+
|
|
26927
|
+
// ../agent-runtime-api/src/modules/skills/schemas.ts
|
|
26928
|
+
var skillInstallInputSchema2 = external_exports.object({
|
|
26929
|
+
sourceUrl: external_exports.string().min(1),
|
|
26930
|
+
name: external_exports.string().min(1),
|
|
26931
|
+
version: external_exports.string().min(1),
|
|
26932
|
+
skillPaths: external_exports.array(external_exports.string().min(1)).min(1),
|
|
26933
|
+
path: external_exports.string().optional()
|
|
26934
|
+
});
|
|
26935
|
+
var skillUninstallInputSchema2 = external_exports.object({
|
|
26936
|
+
name: external_exports.string().min(1),
|
|
26937
|
+
skillPaths: external_exports.array(external_exports.string().min(1)).min(1)
|
|
26938
|
+
});
|
|
26939
|
+
var skillScanInputSchema = external_exports.object({
|
|
26940
|
+
source: external_exports.string().min(1),
|
|
26941
|
+
path: external_exports.string().optional()
|
|
26942
|
+
});
|
|
26943
|
+
var skillPublishInputSchema2 = external_exports.object({
|
|
26944
|
+
name: external_exports.string().min(1),
|
|
26945
|
+
owner: external_exports.string().min(1),
|
|
26946
|
+
repo: external_exports.string().min(1),
|
|
26947
|
+
title: external_exports.string().min(1),
|
|
26948
|
+
body: external_exports.string(),
|
|
26949
|
+
// Source subdir the skill is published into; mirrors the scanner so a
|
|
26950
|
+
// subdir source's own scan finds what was published back to it.
|
|
26951
|
+
path: external_exports.string().optional()
|
|
26952
|
+
});
|
|
26953
|
+
var skillReadLocalInputSchema = external_exports.object({
|
|
26954
|
+
name: external_exports.string().min(1)
|
|
26955
|
+
});
|
|
26956
|
+
|
|
26957
|
+
// ../agent-runtime-api/src/modules/ssh/schemas.ts
|
|
26958
|
+
var sshAuthorizeKeyInputSchema = external_exports.object({
|
|
26959
|
+
publicKey: external_exports.string().min(1).max(8192).refine((s) => !/[\r\n]/.test(s), "must be a single line")
|
|
26960
|
+
});
|
|
26961
|
+
|
|
26962
|
+
// ../agent-runtime-api/src/modules/import/types.ts
|
|
26963
|
+
var importBundleResultSchema = external_exports.object({
|
|
26964
|
+
filesWritten: external_exports.number().int().nonnegative(),
|
|
26965
|
+
bytes: external_exports.number().int().nonnegative(),
|
|
26966
|
+
durationMs: external_exports.number().int().nonnegative()
|
|
26967
|
+
});
|
|
26968
|
+
|
|
26969
|
+
// ../agent-runtime-api/src/modules/runtime/types.ts
|
|
26970
|
+
var contributionKind = external_exports.enum([
|
|
26971
|
+
"env",
|
|
26972
|
+
"egress-allow",
|
|
26973
|
+
"egress-inject",
|
|
26974
|
+
"file",
|
|
26975
|
+
"mcp-entry",
|
|
26976
|
+
"skill-ref"
|
|
26977
|
+
]);
|
|
26978
|
+
var eventKind = external_exports.enum([
|
|
26979
|
+
"trigger",
|
|
26980
|
+
"schedule-reset",
|
|
26981
|
+
"workspace-seed",
|
|
26982
|
+
"experiment-trigger",
|
|
26983
|
+
"harness-config"
|
|
26984
|
+
]);
|
|
26985
|
+
var mergeMode = external_exports.enum([
|
|
26986
|
+
"overwrite",
|
|
26987
|
+
"section-marker",
|
|
26988
|
+
"key-targeted",
|
|
26989
|
+
"yaml-fill-if-missing"
|
|
26990
|
+
]);
|
|
26991
|
+
var fileFormat = external_exports.enum(["yaml", "json", "text", "ini", "toml"]);
|
|
26992
|
+
var envContribution = external_exports.object({
|
|
26993
|
+
kind: external_exports.literal("env"),
|
|
26994
|
+
name: external_exports.string().min(1),
|
|
26995
|
+
placeholder: external_exports.string()
|
|
26996
|
+
});
|
|
26997
|
+
var egressPort = external_exports.number().int().min(1).max(65535).optional();
|
|
26998
|
+
var egressAllowContribution = external_exports.object({
|
|
26999
|
+
kind: external_exports.literal("egress-allow"),
|
|
27000
|
+
host: external_exports.string().min(1),
|
|
27001
|
+
port: egressPort,
|
|
27002
|
+
pathPattern: external_exports.string().optional()
|
|
27003
|
+
});
|
|
27004
|
+
var egressInjectContribution = external_exports.object({
|
|
27005
|
+
kind: external_exports.literal("egress-inject"),
|
|
27006
|
+
host: external_exports.string().min(1),
|
|
27007
|
+
pathPattern: external_exports.string().optional(),
|
|
27008
|
+
headerName: external_exports.string().min(1),
|
|
27009
|
+
valueFormat: external_exports.string().min(1),
|
|
27010
|
+
encoding: external_exports.literal("basic-x-access-token").optional(),
|
|
27011
|
+
// Moves the value into this query param instead of the header; restricted to unreserved chars since the Lua treats it as a trusted literal.
|
|
27012
|
+
queryParamName: external_exports.string().regex(/^[A-Za-z0-9_.~-]+$/).optional(),
|
|
27013
|
+
// Terminate this host's gateway chain as HTTP/2 so injection lands on a gRPC
|
|
27014
|
+
// stream (e.g. Modal's x-modal-token-* metadata). Flows to the injection-hosts
|
|
27015
|
+
// annotation the controller reads. Omit for HTTP/1.1 REST hosts.
|
|
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()
|
|
27023
|
+
});
|
|
27024
|
+
var fileContribution = external_exports.object({
|
|
27025
|
+
kind: external_exports.literal("file"),
|
|
27026
|
+
path: external_exports.string().min(1),
|
|
27027
|
+
format: fileFormat,
|
|
27028
|
+
mergeMode,
|
|
27029
|
+
content: external_exports.unknown().optional()
|
|
27030
|
+
});
|
|
27031
|
+
var mcpEntryContribution = external_exports.object({
|
|
27032
|
+
kind: external_exports.literal("mcp-entry"),
|
|
27033
|
+
name: external_exports.string().min(1),
|
|
27034
|
+
url: external_exports.string().url(),
|
|
27035
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).optional()
|
|
27036
|
+
});
|
|
27037
|
+
var skillRefContribution = external_exports.object({
|
|
27038
|
+
kind: external_exports.literal("skill-ref"),
|
|
27039
|
+
sourceUrl: external_exports.string().min(1),
|
|
27040
|
+
name: external_exports.string().min(1),
|
|
27041
|
+
version: external_exports.string().min(1),
|
|
27042
|
+
path: external_exports.string().optional()
|
|
27043
|
+
});
|
|
27044
|
+
var contribution = external_exports.discriminatedUnion("kind", [
|
|
27045
|
+
envContribution,
|
|
27046
|
+
egressAllowContribution,
|
|
27047
|
+
egressInjectContribution,
|
|
27048
|
+
fileContribution,
|
|
27049
|
+
mcpEntryContribution,
|
|
27050
|
+
skillRefContribution
|
|
27051
|
+
]);
|
|
27052
|
+
var triggerEventPayload = external_exports.object({
|
|
27053
|
+
scheduleId: external_exports.string().min(1),
|
|
27054
|
+
task: external_exports.string().min(1),
|
|
27055
|
+
sessionMode: external_exports.enum(["continuous", "fresh"]).optional(),
|
|
27056
|
+
mcpServers: external_exports.array(external_exports.unknown()).optional()
|
|
27057
|
+
});
|
|
27058
|
+
var triggerEvent = external_exports.object({
|
|
27059
|
+
id: external_exports.string().min(1),
|
|
27060
|
+
kind: external_exports.literal("trigger"),
|
|
27061
|
+
version: external_exports.number().int().nonnegative(),
|
|
27062
|
+
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27063
|
+
payload: triggerEventPayload
|
|
27064
|
+
});
|
|
27065
|
+
var scheduleResetEventPayload = external_exports.object({
|
|
27066
|
+
scheduleId: external_exports.string().min(1)
|
|
27067
|
+
});
|
|
27068
|
+
var scheduleResetEvent = external_exports.object({
|
|
27069
|
+
id: external_exports.string().min(1),
|
|
27070
|
+
kind: external_exports.literal("schedule-reset"),
|
|
27071
|
+
version: external_exports.number().int().nonnegative(),
|
|
27072
|
+
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27073
|
+
payload: scheduleResetEventPayload
|
|
27074
|
+
});
|
|
27075
|
+
var workspaceSeedEventPayload = external_exports.object({
|
|
27076
|
+
url: external_exports.string().min(1),
|
|
27077
|
+
/** Branch or tag to clone; omitted = the repo's default branch. */
|
|
27078
|
+
ref: external_exports.string().min(1).optional()
|
|
27079
|
+
});
|
|
27080
|
+
var workspaceSeedEvent = external_exports.object({
|
|
27081
|
+
id: external_exports.string().min(1),
|
|
27082
|
+
kind: external_exports.literal("workspace-seed"),
|
|
27083
|
+
version: external_exports.number().int().nonnegative(),
|
|
27084
|
+
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27085
|
+
payload: workspaceSeedEventPayload
|
|
27086
|
+
});
|
|
27087
|
+
var experimentTriggerEventPayload = external_exports.object({
|
|
27088
|
+
experimentId: external_exports.string().min(1),
|
|
27089
|
+
task: external_exports.string().min(1)
|
|
27090
|
+
});
|
|
27091
|
+
var experimentTriggerEvent = external_exports.object({
|
|
27092
|
+
id: external_exports.string().min(1),
|
|
27093
|
+
kind: external_exports.literal("experiment-trigger"),
|
|
27094
|
+
version: external_exports.number().int().nonnegative(),
|
|
27095
|
+
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27096
|
+
payload: experimentTriggerEventPayload
|
|
27097
|
+
});
|
|
27098
|
+
var harnessConfigEventPayload = external_exports.object({
|
|
27099
|
+
model: external_exports.string().min(1).optional(),
|
|
27100
|
+
mode: external_exports.string().min(1).optional(),
|
|
27101
|
+
configOptions: external_exports.record(external_exports.string().min(1), external_exports.string()).optional(),
|
|
27102
|
+
unset: external_exports.array(external_exports.string().min(1)).optional()
|
|
27103
|
+
});
|
|
27104
|
+
var harnessConfigEvent = external_exports.object({
|
|
27105
|
+
id: external_exports.string().min(1),
|
|
27106
|
+
kind: external_exports.literal("harness-config"),
|
|
27107
|
+
version: external_exports.number().int().nonnegative(),
|
|
27108
|
+
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
27109
|
+
payload: harnessConfigEventPayload
|
|
27110
|
+
});
|
|
27111
|
+
var event = external_exports.discriminatedUnion("kind", [
|
|
27112
|
+
triggerEvent,
|
|
27113
|
+
scheduleResetEvent,
|
|
27114
|
+
workspaceSeedEvent,
|
|
27115
|
+
experimentTriggerEvent,
|
|
27116
|
+
harnessConfigEvent
|
|
27117
|
+
]);
|
|
27118
|
+
var harnessConfigChoice = external_exports.object({
|
|
27119
|
+
value: external_exports.string().min(1),
|
|
27120
|
+
name: external_exports.string().min(1),
|
|
27121
|
+
description: external_exports.string().optional()
|
|
27122
|
+
});
|
|
27123
|
+
var harnessConfigOptionGroup = external_exports.object({
|
|
27124
|
+
// "model", "mode", or a configOption id (e.g. "effort").
|
|
27125
|
+
id: external_exports.string().min(1),
|
|
27126
|
+
name: external_exports.string().min(1),
|
|
27127
|
+
description: external_exports.string().optional(),
|
|
27128
|
+
// ACP-style category: "model" | "mode" | "thought_level" | …
|
|
27129
|
+
category: external_exports.string().min(1),
|
|
27130
|
+
choices: external_exports.array(harnessConfigChoice)
|
|
27131
|
+
});
|
|
27132
|
+
var harnessConfigCatalog = external_exports.object({
|
|
27133
|
+
options: external_exports.array(harnessConfigOptionGroup),
|
|
27134
|
+
// Per-model validity: allowed choice values per gated group. Model absent =
|
|
27135
|
+
// all allowed; empty array = group hidden for that model (e.g. Haiku effort).
|
|
27136
|
+
modelConstraints: external_exports.record(external_exports.string().min(1), external_exports.record(external_exports.string().min(1), external_exports.array(external_exports.string()))).optional()
|
|
27137
|
+
});
|
|
27138
|
+
var capabilities = external_exports.object({
|
|
27139
|
+
contributions: external_exports.array(contributionKind),
|
|
27140
|
+
events: external_exports.array(eventKind),
|
|
27141
|
+
// Whether the harness declares a config mapping (gates the UI panel). Optional
|
|
27142
|
+
// for forward-compat with agents that predate it.
|
|
27143
|
+
harnessConfig: external_exports.boolean().optional(),
|
|
27144
|
+
// The option catalog from the harness's manifest (absent → UI hides the panel).
|
|
27145
|
+
harnessConfigCatalog: harnessConfigCatalog.optional()
|
|
27146
|
+
});
|
|
27147
|
+
var stateSlice = external_exports.object({
|
|
27148
|
+
contributions: external_exports.array(contribution),
|
|
27149
|
+
hash: external_exports.string().min(1)
|
|
27150
|
+
});
|
|
27151
|
+
var applyStateInput = external_exports.object({
|
|
27152
|
+
version: external_exports.number().int().positive(),
|
|
27153
|
+
state: stateSlice,
|
|
27154
|
+
events: external_exports.array(event)
|
|
27155
|
+
});
|
|
27156
|
+
var driverFailure = external_exports.object({
|
|
27157
|
+
kind: contributionKind,
|
|
27158
|
+
message: external_exports.string().min(1)
|
|
27159
|
+
});
|
|
27160
|
+
var applyStateResult = external_exports.discriminatedUnion("status", [
|
|
27161
|
+
// Processed: resulting cursor + any per-driver failures (empty on a fully clean apply).
|
|
27162
|
+
external_exports.object({
|
|
27163
|
+
status: external_exports.literal("ok"),
|
|
27164
|
+
appliedVersion: external_exports.number().int().nonnegative(),
|
|
27165
|
+
appliedHash: external_exports.string().min(1).nullable(),
|
|
27166
|
+
// null until the first clean settle
|
|
27167
|
+
failures: external_exports.array(driverFailure).default([]),
|
|
27168
|
+
settledEvents: external_exports.array(external_exports.string()).default([])
|
|
27169
|
+
}),
|
|
27170
|
+
// Contributions already at ≥ the requested version; worker reconciles. Events still apply (own version) — settledEvents reports which.
|
|
27171
|
+
external_exports.object({
|
|
27172
|
+
status: external_exports.literal("stale"),
|
|
27173
|
+
appliedVersion: external_exports.number().int().nonnegative(),
|
|
27174
|
+
settledEvents: external_exports.array(external_exports.string()).default([])
|
|
27175
|
+
})
|
|
27176
|
+
]);
|
|
27177
|
+
var helloInput = external_exports.object({
|
|
27178
|
+
lastAppliedVersion: external_exports.number().int().nonnegative().optional(),
|
|
27179
|
+
lastAppliedHash: external_exports.string().optional(),
|
|
27180
|
+
protocolVersion: external_exports.literal("v1"),
|
|
27181
|
+
agentRuntimeVersion: external_exports.string(),
|
|
27182
|
+
capabilities
|
|
27183
|
+
});
|
|
27184
|
+
var helloResult = external_exports.object({
|
|
27185
|
+
version: external_exports.number().int().positive().optional(),
|
|
27186
|
+
state: stateSlice.optional(),
|
|
27187
|
+
events: external_exports.array(event)
|
|
27188
|
+
});
|
|
27189
|
+
|
|
27190
|
+
// ../api-server-api/src/modules/harness-config/schemas.ts
|
|
27191
|
+
var agentConfigOptionsSchema = external_exports.record(external_exports.string().min(1), external_exports.string());
|
|
27192
|
+
var harnessConfigApplyInputSchema = external_exports.object({
|
|
27193
|
+
agentId: external_exports.string().min(1),
|
|
27194
|
+
model: external_exports.string().min(1).optional(),
|
|
27195
|
+
mode: external_exports.string().min(1).optional(),
|
|
27196
|
+
configOptions: agentConfigOptionsSchema.optional(),
|
|
27197
|
+
unset: external_exports.array(external_exports.string().min(1)).optional()
|
|
27198
|
+
});
|
|
27199
|
+
var harnessConfigStatusInputSchema = external_exports.object({
|
|
27200
|
+
agentId: external_exports.string().min(1)
|
|
27201
|
+
});
|
|
27202
|
+
var harnessConfigStatusSchema = external_exports.object({
|
|
27203
|
+
supported: external_exports.boolean(),
|
|
27204
|
+
catalog: harnessConfigCatalog.nullable()
|
|
27205
|
+
});
|
|
27206
|
+
var harnessConfigSettledSchema = external_exports.object({
|
|
27207
|
+
settled: external_exports.boolean()
|
|
27208
|
+
});
|
|
27209
|
+
|
|
25528
27210
|
// ../api-server-api/src/modules/egress-rules/schemas.ts
|
|
25529
27211
|
var ruleVerdictSchema = external_exports.enum(["allow", "deny"]);
|
|
25530
27212
|
var egressPresetSchema = external_exports.enum(["none", "trusted", "all"]);
|
|
@@ -25537,6 +27219,8 @@ var egressRuleCurrentPresetInputSchema = external_exports.object({
|
|
|
25537
27219
|
var egressRuleCreateInputSchema = external_exports.object({
|
|
25538
27220
|
agentId: external_exports.string().min(1),
|
|
25539
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(),
|
|
25540
27224
|
method: external_exports.string().min(1).default("*"),
|
|
25541
27225
|
pathPattern: external_exports.string().min(1).default("*"),
|
|
25542
27226
|
verdict: ruleVerdictSchema
|
|
@@ -25557,6 +27241,22 @@ var egressRuleApplyPresetInputSchema = external_exports.object({
|
|
|
25557
27241
|
|
|
25558
27242
|
// ../api-server-api/src/modules/agents/schemas.ts
|
|
25559
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
|
+
});
|
|
25560
27260
|
var agentCreateInputSchema = external_exports.object({
|
|
25561
27261
|
name: external_exports.string().min(1).refine((n) => !n.startsWith("agent-"), {
|
|
25562
27262
|
message: "agent name cannot start with 'agent-' (reserved for IDs)"
|
|
@@ -25573,16 +27273,24 @@ var agentCreateInputSchema = external_exports.object({
|
|
|
25573
27273
|
}).optional(),
|
|
25574
27274
|
allowedUserEmails: external_exports.array(external_exports.email()).optional(),
|
|
25575
27275
|
egressPreset: egressPresetSchema.optional(),
|
|
27276
|
+
// Per-agent idle timeout override in minutes (0 = never hibernate); omit to inherit the global default.
|
|
27277
|
+
hibernationTimeoutMin: external_exports.number().int().min(0).optional(),
|
|
25576
27278
|
// Optional: clone this public repo (optionally a branch/tag via `ref`) into
|
|
25577
27279
|
// the work dir once, via a one-shot `workspace-seed` event. Not enforced
|
|
25578
27280
|
// against the `gitRepos` catalog server-side — the clone runs in the
|
|
25579
27281
|
// egress-gated agent pod, so this reaches no URL the agent couldn't already
|
|
25580
27282
|
// reach itself.
|
|
25581
27283
|
gitRepo: external_exports.object({ url: external_exports.url(), ref: external_exports.string().min(1).optional() }).optional(),
|
|
25582
|
-
// Initial grants, settled into the spec at create so credentials
|
|
25583
|
-
// first snapshot and the gateway renders its chains once (no
|
|
25584
|
-
|
|
25585
|
-
connectionIds: external_exports.array(external_exports.string()).optional()
|
|
27284
|
+
// Initial connection grants, settled into the spec at create so credentials
|
|
27285
|
+
// ride the first snapshot and the gateway renders its chains once (no
|
|
27286
|
+
// readiness flap).
|
|
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()
|
|
25586
27294
|
}).refine((d2) => d2.templateId !== void 0 || d2.image !== void 0, {
|
|
25587
27295
|
message: "Either templateId or image is required"
|
|
25588
27296
|
});
|
|
@@ -25592,7 +27300,13 @@ var agentUpdateInputSchema = external_exports.object({
|
|
|
25592
27300
|
description: external_exports.string().optional(),
|
|
25593
27301
|
env: external_exports.array(envVarSchema).max(64).optional(),
|
|
25594
27302
|
secretRef: external_exports.string().optional(),
|
|
25595
|
-
allowedUserEmails: external_exports.array(external_exports.email()).optional()
|
|
27303
|
+
allowedUserEmails: external_exports.array(external_exports.email()).optional(),
|
|
27304
|
+
// Per-agent idle timeout override in minutes (0 = never hibernate); null clears it back to the global default.
|
|
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()
|
|
25596
27310
|
});
|
|
25597
27311
|
var agentConnectSlackInputSchema = external_exports.object({
|
|
25598
27312
|
id: external_exports.string().min(1),
|
|
@@ -25688,6 +27402,21 @@ var scheduleStatusSchema = external_exports.object({
|
|
|
25688
27402
|
lastResult: external_exports.string().optional()
|
|
25689
27403
|
});
|
|
25690
27404
|
|
|
27405
|
+
// ../api-server-api/src/modules/experiments/schemas.ts
|
|
27406
|
+
var armVariationSchema = external_exports.string();
|
|
27407
|
+
var experimentIdInputSchema = external_exports.object({
|
|
27408
|
+
id: external_exports.string().min(1)
|
|
27409
|
+
});
|
|
27410
|
+
var experimentCreateInputSchema = external_exports.object({
|
|
27411
|
+
name: external_exports.string().trim().min(1, "name is required").max(200),
|
|
27412
|
+
prompt: external_exports.string().trim().min(1, "prompt is required")
|
|
27413
|
+
});
|
|
27414
|
+
var experimentAddArmInputSchema = external_exports.object({
|
|
27415
|
+
experimentId: external_exports.string().min(1),
|
|
27416
|
+
agentId: external_exports.string().min(1),
|
|
27417
|
+
armVariation: armVariationSchema.default("")
|
|
27418
|
+
});
|
|
27419
|
+
|
|
25691
27420
|
// ../../node_modules/.pnpm/rrule@2.8.1/node_modules/rrule/dist/esm/index.js
|
|
25692
27421
|
var esm_exports = {};
|
|
25693
27422
|
__export(esm_exports, {
|
|
@@ -28731,55 +30460,6 @@ function parseHHMM(s) {
|
|
|
28731
30460
|
return h2 * 60 + mi;
|
|
28732
30461
|
}
|
|
28733
30462
|
|
|
28734
|
-
// ../api-server-api/src/modules/secrets/schemas.ts
|
|
28735
|
-
var presetSecretTypeSchema = external_exports.enum([
|
|
28736
|
-
"anthropic",
|
|
28737
|
-
"ibm-litellm",
|
|
28738
|
-
"openai",
|
|
28739
|
-
"bob"
|
|
28740
|
-
]);
|
|
28741
|
-
var hostPatternSchema = external_exports.string().min(1).max(253).refine((v2) => !v2.includes("*"), {
|
|
28742
|
-
message: "Wildcard host patterns are not supported. Please specify exact hostnames."
|
|
28743
|
-
});
|
|
28744
|
-
var envMappingSchema = external_exports.object({
|
|
28745
|
-
envName: external_exports.string().min(1).max(255).regex(ENV_NAME_RE, "envName must match [A-Z_][A-Z0-9_]*"),
|
|
28746
|
-
placeholder: external_exports.string().min(1).max(1e3)
|
|
28747
|
-
});
|
|
28748
|
-
var envMappingsSchema = external_exports.array(envMappingSchema).max(32);
|
|
28749
|
-
var secretCreateInputSchema = external_exports.object({
|
|
28750
|
-
type: presetSecretTypeSchema,
|
|
28751
|
-
name: external_exports.string().min(1).max(100),
|
|
28752
|
-
value: external_exports.string().min(1),
|
|
28753
|
-
envMappings: envMappingsSchema.optional()
|
|
28754
|
-
});
|
|
28755
|
-
var secretUpdateInputSchema = external_exports.object({
|
|
28756
|
-
id: external_exports.string().min(1),
|
|
28757
|
-
name: external_exports.string().min(1).max(100).optional(),
|
|
28758
|
-
value: external_exports.string().min(1).optional(),
|
|
28759
|
-
envMappings: envMappingsSchema.optional()
|
|
28760
|
-
});
|
|
28761
|
-
var secretDeleteInputSchema = external_exports.object({ id: external_exports.string().min(1) });
|
|
28762
|
-
var secretCreateGithubPatInputSchema = external_exports.object({
|
|
28763
|
-
name: external_exports.string().min(1).max(100),
|
|
28764
|
-
token: external_exports.string().min(1)
|
|
28765
|
-
});
|
|
28766
|
-
var secretUpdateGithubPatInputSchema = external_exports.object({
|
|
28767
|
-
apiSecretId: external_exports.string().min(1),
|
|
28768
|
-
gitSecretId: external_exports.string().min(1),
|
|
28769
|
-
token: external_exports.string().min(1)
|
|
28770
|
-
});
|
|
28771
|
-
var secretGetAgentAccessInputSchema = external_exports.object({
|
|
28772
|
-
agentId: external_exports.string().min(1)
|
|
28773
|
-
});
|
|
28774
|
-
var secretSetAgentAccessInputSchema = external_exports.object({
|
|
28775
|
-
agentId: external_exports.string().min(1),
|
|
28776
|
-
secretIds: external_exports.array(external_exports.string().min(1))
|
|
28777
|
-
});
|
|
28778
|
-
var secretTestAnthropicInputSchema = external_exports.object({
|
|
28779
|
-
value: external_exports.string().min(1),
|
|
28780
|
-
envName: external_exports.enum(["ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"])
|
|
28781
|
-
});
|
|
28782
|
-
|
|
28783
30463
|
// ../api-server-api/src/modules/connections/providers.ts
|
|
28784
30464
|
var DEFAULT_ENV_PLACEHOLDER = "dummy-placeholder";
|
|
28785
30465
|
var IBM_LITELLM_HOST = "ete-litellm.ai-models.vpc.res.ibm.com";
|
|
@@ -28798,6 +30478,12 @@ function ibmLitellmEnvMappings() {
|
|
|
28798
30478
|
{ envName: "OPENAI_MODEL", placeholder: "gpt-5.5" }
|
|
28799
30479
|
];
|
|
28800
30480
|
}
|
|
30481
|
+
function openaiEnvMappings() {
|
|
30482
|
+
return [
|
|
30483
|
+
{ envName: "OPENAI_API_KEY", placeholder: DEFAULT_ENV_PLACEHOLDER },
|
|
30484
|
+
{ envName: "OPENAI_BASE_URL", placeholder: "https://api.openai.com/v1" }
|
|
30485
|
+
];
|
|
30486
|
+
}
|
|
28801
30487
|
var BOB_HOST = "api.us-east.bob.ibm.com";
|
|
28802
30488
|
var BOB_PLACEHOLDER = "dummy-placeholder";
|
|
28803
30489
|
function bobEnvMappings(pins = {}) {
|
|
@@ -28873,9 +30559,7 @@ var PROVIDERS = {
|
|
|
28873
30559
|
key: "api-key",
|
|
28874
30560
|
label: "API Key",
|
|
28875
30561
|
templateId: "openai",
|
|
28876
|
-
defaultEnvMappings:
|
|
28877
|
-
{ envName: "OPENAI_API_KEY", placeholder: DEFAULT_ENV_PLACEHOLDER }
|
|
28878
|
-
]
|
|
30562
|
+
defaultEnvMappings: openaiEnvMappings()
|
|
28879
30563
|
}
|
|
28880
30564
|
]
|
|
28881
30565
|
},
|
|
@@ -28904,9 +30588,6 @@ var PROVIDERS = {
|
|
|
28904
30588
|
var PROVIDER_PRESET_TYPES = Object.keys(
|
|
28905
30589
|
PROVIDERS
|
|
28906
30590
|
);
|
|
28907
|
-
function isProviderPresetType(type) {
|
|
28908
|
-
return type in PROVIDERS;
|
|
28909
|
-
}
|
|
28910
30591
|
var TEMPLATE_TO_PROVIDER = new Map(
|
|
28911
30592
|
PROVIDER_PRESET_TYPES.flatMap(
|
|
28912
30593
|
(type) => PROVIDERS[type].modes.map(
|
|
@@ -28928,230 +30609,6 @@ function templateIdForProvider(type, value) {
|
|
|
28928
30609
|
return (matched ?? modes.find((mode) => mode.isDefault) ?? modes[0]).templateId;
|
|
28929
30610
|
}
|
|
28930
30611
|
|
|
28931
|
-
// ../agent-runtime-api/src/modules/files/schemas.ts
|
|
28932
|
-
var pathSchema = external_exports.string().min(1);
|
|
28933
|
-
var fileListDirsInputSchema = external_exports.object({
|
|
28934
|
-
paths: external_exports.array(external_exports.string()).max(500)
|
|
28935
|
-
});
|
|
28936
|
-
var fileReadInputSchema = external_exports.object({ path: pathSchema });
|
|
28937
|
-
var fileWriteInputSchema = external_exports.object({
|
|
28938
|
-
path: pathSchema,
|
|
28939
|
-
content: external_exports.string(),
|
|
28940
|
-
expectedMtimeMs: external_exports.number().optional()
|
|
28941
|
-
});
|
|
28942
|
-
var fileCreateInputSchema = external_exports.object({
|
|
28943
|
-
path: pathSchema,
|
|
28944
|
-
content: external_exports.string()
|
|
28945
|
-
});
|
|
28946
|
-
var fileMkdirInputSchema = external_exports.object({ path: pathSchema });
|
|
28947
|
-
var fileRenameInputSchema = external_exports.object({
|
|
28948
|
-
from: pathSchema,
|
|
28949
|
-
to: pathSchema,
|
|
28950
|
-
overwrite: external_exports.boolean().optional()
|
|
28951
|
-
});
|
|
28952
|
-
var fileRemoveInputSchema = external_exports.object({ path: pathSchema });
|
|
28953
|
-
var fileUploadInputSchema = external_exports.object({
|
|
28954
|
-
path: pathSchema,
|
|
28955
|
-
contentBase64: external_exports.string(),
|
|
28956
|
-
/** Browser-reported MIME (File.type). Carried in the API for observability
|
|
28957
|
-
* and forward-compat; server-side reads still detect MIME from magic
|
|
28958
|
-
* bytes so we don't need to persist this. */
|
|
28959
|
-
contentType: external_exports.string().max(255).optional(),
|
|
28960
|
-
overwrite: external_exports.boolean().optional()
|
|
28961
|
-
});
|
|
28962
|
-
|
|
28963
|
-
// ../agent-runtime-api/src/modules/skills/schemas.ts
|
|
28964
|
-
var skillInstallInputSchema = external_exports.object({
|
|
28965
|
-
sourceUrl: external_exports.string().min(1),
|
|
28966
|
-
name: external_exports.string().min(1),
|
|
28967
|
-
version: external_exports.string().min(1),
|
|
28968
|
-
skillPaths: external_exports.array(external_exports.string().min(1)).min(1)
|
|
28969
|
-
});
|
|
28970
|
-
var skillUninstallInputSchema = external_exports.object({
|
|
28971
|
-
name: external_exports.string().min(1),
|
|
28972
|
-
skillPaths: external_exports.array(external_exports.string().min(1)).min(1)
|
|
28973
|
-
});
|
|
28974
|
-
var skillScanInputSchema = external_exports.object({
|
|
28975
|
-
source: external_exports.string().min(1)
|
|
28976
|
-
});
|
|
28977
|
-
var skillPublishInputSchema = external_exports.object({
|
|
28978
|
-
name: external_exports.string().min(1),
|
|
28979
|
-
owner: external_exports.string().min(1),
|
|
28980
|
-
repo: external_exports.string().min(1),
|
|
28981
|
-
title: external_exports.string().min(1),
|
|
28982
|
-
body: external_exports.string()
|
|
28983
|
-
});
|
|
28984
|
-
var skillReadLocalInputSchema = external_exports.object({
|
|
28985
|
-
name: external_exports.string().min(1)
|
|
28986
|
-
});
|
|
28987
|
-
|
|
28988
|
-
// ../agent-runtime-api/src/modules/ssh/schemas.ts
|
|
28989
|
-
var sshAuthorizeKeyInputSchema = external_exports.object({
|
|
28990
|
-
publicKey: external_exports.string().min(1).max(8192).refine((s) => !/[\r\n]/.test(s), "must be a single line")
|
|
28991
|
-
});
|
|
28992
|
-
|
|
28993
|
-
// ../agent-runtime-api/src/modules/import/types.ts
|
|
28994
|
-
var importBundleResultSchema = external_exports.object({
|
|
28995
|
-
filesWritten: external_exports.number().int().nonnegative(),
|
|
28996
|
-
bytes: external_exports.number().int().nonnegative(),
|
|
28997
|
-
durationMs: external_exports.number().int().nonnegative()
|
|
28998
|
-
});
|
|
28999
|
-
|
|
29000
|
-
// ../agent-runtime-api/src/modules/runtime/types.ts
|
|
29001
|
-
var contributionKind = external_exports.enum([
|
|
29002
|
-
"env",
|
|
29003
|
-
"egress-allow",
|
|
29004
|
-
"egress-inject",
|
|
29005
|
-
"file",
|
|
29006
|
-
"mcp-entry",
|
|
29007
|
-
"skill-ref"
|
|
29008
|
-
]);
|
|
29009
|
-
var eventKind = external_exports.enum([
|
|
29010
|
-
"trigger",
|
|
29011
|
-
"schedule-reset",
|
|
29012
|
-
"workspace-seed"
|
|
29013
|
-
]);
|
|
29014
|
-
var mergeMode = external_exports.enum([
|
|
29015
|
-
"overwrite",
|
|
29016
|
-
"section-marker",
|
|
29017
|
-
"key-targeted",
|
|
29018
|
-
"yaml-fill-if-missing"
|
|
29019
|
-
]);
|
|
29020
|
-
var fileFormat = external_exports.enum(["yaml", "json", "text", "ini"]);
|
|
29021
|
-
var envContribution = external_exports.object({
|
|
29022
|
-
kind: external_exports.literal("env"),
|
|
29023
|
-
name: external_exports.string().min(1),
|
|
29024
|
-
placeholder: external_exports.string()
|
|
29025
|
-
});
|
|
29026
|
-
var egressAllowContribution = external_exports.object({
|
|
29027
|
-
kind: external_exports.literal("egress-allow"),
|
|
29028
|
-
host: external_exports.string().min(1),
|
|
29029
|
-
pathPattern: external_exports.string().optional()
|
|
29030
|
-
});
|
|
29031
|
-
var egressInjectContribution = external_exports.object({
|
|
29032
|
-
kind: external_exports.literal("egress-inject"),
|
|
29033
|
-
host: external_exports.string().min(1),
|
|
29034
|
-
pathPattern: external_exports.string().optional(),
|
|
29035
|
-
headerName: external_exports.string().min(1),
|
|
29036
|
-
valueFormat: external_exports.string().min(1),
|
|
29037
|
-
encoding: external_exports.literal("basic-x-access-token").optional(),
|
|
29038
|
-
// Moves the value into this query param instead of the header; restricted to unreserved chars since the Lua treats it as a trusted literal.
|
|
29039
|
-
queryParamName: external_exports.string().regex(/^[A-Za-z0-9_.~-]+$/).optional()
|
|
29040
|
-
});
|
|
29041
|
-
var fileContribution = external_exports.object({
|
|
29042
|
-
kind: external_exports.literal("file"),
|
|
29043
|
-
path: external_exports.string().min(1),
|
|
29044
|
-
format: fileFormat,
|
|
29045
|
-
mergeMode,
|
|
29046
|
-
content: external_exports.unknown().optional()
|
|
29047
|
-
});
|
|
29048
|
-
var mcpEntryContribution = external_exports.object({
|
|
29049
|
-
kind: external_exports.literal("mcp-entry"),
|
|
29050
|
-
name: external_exports.string().min(1),
|
|
29051
|
-
url: external_exports.string().url(),
|
|
29052
|
-
headers: external_exports.record(external_exports.string(), external_exports.string()).optional()
|
|
29053
|
-
});
|
|
29054
|
-
var skillRefContribution = external_exports.object({
|
|
29055
|
-
kind: external_exports.literal("skill-ref"),
|
|
29056
|
-
sourceUrl: external_exports.string().min(1),
|
|
29057
|
-
name: external_exports.string().min(1),
|
|
29058
|
-
version: external_exports.string().min(1)
|
|
29059
|
-
});
|
|
29060
|
-
var contribution = external_exports.discriminatedUnion("kind", [
|
|
29061
|
-
envContribution,
|
|
29062
|
-
egressAllowContribution,
|
|
29063
|
-
egressInjectContribution,
|
|
29064
|
-
fileContribution,
|
|
29065
|
-
mcpEntryContribution,
|
|
29066
|
-
skillRefContribution
|
|
29067
|
-
]);
|
|
29068
|
-
var triggerEventPayload = external_exports.object({
|
|
29069
|
-
scheduleId: external_exports.string().min(1),
|
|
29070
|
-
task: external_exports.string().min(1),
|
|
29071
|
-
sessionMode: external_exports.enum(["continuous", "fresh"]).optional(),
|
|
29072
|
-
mcpServers: external_exports.array(external_exports.unknown()).optional()
|
|
29073
|
-
});
|
|
29074
|
-
var triggerEvent = external_exports.object({
|
|
29075
|
-
id: external_exports.string().min(1),
|
|
29076
|
-
kind: external_exports.literal("trigger"),
|
|
29077
|
-
version: external_exports.number().int().nonnegative(),
|
|
29078
|
-
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
29079
|
-
payload: triggerEventPayload
|
|
29080
|
-
});
|
|
29081
|
-
var scheduleResetEventPayload = external_exports.object({
|
|
29082
|
-
scheduleId: external_exports.string().min(1)
|
|
29083
|
-
});
|
|
29084
|
-
var scheduleResetEvent = external_exports.object({
|
|
29085
|
-
id: external_exports.string().min(1),
|
|
29086
|
-
kind: external_exports.literal("schedule-reset"),
|
|
29087
|
-
version: external_exports.number().int().nonnegative(),
|
|
29088
|
-
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
29089
|
-
payload: scheduleResetEventPayload
|
|
29090
|
-
});
|
|
29091
|
-
var workspaceSeedEventPayload = external_exports.object({
|
|
29092
|
-
url: external_exports.string().min(1),
|
|
29093
|
-
/** Branch or tag to clone; omitted = the repo's default branch. */
|
|
29094
|
-
ref: external_exports.string().min(1).optional()
|
|
29095
|
-
});
|
|
29096
|
-
var workspaceSeedEvent = external_exports.object({
|
|
29097
|
-
id: external_exports.string().min(1),
|
|
29098
|
-
kind: external_exports.literal("workspace-seed"),
|
|
29099
|
-
version: external_exports.number().int().nonnegative(),
|
|
29100
|
-
expiresAt: external_exports.string().datetime({ offset: true }),
|
|
29101
|
-
payload: workspaceSeedEventPayload
|
|
29102
|
-
});
|
|
29103
|
-
var event = external_exports.discriminatedUnion("kind", [
|
|
29104
|
-
triggerEvent,
|
|
29105
|
-
scheduleResetEvent,
|
|
29106
|
-
workspaceSeedEvent
|
|
29107
|
-
]);
|
|
29108
|
-
var capabilities = external_exports.object({
|
|
29109
|
-
contributions: external_exports.array(contributionKind),
|
|
29110
|
-
events: external_exports.array(eventKind)
|
|
29111
|
-
});
|
|
29112
|
-
var stateSlice = external_exports.object({
|
|
29113
|
-
contributions: external_exports.array(contribution),
|
|
29114
|
-
hash: external_exports.string().min(1)
|
|
29115
|
-
});
|
|
29116
|
-
var applyStateInput = external_exports.object({
|
|
29117
|
-
version: external_exports.number().int().positive(),
|
|
29118
|
-
state: stateSlice,
|
|
29119
|
-
events: external_exports.array(event)
|
|
29120
|
-
});
|
|
29121
|
-
var driverFailure = external_exports.object({
|
|
29122
|
-
kind: contributionKind,
|
|
29123
|
-
message: external_exports.string().min(1)
|
|
29124
|
-
});
|
|
29125
|
-
var applyStateResult = external_exports.discriminatedUnion("status", [
|
|
29126
|
-
// Processed: resulting cursor + any per-driver failures (empty on a fully clean apply).
|
|
29127
|
-
external_exports.object({
|
|
29128
|
-
status: external_exports.literal("ok"),
|
|
29129
|
-
appliedVersion: external_exports.number().int().nonnegative(),
|
|
29130
|
-
appliedHash: external_exports.string().min(1).nullable(),
|
|
29131
|
-
// null until the first clean settle
|
|
29132
|
-
failures: external_exports.array(driverFailure).default([]),
|
|
29133
|
-
settledEvents: external_exports.array(external_exports.string()).default([])
|
|
29134
|
-
}),
|
|
29135
|
-
// Contributions already at ≥ the requested version; worker reconciles. Events still apply (own version) — settledEvents reports which.
|
|
29136
|
-
external_exports.object({
|
|
29137
|
-
status: external_exports.literal("stale"),
|
|
29138
|
-
appliedVersion: external_exports.number().int().nonnegative(),
|
|
29139
|
-
settledEvents: external_exports.array(external_exports.string()).default([])
|
|
29140
|
-
})
|
|
29141
|
-
]);
|
|
29142
|
-
var helloInput = external_exports.object({
|
|
29143
|
-
lastAppliedVersion: external_exports.number().int().nonnegative().optional(),
|
|
29144
|
-
lastAppliedHash: external_exports.string().optional(),
|
|
29145
|
-
protocolVersion: external_exports.literal("v1"),
|
|
29146
|
-
agentRuntimeVersion: external_exports.string(),
|
|
29147
|
-
capabilities
|
|
29148
|
-
});
|
|
29149
|
-
var helloResult = external_exports.object({
|
|
29150
|
-
version: external_exports.number().int().positive().optional(),
|
|
29151
|
-
state: stateSlice.optional(),
|
|
29152
|
-
events: external_exports.array(event)
|
|
29153
|
-
});
|
|
29154
|
-
|
|
29155
30612
|
// ../api-server-api/src/modules/secret-store/types.ts
|
|
29156
30613
|
var secretRef = external_exports.object({
|
|
29157
30614
|
storeId: external_exports.string().optional(),
|
|
@@ -29177,6 +30634,20 @@ var oauthAuth = external_exports.object({
|
|
|
29177
30634
|
host: external_exports.string().min(1).optional(),
|
|
29178
30635
|
appSlug: external_exports.string().min(1).optional()
|
|
29179
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
|
+
});
|
|
29180
30651
|
var headerAuth = external_exports.object({
|
|
29181
30652
|
kind: external_exports.literal("header"),
|
|
29182
30653
|
valueRef: secretRef,
|
|
@@ -29188,6 +30659,7 @@ var noneAuth = external_exports.object({
|
|
|
29188
30659
|
});
|
|
29189
30660
|
var authConfig = external_exports.discriminatedUnion("kind", [
|
|
29190
30661
|
oauthAuth,
|
|
30662
|
+
clientCredentialsAuth,
|
|
29191
30663
|
headerAuth,
|
|
29192
30664
|
noneAuth
|
|
29193
30665
|
]);
|
|
@@ -29206,6 +30678,12 @@ var connectionStatus = external_exports.enum([
|
|
|
29206
30678
|
"pending",
|
|
29207
30679
|
"disconnected"
|
|
29208
30680
|
]);
|
|
30681
|
+
var authKind = external_exports.enum([
|
|
30682
|
+
"oauth",
|
|
30683
|
+
"client-credentials",
|
|
30684
|
+
"header",
|
|
30685
|
+
"none"
|
|
30686
|
+
]);
|
|
29209
30687
|
var connectionView = external_exports.object({
|
|
29210
30688
|
id: external_exports.string(),
|
|
29211
30689
|
ownerId: external_exports.string(),
|
|
@@ -29213,14 +30691,13 @@ var connectionView = external_exports.object({
|
|
|
29213
30691
|
category: connectionCategory,
|
|
29214
30692
|
name: external_exports.string(),
|
|
29215
30693
|
status: connectionStatus,
|
|
29216
|
-
authKind
|
|
30694
|
+
authKind,
|
|
29217
30695
|
contributions: external_exports.array(contribution),
|
|
29218
30696
|
connectedAt: external_exports.string().optional(),
|
|
29219
30697
|
hosts: external_exports.array(external_exports.string()),
|
|
29220
30698
|
host: external_exports.string().min(1).optional(),
|
|
29221
30699
|
appSlug: external_exports.string().min(1).optional()
|
|
29222
30700
|
});
|
|
29223
|
-
var authKind = external_exports.enum(["oauth", "header", "none"]);
|
|
29224
30701
|
var templateInputState = external_exports.enum([
|
|
29225
30702
|
"required",
|
|
29226
30703
|
"overridable",
|
|
@@ -29282,6 +30759,9 @@ var connectionStartOAuthInputSchema = external_exports.object({
|
|
|
29282
30759
|
var connectionDiscoverMcpInputSchema = external_exports.object({
|
|
29283
30760
|
url: external_exports.string().url()
|
|
29284
30761
|
});
|
|
30762
|
+
var connectionProbeClusterCaInputSchema = external_exports.object({
|
|
30763
|
+
host: external_exports.string().min(1)
|
|
30764
|
+
});
|
|
29285
30765
|
var connectionGetAgentConnectionsInputSchema = external_exports.object({
|
|
29286
30766
|
agentId: external_exports.string().min(1)
|
|
29287
30767
|
});
|
|
@@ -29318,7 +30798,30 @@ var headerCreateInput = external_exports.object({
|
|
|
29318
30798
|
).optional(),
|
|
29319
30799
|
// Values for the template's declared config inputs, keyed by input name.
|
|
29320
30800
|
configInputs: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
29321
|
-
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()
|
|
29322
30825
|
});
|
|
29323
30826
|
var noneCreateInput = external_exports.object({
|
|
29324
30827
|
...commonFields,
|
|
@@ -29327,16 +30830,22 @@ var noneCreateInput = external_exports.object({
|
|
|
29327
30830
|
});
|
|
29328
30831
|
var connectionCreateInputSchema = external_exports.discriminatedUnion("authKind", [
|
|
29329
30832
|
oauthCreateInput,
|
|
30833
|
+
clientCredentialsCreateInput,
|
|
29330
30834
|
headerCreateInput,
|
|
29331
30835
|
noneCreateInput
|
|
29332
30836
|
]);
|
|
30837
|
+
var connectionTestAnthropicInputSchema = external_exports.object({
|
|
30838
|
+
value: external_exports.string().min(1),
|
|
30839
|
+
envName: external_exports.enum(["ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"])
|
|
30840
|
+
});
|
|
29333
30841
|
|
|
29334
30842
|
// ../api-server-api/src/modules/sessions/types.ts
|
|
29335
30843
|
var SessionType = {
|
|
29336
30844
|
Regular: "regular",
|
|
29337
30845
|
ChannelSlack: "channel_slack",
|
|
29338
30846
|
ChannelTelegram: "channel_telegram",
|
|
29339
|
-
ScheduleCron: "schedule_cron"
|
|
30847
|
+
ScheduleCron: "schedule_cron",
|
|
30848
|
+
ExperimentTrial: "experiment_trial"
|
|
29340
30849
|
};
|
|
29341
30850
|
var SessionMode = /* @__PURE__ */ ((SessionMode2) => {
|
|
29342
30851
|
SessionMode2["Chat"] = "chat";
|
|
@@ -29399,101 +30908,6 @@ var PodFilesEventSchema = external_exports.object({
|
|
|
29399
30908
|
});
|
|
29400
30909
|
var EventKindSchema = external_exports.enum(["snapshot", "upsert"]);
|
|
29401
30910
|
|
|
29402
|
-
// ../api-server-api/src/modules/skills/schemas.ts
|
|
29403
|
-
var skillSourceSchema = external_exports.object({
|
|
29404
|
-
id: external_exports.string(),
|
|
29405
|
-
name: external_exports.string(),
|
|
29406
|
-
gitUrl: external_exports.string(),
|
|
29407
|
-
/** True when the source is managed by the cluster admin
|
|
29408
|
-
* (Helm-seeded). Users can't delete it. */
|
|
29409
|
-
system: external_exports.boolean().optional(),
|
|
29410
|
-
/** Present when the source was declared by an agent template
|
|
29411
|
-
* (spec.skillSources). UI-only hint for the "Agent" badge —
|
|
29412
|
-
* backend treats template sources as read-only. */
|
|
29413
|
-
fromTemplate: external_exports.object({ templateId: external_exports.string(), templateName: external_exports.string() }).optional(),
|
|
29414
|
-
canPublish: external_exports.boolean().optional()
|
|
29415
|
-
});
|
|
29416
|
-
var skillPublishResultSchema = external_exports.object({
|
|
29417
|
-
prUrl: external_exports.string().url(),
|
|
29418
|
-
branch: external_exports.string()
|
|
29419
|
-
});
|
|
29420
|
-
var skillSchema = external_exports.object({
|
|
29421
|
-
source: external_exports.string(),
|
|
29422
|
-
name: external_exports.string(),
|
|
29423
|
-
description: external_exports.string(),
|
|
29424
|
-
version: external_exports.string(),
|
|
29425
|
-
contentHash: external_exports.string()
|
|
29426
|
-
});
|
|
29427
|
-
var skillRefSchema = external_exports.object({
|
|
29428
|
-
source: external_exports.string(),
|
|
29429
|
-
name: external_exports.string(),
|
|
29430
|
-
version: external_exports.string(),
|
|
29431
|
-
/** Deterministic SHA-256 of the skill directory's file contents at
|
|
29432
|
-
* install time. Compared to the scanner's contentHash to flag drift.
|
|
29433
|
-
* Optional for backward compatibility with installs that pre-date
|
|
29434
|
-
* this field. */
|
|
29435
|
-
contentHash: external_exports.string().optional()
|
|
29436
|
-
});
|
|
29437
|
-
var localSkillSchema = external_exports.object({
|
|
29438
|
-
name: external_exports.string(),
|
|
29439
|
-
description: external_exports.string(),
|
|
29440
|
-
skillPath: external_exports.string()
|
|
29441
|
-
});
|
|
29442
|
-
var skillPublishRecordSchema = external_exports.object({
|
|
29443
|
-
skillName: external_exports.string(),
|
|
29444
|
-
sourceId: external_exports.string(),
|
|
29445
|
-
sourceName: external_exports.string(),
|
|
29446
|
-
sourceGitUrl: external_exports.string(),
|
|
29447
|
-
prUrl: external_exports.string(),
|
|
29448
|
-
/** ISO 8601 timestamp. */
|
|
29449
|
-
publishedAt: external_exports.string()
|
|
29450
|
-
});
|
|
29451
|
-
var skillStateOutputSchema = external_exports.object({
|
|
29452
|
-
installed: external_exports.array(skillRefSchema),
|
|
29453
|
-
standalone: external_exports.array(localSkillSchema),
|
|
29454
|
-
instancePublishes: external_exports.array(skillPublishRecordSchema)
|
|
29455
|
-
});
|
|
29456
|
-
var skillListSourcesInputSchema = external_exports.object({ agentId: external_exports.string().min(1).optional() }).optional();
|
|
29457
|
-
var skillCreateSourceInputSchema = external_exports.object({
|
|
29458
|
-
name: external_exports.string().min(1).max(128),
|
|
29459
|
-
gitUrl: external_exports.string().url()
|
|
29460
|
-
});
|
|
29461
|
-
var skillDeleteSourceInputSchema = external_exports.object({
|
|
29462
|
-
id: external_exports.string().min(1)
|
|
29463
|
-
});
|
|
29464
|
-
var skillRefreshSourceInputSchema = external_exports.object({
|
|
29465
|
-
id: external_exports.string().min(1)
|
|
29466
|
-
});
|
|
29467
|
-
var skillListInputSchema = external_exports.object({
|
|
29468
|
-
sourceId: external_exports.string().min(1),
|
|
29469
|
-
agentId: external_exports.string().min(1).optional()
|
|
29470
|
-
});
|
|
29471
|
-
var skillInstallInputSchema2 = external_exports.object({
|
|
29472
|
-
agentId: external_exports.string().min(1),
|
|
29473
|
-
source: external_exports.string().url(),
|
|
29474
|
-
name: external_exports.string().min(1),
|
|
29475
|
-
version: external_exports.string().min(1),
|
|
29476
|
-
contentHash: external_exports.string().optional()
|
|
29477
|
-
});
|
|
29478
|
-
var skillUninstallInputSchema2 = external_exports.object({
|
|
29479
|
-
agentId: external_exports.string().min(1),
|
|
29480
|
-
source: external_exports.string().url(),
|
|
29481
|
-
name: external_exports.string().min(1)
|
|
29482
|
-
});
|
|
29483
|
-
var skillListLocalInputSchema = external_exports.object({
|
|
29484
|
-
agentId: external_exports.string().min(1)
|
|
29485
|
-
});
|
|
29486
|
-
var skillStateInputSchema = external_exports.object({
|
|
29487
|
-
agentId: external_exports.string().min(1)
|
|
29488
|
-
});
|
|
29489
|
-
var skillPublishInputSchema2 = external_exports.object({
|
|
29490
|
-
agentId: external_exports.string().min(1),
|
|
29491
|
-
sourceId: external_exports.string().min(1),
|
|
29492
|
-
name: external_exports.string().min(1),
|
|
29493
|
-
title: external_exports.string().optional(),
|
|
29494
|
-
body: external_exports.string().optional()
|
|
29495
|
-
});
|
|
29496
|
-
|
|
29497
30911
|
// ../api-server-api/src/modules/approvals/schemas.ts
|
|
29498
30912
|
var approvalStatusSchema = external_exports.enum(["pending", "resolved", "expired"]);
|
|
29499
30913
|
var approvalListOptionsSchema = external_exports.object({
|
|
@@ -29541,15 +30955,20 @@ function formatEgressRuleSource(source) {
|
|
|
29541
30955
|
function formatEgressRuleInline(rule) {
|
|
29542
30956
|
const parts = [rule.verdict];
|
|
29543
30957
|
if (rule.method !== "*") parts.push(rule.method);
|
|
29544
|
-
parts.push(joinHostPath(rule.host, rule.pathPattern));
|
|
30958
|
+
parts.push(joinHostPath(rule.host, rule.pathPattern, rule.port));
|
|
29545
30959
|
return parts.join(" ");
|
|
29546
30960
|
}
|
|
29547
|
-
function joinHostPath(host, pathPattern) {
|
|
29548
|
-
const normalizedHost = host
|
|
30961
|
+
function joinHostPath(host, pathPattern, port) {
|
|
30962
|
+
const normalizedHost = stripTrailingSlashes(host) + (port ? `:${port}` : "");
|
|
29549
30963
|
if (pathPattern === "*") return normalizedHost;
|
|
29550
30964
|
const normalizedPath = pathPattern.startsWith("/") ? pathPattern : `/${pathPattern}`;
|
|
29551
30965
|
return `${normalizedHost}${normalizedPath}`;
|
|
29552
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
|
+
}
|
|
29553
30972
|
|
|
29554
30973
|
// ../api-server-api/src/modules/acp/types.ts
|
|
29555
30974
|
var platformTurnEndedParamsSchema = external_exports.object({
|
|
@@ -31203,35 +32622,6 @@ function promptSecret(message) {
|
|
|
31203
32622
|
});
|
|
31204
32623
|
}
|
|
31205
32624
|
|
|
31206
|
-
// src/modules/agent/lib/group-github-pats.ts
|
|
31207
|
-
var API_HOST = "api.github.com";
|
|
31208
|
-
var GIT_HOST = "github.com";
|
|
31209
|
-
function groupGithubPats(secrets) {
|
|
31210
|
-
const byName2 = /* @__PURE__ */ new Map();
|
|
31211
|
-
for (const s of secrets) {
|
|
31212
|
-
const slot = s.hostPattern === API_HOST ? "api" : s.hostPattern === GIT_HOST ? "git" : null;
|
|
31213
|
-
if (!slot) continue;
|
|
31214
|
-
let group = byName2.get(s.name);
|
|
31215
|
-
if (!group) {
|
|
31216
|
-
group = { api: [], git: [] };
|
|
31217
|
-
byName2.set(s.name, group);
|
|
31218
|
-
}
|
|
31219
|
-
group[slot].push(s.id);
|
|
31220
|
-
}
|
|
31221
|
-
const pairs = [];
|
|
31222
|
-
for (const [name, group] of byName2) {
|
|
31223
|
-
if (group.api.length === 1 && group.git.length === 1) {
|
|
31224
|
-
pairs.push({
|
|
31225
|
-
name,
|
|
31226
|
-
apiSecretId: group.api[0],
|
|
31227
|
-
gitSecretId: group.git[0]
|
|
31228
|
-
});
|
|
31229
|
-
}
|
|
31230
|
-
}
|
|
31231
|
-
pairs.sort((a, b2) => a.name.localeCompare(b2.name));
|
|
31232
|
-
return pairs;
|
|
31233
|
-
}
|
|
31234
|
-
|
|
31235
32625
|
// src/modules/connection/services/connection-service.ts
|
|
31236
32626
|
function createConnectionService(deps) {
|
|
31237
32627
|
const readIds = async (agentId) => {
|
|
@@ -31263,6 +32653,11 @@ function createConnectionService(deps) {
|
|
|
31263
32653
|
async discoverMcp(url2) {
|
|
31264
32654
|
return trpcCall(() => deps.trpc.connections.discoverMcp.mutate({ url: url2 }));
|
|
31265
32655
|
},
|
|
32656
|
+
async probeClusterCa(host) {
|
|
32657
|
+
return trpcCall(
|
|
32658
|
+
() => deps.trpc.connections.probeClusterCa.mutate({ host })
|
|
32659
|
+
);
|
|
32660
|
+
},
|
|
31266
32661
|
async getConnection(id) {
|
|
31267
32662
|
return trpcCall(() => deps.trpc.connections.get.query({ id }));
|
|
31268
32663
|
},
|
|
@@ -31485,34 +32880,14 @@ hint: run \`dam auth login\` first`
|
|
|
31485
32880
|
process.exit(EXIT_RUNTIME_FAILURE);
|
|
31486
32881
|
}
|
|
31487
32882
|
spin.message("Granting credentials...");
|
|
31488
|
-
const connectionIds = [];
|
|
31489
|
-
|
|
31490
|
-
if (provider.routing.kind === "connection") {
|
|
31491
|
-
connectionIds.push(provider.routing.id);
|
|
31492
|
-
} else {
|
|
31493
|
-
secretIds.push(provider.routing.id);
|
|
31494
|
-
}
|
|
31495
|
-
if (githubPat) {
|
|
31496
|
-
if (githubPat.source === "connection") {
|
|
31497
|
-
connectionIds.push(githubPat.connectionId);
|
|
31498
|
-
} else {
|
|
31499
|
-
secretIds.push(githubPat.apiSecretId, githubPat.gitSecretId);
|
|
31500
|
-
}
|
|
31501
|
-
}
|
|
32883
|
+
const connectionIds = [provider.routing.id];
|
|
32884
|
+
if (githubPat) connectionIds.push(githubPat.connectionId);
|
|
31502
32885
|
try {
|
|
31503
32886
|
await withRetry(async () => {
|
|
31504
|
-
|
|
31505
|
-
|
|
31506
|
-
|
|
31507
|
-
|
|
31508
|
-
});
|
|
31509
|
-
}
|
|
31510
|
-
if (secretIds.length > 0) {
|
|
31511
|
-
await trpc.secrets.setAgentAccess.mutate({
|
|
31512
|
-
agentId: cleanup.agentId,
|
|
31513
|
-
secretIds
|
|
31514
|
-
});
|
|
31515
|
-
}
|
|
32887
|
+
await trpc.connections.setAgentConnections.mutate({
|
|
32888
|
+
agentId: cleanup.agentId,
|
|
32889
|
+
connectionIds
|
|
32890
|
+
});
|
|
31516
32891
|
});
|
|
31517
32892
|
} catch (e2) {
|
|
31518
32893
|
spin.stop("Grant failed");
|
|
@@ -31619,7 +32994,6 @@ async function listCredentials(trpc, cleanup) {
|
|
|
31619
32994
|
try {
|
|
31620
32995
|
return {
|
|
31621
32996
|
conns: await trpc.connections.list.query(),
|
|
31622
|
-
secrets: await trpc.secrets.list.query(),
|
|
31623
32997
|
templates: await trpc.connections.listTemplates.query()
|
|
31624
32998
|
};
|
|
31625
32999
|
} catch (e2) {
|
|
@@ -31629,12 +33003,9 @@ async function listCredentials(trpc, cleanup) {
|
|
|
31629
33003
|
}
|
|
31630
33004
|
}
|
|
31631
33005
|
async function pickProvider(trpc, cleanup) {
|
|
31632
|
-
const { conns,
|
|
33006
|
+
const { conns, templates } = await listCredentials(trpc, cleanup);
|
|
31633
33007
|
const existingConns = providerConns(conns);
|
|
31634
|
-
|
|
31635
|
-
(s) => isProviderPresetType(s.type)
|
|
31636
|
-
).map((s) => ({ id: s.id, name: s.name, type: s.type }));
|
|
31637
|
-
if (existingConns.length === 0 && existingSecrets.length === 0) {
|
|
33008
|
+
if (existingConns.length === 0) {
|
|
31638
33009
|
R2.info("No model providers configured yet \u2014 let's add one.");
|
|
31639
33010
|
return addOrReplaceProvider(trpc, cleanup, existingConns, templates);
|
|
31640
33011
|
}
|
|
@@ -31646,10 +33017,6 @@ async function pickProvider(trpc, cleanup) {
|
|
|
31646
33017
|
value: `conn:${c2.id}`,
|
|
31647
33018
|
label: `${c2.name} (${c2.type})`
|
|
31648
33019
|
})),
|
|
31649
|
-
...existingSecrets.map((s) => ({
|
|
31650
|
-
value: `secret:${s.id}`,
|
|
31651
|
-
label: `${s.name} (${s.type}) (legacy)`
|
|
31652
|
-
})),
|
|
31653
33020
|
{ value: NEW, label: "Add new..." }
|
|
31654
33021
|
]
|
|
31655
33022
|
});
|
|
@@ -31657,17 +33024,9 @@ async function pickProvider(trpc, cleanup) {
|
|
|
31657
33024
|
if (picked === NEW) {
|
|
31658
33025
|
return addOrReplaceProvider(trpc, cleanup, existingConns, templates);
|
|
31659
33026
|
}
|
|
31660
|
-
|
|
31661
|
-
const found2 = existingConns.find((c2) => `conn:${c2.id}` === picked);
|
|
31662
|
-
return {
|
|
31663
|
-
routing: { kind: "connection", id: found2.id },
|
|
31664
|
-
name: found2.name,
|
|
31665
|
-
type: found2.type
|
|
31666
|
-
};
|
|
31667
|
-
}
|
|
31668
|
-
const found = existingSecrets.find((s) => `secret:${s.id}` === picked);
|
|
33027
|
+
const found = existingConns.find((c2) => `conn:${c2.id}` === picked);
|
|
31669
33028
|
return {
|
|
31670
|
-
routing: {
|
|
33029
|
+
routing: { id: found.id },
|
|
31671
33030
|
name: found.name,
|
|
31672
33031
|
type: found.type
|
|
31673
33032
|
};
|
|
@@ -31697,7 +33056,7 @@ async function addOrReplaceProvider(trpc, cleanup, existingConns, templates) {
|
|
|
31697
33056
|
if (q(replace)) return cancelAndCleanup(trpc, cleanup);
|
|
31698
33057
|
if (!replace) {
|
|
31699
33058
|
return {
|
|
31700
|
-
routing: {
|
|
33059
|
+
routing: { id: existingOfType.id },
|
|
31701
33060
|
name: existingOfType.name,
|
|
31702
33061
|
type
|
|
31703
33062
|
};
|
|
@@ -31721,7 +33080,7 @@ async function addOrReplaceProvider(trpc, cleanup, existingConns, templates) {
|
|
|
31721
33080
|
value: value2
|
|
31722
33081
|
});
|
|
31723
33082
|
return {
|
|
31724
|
-
routing: {
|
|
33083
|
+
routing: { id: existingOfType.id },
|
|
31725
33084
|
name: existingOfType.name,
|
|
31726
33085
|
type
|
|
31727
33086
|
};
|
|
@@ -31823,17 +33182,16 @@ async function createProviderConnection(trpc, cleanup, type, templateId, value,
|
|
|
31823
33182
|
});
|
|
31824
33183
|
if (!created) return null;
|
|
31825
33184
|
return {
|
|
31826
|
-
routing: {
|
|
33185
|
+
routing: { id: created.id },
|
|
31827
33186
|
name: created.name,
|
|
31828
33187
|
type
|
|
31829
33188
|
};
|
|
31830
33189
|
}
|
|
31831
33190
|
var DEFAULT_GITHUB_PAT_NAME = GITHUB_PAT_TEMPLATE_ID;
|
|
31832
33191
|
async function pickGithubPat(trpc, cleanup) {
|
|
31833
|
-
const { conns
|
|
33192
|
+
const { conns } = await listCredentials(trpc, cleanup);
|
|
31834
33193
|
const patConns = conns.filter((c2) => c2.templateId === GITHUB_PAT_TEMPLATE_ID);
|
|
31835
|
-
|
|
31836
|
-
if (patConns.length === 0 && pairs.length === 0) {
|
|
33194
|
+
if (patConns.length === 0) {
|
|
31837
33195
|
R2.info("No GitHub PAT configured yet.");
|
|
31838
33196
|
const add = await ue({ message: "Add one?", initialValue: true });
|
|
31839
33197
|
if (q(add)) return cancelAndCleanup(trpc, cleanup);
|
|
@@ -31846,10 +33204,6 @@ async function pickGithubPat(trpc, cleanup) {
|
|
|
31846
33204
|
message: "GitHub PAT",
|
|
31847
33205
|
options: [
|
|
31848
33206
|
...patConns.map((c2) => ({ value: `conn:${c2.id}`, label: c2.name })),
|
|
31849
|
-
...pairs.map((p2) => ({
|
|
31850
|
-
value: `secret:${p2.name}`,
|
|
31851
|
-
label: `${p2.name} (legacy)`
|
|
31852
|
-
})),
|
|
31853
33207
|
{ value: NEW, label: "Add new..." },
|
|
31854
33208
|
{ value: SKIP, label: "Skip" }
|
|
31855
33209
|
]
|
|
@@ -31857,17 +33211,8 @@ async function pickGithubPat(trpc, cleanup) {
|
|
|
31857
33211
|
if (q(picked)) return cancelAndCleanup(trpc, cleanup);
|
|
31858
33212
|
if (picked === SKIP) return null;
|
|
31859
33213
|
if (picked === NEW) return addOrReplaceGithubPat(trpc, cleanup, patConns);
|
|
31860
|
-
|
|
31861
|
-
|
|
31862
|
-
return { source: "connection", connectionId: found2.id, name: found2.name };
|
|
31863
|
-
}
|
|
31864
|
-
const found = pairs.find((p2) => `secret:${p2.name}` === picked);
|
|
31865
|
-
return {
|
|
31866
|
-
source: "secret",
|
|
31867
|
-
apiSecretId: found.apiSecretId,
|
|
31868
|
-
gitSecretId: found.gitSecretId,
|
|
31869
|
-
name: found.name
|
|
31870
|
-
};
|
|
33214
|
+
const found = patConns.find((c2) => `conn:${c2.id}` === picked);
|
|
33215
|
+
return { connectionId: found.id, name: found.name };
|
|
31871
33216
|
}
|
|
31872
33217
|
async function addOrReplaceGithubPat(trpc, cleanup, existing) {
|
|
31873
33218
|
const collide = existing.find((c2) => c2.name === DEFAULT_GITHUB_PAT_NAME);
|
|
@@ -31879,21 +33224,13 @@ async function addOrReplaceGithubPat(trpc, cleanup, existing) {
|
|
|
31879
33224
|
});
|
|
31880
33225
|
if (q(replace)) return cancelAndCleanup(trpc, cleanup);
|
|
31881
33226
|
if (!replace) {
|
|
31882
|
-
return {
|
|
31883
|
-
source: "connection",
|
|
31884
|
-
connectionId: collide.id,
|
|
31885
|
-
name: collide.name
|
|
31886
|
-
};
|
|
33227
|
+
return { connectionId: collide.id, name: collide.name };
|
|
31887
33228
|
}
|
|
31888
33229
|
const token2 = await promptSecret("New GitHub personal access token");
|
|
31889
33230
|
if (q(token2)) return cancelAndCleanup(trpc, cleanup);
|
|
31890
33231
|
try {
|
|
31891
33232
|
await trpc.connections.update.mutate({ id: collide.id, value: token2 });
|
|
31892
|
-
return {
|
|
31893
|
-
source: "connection",
|
|
31894
|
-
connectionId: collide.id,
|
|
31895
|
-
name: collide.name
|
|
31896
|
-
};
|
|
33233
|
+
return { connectionId: collide.id, name: collide.name };
|
|
31897
33234
|
} catch (e2) {
|
|
31898
33235
|
R2.error(`Failed to replace GitHub PAT: ${errorReason2(e2)}`);
|
|
31899
33236
|
continue;
|
|
@@ -31908,11 +33245,7 @@ async function addOrReplaceGithubPat(trpc, cleanup, existing) {
|
|
|
31908
33245
|
nameExample: "my-github"
|
|
31909
33246
|
});
|
|
31910
33247
|
if (created) {
|
|
31911
|
-
return {
|
|
31912
|
-
source: "connection",
|
|
31913
|
-
connectionId: created.id,
|
|
31914
|
-
name: created.name
|
|
31915
|
-
};
|
|
33248
|
+
return { connectionId: created.id, name: created.name };
|
|
31916
33249
|
}
|
|
31917
33250
|
}
|
|
31918
33251
|
}
|
|
@@ -38137,11 +39470,40 @@ var import_websocket = __toESM(require_websocket(), 1);
|
|
|
38137
39470
|
var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
38138
39471
|
var wrapper_default = import_websocket.default;
|
|
38139
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
|
+
|
|
38140
39502
|
// src/modules/chat/infrastructure/acp-session-client.ts
|
|
38141
39503
|
var TIMEOUT_MS = 12e4;
|
|
38142
39504
|
function wsStream(url2) {
|
|
38143
39505
|
return new Promise((resolve4, reject) => {
|
|
38144
|
-
const ws = new import_websocket.default(url2);
|
|
39506
|
+
const ws = new import_websocket.default(url2, { agent: proxyAgentForUrl(url2) });
|
|
38145
39507
|
ws.on("open", () => {
|
|
38146
39508
|
const readable = new ReadableStream({
|
|
38147
39509
|
start(controller) {
|
|
@@ -38190,6 +39552,7 @@ function toSessionView(agentId, s) {
|
|
|
38190
39552
|
mode: p2 ? p2.mode ?? "chat" /* Chat */ : "terminal" /* Terminal */,
|
|
38191
39553
|
createdAt: p2?.createdAt ?? s.updatedAt ?? (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
38192
39554
|
scheduleId: p2?.scheduleId ?? null,
|
|
39555
|
+
experimentId: p2?.experimentId ?? null,
|
|
38193
39556
|
title: s.title ?? null,
|
|
38194
39557
|
updatedAt: s.updatedAt ?? null
|
|
38195
39558
|
};
|
|
@@ -38296,9 +39659,8 @@ function connectTerminalBridge({
|
|
|
38296
39659
|
const proto = host.startsWith("https://") ? "wss:" : "ws:";
|
|
38297
39660
|
const base = host.replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
38298
39661
|
const sep = terminalPath.includes("?") ? "&" : "?";
|
|
38299
|
-
const
|
|
38300
|
-
|
|
38301
|
-
);
|
|
39662
|
+
const url2 = `${proto}//${base}${terminalPath}${sep}token=${encodeURIComponent(token)}`;
|
|
39663
|
+
const ws = new wrapper_default(url2, { agent: proxyAgentForUrl(url2) });
|
|
38302
39664
|
const onData = (chunk) => {
|
|
38303
39665
|
if (ws.readyState === wrapper_default.OPEN)
|
|
38304
39666
|
ws.send(encodeDataFrame(OP_INPUT, new Uint8Array(chunk)));
|
|
@@ -38518,13 +39880,13 @@ function createSessionsPort(deps) {
|
|
|
38518
39880
|
}
|
|
38519
39881
|
|
|
38520
39882
|
// src/modules/chat/compose.ts
|
|
39883
|
+
var buildSessionsPort = (host, token) => createSessionsPort({ acp: createAcpSessionClient({ host, token }) });
|
|
38521
39884
|
function composeChatModule({
|
|
38522
39885
|
compatService,
|
|
38523
39886
|
configService,
|
|
38524
39887
|
tokenProvider,
|
|
38525
39888
|
createAgentService: createAgentService2
|
|
38526
39889
|
}) {
|
|
38527
|
-
const buildSessionsPort = (host, token) => createSessionsPort({ acp: createAcpSessionClient({ host, token }) });
|
|
38528
39890
|
const chatService = createChatService({
|
|
38529
39891
|
compatService,
|
|
38530
39892
|
configService,
|
|
@@ -38812,7 +40174,7 @@ function createProcessEnvReader() {
|
|
|
38812
40174
|
|
|
38813
40175
|
// src/modules/cli/infrastructure/package-version.ts
|
|
38814
40176
|
function readPackageVersion() {
|
|
38815
|
-
return true ? "0.2.
|
|
40177
|
+
return true ? "0.2.7-rc1" : DEV_VERSION;
|
|
38816
40178
|
}
|
|
38817
40179
|
|
|
38818
40180
|
// src/modules/cli/infrastructure/version-probe.ts
|
|
@@ -39039,10 +40401,22 @@ function buildConnectCommand(deps) {
|
|
|
39039
40401
|
).option(
|
|
39040
40402
|
"--auth <mode>",
|
|
39041
40403
|
"MCP auth mode: oauth | none (default: auto-detect from the server)"
|
|
39042
|
-
).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(
|
|
39043
40414
|
"--env-name <name>",
|
|
39044
40415
|
"input: expose the credential to the agent as this env var (custom header credentials)"
|
|
39045
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(
|
|
39046
40420
|
"-c, --config <key=value>",
|
|
39047
40421
|
"set an optional template config input (e.g. -c model=premium-shell), repeatable",
|
|
39048
40422
|
(val, prev) => [...prev, val],
|
|
@@ -39059,7 +40433,7 @@ function buildConnectCommand(deps) {
|
|
|
39059
40433
|
String(DEFAULT_TIMEOUT_SECONDS3)
|
|
39060
40434
|
).addHelpText(
|
|
39061
40435
|
"after",
|
|
39062
|
-
"\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"
|
|
39063
40437
|
).action(async (providerOrUrl, opts) => {
|
|
39064
40438
|
const json2 = opts.json ?? false;
|
|
39065
40439
|
const timeoutSeconds = parseTimeout2(opts.timeout);
|
|
@@ -39115,6 +40489,9 @@ function buildConnectCommand(deps) {
|
|
|
39115
40489
|
`);
|
|
39116
40490
|
process.exit(EXIT_INVALID_INPUT);
|
|
39117
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
|
+
}
|
|
39118
40495
|
const createRes = await svc.createConnection(payload);
|
|
39119
40496
|
if (!createRes.ok) {
|
|
39120
40497
|
printServiceError(createRes.error, host);
|
|
@@ -39304,6 +40681,20 @@ function buildPayload(template, name, values) {
|
|
|
39304
40681
|
...v2("clientSecret") ? { clientSecret: v2("clientSecret") } : {},
|
|
39305
40682
|
...v2("appSlug") ? { appSlug: v2("appSlug") } : {}
|
|
39306
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
|
+
};
|
|
39307
40698
|
case "header": {
|
|
39308
40699
|
const value = v2("value");
|
|
39309
40700
|
if (!value) return { error: "the secret value is required (--value)" };
|
|
@@ -39320,6 +40711,7 @@ function buildPayload(template, name, values) {
|
|
|
39320
40711
|
...v2("headerName") ? { headerName: v2("headerName") } : {},
|
|
39321
40712
|
...v2("valueFormat") ? { valueFormat: v2("valueFormat") } : {},
|
|
39322
40713
|
...v2("envName") ? { envName: v2("envName") } : {},
|
|
40714
|
+
...v2("caData") ? { caData: v2("caData") } : {},
|
|
39323
40715
|
...Object.keys(configInputs).length > 0 ? { configInputs } : {},
|
|
39324
40716
|
value
|
|
39325
40717
|
};
|
|
@@ -39332,6 +40724,24 @@ function buildPayload(template, name, values) {
|
|
|
39332
40724
|
};
|
|
39333
40725
|
}
|
|
39334
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
|
+
}
|
|
39335
40745
|
async function pollUntilActive(svc, id, timeoutSeconds) {
|
|
39336
40746
|
const deadline = Date.now() + timeoutSeconds * 1e3;
|
|
39337
40747
|
while (true) {
|
|
@@ -39398,13 +40808,17 @@ function flagListFor(inputs) {
|
|
|
39398
40808
|
var FIELD_LABELS = {
|
|
39399
40809
|
url: "URL",
|
|
39400
40810
|
host: "Host",
|
|
40811
|
+
issuerUrl: "Issuer URL",
|
|
39401
40812
|
headerName: "Header name",
|
|
39402
40813
|
valueFormat: "Value format",
|
|
39403
40814
|
value: "Secret value",
|
|
39404
40815
|
clientId: "Client ID",
|
|
39405
40816
|
clientSecret: "Client secret",
|
|
40817
|
+
scopes: "Scopes (space-separated)",
|
|
40818
|
+
audience: "Audience",
|
|
39406
40819
|
appSlug: "GitHub App slug",
|
|
39407
|
-
envName: "Env var name"
|
|
40820
|
+
envName: "Env var name",
|
|
40821
|
+
caData: "Cluster CA certificate"
|
|
39408
40822
|
};
|
|
39409
40823
|
function labelFor(key) {
|
|
39410
40824
|
return FIELD_LABELS[key] ?? key;
|
|
@@ -42357,11 +43771,14 @@ function deriveSourceName(gitUrl) {
|
|
|
42357
43771
|
// src/modules/skill/commands/source-add.ts
|
|
42358
43772
|
function buildSourceAddCommand(deps) {
|
|
42359
43773
|
return new Command("add").description("Register a skill source from a git URL").argument("<git-url>", "git URL of the skill source repository").option("--name <name>", "source name (default: derived from the git URL)").option(
|
|
43774
|
+
"--path <path>",
|
|
43775
|
+
"optional subdirectory within the repository to scan for skills"
|
|
43776
|
+
).option(
|
|
42360
43777
|
"--server <url>",
|
|
42361
43778
|
"override the configured server URL for this call"
|
|
42362
43779
|
).option("--json", "emit the created SkillSource as JSON").addHelpText(
|
|
42363
43780
|
"after",
|
|
42364
|
-
"\nThe name defaults to the URL path (github.com/acme/skills \u2192 acme/skills);\npass --name to override. Adding a URL that a Platform or Agent source already\nuses shadows it \u2014 removing your source re-exposes the original.\n\nExamples:\n dam skill source add https://github.com/anthropics/skills\n dam skill source add https://github.com/acme/skills --name acme\n"
|
|
43781
|
+
"\nThe name defaults to the URL path (github.com/acme/skills \u2192 acme/skills);\npass --name to override. Adding a URL that a Platform or Agent source already\nuses shadows it \u2014 removing your source re-exposes the original.\n\nExamples:\n dam skill source add https://github.com/anthropics/skills\n dam skill source add https://github.com/acme/skills --name acme\n dam skill source add https://github.com/acme/monorepo --path .claude/skills\n"
|
|
42365
43782
|
).action(
|
|
42366
43783
|
async (gitUrl, opts) => {
|
|
42367
43784
|
const json2 = opts.json ?? false;
|
|
@@ -42380,6 +43797,19 @@ function buildSourceAddCommand(deps) {
|
|
|
42380
43797
|
`);
|
|
42381
43798
|
process.exit(EXIT_INVALID_INPUT);
|
|
42382
43799
|
}
|
|
43800
|
+
let path2;
|
|
43801
|
+
if (opts.path !== void 0) {
|
|
43802
|
+
const pathCheck = skillCreateSourceInputSchema.shape.path.safeParse(
|
|
43803
|
+
opts.path
|
|
43804
|
+
);
|
|
43805
|
+
if (!pathCheck.success) {
|
|
43806
|
+
const msg = pathCheck.error.issues[0]?.message ?? "invalid path";
|
|
43807
|
+
process.stderr.write(`error: ${msg}
|
|
43808
|
+
`);
|
|
43809
|
+
process.exit(EXIT_INVALID_INPUT);
|
|
43810
|
+
}
|
|
43811
|
+
path2 = pathCheck.data || void 0;
|
|
43812
|
+
}
|
|
42383
43813
|
const host = await resolveActiveHost(deps, {
|
|
42384
43814
|
flag: opts.server ? { server: opts.server } : void 0,
|
|
42385
43815
|
exitCodes: {
|
|
@@ -42387,7 +43817,7 @@ function buildSourceAddCommand(deps) {
|
|
|
42387
43817
|
belowFloor: EXIT_BELOW_FLOOR
|
|
42388
43818
|
}
|
|
42389
43819
|
});
|
|
42390
|
-
const result = await deps.createSkillsService(host).addSource({ name, gitUrl });
|
|
43820
|
+
const result = await deps.createSkillsService(host).addSource({ name, gitUrl, path: path2 });
|
|
42391
43821
|
if (!result.ok) {
|
|
42392
43822
|
if (result.error.kind === "source-exists") {
|
|
42393
43823
|
process.stderr.write(
|
|
@@ -42434,12 +43864,12 @@ async function resolveName(gitUrl, flag, json2) {
|
|
|
42434
43864
|
}
|
|
42435
43865
|
|
|
42436
43866
|
// src/modules/skill/commands/source-list.ts
|
|
42437
|
-
var HEADER3 = ["ID", "NAME", "GIT URL", "KIND"];
|
|
43867
|
+
var HEADER3 = ["ID", "NAME", "GIT URL", "PATH", "KIND"];
|
|
42438
43868
|
function tableFor3(sources) {
|
|
42439
43869
|
const sorted = [...sources].sort((a, b2) => a.name.localeCompare(b2.name));
|
|
42440
43870
|
return renderTable([
|
|
42441
43871
|
HEADER3,
|
|
42442
|
-
...sorted.map((s) => [s.id, s.name, s.gitUrl, sourceKind(s)])
|
|
43872
|
+
...sorted.map((s) => [s.id, s.name, s.gitUrl, s.path ?? "", sourceKind(s)])
|
|
42443
43873
|
]);
|
|
42444
43874
|
}
|
|
42445
43875
|
function buildSourceListCommand(deps) {
|
|
@@ -42882,9 +44312,8 @@ function connectRawBridge({
|
|
|
42882
44312
|
let settled = false;
|
|
42883
44313
|
const proto = host.startsWith("https://") ? "wss:" : "ws:";
|
|
42884
44314
|
const base = host.replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
42885
|
-
const
|
|
42886
|
-
|
|
42887
|
-
);
|
|
44315
|
+
const url2 = `${proto}//${base}/api/agents/${encodeURIComponent(agentId)}/ssh?token=${encodeURIComponent(token)}`;
|
|
44316
|
+
const ws = new wrapper_default(url2, { agent: proxyAgentForUrl(url2) });
|
|
42888
44317
|
ws.binaryType = "nodebuffer";
|
|
42889
44318
|
const onStdin = (chunk) => {
|
|
42890
44319
|
if (ws.readyState === wrapper_default.OPEN) ws.send(chunk, { binary: true });
|
|
@@ -43423,6 +44852,213 @@ function composeSshModule(opts) {
|
|
|
43423
44852
|
return { commands: [buildSshCommand(opts)] };
|
|
43424
44853
|
}
|
|
43425
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
|
+
|
|
43426
45062
|
// src/modules/template/commands/list.ts
|
|
43427
45063
|
var DESCRIPTION_MAX = 60;
|
|
43428
45064
|
function buildListCommand8(deps) {
|
|
@@ -43609,6 +45245,12 @@ function compose(opts = {}) {
|
|
|
43609
45245
|
compatService: cli.services.compatService,
|
|
43610
45246
|
createAgentService: agent.exports.createService
|
|
43611
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
|
+
});
|
|
43612
45254
|
const program3 = new Command();
|
|
43613
45255
|
program3.name("dam").description("Command-line client for a Platform deployment").version(cli.cliVersion);
|
|
43614
45256
|
for (const command of cli.commands) program3.addCommand(command);
|
|
@@ -43625,6 +45267,7 @@ function compose(opts = {}) {
|
|
|
43625
45267
|
for (const command of skill.commands) program3.addCommand(command);
|
|
43626
45268
|
for (const command of ssh.commands) program3.addCommand(command);
|
|
43627
45269
|
for (const command of channel.commands) program3.addCommand(command);
|
|
45270
|
+
for (const command of metrics.commands) program3.addCommand(command);
|
|
43628
45271
|
return program3;
|
|
43629
45272
|
}
|
|
43630
45273
|
|