@rdmind/rdmind 0.0.28-alpha.1 → 0.0.28-alpha.2
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 +205 -200
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -43517,14 +43517,14 @@ var require_connect = __commonJS({
|
|
|
43517
43517
|
const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
|
|
43518
43518
|
timeout2 = timeout2 == null ? 1e4 : timeout2;
|
|
43519
43519
|
allowH2 = allowH2 != null ? allowH2 : false;
|
|
43520
|
-
return /* @__PURE__ */ __name(function connect({ hostname:
|
|
43520
|
+
return /* @__PURE__ */ __name(function connect({ hostname: hostname4, host, protocol, port, servername, localAddress, httpSocket }, callback) {
|
|
43521
43521
|
let socket;
|
|
43522
43522
|
if (protocol === "https:") {
|
|
43523
43523
|
if (!tls) {
|
|
43524
43524
|
tls = __require("node:tls");
|
|
43525
43525
|
}
|
|
43526
43526
|
servername = servername || options2.servername || util4.getServerName(host) || null;
|
|
43527
|
-
const sessionKey = servername ||
|
|
43527
|
+
const sessionKey = servername || hostname4;
|
|
43528
43528
|
assert3(sessionKey);
|
|
43529
43529
|
const session = customSession || sessionCache.get(sessionKey) || null;
|
|
43530
43530
|
port = port || 443;
|
|
@@ -43539,7 +43539,7 @@ var require_connect = __commonJS({
|
|
|
43539
43539
|
socket: httpSocket,
|
|
43540
43540
|
// upgrade socket connection
|
|
43541
43541
|
port,
|
|
43542
|
-
host:
|
|
43542
|
+
host: hostname4
|
|
43543
43543
|
});
|
|
43544
43544
|
socket.on("session", function(session2) {
|
|
43545
43545
|
sessionCache.set(sessionKey, session2);
|
|
@@ -43553,14 +43553,14 @@ var require_connect = __commonJS({
|
|
|
43553
43553
|
...options2,
|
|
43554
43554
|
localAddress,
|
|
43555
43555
|
port,
|
|
43556
|
-
host:
|
|
43556
|
+
host: hostname4
|
|
43557
43557
|
});
|
|
43558
43558
|
}
|
|
43559
43559
|
if (options2.keepAlive == null || options2.keepAlive) {
|
|
43560
43560
|
const keepAliveInitialDelay = options2.keepAliveInitialDelay === void 0 ? 6e4 : options2.keepAliveInitialDelay;
|
|
43561
43561
|
socket.setKeepAlive(true, keepAliveInitialDelay);
|
|
43562
43562
|
}
|
|
43563
|
-
const clearConnectTimeout = util4.setupConnectTimeout(new WeakRef(socket), { timeout: timeout2, hostname:
|
|
43563
|
+
const clearConnectTimeout = util4.setupConnectTimeout(new WeakRef(socket), { timeout: timeout2, hostname: hostname4, port });
|
|
43564
43564
|
socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() {
|
|
43565
43565
|
queueMicrotask(clearConnectTimeout);
|
|
43566
43566
|
if (callback) {
|
|
@@ -48536,8 +48536,8 @@ var require_client_h2 = __commonJS({
|
|
|
48536
48536
|
}
|
|
48537
48537
|
}
|
|
48538
48538
|
let stream2 = null;
|
|
48539
|
-
const { hostname:
|
|
48540
|
-
headers[HTTP2_HEADER_AUTHORITY] = host || `${
|
|
48539
|
+
const { hostname: hostname4, port } = client[kUrl];
|
|
48540
|
+
headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname4}${port ? `:${port}` : ""}`;
|
|
48541
48541
|
headers[HTTP2_HEADER_METHOD] = method;
|
|
48542
48542
|
const abort = /* @__PURE__ */ __name((err) => {
|
|
48543
48543
|
if (request4.aborted || request4.completed) {
|
|
@@ -49204,20 +49204,20 @@ var require_client = __commonJS({
|
|
|
49204
49204
|
function connect(client) {
|
|
49205
49205
|
assert3(!client[kConnecting]);
|
|
49206
49206
|
assert3(!client[kHTTPContext]);
|
|
49207
|
-
let { host, hostname:
|
|
49208
|
-
if (
|
|
49209
|
-
const idx =
|
|
49207
|
+
let { host, hostname: hostname4, protocol, port } = client[kUrl];
|
|
49208
|
+
if (hostname4[0] === "[") {
|
|
49209
|
+
const idx = hostname4.indexOf("]");
|
|
49210
49210
|
assert3(idx !== -1);
|
|
49211
|
-
const ip =
|
|
49211
|
+
const ip = hostname4.substring(1, idx);
|
|
49212
49212
|
assert3(net2.isIPv6(ip));
|
|
49213
|
-
|
|
49213
|
+
hostname4 = ip;
|
|
49214
49214
|
}
|
|
49215
49215
|
client[kConnecting] = true;
|
|
49216
49216
|
if (channels.beforeConnect.hasSubscribers) {
|
|
49217
49217
|
channels.beforeConnect.publish({
|
|
49218
49218
|
connectParams: {
|
|
49219
49219
|
host,
|
|
49220
|
-
hostname:
|
|
49220
|
+
hostname: hostname4,
|
|
49221
49221
|
protocol,
|
|
49222
49222
|
port,
|
|
49223
49223
|
version: client[kHTTPContext]?.version,
|
|
@@ -49229,14 +49229,14 @@ var require_client = __commonJS({
|
|
|
49229
49229
|
}
|
|
49230
49230
|
client[kConnector]({
|
|
49231
49231
|
host,
|
|
49232
|
-
hostname:
|
|
49232
|
+
hostname: hostname4,
|
|
49233
49233
|
protocol,
|
|
49234
49234
|
port,
|
|
49235
49235
|
servername: client[kServerName],
|
|
49236
49236
|
localAddress: client[kLocalAddress]
|
|
49237
49237
|
}, (err, socket) => {
|
|
49238
49238
|
if (err) {
|
|
49239
|
-
handleConnectError(client, err, { host, hostname:
|
|
49239
|
+
handleConnectError(client, err, { host, hostname: hostname4, protocol, port });
|
|
49240
49240
|
client[kResume]();
|
|
49241
49241
|
return;
|
|
49242
49242
|
}
|
|
@@ -49250,7 +49250,7 @@ var require_client = __commonJS({
|
|
|
49250
49250
|
client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
|
|
49251
49251
|
} catch (err2) {
|
|
49252
49252
|
socket.destroy().on("error", noop6);
|
|
49253
|
-
handleConnectError(client, err2, { host, hostname:
|
|
49253
|
+
handleConnectError(client, err2, { host, hostname: hostname4, protocol, port });
|
|
49254
49254
|
client[kResume]();
|
|
49255
49255
|
return;
|
|
49256
49256
|
}
|
|
@@ -49263,7 +49263,7 @@ var require_client = __commonJS({
|
|
|
49263
49263
|
channels.connected.publish({
|
|
49264
49264
|
connectParams: {
|
|
49265
49265
|
host,
|
|
49266
|
-
hostname:
|
|
49266
|
+
hostname: hostname4,
|
|
49267
49267
|
protocol,
|
|
49268
49268
|
port,
|
|
49269
49269
|
version: client[kHTTPContext]?.version,
|
|
@@ -49279,7 +49279,7 @@ var require_client = __commonJS({
|
|
|
49279
49279
|
});
|
|
49280
49280
|
}
|
|
49281
49281
|
__name(connect, "connect");
|
|
49282
|
-
function handleConnectError(client, err, { host, hostname:
|
|
49282
|
+
function handleConnectError(client, err, { host, hostname: hostname4, protocol, port }) {
|
|
49283
49283
|
if (client.destroyed) {
|
|
49284
49284
|
return;
|
|
49285
49285
|
}
|
|
@@ -49288,7 +49288,7 @@ var require_client = __commonJS({
|
|
|
49288
49288
|
channels.connectError.publish({
|
|
49289
49289
|
connectParams: {
|
|
49290
49290
|
host,
|
|
49291
|
-
hostname:
|
|
49291
|
+
hostname: hostname4,
|
|
49292
49292
|
protocol,
|
|
49293
49293
|
port,
|
|
49294
49294
|
version: client[kHTTPContext]?.version,
|
|
@@ -50338,10 +50338,10 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
50338
50338
|
]);
|
|
50339
50339
|
}
|
|
50340
50340
|
#getProxyAgentForUrl(url2) {
|
|
50341
|
-
let { protocol, host:
|
|
50342
|
-
|
|
50341
|
+
let { protocol, host: hostname4, port } = url2;
|
|
50342
|
+
hostname4 = hostname4.replace(/:\d*$/, "").toLowerCase();
|
|
50343
50343
|
port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0;
|
|
50344
|
-
if (!this.#shouldProxy(
|
|
50344
|
+
if (!this.#shouldProxy(hostname4, port)) {
|
|
50345
50345
|
return this[kNoProxyAgent];
|
|
50346
50346
|
}
|
|
50347
50347
|
if (protocol === "https:") {
|
|
@@ -50349,7 +50349,7 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
50349
50349
|
}
|
|
50350
50350
|
return this[kHttpProxyAgent];
|
|
50351
50351
|
}
|
|
50352
|
-
#shouldProxy(
|
|
50352
|
+
#shouldProxy(hostname4, port) {
|
|
50353
50353
|
if (this.#noProxyChanged) {
|
|
50354
50354
|
this.#parseNoProxy();
|
|
50355
50355
|
}
|
|
@@ -50365,11 +50365,11 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
50365
50365
|
continue;
|
|
50366
50366
|
}
|
|
50367
50367
|
if (!/^[.*]/.test(entry.hostname)) {
|
|
50368
|
-
if (
|
|
50368
|
+
if (hostname4 === entry.hostname) {
|
|
50369
50369
|
return false;
|
|
50370
50370
|
}
|
|
50371
50371
|
} else {
|
|
50372
|
-
if (
|
|
50372
|
+
if (hostname4.endsWith(entry.hostname.replace(/^\*/, ""))) {
|
|
50373
50373
|
return false;
|
|
50374
50374
|
}
|
|
50375
50375
|
}
|
|
@@ -50815,10 +50815,10 @@ var require_h2c_client = __commonJS({
|
|
|
50815
50815
|
#buildConnector(connectOpts) {
|
|
50816
50816
|
return (opts, callback) => {
|
|
50817
50817
|
const timeout2 = connectOpts?.connectOpts ?? 1e4;
|
|
50818
|
-
const { hostname:
|
|
50818
|
+
const { hostname: hostname4, port, pathname } = opts;
|
|
50819
50819
|
const socket = connect({
|
|
50820
50820
|
...opts,
|
|
50821
|
-
host:
|
|
50821
|
+
host: hostname4,
|
|
50822
50822
|
port,
|
|
50823
50823
|
pathname
|
|
50824
50824
|
});
|
|
@@ -50829,7 +50829,7 @@ var require_h2c_client = __commonJS({
|
|
|
50829
50829
|
socket.alpnProtocol = "h2";
|
|
50830
50830
|
const clearConnectTimeout = util4.setupConnectTimeout(
|
|
50831
50831
|
new WeakRef(socket),
|
|
50832
|
-
{ timeout: timeout2, hostname:
|
|
50832
|
+
{ timeout: timeout2, hostname: hostname4, port }
|
|
50833
50833
|
);
|
|
50834
50834
|
socket.setNoDelay(true).once("connect", function() {
|
|
50835
50835
|
queueMicrotask(clearConnectTimeout);
|
|
@@ -77806,7 +77806,7 @@ var require_googleauth = __commonJS({
|
|
|
77806
77806
|
var child_process_1 = __require("child_process");
|
|
77807
77807
|
var fs103 = __require("fs");
|
|
77808
77808
|
var gcpMetadata = require_src4();
|
|
77809
|
-
var
|
|
77809
|
+
var os48 = __require("os");
|
|
77810
77810
|
var path115 = __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 = os48.platform();
|
|
78254
78254
|
if (sys && sys.length >= 3) {
|
|
78255
78255
|
if (sys.substring(0, 3).toLowerCase() === "win") {
|
|
78256
78256
|
return true;
|
|
@@ -124811,7 +124811,7 @@ var require_service_config = __commonJS({
|
|
|
124811
124811
|
exports2.validateRetryThrottling = validateRetryThrottling;
|
|
124812
124812
|
exports2.validateServiceConfig = validateServiceConfig;
|
|
124813
124813
|
exports2.extractAndSelectServiceConfig = extractAndSelectServiceConfig;
|
|
124814
|
-
var
|
|
124814
|
+
var os48 = __require("os");
|
|
124815
124815
|
var constants_1 = require_constants9();
|
|
124816
124816
|
var DURATION_REGEX = /^\d+(\.\d{1,9})?s$/;
|
|
124817
124817
|
var CLIENT_LANGUAGE_STRING = "node";
|
|
@@ -125117,8 +125117,8 @@ var require_service_config = __commonJS({
|
|
|
125117
125117
|
}
|
|
125118
125118
|
if (Array.isArray(validatedConfig.clientHostname)) {
|
|
125119
125119
|
let hostnameMatched = false;
|
|
125120
|
-
for (const
|
|
125121
|
-
if (
|
|
125120
|
+
for (const hostname4 of validatedConfig.clientHostname) {
|
|
125121
|
+
if (hostname4 === os48.hostname()) {
|
|
125122
125122
|
hostnameMatched = true;
|
|
125123
125123
|
}
|
|
125124
125124
|
}
|
|
@@ -138607,8 +138607,8 @@ var require_resolver_dns = __commonJS({
|
|
|
138607
138607
|
}
|
|
138608
138608
|
trace2("Looking up DNS hostname " + this.dnsHostname);
|
|
138609
138609
|
this.latestLookupResult = null;
|
|
138610
|
-
const
|
|
138611
|
-
this.pendingLookupPromise = this.lookup(
|
|
138610
|
+
const hostname4 = this.dnsHostname;
|
|
138611
|
+
this.pendingLookupPromise = this.lookup(hostname4);
|
|
138612
138612
|
this.pendingLookupPromise.then((addressList) => {
|
|
138613
138613
|
if (this.pendingLookupPromise === null) {
|
|
138614
138614
|
return;
|
|
@@ -138636,7 +138636,7 @@ var require_resolver_dns = __commonJS({
|
|
|
138636
138636
|
this.listener.onError(this.defaultResolutionError);
|
|
138637
138637
|
});
|
|
138638
138638
|
if (this.isServiceConfigEnabled && this.pendingTxtPromise === null) {
|
|
138639
|
-
this.pendingTxtPromise = this.resolveTxt(
|
|
138639
|
+
this.pendingTxtPromise = this.resolveTxt(hostname4);
|
|
138640
138640
|
this.pendingTxtPromise.then((txtRecord) => {
|
|
138641
138641
|
if (this.pendingTxtPromise === null) {
|
|
138642
138642
|
return;
|
|
@@ -138659,12 +138659,12 @@ var require_resolver_dns = __commonJS({
|
|
|
138659
138659
|
}
|
|
138660
138660
|
}
|
|
138661
138661
|
}
|
|
138662
|
-
async lookup(
|
|
138662
|
+
async lookup(hostname4) {
|
|
138663
138663
|
if (environment_1.GRPC_NODE_USE_ALTERNATIVE_RESOLVER) {
|
|
138664
138664
|
trace2("Using alternative DNS resolver.");
|
|
138665
138665
|
const records = await Promise.allSettled([
|
|
138666
|
-
this.alternativeResolver.resolve4(
|
|
138667
|
-
this.alternativeResolver.resolve6(
|
|
138666
|
+
this.alternativeResolver.resolve4(hostname4),
|
|
138667
|
+
this.alternativeResolver.resolve6(hostname4)
|
|
138668
138668
|
]);
|
|
138669
138669
|
if (records.every((result) => result.status === "rejected")) {
|
|
138670
138670
|
throw new Error(records[0].reason);
|
|
@@ -138676,15 +138676,15 @@ var require_resolver_dns = __commonJS({
|
|
|
138676
138676
|
port: +this.port
|
|
138677
138677
|
}));
|
|
138678
138678
|
}
|
|
138679
|
-
const addressList = await dns_1.promises.lookup(
|
|
138679
|
+
const addressList = await dns_1.promises.lookup(hostname4, { all: true });
|
|
138680
138680
|
return addressList.map((addr) => ({ host: addr.address, port: +this.port }));
|
|
138681
138681
|
}
|
|
138682
|
-
async resolveTxt(
|
|
138682
|
+
async resolveTxt(hostname4) {
|
|
138683
138683
|
if (environment_1.GRPC_NODE_USE_ALTERNATIVE_RESOLVER) {
|
|
138684
138684
|
trace2("Using alternative DNS resolver.");
|
|
138685
|
-
return this.alternativeResolver.resolveTxt(
|
|
138685
|
+
return this.alternativeResolver.resolveTxt(hostname4);
|
|
138686
138686
|
}
|
|
138687
|
-
return dns_1.promises.resolveTxt(
|
|
138687
|
+
return dns_1.promises.resolveTxt(hostname4);
|
|
138688
138688
|
}
|
|
138689
138689
|
startNextResolutionTimer() {
|
|
138690
138690
|
var _a6, _b2;
|
|
@@ -138816,13 +138816,13 @@ var require_http_proxy = __commonJS({
|
|
|
138816
138816
|
userCred = proxyUrl.username;
|
|
138817
138817
|
}
|
|
138818
138818
|
}
|
|
138819
|
-
const
|
|
138819
|
+
const hostname4 = proxyUrl.hostname;
|
|
138820
138820
|
let port = proxyUrl.port;
|
|
138821
138821
|
if (port === "") {
|
|
138822
138822
|
port = "80";
|
|
138823
138823
|
}
|
|
138824
138824
|
const result = {
|
|
138825
|
-
address: `${
|
|
138825
|
+
address: `${hostname4}:${port}`
|
|
138826
138826
|
};
|
|
138827
138827
|
if (userCred) {
|
|
138828
138828
|
result.creds = userCred;
|
|
@@ -139084,7 +139084,7 @@ var require_subchannel_call = __commonJS({
|
|
|
139084
139084
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
139085
139085
|
exports2.Http2SubchannelCall = void 0;
|
|
139086
139086
|
var http22 = __require("http2");
|
|
139087
|
-
var
|
|
139087
|
+
var os48 = __require("os");
|
|
139088
139088
|
var constants_1 = require_constants9();
|
|
139089
139089
|
var metadata_1 = require_metadata3();
|
|
139090
139090
|
var stream_decoder_1 = require_stream_decoder();
|
|
@@ -139092,7 +139092,7 @@ var require_subchannel_call = __commonJS({
|
|
|
139092
139092
|
var constants_2 = require_constants9();
|
|
139093
139093
|
var TRACER_NAME = "subchannel_call";
|
|
139094
139094
|
function getSystemErrorName(errno) {
|
|
139095
|
-
for (const [name3, num] of Object.entries(
|
|
139095
|
+
for (const [name3, num] of Object.entries(os48.constants.errno)) {
|
|
139096
139096
|
if (num === errno) {
|
|
139097
139097
|
return name3;
|
|
139098
139098
|
}
|
|
@@ -140666,8 +140666,8 @@ var require_load_balancing_call = __commonJS({
|
|
|
140666
140666
|
if (splitPath.length >= 2) {
|
|
140667
140667
|
serviceName = splitPath[1];
|
|
140668
140668
|
}
|
|
140669
|
-
const
|
|
140670
|
-
this.serviceUrl = `https://${
|
|
140669
|
+
const hostname4 = (_b2 = (_a6 = (0, uri_parser_1.splitHostPort)(this.host)) === null || _a6 === void 0 ? void 0 : _a6.host) !== null && _b2 !== void 0 ? _b2 : "localhost";
|
|
140670
|
+
this.serviceUrl = `https://${hostname4}/${serviceName}`;
|
|
140671
140671
|
this.startTime = /* @__PURE__ */ new Date();
|
|
140672
140672
|
}
|
|
140673
140673
|
getDeadlineInfo() {
|
|
@@ -159060,7 +159060,7 @@ var require_ProcessDetector = __commonJS({
|
|
|
159060
159060
|
exports2.processDetector = void 0;
|
|
159061
159061
|
var api_1 = (init_esm2(), __toCommonJS(esm_exports2));
|
|
159062
159062
|
var semconv_1 = require_semconv2();
|
|
159063
|
-
var
|
|
159063
|
+
var os48 = __require("os");
|
|
159064
159064
|
var ProcessDetector = class {
|
|
159065
159065
|
static {
|
|
159066
159066
|
__name(this, "ProcessDetector");
|
|
@@ -159083,7 +159083,7 @@ var require_ProcessDetector = __commonJS({
|
|
|
159083
159083
|
attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
|
|
159084
159084
|
}
|
|
159085
159085
|
try {
|
|
159086
|
-
const userInfo2 =
|
|
159086
|
+
const userInfo2 = os48.userInfo();
|
|
159087
159087
|
attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo2.username;
|
|
159088
159088
|
} catch (e2) {
|
|
159089
159089
|
api_1.diag.debug(`error obtaining process owner: ${e2}`);
|
|
@@ -165433,8 +165433,8 @@ var require_homedir = __commonJS({
|
|
|
165433
165433
|
"node_modules/resolve/lib/homedir.js"(exports2, module2) {
|
|
165434
165434
|
"use strict";
|
|
165435
165435
|
init_esbuild_shims();
|
|
165436
|
-
var
|
|
165437
|
-
module2.exports =
|
|
165436
|
+
var os48 = __require("os");
|
|
165437
|
+
module2.exports = os48.homedir || /* @__PURE__ */ __name(function homedir24() {
|
|
165438
165438
|
var home = process.env.HOME;
|
|
165439
165439
|
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
165440
165440
|
if (process.platform === "win32") {
|
|
@@ -170008,10 +170008,10 @@ var require_utils12 = __commonJS({
|
|
|
170008
170008
|
}, "isCompressed");
|
|
170009
170009
|
exports2.isCompressed = isCompressed;
|
|
170010
170010
|
function stringUrlToHttpOptions(stringUrl) {
|
|
170011
|
-
const { hostname:
|
|
170011
|
+
const { hostname: hostname4, pathname, port, username, password, search, protocol, hash, href, origin, host } = new URL(stringUrl);
|
|
170012
170012
|
const options2 = {
|
|
170013
170013
|
protocol,
|
|
170014
|
-
hostname:
|
|
170014
|
+
hostname: hostname4 && hostname4[0] === "[" ? hostname4.slice(1, -1) : hostname4,
|
|
170015
170015
|
hash,
|
|
170016
170016
|
search,
|
|
170017
170017
|
pathname,
|
|
@@ -170070,8 +170070,8 @@ var require_utils12 = __commonJS({
|
|
|
170070
170070
|
}
|
|
170071
170071
|
} else {
|
|
170072
170072
|
optionsParsed = Object.assign({ protocol: options2.host ? "http:" : void 0 }, options2);
|
|
170073
|
-
const
|
|
170074
|
-
origin = `${optionsParsed.protocol || "http:"}//${
|
|
170073
|
+
const hostname4 = optionsParsed.host || (optionsParsed.port != null ? `${optionsParsed.hostname}${optionsParsed.port}` : optionsParsed.hostname);
|
|
170074
|
+
origin = `${optionsParsed.protocol || "http:"}//${hostname4}`;
|
|
170075
170075
|
pathname = options2.pathname;
|
|
170076
170076
|
if (!pathname && optionsParsed.path) {
|
|
170077
170077
|
try {
|
|
@@ -170099,7 +170099,7 @@ var require_utils12 = __commonJS({
|
|
|
170099
170099
|
return { hostname: requestOptions.hostname, port: requestOptions.port };
|
|
170100
170100
|
}
|
|
170101
170101
|
const matches = requestOptions.host?.match(/^([^:/ ]+)(:\d{1,5})?/) || null;
|
|
170102
|
-
const
|
|
170102
|
+
const hostname4 = requestOptions.hostname || (matches === null ? "localhost" : matches[1]);
|
|
170103
170103
|
let port = requestOptions.port;
|
|
170104
170104
|
if (!port) {
|
|
170105
170105
|
if (matches && matches[2]) {
|
|
@@ -170108,11 +170108,11 @@ var require_utils12 = __commonJS({
|
|
|
170108
170108
|
port = requestOptions.protocol === "https:" ? "443" : "80";
|
|
170109
170109
|
}
|
|
170110
170110
|
}
|
|
170111
|
-
return { hostname:
|
|
170111
|
+
return { hostname: hostname4, port };
|
|
170112
170112
|
}, "extractHostnameAndPort");
|
|
170113
170113
|
exports2.extractHostnameAndPort = extractHostnameAndPort;
|
|
170114
170114
|
var getOutgoingRequestAttributes = /* @__PURE__ */ __name((requestOptions, options2, semconvStability, enableSyntheticSourceDetection) => {
|
|
170115
|
-
const
|
|
170115
|
+
const hostname4 = options2.hostname;
|
|
170116
170116
|
const port = options2.port;
|
|
170117
170117
|
const method = requestOptions.method ?? "GET";
|
|
170118
170118
|
const normalizedMethod = normalizeMethod(method);
|
|
@@ -170123,13 +170123,13 @@ var require_utils12 = __commonJS({
|
|
|
170123
170123
|
[semconv_1.ATTR_HTTP_URL]: urlFull,
|
|
170124
170124
|
[semconv_1.ATTR_HTTP_METHOD]: method,
|
|
170125
170125
|
[semconv_1.ATTR_HTTP_TARGET]: requestOptions.path || "/",
|
|
170126
|
-
[semconv_1.ATTR_NET_PEER_NAME]:
|
|
170127
|
-
[semconv_1.ATTR_HTTP_HOST]: headers.host ?? `${
|
|
170126
|
+
[semconv_1.ATTR_NET_PEER_NAME]: hostname4,
|
|
170127
|
+
[semconv_1.ATTR_HTTP_HOST]: headers.host ?? `${hostname4}:${port}`
|
|
170128
170128
|
};
|
|
170129
170129
|
const newAttributes = {
|
|
170130
170130
|
// Required attributes
|
|
170131
170131
|
[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: normalizedMethod,
|
|
170132
|
-
[semantic_conventions_1.ATTR_SERVER_ADDRESS]:
|
|
170132
|
+
[semantic_conventions_1.ATTR_SERVER_ADDRESS]: hostname4,
|
|
170133
170133
|
[semantic_conventions_1.ATTR_SERVER_PORT]: Number(port),
|
|
170134
170134
|
[semantic_conventions_1.ATTR_URL_FULL]: urlFull,
|
|
170135
170135
|
[semantic_conventions_1.ATTR_USER_AGENT_ORIGINAL]: userAgent2
|
|
@@ -170359,7 +170359,7 @@ var require_utils12 = __commonJS({
|
|
|
170359
170359
|
const ips = headers["x-forwarded-for"];
|
|
170360
170360
|
const httpVersion = request4.httpVersion;
|
|
170361
170361
|
const host = headers.host;
|
|
170362
|
-
const
|
|
170362
|
+
const hostname4 = host?.replace(/^(.*)(:[0-9]{1,5})/, "$1") || "localhost";
|
|
170363
170363
|
const method = request4.method;
|
|
170364
170364
|
const normalizedMethod = normalizeMethod(method);
|
|
170365
170365
|
const serverAddress = getServerAddress(request4, options2.component);
|
|
@@ -170396,7 +170396,7 @@ var require_utils12 = __commonJS({
|
|
|
170396
170396
|
const oldAttributes = {
|
|
170397
170397
|
[semconv_1.ATTR_HTTP_URL]: parsedUrl.toString(),
|
|
170398
170398
|
[semconv_1.ATTR_HTTP_HOST]: host,
|
|
170399
|
-
[semconv_1.ATTR_NET_HOST_NAME]:
|
|
170399
|
+
[semconv_1.ATTR_NET_HOST_NAME]: hostname4,
|
|
170400
170400
|
[semconv_1.ATTR_HTTP_METHOD]: method,
|
|
170401
170401
|
[semconv_1.ATTR_HTTP_SCHEME]: options2.component
|
|
170402
170402
|
};
|
|
@@ -170938,11 +170938,11 @@ var require_http = __commonJS({
|
|
|
170938
170938
|
}, true)) {
|
|
170939
170939
|
return original.apply(this, [optionsParsed, ...args]);
|
|
170940
170940
|
}
|
|
170941
|
-
const { hostname:
|
|
170941
|
+
const { hostname: hostname4, port } = (0, utils_1.extractHostnameAndPort)(optionsParsed);
|
|
170942
170942
|
const attributes = (0, utils_1.getOutgoingRequestAttributes)(optionsParsed, {
|
|
170943
170943
|
component,
|
|
170944
170944
|
port,
|
|
170945
|
-
hostname:
|
|
170945
|
+
hostname: hostname4,
|
|
170946
170946
|
hookAttributes: instrumentation._callStartSpanHook(optionsParsed, instrumentation.getConfig().startOutgoingSpanHook)
|
|
170947
170947
|
}, instrumentation._semconvStability, instrumentation.getConfig().enableSyntheticSourceDetection || false);
|
|
170948
170948
|
const startTime = (0, core_1.hrTime)();
|
|
@@ -183115,19 +183115,7 @@ var init_pipeline = __esm({
|
|
|
183115
183115
|
isStreaming
|
|
183116
183116
|
);
|
|
183117
183117
|
if (this.config.cliConfig.getDebugMode()) {
|
|
183118
|
-
|
|
183119
|
-
model: openaiRequest.model,
|
|
183120
|
-
messages: openaiRequest.messages,
|
|
183121
|
-
temperature: openaiRequest.temperature,
|
|
183122
|
-
top_p: openaiRequest.top_p,
|
|
183123
|
-
top_k: openaiRequest["top_k"],
|
|
183124
|
-
repetition_penalty: openaiRequest["repetition_penalty"],
|
|
183125
|
-
max_tokens: openaiRequest["max_tokens"],
|
|
183126
|
-
tools: openaiRequest.tools,
|
|
183127
|
-
stream: openaiRequest.stream,
|
|
183128
|
-
stream_options: openaiRequest.stream_options
|
|
183129
|
-
};
|
|
183130
|
-
console.log(JSON.stringify(cleanParams2, null, 2));
|
|
183118
|
+
console.log(`[OpenAI-Pipeline] API Request: model=${openaiRequest.model}, messages=${openaiRequest.messages?.length || 0}, stream=${openaiRequest.stream || false}`);
|
|
183131
183119
|
}
|
|
183132
183120
|
const result = await executor(openaiRequest, context2);
|
|
183133
183121
|
context2.duration = Date.now() - context2.startTime;
|
|
@@ -184659,7 +184647,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
|
|
|
184659
184647
|
};
|
|
184660
184648
|
}
|
|
184661
184649
|
async function createContentGenerator(config, gcConfig, sessionId2, isInitialAuth) {
|
|
184662
|
-
const version2 = "0.0.28-alpha.
|
|
184650
|
+
const version2 = "0.0.28-alpha.2";
|
|
184663
184651
|
const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
184664
184652
|
const baseHeaders = {
|
|
184665
184653
|
"User-Agent": userAgent2
|
|
@@ -238276,10 +238264,10 @@ var init_google_auth_provider = __esm({
|
|
|
238276
238264
|
"URL must be provided in the config for Google Credentials provider"
|
|
238277
238265
|
);
|
|
238278
238266
|
}
|
|
238279
|
-
const
|
|
238280
|
-
if (!ALLOWED_HOSTS.some((pattern) => pattern.test(
|
|
238267
|
+
const hostname4 = new URL(url2).hostname;
|
|
238268
|
+
if (!ALLOWED_HOSTS.some((pattern) => pattern.test(hostname4))) {
|
|
238281
238269
|
throw new Error(
|
|
238282
|
-
`Host "${
|
|
238270
|
+
`Host "${hostname4}" is not an allowed host for Google Credential provider.`
|
|
238283
238271
|
);
|
|
238284
238272
|
}
|
|
238285
238273
|
const scopes = this.config?.oauth?.scopes;
|
|
@@ -246662,8 +246650,8 @@ var init_html_to_text = __esm({
|
|
|
246662
246650
|
import { URL as URL5 } from "node:url";
|
|
246663
246651
|
function isPrivateIp(url2) {
|
|
246664
246652
|
try {
|
|
246665
|
-
const
|
|
246666
|
-
return PRIVATE_IP_RANGES.some((range) => range.test(
|
|
246653
|
+
const hostname4 = new URL5(url2).hostname;
|
|
246654
|
+
return PRIVATE_IP_RANGES.some((range) => range.test(hostname4));
|
|
246667
246655
|
} catch (_e) {
|
|
246668
246656
|
return false;
|
|
246669
246657
|
}
|
|
@@ -250909,7 +250897,6 @@ __export(apiKeyEncryption_exports, {
|
|
|
250909
250897
|
isEncrypted: () => isEncrypted
|
|
250910
250898
|
});
|
|
250911
250899
|
import * as crypto15 from "node:crypto";
|
|
250912
|
-
import * as os25 from "node:os";
|
|
250913
250900
|
function encryptApiKey(plaintext2) {
|
|
250914
250901
|
if (!plaintext2 || plaintext2.trim() === "") {
|
|
250915
250902
|
return plaintext2;
|
|
@@ -250918,9 +250905,8 @@ function encryptApiKey(plaintext2) {
|
|
|
250918
250905
|
return plaintext2;
|
|
250919
250906
|
}
|
|
250920
250907
|
try {
|
|
250921
|
-
const key = deriveKey();
|
|
250922
250908
|
const iv = crypto15.randomBytes(16);
|
|
250923
|
-
const cipher = crypto15.createCipheriv("aes-256-gcm",
|
|
250909
|
+
const cipher = crypto15.createCipheriv("aes-256-gcm", FIXED_KEY, iv);
|
|
250924
250910
|
let encrypted = cipher.update(plaintext2, "utf8");
|
|
250925
250911
|
encrypted = Buffer.concat([encrypted, cipher.final()]);
|
|
250926
250912
|
const authTag = cipher.getAuthTag();
|
|
@@ -250935,47 +250921,55 @@ function encryptApiKey(plaintext2) {
|
|
|
250935
250921
|
}
|
|
250936
250922
|
function decryptApiKey(ciphertext) {
|
|
250937
250923
|
if (!ciphertext || ciphertext.trim() === "") {
|
|
250924
|
+
console.log("[ApiKeyEncryption] decryptApiKey: \u7A7A\u5B57\u7B26\u4E32\uFF0C\u76F4\u63A5\u8FD4\u56DE");
|
|
250938
250925
|
return ciphertext;
|
|
250939
250926
|
}
|
|
250940
250927
|
if (!ciphertext.startsWith("xhs_enc:")) {
|
|
250928
|
+
console.log("[ApiKeyEncryption] decryptApiKey: \u4E0D\u662F\u52A0\u5BC6\u683C\u5F0F\uFF0C\u76F4\u63A5\u8FD4\u56DE\u660E\u6587");
|
|
250941
250929
|
return ciphertext;
|
|
250942
250930
|
}
|
|
250931
|
+
console.log("[ApiKeyEncryption] decryptApiKey: \u68C0\u6D4B\u5230\u52A0\u5BC6\u683C\u5F0F\uFF0C\u5F00\u59CB\u89E3\u5BC6...");
|
|
250943
250932
|
try {
|
|
250944
250933
|
const parts = ciphertext.substring(8).split(":");
|
|
250945
250934
|
if (parts.length !== 3) {
|
|
250946
|
-
throw new Error(
|
|
250935
|
+
throw new Error(`\u65E0\u6548\u7684\u52A0\u5BC6\u683C\u5F0F: \u671F\u671B3\u90E8\u5206\uFF0C\u5B9E\u9645${parts.length}\u90E8\u5206`);
|
|
250947
250936
|
}
|
|
250948
250937
|
const [ivBase64, authTagBase64, encryptedBase64] = parts;
|
|
250949
250938
|
const iv = Buffer.from(ivBase64, "base64");
|
|
250950
250939
|
const authTag = Buffer.from(authTagBase64, "base64");
|
|
250951
250940
|
const encrypted = Buffer.from(encryptedBase64, "base64");
|
|
250952
|
-
|
|
250953
|
-
const decipher = crypto15.createDecipheriv("aes-256-gcm",
|
|
250941
|
+
console.log("[ApiKeyEncryption] decryptApiKey: Base64 \u89E3\u7801\u6210\u529F");
|
|
250942
|
+
const decipher = crypto15.createDecipheriv("aes-256-gcm", FIXED_KEY, iv);
|
|
250954
250943
|
decipher.setAuthTag(authTag);
|
|
250955
250944
|
let decrypted = decipher.update(encrypted);
|
|
250956
250945
|
decrypted = Buffer.concat([decrypted, decipher.final()]);
|
|
250957
|
-
|
|
250946
|
+
const plaintext2 = decrypted.toString("utf8");
|
|
250947
|
+
console.log(`[ApiKeyEncryption] decryptApiKey: \u2705 \u89E3\u5BC6\u6210\u529F: ${plaintext2.substring(0, 8)}...${plaintext2.slice(-8)}`);
|
|
250948
|
+
return plaintext2;
|
|
250958
250949
|
} catch (error) {
|
|
250959
|
-
console.
|
|
250960
|
-
|
|
250950
|
+
console.error("[ApiKeyEncryption] decryptApiKey: \u274C \u89E3\u5BC6\u5931\u8D25:", error);
|
|
250951
|
+
throw new Error(
|
|
250952
|
+
`API Key \u89E3\u5BC6\u5931\u8D25: ${error instanceof Error ? error.message : String(error)}\u3002\u8BF7\u91CD\u65B0\u8FDB\u884C SSO \u8BA4\u8BC1\u3002`
|
|
250953
|
+
);
|
|
250961
250954
|
}
|
|
250962
250955
|
}
|
|
250963
|
-
function deriveKey() {
|
|
250964
|
-
const hostname5 = os25.hostname();
|
|
250965
|
-
const salt = "rdmind-xhs-sso-api-key-salt-v1";
|
|
250966
|
-
const iterations = 1e5;
|
|
250967
|
-
return crypto15.pbkdf2Sync(hostname5, salt, iterations, 32, "sha256");
|
|
250968
|
-
}
|
|
250969
250956
|
function isEncrypted(value) {
|
|
250970
250957
|
return value.startsWith("xhs_enc:");
|
|
250971
250958
|
}
|
|
250959
|
+
var FIXED_KEY;
|
|
250972
250960
|
var init_apiKeyEncryption = __esm({
|
|
250973
250961
|
"packages/core/src/utils/apiKeyEncryption.ts"() {
|
|
250974
250962
|
"use strict";
|
|
250975
250963
|
init_esbuild_shims();
|
|
250964
|
+
FIXED_KEY = crypto15.pbkdf2Sync(
|
|
250965
|
+
"rdmind-xhs-sso-fixed-key-v1",
|
|
250966
|
+
"rdmind-xhs-sso-salt-v1",
|
|
250967
|
+
1e5,
|
|
250968
|
+
32,
|
|
250969
|
+
"sha256"
|
|
250970
|
+
);
|
|
250976
250971
|
__name(encryptApiKey, "encryptApiKey");
|
|
250977
250972
|
__name(decryptApiKey, "decryptApiKey");
|
|
250978
|
-
__name(deriveKey, "deriveKey");
|
|
250979
250973
|
__name(isEncrypted, "isEncrypted");
|
|
250980
250974
|
}
|
|
250981
250975
|
});
|
|
@@ -258451,7 +258445,7 @@ import * as child_process from "node:child_process";
|
|
|
258451
258445
|
import * as process24 from "node:process";
|
|
258452
258446
|
import * as path61 from "node:path";
|
|
258453
258447
|
import * as fs54 from "node:fs";
|
|
258454
|
-
import * as
|
|
258448
|
+
import * as os25 from "node:os";
|
|
258455
258449
|
function getVsCodeCommand(platform15 = process24.platform) {
|
|
258456
258450
|
return platform15 === "win32" ? "code.cmd" : "code";
|
|
258457
258451
|
}
|
|
@@ -258473,7 +258467,7 @@ async function findVsCodeCommand(platform15 = process24.platform) {
|
|
|
258473
258467
|
} catch {
|
|
258474
258468
|
}
|
|
258475
258469
|
const locations = [];
|
|
258476
|
-
const homeDir =
|
|
258470
|
+
const homeDir = os25.homedir();
|
|
258477
258471
|
if (platform15 === "darwin") {
|
|
258478
258472
|
locations.push(
|
|
258479
258473
|
"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code",
|
|
@@ -258986,8 +258980,8 @@ var init_git_commit = __esm({
|
|
|
258986
258980
|
"packages/core/src/generated/git-commit.ts"() {
|
|
258987
258981
|
"use strict";
|
|
258988
258982
|
init_esbuild_shims();
|
|
258989
|
-
GIT_COMMIT_INFO = "
|
|
258990
|
-
CLI_VERSION = "0.0.28-alpha.
|
|
258983
|
+
GIT_COMMIT_INFO = "6f6a45e";
|
|
258984
|
+
CLI_VERSION = "0.0.28-alpha.2";
|
|
258991
258985
|
}
|
|
258992
258986
|
});
|
|
258993
258987
|
|
|
@@ -266121,7 +266115,7 @@ var require_supports_color = __commonJS({
|
|
|
266121
266115
|
"node_modules/chalk/node_modules/supports-color/index.js"(exports2, module2) {
|
|
266122
266116
|
"use strict";
|
|
266123
266117
|
init_esbuild_shims();
|
|
266124
|
-
var
|
|
266118
|
+
var os48 = __require("os");
|
|
266125
266119
|
var tty3 = __require("tty");
|
|
266126
266120
|
var hasFlag3 = require_has_flag();
|
|
266127
266121
|
var { env: env7 } = process;
|
|
@@ -266170,7 +266164,7 @@ var require_supports_color = __commonJS({
|
|
|
266170
266164
|
return min;
|
|
266171
266165
|
}
|
|
266172
266166
|
if (process.platform === "win32") {
|
|
266173
|
-
const osRelease =
|
|
266167
|
+
const osRelease = os48.release().split(".");
|
|
266174
266168
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
266175
266169
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
266176
266170
|
}
|
|
@@ -269059,7 +269053,7 @@ var require_supports_color2 = __commonJS({
|
|
|
269059
269053
|
"node_modules/supports-hyperlinks/node_modules/supports-color/index.js"(exports2, module2) {
|
|
269060
269054
|
"use strict";
|
|
269061
269055
|
init_esbuild_shims();
|
|
269062
|
-
var
|
|
269056
|
+
var os48 = __require("os");
|
|
269063
269057
|
var tty3 = __require("tty");
|
|
269064
269058
|
var hasFlag3 = require_has_flag();
|
|
269065
269059
|
var { env: env7 } = process;
|
|
@@ -269108,7 +269102,7 @@ var require_supports_color2 = __commonJS({
|
|
|
269108
269102
|
return min;
|
|
269109
269103
|
}
|
|
269110
269104
|
if (process.platform === "win32") {
|
|
269111
|
-
const osRelease =
|
|
269105
|
+
const osRelease = os48.release().split(".");
|
|
269112
269106
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
269113
269107
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
269114
269108
|
}
|
|
@@ -269319,7 +269313,7 @@ var require_main = __commonJS({
|
|
|
269319
269313
|
init_esbuild_shims();
|
|
269320
269314
|
var fs103 = __require("fs");
|
|
269321
269315
|
var path115 = __require("path");
|
|
269322
|
-
var
|
|
269316
|
+
var os48 = __require("os");
|
|
269323
269317
|
var crypto19 = __require("crypto");
|
|
269324
269318
|
var packageJson4 = require_package5();
|
|
269325
269319
|
var version2 = packageJson4.version;
|
|
@@ -269474,7 +269468,7 @@ var require_main = __commonJS({
|
|
|
269474
269468
|
}
|
|
269475
269469
|
__name(_vaultPath, "_vaultPath");
|
|
269476
269470
|
function _resolveHome(envPath) {
|
|
269477
|
-
return envPath[0] === "~" ? path115.join(
|
|
269471
|
+
return envPath[0] === "~" ? path115.join(os48.homedir(), envPath.slice(1)) : envPath;
|
|
269478
269472
|
}
|
|
269479
269473
|
__name(_resolveHome, "_resolveHome");
|
|
269480
269474
|
function _configVault(options2) {
|
|
@@ -286154,7 +286148,7 @@ var require_extract_zip = __commonJS({
|
|
|
286154
286148
|
});
|
|
286155
286149
|
|
|
286156
286150
|
// packages/cli/src/config/extensions/github.ts
|
|
286157
|
-
import * as
|
|
286151
|
+
import * as os28 from "node:os";
|
|
286158
286152
|
import * as https3 from "node:https";
|
|
286159
286153
|
import * as fs71 from "node:fs";
|
|
286160
286154
|
import * as path73 from "node:path";
|
|
@@ -286382,8 +286376,8 @@ async function downloadFromGitHubRelease(installMetadata, destination) {
|
|
|
286382
286376
|
}
|
|
286383
286377
|
}
|
|
286384
286378
|
function findReleaseAsset(assets) {
|
|
286385
|
-
const platform15 =
|
|
286386
|
-
const arch3 =
|
|
286379
|
+
const platform15 = os28.platform();
|
|
286380
|
+
const arch3 = os28.arch();
|
|
286387
286381
|
const platformArchPrefix = `${platform15}.${arch3}.`;
|
|
286388
286382
|
const platformPrefix = `${platform15}.`;
|
|
286389
286383
|
const platformArchAsset = assets.find(
|
|
@@ -286665,10 +286659,10 @@ var init_extensionEnablement = __esm({
|
|
|
286665
286659
|
// packages/cli/src/config/extension.ts
|
|
286666
286660
|
import * as fs73 from "node:fs";
|
|
286667
286661
|
import * as path75 from "node:path";
|
|
286668
|
-
import * as
|
|
286662
|
+
import * as os29 from "node:os";
|
|
286669
286663
|
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
286670
286664
|
function getWorkspaceExtensions(workspaceDir) {
|
|
286671
|
-
if (path75.resolve(workspaceDir) === path75.resolve(
|
|
286665
|
+
if (path75.resolve(workspaceDir) === path75.resolve(os29.homedir())) {
|
|
286672
286666
|
return [];
|
|
286673
286667
|
}
|
|
286674
286668
|
return loadExtensionsFromDir(workspaceDir);
|
|
@@ -286720,7 +286714,7 @@ function loadExtensions(extensionEnablementManager, workspaceDir = process.cwd()
|
|
|
286720
286714
|
return Array.from(uniqueExtensions.values());
|
|
286721
286715
|
}
|
|
286722
286716
|
function loadUserExtensions() {
|
|
286723
|
-
const userExtensions = loadExtensionsFromDir(
|
|
286717
|
+
const userExtensions = loadExtensionsFromDir(os29.homedir());
|
|
286724
286718
|
const uniqueExtensions = /* @__PURE__ */ new Map();
|
|
286725
286719
|
for (const extension of userExtensions) {
|
|
286726
286720
|
if (!uniqueExtensions.has(extension.config.name)) {
|
|
@@ -287082,7 +287076,7 @@ function toOutputString(extension, workspaceDir) {
|
|
|
287082
287076
|
const manager = new ExtensionEnablementManager(
|
|
287083
287077
|
ExtensionStorage.getUserExtensionsDir()
|
|
287084
287078
|
);
|
|
287085
|
-
const userEnabled = manager.isEnabled(extension.config.name,
|
|
287079
|
+
const userEnabled = manager.isEnabled(extension.config.name, os29.homedir());
|
|
287086
287080
|
const workspaceEnabled = manager.isEnabled(
|
|
287087
287081
|
extension.config.name,
|
|
287088
287082
|
workspaceDir
|
|
@@ -287146,7 +287140,7 @@ function disableExtension(name3, scope, cwd7 = process.cwd()) {
|
|
|
287146
287140
|
ExtensionStorage.getUserExtensionsDir(),
|
|
287147
287141
|
[name3]
|
|
287148
287142
|
);
|
|
287149
|
-
const scopePath = scope === "Workspace" /* Workspace */ ? cwd7 :
|
|
287143
|
+
const scopePath = scope === "Workspace" /* Workspace */ ? cwd7 : os29.homedir();
|
|
287150
287144
|
manager.disable(name3, true, scopePath);
|
|
287151
287145
|
logExtensionDisable(config, new ExtensionDisableEvent(name3, scope));
|
|
287152
287146
|
}
|
|
@@ -287161,7 +287155,7 @@ function enableExtension(name3, scope, cwd7 = process.cwd()) {
|
|
|
287161
287155
|
const manager = new ExtensionEnablementManager(
|
|
287162
287156
|
ExtensionStorage.getUserExtensionsDir()
|
|
287163
287157
|
);
|
|
287164
|
-
const scopePath = scope === "Workspace" /* Workspace */ ? cwd7 :
|
|
287158
|
+
const scopePath = scope === "Workspace" /* Workspace */ ? cwd7 : os29.homedir();
|
|
287165
287159
|
manager.enable(name3, true, scopePath);
|
|
287166
287160
|
const config = getTelemetryConfig(cwd7);
|
|
287167
287161
|
logExtensionEnable(config, new ExtensionEnableEvent(name3, scope));
|
|
@@ -287201,12 +287195,12 @@ var init_extension = __esm({
|
|
|
287201
287195
|
return path75.join(this.getExtensionDir(), EXTENSIONS_CONFIG_FILENAME);
|
|
287202
287196
|
}
|
|
287203
287197
|
static getUserExtensionsDir() {
|
|
287204
|
-
const storage = new Storage(
|
|
287198
|
+
const storage = new Storage(os29.homedir());
|
|
287205
287199
|
return storage.getExtensionsDir();
|
|
287206
287200
|
}
|
|
287207
287201
|
static async createTmpDir() {
|
|
287208
287202
|
return await fs73.promises.mkdtemp(
|
|
287209
|
-
path75.join(
|
|
287203
|
+
path75.join(os29.tmpdir(), "rdmind-extension")
|
|
287210
287204
|
);
|
|
287211
287205
|
}
|
|
287212
287206
|
};
|
|
@@ -294052,7 +294046,9 @@ async function resolveXhsSsoRuntimeConfig(config, settings) {
|
|
|
294052
294046
|
);
|
|
294053
294047
|
}
|
|
294054
294048
|
}
|
|
294049
|
+
console.log(`[XhsSsoConfig] resolveXhsSsoRuntimeConfig: apiKey=${apiKey ? apiKey.startsWith("xhs_enc:") ? "xhs_enc:..." : `${apiKey.substring(0, 8)}...` : "empty"}`);
|
|
294055
294050
|
const decryptedApiKey = decryptApiKey(apiKey);
|
|
294051
|
+
console.log(`[XhsSsoConfig] resolveXhsSsoRuntimeConfig: \u89E3\u5BC6\u540E=${decryptedApiKey.startsWith("xhs_enc:") ? "\u274C \u4ECD\u662F\u52A0\u5BC6\u683C\u5F0F" : "\u2705 \u89E3\u5BC6\u6210\u529F"}`);
|
|
294056
294052
|
return {
|
|
294057
294053
|
apiKey: decryptedApiKey,
|
|
294058
294054
|
baseUrl,
|
|
@@ -294067,7 +294063,9 @@ async function applyXhsSsoConfig(config, settings, options2 = {}) {
|
|
|
294067
294063
|
if (!apiKey || apiKey.trim() === "") {
|
|
294068
294064
|
throw new Error("\u7F3A\u5C11\u5C0F\u7EA2\u4E66 SSO API Key\uFF0C\u8BF7\u5148\u5B8C\u6210 SSO \u8BA4\u8BC1\u3002");
|
|
294069
294065
|
}
|
|
294066
|
+
console.log(`[XhsSsoConfig] applyXhsSsoConfig: apiKey=${apiKey ? apiKey.startsWith("xhs_enc:") ? "xhs_enc:..." : `${apiKey.substring(0, 8)}...` : "empty"}`);
|
|
294070
294067
|
const decryptedApiKey = decryptApiKey(apiKey);
|
|
294068
|
+
console.log(`[XhsSsoConfig] applyXhsSsoConfig: \u89E3\u5BC6\u540E=${decryptedApiKey.startsWith("xhs_enc:") ? "\u274C \u4ECD\u662F\u52A0\u5BC6\u683C\u5F0F" : "\u2705 \u89E3\u5BC6\u6210\u529F"}`);
|
|
294071
294069
|
const encryptedApiKey = encryptApiKey(decryptedApiKey);
|
|
294072
294070
|
settings.setValue(scope, "security.auth.selectedType", "xhs-sso" /* XHS_SSO */);
|
|
294073
294071
|
settings.setValue(scope, "security.auth.baseUrl", baseUrl);
|
|
@@ -299654,9 +299652,9 @@ var require_defaults3 = __commonJS({
|
|
|
299654
299652
|
"node_modules/@pnpm/npm-conf/lib/defaults.js"(exports2) {
|
|
299655
299653
|
"use strict";
|
|
299656
299654
|
init_esbuild_shims();
|
|
299657
|
-
var
|
|
299655
|
+
var os48 = __require("os");
|
|
299658
299656
|
var path115 = __require("path");
|
|
299659
|
-
var temp =
|
|
299657
|
+
var temp = os48.tmpdir();
|
|
299660
299658
|
var uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
299661
299659
|
var hasUnicode = /* @__PURE__ */ __name(() => true, "hasUnicode");
|
|
299662
299660
|
var isWindows8 = process.platform === "win32";
|
|
@@ -299667,7 +299665,7 @@ var require_defaults3 = __commonJS({
|
|
|
299667
299665
|
var umask = {
|
|
299668
299666
|
fromString: /* @__PURE__ */ __name(() => process.umask(), "fromString")
|
|
299669
299667
|
};
|
|
299670
|
-
var home =
|
|
299668
|
+
var home = os48.homedir();
|
|
299671
299669
|
if (home) {
|
|
299672
299670
|
process.env.HOME = home;
|
|
299673
299671
|
} else {
|
|
@@ -301789,6 +301787,21 @@ var require_ansi_align = __commonJS({
|
|
|
301789
301787
|
}
|
|
301790
301788
|
});
|
|
301791
301789
|
|
|
301790
|
+
// packages/cli/src/utils/l4SensitiveRepositories.ts
|
|
301791
|
+
var L4_SENSITIVE_REPOSITORIES;
|
|
301792
|
+
var init_l4SensitiveRepositories = __esm({
|
|
301793
|
+
"packages/cli/src/utils/l4SensitiveRepositories.ts"() {
|
|
301794
|
+
"use strict";
|
|
301795
|
+
init_esbuild_shims();
|
|
301796
|
+
L4_SENSITIVE_REPOSITORIES = [
|
|
301797
|
+
// 可以在这里添加敏感仓库地址
|
|
301798
|
+
// 例如:
|
|
301799
|
+
// 'git@code.devops.xiaohongshu.com:sns/rdmind.git',
|
|
301800
|
+
// 'git@code.devops.xiaohongshu.com:aikit/rdmind.git',
|
|
301801
|
+
];
|
|
301802
|
+
}
|
|
301803
|
+
});
|
|
301804
|
+
|
|
301792
301805
|
// packages/cli/src/utils/l4RepositoryAutoSwitch.ts
|
|
301793
301806
|
var l4RepositoryAutoSwitch_exports = {};
|
|
301794
301807
|
__export(l4RepositoryAutoSwitch_exports, {
|
|
@@ -301804,7 +301817,7 @@ function isL4Repository(workspaceRoot) {
|
|
|
301804
301817
|
if (!remoteUrl) {
|
|
301805
301818
|
return false;
|
|
301806
301819
|
}
|
|
301807
|
-
const isMatch =
|
|
301820
|
+
const isMatch = L4_SENSITIVE_REPOSITORIES.some(
|
|
301808
301821
|
(repo) => remoteUrl.includes(repo) || repo.includes(remoteUrl)
|
|
301809
301822
|
);
|
|
301810
301823
|
if (process.env["DEBUG"] || process.env["RDMIND_DEBUG"]) {
|
|
@@ -301853,7 +301866,6 @@ async function autoSwitchToQSModel(config, settings) {
|
|
|
301853
301866
|
});
|
|
301854
301867
|
}
|
|
301855
301868
|
}
|
|
301856
|
-
var L4_SENSITIVE_REPOSITORIES2;
|
|
301857
301869
|
var init_l4RepositoryAutoSwitch = __esm({
|
|
301858
301870
|
"packages/cli/src/utils/l4RepositoryAutoSwitch.ts"() {
|
|
301859
301871
|
"use strict";
|
|
@@ -301861,10 +301873,7 @@ var init_l4RepositoryAutoSwitch = __esm({
|
|
|
301861
301873
|
init_core2();
|
|
301862
301874
|
init_core2();
|
|
301863
301875
|
init_xhsSsoConfig();
|
|
301864
|
-
|
|
301865
|
-
"git@code.devops.xiaohongshu.com:aikit/rdmind.git"
|
|
301866
|
-
// 可以在这里添加更多敏感仓库地址
|
|
301867
|
-
];
|
|
301876
|
+
init_l4SensitiveRepositories();
|
|
301868
301877
|
__name(isL4Repository, "isL4Repository");
|
|
301869
301878
|
__name(autoSwitchToQSModel, "autoSwitchToQSModel");
|
|
301870
301879
|
}
|
|
@@ -310544,7 +310553,7 @@ var QwenDark = new Theme(
|
|
|
310544
310553
|
init_theme();
|
|
310545
310554
|
import * as fs57 from "node:fs";
|
|
310546
310555
|
import * as path64 from "node:path";
|
|
310547
|
-
import * as
|
|
310556
|
+
import * as os26 from "node:os";
|
|
310548
310557
|
|
|
310549
310558
|
// packages/cli/src/ui/themes/ansi.ts
|
|
310550
310559
|
init_esbuild_shims();
|
|
@@ -311189,7 +311198,7 @@ var ThemeManager = class {
|
|
|
311189
311198
|
if (this.customThemes.has(canonicalPath)) {
|
|
311190
311199
|
return this.customThemes.get(canonicalPath);
|
|
311191
311200
|
}
|
|
311192
|
-
const homeDir = path64.resolve(
|
|
311201
|
+
const homeDir = path64.resolve(os26.homedir());
|
|
311193
311202
|
if (!canonicalPath.startsWith(homeDir)) {
|
|
311194
311203
|
console.warn(
|
|
311195
311204
|
`Theme file at "${themePath}" is outside your home directory. Only load themes from trusted sources.`
|
|
@@ -328134,7 +328143,7 @@ var import_react45 = __toESM(require_react(), 1);
|
|
|
328134
328143
|
init_core2();
|
|
328135
328144
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
328136
328145
|
import fs58 from "node:fs";
|
|
328137
|
-
import
|
|
328146
|
+
import os27 from "node:os";
|
|
328138
328147
|
import pathMod from "node:path";
|
|
328139
328148
|
|
|
328140
328149
|
// packages/cli/src/ui/components/shared/vim-buffer-actions.ts
|
|
@@ -329967,7 +329976,7 @@ function useTextBuffer({
|
|
|
329967
329976
|
const openInExternalEditor = (0, import_react45.useCallback)(
|
|
329968
329977
|
async (opts = {}) => {
|
|
329969
329978
|
const editor = opts.editor ?? process.env["VISUAL"] ?? process.env["EDITOR"] ?? (process.platform === "win32" ? "notepad" : "vi");
|
|
329970
|
-
const tmpDir = fs58.mkdtempSync(pathMod.join(
|
|
329979
|
+
const tmpDir = fs58.mkdtempSync(pathMod.join(os27.tmpdir(), "gemini-edit-"));
|
|
329971
329980
|
const filePath = pathMod.join(tmpDir, "buffer.txt");
|
|
329972
329981
|
fs58.writeFileSync(filePath, text, "utf8");
|
|
329973
329982
|
dispatch({ type: "create_undo_snapshot" });
|
|
@@ -347319,7 +347328,7 @@ import { homedir as homedir19 } from "node:os";
|
|
|
347319
347328
|
|
|
347320
347329
|
// packages/cli/src/utils/resolvePath.ts
|
|
347321
347330
|
init_esbuild_shims();
|
|
347322
|
-
import * as
|
|
347331
|
+
import * as os30 from "node:os";
|
|
347323
347332
|
import * as path80 from "node:path";
|
|
347324
347333
|
function resolvePath2(p) {
|
|
347325
347334
|
if (!p) {
|
|
@@ -347327,9 +347336,9 @@ function resolvePath2(p) {
|
|
|
347327
347336
|
}
|
|
347328
347337
|
let expandedPath = p;
|
|
347329
347338
|
if (p.toLowerCase().startsWith("%userprofile%")) {
|
|
347330
|
-
expandedPath =
|
|
347339
|
+
expandedPath = os30.homedir() + p.substring("%userprofile%".length);
|
|
347331
347340
|
} else if (p === "~" || p.startsWith("~/")) {
|
|
347332
|
-
expandedPath =
|
|
347341
|
+
expandedPath = os30.homedir() + p.substring(1);
|
|
347333
347342
|
}
|
|
347334
347343
|
return path80.normalize(expandedPath);
|
|
347335
347344
|
}
|
|
@@ -347569,7 +347578,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
347569
347578
|
// packages/cli/src/utils/version.ts
|
|
347570
347579
|
async function getCliVersion() {
|
|
347571
347580
|
const pkgJson = await getPackageJson();
|
|
347572
|
-
return "0.0.28-alpha.
|
|
347581
|
+
return "0.0.28-alpha.2";
|
|
347573
347582
|
}
|
|
347574
347583
|
__name(getCliVersion, "getCliVersion");
|
|
347575
347584
|
|
|
@@ -347580,7 +347589,7 @@ init_extension();
|
|
|
347580
347589
|
init_esbuild_shims();
|
|
347581
347590
|
init_core2();
|
|
347582
347591
|
var import_command_exists = __toESM(require_command_exists2(), 1);
|
|
347583
|
-
import * as
|
|
347592
|
+
import * as os31 from "node:os";
|
|
347584
347593
|
var VALID_SANDBOX_COMMANDS = [
|
|
347585
347594
|
"docker",
|
|
347586
347595
|
"podman",
|
|
@@ -347616,7 +347625,7 @@ function getSandboxCommand(sandbox) {
|
|
|
347616
347625
|
`Missing sandbox command '${sandbox}' (from GEMINI_SANDBOX)`
|
|
347617
347626
|
);
|
|
347618
347627
|
}
|
|
347619
|
-
if (
|
|
347628
|
+
if (os31.platform() === "darwin" && import_command_exists.default.sync("sandbox-exec")) {
|
|
347620
347629
|
return "sandbox-exec";
|
|
347621
347630
|
} else if (import_command_exists.default.sync("docker") && sandbox === true) {
|
|
347622
347631
|
return "docker";
|
|
@@ -348528,7 +348537,7 @@ async function loadCliConfig(settings, extensions, extensionEnablementManager, s
|
|
|
348528
348537
|
model: resolvedModel,
|
|
348529
348538
|
apiKey: (() => {
|
|
348530
348539
|
const rawApiKey = argv.openaiApiKey || (isXhsSso ? settings.security?.auth?.apiKey || process.env["OPENAI_API_KEY"] : process.env["OPENAI_API_KEY"] || settings.security?.auth?.apiKey);
|
|
348531
|
-
if (rawApiKey &&
|
|
348540
|
+
if (rawApiKey && rawApiKey.startsWith("xhs_enc:")) {
|
|
348532
348541
|
return decryptApiKey(rawApiKey);
|
|
348533
348542
|
}
|
|
348534
348543
|
return rawApiKey;
|
|
@@ -349876,13 +349885,13 @@ init_esbuild_shims();
|
|
|
349876
349885
|
// packages/cli/src/utils/systemInfo.ts
|
|
349877
349886
|
init_esbuild_shims();
|
|
349878
349887
|
import process35 from "node:process";
|
|
349879
|
-
import
|
|
349888
|
+
import os32 from "node:os";
|
|
349880
349889
|
import { execSync as execSync5 } from "node:child_process";
|
|
349881
349890
|
init_core2();
|
|
349882
349891
|
|
|
349883
349892
|
// packages/cli/src/generated/git-commit.ts
|
|
349884
349893
|
init_esbuild_shims();
|
|
349885
|
-
var GIT_COMMIT_INFO2 = "
|
|
349894
|
+
var GIT_COMMIT_INFO2 = "6f6a45e";
|
|
349886
349895
|
|
|
349887
349896
|
// packages/cli/src/utils/systemInfo.ts
|
|
349888
349897
|
async function getNpmVersion() {
|
|
@@ -349923,7 +349932,7 @@ __name(getSandboxEnv, "getSandboxEnv");
|
|
|
349923
349932
|
async function getSystemInfo(context2) {
|
|
349924
349933
|
const osPlatform = process35.platform;
|
|
349925
349934
|
const osArch = process35.arch;
|
|
349926
|
-
const osRelease =
|
|
349935
|
+
const osRelease = os32.release();
|
|
349927
349936
|
const nodeVersion2 = process35.version;
|
|
349928
349937
|
const npmVersion = await getNpmVersion();
|
|
349929
349938
|
const sandboxEnv = getSandboxEnv();
|
|
@@ -351332,7 +351341,7 @@ ${docsUrl}`
|
|
|
351332
351341
|
// packages/cli/src/ui/commands/directoryCommand.tsx
|
|
351333
351342
|
init_esbuild_shims();
|
|
351334
351343
|
init_core2();
|
|
351335
|
-
import * as
|
|
351344
|
+
import * as os33 from "node:os";
|
|
351336
351345
|
import * as path88 from "node:path";
|
|
351337
351346
|
import * as fs80 from "node:fs/promises";
|
|
351338
351347
|
function expandHomeDir(p) {
|
|
@@ -351341,9 +351350,9 @@ function expandHomeDir(p) {
|
|
|
351341
351350
|
}
|
|
351342
351351
|
let expandedPath = p;
|
|
351343
351352
|
if (p.toLowerCase().startsWith("%userprofile%")) {
|
|
351344
|
-
expandedPath =
|
|
351353
|
+
expandedPath = os33.homedir() + p.substring("%userprofile%".length);
|
|
351345
351354
|
} else if (p === "~" || p.startsWith("~/")) {
|
|
351346
|
-
expandedPath =
|
|
351355
|
+
expandedPath = os33.homedir() + p.substring(1);
|
|
351347
351356
|
}
|
|
351348
351357
|
return path88.normalize(expandedPath);
|
|
351349
351358
|
}
|
|
@@ -351604,7 +351613,7 @@ async function resolveCompletionPaths(partialPath, baseDir) {
|
|
|
351604
351613
|
resolvedPath = baseDir;
|
|
351605
351614
|
displayPrefix = "";
|
|
351606
351615
|
} else if (partialPath.startsWith("~")) {
|
|
351607
|
-
resolvedPath = path88.join(
|
|
351616
|
+
resolvedPath = path88.join(os33.homedir(), partialPath.slice(1));
|
|
351608
351617
|
} else {
|
|
351609
351618
|
resolvedPath = path88.isAbsolute(partialPath) ? path88.resolve(partialPath || "/") : path88.resolve(baseDir, partialPath || ".");
|
|
351610
351619
|
}
|
|
@@ -353170,7 +353179,7 @@ var mcpCommand2 = {
|
|
|
353170
353179
|
init_esbuild_shims();
|
|
353171
353180
|
init_core2();
|
|
353172
353181
|
import path91 from "node:path";
|
|
353173
|
-
import
|
|
353182
|
+
import os34 from "os";
|
|
353174
353183
|
import fs82 from "fs/promises";
|
|
353175
353184
|
var memoryCommand = {
|
|
353176
353185
|
name: "memory",
|
|
@@ -353239,7 +353248,7 @@ ${memoryContent}
|
|
|
353239
353248
|
action: /* @__PURE__ */ __name(async (context2) => {
|
|
353240
353249
|
try {
|
|
353241
353250
|
const globalMemoryPath = path91.join(
|
|
353242
|
-
|
|
353251
|
+
os34.homedir(),
|
|
353243
353252
|
QWEN_DIR5,
|
|
353244
353253
|
"RDMind.md"
|
|
353245
353254
|
);
|
|
@@ -355222,7 +355231,7 @@ init_esbuild_shims();
|
|
|
355222
355231
|
// packages/cli/src/ui/utils/terminalSetup.ts
|
|
355223
355232
|
init_esbuild_shims();
|
|
355224
355233
|
import { promises as fs86 } from "node:fs";
|
|
355225
|
-
import * as
|
|
355234
|
+
import * as os35 from "node:os";
|
|
355226
355235
|
import * as path96 from "node:path";
|
|
355227
355236
|
import { exec as exec3 } from "node:child_process";
|
|
355228
355237
|
import { promisify as promisify7 } from "node:util";
|
|
@@ -355329,7 +355338,7 @@ async function detectTerminal() {
|
|
|
355329
355338
|
if (termProgram === "vscode" || process.env["VSCODE_GIT_IPC_HANDLE"]) {
|
|
355330
355339
|
return "vscode";
|
|
355331
355340
|
}
|
|
355332
|
-
if (
|
|
355341
|
+
if (os35.platform() !== "win32") {
|
|
355333
355342
|
try {
|
|
355334
355343
|
const { stdout } = await execAsync2("ps -o comm= -p $PPID");
|
|
355335
355344
|
const parentName = stdout.trim();
|
|
@@ -355359,10 +355368,10 @@ async function backupFile(filePath) {
|
|
|
355359
355368
|
}
|
|
355360
355369
|
__name(backupFile, "backupFile");
|
|
355361
355370
|
function getVSCodeStyleConfigDir(appName) {
|
|
355362
|
-
const platform15 =
|
|
355371
|
+
const platform15 = os35.platform();
|
|
355363
355372
|
if (platform15 === "darwin") {
|
|
355364
355373
|
return path96.join(
|
|
355365
|
-
|
|
355374
|
+
os35.homedir(),
|
|
355366
355375
|
"Library",
|
|
355367
355376
|
"Application Support",
|
|
355368
355377
|
appName,
|
|
@@ -355374,7 +355383,7 @@ function getVSCodeStyleConfigDir(appName) {
|
|
|
355374
355383
|
}
|
|
355375
355384
|
return path96.join(process.env["APPDATA"], appName, "User");
|
|
355376
355385
|
} else {
|
|
355377
|
-
return path96.join(
|
|
355386
|
+
return path96.join(os35.homedir(), ".config", appName, "User");
|
|
355378
355387
|
}
|
|
355379
355388
|
}
|
|
355380
355389
|
__name(getVSCodeStyleConfigDir, "getVSCodeStyleConfigDir");
|
|
@@ -357075,7 +357084,7 @@ var import_react113 = __toESM(require_react(), 1);
|
|
|
357075
357084
|
init_core2();
|
|
357076
357085
|
import crypto18 from "node:crypto";
|
|
357077
357086
|
import path98 from "node:path";
|
|
357078
|
-
import
|
|
357087
|
+
import os36 from "node:os";
|
|
357079
357088
|
import fs88 from "node:fs";
|
|
357080
357089
|
var OUTPUT_UPDATE_INTERVAL_MS2 = 1e3;
|
|
357081
357090
|
var MAX_OUTPUT_LENGTH = 1e4;
|
|
@@ -357112,14 +357121,14 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
|
|
|
357112
357121
|
{ type: "user_shell", text: rawQuery },
|
|
357113
357122
|
userMessageTimestamp
|
|
357114
357123
|
);
|
|
357115
|
-
const isWindows8 =
|
|
357124
|
+
const isWindows8 = os36.platform() === "win32";
|
|
357116
357125
|
const targetDir = config.getTargetDir();
|
|
357117
357126
|
let commandToExecute = rawQuery;
|
|
357118
357127
|
let pwdFilePath;
|
|
357119
357128
|
if (!isWindows8) {
|
|
357120
357129
|
let command2 = rawQuery.trim();
|
|
357121
357130
|
const pwdFileName = `shell_pwd_${crypto18.randomBytes(6).toString("hex")}.tmp`;
|
|
357122
|
-
pwdFilePath = path98.join(
|
|
357131
|
+
pwdFilePath = path98.join(os36.tmpdir(), pwdFileName);
|
|
357123
357132
|
if (!command2.endsWith(";") && !command2.endsWith("&")) {
|
|
357124
357133
|
command2 += ";";
|
|
357125
357134
|
}
|
|
@@ -360041,13 +360050,13 @@ import { format as format3 } from "node:util";
|
|
|
360041
360050
|
init_esbuild_shims();
|
|
360042
360051
|
var import_graceful_fs = __toESM(require_graceful_fs(), 1);
|
|
360043
360052
|
import path104 from "node:path";
|
|
360044
|
-
import
|
|
360053
|
+
import os39 from "node:os";
|
|
360045
360054
|
|
|
360046
360055
|
// node_modules/xdg-basedir/index.js
|
|
360047
360056
|
init_esbuild_shims();
|
|
360048
|
-
import
|
|
360057
|
+
import os37 from "os";
|
|
360049
360058
|
import path101 from "path";
|
|
360050
|
-
var homeDirectory =
|
|
360059
|
+
var homeDirectory = os37.homedir();
|
|
360051
360060
|
var { env: env5 } = process;
|
|
360052
360061
|
var xdgData = env5.XDG_DATA_HOME || (homeDirectory ? path101.join(homeDirectory, ".local", "share") : void 0);
|
|
360053
360062
|
var xdgConfig = env5.XDG_CONFIG_HOME || (homeDirectory ? path101.join(homeDirectory, ".config") : void 0);
|
|
@@ -360282,14 +360291,14 @@ var dist_default6 = FS;
|
|
|
360282
360291
|
|
|
360283
360292
|
// node_modules/atomically/dist/constants.js
|
|
360284
360293
|
init_esbuild_shims();
|
|
360285
|
-
import
|
|
360294
|
+
import os38 from "node:os";
|
|
360286
360295
|
import process40 from "node:process";
|
|
360287
360296
|
var DEFAULT_ENCODING2 = "utf8";
|
|
360288
360297
|
var DEFAULT_FILE_MODE = 438;
|
|
360289
360298
|
var DEFAULT_FOLDER_MODE = 511;
|
|
360290
360299
|
var DEFAULT_WRITE_OPTIONS = {};
|
|
360291
|
-
var DEFAULT_USER_UID =
|
|
360292
|
-
var DEFAULT_USER_GID =
|
|
360300
|
+
var DEFAULT_USER_UID = os38.userInfo().uid;
|
|
360301
|
+
var DEFAULT_USER_GID = os38.userInfo().gid;
|
|
360293
360302
|
var DEFAULT_TIMEOUT_SYNC = 1e3;
|
|
360294
360303
|
var IS_POSIX = !!process40.getuid;
|
|
360295
360304
|
var IS_USER_ROOT2 = process40.getuid ? !process40.getuid() : false;
|
|
@@ -360742,7 +360751,7 @@ __name(hasProperty, "hasProperty");
|
|
|
360742
360751
|
// node_modules/configstore/index.js
|
|
360743
360752
|
function getConfigDirectory(id, globalConfigPath) {
|
|
360744
360753
|
const pathPrefix = globalConfigPath ? path104.join(id, "config.json") : path104.join("configstore", `${id}.json`);
|
|
360745
|
-
const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(
|
|
360754
|
+
const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(os39.tmpdir()) + path104.sep);
|
|
360746
360755
|
return path104.join(configDirectory, pathPrefix);
|
|
360747
360756
|
}
|
|
360748
360757
|
__name(getConfigDirectory, "getConfigDirectory");
|
|
@@ -361021,7 +361030,7 @@ var ansi_styles_default6 = ansiStyles6;
|
|
|
361021
361030
|
// node_modules/update-notifier/node_modules/chalk/source/vendor/supports-color/index.js
|
|
361022
361031
|
init_esbuild_shims();
|
|
361023
361032
|
import process43 from "node:process";
|
|
361024
|
-
import
|
|
361033
|
+
import os40 from "node:os";
|
|
361025
361034
|
import tty2 from "node:tty";
|
|
361026
361035
|
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process43.argv) {
|
|
361027
361036
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -361089,7 +361098,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
361089
361098
|
return min;
|
|
361090
361099
|
}
|
|
361091
361100
|
if (process43.platform === "win32") {
|
|
361092
|
-
const osRelease =
|
|
361101
|
+
const osRelease = os40.release().split(".");
|
|
361093
361102
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
361094
361103
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
361095
361104
|
}
|
|
@@ -362086,7 +362095,7 @@ init_esbuild_shims();
|
|
|
362086
362095
|
var import_ini2 = __toESM(require_ini3(), 1);
|
|
362087
362096
|
import process45 from "node:process";
|
|
362088
362097
|
import path105 from "node:path";
|
|
362089
|
-
import
|
|
362098
|
+
import os41 from "node:os";
|
|
362090
362099
|
import fs93 from "node:fs";
|
|
362091
362100
|
var isWindows7 = process45.platform === "win32";
|
|
362092
362101
|
var readRc = /* @__PURE__ */ __name((filePath) => {
|
|
@@ -362121,7 +362130,7 @@ var getNpmPrefix = /* @__PURE__ */ __name(() => {
|
|
|
362121
362130
|
if (envPrefix) {
|
|
362122
362131
|
return envPrefix;
|
|
362123
362132
|
}
|
|
362124
|
-
const homePrefix = readRc(path105.join(
|
|
362133
|
+
const homePrefix = readRc(path105.join(os41.homedir(), ".npmrc"));
|
|
362125
362134
|
if (homePrefix) {
|
|
362126
362135
|
return homePrefix;
|
|
362127
362136
|
}
|
|
@@ -362152,11 +362161,11 @@ var getYarnPrefix = /* @__PURE__ */ __name(() => {
|
|
|
362152
362161
|
if (windowsPrefix) {
|
|
362153
362162
|
return windowsPrefix;
|
|
362154
362163
|
}
|
|
362155
|
-
const configPrefix = path105.join(
|
|
362164
|
+
const configPrefix = path105.join(os41.homedir(), ".config/yarn");
|
|
362156
362165
|
if (fs93.existsSync(configPrefix)) {
|
|
362157
362166
|
return configPrefix;
|
|
362158
362167
|
}
|
|
362159
|
-
const homePrefix = path105.join(
|
|
362168
|
+
const homePrefix = path105.join(os41.homedir(), ".yarn-config");
|
|
362160
362169
|
if (fs93.existsSync(homePrefix)) {
|
|
362161
362170
|
return homePrefix;
|
|
362162
362171
|
}
|
|
@@ -363770,7 +363779,7 @@ init_esbuild_shims();
|
|
|
363770
363779
|
init_wrapper();
|
|
363771
363780
|
import * as fs97 from "node:fs";
|
|
363772
363781
|
import * as path111 from "node:path";
|
|
363773
|
-
import * as
|
|
363782
|
+
import * as os42 from "node:os";
|
|
363774
363783
|
init_core2();
|
|
363775
363784
|
var WebSocketClient = class {
|
|
363776
363785
|
// 服务端下发的 socketId
|
|
@@ -363989,7 +363998,7 @@ var WebSocketClient = class {
|
|
|
363989
363998
|
}
|
|
363990
363999
|
}
|
|
363991
364000
|
handleCreateFile(filename, content, subPath) {
|
|
363992
|
-
const rdmindDir = path111.join(
|
|
364001
|
+
const rdmindDir = path111.join(os42.homedir(), ".rdmind");
|
|
363993
364002
|
const targetDir = subPath ? path111.join(rdmindDir, subPath) : rdmindDir;
|
|
363994
364003
|
const filePath = path111.join(targetDir, filename);
|
|
363995
364004
|
try {
|
|
@@ -364004,7 +364013,7 @@ var WebSocketClient = class {
|
|
|
364004
364013
|
}
|
|
364005
364014
|
}
|
|
364006
364015
|
handleDeleteFile(filename, subPath) {
|
|
364007
|
-
const rdmindDir = path111.join(
|
|
364016
|
+
const rdmindDir = path111.join(os42.homedir(), ".rdmind");
|
|
364008
364017
|
const targetDir = subPath ? path111.join(rdmindDir, subPath) : rdmindDir;
|
|
364009
364018
|
const filePath = path111.join(targetDir, filename);
|
|
364010
364019
|
try {
|
|
@@ -364114,7 +364123,7 @@ var WebSocketClient = class {
|
|
|
364114
364123
|
|
|
364115
364124
|
// packages/cli/src/ui/hooks/useWebSocket.ts
|
|
364116
364125
|
init_core2();
|
|
364117
|
-
import * as
|
|
364126
|
+
import * as os43 from "node:os";
|
|
364118
364127
|
function getRdmindSsoId3() {
|
|
364119
364128
|
try {
|
|
364120
364129
|
const creds = readSSOCredentialsSync();
|
|
@@ -364145,7 +364154,7 @@ function useWebSocket({ onReloadCommands, debug: debug2 }) {
|
|
|
364145
364154
|
const registrationPayload = {
|
|
364146
364155
|
type: "auth",
|
|
364147
364156
|
deviceId: sessionId,
|
|
364148
|
-
deviceName:
|
|
364157
|
+
deviceName: os43.hostname?.() || "unknown-host",
|
|
364149
364158
|
deviceType: "rdmind-cli"
|
|
364150
364159
|
};
|
|
364151
364160
|
if (rdmindSsoId) {
|
|
@@ -365509,7 +365518,7 @@ __name(readStdin, "readStdin");
|
|
|
365509
365518
|
// packages/cli/src/gemini.tsx
|
|
365510
365519
|
import { basename as basename16 } from "node:path";
|
|
365511
365520
|
import v8 from "node:v8";
|
|
365512
|
-
import
|
|
365521
|
+
import os47 from "node:os";
|
|
365513
365522
|
import dns from "node:dns";
|
|
365514
365523
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
365515
365524
|
|
|
@@ -365519,7 +365528,7 @@ var import_shell_quote5 = __toESM(require_shell_quote(), 1);
|
|
|
365519
365528
|
init_settings();
|
|
365520
365529
|
init_core2();
|
|
365521
365530
|
import { exec as exec4, execSync as execSync7, spawn as spawn11 } from "node:child_process";
|
|
365522
|
-
import
|
|
365531
|
+
import os44 from "node:os";
|
|
365523
365532
|
import path112 from "node:path";
|
|
365524
365533
|
import fs99 from "node:fs";
|
|
365525
365534
|
import { readFile as readFile11 } from "node:fs/promises";
|
|
@@ -365528,7 +365537,7 @@ import { promisify as promisify9 } from "node:util";
|
|
|
365528
365537
|
import { randomBytes as randomBytes6 } from "node:crypto";
|
|
365529
365538
|
var execAsync3 = promisify9(exec4);
|
|
365530
365539
|
function getContainerPath(hostPath) {
|
|
365531
|
-
if (
|
|
365540
|
+
if (os44.platform() !== "win32") {
|
|
365532
365541
|
return hostPath;
|
|
365533
365542
|
}
|
|
365534
365543
|
const withForwardSlashes = hostPath.replace(/\\/g, "/");
|
|
@@ -365558,7 +365567,7 @@ async function shouldUseCurrentUserInSandbox() {
|
|
|
365558
365567
|
if (envVar === "0" || envVar === "false") {
|
|
365559
365568
|
return false;
|
|
365560
365569
|
}
|
|
365561
|
-
if (
|
|
365570
|
+
if (os44.platform() === "linux") {
|
|
365562
365571
|
try {
|
|
365563
365572
|
const osReleaseContent = await readFile11("/etc/os-release", "utf8");
|
|
365564
365573
|
if (osReleaseContent.includes("ID=debian") || osReleaseContent.includes("ID=ubuntu") || osReleaseContent.match(/^ID_LIKE=.*debian.*/m) || // Covers derivatives
|
|
@@ -365588,7 +365597,7 @@ function ports() {
|
|
|
365588
365597
|
}
|
|
365589
365598
|
__name(ports, "ports");
|
|
365590
365599
|
function entrypoint(workdir, cliArgs) {
|
|
365591
|
-
const isWindows8 =
|
|
365600
|
+
const isWindows8 = os44.platform() === "win32";
|
|
365592
365601
|
const containerWorkdir = getContainerPath(workdir);
|
|
365593
365602
|
const shellCmds = [];
|
|
365594
365603
|
const pathSeparator = isWindows8 ? ";" : ":";
|
|
@@ -365673,9 +365682,9 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
365673
365682
|
"-D",
|
|
365674
365683
|
`TARGET_DIR=${fs99.realpathSync(process.cwd())}`,
|
|
365675
365684
|
"-D",
|
|
365676
|
-
`TMP_DIR=${fs99.realpathSync(
|
|
365685
|
+
`TMP_DIR=${fs99.realpathSync(os44.tmpdir())}`,
|
|
365677
365686
|
"-D",
|
|
365678
|
-
`HOME_DIR=${fs99.realpathSync(
|
|
365687
|
+
`HOME_DIR=${fs99.realpathSync(os44.homedir())}`,
|
|
365679
365688
|
"-D",
|
|
365680
365689
|
`CACHE_DIR=${fs99.realpathSync(execSync7(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`
|
|
365681
365690
|
];
|
|
@@ -365843,8 +365852,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
365843
365852
|
`${userSettingsDirOnHost}:${getContainerPath(userSettingsDirOnHost)}`
|
|
365844
365853
|
);
|
|
365845
365854
|
}
|
|
365846
|
-
args.push("--volume", `${
|
|
365847
|
-
const gcloudConfigDir = path112.join(
|
|
365855
|
+
args.push("--volume", `${os44.tmpdir()}:${getContainerPath(os44.tmpdir())}`);
|
|
365856
|
+
const gcloudConfigDir = path112.join(os44.homedir(), ".config", "gcloud");
|
|
365848
365857
|
if (fs99.existsSync(gcloudConfigDir)) {
|
|
365849
365858
|
args.push(
|
|
365850
365859
|
"--volume",
|
|
@@ -366042,7 +366051,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
366042
366051
|
}
|
|
366043
366052
|
args.push("--env", `SANDBOX=${containerName}`);
|
|
366044
366053
|
if (config.command === "podman") {
|
|
366045
|
-
const emptyAuthFilePath = path112.join(
|
|
366054
|
+
const emptyAuthFilePath = path112.join(os44.tmpdir(), "empty_auth.json");
|
|
366046
366055
|
fs99.writeFileSync(emptyAuthFilePath, "{}", "utf-8");
|
|
366047
366056
|
args.push("--authfile", emptyAuthFilePath);
|
|
366048
366057
|
}
|
|
@@ -366056,7 +366065,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
366056
366065
|
const uid = execSync7("id -u").toString().trim();
|
|
366057
366066
|
const gid = execSync7("id -g").toString().trim();
|
|
366058
366067
|
const username = "gemini";
|
|
366059
|
-
const homeDir = getContainerPath(
|
|
366068
|
+
const homeDir = getContainerPath(os44.homedir());
|
|
366060
366069
|
const setupUserCommands = [
|
|
366061
366070
|
// Use -f with groupadd to avoid errors if the group already exists.
|
|
366062
366071
|
`groupadd -f -g ${gid} ${username}`,
|
|
@@ -366068,7 +366077,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
366068
366077
|
const suCommand = `su -p ${username} -c '${escapedOriginalCommand}'`;
|
|
366069
366078
|
finalEntrypoint[2] = `${setupUserCommands} && ${suCommand}`;
|
|
366070
366079
|
userFlag = `--user ${uid}:${gid}`;
|
|
366071
|
-
args.push("--env", `HOME=${
|
|
366080
|
+
args.push("--env", `HOME=${os44.homedir()}`);
|
|
366072
366081
|
}
|
|
366073
366082
|
args.push(image2);
|
|
366074
366083
|
args.push(...finalEntrypoint);
|
|
@@ -366249,9 +366258,9 @@ init_settings();
|
|
|
366249
366258
|
init_esbuild_shims();
|
|
366250
366259
|
init_core2();
|
|
366251
366260
|
import fs100 from "node:fs/promises";
|
|
366252
|
-
import
|
|
366261
|
+
import os45 from "node:os";
|
|
366253
366262
|
import { join as pathJoin } from "node:path";
|
|
366254
|
-
var warningsFilePath = pathJoin(
|
|
366263
|
+
var warningsFilePath = pathJoin(os45.tmpdir(), "qwen-code-warnings.txt");
|
|
366255
366264
|
async function getStartupWarnings() {
|
|
366256
366265
|
try {
|
|
366257
366266
|
await fs100.access(warningsFilePath);
|
|
@@ -366275,8 +366284,9 @@ __name(getStartupWarnings, "getStartupWarnings");
|
|
|
366275
366284
|
// packages/cli/src/utils/userStartupWarnings.ts
|
|
366276
366285
|
init_esbuild_shims();
|
|
366277
366286
|
init_core2();
|
|
366287
|
+
init_l4SensitiveRepositories();
|
|
366278
366288
|
import fs101 from "node:fs/promises";
|
|
366279
|
-
import * as
|
|
366289
|
+
import * as os46 from "node:os";
|
|
366280
366290
|
import path113 from "node:path";
|
|
366281
366291
|
var homeDirectoryCheck = {
|
|
366282
366292
|
id: "home-directory",
|
|
@@ -366284,7 +366294,7 @@ var homeDirectoryCheck = {
|
|
|
366284
366294
|
try {
|
|
366285
366295
|
const [workspaceRealPath, homeRealPath] = await Promise.all([
|
|
366286
366296
|
fs101.realpath(options2.workspaceRoot),
|
|
366287
|
-
fs101.realpath(
|
|
366297
|
+
fs101.realpath(os46.homedir())
|
|
366288
366298
|
]);
|
|
366289
366299
|
if (workspaceRealPath === homeRealPath) {
|
|
366290
366300
|
return "\u5F53\u524D\u6B63\u5728 ~ \u76EE\u5F55\u4E0B\u8FD0\u884C RDMind\uFF0C\u5EFA\u8BAE\u8FDB\u5165\u9879\u76EE\u76EE\u5F55";
|
|
@@ -366323,11 +366333,6 @@ var ripgrepAvailabilityCheck = {
|
|
|
366323
366333
|
return null;
|
|
366324
366334
|
}, "check")
|
|
366325
366335
|
};
|
|
366326
|
-
var L4_SENSITIVE_REPOSITORIES = [
|
|
366327
|
-
"git@code.devops.xiaohongshu.com:sns/rdmind.git",
|
|
366328
|
-
"git@code.devops.xiaohongshu.com:aikit/rdmind.git"
|
|
366329
|
-
// 可以在这里添加更多敏感仓库地址
|
|
366330
|
-
];
|
|
366331
366336
|
var l4RepositoryCheck = {
|
|
366332
366337
|
id: "l4-repository",
|
|
366333
366338
|
check: /* @__PURE__ */ __name(async (options2) => {
|
|
@@ -368418,7 +368423,7 @@ function validateDnsResolutionOrder(order) {
|
|
|
368418
368423
|
}
|
|
368419
368424
|
__name(validateDnsResolutionOrder, "validateDnsResolutionOrder");
|
|
368420
368425
|
function getNodeMemoryArgs(isDebugMode2) {
|
|
368421
|
-
const totalMemoryMB =
|
|
368426
|
+
const totalMemoryMB = os47.totalmem() / (1024 * 1024);
|
|
368422
368427
|
const heapStats = v8.getHeapStatistics();
|
|
368423
368428
|
const currentMaxOldSpaceSizeMb = Math.floor(
|
|
368424
368429
|
heapStats.heap_size_limit / 1024 / 1024
|