viben 1.1.9 → 1.2.1
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/index.cjs +245 -85
- package/dist/index.js +250 -90
- package/dist/templates/iflow/settings.json +47 -47
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2160,8 +2160,8 @@ var require_lib2 = __commonJS({
|
|
|
2160
2160
|
});
|
|
2161
2161
|
|
|
2162
2162
|
// ../../packages/core/dist/index.js
|
|
2163
|
-
import * as
|
|
2164
|
-
import
|
|
2163
|
+
import * as os3 from "os";
|
|
2164
|
+
import os3__default, { homedir as homedir2, platform as platform2, type, release, hostname, arch, tmpdir } from "os";
|
|
2165
2165
|
import * as path21 from "path";
|
|
2166
2166
|
import path21__default, { join as join2, dirname as dirname2, basename as basename2, isAbsolute, resolve as resolve2, parse as parse$1, sep as sep2, delimiter, extname as extname2, relative as relative2 } from "path";
|
|
2167
2167
|
import * as fs15 from "fs/promises";
|
|
@@ -12232,7 +12232,7 @@ function cleanOldTelemetryFiles(baseDir, retentionDays = 7) {
|
|
|
12232
12232
|
}
|
|
12233
12233
|
}
|
|
12234
12234
|
function getDefaultTelemetryDir() {
|
|
12235
|
-
const stateDir = process.env.VIBEN_STATE_DIR || path21.join(
|
|
12235
|
+
const stateDir = process.env.VIBEN_STATE_DIR || path21.join(os3.homedir(), ".viben");
|
|
12236
12236
|
return path21.join(stateDir, "telemetry");
|
|
12237
12237
|
}
|
|
12238
12238
|
var init_telemetry = __esm({
|
|
@@ -19839,13 +19839,13 @@ __export(config_exports2, {
|
|
|
19839
19839
|
function resolveStateDir() {
|
|
19840
19840
|
const override = process.env.OPENCLAW_STATE_DIR?.trim() || process.env.CLAWDBOT_STATE_DIR?.trim();
|
|
19841
19841
|
if (override) {
|
|
19842
|
-
return override.startsWith("~") ? path21__default.resolve(override.replace(/^~(?=$|[\\/])/,
|
|
19842
|
+
return override.startsWith("~") ? path21__default.resolve(override.replace(/^~(?=$|[\\/])/, os3__default.homedir())) : path21__default.resolve(override);
|
|
19843
19843
|
}
|
|
19844
19844
|
if (fs20__default.existsSync(DEFAULT_STATE_DIR)) {
|
|
19845
19845
|
return DEFAULT_STATE_DIR;
|
|
19846
19846
|
}
|
|
19847
19847
|
const legacyDirs = [".clawdbot", ".moltbot", ".moldbot"].map(
|
|
19848
|
-
(dir) => path21__default.join(
|
|
19848
|
+
(dir) => path21__default.join(os3__default.homedir(), dir)
|
|
19849
19849
|
);
|
|
19850
19850
|
const existing = legacyDirs.find((dir) => {
|
|
19851
19851
|
try {
|
|
@@ -19859,7 +19859,7 @@ function resolveStateDir() {
|
|
|
19859
19859
|
function findConfigPath() {
|
|
19860
19860
|
const override = process.env.OPENCLAW_CONFIG_PATH?.trim();
|
|
19861
19861
|
if (override) {
|
|
19862
|
-
return override.startsWith("~") ? path21__default.resolve(override.replace(/^~(?=$|[\\/])/,
|
|
19862
|
+
return override.startsWith("~") ? path21__default.resolve(override.replace(/^~(?=$|[\\/])/, os3__default.homedir())) : path21__default.resolve(override);
|
|
19863
19863
|
}
|
|
19864
19864
|
const stateDir = resolveStateDir();
|
|
19865
19865
|
const candidates = [CONFIG_FILENAME, ...LEGACY_CONFIG_FILENAMES].map(
|
|
@@ -19919,7 +19919,7 @@ var LEGACY_CONFIG_FILENAMES;
|
|
|
19919
19919
|
var init_config3 = __esm({
|
|
19920
19920
|
"src/executors/engines/openclaw/config.ts"() {
|
|
19921
19921
|
init_types11();
|
|
19922
|
-
DEFAULT_STATE_DIR = path21__default.join(
|
|
19922
|
+
DEFAULT_STATE_DIR = path21__default.join(os3__default.homedir(), ".openclaw");
|
|
19923
19923
|
CONFIG_FILENAME = "openclaw.json";
|
|
19924
19924
|
LEGACY_CONFIG_FILENAMES = ["clawdbot.json", "moltbot.json", "moldbot.json"];
|
|
19925
19925
|
}
|
|
@@ -24069,14 +24069,14 @@ var require_is_docker = __commonJS2({
|
|
|
24069
24069
|
});
|
|
24070
24070
|
var require_is_wsl = __commonJS2({
|
|
24071
24071
|
"../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports2, module2) {
|
|
24072
|
-
var
|
|
24072
|
+
var os5 = __require2("os");
|
|
24073
24073
|
var fs23 = __require2("fs");
|
|
24074
24074
|
var isDocker = require_is_docker();
|
|
24075
24075
|
var isWsl = () => {
|
|
24076
24076
|
if (process.platform !== "linux") {
|
|
24077
24077
|
return false;
|
|
24078
24078
|
}
|
|
24079
|
-
if (
|
|
24079
|
+
if (os5.release().toLowerCase().includes("microsoft")) {
|
|
24080
24080
|
if (isDocker()) {
|
|
24081
24081
|
return false;
|
|
24082
24082
|
}
|
|
@@ -24103,7 +24103,7 @@ var require_utils2 = __commonJS2({
|
|
|
24103
24103
|
var isWSL = require_is_wsl();
|
|
24104
24104
|
var path24 = __require2("path");
|
|
24105
24105
|
var url2 = __require2("url");
|
|
24106
|
-
var
|
|
24106
|
+
var os5 = __require2("os");
|
|
24107
24107
|
var fs23 = __require2("fs");
|
|
24108
24108
|
var net2 = __require2("net");
|
|
24109
24109
|
var BUFFER_SIZE = 1024;
|
|
@@ -24489,19 +24489,19 @@ var require_utils2 = __commonJS2({
|
|
|
24489
24489
|
return options;
|
|
24490
24490
|
};
|
|
24491
24491
|
module2.exports.isMac = function() {
|
|
24492
|
-
return
|
|
24492
|
+
return os5.type() === "Darwin";
|
|
24493
24493
|
};
|
|
24494
24494
|
module2.exports.isMountainLion = function() {
|
|
24495
|
-
return
|
|
24495
|
+
return os5.type() === "Darwin" && semver.satisfies(garanteeSemverFormat(os5.release()), ">=12.0.0");
|
|
24496
24496
|
};
|
|
24497
24497
|
module2.exports.isWin8 = function() {
|
|
24498
|
-
return
|
|
24498
|
+
return os5.type() === "Windows_NT" && semver.satisfies(garanteeSemverFormat(os5.release()), ">=6.2.9200");
|
|
24499
24499
|
};
|
|
24500
24500
|
module2.exports.isWSL = function() {
|
|
24501
24501
|
return isWSL;
|
|
24502
24502
|
};
|
|
24503
24503
|
module2.exports.isLessThanWin8 = function() {
|
|
24504
|
-
return
|
|
24504
|
+
return os5.type() === "Windows_NT" && semver.satisfies(garanteeSemverFormat(os5.release()), "<6.2.9200");
|
|
24505
24505
|
};
|
|
24506
24506
|
function garanteeSemverFormat(version2) {
|
|
24507
24507
|
if (version2.split(".").length === 2) {
|
|
@@ -24753,7 +24753,7 @@ var require_which = __commonJS2({
|
|
|
24753
24753
|
});
|
|
24754
24754
|
var require_notifysend = __commonJS2({
|
|
24755
24755
|
"../../node_modules/.pnpm/node-notifier@10.0.1/node_modules/node-notifier/notifiers/notifysend.js"(exports2, module2) {
|
|
24756
|
-
var
|
|
24756
|
+
var os5 = __require2("os");
|
|
24757
24757
|
var which3 = require_which();
|
|
24758
24758
|
var utils = require_utils2();
|
|
24759
24759
|
var EventEmitter14 = __require2("events").EventEmitter;
|
|
@@ -24787,7 +24787,7 @@ var require_notifysend = __commonJS2({
|
|
|
24787
24787
|
callback(new Error("Message is required."));
|
|
24788
24788
|
return this;
|
|
24789
24789
|
}
|
|
24790
|
-
if (
|
|
24790
|
+
if (os5.type() !== "Linux" && !os5.type().match(/BSD$/)) {
|
|
24791
24791
|
callback(new Error("Only supported on Linux and *BSD systems"));
|
|
24792
24792
|
return this;
|
|
24793
24793
|
}
|
|
@@ -25205,7 +25205,7 @@ var require_balloon = __commonJS2({
|
|
|
25205
25205
|
var utils = require_utils2();
|
|
25206
25206
|
var Toaster = require_toaster();
|
|
25207
25207
|
var Growl = require_growl();
|
|
25208
|
-
var
|
|
25208
|
+
var os5 = __require2("os");
|
|
25209
25209
|
var EventEmitter14 = __require2("events").EventEmitter;
|
|
25210
25210
|
var util3 = __require2("util");
|
|
25211
25211
|
var hasGrowl;
|
|
@@ -25273,7 +25273,7 @@ var require_balloon = __commonJS2({
|
|
|
25273
25273
|
});
|
|
25274
25274
|
var allowedArguments = ["t", "d", "p", "m", "i", "e", "q", "w", "xp"];
|
|
25275
25275
|
function doNotification(options, notifierOptions, callback) {
|
|
25276
|
-
const is64Bit =
|
|
25276
|
+
const is64Bit = os5.arch() === "x64";
|
|
25277
25277
|
options = options || {};
|
|
25278
25278
|
options = utils.mapToNotifu(options);
|
|
25279
25279
|
options.p = options.p || "Node Notification:";
|
|
@@ -25629,7 +25629,7 @@ var require_toaster = __commonJS2({
|
|
|
25629
25629
|
var notifier = path24.resolve(__dirname, "../vendor/snoreToast/snoretoast");
|
|
25630
25630
|
var utils = require_utils2();
|
|
25631
25631
|
var Balloon = require_balloon();
|
|
25632
|
-
var
|
|
25632
|
+
var os5 = __require2("os");
|
|
25633
25633
|
var { v4: uuid } = (init_esm_node(), __toCommonJS(esm_node_exports));
|
|
25634
25634
|
var EventEmitter14 = __require2("events").EventEmitter;
|
|
25635
25635
|
var util3 = __require2("util");
|
|
@@ -25668,7 +25668,7 @@ var require_toaster = __commonJS2({
|
|
|
25668
25668
|
function notifyRaw(options, callback) {
|
|
25669
25669
|
options = utils.clone(options || {});
|
|
25670
25670
|
callback = callback || noop2;
|
|
25671
|
-
const is64Bit =
|
|
25671
|
+
const is64Bit = os5.arch() === "x64";
|
|
25672
25672
|
let resultBuffer;
|
|
25673
25673
|
const server = {
|
|
25674
25674
|
namedPipe: getPipeName()
|
|
@@ -25743,7 +25743,7 @@ var require_toaster = __commonJS2({
|
|
|
25743
25743
|
});
|
|
25744
25744
|
var require_node_notifier = __commonJS2({
|
|
25745
25745
|
"../../node_modules/.pnpm/node-notifier@10.0.1/node_modules/node-notifier/index.js"(exports2, module2) {
|
|
25746
|
-
var
|
|
25746
|
+
var os5 = __require2("os");
|
|
25747
25747
|
var utils = require_utils2();
|
|
25748
25748
|
var NotifySend = require_notifysend();
|
|
25749
25749
|
var NotificationCenter = require_notificationcenter();
|
|
@@ -25751,7 +25751,7 @@ var require_node_notifier = __commonJS2({
|
|
|
25751
25751
|
var Growl = require_growl();
|
|
25752
25752
|
var WindowsBalloon = require_balloon();
|
|
25753
25753
|
var options = { withFallback: true };
|
|
25754
|
-
var osType = utils.isWSL() ? "WSL" :
|
|
25754
|
+
var osType = utils.isWSL() ? "WSL" : os5.type();
|
|
25755
25755
|
switch (osType) {
|
|
25756
25756
|
case "Linux":
|
|
25757
25757
|
module2.exports = new NotifySend(options);
|
|
@@ -25775,7 +25775,7 @@ var require_node_notifier = __commonJS2({
|
|
|
25775
25775
|
module2.exports.Notification = WindowsToaster;
|
|
25776
25776
|
break;
|
|
25777
25777
|
default:
|
|
25778
|
-
if (
|
|
25778
|
+
if (os5.type().match(/BSD$/)) {
|
|
25779
25779
|
module2.exports = new NotifySend(options);
|
|
25780
25780
|
module2.exports.Notification = NotifySend;
|
|
25781
25781
|
} else {
|
|
@@ -36770,7 +36770,7 @@ var require_get_proto = __commonJS2({
|
|
|
36770
36770
|
}
|
|
36771
36771
|
});
|
|
36772
36772
|
var require_hasown = __commonJS2({
|
|
36773
|
-
"../../node_modules/.pnpm/hasown@2.0.
|
|
36773
|
+
"../../node_modules/.pnpm/hasown@2.0.3/node_modules/hasown/index.js"(exports2, module2) {
|
|
36774
36774
|
var call = Function.prototype.call;
|
|
36775
36775
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
36776
36776
|
var bind2 = require_function_bind();
|
|
@@ -38944,7 +38944,7 @@ var require_has_flag = __commonJS2({
|
|
|
38944
38944
|
});
|
|
38945
38945
|
var require_supports_color = __commonJS2({
|
|
38946
38946
|
"../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports2, module2) {
|
|
38947
|
-
var
|
|
38947
|
+
var os5 = __require2("os");
|
|
38948
38948
|
var tty = __require2("tty");
|
|
38949
38949
|
var hasFlag = require_has_flag();
|
|
38950
38950
|
var { env } = process;
|
|
@@ -39001,7 +39001,7 @@ var require_supports_color = __commonJS2({
|
|
|
39001
39001
|
return min;
|
|
39002
39002
|
}
|
|
39003
39003
|
if (process.platform === "win32") {
|
|
39004
|
-
const osRelease =
|
|
39004
|
+
const osRelease = os5.release().split(".");
|
|
39005
39005
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
39006
39006
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
39007
39007
|
}
|
|
@@ -42840,7 +42840,7 @@ var require_object_inspect = __commonJS2({
|
|
|
42840
42840
|
}
|
|
42841
42841
|
});
|
|
42842
42842
|
var require_side_channel_list = __commonJS2({
|
|
42843
|
-
"../../node_modules/.pnpm/side-channel-list@1.0.
|
|
42843
|
+
"../../node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js"(exports2, module2) {
|
|
42844
42844
|
var inspect2 = require_object_inspect();
|
|
42845
42845
|
var $TypeError = require_type();
|
|
42846
42846
|
var listGetNode = function(list2, key, isDelete) {
|
|
@@ -42899,9 +42899,8 @@ var require_side_channel_list = __commonJS2({
|
|
|
42899
42899
|
}
|
|
42900
42900
|
},
|
|
42901
42901
|
"delete": function(key) {
|
|
42902
|
-
var root = $o && $o.next;
|
|
42903
42902
|
var deletedNode = listDelete($o, key);
|
|
42904
|
-
if (deletedNode &&
|
|
42903
|
+
if (deletedNode && $o && !$o.next) {
|
|
42905
42904
|
$o = void 0;
|
|
42906
42905
|
}
|
|
42907
42906
|
return !!deletedNode;
|
|
@@ -132520,9 +132519,9 @@ var init_session_store = __esm({
|
|
|
132520
132519
|
}
|
|
132521
132520
|
});
|
|
132522
132521
|
async function sendNotification(options) {
|
|
132523
|
-
const
|
|
132522
|
+
const os5 = platform2();
|
|
132524
132523
|
try {
|
|
132525
|
-
switch (
|
|
132524
|
+
switch (os5) {
|
|
132526
132525
|
case "darwin":
|
|
132527
132526
|
return await sendMacOSNotification(options);
|
|
132528
132527
|
case "linux":
|
|
@@ -132530,7 +132529,7 @@ async function sendNotification(options) {
|
|
|
132530
132529
|
case "win32":
|
|
132531
132530
|
return await sendWindowsNotification(options);
|
|
132532
132531
|
default:
|
|
132533
|
-
console.warn(`[Notifications] Unsupported platform: ${
|
|
132532
|
+
console.warn(`[Notifications] Unsupported platform: ${os5}`);
|
|
132534
132533
|
return false;
|
|
132535
132534
|
}
|
|
132536
132535
|
} catch (error) {
|
|
@@ -135468,7 +135467,7 @@ async function getCodexPath() {
|
|
|
135468
135467
|
// Local node_modules
|
|
135469
135468
|
"./node_modules/.bin/codex",
|
|
135470
135469
|
// User's npm bin
|
|
135471
|
-
`${
|
|
135470
|
+
`${homedir2()}/.npm-global/bin/codex`,
|
|
135472
135471
|
// Homebrew on macOS
|
|
135473
135472
|
"/opt/homebrew/bin/codex",
|
|
135474
135473
|
"/usr/local/bin/codex"
|
|
@@ -135566,8 +135565,8 @@ Error: ${err.message}`,
|
|
|
135566
135565
|
provider: { type: "codex", name: this.name }
|
|
135567
135566
|
};
|
|
135568
135567
|
}
|
|
135569
|
-
const
|
|
135570
|
-
const sandboxSubcommand =
|
|
135568
|
+
const os5 = platform2();
|
|
135569
|
+
const sandboxSubcommand = os5 === "darwin" ? "macos" : "linux";
|
|
135571
135570
|
const spawnArgs = [
|
|
135572
135571
|
"sandbox",
|
|
135573
135572
|
sandboxSubcommand,
|
|
@@ -135636,7 +135635,7 @@ async function getSrtPath() {
|
|
|
135636
135635
|
// Local node_modules
|
|
135637
135636
|
"./node_modules/.bin/srt",
|
|
135638
135637
|
// User's npm bin
|
|
135639
|
-
`${
|
|
135638
|
+
`${homedir2()}/.npm-global/bin/srt`,
|
|
135640
135639
|
// Homebrew on macOS
|
|
135641
135640
|
"/opt/homebrew/bin/srt",
|
|
135642
135641
|
"/usr/local/bin/srt"
|
|
@@ -137267,8 +137266,7 @@ var init_mcp_monitor = __esm({
|
|
|
137267
137266
|
}
|
|
137268
137267
|
});
|
|
137269
137268
|
function getMcpServersConfigPath() {
|
|
137270
|
-
|
|
137271
|
-
return path21.join(homedir30, ".viben", "mcp-servers.json");
|
|
137269
|
+
return path21.join(homedir2(), ".viben", "mcp-servers.json");
|
|
137272
137270
|
}
|
|
137273
137271
|
var log15;
|
|
137274
137272
|
var ConfigWatcherService;
|
|
@@ -148698,7 +148696,7 @@ var startupConfig;
|
|
|
148698
148696
|
var gatewayStartTime;
|
|
148699
148697
|
var init_health = __esm({
|
|
148700
148698
|
"src/gateway/routes/health.ts"() {
|
|
148701
|
-
VERSION3 = "1.1
|
|
148699
|
+
VERSION3 = "1.2.1";
|
|
148702
148700
|
startupConfig = null;
|
|
148703
148701
|
gatewayStartTime = Date.now();
|
|
148704
148702
|
}
|
|
@@ -148707,7 +148705,7 @@ function encodeWorkspacePath(workspacePath) {
|
|
|
148707
148705
|
return workspacePath.replace(/\//g, "-");
|
|
148708
148706
|
}
|
|
148709
148707
|
function getClaudeProjectsDir() {
|
|
148710
|
-
return path21.join(
|
|
148708
|
+
return path21.join(os3.homedir(), ".claude", "projects");
|
|
148711
148709
|
}
|
|
148712
148710
|
async function discoverClaudeCodeSessions(workspacePath) {
|
|
148713
148711
|
const projectsDir = getClaudeProjectsDir();
|
|
@@ -148895,11 +148893,11 @@ function convertClaudeMessageToUI(msg) {
|
|
|
148895
148893
|
}
|
|
148896
148894
|
function getCodexSessionsDir() {
|
|
148897
148895
|
if (process.platform === "darwin") {
|
|
148898
|
-
return path21.join(
|
|
148896
|
+
return path21.join(os3.homedir(), "Library", "Application Support", "codex", "sessions");
|
|
148899
148897
|
} else if (process.platform === "win32") {
|
|
148900
148898
|
return path21.join(process.env.APPDATA || "", "codex", "sessions");
|
|
148901
148899
|
} else {
|
|
148902
|
-
return path21.join(
|
|
148900
|
+
return path21.join(os3.homedir(), ".config", "codex", "sessions");
|
|
148903
148901
|
}
|
|
148904
148902
|
}
|
|
148905
148903
|
async function discoverCodexSessions(workspacePath) {
|
|
@@ -148990,10 +148988,10 @@ function convertCodexMessageToUI(msg) {
|
|
|
148990
148988
|
}
|
|
148991
148989
|
}
|
|
148992
148990
|
function getExecutorConfigPaths(type2, workspacePath) {
|
|
148993
|
-
const
|
|
148991
|
+
const homedir34 = os3.homedir();
|
|
148994
148992
|
switch (type2) {
|
|
148995
148993
|
case "CLAUDE_CODE": {
|
|
148996
|
-
const globalConfigDir = path21.join(
|
|
148994
|
+
const globalConfigDir = path21.join(homedir34, ".claude");
|
|
148997
148995
|
const workspaceConfigDir = workspacePath ? path21.join(workspacePath, ".claude") : void 0;
|
|
148998
148996
|
return {
|
|
148999
148997
|
globalConfigPath: fs20.existsSync(globalConfigDir) ? globalConfigDir : void 0,
|
|
@@ -149005,11 +149003,11 @@ function getExecutorConfigPaths(type2, workspacePath) {
|
|
|
149005
149003
|
case "CODEX": {
|
|
149006
149004
|
let configDir;
|
|
149007
149005
|
if (process.platform === "darwin") {
|
|
149008
|
-
configDir = path21.join(
|
|
149006
|
+
configDir = path21.join(homedir34, "Library", "Application Support", "codex");
|
|
149009
149007
|
} else if (process.platform === "win32") {
|
|
149010
149008
|
configDir = path21.join(process.env.APPDATA || "", "codex");
|
|
149011
149009
|
} else {
|
|
149012
|
-
configDir = path21.join(
|
|
149010
|
+
configDir = path21.join(homedir34, ".config", "codex");
|
|
149013
149011
|
}
|
|
149014
149012
|
const workspaceConfigDir = workspacePath ? path21.join(workspacePath, ".codex") : void 0;
|
|
149015
149013
|
return {
|
|
@@ -149022,11 +149020,11 @@ function getExecutorConfigPaths(type2, workspacePath) {
|
|
|
149022
149020
|
case "CURSOR_AGENT": {
|
|
149023
149021
|
let configDir;
|
|
149024
149022
|
if (process.platform === "darwin") {
|
|
149025
|
-
configDir = path21.join(
|
|
149023
|
+
configDir = path21.join(homedir34, "Library", "Application Support", "Cursor", "User");
|
|
149026
149024
|
} else if (process.platform === "win32") {
|
|
149027
149025
|
configDir = path21.join(process.env.APPDATA || "", "Cursor", "User");
|
|
149028
149026
|
} else {
|
|
149029
|
-
configDir = path21.join(
|
|
149027
|
+
configDir = path21.join(homedir34, ".config", "Cursor", "User");
|
|
149030
149028
|
}
|
|
149031
149029
|
const workspaceConfigDir = workspacePath ? path21.join(workspacePath, ".cursor") : void 0;
|
|
149032
149030
|
return {
|
|
@@ -149037,7 +149035,7 @@ function getExecutorConfigPaths(type2, workspacePath) {
|
|
|
149037
149035
|
};
|
|
149038
149036
|
}
|
|
149039
149037
|
case "GEMINI": {
|
|
149040
|
-
const globalConfigDir = path21.join(
|
|
149038
|
+
const globalConfigDir = path21.join(homedir34, ".gemini");
|
|
149041
149039
|
const workspaceConfigDir = workspacePath ? path21.join(workspacePath, ".gemini") : void 0;
|
|
149042
149040
|
return {
|
|
149043
149041
|
globalConfigPath: fs20.existsSync(globalConfigDir) ? globalConfigDir : void 0,
|
|
@@ -149049,11 +149047,11 @@ function getExecutorConfigPaths(type2, workspacePath) {
|
|
|
149049
149047
|
case "AMP": {
|
|
149050
149048
|
let configDir;
|
|
149051
149049
|
if (process.platform === "darwin") {
|
|
149052
|
-
configDir = path21.join(
|
|
149050
|
+
configDir = path21.join(homedir34, "Library", "Application Support", "amp");
|
|
149053
149051
|
} else if (process.platform === "win32") {
|
|
149054
149052
|
configDir = path21.join(process.env.APPDATA || "", "amp");
|
|
149055
149053
|
} else {
|
|
149056
|
-
configDir = path21.join(
|
|
149054
|
+
configDir = path21.join(homedir34, ".config", "amp");
|
|
149057
149055
|
}
|
|
149058
149056
|
const workspaceConfigDir = workspacePath ? path21.join(workspacePath, ".amp") : void 0;
|
|
149059
149057
|
return {
|
|
@@ -149064,7 +149062,7 @@ function getExecutorConfigPaths(type2, workspacePath) {
|
|
|
149064
149062
|
};
|
|
149065
149063
|
}
|
|
149066
149064
|
case "OPENCLAW": {
|
|
149067
|
-
const globalConfigDir = path21.join(
|
|
149065
|
+
const globalConfigDir = path21.join(homedir34, ".openclaw");
|
|
149068
149066
|
const globalConfigFile = path21.join(globalConfigDir, "openclaw.json");
|
|
149069
149067
|
const workspaceConfigDir = workspacePath ? path21.join(workspacePath, ".openclaw") : void 0;
|
|
149070
149068
|
return {
|
|
@@ -149075,7 +149073,7 @@ function getExecutorConfigPaths(type2, workspacePath) {
|
|
|
149075
149073
|
};
|
|
149076
149074
|
}
|
|
149077
149075
|
default: {
|
|
149078
|
-
const globalConfigDir = path21.join(
|
|
149076
|
+
const globalConfigDir = path21.join(homedir34, ".viben");
|
|
149079
149077
|
const workspaceConfigDir = workspacePath ? path21.join(workspacePath, ".viben") : void 0;
|
|
149080
149078
|
return {
|
|
149081
149079
|
globalConfigPath: fs20.existsSync(globalConfigDir) ? globalConfigDir : void 0,
|
|
@@ -149154,7 +149152,7 @@ function checkExecutorAvailability(type2, workspacePath) {
|
|
|
149154
149152
|
supports_mcp: supportsMcp,
|
|
149155
149153
|
capabilities,
|
|
149156
149154
|
has_workspace_config: hasWorkspaceConfig,
|
|
149157
|
-
workspace_path: workspacePath ||
|
|
149155
|
+
workspace_path: workspacePath || os3.homedir()
|
|
149158
149156
|
};
|
|
149159
149157
|
}
|
|
149160
149158
|
function discoverExecutors(workspacePath) {
|
|
@@ -149220,7 +149218,7 @@ function registerExecutorRoutes(fastify2) {
|
|
|
149220
149218
|
const executors = discoverExecutors(workspacePath);
|
|
149221
149219
|
return {
|
|
149222
149220
|
executors,
|
|
149223
|
-
workspace_path: workspacePath ||
|
|
149221
|
+
workspace_path: workspacePath || os3.homedir(),
|
|
149224
149222
|
include_global: includeGlobal,
|
|
149225
149223
|
total: executors.length
|
|
149226
149224
|
};
|
|
@@ -149279,12 +149277,12 @@ function registerExecutorRoutes(fastify2) {
|
|
|
149279
149277
|
return { messages, total: messages.length };
|
|
149280
149278
|
});
|
|
149281
149279
|
function getMcpConfigPath(workspacePath, executorType) {
|
|
149282
|
-
const base = workspacePath ||
|
|
149280
|
+
const base = workspacePath || os3.homedir();
|
|
149283
149281
|
switch (executorType) {
|
|
149284
149282
|
case "CLAUDE_CODE":
|
|
149285
149283
|
const projectMcp = path21.join(base, ".mcp.json");
|
|
149286
149284
|
if (fs20.existsSync(projectMcp)) return projectMcp;
|
|
149287
|
-
return path21.join(
|
|
149285
|
+
return path21.join(os3.homedir(), ".claude.json");
|
|
149288
149286
|
case "CURSOR_AGENT":
|
|
149289
149287
|
return path21.join(base, ".cursor", "mcp.json");
|
|
149290
149288
|
default:
|
|
@@ -149331,7 +149329,7 @@ function registerExecutorRoutes(fastify2) {
|
|
|
149331
149329
|
return { servers, total: servers.length };
|
|
149332
149330
|
});
|
|
149333
149331
|
function getSkillsConfigPath(workspacePath, executorType) {
|
|
149334
|
-
const base = workspacePath ||
|
|
149332
|
+
const base = workspacePath || os3.homedir();
|
|
149335
149333
|
switch (executorType) {
|
|
149336
149334
|
case "CLAUDE_CODE":
|
|
149337
149335
|
return {
|
|
@@ -149427,7 +149425,7 @@ function registerExecutorRoutes(fastify2) {
|
|
|
149427
149425
|
return { skills, total: skills.length };
|
|
149428
149426
|
});
|
|
149429
149427
|
function getSubagentsPath(workspacePath, executorType) {
|
|
149430
|
-
const base = workspacePath ||
|
|
149428
|
+
const base = workspacePath || os3.homedir();
|
|
149431
149429
|
switch (executorType) {
|
|
149432
149430
|
case "CLAUDE_CODE":
|
|
149433
149431
|
return path21.join(base, ".claude", "agents");
|
|
@@ -149518,7 +149516,7 @@ function registerExecutorRoutes(fastify2) {
|
|
|
149518
149516
|
}
|
|
149519
149517
|
});
|
|
149520
149518
|
function getCommandsPath(workspacePath, executorType) {
|
|
149521
|
-
const base = workspacePath ||
|
|
149519
|
+
const base = workspacePath || os3.homedir();
|
|
149522
149520
|
switch (executorType) {
|
|
149523
149521
|
case "CLAUDE_CODE":
|
|
149524
149522
|
return path21.join(base, ".claude", "commands");
|
|
@@ -149625,7 +149623,7 @@ function registerExecutorRoutes(fastify2) {
|
|
|
149625
149623
|
}
|
|
149626
149624
|
});
|
|
149627
149625
|
function getPromptsPath(workspacePath, executorType) {
|
|
149628
|
-
const base = workspacePath ||
|
|
149626
|
+
const base = workspacePath || os3.homedir();
|
|
149629
149627
|
switch (executorType) {
|
|
149630
149628
|
case "CLAUDE_CODE":
|
|
149631
149629
|
return path21.join(base, ".claude", "prompts");
|
|
@@ -150026,7 +150024,7 @@ function registerAgentRoutes(fastify2, state) {
|
|
|
150026
150024
|
}, async (request) => {
|
|
150027
150025
|
const { workspace_path, include_global } = request.query;
|
|
150028
150026
|
const includeGlobal = include_global !== "false";
|
|
150029
|
-
const homeDir =
|
|
150027
|
+
const homeDir = homedir2();
|
|
150030
150028
|
const transformAgent = (a, sourceOverride, workspacePathOverride) => {
|
|
150031
150029
|
if (!a) return null;
|
|
150032
150030
|
const source = sourceOverride || (a.path && a.path.startsWith(homeDir) && a.path.includes("/.viben/agents/") ? "global" : "workspace");
|
|
@@ -150104,7 +150102,7 @@ function registerAgentRoutes(fastify2, state) {
|
|
|
150104
150102
|
approvals: body.approvals
|
|
150105
150103
|
});
|
|
150106
150104
|
reply.code(201);
|
|
150107
|
-
const homeDir =
|
|
150105
|
+
const homeDir = homedir2();
|
|
150108
150106
|
const isGlobalAgent = agent.path && agent.path.startsWith(homeDir) && agent.path.includes("/.viben/agents/");
|
|
150109
150107
|
const agentSource = isGlobalAgent ? "global" : "workspace";
|
|
150110
150108
|
const agentWorkspacePath = !isGlobalAgent && agent.path ? agent.path.replace(/\/.viben\/agents\/[^/]+$/, "") : void 0;
|
|
@@ -150228,7 +150226,7 @@ function registerAgentRoutes(fastify2, state) {
|
|
|
150228
150226
|
try {
|
|
150229
150227
|
const agent = await agentManager.createFromTemplate(id, agent_id, { name, base_path }, template_workspace_path);
|
|
150230
150228
|
reply.code(201);
|
|
150231
|
-
const homeDir =
|
|
150229
|
+
const homeDir = homedir2();
|
|
150232
150230
|
const isGlobalAgent = agent.path && agent.path.startsWith(homeDir) && agent.path.includes("/.viben/agents/");
|
|
150233
150231
|
const agentSource = isGlobalAgent ? "global" : "workspace";
|
|
150234
150232
|
const agentWorkspacePath = !isGlobalAgent && agent.path ? agent.path.replace(/\/.viben\/agents\/[^/]+$/, "") : void 0;
|
|
@@ -150479,7 +150477,7 @@ function registerAgentRoutes(fastify2, state) {
|
|
|
150479
150477
|
"/api/agent/:id/availability",
|
|
150480
150478
|
async (request, reply) => {
|
|
150481
150479
|
const { id } = request.params;
|
|
150482
|
-
const homeDir =
|
|
150480
|
+
const homeDir = homedir2();
|
|
150483
150481
|
const executorTypes = [
|
|
150484
150482
|
"CLAUDE_CODE",
|
|
150485
150483
|
"CODEX",
|
|
@@ -150635,7 +150633,7 @@ function registerAgentRoutes(fastify2, state) {
|
|
|
150635
150633
|
fastify2.get("/api/agent/:id", async (request, reply) => {
|
|
150636
150634
|
const { id } = request.params;
|
|
150637
150635
|
const { workspace_path } = request.query;
|
|
150638
|
-
const homeDir =
|
|
150636
|
+
const homeDir = homedir2();
|
|
150639
150637
|
let agent = null;
|
|
150640
150638
|
let source = "global";
|
|
150641
150639
|
if (workspace_path) {
|
|
@@ -150705,7 +150703,7 @@ function registerAgentRoutes(fastify2, state) {
|
|
|
150705
150703
|
};
|
|
150706
150704
|
try {
|
|
150707
150705
|
const agent = await agentManager.updateAgent(id, updates, workspace_path);
|
|
150708
|
-
const homeDir =
|
|
150706
|
+
const homeDir = homedir2();
|
|
150709
150707
|
const isGlobalAgent = agent.path && agent.path.startsWith(homeDir) && agent.path.includes("/.viben/agents/");
|
|
150710
150708
|
const agentSource = isGlobalAgent ? "global" : "workspace";
|
|
150711
150709
|
const agentWorkspacePath = !isGlobalAgent && agent.path ? agent.path.replace(/\/.viben\/agents\/[^/]+$/, "") : void 0;
|
|
@@ -157568,7 +157566,7 @@ var init_history2 = __esm({
|
|
|
157568
157566
|
}
|
|
157569
157567
|
});
|
|
157570
157568
|
function getDefaultShell() {
|
|
157571
|
-
if (
|
|
157569
|
+
if (os3.platform() === "win32") {
|
|
157572
157570
|
return process.env.COMSPEC || "cmd.exe";
|
|
157573
157571
|
}
|
|
157574
157572
|
return process.env.SHELL || "/bin/bash";
|
|
@@ -163163,11 +163161,46 @@ function getPythonCandidates() {
|
|
|
163163
163161
|
);
|
|
163164
163162
|
} else if (process.platform === "win32") {
|
|
163165
163163
|
const localAppData = process.env.LOCALAPPDATA || join2(home, "AppData/Local");
|
|
163164
|
+
candidates.push("py", "C:\\Windows\\py.exe");
|
|
163166
163165
|
candidates.push(
|
|
163166
|
+
join2(localAppData, "Programs/Python/Python314/python.exe"),
|
|
163167
163167
|
join2(localAppData, "Programs/Python/Python313/python.exe"),
|
|
163168
163168
|
join2(localAppData, "Programs/Python/Python312/python.exe"),
|
|
163169
163169
|
join2(localAppData, "Programs/Python/Python311/python.exe"),
|
|
163170
|
-
join2(localAppData, "Programs/Python/Python310/python.exe")
|
|
163170
|
+
join2(localAppData, "Programs/Python/Python310/python.exe"),
|
|
163171
|
+
join2(localAppData, "Programs/Python/Python39/python.exe")
|
|
163172
|
+
);
|
|
163173
|
+
candidates.push(
|
|
163174
|
+
join2(localAppData, "Microsoft/WindowsApps/python.exe"),
|
|
163175
|
+
join2(localAppData, "Microsoft/WindowsApps/python3.exe")
|
|
163176
|
+
);
|
|
163177
|
+
candidates.push(
|
|
163178
|
+
join2(home, ".pyenv/pyenv-win/shims/python.exe"),
|
|
163179
|
+
join2(home, ".pyenv/pyenv-win/shims/python3.exe")
|
|
163180
|
+
);
|
|
163181
|
+
candidates.push(join2(home, "scoop/apps/python/current/python.exe"));
|
|
163182
|
+
candidates.push(
|
|
163183
|
+
join2(home, "miniconda3/python.exe"),
|
|
163184
|
+
join2(home, "anaconda3/python.exe"),
|
|
163185
|
+
join2(home, "Miniconda3/python.exe"),
|
|
163186
|
+
join2(home, "Anaconda3/python.exe"),
|
|
163187
|
+
join2(localAppData, "miniconda3/python.exe"),
|
|
163188
|
+
join2(localAppData, "anaconda3/python.exe")
|
|
163189
|
+
);
|
|
163190
|
+
candidates.push(
|
|
163191
|
+
"C:\\ProgramData\\miniconda3\\python.exe",
|
|
163192
|
+
"C:\\ProgramData\\anaconda3\\python.exe",
|
|
163193
|
+
"C:\\ProgramData\\Miniconda3\\python.exe",
|
|
163194
|
+
"C:\\ProgramData\\Anaconda3\\python.exe",
|
|
163195
|
+
"C:\\miniconda3\\python.exe",
|
|
163196
|
+
"C:\\anaconda3\\python.exe"
|
|
163197
|
+
);
|
|
163198
|
+
candidates.push(
|
|
163199
|
+
"C:\\Python314\\python.exe",
|
|
163200
|
+
"C:\\Python313\\python.exe",
|
|
163201
|
+
"C:\\Python312\\python.exe",
|
|
163202
|
+
"C:\\Python311\\python.exe",
|
|
163203
|
+
"C:\\Python310\\python.exe"
|
|
163171
163204
|
);
|
|
163172
163205
|
} else {
|
|
163173
163206
|
candidates.push(
|
|
@@ -163179,9 +163212,10 @@ function getPythonCandidates() {
|
|
|
163179
163212
|
}
|
|
163180
163213
|
return candidates;
|
|
163181
163214
|
}
|
|
163182
|
-
async function isExecutable(
|
|
163215
|
+
async function isExecutable(filePath) {
|
|
163183
163216
|
try {
|
|
163184
|
-
|
|
163217
|
+
const mode = process.platform === "win32" ? constants.F_OK : constants.X_OK;
|
|
163218
|
+
await access2(filePath, mode);
|
|
163185
163219
|
return true;
|
|
163186
163220
|
} catch {
|
|
163187
163221
|
return false;
|
|
@@ -163190,20 +163224,29 @@ async function isExecutable(path24) {
|
|
|
163190
163224
|
async function checkPython(path24) {
|
|
163191
163225
|
try {
|
|
163192
163226
|
let actualPath = path24;
|
|
163193
|
-
|
|
163227
|
+
const isAbsolute6 = path24.startsWith("/") || /^[A-Za-z]:[\\/]/.test(path24);
|
|
163228
|
+
if (!isAbsolute6) {
|
|
163194
163229
|
try {
|
|
163195
|
-
const
|
|
163196
|
-
|
|
163230
|
+
const whichCmd = process.platform === "win32" ? `where "${path24}"` : `which ${path24}`;
|
|
163231
|
+
const { stdout: stdout2 } = await execAsync5(whichCmd, { windowsHide: true });
|
|
163232
|
+
actualPath = stdout2.trim().split(/\r?\n/)[0].trim();
|
|
163197
163233
|
} catch {
|
|
163198
163234
|
}
|
|
163199
163235
|
}
|
|
163200
|
-
if (actualPath.startsWith("/") || actualPath
|
|
163201
|
-
if (
|
|
163236
|
+
if (actualPath.startsWith("/") || /^[A-Za-z]:[\\/]/.test(actualPath)) {
|
|
163237
|
+
if (process.platform === "win32") {
|
|
163238
|
+
try {
|
|
163239
|
+
await access2(actualPath, constants.F_OK);
|
|
163240
|
+
} catch {
|
|
163241
|
+
return null;
|
|
163242
|
+
}
|
|
163243
|
+
} else if (!await isExecutable(actualPath)) {
|
|
163202
163244
|
return null;
|
|
163203
163245
|
}
|
|
163204
163246
|
}
|
|
163205
163247
|
const { stdout, stderr } = await execAsync5(`"${actualPath}" --version`, {
|
|
163206
|
-
timeout: 5e3
|
|
163248
|
+
timeout: 5e3,
|
|
163249
|
+
windowsHide: true
|
|
163207
163250
|
});
|
|
163208
163251
|
const versionOutput = stdout.trim() || stderr.trim();
|
|
163209
163252
|
const versionMatch = versionOutput.match(/Python\s+(\d+\.\d+\.\d+)/);
|
|
@@ -163297,11 +163340,49 @@ function getCliToolCandidates(tool) {
|
|
|
163297
163340
|
const programFiles = process.env.ProgramFiles || "C:\\Program Files";
|
|
163298
163341
|
const programFilesX86 = process.env["ProgramFiles(x86)"] || "C:\\Program Files (x86)";
|
|
163299
163342
|
if (tool === "python") {
|
|
163343
|
+
candidates.push("python", "python3", "py");
|
|
163344
|
+
candidates.push("C:\\Windows\\py.exe");
|
|
163300
163345
|
candidates.push(
|
|
163346
|
+
join2(localAppData, "Programs/Python/Python314/python.exe"),
|
|
163301
163347
|
join2(localAppData, "Programs/Python/Python313/python.exe"),
|
|
163302
163348
|
join2(localAppData, "Programs/Python/Python312/python.exe"),
|
|
163303
163349
|
join2(localAppData, "Programs/Python/Python311/python.exe"),
|
|
163304
|
-
join2(localAppData, "Programs/Python/Python310/python.exe")
|
|
163350
|
+
join2(localAppData, "Programs/Python/Python310/python.exe"),
|
|
163351
|
+
join2(localAppData, "Programs/Python/Python39/python.exe")
|
|
163352
|
+
);
|
|
163353
|
+
candidates.push(
|
|
163354
|
+
join2(localAppData, "Microsoft/WindowsApps/python.exe"),
|
|
163355
|
+
join2(localAppData, "Microsoft/WindowsApps/python3.exe")
|
|
163356
|
+
);
|
|
163357
|
+
candidates.push(
|
|
163358
|
+
join2(home, ".pyenv/pyenv-win/shims/python.exe"),
|
|
163359
|
+
join2(home, ".pyenv/pyenv-win/shims/python3.exe")
|
|
163360
|
+
);
|
|
163361
|
+
candidates.push(
|
|
163362
|
+
join2(home, "scoop/apps/python/current/python.exe")
|
|
163363
|
+
);
|
|
163364
|
+
candidates.push(
|
|
163365
|
+
join2(home, "miniconda3/python.exe"),
|
|
163366
|
+
join2(home, "anaconda3/python.exe"),
|
|
163367
|
+
join2(home, "Miniconda3/python.exe"),
|
|
163368
|
+
join2(home, "Anaconda3/python.exe"),
|
|
163369
|
+
join2(localAppData, "miniconda3/python.exe"),
|
|
163370
|
+
join2(localAppData, "anaconda3/python.exe")
|
|
163371
|
+
);
|
|
163372
|
+
candidates.push(
|
|
163373
|
+
"C:\\ProgramData\\miniconda3\\python.exe",
|
|
163374
|
+
"C:\\ProgramData\\anaconda3\\python.exe",
|
|
163375
|
+
"C:\\ProgramData\\Miniconda3\\python.exe",
|
|
163376
|
+
"C:\\ProgramData\\Anaconda3\\python.exe",
|
|
163377
|
+
"C:\\miniconda3\\python.exe",
|
|
163378
|
+
"C:\\anaconda3\\python.exe"
|
|
163379
|
+
);
|
|
163380
|
+
candidates.push(
|
|
163381
|
+
"C:\\Python314\\python.exe",
|
|
163382
|
+
"C:\\Python313\\python.exe",
|
|
163383
|
+
"C:\\Python312\\python.exe",
|
|
163384
|
+
"C:\\Python311\\python.exe",
|
|
163385
|
+
"C:\\Python310\\python.exe"
|
|
163305
163386
|
);
|
|
163306
163387
|
} else if (tool === "git") {
|
|
163307
163388
|
candidates.push(
|
|
@@ -163371,7 +163452,8 @@ async function detectCliToolVersion(toolPath, tool) {
|
|
|
163371
163452
|
const versionArg = config.versionArg || "--version";
|
|
163372
163453
|
try {
|
|
163373
163454
|
const { stdout, stderr } = await execAsync5(`"${toolPath}" ${versionArg}`, {
|
|
163374
|
-
timeout: 5e3
|
|
163455
|
+
timeout: 5e3,
|
|
163456
|
+
windowsHide: true
|
|
163375
163457
|
});
|
|
163376
163458
|
const output2 = stdout.trim() || stderr.trim();
|
|
163377
163459
|
let version2 = null;
|
|
@@ -163459,12 +163541,12 @@ async function detectCliTool(tool, userConfigPath) {
|
|
|
163459
163541
|
}
|
|
163460
163542
|
}
|
|
163461
163543
|
}
|
|
163462
|
-
const toolCmd = tool === "python" ? "python3" : tool;
|
|
163544
|
+
const toolCmd = tool === "python" ? process.platform === "win32" ? "python" : "python3" : tool;
|
|
163463
163545
|
try {
|
|
163464
163546
|
const whichCmd = process.platform === "win32" ? "where" : "which";
|
|
163465
|
-
const { stdout } = await execAsync5(`${whichCmd} ${toolCmd}`, { timeout: 5e3 });
|
|
163466
|
-
const
|
|
163467
|
-
|
|
163547
|
+
const { stdout } = await execAsync5(`${whichCmd} ${toolCmd}`, { timeout: 5e3, windowsHide: true });
|
|
163548
|
+
const toolPaths = stdout.trim().split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
163549
|
+
for (const toolPath of toolPaths) {
|
|
163468
163550
|
const { version: version2, valid } = await detectCliToolVersion(toolPath, tool);
|
|
163469
163551
|
if (valid) {
|
|
163470
163552
|
await addPath(toolPath, version2 || void 0, getToolSource(toolPath));
|
|
@@ -163472,6 +163554,77 @@ async function detectCliTool(tool, userConfigPath) {
|
|
|
163472
163554
|
}
|
|
163473
163555
|
} catch {
|
|
163474
163556
|
}
|
|
163557
|
+
let condaBaseDir = null;
|
|
163558
|
+
if (tool === "python" && process.platform === "win32") {
|
|
163559
|
+
try {
|
|
163560
|
+
const { stdout: condaStdout } = await execAsync5("where conda", { timeout: 3e3, windowsHide: true });
|
|
163561
|
+
const condaExe = condaStdout.trim().split(/\r?\n/)[0].trim();
|
|
163562
|
+
if (condaExe) {
|
|
163563
|
+
condaBaseDir = join2(dirname2(condaExe), "..");
|
|
163564
|
+
const pythonFromConda = join2(condaBaseDir, "python.exe");
|
|
163565
|
+
if (await isExecutable(pythonFromConda)) {
|
|
163566
|
+
const { version: version2, valid } = await detectCliToolVersion(pythonFromConda, tool);
|
|
163567
|
+
if (valid) {
|
|
163568
|
+
await addPath(pythonFromConda, version2 || void 0, "system-path");
|
|
163569
|
+
}
|
|
163570
|
+
}
|
|
163571
|
+
}
|
|
163572
|
+
} catch {
|
|
163573
|
+
}
|
|
163574
|
+
}
|
|
163575
|
+
if (tool === "python") {
|
|
163576
|
+
const localAppData = process.env.LOCALAPPDATA || join2(home, "AppData/Local");
|
|
163577
|
+
const condaBases = [];
|
|
163578
|
+
if (condaBaseDir) condaBases.push(condaBaseDir);
|
|
163579
|
+
if (process.platform === "win32") {
|
|
163580
|
+
condaBases.push(
|
|
163581
|
+
"C:\\ProgramData\\miniconda3",
|
|
163582
|
+
"C:\\ProgramData\\anaconda3",
|
|
163583
|
+
"C:\\ProgramData\\Miniconda3",
|
|
163584
|
+
"C:\\ProgramData\\Anaconda3",
|
|
163585
|
+
join2(home, "miniconda3"),
|
|
163586
|
+
join2(home, "anaconda3"),
|
|
163587
|
+
join2(home, "Miniconda3"),
|
|
163588
|
+
join2(home, "Anaconda3"),
|
|
163589
|
+
join2(localAppData, "miniconda3"),
|
|
163590
|
+
join2(localAppData, "anaconda3")
|
|
163591
|
+
);
|
|
163592
|
+
} else {
|
|
163593
|
+
condaBases.push(
|
|
163594
|
+
join2(home, "miniconda3"),
|
|
163595
|
+
join2(home, "anaconda3"),
|
|
163596
|
+
"/opt/miniconda3",
|
|
163597
|
+
"/opt/anaconda3"
|
|
163598
|
+
);
|
|
163599
|
+
}
|
|
163600
|
+
for (const existing of allPaths) {
|
|
163601
|
+
const parentDir = dirname2(existing.path);
|
|
163602
|
+
if (!condaBases.includes(parentDir)) {
|
|
163603
|
+
condaBases.push(parentDir);
|
|
163604
|
+
}
|
|
163605
|
+
}
|
|
163606
|
+
const pythonInEnvSuffix = process.platform === "win32" ? "python.exe" : join2("bin", "python");
|
|
163607
|
+
const seenEnvsDirs = /* @__PURE__ */ new Set();
|
|
163608
|
+
for (const base of condaBases) {
|
|
163609
|
+
const envsDir = join2(base, "envs");
|
|
163610
|
+
if (seenEnvsDirs.has(envsDir)) continue;
|
|
163611
|
+
seenEnvsDirs.add(envsDir);
|
|
163612
|
+
try {
|
|
163613
|
+
const envEntries = await readdir2(envsDir, { withFileTypes: true });
|
|
163614
|
+
for (const envEntry of envEntries) {
|
|
163615
|
+
if (!envEntry.isDirectory()) continue;
|
|
163616
|
+
const pythonInEnv = join2(envsDir, envEntry.name, pythonInEnvSuffix);
|
|
163617
|
+
if (await isExecutable(pythonInEnv)) {
|
|
163618
|
+
const { version: version2, valid } = await detectCliToolVersion(pythonInEnv, tool);
|
|
163619
|
+
if (valid) {
|
|
163620
|
+
await addPath(pythonInEnv, version2 || void 0, "system-path");
|
|
163621
|
+
}
|
|
163622
|
+
}
|
|
163623
|
+
}
|
|
163624
|
+
} catch {
|
|
163625
|
+
}
|
|
163626
|
+
}
|
|
163627
|
+
}
|
|
163475
163628
|
if (config.detectMethod === "npm-global" && process.platform !== "win32") {
|
|
163476
163629
|
const nvmVersionsDir = join2(home, ".nvm/versions/node");
|
|
163477
163630
|
try {
|
|
@@ -163601,7 +163754,7 @@ async function checkPackageInstalled(pythonPath, packageName) {
|
|
|
163601
163754
|
const pipCommand = `"${pythonPath}" -m pip show ${packageName}`;
|
|
163602
163755
|
log35.debug({ pipCommand }, "Checking package with pip");
|
|
163603
163756
|
try {
|
|
163604
|
-
const { stdout, stderr } = await execAsync5(pipCommand, { timeout: 1e4 });
|
|
163757
|
+
const { stdout, stderr } = await execAsync5(pipCommand, { timeout: 1e4, windowsHide: true });
|
|
163605
163758
|
log35.debug({ stdout: stdout.slice(0, 200) }, "pip show stdout");
|
|
163606
163759
|
if (stderr) {
|
|
163607
163760
|
log35.debug({ stderr: stderr.slice(0, 200) }, "pip show stderr");
|
|
@@ -163621,7 +163774,7 @@ async function checkPackageInstalled(pythonPath, packageName) {
|
|
|
163621
163774
|
const importCommand = `"${pythonPath}" -c "import ${moduleName2}; print(getattr(${moduleName2}, '__version__', 'unknown'))"`;
|
|
163622
163775
|
log35.debug({ importCommand }, "Trying import");
|
|
163623
163776
|
try {
|
|
163624
|
-
const { stdout: importStdout } = await execAsync5(importCommand, { timeout: 1e4 });
|
|
163777
|
+
const { stdout: importStdout } = await execAsync5(importCommand, { timeout: 1e4, windowsHide: true });
|
|
163625
163778
|
const version2 = importStdout.trim() || "unknown";
|
|
163626
163779
|
log35.debug({ packageName, version: version2 }, "Package found via import");
|
|
163627
163780
|
return {
|
|
@@ -163635,7 +163788,7 @@ async function checkPackageInstalled(pythonPath, packageName) {
|
|
|
163635
163788
|
const moduleCommand = `"${pythonPath}" -m ${moduleName2} --version`;
|
|
163636
163789
|
log35.debug({ moduleCommand }, "Trying module version");
|
|
163637
163790
|
try {
|
|
163638
|
-
const { stdout: modStdout } = await execAsync5(moduleCommand, { timeout: 1e4 });
|
|
163791
|
+
const { stdout: modStdout } = await execAsync5(moduleCommand, { timeout: 1e4, windowsHide: true });
|
|
163639
163792
|
const versionMatch = modStdout.match(/(\d+\.\d+\.\d+)/);
|
|
163640
163793
|
const version2 = versionMatch ? versionMatch[1] : "installed";
|
|
163641
163794
|
log35.debug({ packageName, version: version2 }, "Package found via module");
|
|
@@ -182213,8 +182366,15 @@ async function startGateway(ctx, options) {
|
|
|
182213
182366
|
});
|
|
182214
182367
|
fs20.closeSync(logFd);
|
|
182215
182368
|
child.unref();
|
|
182216
|
-
|
|
182217
|
-
const
|
|
182369
|
+
let pid = null;
|
|
182370
|
+
const pollStart = Date.now();
|
|
182371
|
+
const pollMaxMs = 15e3;
|
|
182372
|
+
const pollInterval = 500;
|
|
182373
|
+
while (Date.now() - pollStart < pollMaxMs) {
|
|
182374
|
+
await new Promise((resolve28) => setTimeout(resolve28, pollInterval));
|
|
182375
|
+
pid = findProcessOnPort(port);
|
|
182376
|
+
if (pid !== null) break;
|
|
182377
|
+
}
|
|
182218
182378
|
if (pid !== null) {
|
|
182219
182379
|
output(
|
|
182220
182380
|
ctx,
|
|
@@ -183791,7 +183951,7 @@ ${chalk22.bold("Telemetry \u7EDF\u8BA1")}:
|
|
|
183791
183951
|
init_lib();
|
|
183792
183952
|
init_update();
|
|
183793
183953
|
var execAsync11 = promisify(exec);
|
|
183794
|
-
var CURRENT_VERSION = "1.1
|
|
183954
|
+
var CURRENT_VERSION = "1.2.1";
|
|
183795
183955
|
var GITHUB_REPO = "LinXueyuanStdio/viben";
|
|
183796
183956
|
var NPM_PACKAGE = "viben";
|
|
183797
183957
|
function compareSemver(a, b) {
|
|
@@ -192067,7 +192227,7 @@ function registerCommands(program) {
|
|
|
192067
192227
|
registerPageCommand(program);
|
|
192068
192228
|
registerAccountCommand(program);
|
|
192069
192229
|
}
|
|
192070
|
-
var VERSION4 = "1.1
|
|
192230
|
+
var VERSION4 = "1.2.1";
|
|
192071
192231
|
function createProgram() {
|
|
192072
192232
|
const program = new Command();
|
|
192073
192233
|
program.name("viben").description("Viben - Agent Swarm \xD7 Code Evolution").version(VERSION4, "-v, --version", "Output the version number");
|