@rdmind/rdmind 0.0.23-alpha.0 → 0.0.23
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/cli.js +272 -179
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -77806,7 +77806,7 @@ var require_googleauth = __commonJS({
|
|
|
77806
77806
|
var child_process_1 = __require("child_process");
|
|
77807
77807
|
var fs98 = __require("fs");
|
|
77808
77808
|
var gcpMetadata = require_src4();
|
|
77809
|
-
var
|
|
77809
|
+
var os42 = __require("os");
|
|
77810
77810
|
var path110 = __require("path");
|
|
77811
77811
|
var crypto_1 = require_crypto3();
|
|
77812
77812
|
var transporters_1 = require_transporters();
|
|
@@ -78250,7 +78250,7 @@ var require_googleauth = __commonJS({
|
|
|
78250
78250
|
* @api private
|
|
78251
78251
|
*/
|
|
78252
78252
|
_isWindows() {
|
|
78253
|
-
const sys =
|
|
78253
|
+
const sys = os42.platform();
|
|
78254
78254
|
if (sys && sys.length >= 3) {
|
|
78255
78255
|
if (sys.substring(0, 3).toLowerCase() === "win") {
|
|
78256
78256
|
return true;
|
|
@@ -124516,7 +124516,7 @@ var require_service_config = __commonJS({
|
|
|
124516
124516
|
exports2.validateRetryThrottling = validateRetryThrottling;
|
|
124517
124517
|
exports2.validateServiceConfig = validateServiceConfig;
|
|
124518
124518
|
exports2.extractAndSelectServiceConfig = extractAndSelectServiceConfig;
|
|
124519
|
-
var
|
|
124519
|
+
var os42 = __require("os");
|
|
124520
124520
|
var constants_1 = require_constants9();
|
|
124521
124521
|
var DURATION_REGEX = /^\d+(\.\d{1,9})?s$/;
|
|
124522
124522
|
var CLIENT_LANGUAGE_STRING = "node";
|
|
@@ -124823,7 +124823,7 @@ var require_service_config = __commonJS({
|
|
|
124823
124823
|
if (Array.isArray(validatedConfig.clientHostname)) {
|
|
124824
124824
|
let hostnameMatched = false;
|
|
124825
124825
|
for (const hostname3 of validatedConfig.clientHostname) {
|
|
124826
|
-
if (hostname3 ===
|
|
124826
|
+
if (hostname3 === os42.hostname()) {
|
|
124827
124827
|
hostnameMatched = true;
|
|
124828
124828
|
}
|
|
124829
124829
|
}
|
|
@@ -138789,7 +138789,7 @@ var require_subchannel_call = __commonJS({
|
|
|
138789
138789
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
138790
138790
|
exports2.Http2SubchannelCall = void 0;
|
|
138791
138791
|
var http22 = __require("http2");
|
|
138792
|
-
var
|
|
138792
|
+
var os42 = __require("os");
|
|
138793
138793
|
var constants_1 = require_constants9();
|
|
138794
138794
|
var metadata_1 = require_metadata3();
|
|
138795
138795
|
var stream_decoder_1 = require_stream_decoder();
|
|
@@ -138797,7 +138797,7 @@ var require_subchannel_call = __commonJS({
|
|
|
138797
138797
|
var constants_2 = require_constants9();
|
|
138798
138798
|
var TRACER_NAME = "subchannel_call";
|
|
138799
138799
|
function getSystemErrorName(errno) {
|
|
138800
|
-
for (const [name3, num] of Object.entries(
|
|
138800
|
+
for (const [name3, num] of Object.entries(os42.constants.errno)) {
|
|
138801
138801
|
if (num === errno) {
|
|
138802
138802
|
return name3;
|
|
138803
138803
|
}
|
|
@@ -158765,7 +158765,7 @@ var require_ProcessDetector = __commonJS({
|
|
|
158765
158765
|
exports2.processDetector = void 0;
|
|
158766
158766
|
var api_1 = (init_esm2(), __toCommonJS(esm_exports2));
|
|
158767
158767
|
var semconv_1 = require_semconv2();
|
|
158768
|
-
var
|
|
158768
|
+
var os42 = __require("os");
|
|
158769
158769
|
var ProcessDetector = class {
|
|
158770
158770
|
static {
|
|
158771
158771
|
__name(this, "ProcessDetector");
|
|
@@ -158788,7 +158788,7 @@ var require_ProcessDetector = __commonJS({
|
|
|
158788
158788
|
attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
|
|
158789
158789
|
}
|
|
158790
158790
|
try {
|
|
158791
|
-
const userInfo2 =
|
|
158791
|
+
const userInfo2 = os42.userInfo();
|
|
158792
158792
|
attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo2.username;
|
|
158793
158793
|
} catch (e2) {
|
|
158794
158794
|
api_1.diag.debug(`error obtaining process owner: ${e2}`);
|
|
@@ -165138,8 +165138,8 @@ var require_homedir = __commonJS({
|
|
|
165138
165138
|
"node_modules/resolve/lib/homedir.js"(exports2, module2) {
|
|
165139
165139
|
"use strict";
|
|
165140
165140
|
init_esbuild_shims();
|
|
165141
|
-
var
|
|
165142
|
-
module2.exports =
|
|
165141
|
+
var os42 = __require("os");
|
|
165142
|
+
module2.exports = os42.homedir || /* @__PURE__ */ __name(function homedir20() {
|
|
165143
165143
|
var home = process.env.HOME;
|
|
165144
165144
|
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
165145
165145
|
if (process.platform === "win32") {
|
|
@@ -183770,7 +183770,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
|
|
|
183770
183770
|
};
|
|
183771
183771
|
}
|
|
183772
183772
|
async function createContentGenerator(config, gcConfig, sessionId2) {
|
|
183773
|
-
const version2 = "0.0.23
|
|
183773
|
+
const version2 = "0.0.23";
|
|
183774
183774
|
const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
183775
183775
|
const baseHeaders = {
|
|
183776
183776
|
"User-Agent": userAgent2
|
|
@@ -260857,7 +260857,7 @@ var require_supports_color = __commonJS({
|
|
|
260857
260857
|
"node_modules/chalk/node_modules/supports-color/index.js"(exports2, module2) {
|
|
260858
260858
|
"use strict";
|
|
260859
260859
|
init_esbuild_shims();
|
|
260860
|
-
var
|
|
260860
|
+
var os42 = __require("os");
|
|
260861
260861
|
var tty3 = __require("tty");
|
|
260862
260862
|
var hasFlag3 = require_has_flag();
|
|
260863
260863
|
var { env: env7 } = process;
|
|
@@ -260906,7 +260906,7 @@ var require_supports_color = __commonJS({
|
|
|
260906
260906
|
return min;
|
|
260907
260907
|
}
|
|
260908
260908
|
if (process.platform === "win32") {
|
|
260909
|
-
const osRelease =
|
|
260909
|
+
const osRelease = os42.release().split(".");
|
|
260910
260910
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
260911
260911
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
260912
260912
|
}
|
|
@@ -263793,7 +263793,7 @@ var require_main = __commonJS({
|
|
|
263793
263793
|
init_esbuild_shims();
|
|
263794
263794
|
var fs98 = __require("fs");
|
|
263795
263795
|
var path110 = __require("path");
|
|
263796
|
-
var
|
|
263796
|
+
var os42 = __require("os");
|
|
263797
263797
|
var crypto18 = __require("crypto");
|
|
263798
263798
|
var packageJson4 = require_package5();
|
|
263799
263799
|
var version2 = packageJson4.version;
|
|
@@ -263948,7 +263948,7 @@ var require_main = __commonJS({
|
|
|
263948
263948
|
}
|
|
263949
263949
|
__name(_vaultPath, "_vaultPath");
|
|
263950
263950
|
function _resolveHome(envPath) {
|
|
263951
|
-
return envPath[0] === "~" ? path110.join(
|
|
263951
|
+
return envPath[0] === "~" ? path110.join(os42.homedir(), envPath.slice(1)) : envPath;
|
|
263952
263952
|
}
|
|
263953
263953
|
__name(_resolveHome, "_resolveHome");
|
|
263954
263954
|
function _configVault(options2) {
|
|
@@ -273930,7 +273930,7 @@ var require_supports_color2 = __commonJS({
|
|
|
273930
273930
|
"node_modules/supports-hyperlinks/node_modules/supports-color/index.js"(exports2, module2) {
|
|
273931
273931
|
"use strict";
|
|
273932
273932
|
init_esbuild_shims();
|
|
273933
|
-
var
|
|
273933
|
+
var os42 = __require("os");
|
|
273934
273934
|
var tty3 = __require("tty");
|
|
273935
273935
|
var hasFlag3 = require_has_flag();
|
|
273936
273936
|
var { env: env7 } = process;
|
|
@@ -273979,7 +273979,7 @@ var require_supports_color2 = __commonJS({
|
|
|
273979
273979
|
return min;
|
|
273980
273980
|
}
|
|
273981
273981
|
if (process.platform === "win32") {
|
|
273982
|
-
const osRelease =
|
|
273982
|
+
const osRelease = os42.release().split(".");
|
|
273983
273983
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
273984
273984
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
273985
273985
|
}
|
|
@@ -280135,7 +280135,7 @@ var require_command_exists = __commonJS({
|
|
|
280135
280135
|
"use strict";
|
|
280136
280136
|
init_esbuild_shims();
|
|
280137
280137
|
var exec5 = __require("child_process").exec;
|
|
280138
|
-
var
|
|
280138
|
+
var execSync7 = __require("child_process").execSync;
|
|
280139
280139
|
var fs98 = __require("fs");
|
|
280140
280140
|
var path110 = __require("path");
|
|
280141
280141
|
var access6 = fs98.access;
|
|
@@ -280209,7 +280209,7 @@ var require_command_exists = __commonJS({
|
|
|
280209
280209
|
var commandExistsUnixSync = /* @__PURE__ */ __name(function(commandName, cleanedCommandName) {
|
|
280210
280210
|
if (fileNotExistsSync(commandName)) {
|
|
280211
280211
|
try {
|
|
280212
|
-
var stdout =
|
|
280212
|
+
var stdout = execSync7(
|
|
280213
280213
|
"command -v " + cleanedCommandName + " 2>/dev/null && { echo >&1 " + cleanedCommandName + "; exit 0; }"
|
|
280214
280214
|
);
|
|
280215
280215
|
return !!stdout;
|
|
@@ -280224,7 +280224,7 @@ var require_command_exists = __commonJS({
|
|
|
280224
280224
|
return false;
|
|
280225
280225
|
}
|
|
280226
280226
|
try {
|
|
280227
|
-
var stdout =
|
|
280227
|
+
var stdout = execSync7("where " + cleanedCommandName, { stdio: [] });
|
|
280228
280228
|
return !!stdout;
|
|
280229
280229
|
} catch (error) {
|
|
280230
280230
|
return false;
|
|
@@ -285845,9 +285845,9 @@ var require_defaults3 = __commonJS({
|
|
|
285845
285845
|
"node_modules/@pnpm/npm-conf/lib/defaults.js"(exports2) {
|
|
285846
285846
|
"use strict";
|
|
285847
285847
|
init_esbuild_shims();
|
|
285848
|
-
var
|
|
285848
|
+
var os42 = __require("os");
|
|
285849
285849
|
var path110 = __require("path");
|
|
285850
|
-
var temp =
|
|
285850
|
+
var temp = os42.tmpdir();
|
|
285851
285851
|
var uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
285852
285852
|
var hasUnicode = /* @__PURE__ */ __name(() => true, "hasUnicode");
|
|
285853
285853
|
var isWindows8 = process.platform === "win32";
|
|
@@ -285858,7 +285858,7 @@ var require_defaults3 = __commonJS({
|
|
|
285858
285858
|
var umask = {
|
|
285859
285859
|
fromString: /* @__PURE__ */ __name(() => process.umask(), "fromString")
|
|
285860
285860
|
};
|
|
285861
|
-
var home =
|
|
285861
|
+
var home = os42.homedir();
|
|
285862
285862
|
if (home) {
|
|
285863
285863
|
process.env.HOME = home;
|
|
285864
285864
|
} else {
|
|
@@ -320169,66 +320169,111 @@ var WarningMessage = /* @__PURE__ */ __name(({ text }) => {
|
|
|
320169
320169
|
// packages/cli/src/ui/components/AboutBox.tsx
|
|
320170
320170
|
init_esbuild_shims();
|
|
320171
320171
|
|
|
320172
|
-
// packages/cli/src/
|
|
320172
|
+
// packages/cli/src/utils/systemInfoFields.ts
|
|
320173
320173
|
init_esbuild_shims();
|
|
320174
|
-
|
|
320174
|
+
function getSystemInfoFields(info) {
|
|
320175
|
+
const allFields = [
|
|
320176
|
+
{
|
|
320177
|
+
label: "CLI Version",
|
|
320178
|
+
key: "cliVersion"
|
|
320179
|
+
},
|
|
320180
|
+
{
|
|
320181
|
+
label: "Git Commit",
|
|
320182
|
+
key: "gitCommit"
|
|
320183
|
+
},
|
|
320184
|
+
{
|
|
320185
|
+
label: "Model",
|
|
320186
|
+
key: "modelVersion"
|
|
320187
|
+
},
|
|
320188
|
+
{
|
|
320189
|
+
label: "Sandbox",
|
|
320190
|
+
key: "sandboxEnv"
|
|
320191
|
+
},
|
|
320192
|
+
{
|
|
320193
|
+
label: "OS Platform",
|
|
320194
|
+
key: "osPlatform"
|
|
320195
|
+
},
|
|
320196
|
+
{
|
|
320197
|
+
label: "OS Arch",
|
|
320198
|
+
key: "osArch"
|
|
320199
|
+
},
|
|
320200
|
+
{
|
|
320201
|
+
label: "OS Release",
|
|
320202
|
+
key: "osRelease"
|
|
320203
|
+
},
|
|
320204
|
+
{
|
|
320205
|
+
label: "Node.js Version",
|
|
320206
|
+
key: "nodeVersion"
|
|
320207
|
+
},
|
|
320208
|
+
{
|
|
320209
|
+
label: "NPM Version",
|
|
320210
|
+
key: "npmVersion"
|
|
320211
|
+
},
|
|
320212
|
+
{
|
|
320213
|
+
label: "Session ID",
|
|
320214
|
+
key: "sessionId"
|
|
320215
|
+
},
|
|
320216
|
+
{
|
|
320217
|
+
label: "Auth Method",
|
|
320218
|
+
key: "selectedAuthType"
|
|
320219
|
+
},
|
|
320220
|
+
{
|
|
320221
|
+
label: "Base URL",
|
|
320222
|
+
key: "baseUrl"
|
|
320223
|
+
},
|
|
320224
|
+
{
|
|
320225
|
+
label: "Memory Usage",
|
|
320226
|
+
key: "memoryUsage"
|
|
320227
|
+
},
|
|
320228
|
+
{
|
|
320229
|
+
label: "IDE Client",
|
|
320230
|
+
key: "ideClient"
|
|
320231
|
+
}
|
|
320232
|
+
];
|
|
320233
|
+
return allFields.filter((field) => {
|
|
320234
|
+
const value = info[field.key];
|
|
320235
|
+
if (field.key === "baseUrl" || field.key === "gitCommit" || field.key === "ideClient") {
|
|
320236
|
+
return Boolean(value);
|
|
320237
|
+
}
|
|
320238
|
+
return true;
|
|
320239
|
+
});
|
|
320240
|
+
}
|
|
320241
|
+
__name(getSystemInfoFields, "getSystemInfoFields");
|
|
320242
|
+
function getFieldValue(field, info) {
|
|
320243
|
+
const value = info[field.key];
|
|
320244
|
+
if (value === void 0 || value === null) {
|
|
320245
|
+
return "";
|
|
320246
|
+
}
|
|
320247
|
+
if (field.key === "selectedAuthType") {
|
|
320248
|
+
return String(value).startsWith("oauth") ? "OAuth" : String(value);
|
|
320249
|
+
}
|
|
320250
|
+
return String(value);
|
|
320251
|
+
}
|
|
320252
|
+
__name(getFieldValue, "getFieldValue");
|
|
320175
320253
|
|
|
320176
320254
|
// packages/cli/src/ui/components/AboutBox.tsx
|
|
320177
320255
|
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
|
|
320178
|
-
var AboutBox = /* @__PURE__ */ __name(({
|
|
320179
|
-
|
|
320180
|
-
|
|
320181
|
-
|
|
320182
|
-
|
|
320183
|
-
|
|
320184
|
-
|
|
320185
|
-
|
|
320186
|
-
|
|
320187
|
-
|
|
320188
|
-
|
|
320189
|
-
|
|
320190
|
-
|
|
320191
|
-
|
|
320192
|
-
|
|
320193
|
-
|
|
320194
|
-
|
|
320195
|
-
|
|
320196
|
-
|
|
320197
|
-
|
|
320198
|
-
|
|
320199
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: cliVersion }) })
|
|
320200
|
-
] }),
|
|
320201
|
-
GIT_COMMIT_INFO2 && !["N/A"].includes(GIT_COMMIT_INFO2) && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
320202
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { width: "35%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.link, children: "Git Commit" }) }),
|
|
320203
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: GIT_COMMIT_INFO2 }) })
|
|
320204
|
-
] }),
|
|
320205
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
320206
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { width: "35%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.link, children: "Model" }) }),
|
|
320207
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: modelVersion }) })
|
|
320208
|
-
] }),
|
|
320209
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
320210
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { width: "35%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.link, children: "Sandbox" }) }),
|
|
320211
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: sandboxEnv }) })
|
|
320212
|
-
] }),
|
|
320213
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
320214
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { width: "35%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.link, children: "OS" }) }),
|
|
320215
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: osVersion }) })
|
|
320216
|
-
] }),
|
|
320217
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
320218
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { width: "35%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.link, children: "Auth Method" }) }),
|
|
320219
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: selectedAuthType.startsWith("oauth") ? "OAuth" : selectedAuthType }) })
|
|
320220
|
-
] }),
|
|
320221
|
-
gcpProject && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
320222
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { width: "35%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.link, children: "GCP Project" }) }),
|
|
320223
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: gcpProject }) })
|
|
320224
|
-
] }),
|
|
320225
|
-
ideClient && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
320226
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { width: "35%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.link, children: "IDE Client" }) }),
|
|
320227
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: ideClient }) })
|
|
320228
|
-
] })
|
|
320229
|
-
]
|
|
320230
|
-
}
|
|
320231
|
-
), "AboutBox");
|
|
320256
|
+
var AboutBox = /* @__PURE__ */ __name((props) => {
|
|
320257
|
+
const fields = getSystemInfoFields(props);
|
|
320258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
320259
|
+
Box_default,
|
|
320260
|
+
{
|
|
320261
|
+
borderStyle: "round",
|
|
320262
|
+
borderColor: theme.border.default,
|
|
320263
|
+
flexDirection: "column",
|
|
320264
|
+
padding: 1,
|
|
320265
|
+
marginY: 1,
|
|
320266
|
+
width: "100%",
|
|
320267
|
+
children: [
|
|
320268
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.accent, children: "About RDMind" }) }),
|
|
320269
|
+
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
320270
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { width: "35%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { bold: true, color: theme.text.link, children: field.label }) }),
|
|
320271
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { color: theme.text.primary, children: getFieldValue(field, props) }) })
|
|
320272
|
+
] }, field.key))
|
|
320273
|
+
]
|
|
320274
|
+
}
|
|
320275
|
+
);
|
|
320276
|
+
}, "AboutBox");
|
|
320232
320277
|
|
|
320233
320278
|
// packages/cli/src/ui/components/StatsDisplay.tsx
|
|
320234
320279
|
init_esbuild_shims();
|
|
@@ -321548,18 +321593,7 @@ var HistoryItemDisplayComponent = /* @__PURE__ */ __name(({
|
|
|
321548
321593
|
itemForDisplay.type === "info" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(InfoMessage, { text: itemForDisplay.text }),
|
|
321549
321594
|
itemForDisplay.type === "warning" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(WarningMessage, { text: itemForDisplay.text }),
|
|
321550
321595
|
itemForDisplay.type === "error" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorMessage, { text: itemForDisplay.text }),
|
|
321551
|
-
itemForDisplay.type === "about" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
321552
|
-
AboutBox,
|
|
321553
|
-
{
|
|
321554
|
-
cliVersion: itemForDisplay.cliVersion,
|
|
321555
|
-
osVersion: itemForDisplay.osVersion,
|
|
321556
|
-
sandboxEnv: itemForDisplay.sandboxEnv,
|
|
321557
|
-
modelVersion: itemForDisplay.modelVersion,
|
|
321558
|
-
selectedAuthType: itemForDisplay.selectedAuthType,
|
|
321559
|
-
gcpProject: itemForDisplay.gcpProject,
|
|
321560
|
-
ideClient: itemForDisplay.ideClient
|
|
321561
|
-
}
|
|
321562
|
-
),
|
|
321596
|
+
itemForDisplay.type === "about" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AboutBox, { ...itemForDisplay.systemInfo }),
|
|
321563
321597
|
itemForDisplay.type === "help" && commands && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Help, { commands }),
|
|
321564
321598
|
itemForDisplay.type === "stats" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(StatsDisplay, { duration: itemForDisplay.duration }),
|
|
321565
321599
|
itemForDisplay.type === "model_stats" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ModelStatsDisplay, {}),
|
|
@@ -342332,7 +342366,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
342332
342366
|
// packages/cli/src/utils/version.ts
|
|
342333
342367
|
async function getCliVersion() {
|
|
342334
342368
|
const pkgJson = await getPackageJson();
|
|
342335
|
-
return "0.0.23
|
|
342369
|
+
return "0.0.23";
|
|
342336
342370
|
}
|
|
342337
342371
|
__name(getCliVersion, "getCliVersion");
|
|
342338
342372
|
|
|
@@ -344322,46 +344356,111 @@ init_esbuild_shims();
|
|
|
344322
344356
|
|
|
344323
344357
|
// packages/cli/src/ui/commands/aboutCommand.ts
|
|
344324
344358
|
init_esbuild_shims();
|
|
344359
|
+
|
|
344360
|
+
// packages/cli/src/utils/systemInfo.ts
|
|
344361
|
+
init_esbuild_shims();
|
|
344325
344362
|
import process35 from "node:process";
|
|
344363
|
+
import os28 from "node:os";
|
|
344364
|
+
import { execSync as execSync4 } from "node:child_process";
|
|
344326
344365
|
init_core2();
|
|
344366
|
+
|
|
344367
|
+
// packages/cli/src/generated/git-commit.ts
|
|
344368
|
+
init_esbuild_shims();
|
|
344369
|
+
var GIT_COMMIT_INFO2 = "546acb78";
|
|
344370
|
+
|
|
344371
|
+
// packages/cli/src/utils/systemInfo.ts
|
|
344372
|
+
async function getNpmVersion() {
|
|
344373
|
+
try {
|
|
344374
|
+
return execSync4("npm --version", { encoding: "utf-8" }).trim();
|
|
344375
|
+
} catch {
|
|
344376
|
+
return "unknown";
|
|
344377
|
+
}
|
|
344378
|
+
}
|
|
344379
|
+
__name(getNpmVersion, "getNpmVersion");
|
|
344380
|
+
async function getIdeClientName(context2) {
|
|
344381
|
+
if (!context2.services.config?.getIdeMode()) {
|
|
344382
|
+
return "";
|
|
344383
|
+
}
|
|
344384
|
+
try {
|
|
344385
|
+
const ideClient = await IdeClient.getInstance();
|
|
344386
|
+
return ideClient?.getDetectedIdeDisplayName() ?? "";
|
|
344387
|
+
} catch {
|
|
344388
|
+
return "";
|
|
344389
|
+
}
|
|
344390
|
+
}
|
|
344391
|
+
__name(getIdeClientName, "getIdeClientName");
|
|
344392
|
+
function getSandboxEnv(stripPrefix = false) {
|
|
344393
|
+
const sandbox = process35.env["SANDBOX"];
|
|
344394
|
+
if (!sandbox || sandbox === "sandbox-exec") {
|
|
344395
|
+
if (sandbox === "sandbox-exec") {
|
|
344396
|
+
const profile = process35.env["SEATBELT_PROFILE"] || "unknown";
|
|
344397
|
+
return `sandbox-exec (${profile})`;
|
|
344398
|
+
}
|
|
344399
|
+
return "no sandbox";
|
|
344400
|
+
}
|
|
344401
|
+
if (stripPrefix) {
|
|
344402
|
+
return sandbox.replace(/^qwen-(?:code-)?/, "");
|
|
344403
|
+
}
|
|
344404
|
+
return sandbox;
|
|
344405
|
+
}
|
|
344406
|
+
__name(getSandboxEnv, "getSandboxEnv");
|
|
344407
|
+
async function getSystemInfo(context2) {
|
|
344408
|
+
const osPlatform = process35.platform;
|
|
344409
|
+
const osArch = process35.arch;
|
|
344410
|
+
const osRelease = os28.release();
|
|
344411
|
+
const nodeVersion2 = process35.version;
|
|
344412
|
+
const npmVersion = await getNpmVersion();
|
|
344413
|
+
const sandboxEnv = getSandboxEnv();
|
|
344414
|
+
const modelVersion = context2.services.config?.getModel() || "Unknown";
|
|
344415
|
+
const cliVersion = await getCliVersion();
|
|
344416
|
+
const selectedAuthType = context2.services.settings.merged.security?.auth?.selectedType || "";
|
|
344417
|
+
const ideClient = await getIdeClientName(context2);
|
|
344418
|
+
const sessionId2 = context2.services.config?.getSessionId() || "unknown";
|
|
344419
|
+
return {
|
|
344420
|
+
cliVersion,
|
|
344421
|
+
osPlatform,
|
|
344422
|
+
osArch,
|
|
344423
|
+
osRelease,
|
|
344424
|
+
nodeVersion: nodeVersion2,
|
|
344425
|
+
npmVersion,
|
|
344426
|
+
sandboxEnv,
|
|
344427
|
+
modelVersion,
|
|
344428
|
+
selectedAuthType,
|
|
344429
|
+
ideClient,
|
|
344430
|
+
sessionId: sessionId2
|
|
344431
|
+
};
|
|
344432
|
+
}
|
|
344433
|
+
__name(getSystemInfo, "getSystemInfo");
|
|
344434
|
+
async function getExtendedSystemInfo(context2) {
|
|
344435
|
+
const baseInfo = await getSystemInfo(context2);
|
|
344436
|
+
const memoryUsage = formatMemoryUsage2(process35.memoryUsage().rss);
|
|
344437
|
+
const sandboxEnv = getSandboxEnv(true);
|
|
344438
|
+
const baseUrl = baseInfo.selectedAuthType === "openai" /* USE_OPENAI */ ? context2.services.config?.getContentGeneratorConfig()?.baseUrl : void 0;
|
|
344439
|
+
const gitCommit = GIT_COMMIT_INFO2 && !["N/A"].includes(GIT_COMMIT_INFO2) ? GIT_COMMIT_INFO2 : void 0;
|
|
344440
|
+
return {
|
|
344441
|
+
...baseInfo,
|
|
344442
|
+
sandboxEnv,
|
|
344443
|
+
memoryUsage,
|
|
344444
|
+
baseUrl,
|
|
344445
|
+
gitCommit
|
|
344446
|
+
};
|
|
344447
|
+
}
|
|
344448
|
+
__name(getExtendedSystemInfo, "getExtendedSystemInfo");
|
|
344449
|
+
|
|
344450
|
+
// packages/cli/src/ui/commands/aboutCommand.ts
|
|
344327
344451
|
var aboutCommand = {
|
|
344328
344452
|
name: "about",
|
|
344329
344453
|
description: "\u7248\u672C\u4FE1\u606F",
|
|
344330
344454
|
kind: "built-in" /* BUILT_IN */,
|
|
344331
344455
|
action: /* @__PURE__ */ __name(async (context2) => {
|
|
344332
|
-
const
|
|
344333
|
-
let sandboxEnv = "no sandbox";
|
|
344334
|
-
if (process35.env["SANDBOX"] && process35.env["SANDBOX"] !== "sandbox-exec") {
|
|
344335
|
-
sandboxEnv = process35.env["SANDBOX"];
|
|
344336
|
-
} else if (process35.env["SANDBOX"] === "sandbox-exec") {
|
|
344337
|
-
sandboxEnv = `sandbox-exec (${process35.env["SEATBELT_PROFILE"] || "unknown"})`;
|
|
344338
|
-
}
|
|
344339
|
-
const modelVersion = context2.services.config?.getModel() || "Unknown";
|
|
344340
|
-
const cliVersion = await getCliVersion();
|
|
344341
|
-
const selectedAuthType = context2.services.settings.merged.security?.auth?.selectedType || "";
|
|
344342
|
-
const gcpProject = process35.env["GOOGLE_CLOUD_PROJECT"] || "";
|
|
344343
|
-
const ideClient = await getIdeClientName(context2);
|
|
344456
|
+
const systemInfo = await getExtendedSystemInfo(context2);
|
|
344344
344457
|
const aboutItem = {
|
|
344345
344458
|
type: "about" /* ABOUT */,
|
|
344346
|
-
|
|
344347
|
-
osVersion,
|
|
344348
|
-
sandboxEnv,
|
|
344349
|
-
modelVersion,
|
|
344350
|
-
selectedAuthType,
|
|
344351
|
-
gcpProject,
|
|
344352
|
-
ideClient
|
|
344459
|
+
systemInfo
|
|
344353
344460
|
};
|
|
344354
344461
|
context2.ui.addItem(aboutItem, Date.now());
|
|
344355
344462
|
}, "action")
|
|
344356
344463
|
};
|
|
344357
|
-
async function getIdeClientName(context2) {
|
|
344358
|
-
if (!context2.services.config?.getIdeMode()) {
|
|
344359
|
-
return "";
|
|
344360
|
-
}
|
|
344361
|
-
const ideClient = await IdeClient.getInstance();
|
|
344362
|
-
return ideClient?.getDetectedIdeDisplayName() ?? "";
|
|
344363
|
-
}
|
|
344364
|
-
__name(getIdeClientName, "getIdeClientName");
|
|
344365
344464
|
|
|
344366
344465
|
// packages/cli/src/ui/commands/agentsCommand.ts
|
|
344367
344466
|
init_esbuild_shims();
|
|
@@ -345864,7 +345963,7 @@ ${docsUrl}`
|
|
|
345864
345963
|
// packages/cli/src/ui/commands/directoryCommand.tsx
|
|
345865
345964
|
init_esbuild_shims();
|
|
345866
345965
|
init_core2();
|
|
345867
|
-
import * as
|
|
345966
|
+
import * as os29 from "node:os";
|
|
345868
345967
|
import * as path85 from "node:path";
|
|
345869
345968
|
import * as fs77 from "node:fs/promises";
|
|
345870
345969
|
function expandHomeDir(p) {
|
|
@@ -345873,9 +345972,9 @@ function expandHomeDir(p) {
|
|
|
345873
345972
|
}
|
|
345874
345973
|
let expandedPath = p;
|
|
345875
345974
|
if (p.toLowerCase().startsWith("%userprofile%")) {
|
|
345876
|
-
expandedPath =
|
|
345975
|
+
expandedPath = os29.homedir() + p.substring("%userprofile%".length);
|
|
345877
345976
|
} else if (p === "~" || p.startsWith("~/")) {
|
|
345878
|
-
expandedPath =
|
|
345977
|
+
expandedPath = os29.homedir() + p.substring(1);
|
|
345879
345978
|
}
|
|
345880
345979
|
return path85.normalize(expandedPath);
|
|
345881
345980
|
}
|
|
@@ -346136,7 +346235,7 @@ async function resolveCompletionPaths(partialPath, baseDir) {
|
|
|
346136
346235
|
resolvedPath = baseDir;
|
|
346137
346236
|
displayPrefix = "";
|
|
346138
346237
|
} else if (partialPath.startsWith("~")) {
|
|
346139
|
-
resolvedPath = path85.join(
|
|
346238
|
+
resolvedPath = path85.join(os29.homedir(), partialPath.slice(1));
|
|
346140
346239
|
} else {
|
|
346141
346240
|
resolvedPath = path85.isAbsolute(partialPath) ? path85.resolve(partialPath || "/") : path85.resolve(baseDir, partialPath || ".");
|
|
346142
346241
|
}
|
|
@@ -347698,7 +347797,7 @@ var mcpCommand2 = {
|
|
|
347698
347797
|
init_esbuild_shims();
|
|
347699
347798
|
init_core2();
|
|
347700
347799
|
import path88 from "node:path";
|
|
347701
|
-
import
|
|
347800
|
+
import os30 from "os";
|
|
347702
347801
|
import fs79 from "fs/promises";
|
|
347703
347802
|
var memoryCommand = {
|
|
347704
347803
|
name: "memory",
|
|
@@ -347767,7 +347866,7 @@ ${memoryContent}
|
|
|
347767
347866
|
action: /* @__PURE__ */ __name(async (context2) => {
|
|
347768
347867
|
try {
|
|
347769
347868
|
const globalMemoryPath = path88.join(
|
|
347770
|
-
|
|
347869
|
+
os30.homedir(),
|
|
347771
347870
|
QWEN_DIR5,
|
|
347772
347871
|
"RDMind.md"
|
|
347773
347872
|
);
|
|
@@ -349569,7 +349668,7 @@ init_esbuild_shims();
|
|
|
349569
349668
|
// packages/cli/src/ui/utils/terminalSetup.ts
|
|
349570
349669
|
init_esbuild_shims();
|
|
349571
349670
|
import { promises as fs82 } from "node:fs";
|
|
349572
|
-
import * as
|
|
349671
|
+
import * as os31 from "node:os";
|
|
349573
349672
|
import * as path92 from "node:path";
|
|
349574
349673
|
import { exec as exec3 } from "node:child_process";
|
|
349575
349674
|
import { promisify as promisify7 } from "node:util";
|
|
@@ -349673,7 +349772,7 @@ async function detectTerminal() {
|
|
|
349673
349772
|
if (termProgram === "vscode" || process.env["VSCODE_GIT_IPC_HANDLE"]) {
|
|
349674
349773
|
return "vscode";
|
|
349675
349774
|
}
|
|
349676
|
-
if (
|
|
349775
|
+
if (os31.platform() !== "win32") {
|
|
349677
349776
|
try {
|
|
349678
349777
|
const { stdout } = await execAsync2("ps -o comm= -p $PPID");
|
|
349679
349778
|
const parentName = stdout.trim();
|
|
@@ -349701,10 +349800,10 @@ async function backupFile(filePath) {
|
|
|
349701
349800
|
}
|
|
349702
349801
|
__name(backupFile, "backupFile");
|
|
349703
349802
|
function getVSCodeStyleConfigDir(appName) {
|
|
349704
|
-
const platform14 =
|
|
349803
|
+
const platform14 = os31.platform();
|
|
349705
349804
|
if (platform14 === "darwin") {
|
|
349706
349805
|
return path92.join(
|
|
349707
|
-
|
|
349806
|
+
os31.homedir(),
|
|
349708
349807
|
"Library",
|
|
349709
349808
|
"Application Support",
|
|
349710
349809
|
appName,
|
|
@@ -349716,7 +349815,7 @@ function getVSCodeStyleConfigDir(appName) {
|
|
|
349716
349815
|
}
|
|
349717
349816
|
return path92.join(process.env["APPDATA"], appName, "User");
|
|
349718
349817
|
} else {
|
|
349719
|
-
return path92.join(
|
|
349818
|
+
return path92.join(os31.homedir(), ".config", appName, "User");
|
|
349720
349819
|
}
|
|
349721
349820
|
}
|
|
349722
349821
|
__name(getVSCodeStyleConfigDir, "getVSCodeStyleConfigDir");
|
|
@@ -350832,13 +350931,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
350832
350931
|
if (message.type === "about" /* ABOUT */) {
|
|
350833
350932
|
historyItemContent = {
|
|
350834
350933
|
type: "about",
|
|
350835
|
-
|
|
350836
|
-
osVersion: message.osVersion,
|
|
350837
|
-
sandboxEnv: message.sandboxEnv,
|
|
350838
|
-
modelVersion: message.modelVersion,
|
|
350839
|
-
selectedAuthType: message.selectedAuthType,
|
|
350840
|
-
gcpProject: message.gcpProject,
|
|
350841
|
-
ideClient: message.ideClient
|
|
350934
|
+
systemInfo: message.systemInfo
|
|
350842
350935
|
};
|
|
350843
350936
|
} else if (message.type === "help" /* HELP */) {
|
|
350844
350937
|
historyItemContent = {
|
|
@@ -351394,7 +351487,7 @@ var import_react111 = __toESM(require_react(), 1);
|
|
|
351394
351487
|
init_core2();
|
|
351395
351488
|
import crypto17 from "node:crypto";
|
|
351396
351489
|
import path94 from "node:path";
|
|
351397
|
-
import
|
|
351490
|
+
import os32 from "node:os";
|
|
351398
351491
|
import fs84 from "node:fs";
|
|
351399
351492
|
var OUTPUT_UPDATE_INTERVAL_MS2 = 1e3;
|
|
351400
351493
|
var MAX_OUTPUT_LENGTH = 1e4;
|
|
@@ -351431,14 +351524,14 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
|
|
|
351431
351524
|
{ type: "user_shell", text: rawQuery },
|
|
351432
351525
|
userMessageTimestamp
|
|
351433
351526
|
);
|
|
351434
|
-
const isWindows8 =
|
|
351527
|
+
const isWindows8 = os32.platform() === "win32";
|
|
351435
351528
|
const targetDir = config.getTargetDir();
|
|
351436
351529
|
let commandToExecute = rawQuery;
|
|
351437
351530
|
let pwdFilePath;
|
|
351438
351531
|
if (!isWindows8) {
|
|
351439
351532
|
let command2 = rawQuery.trim();
|
|
351440
351533
|
const pwdFileName = `shell_pwd_${crypto17.randomBytes(6).toString("hex")}.tmp`;
|
|
351441
|
-
pwdFilePath = path94.join(
|
|
351534
|
+
pwdFilePath = path94.join(os32.tmpdir(), pwdFileName);
|
|
351442
351535
|
if (!command2.endsWith(";") && !command2.endsWith("&")) {
|
|
351443
351536
|
command2 += ";";
|
|
351444
351537
|
}
|
|
@@ -354344,13 +354437,13 @@ import { format as format3 } from "node:util";
|
|
|
354344
354437
|
init_esbuild_shims();
|
|
354345
354438
|
var import_graceful_fs = __toESM(require_graceful_fs(), 1);
|
|
354346
354439
|
import path100 from "node:path";
|
|
354347
|
-
import
|
|
354440
|
+
import os35 from "node:os";
|
|
354348
354441
|
|
|
354349
354442
|
// node_modules/xdg-basedir/index.js
|
|
354350
354443
|
init_esbuild_shims();
|
|
354351
|
-
import
|
|
354444
|
+
import os33 from "os";
|
|
354352
354445
|
import path97 from "path";
|
|
354353
|
-
var homeDirectory =
|
|
354446
|
+
var homeDirectory = os33.homedir();
|
|
354354
354447
|
var { env: env5 } = process;
|
|
354355
354448
|
var xdgData = env5.XDG_DATA_HOME || (homeDirectory ? path97.join(homeDirectory, ".local", "share") : void 0);
|
|
354356
354449
|
var xdgConfig = env5.XDG_CONFIG_HOME || (homeDirectory ? path97.join(homeDirectory, ".config") : void 0);
|
|
@@ -354585,14 +354678,14 @@ var dist_default6 = FS;
|
|
|
354585
354678
|
|
|
354586
354679
|
// node_modules/atomically/dist/constants.js
|
|
354587
354680
|
init_esbuild_shims();
|
|
354588
|
-
import
|
|
354681
|
+
import os34 from "node:os";
|
|
354589
354682
|
import process40 from "node:process";
|
|
354590
354683
|
var DEFAULT_ENCODING2 = "utf8";
|
|
354591
354684
|
var DEFAULT_FILE_MODE = 438;
|
|
354592
354685
|
var DEFAULT_FOLDER_MODE = 511;
|
|
354593
354686
|
var DEFAULT_WRITE_OPTIONS = {};
|
|
354594
|
-
var DEFAULT_USER_UID =
|
|
354595
|
-
var DEFAULT_USER_GID =
|
|
354687
|
+
var DEFAULT_USER_UID = os34.userInfo().uid;
|
|
354688
|
+
var DEFAULT_USER_GID = os34.userInfo().gid;
|
|
354596
354689
|
var DEFAULT_TIMEOUT_SYNC = 1e3;
|
|
354597
354690
|
var IS_POSIX = !!process40.getuid;
|
|
354598
354691
|
var IS_USER_ROOT2 = process40.getuid ? !process40.getuid() : false;
|
|
@@ -355045,7 +355138,7 @@ __name(hasProperty, "hasProperty");
|
|
|
355045
355138
|
// node_modules/configstore/index.js
|
|
355046
355139
|
function getConfigDirectory(id, globalConfigPath) {
|
|
355047
355140
|
const pathPrefix = globalConfigPath ? path100.join(id, "config.json") : path100.join("configstore", `${id}.json`);
|
|
355048
|
-
const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(
|
|
355141
|
+
const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(os35.tmpdir()) + path100.sep);
|
|
355049
355142
|
return path100.join(configDirectory, pathPrefix);
|
|
355050
355143
|
}
|
|
355051
355144
|
__name(getConfigDirectory, "getConfigDirectory");
|
|
@@ -355324,7 +355417,7 @@ var ansi_styles_default6 = ansiStyles6;
|
|
|
355324
355417
|
// node_modules/update-notifier/node_modules/chalk/source/vendor/supports-color/index.js
|
|
355325
355418
|
init_esbuild_shims();
|
|
355326
355419
|
import process43 from "node:process";
|
|
355327
|
-
import
|
|
355420
|
+
import os36 from "node:os";
|
|
355328
355421
|
import tty2 from "node:tty";
|
|
355329
355422
|
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process43.argv) {
|
|
355330
355423
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -355392,7 +355485,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
355392
355485
|
return min;
|
|
355393
355486
|
}
|
|
355394
355487
|
if (process43.platform === "win32") {
|
|
355395
|
-
const osRelease =
|
|
355488
|
+
const osRelease = os36.release().split(".");
|
|
355396
355489
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
355397
355490
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
355398
355491
|
}
|
|
@@ -356389,7 +356482,7 @@ init_esbuild_shims();
|
|
|
356389
356482
|
var import_ini2 = __toESM(require_ini3(), 1);
|
|
356390
356483
|
import process45 from "node:process";
|
|
356391
356484
|
import path101 from "node:path";
|
|
356392
|
-
import
|
|
356485
|
+
import os37 from "node:os";
|
|
356393
356486
|
import fs89 from "node:fs";
|
|
356394
356487
|
var isWindows7 = process45.platform === "win32";
|
|
356395
356488
|
var readRc = /* @__PURE__ */ __name((filePath) => {
|
|
@@ -356424,7 +356517,7 @@ var getNpmPrefix = /* @__PURE__ */ __name(() => {
|
|
|
356424
356517
|
if (envPrefix) {
|
|
356425
356518
|
return envPrefix;
|
|
356426
356519
|
}
|
|
356427
|
-
const homePrefix = readRc(path101.join(
|
|
356520
|
+
const homePrefix = readRc(path101.join(os37.homedir(), ".npmrc"));
|
|
356428
356521
|
if (homePrefix) {
|
|
356429
356522
|
return homePrefix;
|
|
356430
356523
|
}
|
|
@@ -356455,11 +356548,11 @@ var getYarnPrefix = /* @__PURE__ */ __name(() => {
|
|
|
356455
356548
|
if (windowsPrefix) {
|
|
356456
356549
|
return windowsPrefix;
|
|
356457
356550
|
}
|
|
356458
|
-
const configPrefix = path101.join(
|
|
356551
|
+
const configPrefix = path101.join(os37.homedir(), ".config/yarn");
|
|
356459
356552
|
if (fs89.existsSync(configPrefix)) {
|
|
356460
356553
|
return configPrefix;
|
|
356461
356554
|
}
|
|
356462
|
-
const homePrefix = path101.join(
|
|
356555
|
+
const homePrefix = path101.join(os37.homedir(), ".yarn-config");
|
|
356463
356556
|
if (fs89.existsSync(homePrefix)) {
|
|
356464
356557
|
return homePrefix;
|
|
356465
356558
|
}
|
|
@@ -359088,15 +359181,15 @@ __name(readStdin, "readStdin");
|
|
|
359088
359181
|
// packages/cli/src/gemini.tsx
|
|
359089
359182
|
import { basename as basename16 } from "node:path";
|
|
359090
359183
|
import v8 from "node:v8";
|
|
359091
|
-
import
|
|
359184
|
+
import os41 from "node:os";
|
|
359092
359185
|
import dns from "node:dns";
|
|
359093
359186
|
import { randomUUID as randomUUID8 } from "node:crypto";
|
|
359094
359187
|
|
|
359095
359188
|
// packages/cli/src/utils/sandbox.ts
|
|
359096
359189
|
init_esbuild_shims();
|
|
359097
359190
|
var import_shell_quote5 = __toESM(require_shell_quote(), 1);
|
|
359098
|
-
import { exec as exec4, execSync as
|
|
359099
|
-
import
|
|
359191
|
+
import { exec as exec4, execSync as execSync6, spawn as spawn11 } from "node:child_process";
|
|
359192
|
+
import os38 from "node:os";
|
|
359100
359193
|
import path107 from "node:path";
|
|
359101
359194
|
import fs94 from "node:fs";
|
|
359102
359195
|
import { readFile as readFile11 } from "node:fs/promises";
|
|
@@ -359106,7 +359199,7 @@ import { promisify as promisify9 } from "node:util";
|
|
|
359106
359199
|
import { randomBytes as randomBytes5 } from "node:crypto";
|
|
359107
359200
|
var execAsync3 = promisify9(exec4);
|
|
359108
359201
|
function getContainerPath(hostPath) {
|
|
359109
|
-
if (
|
|
359202
|
+
if (os38.platform() !== "win32") {
|
|
359110
359203
|
return hostPath;
|
|
359111
359204
|
}
|
|
359112
359205
|
const withForwardSlashes = hostPath.replace(/\\/g, "/");
|
|
@@ -359136,7 +359229,7 @@ async function shouldUseCurrentUserInSandbox() {
|
|
|
359136
359229
|
if (envVar === "0" || envVar === "false") {
|
|
359137
359230
|
return false;
|
|
359138
359231
|
}
|
|
359139
|
-
if (
|
|
359232
|
+
if (os38.platform() === "linux") {
|
|
359140
359233
|
try {
|
|
359141
359234
|
const osReleaseContent = await readFile11("/etc/os-release", "utf8");
|
|
359142
359235
|
if (osReleaseContent.includes("ID=debian") || osReleaseContent.includes("ID=ubuntu") || osReleaseContent.match(/^ID_LIKE=.*debian.*/m) || // Covers derivatives
|
|
@@ -359166,7 +359259,7 @@ function ports() {
|
|
|
359166
359259
|
}
|
|
359167
359260
|
__name(ports, "ports");
|
|
359168
359261
|
function entrypoint(workdir, cliArgs) {
|
|
359169
|
-
const isWindows8 =
|
|
359262
|
+
const isWindows8 = os38.platform() === "win32";
|
|
359170
359263
|
const containerWorkdir = getContainerPath(workdir);
|
|
359171
359264
|
const shellCmds = [];
|
|
359172
359265
|
const pathSeparator = isWindows8 ? ";" : ":";
|
|
@@ -359251,11 +359344,11 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359251
359344
|
"-D",
|
|
359252
359345
|
`TARGET_DIR=${fs94.realpathSync(process.cwd())}`,
|
|
359253
359346
|
"-D",
|
|
359254
|
-
`TMP_DIR=${fs94.realpathSync(
|
|
359347
|
+
`TMP_DIR=${fs94.realpathSync(os38.tmpdir())}`,
|
|
359255
359348
|
"-D",
|
|
359256
|
-
`HOME_DIR=${fs94.realpathSync(
|
|
359349
|
+
`HOME_DIR=${fs94.realpathSync(os38.homedir())}`,
|
|
359257
359350
|
"-D",
|
|
359258
|
-
`CACHE_DIR=${fs94.realpathSync(
|
|
359351
|
+
`CACHE_DIR=${fs94.realpathSync(execSync6(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`
|
|
359259
359352
|
];
|
|
359260
359353
|
const MAX_INCLUDE_DIRS = 5;
|
|
359261
359354
|
const targetDir = fs94.realpathSync(cliConfig?.getTargetDir() || "");
|
|
@@ -359373,7 +359466,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359373
359466
|
console.error(`using ${projectSandboxDockerfile2} for sandbox`);
|
|
359374
359467
|
buildArgs += `-f ${path107.resolve(projectSandboxDockerfile2)} -i ${image2}`;
|
|
359375
359468
|
}
|
|
359376
|
-
|
|
359469
|
+
execSync6(
|
|
359377
359470
|
`cd ${gcRoot} && node scripts/build_sandbox.js -s ${buildArgs}`,
|
|
359378
359471
|
{
|
|
359379
359472
|
stdio: "inherit",
|
|
@@ -359421,8 +359514,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359421
359514
|
`${userSettingsDirOnHost}:${getContainerPath(userSettingsDirOnHost)}`
|
|
359422
359515
|
);
|
|
359423
359516
|
}
|
|
359424
|
-
args.push("--volume", `${
|
|
359425
|
-
const gcloudConfigDir = path107.join(
|
|
359517
|
+
args.push("--volume", `${os38.tmpdir()}:${getContainerPath(os38.tmpdir())}`);
|
|
359518
|
+
const gcloudConfigDir = path107.join(os38.homedir(), ".config", "gcloud");
|
|
359426
359519
|
if (fs94.existsSync(gcloudConfigDir)) {
|
|
359427
359520
|
args.push(
|
|
359428
359521
|
"--volume",
|
|
@@ -359482,12 +359575,12 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359482
359575
|
args.push("--env", `no_proxy=${noProxy}`);
|
|
359483
359576
|
}
|
|
359484
359577
|
if (proxy) {
|
|
359485
|
-
|
|
359578
|
+
execSync6(
|
|
359486
359579
|
`${config.command} network inspect ${SANDBOX_NETWORK_NAME} || ${config.command} network create --internal ${SANDBOX_NETWORK_NAME}`
|
|
359487
359580
|
);
|
|
359488
359581
|
args.push("--network", SANDBOX_NETWORK_NAME);
|
|
359489
359582
|
if (proxyCommand) {
|
|
359490
|
-
|
|
359583
|
+
execSync6(
|
|
359491
359584
|
`${config.command} network inspect ${SANDBOX_PROXY_NAME} || ${config.command} network create ${SANDBOX_PROXY_NAME}`
|
|
359492
359585
|
);
|
|
359493
359586
|
}
|
|
@@ -359503,7 +359596,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359503
359596
|
console.log(`ContainerName: ${containerName}`);
|
|
359504
359597
|
} else {
|
|
359505
359598
|
let index = 0;
|
|
359506
|
-
const containerNameCheck =
|
|
359599
|
+
const containerNameCheck = execSync6(
|
|
359507
359600
|
`${config.command} ps -a --format "{{.Names}}"`
|
|
359508
359601
|
).toString().trim();
|
|
359509
359602
|
while (containerNameCheck.includes(`${imageName}-${index}`)) {
|
|
@@ -359620,7 +359713,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359620
359713
|
}
|
|
359621
359714
|
args.push("--env", `SANDBOX=${containerName}`);
|
|
359622
359715
|
if (config.command === "podman") {
|
|
359623
|
-
const emptyAuthFilePath = path107.join(
|
|
359716
|
+
const emptyAuthFilePath = path107.join(os38.tmpdir(), "empty_auth.json");
|
|
359624
359717
|
fs94.writeFileSync(emptyAuthFilePath, "{}", "utf-8");
|
|
359625
359718
|
args.push("--authfile", emptyAuthFilePath);
|
|
359626
359719
|
}
|
|
@@ -359631,10 +359724,10 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359631
359724
|
userFlag = "--user root";
|
|
359632
359725
|
} else if (await shouldUseCurrentUserInSandbox()) {
|
|
359633
359726
|
args.push("--user", "root");
|
|
359634
|
-
const uid =
|
|
359635
|
-
const gid =
|
|
359727
|
+
const uid = execSync6("id -u").toString().trim();
|
|
359728
|
+
const gid = execSync6("id -g").toString().trim();
|
|
359636
359729
|
const username = "gemini";
|
|
359637
|
-
const homeDir = getContainerPath(
|
|
359730
|
+
const homeDir = getContainerPath(os38.homedir());
|
|
359638
359731
|
const setupUserCommands = [
|
|
359639
359732
|
// Use -f with groupadd to avoid errors if the group already exists.
|
|
359640
359733
|
`groupadd -f -g ${gid} ${username}`,
|
|
@@ -359646,7 +359739,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359646
359739
|
const suCommand = `su -p ${username} -c '${escapedOriginalCommand}'`;
|
|
359647
359740
|
finalEntrypoint[2] = `${setupUserCommands} && ${suCommand}`;
|
|
359648
359741
|
userFlag = `--user ${uid}:${gid}`;
|
|
359649
|
-
args.push("--env", `HOME=${
|
|
359742
|
+
args.push("--env", `HOME=${os38.homedir()}`);
|
|
359650
359743
|
}
|
|
359651
359744
|
args.push(image2);
|
|
359652
359745
|
args.push(...finalEntrypoint);
|
|
@@ -359661,7 +359754,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
359661
359754
|
});
|
|
359662
359755
|
const stopProxy = /* @__PURE__ */ __name(() => {
|
|
359663
359756
|
console.log("stopping proxy container ...");
|
|
359664
|
-
|
|
359757
|
+
execSync6(`${config.command} rm -f ${SANDBOX_PROXY_NAME}`);
|
|
359665
359758
|
}, "stopProxy");
|
|
359666
359759
|
process.on("exit", stopProxy);
|
|
359667
359760
|
process.on("SIGINT", stopProxy);
|
|
@@ -359824,9 +359917,9 @@ __name(ensureSandboxImageIsPresent, "ensureSandboxImageIsPresent");
|
|
|
359824
359917
|
init_esbuild_shims();
|
|
359825
359918
|
init_core2();
|
|
359826
359919
|
import fs95 from "node:fs/promises";
|
|
359827
|
-
import
|
|
359920
|
+
import os39 from "node:os";
|
|
359828
359921
|
import { join as pathJoin } from "node:path";
|
|
359829
|
-
var warningsFilePath = pathJoin(
|
|
359922
|
+
var warningsFilePath = pathJoin(os39.tmpdir(), "qwen-code-warnings.txt");
|
|
359830
359923
|
async function getStartupWarnings() {
|
|
359831
359924
|
try {
|
|
359832
359925
|
await fs95.access(warningsFilePath);
|
|
@@ -359851,7 +359944,7 @@ __name(getStartupWarnings, "getStartupWarnings");
|
|
|
359851
359944
|
init_esbuild_shims();
|
|
359852
359945
|
init_core2();
|
|
359853
359946
|
import fs96 from "node:fs/promises";
|
|
359854
|
-
import * as
|
|
359947
|
+
import * as os40 from "node:os";
|
|
359855
359948
|
import path108 from "node:path";
|
|
359856
359949
|
var homeDirectoryCheck = {
|
|
359857
359950
|
id: "home-directory",
|
|
@@ -359859,7 +359952,7 @@ var homeDirectoryCheck = {
|
|
|
359859
359952
|
try {
|
|
359860
359953
|
const [workspaceRealPath, homeRealPath] = await Promise.all([
|
|
359861
359954
|
fs96.realpath(options2.workspaceRoot),
|
|
359862
|
-
fs96.realpath(
|
|
359955
|
+
fs96.realpath(os40.homedir())
|
|
359863
359956
|
]);
|
|
359864
359957
|
if (workspaceRealPath === homeRealPath) {
|
|
359865
359958
|
return "\u5F53\u524D\u6B63\u5728 ~ \u76EE\u5F55\u4E0B\u8FD0\u884C RDMind\uFF0C\u5EFA\u8BAE\u8FDB\u5165\u9879\u76EE\u76EE\u5F55";
|
|
@@ -361625,7 +361718,7 @@ function validateDnsResolutionOrder(order) {
|
|
|
361625
361718
|
}
|
|
361626
361719
|
__name(validateDnsResolutionOrder, "validateDnsResolutionOrder");
|
|
361627
361720
|
function getNodeMemoryArgs(isDebugMode2) {
|
|
361628
|
-
const totalMemoryMB =
|
|
361721
|
+
const totalMemoryMB = os41.totalmem() / (1024 * 1024);
|
|
361629
361722
|
const heapStats = v8.getHeapStatistics();
|
|
361630
361723
|
const currentMaxOldSpaceSizeMb = Math.floor(
|
|
361631
361724
|
heapStats.heap_size_limit / 1024 / 1024
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rdmind/rdmind",
|
|
3
|
-
"version": "0.0.23
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "RDMind - AI-powered coding assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "cli.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"LICENSE"
|
|
20
20
|
],
|
|
21
21
|
"config": {
|
|
22
|
-
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.23
|
|
22
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.23"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|