shellx-cli 0.0.20 → 0.0.22
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/bundle/shellx.js +174 -65
- package/package.json +7 -5
package/bundle/shellx.js
CHANGED
|
@@ -143076,7 +143076,7 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
143076
143076
|
var init_git_commit = __esm({
|
|
143077
143077
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
143078
143078
|
"use strict";
|
|
143079
|
-
GIT_COMMIT_INFO = "
|
|
143079
|
+
GIT_COMMIT_INFO = "c04c6e88";
|
|
143080
143080
|
CLI_VERSION = "0.15.0-nightly.20251107.b8eeb553";
|
|
143081
143081
|
}
|
|
143082
143082
|
});
|
|
@@ -233003,7 +233003,7 @@ async function createContentGenerator(config, gcConfig, sessionId2) {
|
|
|
233003
233003
|
if (gcConfig.fakeResponses) {
|
|
233004
233004
|
return FakeContentGenerator.fromFile(gcConfig.fakeResponses);
|
|
233005
233005
|
}
|
|
233006
|
-
const version3 = "0.0.
|
|
233006
|
+
const version3 = "0.0.22";
|
|
233007
233007
|
const userAgent = `GeminiCLI/${version3} (${process.platform}; ${process.arch})`;
|
|
233008
233008
|
const baseHeaders = {
|
|
233009
233009
|
"User-Agent": userAgent
|
|
@@ -302330,7 +302330,7 @@ async function getClientMetadata() {
|
|
|
302330
302330
|
if (!clientMetadataPromise) {
|
|
302331
302331
|
clientMetadataPromise = (async () => ({
|
|
302332
302332
|
ideName: "GEMINI_CLI",
|
|
302333
|
-
ideVersion: "0.0.
|
|
302333
|
+
ideVersion: "0.0.22",
|
|
302334
302334
|
platform: getPlatform(),
|
|
302335
302335
|
updateChannel: await getReleaseChannel(__dirname3)
|
|
302336
302336
|
}))();
|
|
@@ -319583,7 +319583,7 @@ var require_domain_manager = __commonJS({
|
|
|
319583
319583
|
return config.protocol + domain;
|
|
319584
319584
|
}
|
|
319585
319585
|
function getWsServerUrl(config = DEFAULT_DOMAIN_CONFIG) {
|
|
319586
|
-
return
|
|
319586
|
+
return config.international;
|
|
319587
319587
|
}
|
|
319588
319588
|
function buildDeviceApiUrl(deviceId, config = DEFAULT_DOMAIN_CONFIG) {
|
|
319589
319589
|
return `${getApiBaseUrl(config)}/api/device/${deviceId}`;
|
|
@@ -331687,8 +331687,32 @@ var require_dist9 = __commonJS({
|
|
|
331687
331687
|
onReconnectFailed: () => {
|
|
331688
331688
|
}
|
|
331689
331689
|
};
|
|
331690
|
+
function extractUUIDFromUrl(url2) {
|
|
331691
|
+
try {
|
|
331692
|
+
const uuidMatch = url2.match(/\/(?:api\/[ts]\/)([a-f0-9\-]{36})(?:\?|\/|$)/);
|
|
331693
|
+
if (uuidMatch && uuidMatch[1]) {
|
|
331694
|
+
console.log(`[ShellX] Extracted UUID from WebSocket URL: ${uuidMatch[1]}, url: ${url2}`);
|
|
331695
|
+
return uuidMatch[1];
|
|
331696
|
+
}
|
|
331697
|
+
console.log(`[ShellX] Could not extract UUID from WebSocket URL: ${url2}`);
|
|
331698
|
+
return null;
|
|
331699
|
+
} catch (error) {
|
|
331700
|
+
console.error(`[ShellX] Error extracting UUID from URL: ${error.message}, url: ${url2}`);
|
|
331701
|
+
return null;
|
|
331702
|
+
}
|
|
331703
|
+
}
|
|
331704
|
+
function addSessionIdToUrl(url2) {
|
|
331705
|
+
const uuid = extractUUIDFromUrl(url2);
|
|
331706
|
+
if (!uuid) {
|
|
331707
|
+
console.log(`[ShellX] No UUID found in URL, returning original URL: ${url2}`);
|
|
331708
|
+
return url2;
|
|
331709
|
+
}
|
|
331710
|
+
const separator = url2.includes("?") ? "&" : "?";
|
|
331711
|
+
const urlWithSessionId = `${url2}${separator}session_id=${uuid}`;
|
|
331712
|
+
console.log(`[ShellX] Added session_id to WebSocket URL: ${urlWithSessionId}, session_id: ${uuid}`);
|
|
331713
|
+
return urlWithSessionId;
|
|
331714
|
+
}
|
|
331690
331715
|
var cbor_1 = require_cbor();
|
|
331691
|
-
var authKey = (0, utils_1.getEnvVar)("SHELLX_AUTH_KEY");
|
|
331692
331716
|
function getWebSocket() {
|
|
331693
331717
|
return __awaiter(this, void 0, void 0, function* () {
|
|
331694
331718
|
if (typeof globalThis.WebSocket !== "undefined") {
|
|
@@ -331727,23 +331751,35 @@ var require_dist9 = __commonJS({
|
|
|
331727
331751
|
return __awaiter(this, void 0, void 0, function* () {
|
|
331728
331752
|
var _a5, _b2;
|
|
331729
331753
|
try {
|
|
331730
|
-
this.wsUrl = yield this.authenticateDevice(
|
|
331754
|
+
this.wsUrl = yield this.authenticateDevice();
|
|
331731
331755
|
if (!this.wsUrl) {
|
|
331732
331756
|
this.config.onError(new Event("connection"));
|
|
331733
331757
|
this.reconnect();
|
|
331734
331758
|
return;
|
|
331735
331759
|
}
|
|
331760
|
+
const wsUrlWithSessionId = addSessionIdToUrl(this.wsUrl);
|
|
331736
331761
|
console.log("Initializing ShellX client wsUrl:" + this.wsUrl + " deviceId: " + this.deviceId);
|
|
331762
|
+
console.log("WebSocket URL with session_id: " + wsUrlWithSessionId);
|
|
331737
331763
|
const WebSocketConstructor = yield getWebSocket();
|
|
331738
|
-
this.ws = new WebSocketConstructor(
|
|
331764
|
+
this.ws = new WebSocketConstructor(wsUrlWithSessionId);
|
|
331739
331765
|
if (this.ws.binaryType !== void 0) {
|
|
331740
331766
|
this.ws.binaryType = "arraybuffer";
|
|
331741
331767
|
}
|
|
331742
331768
|
this.ws.onopen = () => {
|
|
331743
|
-
|
|
331769
|
+
var _a6, _b3;
|
|
331770
|
+
console.log("\u{1F517} [ShellX] WebSocket\u8FDE\u63A5\u5DF2\u5EFA\u7ACB:" + this.wsUrl);
|
|
331744
331771
|
this.wsConnected = true;
|
|
331745
331772
|
this.reconnectAttempts = 0;
|
|
331746
|
-
this.
|
|
331773
|
+
this.shellxConnected = true;
|
|
331774
|
+
(_b3 = (_a6 = this.config).onOpen) === null || _b3 === void 0 ? void 0 : _b3.call(_a6, this.deviceId);
|
|
331775
|
+
this.flushQueue();
|
|
331776
|
+
this.startPing();
|
|
331777
|
+
const isAndroidSandbox = process.env["SANDBOX"] === "android";
|
|
331778
|
+
if (isAndroidSandbox) {
|
|
331779
|
+
this.getScreenInfo();
|
|
331780
|
+
} else {
|
|
331781
|
+
this.getAndWakeScreen();
|
|
331782
|
+
}
|
|
331747
331783
|
};
|
|
331748
331784
|
this.ws.onmessage = (event) => {
|
|
331749
331785
|
this.handleMessage(event);
|
|
@@ -331769,7 +331805,7 @@ var require_dist9 = __commonJS({
|
|
|
331769
331805
|
}
|
|
331770
331806
|
});
|
|
331771
331807
|
}
|
|
331772
|
-
authenticateDevice(
|
|
331808
|
+
authenticateDevice() {
|
|
331773
331809
|
return __awaiter(this, void 0, void 0, function* () {
|
|
331774
331810
|
let fallbackUrl = void 0;
|
|
331775
331811
|
try {
|
|
@@ -331781,7 +331817,7 @@ var require_dist9 = __commonJS({
|
|
|
331781
331817
|
if (localResp.ok) {
|
|
331782
331818
|
const info2 = yield localResp.json();
|
|
331783
331819
|
if (info2 && (info2.status === "ok" || info2.status === 1) && info2.uuid) {
|
|
331784
|
-
if (deviceId === void 0 || deviceId === info2.uuid) {
|
|
331820
|
+
if (this.deviceId === void 0 || this.deviceId === info2.uuid) {
|
|
331785
331821
|
const localUuid = info2.uuid;
|
|
331786
331822
|
this.deviceId = localUuid;
|
|
331787
331823
|
fallbackUrl = `ws://127.0.0.1:9091/api/s/${localUuid}`;
|
|
@@ -331792,19 +331828,14 @@ var require_dist9 = __commonJS({
|
|
|
331792
331828
|
}
|
|
331793
331829
|
} catch (e3) {
|
|
331794
331830
|
}
|
|
331795
|
-
if (deviceId === void 0) {
|
|
331831
|
+
if (this.deviceId === void 0) {
|
|
331796
331832
|
console.warn("\u274C [Auth] \u8BBE\u5907ID\u672A\u8BBE\u7F6E\uFF0C\u672C\u5730\u672A\u8FDE\u63A5USB\uFF0C\u8BF7\u8BBE\u7F6E\u73AF\u5883\u53D8\u91CF SHELLX_DEVICE_ID \u6216\u8005 USB\u8FDE\u63A5\u8BBE\u5907");
|
|
331797
331833
|
return void 0;
|
|
331798
331834
|
}
|
|
331799
|
-
authKey = (0, utils_1.getEnvVar)("SHELLX_AUTH_KEY");
|
|
331800
|
-
if (!authKey) {
|
|
331801
|
-
authKey = (0, uuid_1.v4)();
|
|
331802
|
-
console.log("\u2705 [Auth] SHELLX_AUTH_KEY \u73AF\u5883\u53D8\u91CF\u672A\u8BBE\u7F6E, \u751F\u6210\u65B0\u7684authKey: " + authKey);
|
|
331803
|
-
}
|
|
331804
331835
|
try {
|
|
331805
331836
|
console.log("\u{1F511} [Auth] \u6B63\u5728\u8BA4\u8BC1\u8BBE\u5907...");
|
|
331806
331837
|
const featGlobal = this.getFetch();
|
|
331807
|
-
const deviceApiUrl = (0, domain_manager_1.buildDeviceApiUrl)(deviceId);
|
|
331838
|
+
const deviceApiUrl = (0, domain_manager_1.buildDeviceApiUrl)(this.deviceId);
|
|
331808
331839
|
const jsonData = yield featGlobal(deviceApiUrl, {
|
|
331809
331840
|
method: "GET",
|
|
331810
331841
|
headers: {
|
|
@@ -331815,7 +331846,7 @@ var require_dist9 = __commonJS({
|
|
|
331815
331846
|
if (!jsonData || jsonData === null || !jsonData.machine || !jsonData.authenticate) {
|
|
331816
331847
|
console.error("\u274C [Auth] ShellX.ai\u8BBE\u5907\u672A\u6CE8\u518C\u6216\u8BA4\u8BC1\u4FE1\u606F\u65E0\u6548");
|
|
331817
331848
|
const wsServerUrl = (0, domain_manager_1.getWsServerUrl)();
|
|
331818
|
-
return `wss://${wsServerUrl}/api/s/${deviceId}`;
|
|
331849
|
+
return `wss://${wsServerUrl}/api/s/${this.deviceId}`;
|
|
331819
331850
|
}
|
|
331820
331851
|
console.log("\u2705 [Auth] ShellX.ai\u8BBE\u5907\u8BA4\u8BC1\u6210\u529F");
|
|
331821
331852
|
console.log(`\u{1F4E1} [Auth] \u8BBE\u5907ID: ${jsonData.authenticate}`);
|
|
@@ -331865,29 +331896,6 @@ var require_dist9 = __commonJS({
|
|
|
331865
331896
|
}
|
|
331866
331897
|
});
|
|
331867
331898
|
}
|
|
331868
|
-
/**
|
|
331869
|
-
* 发送认证消息
|
|
331870
|
-
*/
|
|
331871
|
-
sendAuthenticationMessage() {
|
|
331872
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
331873
|
-
try {
|
|
331874
|
-
authKey = (0, utils_1.getEnvVar)("SHELLX_AUTH_KEY");
|
|
331875
|
-
if (!authKey) {
|
|
331876
|
-
authKey = (0, uuid_1.v4)();
|
|
331877
|
-
console.log("\u2705 [Auth] SHELLX_AUTH_KEY \u73AF\u5883\u53D8\u91CF\u672A\u8BBE\u7F6E, \u751F\u6210\u65B0\u7684authKey: " + authKey);
|
|
331878
|
-
}
|
|
331879
|
-
const authMessage = { authenticate: authKey };
|
|
331880
|
-
console.log("\u{1F4E4} [Auth] \u53D1\u9001\u8BA4\u8BC1\u6D88\u606F:", { authenticate: authKey });
|
|
331881
|
-
if (this.ws && this.wsConnected) {
|
|
331882
|
-
this.ws.send((0, cbor_1.encode)(authMessage));
|
|
331883
|
-
} else {
|
|
331884
|
-
console.error("\u274C [Auth] ShellX \u672A\u8FDE\u63A5\uFF0C\u65E0\u6CD5\u53D1\u9001\u8BA4\u8BC1\u6D88\u606F");
|
|
331885
|
-
}
|
|
331886
|
-
} catch (error) {
|
|
331887
|
-
console.error("\u274C [Auth] \u53D1\u9001\u8BA4\u8BC1\u6D88\u606F\u5931\u8D25:", error);
|
|
331888
|
-
}
|
|
331889
|
-
});
|
|
331890
|
-
}
|
|
331891
331899
|
handleMessage(event) {
|
|
331892
331900
|
let serverMessage;
|
|
331893
331901
|
try {
|
|
@@ -331920,22 +331928,8 @@ var require_dist9 = __commonJS({
|
|
|
331920
331928
|
}
|
|
331921
331929
|
}
|
|
331922
331930
|
processServerMessage(message) {
|
|
331923
|
-
var _a5, _b2
|
|
331924
|
-
this.
|
|
331925
|
-
if (this.authenticated && !this.shellxConnected) {
|
|
331926
|
-
this.shellxConnected = true;
|
|
331927
|
-
console.log("\u2705 [ShellX] ShellX.ai\u670D\u52A1\u8FDE\u63A5\u6210\u529F\uFF01");
|
|
331928
|
-
(_b2 = (_a5 = this.config).onOpen) === null || _b2 === void 0 ? void 0 : _b2.call(_a5);
|
|
331929
|
-
this.flushQueue();
|
|
331930
|
-
this.startPing();
|
|
331931
|
-
const isAndroidSandbox = process.env["SANDBOX"] === "android";
|
|
331932
|
-
if (isAndroidSandbox) {
|
|
331933
|
-
this.getScreenInfo();
|
|
331934
|
-
} else {
|
|
331935
|
-
this.getAndWakeScreen();
|
|
331936
|
-
}
|
|
331937
|
-
}
|
|
331938
|
-
(_d = (_c2 = this.config).onMessage) === null || _d === void 0 ? void 0 : _d.call(_c2, message);
|
|
331931
|
+
var _a5, _b2;
|
|
331932
|
+
(_b2 = (_a5 = this.config).onMessage) === null || _b2 === void 0 ? void 0 : _b2.call(_a5, message);
|
|
331939
331933
|
if (message.jsonData) {
|
|
331940
331934
|
this.handleJsonDataResponse(message.jsonData);
|
|
331941
331935
|
}
|
|
@@ -334170,6 +334164,29 @@ async function killShellX() {
|
|
|
334170
334164
|
return false;
|
|
334171
334165
|
}
|
|
334172
334166
|
}
|
|
334167
|
+
async function stopShellX() {
|
|
334168
|
+
console.log("Stopping ShellX...");
|
|
334169
|
+
try {
|
|
334170
|
+
const platform13 = os14.platform();
|
|
334171
|
+
const shellxBin = platform13 === "win32" ? path35.join(SHELLX_BIN_DIR, "shellx.exe") : path35.join(SHELLX_BIN_DIR, "shellx");
|
|
334172
|
+
if (!fs36.existsSync(shellxBin)) {
|
|
334173
|
+
console.warn("ShellX binary not found; skipping stop request.");
|
|
334174
|
+
return false;
|
|
334175
|
+
}
|
|
334176
|
+
const subprocess = child_process.spawn(shellxBin, ["--stop"], {
|
|
334177
|
+
detached: true,
|
|
334178
|
+
stdio: "pipe",
|
|
334179
|
+
windowsHide: false,
|
|
334180
|
+
shell: false,
|
|
334181
|
+
cwd: SHELLX_BIN_DIR
|
|
334182
|
+
});
|
|
334183
|
+
subprocess.unref();
|
|
334184
|
+
return true;
|
|
334185
|
+
} catch (error) {
|
|
334186
|
+
console.error("Failed to stop ShellX:", error);
|
|
334187
|
+
return false;
|
|
334188
|
+
}
|
|
334189
|
+
}
|
|
334173
334190
|
function isShellXInstalled() {
|
|
334174
334191
|
const platform13 = os14.platform();
|
|
334175
334192
|
const shellxBin = platform13 === "win32" ? path35.join(SHELLX_BIN_DIR, "shellx.exe") : path35.join(SHELLX_BIN_DIR, "shellx");
|
|
@@ -334223,7 +334240,35 @@ async function isShellXUpdate() {
|
|
|
334223
334240
|
const localVersion = getLocalBinaryVersion();
|
|
334224
334241
|
return !localVersion || localVersion !== targetVersion;
|
|
334225
334242
|
}
|
|
334226
|
-
|
|
334243
|
+
function getDeviceIdFromFile() {
|
|
334244
|
+
try {
|
|
334245
|
+
if (fs36.existsSync(SHELLX_DEVICE_ID_FILE)) {
|
|
334246
|
+
const deviceId = fs36.readFileSync(SHELLX_DEVICE_ID_FILE, "utf8").trim();
|
|
334247
|
+
return deviceId || null;
|
|
334248
|
+
}
|
|
334249
|
+
} catch (error) {
|
|
334250
|
+
console.warn("Failed to read device ID from file:", error);
|
|
334251
|
+
}
|
|
334252
|
+
return null;
|
|
334253
|
+
}
|
|
334254
|
+
function saveDeviceIdToFile(deviceId) {
|
|
334255
|
+
try {
|
|
334256
|
+
if (!deviceId || typeof deviceId !== "string" || deviceId.trim() === "") {
|
|
334257
|
+
console.warn("Invalid device ID provided, skipping save:", deviceId);
|
|
334258
|
+
return false;
|
|
334259
|
+
}
|
|
334260
|
+
const dir = path35.dirname(SHELLX_DEVICE_ID_FILE);
|
|
334261
|
+
if (!fs36.existsSync(dir)) {
|
|
334262
|
+
fs36.mkdirSync(dir, { recursive: true });
|
|
334263
|
+
}
|
|
334264
|
+
fs36.writeFileSync(SHELLX_DEVICE_ID_FILE, deviceId.trim(), "utf8");
|
|
334265
|
+
return true;
|
|
334266
|
+
} catch (error) {
|
|
334267
|
+
console.warn("Failed to save device ID to file:", error);
|
|
334268
|
+
return false;
|
|
334269
|
+
}
|
|
334270
|
+
}
|
|
334271
|
+
var import_extract_zip, shellxFilesArm64Path, SUPPORTED_PLATFORMS, SHELLX_INSTALL_DIR, SHELLX_BIN_DIR, SHELLX_APK_FILE, SHELLX_APK_SIGN_FILE, SHELLX_PLATFORM_TOOLS_PACKAGE, SHELLX_BINARY_VERSION_FILE, SHELLX_DEVICE_ID_FILE;
|
|
334227
334272
|
var init_shellx_manager = __esm({
|
|
334228
334273
|
"packages/core/dist/src/shellx/shellx-manager.js"() {
|
|
334229
334274
|
"use strict";
|
|
@@ -334248,6 +334293,7 @@ var init_shellx_manager = __esm({
|
|
|
334248
334293
|
SHELLX_APK_SIGN_FILE = path35.join(SHELLX_BIN_DIR, "shellx.apk.sha256");
|
|
334249
334294
|
SHELLX_PLATFORM_TOOLS_PACKAGE = "shellx-platform-tools";
|
|
334250
334295
|
SHELLX_BINARY_VERSION_FILE = path35.join(SHELLX_INSTALL_DIR, "binary-version.txt");
|
|
334296
|
+
SHELLX_DEVICE_ID_FILE = path35.join(SHELLX_INSTALL_DIR, "device-id.txt");
|
|
334251
334297
|
}
|
|
334252
334298
|
});
|
|
334253
334299
|
|
|
@@ -334807,7 +334853,10 @@ var init_config3 = __esm({
|
|
|
334807
334853
|
console.log("ShellX is already connected, skipping reconnection.");
|
|
334808
334854
|
return;
|
|
334809
334855
|
}
|
|
334810
|
-
|
|
334856
|
+
let deviceId = process24.env["SHELLX_DEVICE_ID"];
|
|
334857
|
+
if (!deviceId) {
|
|
334858
|
+
deviceId = getDeviceIdFromFile() || void 0;
|
|
334859
|
+
}
|
|
334811
334860
|
try {
|
|
334812
334861
|
if (retryCount === 0) {
|
|
334813
334862
|
console.log("\u{1F50C} Connecting to ShellX...");
|
|
@@ -334835,7 +334884,10 @@ var init_config3 = __esm({
|
|
|
334835
334884
|
resolve23(client);
|
|
334836
334885
|
}
|
|
334837
334886
|
},
|
|
334838
|
-
onOpen: () => {
|
|
334887
|
+
onOpen: (deviceId2) => {
|
|
334888
|
+
if (deviceId2) {
|
|
334889
|
+
saveDeviceIdToFile(deviceId2);
|
|
334890
|
+
}
|
|
334839
334891
|
this.startConnectionMonitoring();
|
|
334840
334892
|
try {
|
|
334841
334893
|
client.getClient().sendMessage({
|
|
@@ -415269,7 +415321,7 @@ var WarningMessage = ({ text }) => {
|
|
|
415269
415321
|
};
|
|
415270
415322
|
|
|
415271
415323
|
// packages/cli/src/generated/git-commit.ts
|
|
415272
|
-
var GIT_COMMIT_INFO2 = "
|
|
415324
|
+
var GIT_COMMIT_INFO2 = "c04c6e88";
|
|
415273
415325
|
|
|
415274
415326
|
// packages/cli/src/ui/components/AboutBox.tsx
|
|
415275
415327
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -429009,7 +429061,7 @@ var __filename3 = fileURLToPath10(import.meta.url);
|
|
|
429009
429061
|
var __dirname7 = path59.dirname(__filename3);
|
|
429010
429062
|
async function getCliVersion() {
|
|
429011
429063
|
const pkgJson = await getPackageJson(__dirname7);
|
|
429012
|
-
return "0.0.
|
|
429064
|
+
return "0.0.22";
|
|
429013
429065
|
}
|
|
429014
429066
|
|
|
429015
429067
|
// packages/cli/src/ui/commands/aboutCommand.ts
|
|
@@ -433359,7 +433411,7 @@ var checkCwdSync = (dir) => {
|
|
|
433359
433411
|
}
|
|
433360
433412
|
}
|
|
433361
433413
|
};
|
|
433362
|
-
var
|
|
433414
|
+
var mkdirSync6 = (dir, opt) => {
|
|
433363
433415
|
dir = normalizeWindowsPath(dir);
|
|
433364
433416
|
const umask = opt.umask ?? 18;
|
|
433365
433417
|
const mode = opt.mode | 448;
|
|
@@ -434209,7 +434261,7 @@ var UnpackSync = class extends Unpack {
|
|
|
434209
434261
|
}
|
|
434210
434262
|
[MKDIR](dir, mode) {
|
|
434211
434263
|
try {
|
|
434212
|
-
return
|
|
434264
|
+
return mkdirSync6(normalizeWindowsPath(dir), {
|
|
434213
434265
|
uid: this.uid,
|
|
434214
434266
|
gid: this.gid,
|
|
434215
434267
|
processUid: this.processUid,
|
|
@@ -436093,6 +436145,62 @@ ${deviceManagementUrl}`
|
|
|
436093
436145
|
}
|
|
436094
436146
|
};
|
|
436095
436147
|
|
|
436148
|
+
// packages/cli/src/ui/commands/stopCommand.ts
|
|
436149
|
+
init_dist6();
|
|
436150
|
+
var stopCommand = {
|
|
436151
|
+
name: "stop",
|
|
436152
|
+
altNames: [],
|
|
436153
|
+
description: "Stop ShellX platform tools service",
|
|
436154
|
+
kind: "built-in" /* BUILT_IN */,
|
|
436155
|
+
action: async (context2) => {
|
|
436156
|
+
const { ui: ui2 } = context2;
|
|
436157
|
+
if (ui2.pendingItem) {
|
|
436158
|
+
ui2.addItem(
|
|
436159
|
+
{
|
|
436160
|
+
type: "error" /* ERROR */,
|
|
436161
|
+
text: "Already processing a request, wait for previous request to complete"
|
|
436162
|
+
},
|
|
436163
|
+
Date.now()
|
|
436164
|
+
);
|
|
436165
|
+
return;
|
|
436166
|
+
}
|
|
436167
|
+
ui2.setPendingItem({
|
|
436168
|
+
type: "info" /* INFO */,
|
|
436169
|
+
text: "Stopping ShellX..."
|
|
436170
|
+
});
|
|
436171
|
+
try {
|
|
436172
|
+
const result = await stopShellX();
|
|
436173
|
+
if (result) {
|
|
436174
|
+
ui2.addItem(
|
|
436175
|
+
{
|
|
436176
|
+
type: "info" /* INFO */,
|
|
436177
|
+
text: `\u2705 ShellX stopped successfully`
|
|
436178
|
+
},
|
|
436179
|
+
Date.now()
|
|
436180
|
+
);
|
|
436181
|
+
} else {
|
|
436182
|
+
ui2.addItem(
|
|
436183
|
+
{
|
|
436184
|
+
type: "error" /* ERROR */,
|
|
436185
|
+
text: `\u274C Failed to stop ShellX`
|
|
436186
|
+
},
|
|
436187
|
+
Date.now()
|
|
436188
|
+
);
|
|
436189
|
+
}
|
|
436190
|
+
} catch (error) {
|
|
436191
|
+
ui2.addItem(
|
|
436192
|
+
{
|
|
436193
|
+
type: "error" /* ERROR */,
|
|
436194
|
+
text: `Stop failed: ${error instanceof Error ? error.message : String(error)}`
|
|
436195
|
+
},
|
|
436196
|
+
Date.now()
|
|
436197
|
+
);
|
|
436198
|
+
} finally {
|
|
436199
|
+
ui2.setPendingItem(null);
|
|
436200
|
+
}
|
|
436201
|
+
}
|
|
436202
|
+
};
|
|
436203
|
+
|
|
436096
436204
|
// packages/cli/src/ui/commands/quitCommand.ts
|
|
436097
436205
|
var quitCommand = {
|
|
436098
436206
|
name: "quit",
|
|
@@ -436441,6 +436549,7 @@ var BuiltinCommandLoader = class {
|
|
|
436441
436549
|
loginCommand,
|
|
436442
436550
|
installCommand,
|
|
436443
436551
|
startCommand,
|
|
436552
|
+
stopCommand,
|
|
436444
436553
|
// shellx.ai add end
|
|
436445
436554
|
aboutCommand,
|
|
436446
436555
|
// authCommand,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shellx-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.0.0"
|
|
6
6
|
},
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.15.0-nightly.20251107.b8eeb553"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
+
"postinstall": "node scripts/install-shellx-files.js",
|
|
19
20
|
"start": "cross-env NODE_ENV=development node scripts/start.js",
|
|
20
21
|
"start:a2a-server": "CODER_AGENT_PORT=41242 npm run start --workspace @google/gemini-cli-a2a-server",
|
|
21
22
|
"debug": "cross-env DEBUG=1 node --inspect-brk scripts/start.js",
|
|
@@ -98,6 +99,7 @@
|
|
|
98
99
|
"eslint-plugin-license-header": "^0.8.0",
|
|
99
100
|
"eslint-plugin-react": "^7.37.5",
|
|
100
101
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
102
|
+
"eval": "^0.1.8",
|
|
101
103
|
"glob": "^10.4.5",
|
|
102
104
|
"globals": "^16.0.0",
|
|
103
105
|
"google-artifactregistry-auth": "^3.4.0",
|
|
@@ -113,6 +115,9 @@
|
|
|
113
115
|
"prettier": "^3.5.3",
|
|
114
116
|
"react-devtools-core": "^6.1.2",
|
|
115
117
|
"semver": "^7.7.2",
|
|
118
|
+
"shellx-files-arm64": "^0.0.2",
|
|
119
|
+
"shellx-platform-tools": "^0.0.16",
|
|
120
|
+
"simple-git": "^3.28.0",
|
|
116
121
|
"strip-ansi": "^7.1.2",
|
|
117
122
|
"tsx": "^4.20.3",
|
|
118
123
|
"typescript-eslint": "^8.30.1",
|
|
@@ -120,10 +125,7 @@
|
|
|
120
125
|
"yargs": "^17.7.2"
|
|
121
126
|
},
|
|
122
127
|
"dependencies": {
|
|
123
|
-
"
|
|
124
|
-
"latest-version": "^9.0.0",
|
|
125
|
-
"shellx-files-arm64": "^0.0.2",
|
|
126
|
-
"simple-git": "^3.28.0"
|
|
128
|
+
"latest-version": "^9.0.0"
|
|
127
129
|
},
|
|
128
130
|
"optionalDependencies": {
|
|
129
131
|
"@lydell/node-pty": "1.1.0",
|