shellx-ai 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -6
- package/dist/protocol.d.ts +16 -0
- package/dist/shellx.js +4 -3
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -161,10 +161,12 @@ class ConnectionTaskClient {
|
|
|
161
161
|
if (localResp.ok) {
|
|
162
162
|
const info = yield localResp.json();
|
|
163
163
|
if (info && (info.status === 'ok' || info.status === 1) && info.uuid) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
if (deviceId == info.uuid) {
|
|
165
|
+
const localUuid = info.uuid;
|
|
166
|
+
const fallbackUrl = `ws://127.0.0.1:9091/api/s/${localUuid}`;
|
|
167
|
+
console.log('✅ [Auth] 本地ShellX服务可用,使用本地 /info 返回的 uuid:', localUuid, ',服务地址:', fallbackUrl);
|
|
168
|
+
return fallbackUrl;
|
|
169
|
+
}
|
|
168
170
|
}
|
|
169
171
|
}
|
|
170
172
|
}
|
|
@@ -180,13 +182,14 @@ class ConnectionTaskClient {
|
|
|
180
182
|
try {
|
|
181
183
|
console.log('🔑 [Auth] 正在认证设备...');
|
|
182
184
|
const featGlobal = this.getFetch();
|
|
183
|
-
const
|
|
185
|
+
const jsonData = yield featGlobal(`https://shellx.ai/api/device/${deviceId}`, {
|
|
184
186
|
method: 'GET',
|
|
185
187
|
headers: {
|
|
186
188
|
'Content-Type': 'application/json',
|
|
187
189
|
},
|
|
188
190
|
});
|
|
189
|
-
|
|
191
|
+
console.log('ShellX.ai设备认证响应:', jsonData);
|
|
192
|
+
// const jsonData = JSON.parse(data);
|
|
190
193
|
console.log('✅ [Auth] ShellX.ai设备认证成功');
|
|
191
194
|
console.log(`📡 [Auth] 设备ID: ${jsonData.authenticate}`);
|
|
192
195
|
console.log(`📡 [Auth] ShellX.ai服务地址: ${jsonData.machine}`);
|
package/dist/protocol.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export type ScreenShotResponse = {
|
|
|
43
43
|
dimensions: ScreenDimensions;
|
|
44
44
|
success?: boolean;
|
|
45
45
|
errorMessage?: string;
|
|
46
|
+
isVideo?: boolean;
|
|
47
|
+
videoPath?: string;
|
|
46
48
|
};
|
|
47
49
|
export type ScreenInfoResponse = {
|
|
48
50
|
displayId?: number;
|
|
@@ -159,6 +161,9 @@ export type ScreenShotOptions = {
|
|
|
159
161
|
quality?: number;
|
|
160
162
|
scale?: number;
|
|
161
163
|
region?: ScreenRegion;
|
|
164
|
+
isRecording?: boolean;
|
|
165
|
+
saveToFile?: boolean;
|
|
166
|
+
duration?: number;
|
|
162
167
|
};
|
|
163
168
|
/** Client message type, see the Rust version. */
|
|
164
169
|
export type WsClient = {
|
|
@@ -206,6 +211,17 @@ export interface ShellCommandAction {
|
|
|
206
211
|
activity?: string;
|
|
207
212
|
command: string;
|
|
208
213
|
}
|
|
214
|
+
export interface ScreenShotAction {
|
|
215
|
+
title?: string;
|
|
216
|
+
type: "screenShot";
|
|
217
|
+
activity?: string;
|
|
218
|
+
format: 'png' | 'jpeg';
|
|
219
|
+
quality?: number;
|
|
220
|
+
scale?: number;
|
|
221
|
+
region?: ScreenRegion;
|
|
222
|
+
isRecording?: boolean;
|
|
223
|
+
duration?: number;
|
|
224
|
+
}
|
|
209
225
|
export interface getAppInfoAction {
|
|
210
226
|
title?: string;
|
|
211
227
|
type: "get_app_info";
|
package/dist/shellx.js
CHANGED
|
@@ -789,9 +789,10 @@ class ShellX {
|
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
791
791
|
console.log(`\n${title || `✅ 找到 ${elements.length} 个元素`}:`);
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
792
|
+
/*
|
|
793
|
+
elements.forEach((element, index) => {
|
|
794
|
+
this.printElementInfo(element, index);
|
|
795
|
+
});*/
|
|
795
796
|
// 统计信息
|
|
796
797
|
const visibleCount = elements.filter(e => e.visible).length;
|
|
797
798
|
const clickableCount = elements.filter(e => e.clickable).length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shellx-ai",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "shellx is a powerful WebSocket-based client for controlling shell commands and UI automation on remote devices.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "git+https://github.com/10cl/shellx.git",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"cbor": "^9.0.0",
|
|
34
34
|
"dotenv": "^16.4.5",
|
|
35
35
|
"ofetch": "^1.4.1",
|
|
36
|
-
"shellx-ai": "file:",
|
|
37
36
|
"uuid": "^11.1.0"
|
|
38
37
|
},
|
|
39
38
|
"optionalDependencies": {
|