@aixnn/aixautots 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-IZMWCTAP.js → chunk-6S3XLY5O.js} +2 -2
- package/dist/{chunk-SSE4IYA4.js → chunk-A5VNENHD.js} +6 -1
- package/dist/{chunk-CVV7FOMQ.js → chunk-E7WMHM63.js} +10 -1
- package/dist/{chunk-HPKXW5IC.js → chunk-M7CKUC4U.js} +49 -12
- package/dist/{chunk-XB4MS2A4.js → chunk-P2Y655SL.js} +19 -8
- package/dist/{chunk-JY7O77ML.js → chunk-Q63FQ7B5.js} +1 -1
- package/dist/{chunk-64Q7BBIQ.js → chunk-T3QVYTOT.js} +10 -0
- package/dist/{chunk-QPNH7B7P.js → chunk-VKPKHUHU.js} +57 -14
- package/dist/core/index.d.ts +2 -2
- package/dist/i18n/index.js +1 -1
- package/dist/{mirror-session-7hrjaLnF.d.ts → mirror-session-BP7Rd3Jk.d.ts} +3 -0
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +2 -2
- package/dist/ui/billing.js +3 -3
- package/dist/ui/device-create.js +3 -3
- package/dist/ui/device-mirror.js +4 -4
- package/dist/ui/devices.js +7 -7
- package/dist/ui/editor.js +4 -4
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +40 -15
- package/dist/ui/inspector.js +3 -3
- package/dist/ui/market.js +3 -3
- package/dist/ui/mirror.d.ts +4 -2
- package/dist/ui/mirror.js +1 -1
- package/dist/ui/script-studio.js +3 -3
- package/dist/ui/scripts.js +3 -3
- package/dist/ui/tasks.js +7 -7
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LogConsole } from './chunk-FW23FLAF.js';
|
|
2
2
|
import { cn, Button, Select } from './chunk-EVHTAXQG.js';
|
|
3
|
-
import { useDevices, useScripts, useScriptRun } from './chunk-
|
|
3
|
+
import { useDevices, useScripts, useScriptRun } from './chunk-Q63FQ7B5.js';
|
|
4
4
|
import { variablesToSchema, normalizeDevices, schemaToVariables } from './chunk-BUW45GM2.js';
|
|
5
|
-
import { useClient } from './chunk-
|
|
5
|
+
import { useClient } from './chunk-A5VNENHD.js';
|
|
6
6
|
import { useMemo, useState, useEffect, useRef, useCallback } from 'react';
|
|
7
7
|
import { Trash2, Plus, Play, Pause, Square, ArrowDownToLine, WrapText, ChevronRight, Save, XCircle, CheckCircle2, Loader2, Circle } from 'lucide-react';
|
|
8
8
|
import CodeMirror, { EditorView } from '@uiw/react-codemirror';
|
|
@@ -188,7 +188,12 @@ function useEnvRun(beforeSetup) {
|
|
|
188
188
|
const r = await start();
|
|
189
189
|
runRef.current = r;
|
|
190
190
|
r.on("event", (e) => {
|
|
191
|
-
if (mountedRef.current)
|
|
191
|
+
if (!mountedRef.current) return;
|
|
192
|
+
setEvents((prev) => [...prev, e]);
|
|
193
|
+
if (e.kind === "finished") {
|
|
194
|
+
setFinished(e);
|
|
195
|
+
setDone(true);
|
|
196
|
+
}
|
|
192
197
|
});
|
|
193
198
|
r.on("done", (f) => {
|
|
194
199
|
if (mountedRef.current) {
|
|
@@ -12,6 +12,7 @@ function MirrorView({
|
|
|
12
12
|
onFirstFrame,
|
|
13
13
|
onResize,
|
|
14
14
|
continuousTouch = false,
|
|
15
|
+
volume = 0,
|
|
15
16
|
className
|
|
16
17
|
}) {
|
|
17
18
|
const videoRef = useRef(null);
|
|
@@ -24,6 +25,14 @@ function MirrorView({
|
|
|
24
25
|
if (v) v.srcObject = stream;
|
|
25
26
|
firstFrameRef.current = false;
|
|
26
27
|
}, [stream]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const v = videoRef.current;
|
|
30
|
+
if (!v) return;
|
|
31
|
+
v.volume = Math.max(0, Math.min(1, volume));
|
|
32
|
+
v.muted = volume === 0;
|
|
33
|
+
void v.play()?.catch(() => {
|
|
34
|
+
});
|
|
35
|
+
}, [volume, stream]);
|
|
27
36
|
const handleFrameReady = useCallback(() => {
|
|
28
37
|
if (firstFrameRef.current) return;
|
|
29
38
|
const v = videoRef.current;
|
|
@@ -112,7 +121,7 @@ function MirrorView({
|
|
|
112
121
|
ref: videoRef,
|
|
113
122
|
autoPlay: true,
|
|
114
123
|
playsInline: true,
|
|
115
|
-
muted:
|
|
124
|
+
muted: volume === 0,
|
|
116
125
|
tabIndex: keyboard ? 0 : -1,
|
|
117
126
|
className,
|
|
118
127
|
onPointerDown: handlePointerDown,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MirrorView, ControlBar } from './chunk-
|
|
2
|
-
import { useMirror, useDevices } from './chunk-
|
|
3
|
-
import { useClient } from './chunk-
|
|
1
|
+
import { MirrorView, ControlBar } from './chunk-E7WMHM63.js';
|
|
2
|
+
import { useMirror, useDevices } from './chunk-Q63FQ7B5.js';
|
|
3
|
+
import { useClient } from './chunk-A5VNENHD.js';
|
|
4
4
|
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
5
5
|
import { RotateCw, Minimize2, Maximize2, X } from 'lucide-react';
|
|
6
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -128,6 +128,7 @@ function MirrorSurface({ deviceId, platform = "android", onSize, videoAspect, sh
|
|
|
128
128
|
const [hasFrame, setHasFrame] = useState(false);
|
|
129
129
|
useEffect(() => {
|
|
130
130
|
setHasFrame(false);
|
|
131
|
+
setVolume(0);
|
|
131
132
|
}, [deviceId, stream]);
|
|
132
133
|
useEffect(() => {
|
|
133
134
|
setSize(DEFAULT_SIZE);
|
|
@@ -143,18 +144,31 @@ function MirrorSurface({ deviceId, platform = "android", onSize, videoAspect, sh
|
|
|
143
144
|
},
|
|
144
145
|
[setQuality]
|
|
145
146
|
);
|
|
146
|
-
const
|
|
147
|
+
const landscape = size.width > size.height;
|
|
148
|
+
const [volume, setVolume] = useState(0);
|
|
149
|
+
const audioEnabledRef = useRef(false);
|
|
150
|
+
useEffect(() => () => {
|
|
151
|
+
if (audioEnabledRef.current) sendInput({ t: "audio", enabled: false });
|
|
152
|
+
audioEnabledRef.current = false;
|
|
153
|
+
}, [stream, sendInput]);
|
|
154
|
+
const [hasAudio, setHasAudio] = useState(false);
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
const update = () => setHasAudio(!!stream?.getAudioTracks().some((t) => t.readyState === "live"));
|
|
157
|
+
update();
|
|
158
|
+
stream?.addEventListener("addtrack", update);
|
|
159
|
+
stream?.addEventListener("removetrack", update);
|
|
160
|
+
return () => {
|
|
161
|
+
stream?.removeEventListener("addtrack", update);
|
|
162
|
+
stream?.removeEventListener("removetrack", update);
|
|
163
|
+
};
|
|
164
|
+
}, [stream]);
|
|
147
165
|
const toggleOrientation = useCallback(() => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
sendInput({ t: "rotate", orientation: next ? "landscape" : "portrait" });
|
|
151
|
-
return next;
|
|
152
|
-
});
|
|
153
|
-
}, [sendInput]);
|
|
166
|
+
sendInput({ t: "rotate", orientation: landscape ? "portrait" : "landscape" });
|
|
167
|
+
}, [sendInput, landscape]);
|
|
154
168
|
useEffect(() => {
|
|
155
169
|
manualRef.current = false;
|
|
156
170
|
setProfile("balanced");
|
|
157
|
-
|
|
171
|
+
setVolume(0);
|
|
158
172
|
}, [deviceId]);
|
|
159
173
|
const profileRef = useRef(profile);
|
|
160
174
|
useEffect(() => {
|
|
@@ -212,6 +226,7 @@ function MirrorSurface({ deviceId, platform = "android", onSize, videoAspect, sh
|
|
|
212
226
|
MirrorView,
|
|
213
227
|
{
|
|
214
228
|
stream,
|
|
229
|
+
volume: volume / 100,
|
|
215
230
|
deviceSize: size,
|
|
216
231
|
onInput: sendInput,
|
|
217
232
|
onFirstFrame: handleFirstFrame,
|
|
@@ -232,7 +247,7 @@ function MirrorSurface({ deviceId, platform = "android", onSize, videoAspect, sh
|
|
|
232
247
|
}
|
|
233
248
|
)
|
|
234
249
|
] }),
|
|
235
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
250
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [
|
|
236
251
|
/* @__PURE__ */ jsx(
|
|
237
252
|
ControlBar,
|
|
238
253
|
{
|
|
@@ -252,6 +267,28 @@ function MirrorSurface({ deviceId, platform = "android", onSize, videoAspect, sh
|
|
|
252
267
|
children: Object.keys(PROFILE_LABELS).map((p) => /* @__PURE__ */ jsx("option", { value: p, children: PROFILE_LABELS[p] }, p))
|
|
253
268
|
}
|
|
254
269
|
),
|
|
270
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1 text-xs text-foreground", children: [
|
|
271
|
+
"\u97F3\u91CF",
|
|
272
|
+
/* @__PURE__ */ jsx(
|
|
273
|
+
"input",
|
|
274
|
+
{
|
|
275
|
+
type: "range",
|
|
276
|
+
"aria-label": "\u64AD\u653E\u97F3\u91CF",
|
|
277
|
+
min: 0,
|
|
278
|
+
max: 100,
|
|
279
|
+
value: volume,
|
|
280
|
+
disabled: !hasAudio,
|
|
281
|
+
onChange: (e) => {
|
|
282
|
+
const next = Number(e.target.value);
|
|
283
|
+
if (audioEnabledRef.current !== next > 0) sendInput({ t: "audio", enabled: next > 0 });
|
|
284
|
+
audioEnabledRef.current = next > 0;
|
|
285
|
+
setVolume(next);
|
|
286
|
+
},
|
|
287
|
+
className: "w-20"
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
/* @__PURE__ */ jsx("span", { children: hasAudio ? `${volume}%` : "\u65E0\u97F3\u9891\u6D41" })
|
|
291
|
+
] }),
|
|
255
292
|
platform === "android" && /* @__PURE__ */ jsxs(
|
|
256
293
|
"button",
|
|
257
294
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn, Select, Dialog, Button, Input, Badge } from './chunk-EVHTAXQG.js';
|
|
2
|
-
import { useNodes, useDevices } from './chunk-
|
|
3
|
-
import { useClient } from './chunk-
|
|
2
|
+
import { useNodes, useDevices } from './chunk-Q63FQ7B5.js';
|
|
3
|
+
import { useClient } from './chunk-A5VNENHD.js';
|
|
4
4
|
import { useMemo, useEffect, useState, useCallback } from 'react';
|
|
5
5
|
import { Server, RefreshCw, Smartphone, Usb, Wifi, Info } from 'lucide-react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -221,7 +221,10 @@ function VirtualSpecStep({ spec, onChange, nodeId }) {
|
|
|
221
221
|
const selectedImage = spec.image_id ?? "";
|
|
222
222
|
useEffect(() => {
|
|
223
223
|
if (versionsLoading) return;
|
|
224
|
-
if (selectedImage &&
|
|
224
|
+
if (!selectedImage && availableVersions.length === 1) {
|
|
225
|
+
const only = availableVersions[0];
|
|
226
|
+
patch({ image_id: only.id, os_version: only.version, android_version: platform === "android" ? only.version : void 0 });
|
|
227
|
+
} else if (selectedImage && !availableVersions.some((o) => o.id === selectedImage)) {
|
|
225
228
|
patch({ image_id: void 0, os_version: void 0, android_version: void 0 });
|
|
226
229
|
}
|
|
227
230
|
}, [versionsLoading, selectedImage, availableVersions]);
|
|
@@ -728,11 +731,15 @@ function isRedactedProxyUrl(value) {
|
|
|
728
731
|
function isSupportedProxyUrl(value) {
|
|
729
732
|
if (!value) return true;
|
|
730
733
|
if (value.trim() !== value || !value.startsWith("http://") || value.includes("***")) return false;
|
|
734
|
+
const endpoint = value.match(/^http:\/\/(?:[^/@?#\s]+@)?([^/?#\s]+):([0-9]+)$/);
|
|
735
|
+
if (!endpoint) return false;
|
|
736
|
+
const explicitPort = Number(endpoint[2]);
|
|
737
|
+
if (!Number.isInteger(explicitPort) || explicitPort < 1 || explicitPort > 65535) return false;
|
|
731
738
|
const at = value.slice("http://".length).match(/@/g)?.length ?? 0;
|
|
732
739
|
if (at > 1) return false;
|
|
733
740
|
try {
|
|
734
741
|
const url = new URL(value);
|
|
735
|
-
return url.protocol === "http:" && (at === 0 || url.username.length > 0 && url.password.length > 0) && url.hostname.length > 0 && url.
|
|
742
|
+
return url.protocol === "http:" && (at === 0 || url.username.length > 0 && url.password.length > 0) && url.hostname.length > 0 && !url.hostname.includes(":") && Number(url.port || "80") === explicitPort && url.pathname === "/" && !url.search && !url.hash;
|
|
736
743
|
} catch {
|
|
737
744
|
return false;
|
|
738
745
|
}
|
|
@@ -827,7 +834,7 @@ function ProxySpoofStep({ spec, onChange, isReal }) {
|
|
|
827
834
|
{
|
|
828
835
|
value: proxy,
|
|
829
836
|
onChange: (e) => setProxy(e.target.value),
|
|
830
|
-
placeholder: "http://
|
|
837
|
+
placeholder: "http://host:8080 \u6216 http://user:password@host:8080",
|
|
831
838
|
className: proxyInvalid ? "border-destructive" : void 0
|
|
832
839
|
}
|
|
833
840
|
),
|
|
@@ -840,7 +847,7 @@ function ProxySpoofStep({ spec, onChange, isReal }) {
|
|
|
840
847
|
/* @__PURE__ */ jsx("code", { children: ":" }),
|
|
841
848
|
" \u7B49\u7279\u6B8A\u5B57\u7B26\u5FC5\u987B\u505A URL \u767E\u5206\u53F7\u7F16\u7801\uFF1BUDP/QUIC/DNS \u4E0D\u7ECF\u8FC7\u6B64\u4EE3\u7406\uFF0C\u4FDD\u6301\u76F4\u8FDE\u3002 \u7528\u6237\u540D\u548C\u5BC6\u7801\u53EF\u4E0D\u586B\uFF1B\u7559\u7A7A\u8868\u793A\u4E0D\u4F7F\u7528\u4EE3\u7406\u3002"
|
|
842
849
|
] }),
|
|
843
|
-
proxyInvalid && /* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-destructive", children: "\u8BF7\u8F93\u5165\
|
|
850
|
+
proxyInvalid && /* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-destructive", children: "\u8BF7\u8F93\u5165 http://\u4E3B\u673A:\u7AEF\u53E3 \u6216 http://\u7528\u6237\u540D:\u5BC6\u7801@\u4E3B\u673A:\u7AEF\u53E3\uFF1B\u4E0D\u652F\u6301 socks/https\u3002" })
|
|
844
851
|
] })
|
|
845
852
|
] }),
|
|
846
853
|
/* @__PURE__ */ jsxs("section", { className: "space-y-2", children: [
|
|
@@ -893,7 +900,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
893
900
|
const canNext = (() => {
|
|
894
901
|
if (step === 0) return true;
|
|
895
902
|
if (step === 1) return !!nodeId;
|
|
896
|
-
if (step === 2) return kind === "virtual" ?
|
|
903
|
+
if (step === 2) return kind === "virtual" ? !!spec.image_id : !!picked;
|
|
897
904
|
return true;
|
|
898
905
|
})();
|
|
899
906
|
const enrollDiscovered = async (d) => {
|
|
@@ -908,6 +915,10 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
908
915
|
}
|
|
909
916
|
};
|
|
910
917
|
const finish = async () => {
|
|
918
|
+
if (kind === "virtual" && !spec.image_id) {
|
|
919
|
+
setError("\u8BF7\u9009\u62E9\u8BE5\u8282\u70B9\u5DF2\u5B89\u88C5\u7684\u7CFB\u7EDF\u7248\u672C\u540E\u518D\u521B\u5EFA\u3002");
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
911
922
|
setBusy(true);
|
|
912
923
|
setError("");
|
|
913
924
|
try {
|
|
@@ -1013,7 +1024,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1013
1024
|
Button,
|
|
1014
1025
|
{
|
|
1015
1026
|
size: "sm",
|
|
1016
|
-
disabled: busy || !proxyOk || kind === "virtual" && (quantity < 1 || quantity > 20),
|
|
1027
|
+
disabled: busy || !proxyOk || kind === "virtual" && !spec.image_id || kind === "virtual" && (quantity < 1 || quantity > 20),
|
|
1017
1028
|
onClick: finish,
|
|
1018
1029
|
children: busy ? "\u521B\u5EFA\u4E2D\u2026" : quantity > 1 ? `\u521B\u5EFA ${quantity} \u53F0` : "\u521B\u5EFA"
|
|
1019
1030
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MirrorSession, normalizeDevices, submitBatch } from './chunk-BUW45GM2.js';
|
|
2
|
-
import { useDevice, useAixConfig, useClient, useQuery } from './chunk-
|
|
2
|
+
import { useDevice, useAixConfig, useClient, useQuery } from './chunk-A5VNENHD.js';
|
|
3
3
|
import { FlowRun } from './chunk-JTFZSFFA.js';
|
|
4
4
|
import { isFleetRunTerminal, resolveConfig, joinUrl, AixAuthError, AixError, detectEnvOs, EnvRun, summarizeEnv, ReconnectingSocket, executionWsTicketUrl } from './chunk-B2BOVLI6.js';
|
|
5
5
|
import { createContext, useState, useRef, useEffect, useCallback, useMemo, createElement, useContext } from 'react';
|
|
@@ -272,6 +272,11 @@ var en = {
|
|
|
272
272
|
"recycle.purge": "Purge",
|
|
273
273
|
"recycle.purging": "Deleting\u2026",
|
|
274
274
|
// ── ShortcutBar ──
|
|
275
|
+
"shortcutBar.noResult": "No result returned",
|
|
276
|
+
"shortcutBar.download": "Download screenshot",
|
|
277
|
+
"shortcutBar.copy": "Copy text",
|
|
278
|
+
"shortcutBar.copied": "Copied",
|
|
279
|
+
"shortcutBar.emptyClipboard": "Device clipboard is empty",
|
|
275
280
|
"shortcutBar.edit": "Edit",
|
|
276
281
|
"shortcutBar.newCustom": "New custom shortcut",
|
|
277
282
|
"shortcutBar.more": "More",
|
|
@@ -929,6 +934,11 @@ var zh = {
|
|
|
929
934
|
"recycle.purge": "\u5F7B\u5E95\u5220\u9664",
|
|
930
935
|
"recycle.purging": "\u5220\u9664\u4E2D\u2026",
|
|
931
936
|
// ── ShortcutBar ──
|
|
937
|
+
"shortcutBar.noResult": "\u8BBE\u5907\u672A\u8FD4\u56DE\u7ED3\u679C",
|
|
938
|
+
"shortcutBar.download": "\u4E0B\u8F7D\u622A\u56FE",
|
|
939
|
+
"shortcutBar.copy": "\u590D\u5236\u6587\u672C",
|
|
940
|
+
"shortcutBar.copied": "\u5DF2\u590D\u5236",
|
|
941
|
+
"shortcutBar.emptyClipboard": "\u8BBE\u5907\u526A\u8D34\u677F\u4E3A\u7A7A",
|
|
932
942
|
"shortcutBar.edit": "\u7F16\u8F91",
|
|
933
943
|
"shortcutBar.newCustom": "\u65B0\u5EFA\u81EA\u5B9A\u4E49\u5FEB\u6377",
|
|
934
944
|
"shortcutBar.more": "\u66F4\u591A",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useAixT } from './chunk-
|
|
1
|
+
import { useAixT } from './chunk-T3QVYTOT.js';
|
|
2
2
|
import { LogConsole } from './chunk-FW23FLAF.js';
|
|
3
|
-
import { MirrorSurface, DeviceMirror } from './chunk-
|
|
4
|
-
import { ControlBar, MirrorView } from './chunk-
|
|
5
|
-
import { createProxyProbeGuard, proxySummaryFromDevice, isProxyApplyStatus, proxyCapabilityReason, proxyProbeExitIp, proxyProbeMessage, DeviceCreate, isProxyProbeUnsupported, isRedactedProxyUrl, isSupportedProxyUrl, redactProxyUrl } from './chunk-
|
|
3
|
+
import { MirrorSurface, DeviceMirror } from './chunk-M7CKUC4U.js';
|
|
4
|
+
import { ControlBar, MirrorView } from './chunk-E7WMHM63.js';
|
|
5
|
+
import { createProxyProbeGuard, proxySummaryFromDevice, isProxyApplyStatus, proxyCapabilityReason, proxyProbeExitIp, proxyProbeMessage, DeviceCreate, isProxyProbeUnsupported, isRedactedProxyUrl, isSupportedProxyUrl, redactProxyUrl } from './chunk-P2Y655SL.js';
|
|
6
6
|
import { cn, Badge, Button, Dialog, Input, Popover, Select, useToast, ToastViewport, Drawer } from './chunk-EVHTAXQG.js';
|
|
7
|
-
import { useDevicesView, useShortcutsView, GROUP_MIRROR_MAX, useGroupMirror, useScripts, useFleetRun, useTaskAgentRun, preflightTaskAgentDevice, createAgentTaskRunner, useNodesView } from './chunk-
|
|
7
|
+
import { useDevicesView, useShortcutsView, GROUP_MIRROR_MAX, useGroupMirror, useScripts, useFleetRun, useTaskAgentRun, preflightTaskAgentDevice, createAgentTaskRunner, useNodesView } from './chunk-Q63FQ7B5.js';
|
|
8
8
|
import { DeviceSession, pushFile, pullFile } from './chunk-LAZ3RQ7X.js';
|
|
9
|
-
import { useClient } from './chunk-
|
|
9
|
+
import { useClient } from './chunk-A5VNENHD.js';
|
|
10
10
|
import { useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect } from 'react';
|
|
11
11
|
import * as Icons from 'lucide-react';
|
|
12
12
|
import { Monitor, Eye, Play, Power, RefreshCw, Server, Pencil, Trash2, FolderPlus, Upload, ArrowUp, Folder, File, Download, Dices, ShieldCheck, AlertTriangle, X, Crown, RotateCcw, Square, Plus, Search, LayoutGrid, List, ChevronLeft, Link, Link2Off, Terminal as Terminal$1, PackagePlus, MonitorPlay, ChevronRight, ChevronDown, PlusSquare, Maximize2, Info, ChevronsLeft, ChevronsRight, Check, Copy, Tablet, Smartphone } from 'lucide-react';
|
|
@@ -1763,8 +1763,10 @@ function RailIcon({
|
|
|
1763
1763
|
}
|
|
1764
1764
|
function ShortcutBar({ deviceIds, platform = "any", orientation = "horizontal", className }) {
|
|
1765
1765
|
const t = useAixT();
|
|
1766
|
+
const client = useClient();
|
|
1766
1767
|
const { shortcuts, fetch: fetch2, runShortcut, runPower } = useShortcutsView();
|
|
1767
1768
|
const { fetchDevices } = useDevicesView();
|
|
1769
|
+
const [results, setResults] = useState(null);
|
|
1768
1770
|
const [active, setActive] = useState(null);
|
|
1769
1771
|
const [manage, setManage] = useState(null);
|
|
1770
1772
|
const [feedback, setFeedback] = useState(null);
|
|
@@ -1787,16 +1789,16 @@ function ShortcutBar({ deviceIds, platform = "any", orientation = "horizontal",
|
|
|
1787
1789
|
}
|
|
1788
1790
|
};
|
|
1789
1791
|
const visible = useMemo(
|
|
1790
|
-
() => shortcuts.filter((s) => s.platform === "any" || s.platform === platform),
|
|
1792
|
+
() => shortcuts.filter((s) => (s.platform === "any" || s.platform === platform) && (s.visibility !== "system" || !["Home", "\u4E3B\u9875", "Back", "\u6700\u8FD1\u4EFB\u52A1", "\u7C98\u8D34\u6587\u672C", "\u8F93\u5165\u6587\u672C", "\u5F00\u673A", "\u5173\u673A", "\u91CD\u542F\u8BBE\u5907", "\u542F\u52A8\u5E94\u7528"].includes(s.name))),
|
|
1791
1793
|
[shortcuts, platform]
|
|
1792
1794
|
);
|
|
1793
1795
|
const doPower = async (s) => {
|
|
1794
|
-
if (deviceIds.length === 0) return;
|
|
1796
|
+
if (deviceIds.length === 0 || runningId) return;
|
|
1795
1797
|
setRunningId(s.id);
|
|
1796
1798
|
showFeedback({ tone: "warn", key: "shortcutBar.running", vars: { name: s.name }, busy: true }, false);
|
|
1797
1799
|
try {
|
|
1798
|
-
const
|
|
1799
|
-
showFeedback(powerFeedback(s.name,
|
|
1800
|
+
const results2 = await runPower(s, deviceIds);
|
|
1801
|
+
showFeedback(powerFeedback(s.name, results2));
|
|
1800
1802
|
} catch (e) {
|
|
1801
1803
|
showFeedback({ tone: "err", key: "shortcutBar.failed", vars: { name: s.name, error: String(e) } });
|
|
1802
1804
|
} finally {
|
|
@@ -1805,13 +1807,34 @@ function ShortcutBar({ deviceIds, platform = "any", orientation = "horizontal",
|
|
|
1805
1807
|
void fetchDevices();
|
|
1806
1808
|
};
|
|
1807
1809
|
const doScript = async (s, values) => {
|
|
1808
|
-
if (deviceIds.length === 0) return;
|
|
1810
|
+
if (deviceIds.length === 0 || runningId) return;
|
|
1809
1811
|
setRunningId(s.id);
|
|
1810
1812
|
showFeedback({ tone: "warn", key: "shortcutBar.running", vars: { name: s.name }, busy: true }, false);
|
|
1811
1813
|
try {
|
|
1812
|
-
const
|
|
1813
|
-
|
|
1814
|
-
|
|
1814
|
+
const capture = s.visibility === "system" && s.body.trim() === "await device.screenshot();";
|
|
1815
|
+
const clipboard = s.visibility === "system" && s.body.includes("device.getClipboard()");
|
|
1816
|
+
if (capture || clipboard) {
|
|
1817
|
+
const rows = await Promise.all(deviceIds.map(async (deviceId) => {
|
|
1818
|
+
try {
|
|
1819
|
+
if (capture) {
|
|
1820
|
+
const value2 = await client.devices.screenshot(deviceId);
|
|
1821
|
+
if (!value2.png_base64) throw new Error(t("shortcutBar.noResult"));
|
|
1822
|
+
return { deviceId, image: `data:image/png;base64,${value2.png_base64}` };
|
|
1823
|
+
}
|
|
1824
|
+
const value = await client.devices.op(deviceId, { op: "get_clipboard" });
|
|
1825
|
+
if (typeof value.text !== "string") throw new Error(t("shortcutBar.noResult"));
|
|
1826
|
+
return { deviceId, text: value.text };
|
|
1827
|
+
} catch (e) {
|
|
1828
|
+
return { deviceId, error: e.message };
|
|
1829
|
+
}
|
|
1830
|
+
}));
|
|
1831
|
+
setResults({ name: s.name, rows });
|
|
1832
|
+
showFeedback(powerFeedback(s.name, rows.map((row) => ({ device_id: row.deviceId, ok: !row.error, error: row.error }))));
|
|
1833
|
+
} else {
|
|
1834
|
+
const run = await runShortcut(s, values, deviceIds);
|
|
1835
|
+
if (run) showFeedback(scriptFeedback(s.name, run));
|
|
1836
|
+
else showFeedback(null);
|
|
1837
|
+
}
|
|
1815
1838
|
} catch (e) {
|
|
1816
1839
|
showFeedback({ tone: "err", key: "shortcutBar.failed", vars: { name: s.name, error: String(e) } });
|
|
1817
1840
|
} finally {
|
|
@@ -1834,6 +1857,26 @@ function ShortcutBar({ deviceIds, platform = "any", orientation = "horizontal",
|
|
|
1834
1857
|
setActive(s);
|
|
1835
1858
|
};
|
|
1836
1859
|
const dialogs = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1860
|
+
/* @__PURE__ */ jsx(Dialog, { open: results !== null, onClose: () => setResults(null), title: results?.name ?? "", children: /* @__PURE__ */ jsx("div", { className: "max-h-[70vh] space-y-4 overflow-auto", children: results?.rows.map((row) => /* @__PURE__ */ jsxs("section", { className: "space-y-2", children: [
|
|
1861
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: row.deviceId }),
|
|
1862
|
+
row.error && /* @__PURE__ */ jsx("p", { role: "alert", className: "whitespace-pre-wrap text-xs text-red-600", children: row.error }),
|
|
1863
|
+
row.image && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1864
|
+
/* @__PURE__ */ jsx("img", { src: row.image, alt: results.name, className: "mx-auto max-h-[55vh] max-w-full rounded object-contain" }),
|
|
1865
|
+
/* @__PURE__ */ jsx("a", { href: row.image, download: `${row.deviceId}-${Date.now()}.png`, className: "text-sm underline", children: t("shortcutBar.download") })
|
|
1866
|
+
] }),
|
|
1867
|
+
row.text !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1868
|
+
/* @__PURE__ */ jsx("textarea", { readOnly: true, value: row.text, "aria-label": results.name, className: "min-h-32 w-full rounded border border-border bg-background p-2 text-sm" }),
|
|
1869
|
+
row.text === "" && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("shortcutBar.emptyClipboard") }),
|
|
1870
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", disabled: !row.text, onClick: async () => {
|
|
1871
|
+
try {
|
|
1872
|
+
await navigator.clipboard.writeText(row.text);
|
|
1873
|
+
showFeedback({ tone: "ok", key: "shortcutBar.copied", vars: {} });
|
|
1874
|
+
} catch (e) {
|
|
1875
|
+
showFeedback({ tone: "err", key: "shortcutBar.failed", vars: { name: results.name, error: String(e) } });
|
|
1876
|
+
}
|
|
1877
|
+
}, children: t("shortcutBar.copy") })
|
|
1878
|
+
] })
|
|
1879
|
+
] }, row.deviceId)) }) }),
|
|
1837
1880
|
active && /* @__PURE__ */ jsx(
|
|
1838
1881
|
ShortcutRunDialog,
|
|
1839
1882
|
{
|
package/dist/core/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export { A as AdbResult, D as DeviceChannel, b as DeviceTunnel, c as ScriptDebug
|
|
|
4
4
|
export { A as AutomationQueue, B as BatchConfig, F as FlowEvent, a as FlowRun, b as FlowSubmit, Q as QueueMode, s as submitBatch } from '../automation-queue-BxrSIkG3.js';
|
|
5
5
|
import { h as ScriptParam } from '../types-C2WXVcam.js';
|
|
6
6
|
export { i as AdbScanResult, d as AgentTaskBlocker, j as AgentTaskCurrentAttempt, k as AgentTaskEvent, l as AgentTaskEventsResult, e as AgentTaskEvidence, m as AgentTaskReadResult, n as AgentTaskReadTarget, o as AgentTaskSubmitInput, p as AgentTaskSubmitResult, c as AgentTaskTarget, A as AgentTaskTargetStatus, q as ApiTokenRow, r as AppCandidate, s as AppEntry, t as AppTemplate, u as AppTemplateItemAndroid, v as AppTemplateItemIos, w as AuthResult, B as BalanceLedgerRow, x as BalanceResp, y as BillingPlan, C as CatalogBrand, z as CatalogModel, E as Cluster, F as ClusterMode, G as CreateClusterInput, H as CreateLocatorInput, I as CreateProjectInput, J as CreateProjectResult, K as CreateTokenInput, L as CreateWebhookInput, M as CreatedToken, g as Decimal, O as DeveloperRef, Q as DeviceLocation, R as DeviceOp, T as DeviceProfileView, U as DeviceRate, D as DeviceRow, V as DeviceUsageSession, b as DiscoveredDevice, W as DiscoveredStatus, X as ElementNode, Y as FleetMode, Z as FleetRunDetail, _ as FleetRunDeviceRow, $ as FleetRunSubmit, a0 as ImageArtifact, a1 as ImageInput, a2 as ImageOption, a3 as InstallAntiDetectResult, a4 as IosAccountState, a5 as IosDeviceRow, a6 as IosLibraryApp, a7 as IosLoginResult, a8 as IosScanResult, a9 as KnownDeviceOpName, aa as LlmTestResult, ab as Locator, ac as MdnsEntry, ad as NewAppTemplate, ae as NewShortcut, af as NodeEffectiveCaps, ag as NodeOwnerPolicy, N as NodeRow, ah as NodeScope, ai as OwnNodeDailyCharge, aj as PlanInput, ak as PlatformOem, al as PlatformOemInput, am as PowerAction, an as PowerRunResult, ao as ProfileOverrides, ap as Project, aq as ProjectSubscription, ar as ProjectUserResult, a as ProvisionResult, P as ProvisionSpec, as as ProvisionUserInput, at as ProvisionUserResult, au as ProxyApplyReceipt, av as ProxyApplyStatus, aw as ProxyPatchResult, ax as ProxyProbe, ay as ProxyProbeErrorCode, az as ProxySummary, aA as ProxyUrl, aB as RateInput, aC as RebateLedgerRow, aD as RecycledDeviceRow, aE as RegisterNodeInput, aF as RegisterNodeResult, aG as ScreenshotResult, S as Script, f as ScriptSummary, aH as SendCodeResult, aI as SetDataRootResult, aJ as SetDisguiseResult, aK as SetProfileResult, aL as Shortcut, aM as ShortcutParam, aN as ShortcutRunResult, aO as SubscribeInput, aP as TaskEvent, aQ as TaskEventsResult, aR as TaskListFilter, aS as TaskListResult, aT as TaskStatus, aU as TaskSubmitResult, aV as TaskSummary, aW as TaskTarget, aX as TopupInput, aY as TopupResult, aZ as UpdateNodeInput, a_ as User, a$ as VerifyCodeResult, b0 as WebhookConfig } from '../types-C2WXVcam.js';
|
|
7
|
-
import { C as ControlMessage } from '../mirror-session-
|
|
8
|
-
export { I as InputMessage, M as MirrorSession, S as SCRCPY_PROFILES, a as ScrcpyProfile, b as ScrcpyProfileName, q as qualityMessage } from '../mirror-session-
|
|
7
|
+
import { C as ControlMessage } from '../mirror-session-BP7Rd3Jk.js';
|
|
8
|
+
export { I as InputMessage, M as MirrorSession, S as SCRCPY_PROFILES, a as ScrcpyProfile, b as ScrcpyProfileName, q as qualityMessage } from '../mirror-session-BP7Rd3Jk.js';
|
|
9
9
|
import { B as Box, D as DeviceSize } from '../coords-LPR_MPyp.js';
|
|
10
10
|
export { a as DevicePoint, t as toDevicePoint } from '../coords-LPR_MPyp.js';
|
|
11
11
|
export { D as DeviceTransport, N as NormalizedDevice, n as normalizeDevices } from '../device-normalize-BaThgnH7.js';
|
package/dist/i18n/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AixI18nProvider, useAixLang, useAixT } from '../chunk-
|
|
1
|
+
export { AixI18nProvider, useAixLang, useAixT } from '../chunk-T3QVYTOT.js';
|
|
@@ -3,6 +3,9 @@ import { A as AixConfig, R as ResolvedConfig } from './config-CLi5IhmO.js';
|
|
|
3
3
|
/** Mirrors the node's `ControlMsg` (webrtc/control.rs): `t`-tagged, coords
|
|
4
4
|
* normalized [0,1] (node scales to px). Sent over the `control` DataChannel. */
|
|
5
5
|
type ControlMessage = {
|
|
6
|
+
t: 'audio';
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
} | {
|
|
6
9
|
t: 'tap';
|
|
7
10
|
x: number;
|
|
8
11
|
y: number;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import react__default, { ReactNode } from 'react';
|
|
|
3
3
|
import { A as AixConfig, R as ResolvedConfig, c as AixClient, e as EnvEventKind, q as EnvFinished, t as EnvSetupInput, x as EnvTeardownInput, E as EnvOs } from '../config-CLi5IhmO.js';
|
|
4
4
|
import { D as DeviceChannel, A as AdbResult, W as WdaResult, S as ScriptEvent, e as ScriptRunInput } from '../script-debugger-DtUGxK9i.js';
|
|
5
5
|
import { F as FlowEvent, b as FlowSubmit, B as BatchConfig } from '../automation-queue-BxrSIkG3.js';
|
|
6
|
-
import { M as MirrorSession, I as InputMessage, b as ScrcpyProfileName } from '../mirror-session-
|
|
6
|
+
import { M as MirrorSession, I as InputMessage, b as ScrcpyProfileName } from '../mirror-session-BP7Rd3Jk.js';
|
|
7
7
|
import { w as AuthResult, aH as SendCodeResult, a$ as VerifyCodeResult, ap as Project, I as CreateProjectInput, J as CreateProjectResult, am as PowerAction, aG as ScreenshotResult, X as ElementNode, D as DeviceRow, N as NodeRow, ah as NodeScope, aF as RegisterNodeResult, ag as NodeOwnerPolicy, aL as Shortcut, ae as NewShortcut, aN as ShortcutRunResult, an as PowerRunResult, f as ScriptSummary, S as Script, E as Cluster, G as CreateClusterInput, Z as FleetRunDetail, Y as FleetMode, d as AgentTaskBlocker, e as AgentTaskEvidence, aT as TaskStatus, aV as TaskSummary, aR as TaskListFilter, b0 as WebhookConfig, L as CreateWebhookInput, aE as RegisterNodeInput, ab as Locator, H as CreateLocatorInput, a0 as ImageArtifact, a1 as ImageInput, aa as LlmTestResult, U as DeviceRate, aB as RateInput, y as BillingPlan, aj as PlanInput, V as DeviceUsageSession, aC as RebateLedgerRow, x as BalanceResp, aX as TopupInput, aY as TopupResult, q as ApiTokenRow, K as CreateTokenInput, M as CreatedToken } from '../types-C2WXVcam.js';
|
|
8
8
|
import { a as TaskAgentDevice, b as TaskAgentDeviceStatus, T as TaskAgentRunner } from '../task-agent-runner-DzV_OUZ7.js';
|
|
9
9
|
export { D as Device, i as DevicesProvider, j as DevicesProviderProps, k as DevicesView, c as TaskAgentNodeSnapshot, d as TaskAgentPreflightResult, e as TaskAgentRunRequest, f as TaskAgentStreamEvent, g as TaskAgentTarget, m as mapDevice, p as preflightTaskAgentDevice, u as useDevicesView } from '../task-agent-runner-DzV_OUZ7.js';
|
package/dist/react/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { DevicesProvider, GROUP_MIRROR_MAX, InspectorProvider, NodesProvider, ShortcutsProvider, mapDevice, preflightTaskAgentDevice, useAdmin, useApiTokens, useAuth, useAutomationQueue, useBilling, useClusters, useCommands, useDeviceActions, useDevices, useDevicesView, useEnvGate, useFleetRun, useFlowRun, useGroupMirror, useImages, useInspector, useInspectorView, useLlm, useLocators, useMirror, useNodes, useNodesView, useProjects, useScriptRun, useScripts, useShortcutsView, useTaskAgentRun, useTaskStatus, useTasks, useWebhooks } from '../chunk-
|
|
1
|
+
export { DevicesProvider, GROUP_MIRROR_MAX, InspectorProvider, NodesProvider, ShortcutsProvider, mapDevice, preflightTaskAgentDevice, useAdmin, useApiTokens, useAuth, useAutomationQueue, useBilling, useClusters, useCommands, useDeviceActions, useDevices, useDevicesView, useEnvGate, useFleetRun, useFlowRun, useGroupMirror, useImages, useInspector, useInspectorView, useLlm, useLocators, useMirror, useNodes, useNodesView, useProjects, useScriptRun, useScripts, useShortcutsView, useTaskAgentRun, useTaskStatus, useTasks, useWebhooks } from '../chunk-Q63FQ7B5.js';
|
|
2
2
|
import '../chunk-BUW45GM2.js';
|
|
3
3
|
import '../chunk-LAZ3RQ7X.js';
|
|
4
|
-
export { AixProvider, useAixConfig, useClient, useDevice, useEnvRun, useQuery, useScript } from '../chunk-
|
|
4
|
+
export { AixProvider, useAixConfig, useClient, useDevice, useEnvRun, useQuery, useScript } from '../chunk-A5VNENHD.js';
|
|
5
5
|
import '../chunk-JTFZSFFA.js';
|
|
6
6
|
import '../chunk-B2BOVLI6.js';
|
|
7
7
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/billing.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useAixT } from '../chunk-
|
|
1
|
+
import { useAixT } from '../chunk-T3QVYTOT.js';
|
|
2
2
|
import { cn, Button, Badge, Input } from '../chunk-EVHTAXQG.js';
|
|
3
|
-
import { useBilling } from '../chunk-
|
|
3
|
+
import { useBilling } from '../chunk-Q63FQ7B5.js';
|
|
4
4
|
import '../chunk-BUW45GM2.js';
|
|
5
5
|
import '../chunk-LAZ3RQ7X.js';
|
|
6
|
-
import { useClient } from '../chunk-
|
|
6
|
+
import { useClient } from '../chunk-A5VNENHD.js';
|
|
7
7
|
import '../chunk-JTFZSFFA.js';
|
|
8
8
|
import '../chunk-B2BOVLI6.js';
|
|
9
9
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/device-create.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { AddWirelessDeviceDialog, DeviceCreate, NodePicker, ProxySpoofStep, RealDiscoverStep, VirtualSpecStep } from '../chunk-
|
|
1
|
+
export { AddWirelessDeviceDialog, DeviceCreate, NodePicker, ProxySpoofStep, RealDiscoverStep, VirtualSpecStep } from '../chunk-P2Y655SL.js';
|
|
2
2
|
import '../chunk-EVHTAXQG.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-Q63FQ7B5.js';
|
|
4
4
|
import '../chunk-BUW45GM2.js';
|
|
5
5
|
import '../chunk-LAZ3RQ7X.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-A5VNENHD.js';
|
|
7
7
|
import '../chunk-JTFZSFFA.js';
|
|
8
8
|
import '../chunk-B2BOVLI6.js';
|
|
9
9
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/device-mirror.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { DeviceBootSplash, DeviceMirror, MirrorSurface } from '../chunk-
|
|
1
|
+
export { DeviceBootSplash, DeviceMirror, MirrorSurface } from '../chunk-M7CKUC4U.js';
|
|
2
2
|
import '../chunk-OEZFYKL6.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-E7WMHM63.js';
|
|
4
|
+
import '../chunk-Q63FQ7B5.js';
|
|
5
5
|
import '../chunk-BUW45GM2.js';
|
|
6
6
|
import '../chunk-LAZ3RQ7X.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-A5VNENHD.js';
|
|
8
8
|
import '../chunk-JTFZSFFA.js';
|
|
9
9
|
import '../chunk-B2BOVLI6.js';
|
|
10
10
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/devices.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { BulkInstallAppsDialog, DeleteDeviceDialog, DeviceCard, DeviceConnect, DeviceDetailDrawer, DeviceEditDialog, DeviceSelector, DeviceTerminal, DevicesPage, FileManager, FingerprintPanel, GroupMirrorModal, NodeRegister, RecycleBinPanel, RefreshParamsButton, RunScriptDialog, ScriptParamForm, SharedParamsForm, ShortcutBar, ShortcutEditDialog, ShortcutRunDialog, TagEditor, TaskAgentDialog, resolveSharedRow, variablesToParams } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { BulkInstallAppsDialog, DeleteDeviceDialog, DeviceCard, DeviceConnect, DeviceDetailDrawer, DeviceEditDialog, DeviceSelector, DeviceTerminal, DevicesPage, FileManager, FingerprintPanel, GroupMirrorModal, NodeRegister, RecycleBinPanel, RefreshParamsButton, RunScriptDialog, ScriptParamForm, SharedParamsForm, ShortcutBar, ShortcutEditDialog, ShortcutRunDialog, TagEditor, TaskAgentDialog, resolveSharedRow, variablesToParams } from '../chunk-VKPKHUHU.js';
|
|
2
|
+
import '../chunk-T3QVYTOT.js';
|
|
3
3
|
import '../chunk-FW23FLAF.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-M7CKUC4U.js';
|
|
5
5
|
import '../chunk-OEZFYKL6.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-E7WMHM63.js';
|
|
7
|
+
import '../chunk-P2Y655SL.js';
|
|
8
8
|
import '../chunk-EVHTAXQG.js';
|
|
9
|
-
export { createAgentTaskRunner, preflightTaskAgentDevice } from '../chunk-
|
|
9
|
+
export { createAgentTaskRunner, preflightTaskAgentDevice } from '../chunk-Q63FQ7B5.js';
|
|
10
10
|
import '../chunk-BUW45GM2.js';
|
|
11
11
|
import '../chunk-LAZ3RQ7X.js';
|
|
12
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-A5VNENHD.js';
|
|
13
13
|
import '../chunk-JTFZSFFA.js';
|
|
14
14
|
import '../chunk-B2BOVLI6.js';
|
|
15
15
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/editor.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ScriptStudio } from '../chunk-
|
|
1
|
+
import { ScriptStudio } from '../chunk-6S3XLY5O.js';
|
|
2
2
|
import { useAixNav } from '../chunk-5BMFMDQR.js';
|
|
3
|
-
import { useAixT } from '../chunk-
|
|
3
|
+
import { useAixT } from '../chunk-T3QVYTOT.js';
|
|
4
4
|
import '../chunk-FW23FLAF.js';
|
|
5
5
|
import { Select, cn } from '../chunk-EVHTAXQG.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-Q63FQ7B5.js';
|
|
7
7
|
import '../chunk-BUW45GM2.js';
|
|
8
8
|
import '../chunk-LAZ3RQ7X.js';
|
|
9
|
-
import { useClient } from '../chunk-
|
|
9
|
+
import { useClient } from '../chunk-A5VNENHD.js';
|
|
10
10
|
import '../chunk-JTFZSFFA.js';
|
|
11
11
|
import '../chunk-B2BOVLI6.js';
|
|
12
12
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { ControlBar, ControlBarProps, MirrorView, MirrorViewProps } from './mirr
|
|
|
6
6
|
import { E as EnvOs, d as EnvRoute, e as EnvEventKind } from '../config-CLi5IhmO.js';
|
|
7
7
|
import { N as NodeRow } from '../types-C2WXVcam.js';
|
|
8
8
|
import '../coords-LPR_MPyp.js';
|
|
9
|
-
import '../mirror-session-
|
|
9
|
+
import '../mirror-session-BP7Rd3Jk.js';
|
|
10
10
|
|
|
11
11
|
interface DebugConsoleProps {
|
|
12
12
|
events: ScriptEvent[];
|
package/dist/ui/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { ControlBar, MirrorView } from '../chunk-
|
|
1
|
+
export { ControlBar, MirrorView } from '../chunk-E7WMHM63.js';
|
|
2
2
|
import { Button, Input } from '../chunk-EVHTAXQG.js';
|
|
3
|
-
import { useScript, useEnvRun, useClient } from '../chunk-
|
|
3
|
+
import { useScript, useEnvRun, useClient } from '../chunk-A5VNENHD.js';
|
|
4
4
|
import '../chunk-JTFZSFFA.js';
|
|
5
|
-
import {
|
|
5
|
+
import { summarizeEnv, envBlocker, detectEnvOs } from '../chunk-B2BOVLI6.js';
|
|
6
6
|
import '../chunk-NWFYTFMI.js';
|
|
7
|
-
import React4, { useState, useId, useRef,
|
|
7
|
+
import React4, { useState, useId, useRef, useMemo, useEffect } from 'react';
|
|
8
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
import CodeMirror, { EditorView } from '@uiw/react-codemirror';
|
|
10
10
|
import { javascript } from '@codemirror/lang-javascript';
|
|
@@ -239,7 +239,9 @@ var btn3 = (primary) => ({
|
|
|
239
239
|
});
|
|
240
240
|
function EnvInitDialog(props) {
|
|
241
241
|
const { open, onClose, nodeId, os, route, mode = "prompt", seedEvents, onReady, onInstallWsl, title } = props;
|
|
242
|
-
const { reqId, events, finished
|
|
242
|
+
const { reqId, events, finished: streamFinished, error, setup } = useEnvRun(props.beforeSetup);
|
|
243
|
+
const confirmation = useEnvRun();
|
|
244
|
+
const confirmationStarted = useRef(false);
|
|
243
245
|
const [minimized, setMinimized] = useState(false);
|
|
244
246
|
const [started, setStarted] = useState(false);
|
|
245
247
|
const [showLogs, setShowLogs] = useState(false);
|
|
@@ -247,6 +249,25 @@ function EnvInitDialog(props) {
|
|
|
247
249
|
const [wslFailed, setWslFailed] = useState(false);
|
|
248
250
|
const readyFired = useRef(false);
|
|
249
251
|
const wslTried = useRef(false);
|
|
252
|
+
const summary = useMemo(
|
|
253
|
+
() => summarizeEnv(started ? events : seedEvents ?? []),
|
|
254
|
+
[started, events, seedEvents]
|
|
255
|
+
);
|
|
256
|
+
const checked = summarizeEnv(confirmation.events);
|
|
257
|
+
const confirmed = confirmationStarted.current && confirmation.finished ? checked.ready ? confirmation.finished : { ...confirmation.finished, ok: false, error: confirmation.finished.error ?? "\u73AF\u5883\u68C0\u67E5\u672A\u901A\u8FC7\uFF0C\u8BF7\u91CD\u8BD5\u521D\u59CB\u5316\u3002" } : null;
|
|
258
|
+
const finished = streamFinished ?? (started ? summary.finished : null) ?? confirmed;
|
|
259
|
+
const done = !!finished;
|
|
260
|
+
useEffect(() => {
|
|
261
|
+
if (!open || !started || finished || confirmationStarted.current) return;
|
|
262
|
+
const verified = summary.steps.some((s) => s.id === "verify" && ["ok", "done", "skipped", "present"].includes(s.state));
|
|
263
|
+
if (!verified) return;
|
|
264
|
+
const timer = setTimeout(() => {
|
|
265
|
+
confirmationStarted.current = true;
|
|
266
|
+
void confirmation.status(nodeId, { os }).catch(() => {
|
|
267
|
+
});
|
|
268
|
+
}, 1500);
|
|
269
|
+
return () => clearTimeout(timer);
|
|
270
|
+
}, [open, started, finished, summary.steps, confirmation.status, nodeId, os]);
|
|
250
271
|
useEffect(() => {
|
|
251
272
|
if (open) {
|
|
252
273
|
setMinimized(false);
|
|
@@ -256,6 +277,7 @@ function EnvInitDialog(props) {
|
|
|
256
277
|
setWslFailed(false);
|
|
257
278
|
readyFired.current = false;
|
|
258
279
|
wslTried.current = false;
|
|
280
|
+
confirmationStarted.current = false;
|
|
259
281
|
}
|
|
260
282
|
}, [open, nodeId]);
|
|
261
283
|
const wslBlocked = done && envBlocker(finished) === "wsl-missing" && !!onInstallWsl;
|
|
@@ -277,26 +299,24 @@ function EnvInitDialog(props) {
|
|
|
277
299
|
}
|
|
278
300
|
}, [wslBlocked, installing, wslFailed, installWsl]);
|
|
279
301
|
const begin = React4.useCallback(() => {
|
|
302
|
+
confirmation.close();
|
|
303
|
+
confirmationStarted.current = false;
|
|
280
304
|
setStarted(true);
|
|
281
305
|
void setup(nodeId, { os, route }).catch(() => {
|
|
282
306
|
});
|
|
283
|
-
}, [setup, nodeId, os, route]);
|
|
307
|
+
}, [setup, nodeId, os, route, confirmation.close]);
|
|
284
308
|
useEffect(() => {
|
|
285
309
|
if (open && mode === "auto" && !started) begin();
|
|
286
310
|
}, [open, mode, started, begin]);
|
|
287
311
|
useEffect(() => {
|
|
288
|
-
if (done && finished?.ok && !readyFired.current) {
|
|
312
|
+
if (open && started && done && finished?.ok && !readyFired.current) {
|
|
289
313
|
readyFired.current = true;
|
|
290
314
|
onReady?.();
|
|
291
315
|
}
|
|
292
|
-
}, [done, finished, onReady]);
|
|
293
|
-
const summary = useMemo(
|
|
294
|
-
() => summarizeEnv(started ? events : seedEvents ?? []),
|
|
295
|
-
[started, events, seedEvents]
|
|
296
|
-
);
|
|
316
|
+
}, [open, started, done, finished, onReady]);
|
|
297
317
|
if (!open) return null;
|
|
298
318
|
const pct = summary.steps.length ? Math.round(summary.steps.reduce((a, s) => a + (s.state === "ok" || s.state === "done" || s.state === "skipped" || s.state === "present" ? 100 : s.pct), 0) / summary.steps.length) : 0;
|
|
299
|
-
const failed = !!error || done && !!finished && !finished.ok;
|
|
319
|
+
const failed = !!error || confirmationStarted.current && !!confirmation.error || done && !!finished && !finished.ok;
|
|
300
320
|
const success = done && finished?.ok;
|
|
301
321
|
if (minimized) return /* @__PURE__ */ jsxs("div", { role: "status", style: {
|
|
302
322
|
position: "fixed",
|
|
@@ -346,7 +366,7 @@ function EnvInitDialog(props) {
|
|
|
346
366
|
/* @__PURE__ */ jsx("span", { style: { fontSize: 16, fontWeight: 600 }, children: title ?? "\u521D\u59CB\u5316 Android \u73AF\u5883\u5E95\u5EA7" }),
|
|
347
367
|
/* @__PURE__ */ jsx("button", { style: btn3(), onClick: () => setMinimized(true), children: "\u6700\u5C0F\u5316" })
|
|
348
368
|
] }),
|
|
349
|
-
/* @__PURE__ */ jsx("div", { style: { color: "var(--aix-muted, #8a8a8a)", fontSize: 13, marginBottom: 16 }, children: success ? "
|
|
369
|
+
/* @__PURE__ */ jsx("div", { style: { color: "var(--aix-muted, #8a8a8a)", fontSize: 13, marginBottom: 16 }, children: success ? "\u521D\u59CB\u5316\u6210\u529F\uFF0C\u73AF\u5883\u548C\u955C\u50CF\u5DF2\u5C31\u7EEA\uFF0C\u53EF\u4EE5\u4F7F\u7528\u4E91\u624B\u673A\u3002" : wslBlocked && wslFailed ? "\u81EA\u52A8\u5B89\u88C5 WSL \u8FD0\u884C\u65F6\u5931\u8D25\uFF08\u53EF\u80FD\u5185\u7F51\u65E0\u6CD5\u4E0B\u8F7D\uFF09\u3002\u8BF7\u6309\u4E0B\u65B9\u6B65\u9AA4\u624B\u52A8\u4E0B\u8F7D\u5B89\u88C5\u540E\u91CD\u8BD5\u3002" : wslBlocked ? '\u9700\u8981\u5148\u5B89\u88C5 WSL \u8FD0\u884C\u65F6\uFF1A\u6B63\u5728\u81EA\u52A8\u4E0B\u8F7D\u5E76\u5B89\u88C5\uFF08\u9700\u5728 UAC \u5F39\u7A97\u70B9"\u662F"\uFF0C\u7EA6 250MB\uFF09\uFF0C\u5B8C\u6210\u540E\u4F1A\u81EA\u52A8\u91CD\u542F\u5E76\u7EE7\u7EED\u3002' : failed ? "Setup failed. Review the steps below and retry." : started && !reqId ? "\u6B63\u5728\u542F\u52A8\u5E76\u8FDE\u63A5\u8282\u70B9\uFF0C\u9996\u6B21\u542F\u52A8\u4F1A\u81EA\u52A8\u68C0\u67E5\u3001\u4E0B\u8F7D\u6240\u9700\u7EC4\u4EF6\uFF0C\u53EF\u80FD\u9700\u8981\u51E0\u5206\u949F\u3002\u8FDE\u63A5\u6210\u529F\u540E\u81EA\u52A8\u5F00\u59CB\u521D\u59CB\u5316\u3002" : started ? "Installing the redroid base. This downloads ~1\u20132 GB and may take several minutes." : "This machine needs a one-time base (kernel + container runtime + image) to host cloud phones." }),
|
|
350
370
|
(started || summary.steps.length > 0) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
351
371
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, marginBottom: 14 }, children: [
|
|
352
372
|
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: 6, background: "var(--aix-border, #2a2e35)", borderRadius: 999, overflow: "hidden" }, children: /* @__PURE__ */ jsx("div", { style: { width: `${pct}%`, height: "100%", background: failed ? "var(--aix-danger, #e5484d)" : "var(--aix-accent, #2d6cdf)", transition: "width .3s" } }) }),
|
|
@@ -378,6 +398,11 @@ function EnvInitDialog(props) {
|
|
|
378
398
|
finished.hint
|
|
379
399
|
] }) : null
|
|
380
400
|
] }),
|
|
401
|
+
confirmationStarted.current && confirmation.error && !finished && /* @__PURE__ */ jsxs("div", { role: "alert", style: { marginTop: 12, color: "var(--aix-danger, #e5484d)" }, children: [
|
|
402
|
+
"\u65E0\u6CD5\u786E\u8BA4\u521D\u59CB\u5316\u7ED3\u679C\uFF1A",
|
|
403
|
+
confirmation.error.message,
|
|
404
|
+
"\u3002\u8BF7\u91CD\u65B0\u68C0\u67E5\u8282\u70B9\u72B6\u6001\u3002"
|
|
405
|
+
] }),
|
|
381
406
|
error && !finished && /* @__PURE__ */ jsxs("div", { style: { marginTop: 12, color: "var(--aix-danger, #e5484d)", fontSize: 13 }, children: [
|
|
382
407
|
"Could not start setup: ",
|
|
383
408
|
error.message
|
|
@@ -416,7 +441,7 @@ function EnvInitDialog(props) {
|
|
|
416
441
|
] }),
|
|
417
442
|
showLogs && /* @__PURE__ */ jsx("pre", { style: { marginTop: 6, maxHeight: 160, overflow: "auto", background: "var(--aix-editor-bg, #0e0f12)", color: "var(--aix-editor-fg, #cfcfcf)", padding: 10, borderRadius: 8, fontSize: 12, fontFamily: "var(--aix-mono, ui-monospace, Menlo, monospace)" }, children: summary.logs.slice(-200).join("\n") })
|
|
418
443
|
] }),
|
|
419
|
-
/* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "flex-end", gap: 10, marginTop: 18 }, children: success ? /* @__PURE__ */ jsx("button", { style: btn3(true), onClick: onClose, children: "
|
|
444
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "flex-end", gap: 10, marginTop: 18 }, children: success ? /* @__PURE__ */ jsx("button", { style: btn3(true), onClick: onClose, children: "\u5B8C\u6210" }) : wslBlocked && wslFailed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
420
445
|
/* @__PURE__ */ jsx("button", { style: btn3(), onClick: onClose, children: "\u5173\u95ED" }),
|
|
421
446
|
/* @__PURE__ */ jsx("button", { style: btn3(true), onClick: begin, children: "\u91CD\u8BD5\uFF08\u5DF2\u624B\u52A8\u88C5\u597D\uFF09" })
|
|
422
447
|
] }) : wslBlocked ? /* @__PURE__ */ jsx("button", { style: btn3(), disabled: true, onClick: () => {
|
package/dist/ui/inspector.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useAixT } from '../chunk-
|
|
1
|
+
import { useAixT } from '../chunk-T3QVYTOT.js';
|
|
2
2
|
import { Select, Button, cn, Input, Dialog } from '../chunk-EVHTAXQG.js';
|
|
3
|
-
import { useInspectorView, useDevicesView, useLocators } from '../chunk-
|
|
3
|
+
import { useInspectorView, useDevicesView, useLocators } from '../chunk-Q63FQ7B5.js';
|
|
4
4
|
import '../chunk-BUW45GM2.js';
|
|
5
5
|
import '../chunk-LAZ3RQ7X.js';
|
|
6
|
-
import { useClient } from '../chunk-
|
|
6
|
+
import { useClient } from '../chunk-A5VNENHD.js';
|
|
7
7
|
import '../chunk-JTFZSFFA.js';
|
|
8
8
|
import '../chunk-B2BOVLI6.js';
|
|
9
9
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/market.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useAixNav } from '../chunk-5BMFMDQR.js';
|
|
2
|
-
import { useAixT } from '../chunk-
|
|
3
|
-
import { useScripts } from '../chunk-
|
|
2
|
+
import { useAixT } from '../chunk-T3QVYTOT.js';
|
|
3
|
+
import { useScripts } from '../chunk-Q63FQ7B5.js';
|
|
4
4
|
import '../chunk-BUW45GM2.js';
|
|
5
5
|
import '../chunk-LAZ3RQ7X.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-A5VNENHD.js';
|
|
7
7
|
import '../chunk-JTFZSFFA.js';
|
|
8
8
|
import '../chunk-B2BOVLI6.js';
|
|
9
9
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/mirror.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import react__default from 'react';
|
|
2
2
|
import { D as DeviceSize } from '../coords-LPR_MPyp.js';
|
|
3
|
-
import { C as ControlMessage } from '../mirror-session-
|
|
3
|
+
import { C as ControlMessage } from '../mirror-session-BP7Rd3Jk.js';
|
|
4
4
|
import '../config-CLi5IhmO.js';
|
|
5
5
|
import '../types-C2WXVcam.js';
|
|
6
6
|
|
|
@@ -25,6 +25,8 @@ interface MirrorViewProps {
|
|
|
25
25
|
* without a continuous-injection backend, e.g. iOS). Android mirror turns
|
|
26
26
|
* this on so drags/scrolls follow the actual pointer path. */
|
|
27
27
|
continuousTouch?: boolean;
|
|
28
|
+
/** Local playback gain, 0 (muted) to 1. */
|
|
29
|
+
volume?: number;
|
|
28
30
|
className?: string;
|
|
29
31
|
}
|
|
30
32
|
/** Live device video that turns mouse + keyboard into `ControlMessage`s.
|
|
@@ -34,7 +36,7 @@ interface MirrorViewProps {
|
|
|
34
36
|
* - `continuousTouch`: pointerdown/move/up stream `touch_down`/`touch_move`/
|
|
35
37
|
* `touch_up` in real time, so drags follow the actual pointer path.
|
|
36
38
|
* keydown becomes a `key` (special keys) or `text` (printable) message. */
|
|
37
|
-
declare function MirrorView({ stream, deviceSize, onInput, keyboard, autoFocus, onFirstFrame, onResize, continuousTouch, className, }: MirrorViewProps): react__default.JSX.Element;
|
|
39
|
+
declare function MirrorView({ stream, deviceSize, onInput, keyboard, autoFocus, onFirstFrame, onResize, continuousTouch, volume, className, }: MirrorViewProps): react__default.JSX.Element;
|
|
38
40
|
|
|
39
41
|
interface ControlBarProps {
|
|
40
42
|
/** Picks the nav-key icon set; Android additionally gets a Menu (recents)
|
package/dist/ui/mirror.js
CHANGED
package/dist/ui/script-studio.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { CodeEditor, DeviceSelect, RunPanel, ScriptParamEditor, ScriptStudio, TimelineStep } from '../chunk-
|
|
1
|
+
export { CodeEditor, DeviceSelect, RunPanel, ScriptParamEditor, ScriptStudio, TimelineStep } from '../chunk-6S3XLY5O.js';
|
|
2
2
|
export { LogConsole } from '../chunk-FW23FLAF.js';
|
|
3
3
|
import '../chunk-EVHTAXQG.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-Q63FQ7B5.js';
|
|
5
5
|
import '../chunk-BUW45GM2.js';
|
|
6
6
|
import '../chunk-LAZ3RQ7X.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-A5VNENHD.js';
|
|
8
8
|
import '../chunk-JTFZSFFA.js';
|
|
9
9
|
import '../chunk-B2BOVLI6.js';
|
|
10
10
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/scripts.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useAixNav } from '../chunk-5BMFMDQR.js';
|
|
2
|
-
import { useAixT } from '../chunk-
|
|
2
|
+
import { useAixT } from '../chunk-T3QVYTOT.js';
|
|
3
3
|
import { cn, Badge, Button, Input } from '../chunk-EVHTAXQG.js';
|
|
4
|
-
import { useScripts } from '../chunk-
|
|
4
|
+
import { useScripts } from '../chunk-Q63FQ7B5.js';
|
|
5
5
|
import '../chunk-BUW45GM2.js';
|
|
6
6
|
import '../chunk-LAZ3RQ7X.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-A5VNENHD.js';
|
|
8
8
|
import '../chunk-JTFZSFFA.js';
|
|
9
9
|
import '../chunk-B2BOVLI6.js';
|
|
10
10
|
import '../chunk-NWFYTFMI.js';
|
package/dist/ui/tasks.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { SharedParamsForm, resolveSharedRow } from '../chunk-
|
|
2
|
-
import { useAixT } from '../chunk-
|
|
1
|
+
import { SharedParamsForm, resolveSharedRow } from '../chunk-VKPKHUHU.js';
|
|
2
|
+
import { useAixT } from '../chunk-T3QVYTOT.js';
|
|
3
3
|
import '../chunk-FW23FLAF.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-M7CKUC4U.js';
|
|
5
5
|
import '../chunk-OEZFYKL6.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-E7WMHM63.js';
|
|
7
|
+
import '../chunk-P2Y655SL.js';
|
|
8
8
|
import { Button, cn, Select, Input, Badge } from '../chunk-EVHTAXQG.js';
|
|
9
|
-
import { useDevicesView, useAutomationQueue, useApiTokens } from '../chunk-
|
|
9
|
+
import { useDevicesView, useAutomationQueue, useApiTokens } from '../chunk-Q63FQ7B5.js';
|
|
10
10
|
import { targetParam, variablesToSchema, schemaDefaults } from '../chunk-BUW45GM2.js';
|
|
11
11
|
import '../chunk-LAZ3RQ7X.js';
|
|
12
|
-
import { useClient, useAixConfig } from '../chunk-
|
|
12
|
+
import { useClient, useAixConfig } from '../chunk-A5VNENHD.js';
|
|
13
13
|
import '../chunk-JTFZSFFA.js';
|
|
14
14
|
import '../chunk-B2BOVLI6.js';
|
|
15
15
|
import '../chunk-NWFYTFMI.js';
|