@aixnn/aixautots 0.5.3 → 0.6.0
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/README.md +40 -23
- package/dist/ScriptStudio-DaCqOF5H.d.ts +43 -0
- package/dist/agent-runner-V60B0is1.d.ts +57 -0
- package/dist/automation-queue-BxrSIkG3.d.ts +72 -0
- package/dist/{chunk-TATL3HTE.js → chunk-B2BOVLI6.js} +82 -21
- package/dist/{chunk-V4MXFPDX.js → chunk-BUW45GM2.js} +3 -3
- package/dist/{chunk-SVK2AY3J.js → chunk-HPKXW5IC.js} +2 -2
- package/dist/{chunk-XNKC6HU3.js → chunk-IZMWCTAP.js} +3 -3
- package/dist/{chunk-OXIM6EYO.js → chunk-JTFZSFFA.js} +1 -1
- package/dist/{chunk-O34SNDQB.js → chunk-JY7O77ML.js} +4 -4
- package/dist/{chunk-IJVNII5N.js → chunk-LAZ3RQ7X.js} +1 -1
- package/dist/{chunk-YOT7HZBU.js → chunk-QPNH7B7P.js} +6 -6
- package/dist/{chunk-UINEPEIE.js → chunk-SSE4IYA4.js} +12 -5
- package/dist/{chunk-BSHHYM72.js → chunk-XB4MS2A4.js} +2 -2
- package/dist/config-CLi5IhmO.d.ts +1380 -0
- package/dist/coords-LPR_MPyp.d.ts +22 -0
- package/dist/core/index.d.ts +135 -0
- package/dist/core/index.js +4 -4
- package/dist/device-normalize-BaThgnH7.d.ts +43 -0
- package/dist/device-session-CVT7OY4H.js +2 -0
- package/dist/i18n/index.d.ts +30 -0
- package/dist/mirror-session-7hrjaLnF.d.ts +108 -0
- package/dist/nav/index.d.ts +19 -0
- package/dist/react/index.d.ts +488 -0
- package/dist/react/index.js +6 -6
- package/dist/script-debugger-DtUGxK9i.d.ts +114 -0
- package/dist/task-agent-runner-DzV_OUZ7.d.ts +160 -0
- package/dist/types-C2WXVcam.d.ts +1005 -0
- package/dist/ui/billing.d.ts +48 -0
- package/dist/ui/billing.js +6 -6
- package/dist/ui/device-create.d.ts +55 -0
- package/dist/ui/device-create.js +7 -7
- package/dist/ui/device-mirror.d.ts +42 -0
- package/dist/ui/device-mirror.js +7 -7
- package/dist/ui/devices.d.ts +223 -0
- package/dist/ui/devices.js +9 -9
- package/dist/ui/editor.d.ts +64 -0
- package/dist/ui/editor.js +7 -7
- package/dist/ui/index.d.ts +108 -0
- package/dist/ui/index.js +83 -90
- package/dist/ui/inspector.d.ts +5 -0
- package/dist/ui/inspector.js +6 -6
- package/dist/ui/market.d.ts +10 -0
- package/dist/ui/market.js +6 -6
- package/dist/ui/mirror.d.ts +52 -0
- package/dist/ui/primitives/index.d.ts +101 -0
- package/dist/ui/script-studio.d.ts +85 -0
- package/dist/ui/script-studio.js +7 -7
- package/dist/ui/scripts.d.ts +18 -0
- package/dist/ui/scripts.js +6 -6
- package/dist/ui/tasks.d.ts +10 -0
- package/dist/ui/tasks.js +9 -9
- package/dist/use-script-run-Diay7ibY.d.ts +50 -0
- package/package.json +112 -40
- package/styles.css +1 -1
- package/tailwind-preset.cjs +3 -3
- package/dist/device-session-W7I3WQXF.js +0 -2
package/dist/ui/tasks.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { SharedParamsForm, resolveSharedRow } from '../chunk-
|
|
1
|
+
import { SharedParamsForm, resolveSharedRow } from '../chunk-QPNH7B7P.js';
|
|
2
2
|
import { useAixT } from '../chunk-64Q7BBIQ.js';
|
|
3
3
|
import '../chunk-FW23FLAF.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-HPKXW5IC.js';
|
|
5
5
|
import '../chunk-OEZFYKL6.js';
|
|
6
6
|
import '../chunk-CVV7FOMQ.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-XB4MS2A4.js';
|
|
8
8
|
import { Button, cn, Select, Input, Badge } from '../chunk-EVHTAXQG.js';
|
|
9
|
-
import { useDevicesView, useAutomationQueue, useApiTokens } from '../chunk-
|
|
10
|
-
import { targetParam, variablesToSchema, schemaDefaults } from '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import { useClient, useAixConfig } from '../chunk-
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
9
|
+
import { useDevicesView, useAutomationQueue, useApiTokens } from '../chunk-JY7O77ML.js';
|
|
10
|
+
import { targetParam, variablesToSchema, schemaDefaults } from '../chunk-BUW45GM2.js';
|
|
11
|
+
import '../chunk-LAZ3RQ7X.js';
|
|
12
|
+
import { useClient, useAixConfig } from '../chunk-SSE4IYA4.js';
|
|
13
|
+
import '../chunk-JTFZSFFA.js';
|
|
14
|
+
import '../chunk-B2BOVLI6.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';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Run lifecycle status (mirrors the frontend runner store). */
|
|
2
|
+
type ScriptRunStatus = 'idle' | 'running' | 'paused' | 'completed' | 'failed';
|
|
3
|
+
/** Severity of a console line — drives the Logcat-style colour + level filter. */
|
|
4
|
+
type LogLevel = 'system' | 'error' | 'warn' | 'info' | 'debug';
|
|
5
|
+
/** One structured console line (colour by level, tag the device, filter/search). */
|
|
6
|
+
interface LogEntry {
|
|
7
|
+
/** ISO timestamp. */
|
|
8
|
+
ts: string;
|
|
9
|
+
level: LogLevel;
|
|
10
|
+
/** Originating device (per-device transitions), if any. */
|
|
11
|
+
device?: string;
|
|
12
|
+
msg: string;
|
|
13
|
+
}
|
|
14
|
+
/** A step/timeline event (kept for API parity with the frontend runner; the
|
|
15
|
+
* fleet backend has no step stream, so this stays empty in practice). */
|
|
16
|
+
interface StepEvent {
|
|
17
|
+
step_index: number;
|
|
18
|
+
step_type: string;
|
|
19
|
+
status: 'pending' | 'running' | 'success' | 'failed';
|
|
20
|
+
description?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
screenshot?: string;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}
|
|
25
|
+
interface UseScriptRun {
|
|
26
|
+
runId: string | null;
|
|
27
|
+
status: ScriptRunStatus;
|
|
28
|
+
progress: number;
|
|
29
|
+
steps: StepEvent[];
|
|
30
|
+
logs: LogEntry[];
|
|
31
|
+
error: string | null;
|
|
32
|
+
/** Submit a persisted script (fetched by id) to the selected devices. */
|
|
33
|
+
startRun(scriptId: string, deviceIds: string[]): Promise<void>;
|
|
34
|
+
/** Submit an inline script body (full file or a selected segment). */
|
|
35
|
+
runCode(code: string, language: string, variables: Record<string, unknown>, deviceIds: string[], platform?: string): Promise<void>;
|
|
36
|
+
stopRun(): Promise<void>;
|
|
37
|
+
pauseRun(): Promise<void>;
|
|
38
|
+
resumeRun(): Promise<void>;
|
|
39
|
+
clearLogs(): void;
|
|
40
|
+
reset(): void;
|
|
41
|
+
}
|
|
42
|
+
/** Single-device (or small fleet) script run with a Logcat-style console.
|
|
43
|
+
*
|
|
44
|
+
* Ports the frontend `useRunnerStore` engine into the SDK: it submits a script
|
|
45
|
+
* body via `fleet.start`, polls `fleet.get`, and turns every per-device status
|
|
46
|
+
* TRANSITION (and captured `output`) into a console `LogEntry`. Behaviourally
|
|
47
|
+
* identical to the store's `startWithBody`/`runCode`/`stop`/`pause`/`resume`. */
|
|
48
|
+
declare function useScriptRun(pollMs?: number): UseScriptRun;
|
|
49
|
+
|
|
50
|
+
export { type LogEntry as L, type ScriptRunStatus as S, type UseScriptRun as U, type StepEvent as a, type LogLevel as b, useScriptRun as u };
|
package/package.json
CHANGED
|
@@ -1,31 +1,90 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aixnn/aixautots",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public",
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
6
10
|
"sideEffects": false,
|
|
7
11
|
"exports": {
|
|
8
|
-
"./core": {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"./
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"./ui
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"./ui/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"./
|
|
12
|
+
"./core": {
|
|
13
|
+
"types": "./dist/core/index.d.ts",
|
|
14
|
+
"import": "./dist/core/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./react": {
|
|
17
|
+
"types": "./dist/react/index.d.ts",
|
|
18
|
+
"import": "./dist/react/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./ui": {
|
|
21
|
+
"types": "./dist/ui/index.d.ts",
|
|
22
|
+
"import": "./dist/ui/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./ui/mirror": {
|
|
25
|
+
"types": "./dist/ui/mirror.d.ts",
|
|
26
|
+
"import": "./dist/ui/mirror.js"
|
|
27
|
+
},
|
|
28
|
+
"./ui/device-mirror": {
|
|
29
|
+
"types": "./dist/ui/device-mirror.d.ts",
|
|
30
|
+
"import": "./dist/ui/device-mirror.js"
|
|
31
|
+
},
|
|
32
|
+
"./ui/device-create": {
|
|
33
|
+
"types": "./dist/ui/device-create.d.ts",
|
|
34
|
+
"import": "./dist/ui/device-create.js"
|
|
35
|
+
},
|
|
36
|
+
"./ui/devices": {
|
|
37
|
+
"types": "./dist/ui/devices.d.ts",
|
|
38
|
+
"import": "./dist/ui/devices.js"
|
|
39
|
+
},
|
|
40
|
+
"./ui/tasks": {
|
|
41
|
+
"types": "./dist/ui/tasks.d.ts",
|
|
42
|
+
"import": "./dist/ui/tasks.js"
|
|
43
|
+
},
|
|
44
|
+
"./ui/billing": {
|
|
45
|
+
"types": "./dist/ui/billing.d.ts",
|
|
46
|
+
"import": "./dist/ui/billing.js"
|
|
47
|
+
},
|
|
48
|
+
"./ui/market": {
|
|
49
|
+
"types": "./dist/ui/market.d.ts",
|
|
50
|
+
"import": "./dist/ui/market.js"
|
|
51
|
+
},
|
|
52
|
+
"./ui/scripts": {
|
|
53
|
+
"types": "./dist/ui/scripts.d.ts",
|
|
54
|
+
"import": "./dist/ui/scripts.js"
|
|
55
|
+
},
|
|
56
|
+
"./ui/editor": {
|
|
57
|
+
"types": "./dist/ui/editor.d.ts",
|
|
58
|
+
"import": "./dist/ui/editor.js"
|
|
59
|
+
},
|
|
60
|
+
"./ui/inspector": {
|
|
61
|
+
"types": "./dist/ui/inspector.d.ts",
|
|
62
|
+
"import": "./dist/ui/inspector.js"
|
|
63
|
+
},
|
|
64
|
+
"./ui/script-studio": {
|
|
65
|
+
"types": "./dist/ui/script-studio.d.ts",
|
|
66
|
+
"import": "./dist/ui/script-studio.js"
|
|
67
|
+
},
|
|
68
|
+
"./ui/primitives": {
|
|
69
|
+
"types": "./dist/ui/primitives/index.d.ts",
|
|
70
|
+
"import": "./dist/ui/primitives/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./nav": {
|
|
73
|
+
"types": "./dist/nav/index.d.ts",
|
|
74
|
+
"import": "./dist/nav/index.js"
|
|
75
|
+
},
|
|
76
|
+
"./i18n": {
|
|
77
|
+
"types": "./dist/i18n/index.d.ts",
|
|
78
|
+
"import": "./dist/i18n/index.js"
|
|
79
|
+
},
|
|
25
80
|
"./tailwind-preset": "./tailwind-preset.cjs",
|
|
26
81
|
"./styles.css": "./styles.css"
|
|
27
82
|
},
|
|
28
|
-
"files": [
|
|
83
|
+
"files": [
|
|
84
|
+
"dist",
|
|
85
|
+
"tailwind-preset.cjs",
|
|
86
|
+
"styles.css"
|
|
87
|
+
],
|
|
29
88
|
"scripts": {
|
|
30
89
|
"build": "tsup",
|
|
31
90
|
"test": "vitest run",
|
|
@@ -33,43 +92,56 @@
|
|
|
33
92
|
"typecheck": "tsc --noEmit"
|
|
34
93
|
},
|
|
35
94
|
"dependencies": {
|
|
36
|
-
"
|
|
37
|
-
"tailwind-merge": "^2.5.0",
|
|
95
|
+
"@radix-ui/react-dialog": "^1.1.1",
|
|
38
96
|
"class-variance-authority": "^0.7.0",
|
|
39
|
-
"
|
|
97
|
+
"clsx": "^2.1.1",
|
|
98
|
+
"tailwind-merge": "^2.5.0"
|
|
40
99
|
},
|
|
41
100
|
"peerDependencies": {
|
|
42
|
-
"react": "^18.3.0",
|
|
43
|
-
"lucide-react": "^0.441.0",
|
|
44
|
-
"@uiw/react-codemirror": "^4.23.0",
|
|
45
101
|
"@codemirror/lang-javascript": "^6.2.0",
|
|
102
|
+
"@uiw/react-codemirror": "^4.23.0",
|
|
103
|
+
"@xterm/addon-fit": "^0.10.0",
|
|
46
104
|
"@xterm/xterm": "^5.5.0",
|
|
47
|
-
"
|
|
105
|
+
"lucide-react": "^0.441.0",
|
|
106
|
+
"react": "^18.3.0"
|
|
48
107
|
},
|
|
49
108
|
"peerDependenciesMeta": {
|
|
50
|
-
"react": {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
109
|
+
"react": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"lucide-react": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"@uiw/react-codemirror": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"@codemirror/lang-javascript": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"@xterm/xterm": {
|
|
122
|
+
"optional": true
|
|
123
|
+
},
|
|
124
|
+
"@xterm/addon-fit": {
|
|
125
|
+
"optional": true
|
|
126
|
+
}
|
|
56
127
|
},
|
|
57
128
|
"devDependencies": {
|
|
58
|
-
"lucide-react": "^0.441.0",
|
|
59
|
-
"@radix-ui/react-dialog": "^1.1.1",
|
|
60
|
-
"clsx": "^2.1.1",
|
|
61
|
-
"tailwind-merge": "^2.5.0",
|
|
62
|
-
"class-variance-authority": "^0.7.0",
|
|
63
|
-
"@uiw/react-codemirror": "^4.23.0",
|
|
64
129
|
"@codemirror/lang-javascript": "^6.2.0",
|
|
65
|
-
"@
|
|
66
|
-
"@xterm/addon-fit": "^0.10.0",
|
|
130
|
+
"@radix-ui/react-dialog": "^1.1.1",
|
|
67
131
|
"@testing-library/react": "^16.0.0",
|
|
68
132
|
"@types/node": "^26.2.0",
|
|
69
133
|
"@types/react": "^18.3.5",
|
|
134
|
+
"@types/react-dom": "^18.3.7",
|
|
135
|
+
"@uiw/react-codemirror": "^4.23.0",
|
|
136
|
+
"@xterm/addon-fit": "^0.10.0",
|
|
137
|
+
"@xterm/xterm": "^5.5.0",
|
|
138
|
+
"class-variance-authority": "^0.7.0",
|
|
139
|
+
"clsx": "^2.1.1",
|
|
70
140
|
"jsdom": "^25.0.0",
|
|
141
|
+
"lucide-react": "^0.441.0",
|
|
71
142
|
"react": "^18.3.1",
|
|
72
143
|
"react-dom": "^18.3.1",
|
|
144
|
+
"tailwind-merge": "^2.5.0",
|
|
73
145
|
"tsup": "^8.3.0",
|
|
74
146
|
"typescript": "^5.5.4",
|
|
75
147
|
"vitest": "^2.1.0"
|
package/styles.css
CHANGED
package/tailwind-preset.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* aixautots 的 Tailwind 预设。接入方在自己的 tailwind.config 里:
|
|
3
|
-
* presets: [require('aixautots/tailwind-preset')]
|
|
3
|
+
* presets: [require('@aixnn/aixautots/tailwind-preset')]
|
|
4
4
|
* 即可获得 aixautots UI 组件依赖的全部语义 token(颜色/字号/间距/圆角),无需手抄。
|
|
5
5
|
*
|
|
6
|
-
* 颜色走 `hsl(var(--token))` 约定,token 的实际值由
|
|
6
|
+
* 颜色走 `hsl(var(--token))` 约定,token 的实际值由 `@aixnn/aixautots/styles.css` 提供
|
|
7
7
|
* (浅色 :root + 深色 .dark)。接入方覆盖 token 值即可换肤。
|
|
8
8
|
*
|
|
9
9
|
* 注意:接入方仍需在 content 里加入 aixautots(否则其类名不会被生成):
|
|
10
|
-
* content: [..., './node_modules/aixautots/dist/** /*.js'] // 或源码路径
|
|
10
|
+
* content: [..., './node_modules/@aixnn/aixautots/dist/** /*.js'] // 或源码路径
|
|
11
11
|
*/
|
|
12
12
|
module.exports = {
|
|
13
13
|
darkMode: 'class',
|