@aixnn/aixautots 0.5.2 → 0.5.3

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 (57) hide show
  1. package/README.md +23 -40
  2. package/dist/{chunk-MRQ7VJFJ.js → chunk-BSHHYM72.js} +2 -2
  3. package/dist/{chunk-PUPVZRKZ.js → chunk-IJVNII5N.js} +1 -1
  4. package/dist/{chunk-EHF2WQUR.js → chunk-O34SNDQB.js} +4 -4
  5. package/dist/{chunk-GKEPMDXO.js → chunk-OXIM6EYO.js} +1 -1
  6. package/dist/{chunk-AIUOLJZA.js → chunk-SVK2AY3J.js} +2 -2
  7. package/dist/{chunk-PCYERBNZ.js → chunk-TATL3HTE.js} +11 -64
  8. package/dist/{chunk-SUKFJ73W.js → chunk-UINEPEIE.js} +2 -2
  9. package/dist/{chunk-H7MHGYF3.js → chunk-V4MXFPDX.js} +3 -3
  10. package/dist/{chunk-6YUAACW6.js → chunk-XNKC6HU3.js} +3 -3
  11. package/dist/{chunk-536WVCTB.js → chunk-YOT7HZBU.js} +5 -5
  12. package/dist/core/index.js +4 -4
  13. package/dist/device-session-W7I3WQXF.js +2 -0
  14. package/dist/react/index.js +6 -6
  15. package/dist/ui/billing.js +6 -6
  16. package/dist/ui/device-create.js +7 -7
  17. package/dist/ui/device-mirror.js +7 -7
  18. package/dist/ui/devices.js +9 -9
  19. package/dist/ui/editor.js +7 -7
  20. package/dist/ui/index.js +20 -31
  21. package/dist/ui/inspector.js +6 -6
  22. package/dist/ui/market.js +6 -6
  23. package/dist/ui/script-studio.js +7 -7
  24. package/dist/ui/scripts.js +6 -6
  25. package/dist/ui/tasks.js +9 -9
  26. package/package.json +1 -2
  27. package/styles.css +1 -1
  28. package/tailwind-preset.cjs +3 -3
  29. package/dist/ScriptStudio-DaCqOF5H.d.ts +0 -43
  30. package/dist/agent-runner-V60B0is1.d.ts +0 -57
  31. package/dist/automation-queue-8HqRJV_K.d.ts +0 -72
  32. package/dist/config-Bm1hmXhD.d.ts +0 -1380
  33. package/dist/coords-LPR_MPyp.d.ts +0 -22
  34. package/dist/core/index.d.ts +0 -135
  35. package/dist/device-normalize-BaThgnH7.d.ts +0 -43
  36. package/dist/device-session-KZVGLPOI.js +0 -2
  37. package/dist/i18n/index.d.ts +0 -30
  38. package/dist/mirror-session-C_1vFkRV.d.ts +0 -108
  39. package/dist/nav/index.d.ts +0 -19
  40. package/dist/react/index.d.ts +0 -487
  41. package/dist/script-debugger-Cw5jVRoz.d.ts +0 -114
  42. package/dist/task-agent-runner-eD9-SCJz.d.ts +0 -160
  43. package/dist/types-C2WXVcam.d.ts +0 -1005
  44. package/dist/ui/billing.d.ts +0 -48
  45. package/dist/ui/device-create.d.ts +0 -55
  46. package/dist/ui/device-mirror.d.ts +0 -42
  47. package/dist/ui/devices.d.ts +0 -223
  48. package/dist/ui/editor.d.ts +0 -64
  49. package/dist/ui/index.d.ts +0 -104
  50. package/dist/ui/inspector.d.ts +0 -5
  51. package/dist/ui/market.d.ts +0 -10
  52. package/dist/ui/mirror.d.ts +0 -52
  53. package/dist/ui/primitives/index.d.ts +0 -101
  54. package/dist/ui/script-studio.d.ts +0 -85
  55. package/dist/ui/scripts.d.ts +0 -18
  56. package/dist/ui/tasks.d.ts +0 -10
  57. package/dist/use-script-run-Diay7ibY.d.ts +0 -50
package/dist/ui/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { ControlBar, MirrorView } from '../chunk-CVV7FOMQ.js';
2
2
  import { Button, Input } from '../chunk-EVHTAXQG.js';
3
- import { useScript, useEnvRun, useClient } from '../chunk-SUKFJ73W.js';
4
- import '../chunk-GKEPMDXO.js';
5
- import { envBlocker, summarizeEnv, detectEnvOs } from '../chunk-PCYERBNZ.js';
3
+ import { useScript, useEnvRun, useClient } from '../chunk-UINEPEIE.js';
4
+ import '../chunk-OXIM6EYO.js';
5
+ import { envBlocker, summarizeEnv } from '../chunk-TATL3HTE.js';
6
6
  import '../chunk-NWFYTFMI.js';
7
7
  import React4, { useState, useId, useRef, useEffect, useMemo } from 'react';
8
8
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -294,7 +294,7 @@ function EnvInitDialog(props) {
294
294
  );
295
295
  if (!open) return null;
296
296
  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;
297
- const failed = !!error || done && !!finished && !finished.ok;
297
+ const failed = done && finished && !finished.ok;
298
298
  const success = done && finished?.ok;
299
299
  return /* @__PURE__ */ jsx("div", { style: overlay, role: "dialog", "aria-modal": "true", onClick: (e) => {
300
300
  if (e.target === e.currentTarget && !started) onClose();
@@ -309,7 +309,6 @@ function EnvInitDialog(props) {
309
309
  "%"
310
310
  ] })
311
311
  ] }),
312
- 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" }),
313
312
  /* @__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: [
314
313
  /* @__PURE__ */ jsx("span", { style: { color: stateColor(s.state), width: 16, textAlign: "center" }, children: STATE_ICON[s.state] ?? "\xB7" }),
315
314
  /* @__PURE__ */ jsxs("span", { style: { flex: 1 }, children: [
@@ -399,19 +398,6 @@ function envOsOf(node) {
399
398
  const os = str(sys(node, "os"));
400
399
  return os === "macos" ? "mac" : os === "windows" ? "win" : null;
401
400
  }
402
- function withLocalEnvOs(node, os) {
403
- if (!node.is_owner || !os || envOsOf(node) || sys(node, "os")) return node;
404
- return {
405
- ...node,
406
- reported_caps: {
407
- ...node.reported_caps,
408
- system: {
409
- ...node.reported_caps?.system,
410
- os: os === "win" ? "windows" : "macos"
411
- }
412
- }
413
- };
414
- }
415
401
  function vmPlan(node) {
416
402
  const eff = node.effective_caps;
417
403
  const os = str(sys(node, "os"));
@@ -436,11 +422,13 @@ function vmPlan(node) {
436
422
  reason: `\u9700\u5B89\u88C5 redroid \u73AF\u5883\u5E95\u5EA7\uFF08${os === "windows" ? "WSL2" : "lima"}\uFF09\u540E\u53EF\u7528`
437
423
  });
438
424
  } else if (os === "linux") {
425
+ const feature = node.reported_caps?.redroid_feature_enabled;
426
+ const setupSupported = feature !== false && !capBool(node, "redroid_capable") && capBool(node, "redroid_setup_supported");
439
427
  out.push({
440
428
  key: "android",
441
429
  label: "Android \u4E91\u624B\u673A",
442
- state: "unavailable",
443
- reason: "\u8BE5 Linux \u8282\u70B9\u4E8C\u8FDB\u5236\u672A\u542F\u7528 redroid \u80FD\u529B\uFF08\u9700\u91CD\u88C5\u8282\u70B9\uFF09"
430
+ state: setupSupported ? "needs-init" : "unavailable",
431
+ 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"
444
432
  });
445
433
  } else {
446
434
  out.push({ key: "android", label: "Android \u4E91\u624B\u673A", state: "unavailable", reason: "\u672C\u673A\u4E0D\u652F\u6301" });
@@ -525,7 +513,7 @@ function VmCapRow({
525
513
  onDownload,
526
514
  downloading
527
515
  }) {
528
- const canInit = vm.state === "needs-init" && node.is_owner && envOsOf(node) !== null;
516
+ const canInit = vm.state === "needs-init" && node.is_owner && (envOsOf(node) !== null || sys(node, "os") === "linux" && capBool(node, "redroid_setup_supported"));
529
517
  const canDownload = vm.state === "needs-image" && node.is_owner;
530
518
  const dot = vm.state === "available" ? "bg-success" : vm.state === "needs-init" ? "bg-warning" : vm.state === "needs-image" ? "bg-warning" : "bg-muted-foreground/40";
531
519
  const badge = 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";
@@ -535,8 +523,8 @@ function VmCapRow({
535
523
  /* @__PURE__ */ jsx("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${dot}` }),
536
524
  /* @__PURE__ */ jsx("span", { className: "flex-1 text-xs text-foreground", children: vm.label }),
537
525
  /* @__PURE__ */ jsx("span", { className: `text-[11px] ${badgeClass}`, children: badge }),
538
- canInit && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", onClick: onInit, className: "ml-2", children: "\u521D\u59CB\u5316" }),
539
- canDownload && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", onClick: onDownload, disabled: downloading, className: "ml-2", children: downloading ? "\u91CD\u542F\u4E2D\u2026" : "\u4E0B\u8F7D\u955C\u50CF" })
526
+ 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" }),
527
+ 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" })
540
528
  ] }),
541
529
  vm.reason && /* @__PURE__ */ jsx("p", { className: "mt-1 pl-3.5 text-[11px] text-muted-foreground", children: vm.reason })
542
530
  ] });
@@ -594,19 +582,18 @@ function AndroidImageRows({ images, installed }) {
594
582
  ] }, img.id);
595
583
  }) });
596
584
  }
597
- function NodeCapabilityPanel({ node: reportedNode, isTauri, onInstallWsl, localEnvOs }) {
585
+ function NodeCapabilityPanel({ node, isTauri, onInstallWsl }) {
598
586
  const client = useClient();
599
- const localOs = localEnvOs ?? (client.localNode?.nodeId === reportedNode.id ? client.localNode.envOs ?? detectEnvOs() : null);
600
- const node = withLocalEnvOs(reportedNode, localOs);
601
587
  const [init, setInit] = useState(null);
602
588
  const initOs = envOsOf(node);
603
589
  const envRun = useEnvRun();
604
590
  const imagePulling = envRun.reqId !== null && !envRun.done;
605
591
  const showImagePanel = envRun.reqId !== null;
606
592
  const handleDownload = async () => {
607
- if (!initOs || imagePulling) return;
593
+ const setupOs = sys(node, "os") === "linux" ? "linux" : initOs;
594
+ if (!setupOs || imagePulling) return;
608
595
  try {
609
- await envRun.setup(node.id, { os: initOs });
596
+ await envRun.setup(node.id, { os: setupOs });
610
597
  } catch {
611
598
  }
612
599
  };
@@ -625,14 +612,16 @@ function NodeCapabilityPanel({ node: reportedNode, isTauri, onInstallWsl, localE
625
612
  return /* @__PURE__ */ jsxs("section", { children: [
626
613
  /* @__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" }),
627
614
  !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: [
628
- !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" }),
629
615
  vmPlan(node).map((vm) => /* @__PURE__ */ jsxs("div", { children: [
630
616
  /* @__PURE__ */ jsx(
631
617
  VmCapRow,
632
618
  {
633
619
  node,
634
620
  vm,
635
- onInit: () => setInit(vm),
621
+ onInit: () => {
622
+ if (sys(node, "os") === "linux") void handleDownload();
623
+ else setInit(vm);
624
+ },
636
625
  onDownload: handleDownload,
637
626
  downloading: imagePulling
638
627
  }
@@ -650,7 +639,7 @@ function NodeCapabilityPanel({ node: reportedNode, isTauri, onInstallWsl, localE
650
639
  }
651
640
  )
652
641
  ] }),
653
- node.is_owner && (supportsRuntimeDataRoot(node) || sys(node, "os") === "linux") && /* @__PURE__ */ jsx(DataRootConfig, { node }),
642
+ node.is_owner && /* @__PURE__ */ jsx(DataRootConfig, { node }),
654
643
  init && initOs && /* @__PURE__ */ jsx(
655
644
  EnvInitDialog,
656
645
  {
@@ -1,11 +1,11 @@
1
1
  import { useAixT } from '../chunk-64Q7BBIQ.js';
2
2
  import { Select, Button, cn, Input, Dialog } from '../chunk-EVHTAXQG.js';
3
- import { useInspectorView, useDevicesView, useLocators } from '../chunk-EHF2WQUR.js';
4
- import '../chunk-H7MHGYF3.js';
5
- import '../chunk-PUPVZRKZ.js';
6
- import { useClient } from '../chunk-SUKFJ73W.js';
7
- import '../chunk-GKEPMDXO.js';
8
- import '../chunk-PCYERBNZ.js';
3
+ import { useInspectorView, useDevicesView, useLocators } from '../chunk-O34SNDQB.js';
4
+ import '../chunk-V4MXFPDX.js';
5
+ import '../chunk-IJVNII5N.js';
6
+ import { useClient } from '../chunk-UINEPEIE.js';
7
+ import '../chunk-OXIM6EYO.js';
8
+ import '../chunk-TATL3HTE.js';
9
9
  import '../chunk-NWFYTFMI.js';
10
10
  import { useState, useMemo, useEffect, useCallback, useRef } from 'react';
11
11
  import { Upload, RefreshCw, ChevronsUp, ChevronsDown, MousePointer2, Circle, Square, Search, Laptop, Smartphone, Check, Copy, Crosshair, TimerReset, Eraser, ImageDown, Keyboard, Save, Trash2, X, ChevronDown, ChevronRight, ArrowLeft, Home, SquareStack, CornerDownLeft, Delete } from 'lucide-react';
package/dist/ui/market.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { useAixNav } from '../chunk-5BMFMDQR.js';
2
2
  import { useAixT } from '../chunk-64Q7BBIQ.js';
3
- import { useScripts } from '../chunk-EHF2WQUR.js';
4
- import '../chunk-H7MHGYF3.js';
5
- import '../chunk-PUPVZRKZ.js';
6
- import '../chunk-SUKFJ73W.js';
7
- import '../chunk-GKEPMDXO.js';
8
- import '../chunk-PCYERBNZ.js';
3
+ import { useScripts } from '../chunk-O34SNDQB.js';
4
+ import '../chunk-V4MXFPDX.js';
5
+ import '../chunk-IJVNII5N.js';
6
+ import '../chunk-UINEPEIE.js';
7
+ import '../chunk-OXIM6EYO.js';
8
+ import '../chunk-TATL3HTE.js';
9
9
  import '../chunk-NWFYTFMI.js';
10
10
  import { Pencil, Store } from 'lucide-react';
11
11
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -1,10 +1,10 @@
1
- export { CodeEditor, DeviceSelect, RunPanel, ScriptParamEditor, ScriptStudio, TimelineStep } from '../chunk-6YUAACW6.js';
1
+ export { CodeEditor, DeviceSelect, RunPanel, ScriptParamEditor, ScriptStudio, TimelineStep } from '../chunk-XNKC6HU3.js';
2
2
  export { LogConsole } from '../chunk-FW23FLAF.js';
3
3
  import '../chunk-EVHTAXQG.js';
4
- import '../chunk-EHF2WQUR.js';
5
- import '../chunk-H7MHGYF3.js';
6
- import '../chunk-PUPVZRKZ.js';
7
- import '../chunk-SUKFJ73W.js';
8
- import '../chunk-GKEPMDXO.js';
9
- import '../chunk-PCYERBNZ.js';
4
+ import '../chunk-O34SNDQB.js';
5
+ import '../chunk-V4MXFPDX.js';
6
+ import '../chunk-IJVNII5N.js';
7
+ import '../chunk-UINEPEIE.js';
8
+ import '../chunk-OXIM6EYO.js';
9
+ import '../chunk-TATL3HTE.js';
10
10
  import '../chunk-NWFYTFMI.js';
@@ -1,12 +1,12 @@
1
1
  import { useAixNav } from '../chunk-5BMFMDQR.js';
2
2
  import { useAixT } from '../chunk-64Q7BBIQ.js';
3
3
  import { cn, Badge, Button, Input } from '../chunk-EVHTAXQG.js';
4
- import { useScripts } from '../chunk-EHF2WQUR.js';
5
- import '../chunk-H7MHGYF3.js';
6
- import '../chunk-PUPVZRKZ.js';
7
- import '../chunk-SUKFJ73W.js';
8
- import '../chunk-GKEPMDXO.js';
9
- import '../chunk-PCYERBNZ.js';
4
+ import { useScripts } from '../chunk-O34SNDQB.js';
5
+ import '../chunk-V4MXFPDX.js';
6
+ import '../chunk-IJVNII5N.js';
7
+ import '../chunk-UINEPEIE.js';
8
+ import '../chunk-OXIM6EYO.js';
9
+ import '../chunk-TATL3HTE.js';
10
10
  import '../chunk-NWFYTFMI.js';
11
11
  import { useState, useMemo } from 'react';
12
12
  import { AppWindow, Monitor, Smartphone, FileText, Play, Copy, Trash2, PlusCircle, LayoutGrid, Plus, Search } from 'lucide-react';
package/dist/ui/tasks.js CHANGED
@@ -1,17 +1,17 @@
1
- import { SharedParamsForm, resolveSharedRow } from '../chunk-536WVCTB.js';
1
+ import { SharedParamsForm, resolveSharedRow } from '../chunk-YOT7HZBU.js';
2
2
  import { useAixT } from '../chunk-64Q7BBIQ.js';
3
3
  import '../chunk-FW23FLAF.js';
4
- import '../chunk-AIUOLJZA.js';
4
+ import '../chunk-SVK2AY3J.js';
5
5
  import '../chunk-OEZFYKL6.js';
6
6
  import '../chunk-CVV7FOMQ.js';
7
- import '../chunk-MRQ7VJFJ.js';
7
+ import '../chunk-BSHHYM72.js';
8
8
  import { Button, cn, Select, Input, Badge } from '../chunk-EVHTAXQG.js';
9
- import { useDevicesView, useAutomationQueue, useApiTokens } from '../chunk-EHF2WQUR.js';
10
- import { targetParam, variablesToSchema, schemaDefaults } from '../chunk-H7MHGYF3.js';
11
- import '../chunk-PUPVZRKZ.js';
12
- import { useClient, useAixConfig } from '../chunk-SUKFJ73W.js';
13
- import '../chunk-GKEPMDXO.js';
14
- import '../chunk-PCYERBNZ.js';
9
+ import { useDevicesView, useAutomationQueue, useApiTokens } from '../chunk-O34SNDQB.js';
10
+ import { targetParam, variablesToSchema, schemaDefaults } from '../chunk-V4MXFPDX.js';
11
+ import '../chunk-IJVNII5N.js';
12
+ import { useClient, useAixConfig } from '../chunk-UINEPEIE.js';
13
+ import '../chunk-OXIM6EYO.js';
14
+ import '../chunk-TATL3HTE.js';
15
15
  import '../chunk-NWFYTFMI.js';
16
16
  import { useState, useEffect, useMemo } from 'react';
17
17
  import { RefreshCw, Plug, Plus, X, Play, ChevronDown, ChevronRight, PlayCircle, Pause, Ban, Trash2, Webhook, MonitorSmartphone, Copy } from 'lucide-react';
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@aixnn/aixautots",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
- "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
7
6
  "sideEffects": false,
8
7
  "exports": {
9
8
  "./core": { "types": "./dist/core/index.d.ts", "import": "./dist/core/index.js" },
package/styles.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * aixautots 默认主题 token。接入方在自己的入口 CSS 里:
3
- * @import "@aixnn/aixautots/styles.css";
3
+ * @import "aixautots/styles.css";
4
4
  * 即可获得一套可用的浅色(:root) / 深色(.dark) 主题;覆盖任意 --token 即可换肤。
5
5
  * 颜色值为 HSL 通道(与 tailwind-preset 的 `hsl(var(--token))` 配套)。
6
6
  *
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * aixautots 的 Tailwind 预设。接入方在自己的 tailwind.config 里:
3
- * presets: [require('@aixnn/aixautots/tailwind-preset')]
3
+ * presets: [require('aixautots/tailwind-preset')]
4
4
  * 即可获得 aixautots UI 组件依赖的全部语义 token(颜色/字号/间距/圆角),无需手抄。
5
5
  *
6
- * 颜色走 `hsl(var(--token))` 约定,token 的实际值由 `@aixnn/aixautots/styles.css` 提供
6
+ * 颜色走 `hsl(var(--token))` 约定,token 的实际值由 `aixautots/styles.css` 提供
7
7
  * (浅色 :root + 深色 .dark)。接入方覆盖 token 值即可换肤。
8
8
  *
9
9
  * 注意:接入方仍需在 content 里加入 aixautots(否则其类名不会被生成):
10
- * content: [..., './node_modules/@aixnn/aixautots/dist/** /*.js'] // 或源码路径
10
+ * content: [..., './node_modules/aixautots/dist/** /*.js'] // 或源码路径
11
11
  */
12
12
  module.exports = {
13
13
  darkMode: 'class',
@@ -1,43 +0,0 @@
1
- import * as react from 'react';
2
- import { ReactNode } from 'react';
3
-
4
- /** Context handed to host-injected slots (agent / inspector). */
5
- interface ScriptStudioSlotContext {
6
- /** Persisted script id (undefined until first save). */
7
- scriptId?: string;
8
- /** Currently selected run device id. */
9
- deviceId: string | null;
10
- /** Resolved platform of the selected device ('android' | 'ios' | …). */
11
- platform: 'android' | 'ios';
12
- /** Current editor source. */
13
- code: string;
14
- /** Replace the entire editor source. */
15
- setCode: (code: string) => void;
16
- /** Append a snippet to the editor source (newline-separated). */
17
- insertSnippet: (snippet: string) => void;
18
- /** Open the host-injected device inspector (same as the header button). */
19
- openInspector: () => void;
20
- }
21
- interface ScriptStudioProps {
22
- /** Route param: the script to open. Undefined ⇒ a fresh "New Script". */
23
- scriptId?: string;
24
- /** Called after the first create assigns an id, so the host can switch the
25
- * URL to `/editor/:id` (the SDK does not depend on a router). */
26
- onScriptIdChange?: (id: string) => void;
27
- /** Host-injected LLM agent panel (right column). Not rendered if omitted. */
28
- renderAgentPanel?: (ctx: ScriptStudioSlotContext) => ReactNode;
29
- /** Host-injected device inspector (modal/overlay). Not rendered if omitted.
30
- * `open`/`onClose` are driven by the studio's "设备/Inspector" button. */
31
- renderInspector?: (ctx: ScriptStudioSlotContext & {
32
- open: boolean;
33
- onClose: () => void;
34
- }) => ReactNode;
35
- /** localStorage key for the resizable console height. */
36
- consoleHeightStorageKey?: string;
37
- /** Extra controls rendered at the right end of the header (e.g. a language
38
- * toggle). The studio itself stays app-chrome-agnostic. */
39
- headerExtra?: ReactNode;
40
- }
41
- declare function ScriptStudio({ scriptId, onScriptIdChange, renderAgentPanel, renderInspector, consoleHeightStorageKey, headerExtra, }: ScriptStudioProps): react.JSX.Element;
42
-
43
- export { type ScriptStudioProps as S, type ScriptStudioSlotContext as a, ScriptStudio as b };
@@ -1,57 +0,0 @@
1
- /**
2
- * LLM agent 传输的注入接口。`AgentPanel` 的 UI 与可移植逻辑在 aixautots 内,但「如何
3
- * 真正跑一个本地 agent」是宿主特有的(桌面端经 Tauri IPC spawn claude/codex CLI,
4
- * 经事件流式回传)——所以这部分由宿主实现 `AgentRunner` 注入,aixautots 不依赖 Tauri。
5
- *
6
- * 非桌面/无本地 agent 的宿主可传 `available: false`,面板会显示「需在桌面应用中使用」。
7
- *
8
- * ── 实现是可替换的:Tauri 只是其中一种 ──
9
- * 本接口刻意与传输解耦,`AgentPanel` 不知底层是本机还是服务端。已有/可有的实现:
10
- * 1) 本机 CLI(现状):桌面端 `frontend/src/lib/agentRunner.ts` 用 Tauri `invoke`/`listen`
11
- * spawn 本机 claude/codex CLI(密钥/算力在用户机器)。
12
- * 2) 服务端 agent:服务器跑 claude/codex CLI(密钥/算力在后端),HTTP 起停 + SSE 流式
13
- * 回传。**SDK 已内置实现** `createBackendAgentRunner(client)`(见 `backend-agent-runner.ts`);
14
- * editor 薄壳按环境切换即可,aixautots 与 AgentPanel 零改动:
15
- * agentRunner={isTauri() ? tauriAgentRunner : createBackendAgentRunner(client)}
16
- * (仅待后端落地 `/api/agent/*` 端点;客户端侧已就绪。)
17
- *
18
- * 后端端点契约(详见 `backend-agent-runner.ts`):`POST /api/agent/{start,send,stop}` +
19
- * `GET /api/agent/stream`(SSE);事件载荷映射到本文件的 `AgentStreamEvent`
20
- * (`stream: 'stdout'|'stderr'|'done'`,done 带最终 `script` 全文)。鉴权复用 user JWT。
21
- * 失败可经 `stream:'stderr'` 文本上报,或 `done` 不带 `script` 表示无产出。
22
- */
23
- type AgentKind = 'claude' | 'codex';
24
- interface AgentStreamEvent {
25
- /** 该事件所属脚本 id(面板按当前 scriptId 过滤)。 */
26
- scriptId: string;
27
- stream: 'stdout' | 'stderr' | 'done';
28
- /** stdout/stderr 增量文本。 */
29
- chunk?: string;
30
- /** done 时回带的最终 script.ts 全文(非空且有变化则替换编辑器)。 */
31
- script?: string;
32
- }
33
- interface AgentSendRequest {
34
- agent: AgentKind;
35
- scriptId: string;
36
- code: string;
37
- deviceId: string;
38
- userMsg: string;
39
- /** 本轮是否是会话首轮(决定 start vs send 语义,由实现自行处理)。 */
40
- isFirst: boolean;
41
- }
42
- interface AgentRunner {
43
- /** 本机 agent 后端是否可用(如桌面/Tauri 环境)。false 时面板显示提示而不渲染交互。 */
44
- available: boolean;
45
- /** 可选:从宿主设置读默认 agent / 权限模式(面板挂载时调用)。 */
46
- defaults?: () => Promise<{
47
- agent?: AgentKind;
48
- }>;
49
- /** 启动或继续一轮 agent。权限模式等宿主细节由实现内部处理。 */
50
- send: (req: AgentSendRequest) => Promise<void>;
51
- /** 停止进行中的一轮。 */
52
- stop: (scriptId: string) => Promise<void>;
53
- /** 订阅流式输出;返回取消订阅函数。面板内部按 scriptId 过滤事件。 */
54
- subscribe: (on: (ev: AgentStreamEvent) => void) => () => void;
55
- }
56
-
57
- export type { AgentKind as A, AgentRunner as a, AgentSendRequest as b, AgentStreamEvent as c };
@@ -1,72 +0,0 @@
1
- import { a as RunEventKind, A as AixConfig, R as ResolvedConfig } from './config-Bm1hmXhD.js';
2
- import { S as Script } from './types-C2WXVcam.js';
3
-
4
- interface FlowSubmit {
5
- /** Inline flow JSON (XOR scriptId). */
6
- flow?: unknown;
7
- /** Reference a stored script by id (XOR flow). */
8
- scriptId?: string;
9
- /** Internal device UUIDs (non-empty). */
10
- deviceIds: string[];
11
- params?: unknown;
12
- mode?: unknown;
13
- expiresIn?: number;
14
- }
15
- /** A normalized per-device execution event. */
16
- interface FlowEvent {
17
- deviceId: string;
18
- event: RunEventKind;
19
- }
20
- declare class FlowRun {
21
- readonly taskId: string;
22
- readonly targets: string[];
23
- private readonly socket;
24
- private readonly eventListeners;
25
- private readonly doneListeners;
26
- private readonly finished;
27
- private doneFired;
28
- private cursor;
29
- private constructor();
30
- static submit(cfg: AixConfig | ResolvedConfig, body: FlowSubmit): Promise<FlowRun>;
31
- on(event: 'event', cb: (e: FlowEvent) => void): () => void;
32
- on(event: 'done', cb: () => void): () => void;
33
- /** Called (via microtask) when submit() returns targets:[]. */
34
- fireDoneIfEmpty(): void;
35
- private onMessage;
36
- close(): void;
37
- }
38
-
39
- /** 批次派发模式。`'round-robin'` 为默认(行分摊到设备);`'broadcast'` 每行全量。 */
40
- type QueueMode = 'round-robin' | 'broadcast';
41
- /** 一个批次的输入。`script` 与 `flow` 二选一(与 `FlowRun`/后端的 flow XOR
42
- * script 约束一致)。`rows` 每项是一组动态参数值(覆写 `flow.variables`);空
43
- * 数组等价于「无参数」单组(提交一次,沿用脚本自带 variables)。 */
44
- interface BatchConfig {
45
- /** 引用已存库脚本(XOR flow)。 */
46
- script?: Pick<Script, 'id'> & {
47
- id: string;
48
- };
49
- /** 内联 flow JSON(XOR script)。 */
50
- flow?: unknown;
51
- /** 每行 = 一组动态参数(如不同账户)。空 ⇒ 视作单组空参数,提交一次。 */
52
- rows: Array<Record<string, unknown>>;
53
- /** 目标设备内部 UUID(非空)。 */
54
- deviceIds: string[];
55
- /** 派发模式,默认 `'round-robin'`。 */
56
- mode?: QueueMode;
57
- /** 透传给 `FlowRun.submit` 的任务过期秒数(可选)。 */
58
- expiresIn?: number;
59
- }
60
- /** 把 rows×mode 展开为多次 `FlowRun.submit`,返回每次提交得到的 task id 顺序数组。
61
- * 逐行顺序提交(保留行序);任一行失败即抛出(已提交的行不回滚——它们是独立任务)。 */
62
- declare function submitBatch(cfg: AixConfig | ResolvedConfig, config: BatchConfig): Promise<string[]>;
63
- /** 自动化队列的薄封装:绑定一份 config,`submit(batch)` 即提交。无状态——
64
- * 追踪/暂停/恢复由 `TasksApi`(`useAutomationQueue`)负责。 */
65
- declare class AutomationQueue {
66
- private readonly cfg;
67
- constructor(cfg: AixConfig | ResolvedConfig);
68
- /** 展开并提交一个批次,返回 task id 数组。见 [`submitBatch`]。 */
69
- submit(config: BatchConfig): Promise<string[]>;
70
- }
71
-
72
- export { AutomationQueue as A, type BatchConfig as B, type FlowEvent as F, type QueueMode as Q, FlowRun as a, type FlowSubmit as b, submitBatch as s };