@aixnn/aixautots 0.0.0-stage → 0.5.2
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 +239 -2
- package/dist/ScriptStudio-DaCqOF5H.d.ts +43 -0
- package/dist/agent-runner-V60B0is1.d.ts +57 -0
- package/dist/automation-queue-8HqRJV_K.d.ts +72 -0
- package/dist/chunk-536WVCTB.js +5744 -0
- package/dist/chunk-5BMFMDQR.js +18 -0
- package/dist/chunk-64Q7BBIQ.js +1347 -0
- package/dist/chunk-6YUAACW6.js +866 -0
- package/dist/chunk-AIUOLJZA.js +412 -0
- package/dist/chunk-CVV7FOMQ.js +175 -0
- package/dist/chunk-EHF2WQUR.js +2042 -0
- package/dist/chunk-EVHTAXQG.js +273 -0
- package/dist/chunk-FW23FLAF.js +56 -0
- package/dist/chunk-GKEPMDXO.js +410 -0
- package/dist/chunk-H7MHGYF3.js +341 -0
- package/dist/chunk-MRQ7VJFJ.js +1074 -0
- package/dist/chunk-NWFYTFMI.js +65 -0
- package/dist/chunk-OEZFYKL6.js +1 -0
- package/dist/chunk-PCYERBNZ.js +1564 -0
- package/dist/chunk-PUPVZRKZ.js +668 -0
- package/dist/chunk-SUKFJ73W.js +217 -0
- package/dist/config-Bm1hmXhD.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 +5 -0
- package/dist/device-normalize-BaThgnH7.d.ts +43 -0
- package/dist/device-session-KZVGLPOI.js +2 -0
- package/dist/i18n/index.d.ts +30 -0
- package/dist/i18n/index.js +1 -0
- package/dist/mirror-session-C_1vFkRV.d.ts +108 -0
- package/dist/nav/index.d.ts +19 -0
- package/dist/nav/index.js +1 -0
- package/dist/react/index.d.ts +487 -0
- package/dist/react/index.js +7 -0
- package/dist/script-debugger-Cw5jVRoz.d.ts +114 -0
- package/dist/task-agent-runner-eD9-SCJz.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 +425 -0
- package/dist/ui/device-create.d.ts +55 -0
- package/dist/ui/device-create.js +9 -0
- package/dist/ui/device-mirror.d.ts +42 -0
- package/dist/ui/device-mirror.js +10 -0
- package/dist/ui/devices.d.ts +223 -0
- package/dist/ui/devices.js +15 -0
- package/dist/ui/editor.d.ts +64 -0
- package/dist/ui/editor.js +344 -0
- package/dist/ui/index.d.ts +104 -0
- package/dist/ui/index.js +676 -0
- package/dist/ui/inspector.d.ts +5 -0
- package/dist/ui/inspector.js +1250 -0
- package/dist/ui/market.d.ts +10 -0
- package/dist/ui/market.js +60 -0
- package/dist/ui/mirror.d.ts +52 -0
- package/dist/ui/mirror.js +3 -0
- package/dist/ui/primitives/index.d.ts +101 -0
- package/dist/ui/primitives/index.js +1 -0
- package/dist/ui/script-studio.d.ts +85 -0
- package/dist/ui/script-studio.js +10 -0
- package/dist/ui/scripts.d.ts +18 -0
- package/dist/ui/scripts.js +210 -0
- package/dist/ui/tasks.d.ts +10 -0
- package/dist/ui/tasks.js +1039 -0
- package/dist/use-script-run-Diay7ibY.d.ts +50 -0
- package/package.json +76 -4
- package/styles.css +97 -0
- package/tailwind-preset.cjs +84 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// src/core/coords.ts
|
|
2
|
+
function toDevicePoint(pointer, box, device) {
|
|
3
|
+
if (device.width <= 0 || device.height <= 0 || box.width <= 0 || box.height <= 0) return null;
|
|
4
|
+
const scale = Math.min(box.width / device.width, box.height / device.height);
|
|
5
|
+
const renderedW = device.width * scale;
|
|
6
|
+
const renderedH = device.height * scale;
|
|
7
|
+
const offsetX = box.left + (box.width - renderedW) / 2;
|
|
8
|
+
const offsetY = box.top + (box.height - renderedH) / 2;
|
|
9
|
+
const rx = pointer.clientX - offsetX;
|
|
10
|
+
const ry = pointer.clientY - offsetY;
|
|
11
|
+
if (rx < 0 || ry < 0 || rx > renderedW || ry > renderedH) return null;
|
|
12
|
+
return { x: rx / renderedW * device.width, y: ry / renderedH * device.height };
|
|
13
|
+
}
|
|
14
|
+
function toNormalizedPoint(pointer, box, device) {
|
|
15
|
+
const p = toDevicePoint(pointer, box, device);
|
|
16
|
+
if (!p) return null;
|
|
17
|
+
return { x: p.x / device.width, y: p.y / device.height };
|
|
18
|
+
}
|
|
19
|
+
function toNormalizedPointClamped(pointer, box, device) {
|
|
20
|
+
if (device.width <= 0 || device.height <= 0 || box.width <= 0 || box.height <= 0) return null;
|
|
21
|
+
const scale = Math.min(box.width / device.width, box.height / device.height);
|
|
22
|
+
const renderedW = device.width * scale;
|
|
23
|
+
const renderedH = device.height * scale;
|
|
24
|
+
const offsetX = box.left + (box.width - renderedW) / 2;
|
|
25
|
+
const offsetY = box.top + (box.height - renderedH) / 2;
|
|
26
|
+
const rx = Math.min(Math.max(pointer.clientX - offsetX, 0), renderedW);
|
|
27
|
+
const ry = Math.min(Math.max(pointer.clientY - offsetY, 0), renderedH);
|
|
28
|
+
return { x: rx / renderedW, y: ry / renderedH };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/core/input-map.ts
|
|
32
|
+
function classifyDrag(start, end, box, device, opts = {}) {
|
|
33
|
+
const tapMovePx = opts.tapMovePx ?? 8;
|
|
34
|
+
const movedPx = Math.hypot(end.clientX - start.clientX, end.clientY - start.clientY);
|
|
35
|
+
if (movedPx <= tapMovePx) {
|
|
36
|
+
const p = toNormalizedPoint({ clientX: start.clientX, clientY: start.clientY }, box, device);
|
|
37
|
+
return p ? { t: "tap", x: p.x, y: p.y } : null;
|
|
38
|
+
}
|
|
39
|
+
const from = toNormalizedPoint({ clientX: start.clientX, clientY: start.clientY }, box, device);
|
|
40
|
+
const to = toNormalizedPoint({ clientX: end.clientX, clientY: end.clientY }, box, device);
|
|
41
|
+
if (!from || !to) return null;
|
|
42
|
+
const duration_ms = Math.max(1, Math.round(end.t - start.t));
|
|
43
|
+
return { t: "swipe", from_x: from.x, from_y: from.y, to_x: to.x, to_y: to.y, duration_ms };
|
|
44
|
+
}
|
|
45
|
+
var SPECIAL_KEYS = {
|
|
46
|
+
Enter: "enter",
|
|
47
|
+
Backspace: "backspace",
|
|
48
|
+
Tab: "tab",
|
|
49
|
+
Escape: "escape",
|
|
50
|
+
Delete: "delete",
|
|
51
|
+
" ": "space",
|
|
52
|
+
ArrowUp: "up",
|
|
53
|
+
ArrowDown: "down",
|
|
54
|
+
ArrowLeft: "left",
|
|
55
|
+
ArrowRight: "right"
|
|
56
|
+
};
|
|
57
|
+
function mapKey(e) {
|
|
58
|
+
if (e.ctrlKey || e.metaKey || e.altKey) return null;
|
|
59
|
+
const code = SPECIAL_KEYS[e.key];
|
|
60
|
+
if (code) return { t: "key", code };
|
|
61
|
+
if (e.key.length === 1) return { t: "text", value: e.key };
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { classifyDrag, mapKey, toDevicePoint, toNormalizedPointClamped };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|