nestor-sh 3.5.1 → 3.5.3
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/nestor.mjs
CHANGED
|
@@ -14967,7 +14967,7 @@ function isNativeAvailable() {
|
|
|
14967
14967
|
return nativeModule !== null;
|
|
14968
14968
|
}
|
|
14969
14969
|
function getNativeVersion() {
|
|
14970
|
-
return nativeModule ? "3.5.
|
|
14970
|
+
return nativeModule ? "3.5.3" : null;
|
|
14971
14971
|
}
|
|
14972
14972
|
function validateSsrf(url, allowPrivate = false) {
|
|
14973
14973
|
if (nativeModule) {
|
|
@@ -15872,7 +15872,12 @@ var init_docker = __esm({
|
|
|
15872
15872
|
this.timeoutMs = options.timeoutMs ?? 3e4;
|
|
15873
15873
|
this.memoryLimit = options.memoryLimit ?? `${config2.memoryLimitMb}m`;
|
|
15874
15874
|
this.cpuLimit = options.cpuLimit ?? config2.cpuLimitPercent / 100;
|
|
15875
|
-
this.networkEnabled = config2.networkPolicy
|
|
15875
|
+
this.networkEnabled = config2.networkPolicy === "restricted" || config2.networkPolicy === "full";
|
|
15876
|
+
if (config2.networkPolicy === void 0) {
|
|
15877
|
+
console.warn(
|
|
15878
|
+
'[nestor:sandbox] networkPolicy not set \u2014 defaulting to DISABLED for security. Set networkPolicy: "restricted" or "full" explicitly to allow network access.'
|
|
15879
|
+
);
|
|
15880
|
+
}
|
|
15876
15881
|
this.workDir = options.workDir ?? "/workspace";
|
|
15877
15882
|
}
|
|
15878
15883
|
/**
|
|
@@ -119716,7 +119721,7 @@ var SERVER_VERSION, startTime;
|
|
|
119716
119721
|
var init_health = __esm({
|
|
119717
119722
|
"../server/src/routes/health.ts"() {
|
|
119718
119723
|
"use strict";
|
|
119719
|
-
SERVER_VERSION = "3.5.
|
|
119724
|
+
SERVER_VERSION = "3.5.3";
|
|
119720
119725
|
startTime = Date.now();
|
|
119721
119726
|
}
|
|
119722
119727
|
});
|
|
@@ -121129,7 +121134,7 @@ var init_system = __esm({
|
|
|
121129
121134
|
init_error_handler();
|
|
121130
121135
|
init_broadcaster();
|
|
121131
121136
|
init_approval_service();
|
|
121132
|
-
SERVER_VERSION2 = "3.5.
|
|
121137
|
+
SERVER_VERSION2 = "3.5.3";
|
|
121133
121138
|
startTime2 = Date.now();
|
|
121134
121139
|
UpdateConfigSchema = z20.object({
|
|
121135
121140
|
server: z20.object({
|
|
@@ -158907,7 +158912,7 @@ var init_admin3 = __esm({
|
|
|
158907
158912
|
"../server/src/routes/admin.ts"() {
|
|
158908
158913
|
"use strict";
|
|
158909
158914
|
init_rate_limit();
|
|
158910
|
-
SERVER_VERSION3 = "3.5.
|
|
158915
|
+
SERVER_VERSION3 = "3.5.3";
|
|
158911
158916
|
startTime3 = Date.now();
|
|
158912
158917
|
}
|
|
158913
158918
|
});
|
|
@@ -162484,7 +162489,7 @@ var VERSION2, DATA_DIR3, TELEMETRY_ID_FILE, TELEMETRY_LOG_FILE, DEFAULT_FLUSH_TH
|
|
|
162484
162489
|
var init_telemetry2 = __esm({
|
|
162485
162490
|
"../server/src/services/telemetry.ts"() {
|
|
162486
162491
|
"use strict";
|
|
162487
|
-
VERSION2 = "3.5.
|
|
162492
|
+
VERSION2 = "3.5.3";
|
|
162488
162493
|
DATA_DIR3 = join27(homedir10(), ".nestor");
|
|
162489
162494
|
TELEMETRY_ID_FILE = join27(DATA_DIR3, "telemetry-id");
|
|
162490
162495
|
TELEMETRY_LOG_FILE = join27(DATA_DIR3, "telemetry.jsonl");
|
|
@@ -289658,438 +289663,14 @@ var require_chat_stream = __commonJS({
|
|
|
289658
289663
|
}
|
|
289659
289664
|
});
|
|
289660
289665
|
|
|
289661
|
-
// ../../node_modules/.pnpm/ms@2.0.0/node_modules/ms/index.js
|
|
289662
|
-
var require_ms2 = __commonJS({
|
|
289663
|
-
"../../node_modules/.pnpm/ms@2.0.0/node_modules/ms/index.js"(exports2, module2) {
|
|
289664
|
-
var s = 1e3;
|
|
289665
|
-
var m = s * 60;
|
|
289666
|
-
var h = m * 60;
|
|
289667
|
-
var d = h * 24;
|
|
289668
|
-
var y = d * 365.25;
|
|
289669
|
-
module2.exports = function(val, options) {
|
|
289670
|
-
options = options || {};
|
|
289671
|
-
var type = typeof val;
|
|
289672
|
-
if (type === "string" && val.length > 0) {
|
|
289673
|
-
return parse(val);
|
|
289674
|
-
} else if (type === "number" && isNaN(val) === false) {
|
|
289675
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
289676
|
-
}
|
|
289677
|
-
throw new Error(
|
|
289678
|
-
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
289679
|
-
);
|
|
289680
|
-
};
|
|
289681
|
-
function parse(str) {
|
|
289682
|
-
str = String(str);
|
|
289683
|
-
if (str.length > 100) {
|
|
289684
|
-
return;
|
|
289685
|
-
}
|
|
289686
|
-
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
|
|
289687
|
-
str
|
|
289688
|
-
);
|
|
289689
|
-
if (!match) {
|
|
289690
|
-
return;
|
|
289691
|
-
}
|
|
289692
|
-
var n = parseFloat(match[1]);
|
|
289693
|
-
var type = (match[2] || "ms").toLowerCase();
|
|
289694
|
-
switch (type) {
|
|
289695
|
-
case "years":
|
|
289696
|
-
case "year":
|
|
289697
|
-
case "yrs":
|
|
289698
|
-
case "yr":
|
|
289699
|
-
case "y":
|
|
289700
|
-
return n * y;
|
|
289701
|
-
case "days":
|
|
289702
|
-
case "day":
|
|
289703
|
-
case "d":
|
|
289704
|
-
return n * d;
|
|
289705
|
-
case "hours":
|
|
289706
|
-
case "hour":
|
|
289707
|
-
case "hrs":
|
|
289708
|
-
case "hr":
|
|
289709
|
-
case "h":
|
|
289710
|
-
return n * h;
|
|
289711
|
-
case "minutes":
|
|
289712
|
-
case "minute":
|
|
289713
|
-
case "mins":
|
|
289714
|
-
case "min":
|
|
289715
|
-
case "m":
|
|
289716
|
-
return n * m;
|
|
289717
|
-
case "seconds":
|
|
289718
|
-
case "second":
|
|
289719
|
-
case "secs":
|
|
289720
|
-
case "sec":
|
|
289721
|
-
case "s":
|
|
289722
|
-
return n * s;
|
|
289723
|
-
case "milliseconds":
|
|
289724
|
-
case "millisecond":
|
|
289725
|
-
case "msecs":
|
|
289726
|
-
case "msec":
|
|
289727
|
-
case "ms":
|
|
289728
|
-
return n;
|
|
289729
|
-
default:
|
|
289730
|
-
return void 0;
|
|
289731
|
-
}
|
|
289732
|
-
}
|
|
289733
|
-
function fmtShort(ms) {
|
|
289734
|
-
if (ms >= d) {
|
|
289735
|
-
return Math.round(ms / d) + "d";
|
|
289736
|
-
}
|
|
289737
|
-
if (ms >= h) {
|
|
289738
|
-
return Math.round(ms / h) + "h";
|
|
289739
|
-
}
|
|
289740
|
-
if (ms >= m) {
|
|
289741
|
-
return Math.round(ms / m) + "m";
|
|
289742
|
-
}
|
|
289743
|
-
if (ms >= s) {
|
|
289744
|
-
return Math.round(ms / s) + "s";
|
|
289745
|
-
}
|
|
289746
|
-
return ms + "ms";
|
|
289747
|
-
}
|
|
289748
|
-
function fmtLong(ms) {
|
|
289749
|
-
return plural(ms, d, "day") || plural(ms, h, "hour") || plural(ms, m, "minute") || plural(ms, s, "second") || ms + " ms";
|
|
289750
|
-
}
|
|
289751
|
-
function plural(ms, n, name) {
|
|
289752
|
-
if (ms < n) {
|
|
289753
|
-
return;
|
|
289754
|
-
}
|
|
289755
|
-
if (ms < n * 1.5) {
|
|
289756
|
-
return Math.floor(ms / n) + " " + name;
|
|
289757
|
-
}
|
|
289758
|
-
return Math.ceil(ms / n) + " " + name + "s";
|
|
289759
|
-
}
|
|
289760
|
-
}
|
|
289761
|
-
});
|
|
289762
|
-
|
|
289763
|
-
// ../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/debug.js
|
|
289764
|
-
var require_debug3 = __commonJS({
|
|
289765
|
-
"../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/debug.js"(exports2, module2) {
|
|
289766
|
-
exports2 = module2.exports = createDebug.debug = createDebug["default"] = createDebug;
|
|
289767
|
-
exports2.coerce = coerce;
|
|
289768
|
-
exports2.disable = disable;
|
|
289769
|
-
exports2.enable = enable;
|
|
289770
|
-
exports2.enabled = enabled;
|
|
289771
|
-
exports2.humanize = require_ms2();
|
|
289772
|
-
exports2.names = [];
|
|
289773
|
-
exports2.skips = [];
|
|
289774
|
-
exports2.formatters = {};
|
|
289775
|
-
var prevTime;
|
|
289776
|
-
function selectColor(namespace) {
|
|
289777
|
-
var hash = 0, i;
|
|
289778
|
-
for (i in namespace) {
|
|
289779
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
289780
|
-
hash |= 0;
|
|
289781
|
-
}
|
|
289782
|
-
return exports2.colors[Math.abs(hash) % exports2.colors.length];
|
|
289783
|
-
}
|
|
289784
|
-
function createDebug(namespace) {
|
|
289785
|
-
function debug5() {
|
|
289786
|
-
if (!debug5.enabled) return;
|
|
289787
|
-
var self2 = debug5;
|
|
289788
|
-
var curr = +/* @__PURE__ */ new Date();
|
|
289789
|
-
var ms = curr - (prevTime || curr);
|
|
289790
|
-
self2.diff = ms;
|
|
289791
|
-
self2.prev = prevTime;
|
|
289792
|
-
self2.curr = curr;
|
|
289793
|
-
prevTime = curr;
|
|
289794
|
-
var args = new Array(arguments.length);
|
|
289795
|
-
for (var i = 0; i < args.length; i++) {
|
|
289796
|
-
args[i] = arguments[i];
|
|
289797
|
-
}
|
|
289798
|
-
args[0] = exports2.coerce(args[0]);
|
|
289799
|
-
if ("string" !== typeof args[0]) {
|
|
289800
|
-
args.unshift("%O");
|
|
289801
|
-
}
|
|
289802
|
-
var index = 0;
|
|
289803
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format3) {
|
|
289804
|
-
if (match === "%%") return match;
|
|
289805
|
-
index++;
|
|
289806
|
-
var formatter = exports2.formatters[format3];
|
|
289807
|
-
if ("function" === typeof formatter) {
|
|
289808
|
-
var val = args[index];
|
|
289809
|
-
match = formatter.call(self2, val);
|
|
289810
|
-
args.splice(index, 1);
|
|
289811
|
-
index--;
|
|
289812
|
-
}
|
|
289813
|
-
return match;
|
|
289814
|
-
});
|
|
289815
|
-
exports2.formatArgs.call(self2, args);
|
|
289816
|
-
var logFn = debug5.log || exports2.log || console.log.bind(console);
|
|
289817
|
-
logFn.apply(self2, args);
|
|
289818
|
-
}
|
|
289819
|
-
debug5.namespace = namespace;
|
|
289820
|
-
debug5.enabled = exports2.enabled(namespace);
|
|
289821
|
-
debug5.useColors = exports2.useColors();
|
|
289822
|
-
debug5.color = selectColor(namespace);
|
|
289823
|
-
if ("function" === typeof exports2.init) {
|
|
289824
|
-
exports2.init(debug5);
|
|
289825
|
-
}
|
|
289826
|
-
return debug5;
|
|
289827
|
-
}
|
|
289828
|
-
function enable(namespaces) {
|
|
289829
|
-
exports2.save(namespaces);
|
|
289830
|
-
exports2.names = [];
|
|
289831
|
-
exports2.skips = [];
|
|
289832
|
-
var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
|
|
289833
|
-
var len = split.length;
|
|
289834
|
-
for (var i = 0; i < len; i++) {
|
|
289835
|
-
if (!split[i]) continue;
|
|
289836
|
-
namespaces = split[i].replace(/\*/g, ".*?");
|
|
289837
|
-
if (namespaces[0] === "-") {
|
|
289838
|
-
exports2.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
|
|
289839
|
-
} else {
|
|
289840
|
-
exports2.names.push(new RegExp("^" + namespaces + "$"));
|
|
289841
|
-
}
|
|
289842
|
-
}
|
|
289843
|
-
}
|
|
289844
|
-
function disable() {
|
|
289845
|
-
exports2.enable("");
|
|
289846
|
-
}
|
|
289847
|
-
function enabled(name) {
|
|
289848
|
-
var i, len;
|
|
289849
|
-
for (i = 0, len = exports2.skips.length; i < len; i++) {
|
|
289850
|
-
if (exports2.skips[i].test(name)) {
|
|
289851
|
-
return false;
|
|
289852
|
-
}
|
|
289853
|
-
}
|
|
289854
|
-
for (i = 0, len = exports2.names.length; i < len; i++) {
|
|
289855
|
-
if (exports2.names[i].test(name)) {
|
|
289856
|
-
return true;
|
|
289857
|
-
}
|
|
289858
|
-
}
|
|
289859
|
-
return false;
|
|
289860
|
-
}
|
|
289861
|
-
function coerce(val) {
|
|
289862
|
-
if (val instanceof Error) return val.stack || val.message;
|
|
289863
|
-
return val;
|
|
289864
|
-
}
|
|
289865
|
-
}
|
|
289866
|
-
});
|
|
289867
|
-
|
|
289868
|
-
// ../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/browser.js
|
|
289869
|
-
var require_browser4 = __commonJS({
|
|
289870
|
-
"../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/browser.js"(exports2, module2) {
|
|
289871
|
-
exports2 = module2.exports = require_debug3();
|
|
289872
|
-
exports2.log = log3;
|
|
289873
|
-
exports2.formatArgs = formatArgs;
|
|
289874
|
-
exports2.save = save;
|
|
289875
|
-
exports2.load = load;
|
|
289876
|
-
exports2.useColors = useColors;
|
|
289877
|
-
exports2.storage = "undefined" != typeof chrome && "undefined" != typeof chrome.storage ? chrome.storage.local : localstorage();
|
|
289878
|
-
exports2.colors = [
|
|
289879
|
-
"lightseagreen",
|
|
289880
|
-
"forestgreen",
|
|
289881
|
-
"goldenrod",
|
|
289882
|
-
"dodgerblue",
|
|
289883
|
-
"darkorchid",
|
|
289884
|
-
"crimson"
|
|
289885
|
-
];
|
|
289886
|
-
function useColors() {
|
|
289887
|
-
if (typeof window !== "undefined" && window.process && window.process.type === "renderer") {
|
|
289888
|
-
return true;
|
|
289889
|
-
}
|
|
289890
|
-
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
|
|
289891
|
-
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
|
|
289892
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
289893
|
-
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
|
|
289894
|
-
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
289895
|
-
}
|
|
289896
|
-
exports2.formatters.j = function(v) {
|
|
289897
|
-
try {
|
|
289898
|
-
return JSON.stringify(v);
|
|
289899
|
-
} catch (err) {
|
|
289900
|
-
return "[UnexpectedJSONParseError]: " + err.message;
|
|
289901
|
-
}
|
|
289902
|
-
};
|
|
289903
|
-
function formatArgs(args) {
|
|
289904
|
-
var useColors2 = this.useColors;
|
|
289905
|
-
args[0] = (useColors2 ? "%c" : "") + this.namespace + (useColors2 ? " %c" : " ") + args[0] + (useColors2 ? "%c " : " ") + "+" + exports2.humanize(this.diff);
|
|
289906
|
-
if (!useColors2) return;
|
|
289907
|
-
var c = "color: " + this.color;
|
|
289908
|
-
args.splice(1, 0, c, "color: inherit");
|
|
289909
|
-
var index = 0;
|
|
289910
|
-
var lastC = 0;
|
|
289911
|
-
args[0].replace(/%[a-zA-Z%]/g, function(match) {
|
|
289912
|
-
if ("%%" === match) return;
|
|
289913
|
-
index++;
|
|
289914
|
-
if ("%c" === match) {
|
|
289915
|
-
lastC = index;
|
|
289916
|
-
}
|
|
289917
|
-
});
|
|
289918
|
-
args.splice(lastC, 0, c);
|
|
289919
|
-
}
|
|
289920
|
-
function log3() {
|
|
289921
|
-
return "object" === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);
|
|
289922
|
-
}
|
|
289923
|
-
function save(namespaces) {
|
|
289924
|
-
try {
|
|
289925
|
-
if (null == namespaces) {
|
|
289926
|
-
exports2.storage.removeItem("debug");
|
|
289927
|
-
} else {
|
|
289928
|
-
exports2.storage.debug = namespaces;
|
|
289929
|
-
}
|
|
289930
|
-
} catch (e) {
|
|
289931
|
-
}
|
|
289932
|
-
}
|
|
289933
|
-
function load() {
|
|
289934
|
-
var r;
|
|
289935
|
-
try {
|
|
289936
|
-
r = exports2.storage.debug;
|
|
289937
|
-
} catch (e) {
|
|
289938
|
-
}
|
|
289939
|
-
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
289940
|
-
r = process.env.DEBUG;
|
|
289941
|
-
}
|
|
289942
|
-
return r;
|
|
289943
|
-
}
|
|
289944
|
-
exports2.enable(load());
|
|
289945
|
-
function localstorage() {
|
|
289946
|
-
try {
|
|
289947
|
-
return window.localStorage;
|
|
289948
|
-
} catch (e) {
|
|
289949
|
-
}
|
|
289950
|
-
}
|
|
289951
|
-
}
|
|
289952
|
-
});
|
|
289953
|
-
|
|
289954
|
-
// ../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/node.js
|
|
289955
|
-
var require_node15 = __commonJS({
|
|
289956
|
-
"../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/node.js"(exports2, module2) {
|
|
289957
|
-
var tty = __require("tty");
|
|
289958
|
-
var util = __require("util");
|
|
289959
|
-
exports2 = module2.exports = require_debug3();
|
|
289960
|
-
exports2.init = init;
|
|
289961
|
-
exports2.log = log3;
|
|
289962
|
-
exports2.formatArgs = formatArgs;
|
|
289963
|
-
exports2.save = save;
|
|
289964
|
-
exports2.load = load;
|
|
289965
|
-
exports2.useColors = useColors;
|
|
289966
|
-
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
289967
|
-
exports2.inspectOpts = Object.keys(process.env).filter(function(key) {
|
|
289968
|
-
return /^debug_/i.test(key);
|
|
289969
|
-
}).reduce(function(obj2, key) {
|
|
289970
|
-
var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
|
|
289971
|
-
return k.toUpperCase();
|
|
289972
|
-
});
|
|
289973
|
-
var val = process.env[key];
|
|
289974
|
-
if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
|
|
289975
|
-
else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
|
|
289976
|
-
else if (val === "null") val = null;
|
|
289977
|
-
else val = Number(val);
|
|
289978
|
-
obj2[prop] = val;
|
|
289979
|
-
return obj2;
|
|
289980
|
-
}, {});
|
|
289981
|
-
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
|
289982
|
-
if (1 !== fd && 2 !== fd) {
|
|
289983
|
-
util.deprecate(function() {
|
|
289984
|
-
}, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
|
|
289985
|
-
}
|
|
289986
|
-
var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);
|
|
289987
|
-
function useColors() {
|
|
289988
|
-
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(fd);
|
|
289989
|
-
}
|
|
289990
|
-
exports2.formatters.o = function(v) {
|
|
289991
|
-
this.inspectOpts.colors = this.useColors;
|
|
289992
|
-
return util.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
|
289993
|
-
return str.trim();
|
|
289994
|
-
}).join(" ");
|
|
289995
|
-
};
|
|
289996
|
-
exports2.formatters.O = function(v) {
|
|
289997
|
-
this.inspectOpts.colors = this.useColors;
|
|
289998
|
-
return util.inspect(v, this.inspectOpts);
|
|
289999
|
-
};
|
|
290000
|
-
function formatArgs(args) {
|
|
290001
|
-
var name = this.namespace;
|
|
290002
|
-
var useColors2 = this.useColors;
|
|
290003
|
-
if (useColors2) {
|
|
290004
|
-
var c = this.color;
|
|
290005
|
-
var prefix = " \x1B[3" + c + ";1m" + name + " \x1B[0m";
|
|
290006
|
-
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
290007
|
-
args.push("\x1B[3" + c + "m+" + exports2.humanize(this.diff) + "\x1B[0m");
|
|
290008
|
-
} else {
|
|
290009
|
-
args[0] = (/* @__PURE__ */ new Date()).toUTCString() + " " + name + " " + args[0];
|
|
290010
|
-
}
|
|
290011
|
-
}
|
|
290012
|
-
function log3() {
|
|
290013
|
-
return stream.write(util.format.apply(util, arguments) + "\n");
|
|
290014
|
-
}
|
|
290015
|
-
function save(namespaces) {
|
|
290016
|
-
if (null == namespaces) {
|
|
290017
|
-
delete process.env.DEBUG;
|
|
290018
|
-
} else {
|
|
290019
|
-
process.env.DEBUG = namespaces;
|
|
290020
|
-
}
|
|
290021
|
-
}
|
|
290022
|
-
function load() {
|
|
290023
|
-
return process.env.DEBUG;
|
|
290024
|
-
}
|
|
290025
|
-
function createWritableStdioStream(fd2) {
|
|
290026
|
-
var stream2;
|
|
290027
|
-
var tty_wrap = process.binding("tty_wrap");
|
|
290028
|
-
switch (tty_wrap.guessHandleType(fd2)) {
|
|
290029
|
-
case "TTY":
|
|
290030
|
-
stream2 = new tty.WriteStream(fd2);
|
|
290031
|
-
stream2._type = "tty";
|
|
290032
|
-
if (stream2._handle && stream2._handle.unref) {
|
|
290033
|
-
stream2._handle.unref();
|
|
290034
|
-
}
|
|
290035
|
-
break;
|
|
290036
|
-
case "FILE":
|
|
290037
|
-
var fs32 = __require("fs");
|
|
290038
|
-
stream2 = new fs32.SyncWriteStream(fd2, { autoClose: false });
|
|
290039
|
-
stream2._type = "fs";
|
|
290040
|
-
break;
|
|
290041
|
-
case "PIPE":
|
|
290042
|
-
case "TCP":
|
|
290043
|
-
var net = __require("net");
|
|
290044
|
-
stream2 = new net.Socket({
|
|
290045
|
-
fd: fd2,
|
|
290046
|
-
readable: false,
|
|
290047
|
-
writable: true
|
|
290048
|
-
});
|
|
290049
|
-
stream2.readable = false;
|
|
290050
|
-
stream2.read = null;
|
|
290051
|
-
stream2._type = "pipe";
|
|
290052
|
-
if (stream2._handle && stream2._handle.unref) {
|
|
290053
|
-
stream2._handle.unref();
|
|
290054
|
-
}
|
|
290055
|
-
break;
|
|
290056
|
-
default:
|
|
290057
|
-
throw new Error("Implement me. Unknown stream file type!");
|
|
290058
|
-
}
|
|
290059
|
-
stream2.fd = fd2;
|
|
290060
|
-
stream2._isStdio = true;
|
|
290061
|
-
return stream2;
|
|
290062
|
-
}
|
|
290063
|
-
function init(debug5) {
|
|
290064
|
-
debug5.inspectOpts = {};
|
|
290065
|
-
var keys = Object.keys(exports2.inspectOpts);
|
|
290066
|
-
for (var i = 0; i < keys.length; i++) {
|
|
290067
|
-
debug5.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
290068
|
-
}
|
|
290069
|
-
}
|
|
290070
|
-
exports2.enable(load());
|
|
290071
|
-
}
|
|
290072
|
-
});
|
|
290073
|
-
|
|
290074
|
-
// ../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/index.js
|
|
290075
|
-
var require_src19 = __commonJS({
|
|
290076
|
-
"../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/index.js"(exports2, module2) {
|
|
290077
|
-
if (typeof process !== "undefined" && process.type === "renderer") {
|
|
290078
|
-
module2.exports = require_browser4();
|
|
290079
|
-
} else {
|
|
290080
|
-
module2.exports = require_node15();
|
|
290081
|
-
}
|
|
290082
|
-
}
|
|
290083
|
-
});
|
|
290084
|
-
|
|
290085
289666
|
// ../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js
|
|
290086
|
-
var
|
|
289667
|
+
var require_debug3 = __commonJS({
|
|
290087
289668
|
"../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js"(exports2, module2) {
|
|
290088
289669
|
var debug5;
|
|
290089
289670
|
module2.exports = function() {
|
|
290090
289671
|
if (!debug5) {
|
|
290091
289672
|
try {
|
|
290092
|
-
debug5 =
|
|
289673
|
+
debug5 = require_src()("follow-redirects");
|
|
290093
289674
|
} catch (error) {
|
|
290094
289675
|
}
|
|
290095
289676
|
if (typeof debug5 !== "function") {
|
|
@@ -290111,7 +289692,7 @@ var require_follow_redirects = __commonJS({
|
|
|
290111
289692
|
var https2 = __require("https");
|
|
290112
289693
|
var Writable = __require("stream").Writable;
|
|
290113
289694
|
var assert3 = __require("assert");
|
|
290114
|
-
var debug5 =
|
|
289695
|
+
var debug5 = require_debug3();
|
|
290115
289696
|
(function detectUnsupportedEnvironment() {
|
|
290116
289697
|
var looksLikeNode = typeof process !== "undefined";
|
|
290117
289698
|
var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
@@ -308173,7 +307754,7 @@ var require_SocketModeClient = __commonJS({
|
|
|
308173
307754
|
});
|
|
308174
307755
|
|
|
308175
307756
|
// ../../node_modules/.pnpm/@slack+socket-mode@2.0.6/node_modules/@slack/socket-mode/dist/src/index.js
|
|
308176
|
-
var
|
|
307757
|
+
var require_src19 = __commonJS({
|
|
308177
307758
|
"../../node_modules/.pnpm/@slack+socket-mode@2.0.6/node_modules/@slack/socket-mode/dist/src/index.js"(exports2) {
|
|
308178
307759
|
"use strict";
|
|
308179
307760
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -308259,7 +307840,7 @@ var require_SocketModeReceiver = __commonJS({
|
|
|
308259
307840
|
var node_url_1 = __require("node:url");
|
|
308260
307841
|
var logger_1 = require_dist21();
|
|
308261
307842
|
var oauth_1 = require_dist25();
|
|
308262
|
-
var socket_mode_1 =
|
|
307843
|
+
var socket_mode_1 = require_src19();
|
|
308263
307844
|
var path_to_regexp_1 = require_dist26();
|
|
308264
307845
|
var SocketModeFunctions_1 = require_SocketModeFunctions();
|
|
308265
307846
|
var SocketModeResponseAck_1 = require_SocketModeResponseAck();
|
|
@@ -311707,7 +311288,7 @@ var init_src8 = __esm({
|
|
|
311707
311288
|
await this._handle.listen();
|
|
311708
311289
|
const authMode = config2.apiKey ? "API key" : "open (no auth)";
|
|
311709
311290
|
console.log(`
|
|
311710
|
-
Nestor Server v3.5.
|
|
311291
|
+
Nestor Server v3.5.3`);
|
|
311711
311292
|
console.log(` \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`);
|
|
311712
311293
|
console.log(` HTTP : http://${this._host}:${this._port}`);
|
|
311713
311294
|
console.log(` WS : ws://${this._host}:${this._port}/ws`);
|
|
@@ -319922,190 +319503,9 @@ var init_mock_llm = __esm({
|
|
|
319922
319503
|
}
|
|
319923
319504
|
});
|
|
319924
319505
|
|
|
319925
|
-
// ../skill-tester/src/test-runner.ts
|
|
319926
|
-
var SkillTestRunner2;
|
|
319927
|
-
var init_test_runner = __esm({
|
|
319928
|
-
"../skill-tester/src/test-runner.ts"() {
|
|
319929
|
-
"use strict";
|
|
319930
|
-
init_mock_llm();
|
|
319931
|
-
SkillTestRunner2 = class {
|
|
319932
|
-
opts;
|
|
319933
|
-
constructor(opts) {
|
|
319934
|
-
this.opts = opts ?? {};
|
|
319935
|
-
}
|
|
319936
|
-
/**
|
|
319937
|
-
* Run a full test suite.
|
|
319938
|
-
*/
|
|
319939
|
-
async run(suite) {
|
|
319940
|
-
const results = [];
|
|
319941
|
-
const suiteStart = Date.now();
|
|
319942
|
-
if (this.opts.verbose) {
|
|
319943
|
-
console.log("");
|
|
319944
|
-
console.log(` Skill: ${suite.skillName}`);
|
|
319945
|
-
if (suite.description) {
|
|
319946
|
-
console.log(` ${suite.description}`);
|
|
319947
|
-
}
|
|
319948
|
-
console.log("");
|
|
319949
|
-
}
|
|
319950
|
-
if (suite.setup) {
|
|
319951
|
-
try {
|
|
319952
|
-
await suite.setup();
|
|
319953
|
-
} catch (err) {
|
|
319954
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
319955
|
-
console.error(` Suite setup failed: ${msg}`);
|
|
319956
|
-
return {
|
|
319957
|
-
skillName: suite.skillName,
|
|
319958
|
-
description: suite.description,
|
|
319959
|
-
total: suite.tests.length,
|
|
319960
|
-
passed: 0,
|
|
319961
|
-
failed: suite.tests.length,
|
|
319962
|
-
results: suite.tests.map((t) => ({
|
|
319963
|
-
name: t.name,
|
|
319964
|
-
passed: false,
|
|
319965
|
-
error: `Suite setup failed: ${msg}`,
|
|
319966
|
-
durationMs: 0
|
|
319967
|
-
})),
|
|
319968
|
-
durationMs: Date.now() - suiteStart
|
|
319969
|
-
};
|
|
319970
|
-
}
|
|
319971
|
-
}
|
|
319972
|
-
for (const test of suite.tests) {
|
|
319973
|
-
const result = await this.runTest(suite, test);
|
|
319974
|
-
results.push(result);
|
|
319975
|
-
if (this.opts.verbose) {
|
|
319976
|
-
const icon = result.passed ? "\u2705" : "\u274C";
|
|
319977
|
-
console.log(` ${icon} ${test.name} (${result.durationMs}ms)`);
|
|
319978
|
-
if (!result.passed && result.error) {
|
|
319979
|
-
console.log(` ${result.error}`);
|
|
319980
|
-
}
|
|
319981
|
-
}
|
|
319982
|
-
if (this.opts.bail && !result.passed) {
|
|
319983
|
-
const remaining = suite.tests.slice(results.length);
|
|
319984
|
-
for (const rem of remaining) {
|
|
319985
|
-
results.push({
|
|
319986
|
-
name: rem.name,
|
|
319987
|
-
passed: false,
|
|
319988
|
-
error: "Skipped (bail on failure)",
|
|
319989
|
-
durationMs: 0
|
|
319990
|
-
});
|
|
319991
|
-
}
|
|
319992
|
-
break;
|
|
319993
|
-
}
|
|
319994
|
-
}
|
|
319995
|
-
if (suite.teardown) {
|
|
319996
|
-
try {
|
|
319997
|
-
await suite.teardown();
|
|
319998
|
-
} catch (err) {
|
|
319999
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
320000
|
-
if (this.opts.verbose) {
|
|
320001
|
-
console.error(` Suite teardown failed: ${msg}`);
|
|
320002
|
-
}
|
|
320003
|
-
}
|
|
320004
|
-
}
|
|
320005
|
-
const totalDuration = Date.now() - suiteStart;
|
|
320006
|
-
if (this.opts.verbose) {
|
|
320007
|
-
const passCount = results.filter((r) => r.passed).length;
|
|
320008
|
-
const failCount = results.filter((r) => !r.passed).length;
|
|
320009
|
-
console.log("");
|
|
320010
|
-
console.log(
|
|
320011
|
-
` ${passCount} passed, ${failCount} failed (${totalDuration}ms)`
|
|
320012
|
-
);
|
|
320013
|
-
console.log("");
|
|
320014
|
-
}
|
|
320015
|
-
return {
|
|
320016
|
-
skillName: suite.skillName,
|
|
320017
|
-
description: suite.description,
|
|
320018
|
-
total: results.length,
|
|
320019
|
-
passed: results.filter((r) => r.passed).length,
|
|
320020
|
-
failed: results.filter((r) => !r.passed).length,
|
|
320021
|
-
results,
|
|
320022
|
-
durationMs: totalDuration
|
|
320023
|
-
};
|
|
320024
|
-
}
|
|
320025
|
-
/**
|
|
320026
|
-
* Run a single test case.
|
|
320027
|
-
*/
|
|
320028
|
-
async runTest(suite, test) {
|
|
320029
|
-
const start = Date.now();
|
|
320030
|
-
try {
|
|
320031
|
-
if (test.setup) {
|
|
320032
|
-
await test.setup();
|
|
320033
|
-
}
|
|
320034
|
-
const mockLlm = test.mockLlm || suite.mockLlm || new MockLlmAdapter2();
|
|
320035
|
-
const messages = [{ role: "user", content: test.input }];
|
|
320036
|
-
const response = await mockLlm.chat(messages);
|
|
320037
|
-
const toolCalls = response.toolCalls ?? [];
|
|
320038
|
-
const toolsCalled = toolCalls.map((tc) => tc.name);
|
|
320039
|
-
const output = response.content;
|
|
320040
|
-
if (test.expectedTools) {
|
|
320041
|
-
for (const expectedTool of test.expectedTools) {
|
|
320042
|
-
if (!toolsCalled.includes(expectedTool)) {
|
|
320043
|
-
throw new Error(
|
|
320044
|
-
`Expected tool '${expectedTool}' to be called, but it was not. Called tools: [${toolsCalled.join(", ")}]`
|
|
320045
|
-
);
|
|
320046
|
-
}
|
|
320047
|
-
}
|
|
320048
|
-
}
|
|
320049
|
-
if (test.expectedOutput !== void 0) {
|
|
320050
|
-
if (typeof test.expectedOutput === "string") {
|
|
320051
|
-
if (!output.includes(test.expectedOutput)) {
|
|
320052
|
-
throw new Error(
|
|
320053
|
-
`Expected output to contain '${test.expectedOutput}', but got: '${output.substring(0, 200)}'`
|
|
320054
|
-
);
|
|
320055
|
-
}
|
|
320056
|
-
} else if (test.expectedOutput instanceof RegExp) {
|
|
320057
|
-
if (!test.expectedOutput.test(output)) {
|
|
320058
|
-
throw new Error(
|
|
320059
|
-
`Expected output to match ${test.expectedOutput}, but got: '${output.substring(0, 200)}'`
|
|
320060
|
-
);
|
|
320061
|
-
}
|
|
320062
|
-
}
|
|
320063
|
-
}
|
|
320064
|
-
if (test.expectedToolArgs && toolCalls.length > 0) {
|
|
320065
|
-
const lastCall = toolCalls[toolCalls.length - 1];
|
|
320066
|
-
for (const [key, value] of Object.entries(test.expectedToolArgs)) {
|
|
320067
|
-
const actual = lastCall.arguments?.[key];
|
|
320068
|
-
if (JSON.stringify(actual) !== JSON.stringify(value)) {
|
|
320069
|
-
throw new Error(
|
|
320070
|
-
`Expected tool arg '${key}' to be ${JSON.stringify(value)}, but got: ${JSON.stringify(actual)}`
|
|
320071
|
-
);
|
|
320072
|
-
}
|
|
320073
|
-
}
|
|
320074
|
-
}
|
|
320075
|
-
if (test.teardown) {
|
|
320076
|
-
await test.teardown();
|
|
320077
|
-
}
|
|
320078
|
-
return {
|
|
320079
|
-
name: test.name,
|
|
320080
|
-
passed: true,
|
|
320081
|
-
durationMs: Date.now() - start,
|
|
320082
|
-
toolsCalled,
|
|
320083
|
-
output
|
|
320084
|
-
};
|
|
320085
|
-
} catch (err) {
|
|
320086
|
-
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
320087
|
-
if (test.teardown) {
|
|
320088
|
-
try {
|
|
320089
|
-
await test.teardown();
|
|
320090
|
-
} catch {
|
|
320091
|
-
}
|
|
320092
|
-
}
|
|
320093
|
-
return {
|
|
320094
|
-
name: test.name,
|
|
320095
|
-
passed: false,
|
|
320096
|
-
error: errorMsg,
|
|
320097
|
-
durationMs: Date.now() - start
|
|
320098
|
-
};
|
|
320099
|
-
}
|
|
320100
|
-
}
|
|
320101
|
-
};
|
|
320102
|
-
}
|
|
320103
|
-
});
|
|
320104
|
-
|
|
320105
319506
|
// ../skill-tester/src/index.ts
|
|
320106
319507
|
var src_exports7 = {};
|
|
320107
319508
|
__export(src_exports7, {
|
|
320108
|
-
LegacySkillTestRunner: () => SkillTestRunner2,
|
|
320109
319509
|
MockLlmAdapter: () => MockLlmAdapter2,
|
|
320110
319510
|
SkillTestRunner: () => SkillTestRunner,
|
|
320111
319511
|
TestReporter: () => TestReporter,
|
|
@@ -320122,7 +319522,6 @@ var init_src9 = __esm({
|
|
|
320122
319522
|
init_yaml_loader();
|
|
320123
319523
|
init_reporter();
|
|
320124
319524
|
init_mock_llm();
|
|
320125
|
-
init_test_runner();
|
|
320126
319525
|
init_mock_llm();
|
|
320127
319526
|
}
|
|
320128
319527
|
});
|
|
@@ -321496,7 +320895,7 @@ var init_server = __esm({
|
|
|
321496
320895
|
MCP_PROTOCOL_VERSION = "2024-11-05";
|
|
321497
320896
|
SERVER_INFO = {
|
|
321498
320897
|
name: "nestor",
|
|
321499
|
-
version: "3.5.
|
|
320898
|
+
version: "3.5.3"
|
|
321500
320899
|
};
|
|
321501
320900
|
SERVER_CAPABILITIES = {
|
|
321502
320901
|
tools: { listChanged: false },
|
|
@@ -322217,7 +321616,7 @@ function printWelcome() {
|
|
|
322217
321616
|
console.log(chalk15.cyan(` | .\` | | _| \\__ \\ | | | (_) | | / _ \\__ \\ | __ |`));
|
|
322218
321617
|
console.log(chalk15.cyan(` |_|\\_| |___| |___/ |_| \\___/ |_|_\\ (_) |___/ |_||_|`));
|
|
322219
321618
|
console.log("");
|
|
322220
|
-
console.log(chalk15.dim(" Interactive Shell \u2014 v3.5.
|
|
321619
|
+
console.log(chalk15.dim(" Interactive Shell \u2014 v3.5.3"));
|
|
322221
321620
|
console.log(chalk15.dim(" Type /help for commands, /exit to quit."));
|
|
322222
321621
|
console.log(chalk15.dim(" Multiline: end a line with \\ or use ``` code blocks."));
|
|
322223
321622
|
console.log("");
|
|
@@ -324136,7 +323535,7 @@ var BANNER = `
|
|
|
324136
323535
|
function registerStartCommand(program2) {
|
|
324137
323536
|
program2.command("start").description("Start the Nestor server").option("-p, --port <port>", "Server port").option("-H, --host <host>", "Server host").option("--no-studio", "Disable the Studio web UI").action(async (options) => {
|
|
324138
323537
|
console.log(chalk.cyan(BANNER));
|
|
324139
|
-
console.log(chalk.dim(` v3.5.
|
|
323538
|
+
console.log(chalk.dim(` v3.5.3
|
|
324140
323539
|
`));
|
|
324141
323540
|
let config2 = readConfigFile();
|
|
324142
323541
|
if (!config2) {
|
|
@@ -325242,8 +324641,8 @@ function registerSkillCommand(program2) {
|
|
|
325242
324641
|
console.log(chalk4.dim("Use `defineSkillTests()` from @nestor/skill-tester."));
|
|
325243
324642
|
process.exit(1);
|
|
325244
324643
|
}
|
|
325245
|
-
const { SkillTestRunner:
|
|
325246
|
-
const runner = new
|
|
324644
|
+
const { SkillTestRunner: SkillTestRunner2 } = await Promise.resolve().then(() => (init_src9(), src_exports7));
|
|
324645
|
+
const runner = new SkillTestRunner2({
|
|
325247
324646
|
verbose: options.verbose ?? true,
|
|
325248
324647
|
bail: options.bail
|
|
325249
324648
|
});
|
|
@@ -326195,7 +325594,7 @@ async function startForeground() {
|
|
|
326195
325594
|
console.log(chalk23.cyan(` | .\` | | _| \\__ \\ | | | (_) | | / _ \\__ \\ | __ |`));
|
|
326196
325595
|
console.log(chalk23.cyan(` |_|\\_| |___| |___/ |_| \\___/ |_|_\\ (_) |___/ |_||_|`));
|
|
326197
325596
|
console.log("");
|
|
326198
|
-
console.log(chalk23.dim(" Daemon Mode \u2014 v3.5.
|
|
325597
|
+
console.log(chalk23.dim(" Daemon Mode \u2014 v3.5.3"));
|
|
326199
325598
|
console.log(chalk23.dim(` PID: ${process.pid}`));
|
|
326200
325599
|
console.log(chalk23.dim(` Log: ${LOG_FILE}`));
|
|
326201
325600
|
console.log("");
|
|
@@ -329704,7 +329103,7 @@ function registerEvolveCommand(program2) {
|
|
|
329704
329103
|
|
|
329705
329104
|
// src/index.ts
|
|
329706
329105
|
var program = new Command();
|
|
329707
|
-
program.name("nestor-sh").description("Nestor AI Agent Platform \u2014 orchestrate, secure and monitor AI agents").version("3.5.
|
|
329106
|
+
program.name("nestor-sh").description("Nestor AI Agent Platform \u2014 orchestrate, secure and monitor AI agents").version("3.5.3");
|
|
329708
329107
|
registerStartCommand(program);
|
|
329709
329108
|
registerInstallCommand(program);
|
|
329710
329109
|
registerAgentCommand(program);
|