@aixnn/aixautots 0.6.17 → 0.6.21

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.
Files changed (52) hide show
  1. package/dist/{automation-queue-DO8fOG6l.d.ts → automation-queue-GhfQtZLm.d.ts} +2 -2
  2. package/dist/{chunk-TJ2QIP5M.js → chunk-4NRIEM5Z.js} +249 -33
  3. package/dist/chunk-6IH74UX6.js +1693 -0
  4. package/dist/{chunk-WOPEKCVC.js → chunk-DAU3FVCV.js} +2 -2
  5. package/dist/chunk-DTXXQPOU.js +693 -0
  6. package/dist/{chunk-7BJPVSEZ.js → chunk-ED6CB3B4.js} +222 -12
  7. package/dist/{chunk-NIEGPH3E.js → chunk-FJKMRWYC.js} +55 -23
  8. package/dist/{chunk-ZDCTHR7D.js → chunk-H7KZUU67.js} +2 -2
  9. package/dist/{chunk-FJPIY4YI.js → chunk-HQ2L4NQ2.js} +262 -10
  10. package/dist/{chunk-LOKPZ677.js → chunk-JQBSGFAR.js} +2 -2
  11. package/dist/{chunk-2KPZSPV6.js → chunk-OJK35AQD.js} +105 -17
  12. package/dist/{chunk-KASSYUGM.js → chunk-RFOJSDYI.js} +2 -2
  13. package/dist/{chunk-QEK25NUA.js → chunk-UEZVXYGP.js} +12 -5
  14. package/dist/{config-CBUhr4Gl.d.ts → config-C79rcedl.d.ts} +52 -10
  15. package/dist/core/index.d.ts +13 -9
  16. package/dist/core/index.js +2 -2
  17. package/dist/core/network-adb-node.d.ts +23 -0
  18. package/dist/core/network-adb-node.js +171 -0
  19. package/dist/{script-debugger-DoT02din.d.ts → device-channel-OiZwAqNQ.d.ts} +41 -55
  20. package/dist/{device-normalize-Vl5JYbAI.d.ts → device-normalize-ODrxJb-a.d.ts} +1 -1
  21. package/dist/device-session-PVHD6PNR.js +1 -0
  22. package/dist/i18n/index.js +1 -1
  23. package/dist/{mirror-session-Y1InpkUY.d.ts → mirror-session-DifANocH.d.ts} +2 -2
  24. package/dist/react/index.d.ts +19 -12
  25. package/dist/react/index.js +3 -3
  26. package/dist/script-debugger-DjxpvdaN.d.ts +56 -0
  27. package/dist/{task-agent-runner-Cl2ickJ1.d.ts → task-agent-runner-CAt-z8gr.d.ts} +3 -3
  28. package/dist/{types-Cp1ohbTb.d.ts → types-CBI5SIH5.d.ts} +102 -4
  29. package/dist/ui/billing.d.ts +43 -6
  30. package/dist/ui/billing.js +190 -309
  31. package/dist/ui/device-create.d.ts +1 -1
  32. package/dist/ui/device-create.js +7 -7
  33. package/dist/ui/device-mirror.js +5 -5
  34. package/dist/ui/devices.d.ts +5 -5
  35. package/dist/ui/devices.js +9 -9
  36. package/dist/ui/editor.d.ts +2 -2
  37. package/dist/ui/editor.js +5 -5
  38. package/dist/ui/index.d.ts +6 -4
  39. package/dist/ui/index.js +13 -492
  40. package/dist/ui/inspector.js +4 -4
  41. package/dist/ui/ip-commerce.d.ts +2 -2
  42. package/dist/ui/ip-commerce.js +5 -5
  43. package/dist/ui/market.js +4 -4
  44. package/dist/ui/mirror.d.ts +3 -3
  45. package/dist/ui/script-studio.js +4 -4
  46. package/dist/ui/scripts.d.ts +1 -1
  47. package/dist/ui/scripts.js +4 -4
  48. package/dist/ui/settings.d.ts +164 -0
  49. package/dist/ui/settings.js +10 -0
  50. package/dist/ui/tasks.js +9 -9
  51. package/package.json +9 -1
  52. package/dist/device-session-3XK2SZDF.js +0 -1
@@ -1,10 +1,10 @@
1
- export { DeviceBootSplash, DeviceMirror, MirrorSurface, parseIosMediaCapabilities } from '../chunk-ZDCTHR7D.js';
1
+ export { DeviceBootSplash, DeviceMirror, MirrorSurface, parseIosMediaCapabilities } from '../chunk-H7KZUU67.js';
2
2
  import '../chunk-OEZFYKL6.js';
3
3
  import '../chunk-MBBVYSPD.js';
4
4
  import '../chunk-ZB5ET67B.js';
5
- import '../chunk-FJPIY4YI.js';
6
5
  import '../chunk-7RQTSTR6.js';
7
- import '../chunk-QEK25NUA.js';
8
- import '../chunk-7BJPVSEZ.js';
9
- import '../chunk-2KPZSPV6.js';
6
+ import '../chunk-HQ2L4NQ2.js';
7
+ import '../chunk-UEZVXYGP.js';
8
+ import '../chunk-ED6CB3B4.js';
9
+ import '../chunk-OJK35AQD.js';
10
10
  import '../chunk-NWFYTFMI.js';
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
- import { T as TaskAgentRunner, D as Device, a as TaskAgentDevice } from '../task-agent-runner-Cl2ickJ1.js';
3
- export { A as AgentTaskRunnerOptions, b as TaskAgentDeviceStatus, c as TaskAgentNodeSnapshot, d as TaskAgentPreflightResult, e as TaskAgentRunRequest, f as TaskAgentStreamEvent, g as TaskAgentTarget, h as createAgentTaskRunner, p as preflightTaskAgentDevice } from '../task-agent-runner-Cl2ickJ1.js';
4
- import { aQ as Shortcut, h as ScriptParam } from '../types-Cp1ohbTb.js';
5
- import '../device-normalize-Vl5JYbAI.js';
6
- import '../config-CBUhr4Gl.js';
2
+ import { T as TaskAgentRunner, D as Device, a as TaskAgentDevice } from '../task-agent-runner-CAt-z8gr.js';
3
+ export { A as AgentTaskRunnerOptions, b as TaskAgentDeviceStatus, c as TaskAgentNodeSnapshot, d as TaskAgentPreflightResult, e as TaskAgentRunRequest, f as TaskAgentStreamEvent, g as TaskAgentTarget, h as createAgentTaskRunner, p as preflightTaskAgentDevice } from '../task-agent-runner-CAt-z8gr.js';
4
+ import { aT as Shortcut, g as ScriptParam } from '../types-CBI5SIH5.js';
5
+ import '../device-normalize-ODrxJb-a.js';
6
+ import '../config-C79rcedl.js';
7
7
  import '../agent-runner-V60B0is1.js';
8
8
 
9
9
  interface DevicesPageProps {
@@ -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-TJ2QIP5M.js';
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-4NRIEM5Z.js';
2
2
  import '../chunk-3OBCSW2J.js';
3
- import '../chunk-ZDCTHR7D.js';
3
+ import '../chunk-H7KZUU67.js';
4
4
  import '../chunk-OEZFYKL6.js';
5
5
  import '../chunk-MBBVYSPD.js';
6
- import '../chunk-NIEGPH3E.js';
7
- import '../chunk-KASSYUGM.js';
8
- import '../chunk-LOKPZ677.js';
6
+ import '../chunk-FJKMRWYC.js';
7
+ import '../chunk-JQBSGFAR.js';
8
+ import '../chunk-RFOJSDYI.js';
9
9
  import '../chunk-ZB5ET67B.js';
10
- import '../chunk-FJPIY4YI.js';
11
10
  import '../chunk-7RQTSTR6.js';
12
- export { createAgentTaskRunner, preflightTaskAgentDevice } from '../chunk-QEK25NUA.js';
13
- import '../chunk-7BJPVSEZ.js';
14
- import '../chunk-2KPZSPV6.js';
11
+ import '../chunk-HQ2L4NQ2.js';
12
+ export { createAgentTaskRunner, preflightTaskAgentDevice } from '../chunk-UEZVXYGP.js';
13
+ import '../chunk-ED6CB3B4.js';
14
+ import '../chunk-OJK35AQD.js';
15
15
  import '../chunk-NWFYTFMI.js';
@@ -3,8 +3,8 @@ import { S as ScriptStudioProps } from '../ScriptStudio-DaCqOF5H.js';
3
3
  export { a as ScriptStudioSlotContext } from '../ScriptStudio-DaCqOF5H.js';
4
4
  import { a as AgentRunner } from '../agent-runner-V60B0is1.js';
5
5
  export { A as AgentKind, b as AgentSendRequest, c as AgentStreamEvent } from '../agent-runner-V60B0is1.js';
6
- import { c as AixClient } from '../config-CBUhr4Gl.js';
7
- import '../types-Cp1ohbTb.js';
6
+ import { c as AixClient } from '../config-C79rcedl.js';
7
+ import '../types-CBI5SIH5.js';
8
8
 
9
9
  interface ScriptEditorPageProps {
10
10
  /** Route param: the script to open. Undefined ⇒ a fresh "New Script". */
package/dist/ui/editor.js CHANGED
@@ -1,11 +1,11 @@
1
+ import { ScriptStudio } from '../chunk-DAU3FVCV.js';
1
2
  import { useAixNav } from '../chunk-5BMFMDQR.js';
2
- import { ScriptStudio } from '../chunk-WOPEKCVC.js';
3
3
  import '../chunk-3OBCSW2J.js';
4
- import { useAixT } from '../chunk-FJPIY4YI.js';
5
4
  import { Select, cn } from '../chunk-7RQTSTR6.js';
6
- import { useClient } from '../chunk-QEK25NUA.js';
7
- import '../chunk-7BJPVSEZ.js';
8
- import '../chunk-2KPZSPV6.js';
5
+ import { useAixT } from '../chunk-HQ2L4NQ2.js';
6
+ import { useClient } from '../chunk-UEZVXYGP.js';
7
+ import '../chunk-ED6CB3B4.js';
8
+ import '../chunk-OJK35AQD.js';
9
9
  import '../chunk-NWFYTFMI.js';
10
10
  import { useState, useEffect, useRef, useCallback } from 'react';
11
11
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -1,13 +1,15 @@
1
1
  import * as react from 'react';
2
2
  import react__default from 'react';
3
- import { S as ScriptEvent, a as ScriptEngine } from '../script-debugger-DoT02din.js';
3
+ import { S as ScriptEvent, a as ScriptEngine } from '../script-debugger-DjxpvdaN.js';
4
4
  import * as _uiw_react_codemirror from '@uiw/react-codemirror';
5
5
  export { ControlBar, ControlBarProps, MirrorView, MirrorViewProps } from './mirror.js';
6
- import { E as EnvOs, d as EnvRoute, e as EnvEventKind } from '../config-CBUhr4Gl.js';
7
- import { N as NodeRow } from '../types-Cp1ohbTb.js';
6
+ import { E as EnvOs, d as EnvRoute, e as EnvEventKind } from '../config-C79rcedl.js';
7
+ import { N as NodeRow } from '../types-CBI5SIH5.js';
8
+ export { SdkLocalNodeSection, SdkLocalNodeSectionProps, SdkLocalRuntimeAdapter, SdkNodeCapabilityRenderer, SdkNodeDetailsSection, SdkNodeDetailsSectionProps, SdkRuntimeHealthSnapshot, SdkServicePhase, SdkSessionScope, SdkSettingsGatewayBridge, SdkSettingsPage, SdkSettingsPageProps, SdkSettingsSectionsConfig, SdkUpdatePhase, SdkUpdateStatus, SdkVersionSection, SdkVersionSectionProps, SdkWalletClient, SdkWalletSection, SdkWalletSectionProps, parseSdkUpdate, sdkVersion, verifySdkCompletion } from './settings.js';
8
9
  export { IpCommercePanel, IpCommercePanelProps } from './ip-commerce.js';
10
+ import '../device-channel-OiZwAqNQ.js';
9
11
  import '../coords-LPR_MPyp.js';
10
- import '../mirror-session-Y1InpkUY.js';
12
+ import '../mirror-session-DifANocH.js';
11
13
 
12
14
  interface DebugConsoleProps {
13
15
  events: ScriptEvent[];
package/dist/ui/index.js CHANGED
@@ -1,16 +1,18 @@
1
1
  import '../chunk-ZCTAYVPK.js';
2
+ export { EnvInitDialog, NodeCapabilityPanel, SdkLocalNodeSection, SdkNodeDetailsSection, SdkSettingsPage, SdkVersionSection, SdkWalletSection, parseSdkUpdate, sdkVersion, verifySdkCompletion, vmPlan } from '../chunk-6IH74UX6.js';
3
+ import '../chunk-DTXXQPOU.js';
2
4
  export { ControlBar, MirrorView } from '../chunk-MBBVYSPD.js';
3
- import { IosDeviceDiagnostics } from '../chunk-KASSYUGM.js';
4
- export { IpCommercePanel } from '../chunk-LOKPZ677.js';
5
- import { iosPhysicalUnavailableReason } from '../chunk-ZB5ET67B.js';
6
- import '../chunk-FJPIY4YI.js';
7
- import { Button, Input } from '../chunk-7RQTSTR6.js';
8
- import { useScript, useEnvRun, useClient } from '../chunk-QEK25NUA.js';
9
- import '../chunk-7BJPVSEZ.js';
10
- import { summarizeEnv, envBlocker, detectEnvOs } from '../chunk-2KPZSPV6.js';
5
+ export { IpCommercePanel } from '../chunk-JQBSGFAR.js';
6
+ import '../chunk-RFOJSDYI.js';
7
+ import '../chunk-ZB5ET67B.js';
8
+ import '../chunk-7RQTSTR6.js';
9
+ import '../chunk-HQ2L4NQ2.js';
10
+ import { useScript } from '../chunk-UEZVXYGP.js';
11
+ import '../chunk-ED6CB3B4.js';
12
+ import '../chunk-OJK35AQD.js';
11
13
  import '../chunk-NWFYTFMI.js';
12
- import React4, { useState, useId, useRef, useMemo, useEffect } from 'react';
13
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
14
+ import { useState, useId } from 'react';
15
+ import { jsxs, jsx } from 'react/jsx-runtime';
14
16
  import CodeMirror, { EditorView } from '@uiw/react-codemirror';
15
17
  import { javascript } from '@codemirror/lang-javascript';
16
18
 
@@ -200,486 +202,5 @@ function ScriptPanel({ deviceId, defaultEngine = "scriptlet", defaultScript = ""
200
202
  )
201
203
  ] });
202
204
  }
203
- var STATE_ICON = {
204
- ok: "\u2713",
205
- done: "\u2713",
206
- skipped: "\u2298",
207
- present: "\u2713",
208
- running: "\u23F3",
209
- missing: "\xB7",
210
- pending: "\xB7",
211
- failed: "\u2715",
212
- error: "\u2715"
213
- };
214
- var stateColor = (s) => s === "failed" || s === "error" ? "var(--aix-danger, #e5484d)" : s === "ok" || s === "done" || s === "present" ? "var(--aix-accent, #2d6cdf)" : s === "running" ? "var(--aix-fg, #e6e6e6)" : "var(--aix-muted, #8a8a8a)";
215
- var overlay = {
216
- position: "fixed",
217
- inset: 0,
218
- background: "rgba(0,0,0,0.55)",
219
- display: "flex",
220
- alignItems: "center",
221
- justifyContent: "center",
222
- zIndex: 1e3
223
- };
224
- var card = {
225
- width: "min(560px, 92vw)",
226
- maxHeight: "86vh",
227
- overflow: "auto",
228
- background: "var(--aix-bg, #14161a)",
229
- color: "var(--aix-fg, #e6e6e6)",
230
- border: "1px solid var(--aix-border, #2a2e35)",
231
- borderRadius: "var(--aix-radius, 10px)",
232
- padding: "20px 22px",
233
- font: "var(--aix-font, 14px/1.5 system-ui, sans-serif)",
234
- boxShadow: "0 12px 40px rgba(0,0,0,0.5)"
235
- };
236
- var btn3 = (primary) => ({
237
- background: primary ? "var(--aix-accent, #2d6cdf)" : "transparent",
238
- color: primary ? "#fff" : "var(--aix-fg, #e6e6e6)",
239
- border: primary ? "none" : "1px solid var(--aix-border, #2a2e35)",
240
- borderRadius: "var(--aix-radius, 8px)",
241
- padding: "7px 16px",
242
- cursor: "pointer",
243
- fontSize: 13
244
- });
245
- function EnvInitDialog(props) {
246
- const { open, onClose, nodeId, os, route, mode = "prompt", seedEvents, onReady, onInstallWsl, title } = props;
247
- const { reqId, events, finished: streamFinished, error, setup } = useEnvRun(props.beforeSetup);
248
- const confirmation = useEnvRun();
249
- const confirmationStarted = useRef(false);
250
- const [minimized, setMinimized] = useState(false);
251
- const [started, setStarted] = useState(false);
252
- const [showLogs, setShowLogs] = useState(false);
253
- const [installing, setInstalling] = useState(false);
254
- const [wslFailed, setWslFailed] = useState(false);
255
- const readyFired = useRef(false);
256
- const wslTried = useRef(false);
257
- const summary = useMemo(
258
- () => summarizeEnv(started ? events : seedEvents ?? []),
259
- [started, events, seedEvents]
260
- );
261
- const checked = summarizeEnv(confirmation.events);
262
- 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;
263
- const finished = streamFinished ?? (started ? summary.finished : null) ?? confirmed;
264
- const done = !!finished;
265
- useEffect(() => {
266
- if (!open || !started || finished || confirmationStarted.current) return;
267
- const verified = summary.steps.some((s) => s.id === "verify" && ["ok", "done", "skipped", "present"].includes(s.state));
268
- if (!verified) return;
269
- const timer = setTimeout(() => {
270
- confirmationStarted.current = true;
271
- void confirmation.status(nodeId, { os }).catch(() => {
272
- });
273
- }, 1500);
274
- return () => clearTimeout(timer);
275
- }, [open, started, finished, summary.steps, confirmation.status, nodeId, os]);
276
- useEffect(() => {
277
- if (open) {
278
- setMinimized(false);
279
- setStarted(false);
280
- setShowLogs(false);
281
- setInstalling(false);
282
- setWslFailed(false);
283
- readyFired.current = false;
284
- wslTried.current = false;
285
- confirmationStarted.current = false;
286
- }
287
- }, [open, nodeId]);
288
- const wslBlocked = done && envBlocker(finished) === "wsl-missing" && !!onInstallWsl;
289
- const installWsl = React4.useCallback(async () => {
290
- if (!onInstallWsl) return;
291
- setInstalling(true);
292
- setWslFailed(false);
293
- try {
294
- await onInstallWsl();
295
- } catch {
296
- setInstalling(false);
297
- setWslFailed(true);
298
- }
299
- }, [onInstallWsl]);
300
- useEffect(() => {
301
- if (wslBlocked && !installing && !wslFailed && !wslTried.current) {
302
- wslTried.current = true;
303
- void installWsl();
304
- }
305
- }, [wslBlocked, installing, wslFailed, installWsl]);
306
- const begin = React4.useCallback(() => {
307
- confirmation.close();
308
- confirmationStarted.current = false;
309
- setStarted(true);
310
- void setup(nodeId, { os, route }).catch(() => {
311
- });
312
- }, [setup, nodeId, os, route, confirmation.close]);
313
- useEffect(() => {
314
- if (open && mode === "auto" && !started) begin();
315
- }, [open, mode, started, begin]);
316
- useEffect(() => {
317
- if (open && started && done && finished?.ok && !readyFired.current) {
318
- readyFired.current = true;
319
- onReady?.();
320
- }
321
- }, [open, started, done, finished, onReady]);
322
- if (!open) return null;
323
- 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;
324
- const failed = !!error || confirmationStarted.current && !!confirmation.error || done && !!finished && !finished.ok;
325
- const success = done && finished?.ok;
326
- if (minimized) return /* @__PURE__ */ jsxs("div", { role: "status", style: {
327
- position: "fixed",
328
- bottom: 16,
329
- left: 16,
330
- right: 16,
331
- zIndex: 1e3,
332
- background: "var(--aix-bg, #14161a)",
333
- color: "var(--aix-fg, #e6e6e6)",
334
- border: "1px solid var(--aix-border, #2a2e35)",
335
- borderRadius: 10,
336
- padding: "12px 16px",
337
- boxShadow: "0 4px 20px rgba(0,0,0,.2)",
338
- display: "flex",
339
- alignItems: "center",
340
- gap: 16
341
- }, children: [
342
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
343
- /* @__PURE__ */ jsxs("div", { style: { fontSize: 13, marginBottom: 6 }, children: [
344
- title ?? "Android \u73AF\u5883\u521D\u59CB\u5316",
345
- " \xB7 ",
346
- success ? "\u5DF2\u5B8C\u6210" : failed ? "\u521D\u59CB\u5316\u5931\u8D25" : !reqId ? "\u6B63\u5728\u8FDE\u63A5\u8282\u70B9\u2026" : "\u6B63\u5728\u521D\u59CB\u5316\u2026",
347
- " ",
348
- pct,
349
- "%"
350
- ] }),
351
- /* @__PURE__ */ jsx(
352
- "div",
353
- {
354
- role: "progressbar",
355
- "aria-valuemin": 0,
356
- "aria-valuemax": 100,
357
- "aria-valuenow": pct,
358
- "aria-label": "\u521D\u59CB\u5316\u8FDB\u5EA6",
359
- style: { height: 5, background: "var(--aix-border, #2a2e35)", borderRadius: 999, overflow: "hidden" },
360
- children: /* @__PURE__ */ jsx("div", { style: { width: `${pct}%`, height: "100%", background: failed ? "var(--aix-danger, #e5484d)" : "var(--aix-accent, #2d6cdf)" } })
361
- }
362
- )
363
- ] }),
364
- /* @__PURE__ */ jsx("button", { style: btn3(), onClick: () => setMinimized(false), children: "\u5C55\u5F00" }),
365
- (success || failed) && /* @__PURE__ */ jsx("button", { style: btn3(), onClick: onClose, children: "\u5173\u95ED" })
366
- ] });
367
- return /* @__PURE__ */ jsx("div", { style: overlay, role: "dialog", "aria-modal": "true", onClick: (e) => {
368
- if (e.target === e.currentTarget && !started) onClose();
369
- }, children: /* @__PURE__ */ jsxs("div", { style: card, children: [
370
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", gap: 16, alignItems: "center", marginBottom: 8 }, children: [
371
- /* @__PURE__ */ jsx("span", { style: { fontSize: 16, fontWeight: 600 }, children: title ?? "\u521D\u59CB\u5316 Android \u73AF\u5883\u5E95\u5EA7" }),
372
- /* @__PURE__ */ jsx("button", { style: btn3(), onClick: () => setMinimized(true), children: "\u6700\u5C0F\u5316" })
373
- ] }),
374
- /* @__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." }),
375
- (started || summary.steps.length > 0) && /* @__PURE__ */ jsxs(Fragment, { children: [
376
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, marginBottom: 14 }, children: [
377
- /* @__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
- /* @__PURE__ */ jsxs("span", { style: { fontSize: 12, color: "var(--aix-muted, #8a8a8a)", minWidth: 36, textAlign: "right", fontVariantNumeric: "tabular-nums" }, children: [
379
- pct,
380
- "%"
381
- ] })
382
- ] }),
383
- started && events.length === 0 && !failed && /* @__PURE__ */ jsx("div", { role: "status", style: { color: "var(--aix-muted, #8a8a8a)", fontSize: 13, marginBottom: 12 }, children: "\u6B63\u5728\u8FDE\u63A5\u8282\u70B9\u5E76\u7B49\u5F85\u521D\u59CB\u5316\u6B65\u9AA4\u2026" }),
384
- /* @__PURE__ */ jsx("ul", { style: { listStyle: "none", margin: 0, padding: 0, display: "grid", gap: 8 }, children: summary.steps.map((s) => /* @__PURE__ */ jsxs("li", { style: { display: "flex", alignItems: "baseline", gap: 10, fontSize: 13 }, children: [
385
- /* @__PURE__ */ jsx("span", { style: { color: stateColor(s.state), width: 16, textAlign: "center" }, children: STATE_ICON[s.state] ?? "\xB7" }),
386
- /* @__PURE__ */ jsxs("span", { style: { flex: 1 }, children: [
387
- s.label,
388
- s.detail ? /* @__PURE__ */ jsxs("span", { style: { color: "var(--aix-muted, #8a8a8a)" }, children: [
389
- " \u2014 ",
390
- s.detail
391
- ] }) : null
392
- ] }),
393
- s.state === "running" && /* @__PURE__ */ jsxs("span", { style: { color: "var(--aix-muted, #8a8a8a)" }, children: [
394
- s.pct,
395
- "%"
396
- ] })
397
- ] }, s.index)) })
398
- ] }),
399
- failed && finished?.error && /* @__PURE__ */ jsxs("div", { style: { marginTop: 12, padding: 10, background: "rgba(229,72,77,0.1)", border: "1px solid var(--aix-danger, #e5484d)", borderRadius: 8, fontSize: 13 }, children: [
400
- finished.error,
401
- finished.hint ? /* @__PURE__ */ jsxs("div", { style: { color: "var(--aix-muted, #8a8a8a)", marginTop: 4 }, children: [
402
- "Hint: ",
403
- finished.hint
404
- ] }) : null
405
- ] }),
406
- confirmationStarted.current && confirmation.error && !finished && /* @__PURE__ */ jsxs("div", { role: "alert", style: { marginTop: 12, color: "var(--aix-danger, #e5484d)" }, children: [
407
- "\u65E0\u6CD5\u786E\u8BA4\u521D\u59CB\u5316\u7ED3\u679C\uFF1A",
408
- confirmation.error.message,
409
- "\u3002\u8BF7\u91CD\u65B0\u68C0\u67E5\u8282\u70B9\u72B6\u6001\u3002"
410
- ] }),
411
- error && !finished && /* @__PURE__ */ jsxs("div", { style: { marginTop: 12, color: "var(--aix-danger, #e5484d)", fontSize: 13 }, children: [
412
- "Could not start setup: ",
413
- error.message
414
- ] }),
415
- wslBlocked && wslFailed && /* @__PURE__ */ jsxs("div", { style: { marginTop: 12, padding: 12, background: "var(--aix-editor-bg, #0e0f12)", border: "1px solid var(--aix-border, #2a2e35)", borderRadius: 8, fontSize: 12.5, lineHeight: 1.6 }, children: [
416
- /* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: 6 }, children: "\u624B\u52A8\u5B89\u88C5 WSL \u8FD0\u884C\u65F6\uFF08\u9700 Win10 21H2/19044+\uFF09" }),
417
- /* @__PURE__ */ jsxs("ol", { style: { margin: 0, paddingLeft: 18 }, children: [
418
- /* @__PURE__ */ jsxs("li", { children: [
419
- "\u4E0B\u8F7D\uFF08\u7EA6 250MB\uFF09\uFF1A",
420
- /* @__PURE__ */ jsx("br", {}),
421
- /* @__PURE__ */ jsx("code", { style: { fontFamily: "var(--aix-mono, ui-monospace, Menlo, monospace)", wordBreak: "break-all" }, children: "https://github.com/microsoft/WSL/releases/latest" }),
422
- /* @__PURE__ */ jsx("br", {}),
423
- "\u9009 ",
424
- /* @__PURE__ */ jsx("code", { children: "wsl.<\u7248\u672C>.x64.msi" }),
425
- "\uFF08\u5185\u7F51\u673A\u53EF\u5728\u80FD\u8054\u7F51\u7684\u7535\u8111\u4E0B\u597D\u518D\u62F7\u8FC7\u6765\uFF09\u3002"
426
- ] }),
427
- /* @__PURE__ */ jsxs("li", { style: { marginTop: 4 }, children: [
428
- "\u7BA1\u7406\u5458\u8FD0\u884C\uFF1A",
429
- /* @__PURE__ */ jsx("br", {}),
430
- /* @__PURE__ */ jsx("code", { style: { fontFamily: "var(--aix-mono, ui-monospace, Menlo, monospace)" }, children: "msiexec /i wsl.<\u7248\u672C>.x64.msi /quiet" }),
431
- "\uFF08\u6216\u53CC\u51FB\u5B89\u88C5\uFF09\u3002"
432
- ] }),
433
- /* @__PURE__ */ jsxs("li", { style: { marginTop: 4 }, children: [
434
- "\u91CD\u542F\u540E ",
435
- /* @__PURE__ */ jsx("code", { children: "wsl --version" }),
436
- " \u80FD\u663E\u793A\u7248\u672C\u5373\u6210\u529F\uFF0C\u518D\u70B9\u4E0B\u65B9\u300C\u91CD\u8BD5\u300D\u3002"
437
- ] })
438
- ] })
439
- ] }),
440
- started && summary.logs.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginTop: 12 }, children: [
441
- /* @__PURE__ */ jsxs("button", { style: { ...btn3(), padding: "2px 0", border: "none", color: "var(--aix-muted, #8a8a8a)", fontSize: 12 }, onClick: () => setShowLogs((v) => !v), children: [
442
- showLogs ? "\u25BE Hide logs" : "\u25B8 Show logs",
443
- " (",
444
- summary.logs.length,
445
- ")"
446
- ] }),
447
- 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") })
448
- ] }),
449
- /* @__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: [
450
- /* @__PURE__ */ jsx("button", { style: btn3(), onClick: onClose, children: "\u5173\u95ED" }),
451
- /* @__PURE__ */ jsx("button", { style: btn3(true), onClick: begin, children: "\u91CD\u8BD5\uFF08\u5DF2\u624B\u52A8\u88C5\u597D\uFF09" })
452
- ] }) : wslBlocked ? /* @__PURE__ */ jsx("button", { style: btn3(), disabled: true, onClick: () => {
453
- }, children: installing ? "\u6B63\u5728\u4E0B\u8F7D\u5B89\u88C5 WSL \u8FD0\u884C\u65F6\u2026" : "\u51C6\u5907\u5B89\u88C5\u2026" }) : failed ? /* @__PURE__ */ jsxs(Fragment, { children: [
454
- /* @__PURE__ */ jsx("button", { style: btn3(), onClick: onClose, children: "Close" }),
455
- /* @__PURE__ */ jsx("button", { style: btn3(true), onClick: begin, children: "Retry" })
456
- ] }) : started ? /* @__PURE__ */ jsx("button", { style: btn3(), disabled: true, onClick: () => {
457
- }, children: "Installing\u2026" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
458
- /* @__PURE__ */ jsx("button", { style: btn3(), onClick: onClose, children: "Not now" }),
459
- /* @__PURE__ */ jsx("button", { style: btn3(true), onClick: begin, children: "Start setup" })
460
- ] }) })
461
- ] }) });
462
- }
463
- function installedTags(node) {
464
- const v = node.reported_caps?.installed_images;
465
- return Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
466
- }
467
- var str = (v) => typeof v === "string" && v ? v : "\u2014";
468
- var sys = (node, k) => node.reported_caps?.system?.[k];
469
- var capBool = (node, k) => node.reported_caps?.[k] === true;
470
- function supportsRuntimeDataRoot(node) {
471
- const capability = node.reported_caps?.runtime_data_root;
472
- return capability?.supported === true;
473
- }
474
- function envOsOf(node) {
475
- const os = str(sys(node, "os"));
476
- return os === "macos" ? "mac" : os === "windows" ? "win" : null;
477
- }
478
- function withLocalEnvOs(node, os) {
479
- if (!node.is_owner || !os || envOsOf(node) || sys(node, "os")) return node;
480
- return {
481
- ...node,
482
- reported_caps: {
483
- ...node.reported_caps,
484
- system: {
485
- ...node.reported_caps?.system,
486
- os: os === "win" ? "windows" : "macos"
487
- }
488
- }
489
- };
490
- }
491
- function vmPlan(node) {
492
- const eff = node.effective_caps;
493
- const os = str(sys(node, "os"));
494
- const out = [];
495
- if (sys(node, "runtime_preparing") === true) {
496
- out.push({ key: "android", label: "Android \u4E91\u624B\u673A", state: "checking", reason: "\u8282\u70B9\u6B63\u5728\u68C0\u6D4B\u5DF2\u914D\u7F6E\u7684\u8FD0\u884C\u73AF\u5883\uFF0C\u8BF7\u7A0D\u5019" });
497
- } else if (!eff?.android && (capBool(node, "redroid_runtime_ready") || capBool(node, "redroid_capable"))) {
498
- out.push({ key: "android", label: "Android \u4E91\u624B\u673A", state: "unavailable", reason: "\u8FD0\u884C\u73AF\u5883\u5DF2\u5C31\u7EEA\uFF0C\u8282\u70B9\u672A\u542F\u7528 Android \u4E91\u624B\u673A\u6743\u9650" });
499
- } else if (eff?.android) {
500
- const imageReady = node.reported_caps?.android_image_ready !== false;
501
- if (imageReady) {
502
- out.push({ key: "android", label: "Android \u4E91\u624B\u673A", state: "available" });
503
- } else {
504
- out.push({
505
- key: "android",
506
- label: "Android \u4E91\u624B\u673A",
507
- state: "needs-image",
508
- reason: "\u8FD0\u884C\u73AF\u5883\u5DF2\u5C31\u7EEA\uFF0CAndroid \u955C\u50CF\u5C1A\u672A\u4E0B\u8F7D\uFF08\u8282\u70B9\u542F\u52A8\u65F6\u81EA\u52A8\u62C9\u53D6\uFF0C\u4E5F\u53EF\u624B\u52A8\u89E6\u53D1\uFF09"
509
- });
510
- }
511
- } else if (os === "windows" || os === "macos") {
512
- out.push({
513
- key: "android",
514
- label: "Android \u4E91\u624B\u673A",
515
- state: "needs-init",
516
- reason: `\u9700\u5B89\u88C5 redroid \u73AF\u5883\u5E95\u5EA7\uFF08${os === "windows" ? "WSL2" : "lima"}\uFF09\u540E\u53EF\u7528`
517
- });
518
- } else if (os === "linux") {
519
- const feature = node.reported_caps?.redroid_feature_enabled;
520
- const setupSupported = feature !== false && !capBool(node, "redroid_capable") && capBool(node, "redroid_setup_supported");
521
- out.push({
522
- key: "android",
523
- label: "Android \u4E91\u624B\u673A",
524
- state: setupSupported ? "needs-init" : "unavailable",
525
- reason: setupSupported ? "\u9700\u521D\u59CB\u5316\u8FD0\u884C\u73AF\u5883\u5E76\u5728\u7EBF\u4E0B\u8F7D Android \u955C\u50CF" : feature === false ? "\u8BE5 Linux \u8282\u70B9\u7248\u672C\u672A\u5305\u542B Redroid provider\uFF0C\u8BF7\u5347\u7EA7\u8282\u70B9" : capBool(node, "redroid_capable") ? "\u8282\u70B9\u672A\u542F\u7528 Android \u4E91\u624B\u673A\u6743\u9650" : feature === true ? "Linux \u8FD0\u884C\u73AF\u5883\u5C1A\u672A\u5C31\u7EEA\uFF0C\u6B64\u8282\u70B9\u4E0D\u652F\u6301\u81EA\u52A8\u521D\u59CB\u5316" : "\u8282\u70B9\u5C1A\u672A\u4E0A\u62A5 Linux \u521D\u59CB\u5316\u80FD\u529B\uFF0C\u8BF7\u68C0\u67E5\u8282\u70B9\u7248\u672C\u4E0E\u8FD0\u884C\u73AF\u5883"
526
- });
527
- } else {
528
- out.push({ key: "android", label: "Android \u4E91\u624B\u673A", state: "unavailable", reason: "\u672C\u673A\u4E0D\u652F\u6301" });
529
- }
530
- if (capBool(node, "vphone_capable") && eff?.ios) {
531
- out.push({ key: "ios", label: "iOS \u865A\u62DF\u673A", state: "available" });
532
- } else {
533
- const arch = str(sys(node, "arch"));
534
- const reason = os === "macos" ? arch === "aarch64" ? "\u672A\u68C0\u6D4B\u5230 vphone \u80FD\u529B\uFF08\u9700\u5728\u6B64 Mac \u4E0A\u542F\u7528\uFF09" : "iOS \u865A\u62DF\u673A\u4EC5 Apple Silicon Mac \u652F\u6301\uFF08\u6B64 Mac \u4E3A Intel\uFF09" : "iOS \u865A\u62DF\u673A\u4EC5 Apple Silicon Mac \u652F\u6301\uFF0C\u672C\u673A\u4E0D\u53EF\u7528";
535
- out.push({ key: "ios", label: "iOS \u865A\u62DF\u673A", state: "unavailable", reason });
536
- }
537
- const iosReason = iosPhysicalUnavailableReason(node);
538
- out.push({ key: "ios-real", label: "iOS \u771F\u673A", state: iosReason ? "unavailable" : "available", ...iosReason ? { reason: iosReason } : {} });
539
- out.push(
540
- eff?.real_devices ? { key: "android-real", label: "Android \u771F\u673A", state: "available" } : { key: "android-real", label: "Android \u771F\u673A", state: "unavailable", reason: "\u8282\u70B9\u672A\u542F\u7528\u771F\u673A\u63A5\u5165" }
541
- );
542
- return out;
543
- }
544
- function VmCapRow({
545
- node,
546
- vm,
547
- onInit,
548
- onDownload,
549
- downloading
550
- }) {
551
- const canInit = vm.state === "needs-init" && node.is_owner && (envOsOf(node) !== null || sys(node, "os") === "linux" && capBool(node, "redroid_setup_supported"));
552
- const canDownload = vm.state === "needs-image" && node.is_owner;
553
- const dot = vm.state === "available" ? "bg-success" : vm.state === "needs-init" ? "bg-warning" : vm.state === "needs-image" ? "bg-warning" : "bg-muted-foreground/40";
554
- const badge = vm.state === "checking" ? "\u68C0\u6D4B\u4E2D" : vm.state === "available" ? "\u53EF\u7528" : vm.state === "needs-init" ? "\u9700\u521D\u59CB\u5316" : vm.state === "needs-image" ? "\u955C\u50CF\u672A\u5C31\u7EEA" : "\u672C\u673A\u4E0D\u53EF\u7528";
555
- const badgeClass = vm.state === "available" ? "text-success" : vm.state === "needs-init" ? "text-warning" : vm.state === "needs-image" ? "text-warning" : "text-muted-foreground";
556
- return /* @__PURE__ */ jsxs("div", { className: "rounded border border-border px-3 py-2", children: [
557
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
558
- /* @__PURE__ */ jsx("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${dot}` }),
559
- /* @__PURE__ */ jsx("span", { className: "flex-1 text-xs text-foreground", children: vm.label }),
560
- /* @__PURE__ */ jsx("span", { className: `text-[11px] ${badgeClass}`, children: badge }),
561
- canInit && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", onClick: onInit, disabled: downloading, className: "ml-2", children: downloading ? "\u521D\u59CB\u5316\u4E2D\u2026" : "\u521D\u59CB\u5316" }),
562
- canDownload && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", onClick: onDownload, disabled: downloading, className: "ml-2", children: downloading ? "\u4E0B\u8F7D\u4E2D\u2026" : "\u4E0B\u8F7D\u955C\u50CF" })
563
- ] }),
564
- vm.reason && /* @__PURE__ */ jsx("p", { className: "mt-1 pl-3.5 text-[11px] text-muted-foreground", children: vm.reason })
565
- ] });
566
- }
567
- function DataRootConfig({ node }) {
568
- const client = useClient();
569
- const [dataRoot, setDataRoot] = useState("");
570
- const [saving, setSaving] = useState(false);
571
- const [message, setMessage] = useState(null);
572
- if (!supportsRuntimeDataRoot(node)) {
573
- return /* @__PURE__ */ jsx("p", { className: "mt-3 text-[11px] text-muted-foreground", children: "\u6570\u636E\u6839\u76EE\u5F55\u914D\u7F6E\u9700\u8981\u652F\u6301\u6B64\u529F\u80FD\u7684\u65B0\u7248 Linux \u8282\u70B9\u3002" });
574
- }
575
- const save = async () => {
576
- if (!dataRoot.trim() || saving) return;
577
- setSaving(true);
578
- setMessage(null);
579
- try {
580
- const receipt = await client.nodes.setDataRoot(node.id, dataRoot);
581
- setMessage(
582
- receipt.restart_required ? `\u5DF2\u4FDD\u5B58 ${receipt.data_root}\u3002\u8BF7\u91CD\u542F\u8282\u70B9\u540E\uFF0C\u65B0\u5EFA Redroid \u5BB9\u5668\u624D\u4F1A\u4F7F\u7528\u6B64\u76EE\u5F55\u3002` : `\u5DF2\u4FDD\u5B58 ${receipt.data_root}\u3002`
583
- );
584
- } catch (error) {
585
- setMessage(error instanceof Error ? error.message : String(error));
586
- } finally {
587
- setSaving(false);
588
- }
589
- };
590
- return /* @__PURE__ */ jsxs("div", { className: "mt-3 rounded border border-border p-3 space-y-2", children: [
591
- /* @__PURE__ */ jsxs("div", { children: [
592
- /* @__PURE__ */ jsx("h4", { className: "text-xs font-medium text-foreground", children: "Redroid \u6570\u636E\u6839\u76EE\u5F55" }),
593
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-muted-foreground", children: "\u4EC5\u63A5\u53D7\u8282\u70B9\u539F\u751F\u6587\u4EF6\u7CFB\u7EDF\u7684\u7EDD\u5BF9\u8DEF\u5F84\u3002\u4E0D\u4F1A\u8FC1\u79FB\u6216\u5220\u9664\u73B0\u6709\u6570\u636E\uFF0C\u4FDD\u5B58\u540E\u9700\u624B\u52A8\u91CD\u542F\u8282\u70B9\u3002" })
594
- ] }),
595
- /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
596
- /* @__PURE__ */ jsx(
597
- Input,
598
- {
599
- value: dataRoot,
600
- onChange: (event) => setDataRoot(event.target.value),
601
- placeholder: "/var/lib/aixautobot/instances",
602
- "aria-label": "Redroid \u6570\u636E\u6839\u76EE\u5F55"
603
- }
604
- ),
605
- /* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", disabled: saving || !dataRoot.trim(), onClick: () => void save(), children: saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58" })
606
- ] }),
607
- message && /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: message })
608
- ] });
609
- }
610
- function AndroidImageRows({ images, installed }) {
611
- return /* @__PURE__ */ jsx("div", { className: "mt-1.5 ml-3.5 space-y-1 border-l border-border/60 pl-3", children: images.map((img) => {
612
- const has = installed.includes(img.image_tag);
613
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
614
- /* @__PURE__ */ jsx("span", { className: `h-1 w-1 shrink-0 rounded-full ${has ? "bg-success" : "bg-muted-foreground/40"}` }),
615
- /* @__PURE__ */ jsx("span", { className: "flex-1 text-[11px] text-muted-foreground", children: img.label }),
616
- /* @__PURE__ */ jsx("span", { className: `text-[10px] ${has ? "text-success" : "text-muted-foreground"}`, children: has ? "\u5DF2\u5B89\u88C5" : "\u672A\u5B89\u88C5" })
617
- ] }, img.id);
618
- }) });
619
- }
620
- function NodeCapabilityPanel({ node: reportedNode, isTauri, onInstallWsl, localEnvOs, beforeSetup }) {
621
- const client = useClient();
622
- const localOs = localEnvOs ?? (client.localNode?.nodeId === reportedNode.id ? client.localNode.envOs ?? detectEnvOs() : null);
623
- const node = withLocalEnvOs(reportedNode, localOs);
624
- const [init, setInit] = useState(null);
625
- const initOs = sys(node, "os") === "linux" ? "linux" : envOsOf(node);
626
- const [androidImages, setAndroidImages] = useState([]);
627
- useEffect(() => {
628
- let cancelled = false;
629
- client.images.options("android").then((imgs) => {
630
- if (!cancelled) setAndroidImages(imgs);
631
- }).catch(() => {
632
- });
633
- return () => {
634
- cancelled = true;
635
- };
636
- }, [client]);
637
- const installed = installedTags(node);
638
- const usbDiagnostic = node.reported_caps?.ios_usb_diagnostic;
639
- return /* @__PURE__ */ jsxs("section", { children: [
640
- /* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2", children: "\u865A\u62DF\u673A\u4E0E\u8BBE\u5907\u80FD\u529B" }),
641
- usbDiagnostic && typeof usbDiagnostic.message === "string" && /* @__PURE__ */ jsxs("div", { role: "alert", className: "mb-3 rounded border border-destructive/50 p-3 text-sm", children: [
642
- /* @__PURE__ */ jsx("p", { children: usbDiagnostic.message }),
643
- Array.isArray(usbDiagnostic.instance_ids) && usbDiagnostic.instance_ids.filter((id) => typeof id === "string").map((id) => /* @__PURE__ */ jsx("p", { className: "mt-2 break-all font-mono text-xs", children: id }, id)),
644
- typeof usbDiagnostic.hint === "string" && /* @__PURE__ */ jsx("p", { className: "mt-2 whitespace-pre-wrap", children: usbDiagnostic.hint })
645
- ] }),
646
- !node.reported_caps ? /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: "\u80FD\u529B\u672A\u77E5\uFF1A\u8282\u70B9\u5C1A\u672A\u8FDE\u63A5\u6216\u4E3A\u65E7\u7248\u672C\uFF08\u9700\u5347\u7EA7\u4EE5\u4E0A\u62A5\u80FD\u529B\uFF09\u3002" }) : /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
647
- !reportedNode.reported_caps && /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: "\u5DF2\u8BC6\u522B\u672C\u673A\u7CFB\u7EDF\uFF0C\u53EF\u521D\u59CB\u5316\u73AF\u5883\uFF1B\u8282\u70B9\u80FD\u529B\u5C1A\u672A\u4E0A\u62A5\uFF0C\u8BF7\u786E\u4FDD\u8282\u70B9\u5DF2\u8FDE\u63A5\u8BBE\u5907\u7F51\u5173\u3002" }),
648
- vmPlan(node).map((vm) => /* @__PURE__ */ jsxs("div", { children: [
649
- /* @__PURE__ */ jsx(
650
- VmCapRow,
651
- {
652
- node,
653
- vm,
654
- onInit: () => setInit(vm),
655
- onDownload: () => setInit(vm)
656
- }
657
- ),
658
- vm.key === "android" && vm.state !== "unavailable" && androidImages.length > 0 && /* @__PURE__ */ jsx(AndroidImageRows, { images: androidImages, installed })
659
- ] }, vm.key))
660
- ] }),
661
- node.is_owner && node.status === "online" && node.reported_caps?.ios_control?.diagnostics === true && /* @__PURE__ */ jsx(IosDeviceDiagnostics, { nodeId: node.id }, node.id),
662
- node.is_owner && (supportsRuntimeDataRoot(node) || sys(node, "os") === "linux") && /* @__PURE__ */ jsx(DataRootConfig, { node }),
663
- init && initOs && /* @__PURE__ */ jsx(
664
- EnvInitDialog,
665
- {
666
- open: true,
667
- nodeId: node.id,
668
- os: initOs,
669
- mode: "prompt",
670
- beforeSetup,
671
- title: `\u521D\u59CB\u5316 ${init.label} \u73AF\u5883\u5E95\u5EA7`,
672
- onInstallWsl: isTauri ? onInstallWsl : void 0,
673
- onClose: () => setInit(null),
674
- onReady: async () => {
675
- try {
676
- await client.nodes.restart(node.id);
677
- } catch {
678
- }
679
- }
680
- }
681
- )
682
- ] });
683
- }
684
205
 
685
- export { AIX_CSS_VARS, DebugConsole, EnvInitDialog, NodeCapabilityPanel, ScriptEditor, ScriptPanel, aixCodeMirrorTheme, vmPlan };
206
+ export { AIX_CSS_VARS, DebugConsole, ScriptEditor, ScriptPanel, aixCodeMirrorTheme };