@aixnn/aixautots 0.5.3 → 0.5.4
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/ScriptStudio-DaCqOF5H.d.ts +43 -0
- package/dist/agent-runner-V60B0is1.d.ts +57 -0
- package/dist/automation-queue-CKsueO9z.d.ts +72 -0
- package/dist/config-fsx4jlLK.d.ts +1378 -0
- package/dist/coords-LPR_MPyp.d.ts +22 -0
- package/dist/core/index.d.ts +135 -0
- package/dist/device-normalize-BaThgnH7.d.ts +43 -0
- package/dist/i18n/index.d.ts +30 -0
- package/dist/mirror-session-DM-trg1F.d.ts +108 -0
- package/dist/nav/index.d.ts +19 -0
- package/dist/react/index.d.ts +487 -0
- package/dist/script-debugger-Cu_coj-h.d.ts +114 -0
- package/dist/task-agent-runner-CMq9Cir1.d.ts +160 -0
- package/dist/types-C2WXVcam.d.ts +1005 -0
- package/dist/ui/billing.d.ts +48 -0
- package/dist/ui/device-create.d.ts +55 -0
- package/dist/ui/device-mirror.d.ts +42 -0
- package/dist/ui/devices.d.ts +223 -0
- package/dist/ui/editor.d.ts +64 -0
- package/dist/ui/index.d.ts +102 -0
- package/dist/ui/inspector.d.ts +5 -0
- package/dist/ui/market.d.ts +10 -0
- 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/scripts.d.ts +18 -0
- package/dist/ui/tasks.d.ts +10 -0
- package/dist/use-script-run-Diay7ibY.d.ts +50 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1005 @@
|
|
|
1
|
+
interface DeveloperRef {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
}
|
|
5
|
+
interface AuthResult {
|
|
6
|
+
token: string;
|
|
7
|
+
developer: DeveloperRef;
|
|
8
|
+
}
|
|
9
|
+
interface VerifyCodeResult {
|
|
10
|
+
token: string;
|
|
11
|
+
developer: DeveloperRef;
|
|
12
|
+
password_set: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface SendCodeResult {
|
|
15
|
+
sent: boolean;
|
|
16
|
+
dev_code?: string;
|
|
17
|
+
}
|
|
18
|
+
interface ProjectUserResult {
|
|
19
|
+
token: string;
|
|
20
|
+
user_id: string;
|
|
21
|
+
project_id: string;
|
|
22
|
+
}
|
|
23
|
+
interface Project {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
platform: string;
|
|
28
|
+
project_key: string;
|
|
29
|
+
created_at: string;
|
|
30
|
+
updated_at: string;
|
|
31
|
+
}
|
|
32
|
+
interface CreateProjectInput {
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
platform: string;
|
|
36
|
+
}
|
|
37
|
+
interface CreateProjectResult {
|
|
38
|
+
project: Project;
|
|
39
|
+
secret: string;
|
|
40
|
+
}
|
|
41
|
+
interface User {
|
|
42
|
+
id: string;
|
|
43
|
+
email: string;
|
|
44
|
+
created_at: string;
|
|
45
|
+
}
|
|
46
|
+
/** `project_id` is optional; when set it must match the authenticated project. */
|
|
47
|
+
interface ProvisionUserInput {
|
|
48
|
+
email: string;
|
|
49
|
+
project_id?: string;
|
|
50
|
+
}
|
|
51
|
+
interface ProvisionUserResult {
|
|
52
|
+
user: User;
|
|
53
|
+
project_id: string;
|
|
54
|
+
token: string;
|
|
55
|
+
/** True when this call created a brand-new user (vs. reused an existing one). */
|
|
56
|
+
created: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface DeviceRow {
|
|
59
|
+
id: string;
|
|
60
|
+
external_id: string;
|
|
61
|
+
project_id: string;
|
|
62
|
+
owner_user_id: string;
|
|
63
|
+
visibility: string;
|
|
64
|
+
kind: string;
|
|
65
|
+
name: string;
|
|
66
|
+
meta: Record<string, unknown> | null;
|
|
67
|
+
last_seen_at: string | null;
|
|
68
|
+
online?: boolean;
|
|
69
|
+
created_at: string;
|
|
70
|
+
updated_at: string;
|
|
71
|
+
tags?: string[];
|
|
72
|
+
/** User-set free-text remark; '' = unset. */
|
|
73
|
+
note?: string;
|
|
74
|
+
node_id?: string | null;
|
|
75
|
+
node_name?: string | null;
|
|
76
|
+
platform?: string | null;
|
|
77
|
+
}
|
|
78
|
+
/** A soft-deleted device in the recycle bin (`GET /api/devices/recycle`). */
|
|
79
|
+
interface RecycledDeviceRow {
|
|
80
|
+
id: string;
|
|
81
|
+
external_id: string;
|
|
82
|
+
name: string | null;
|
|
83
|
+
kind: string | null;
|
|
84
|
+
meta: Record<string, unknown> | null;
|
|
85
|
+
tags: string[];
|
|
86
|
+
note: string;
|
|
87
|
+
/** When it was moved to the recycle bin. */
|
|
88
|
+
deleted_at: string;
|
|
89
|
+
/** Container teardown deferred until the owning node reconnects. */
|
|
90
|
+
pending_destroy: boolean;
|
|
91
|
+
platform: string | null;
|
|
92
|
+
}
|
|
93
|
+
type PowerAction = 'start' | 'stop' | 'reboot' | 'reset' | 'destroy' | 'snapshot' | 'restore' | 'control' | 'reconfigure';
|
|
94
|
+
interface ScreenshotResult {
|
|
95
|
+
png_base64: string;
|
|
96
|
+
}
|
|
97
|
+
/** Result of `POST /api/devices/:id/proxy/probe`. The endpoint deliberately
|
|
98
|
+
* exposes diagnostics only; it never echoes proxy credentials. The primary
|
|
99
|
+
* contract uses `exit_ip`/`message`; deprecated aliases are accepted while
|
|
100
|
+
* older gateways roll forward. */
|
|
101
|
+
type ProxyProbeErrorCode = 'not_configured' | 'unsupported_runtime' | 'timeout' | 'dns' | 'connect' | 'invalid_response' | 'configuration_error' | 'probe_failed' | (string & {});
|
|
102
|
+
interface ProxyProbe {
|
|
103
|
+
configured?: boolean;
|
|
104
|
+
enforcement?: 'transparent_tcp' | 'transparent' | 'unsupported';
|
|
105
|
+
reachable: boolean;
|
|
106
|
+
exit_ip?: string | null;
|
|
107
|
+
checked_at?: string;
|
|
108
|
+
error_code?: ProxyProbeErrorCode;
|
|
109
|
+
message?: string | null;
|
|
110
|
+
latency_ms?: number | null;
|
|
111
|
+
/** @deprecated Use `exit_ip`. */
|
|
112
|
+
egress_ip?: string | null;
|
|
113
|
+
/** @deprecated Use `message`. */
|
|
114
|
+
error?: string | null;
|
|
115
|
+
}
|
|
116
|
+
/** Secret-free proxy state exposed in public device metadata. */
|
|
117
|
+
type ProxyApplyStatus = 'pending' | 'applied' | 'failed' | 'unsupported' | 'unsupported_legacy';
|
|
118
|
+
interface ProxySummary {
|
|
119
|
+
configured: boolean;
|
|
120
|
+
desired_revision?: number | null;
|
|
121
|
+
observed_revision?: number | null;
|
|
122
|
+
observed_status?: ProxyApplyStatus | null;
|
|
123
|
+
}
|
|
124
|
+
interface ProxyApplyReceipt {
|
|
125
|
+
revision: number;
|
|
126
|
+
status: ProxyApplyStatus;
|
|
127
|
+
/** Safe backend explanation for failed/unsupported capability outcomes. */
|
|
128
|
+
message?: string | null;
|
|
129
|
+
}
|
|
130
|
+
/** The existing device PATCH returns the updated, credential-scrubbed device row. */
|
|
131
|
+
interface ProxyPatchResult extends DeviceRow {
|
|
132
|
+
proxy_apply?: ProxyApplyReceipt | null;
|
|
133
|
+
}
|
|
134
|
+
/** A device op for the REST proxy (`POST /api/devices/:id/op`). Known ops are
|
|
135
|
+
* listed for autocomplete; the open `{ op: string; ... }` fallback keeps any
|
|
136
|
+
* node-supported op valid WITHOUT a new SDK method (the single generic entry
|
|
137
|
+
* point — typed helpers like `screenshot()` are thin wrappers over it). */
|
|
138
|
+
type KnownDeviceOpName = 'screenshot' | 'screen_size' | 'capture_ui_tree' | 'tap' | 'swipe' | 'input_text' | 'press_key' | 'find_element' | 'find_elements' | 'install' | 'app_list' | 'inject_location' | 'inject_location_auto';
|
|
139
|
+
type DeviceOp = {
|
|
140
|
+
op: KnownDeviceOpName | (string & {});
|
|
141
|
+
[k: string]: unknown;
|
|
142
|
+
};
|
|
143
|
+
interface DeviceLocation {
|
|
144
|
+
mode: 'auto' | 'manual';
|
|
145
|
+
latitude: number;
|
|
146
|
+
longitude: number;
|
|
147
|
+
accuracy_meters?: number;
|
|
148
|
+
updated_at?: string;
|
|
149
|
+
}
|
|
150
|
+
/** An installed app entry — `device-op app_list` result (mirrors
|
|
151
|
+
* `aixautosdk::core::device::types::AppEntry`). */
|
|
152
|
+
interface AppEntry {
|
|
153
|
+
package: string;
|
|
154
|
+
label: string;
|
|
155
|
+
}
|
|
156
|
+
/** UI tree node — mirrors `aixautosdk::core::element::tree::UITreeNode`. */
|
|
157
|
+
interface ElementNode {
|
|
158
|
+
label: string | null;
|
|
159
|
+
text: string | null;
|
|
160
|
+
resource_id: string | null;
|
|
161
|
+
class_name: string | null;
|
|
162
|
+
xpath: string;
|
|
163
|
+
rect: {
|
|
164
|
+
x: number;
|
|
165
|
+
y: number;
|
|
166
|
+
width: number;
|
|
167
|
+
height: number;
|
|
168
|
+
};
|
|
169
|
+
enabled: boolean;
|
|
170
|
+
visible: boolean;
|
|
171
|
+
attributes: Record<string, string>;
|
|
172
|
+
children: ElementNode[];
|
|
173
|
+
}
|
|
174
|
+
/** Upstream proxy as a canonical HTTP CONNECT URL with optional credentials,
|
|
175
|
+
* `http://[user:percent-encoded-password@]host:port`. Carried opaquely through
|
|
176
|
+
* the provision spec; the backend encrypts credentials before storage. */
|
|
177
|
+
type ProxyUrl = string;
|
|
178
|
+
/** Ownership/claim status of a node-reported device, relative to the caller. */
|
|
179
|
+
type DiscoveredStatus = 'mine' | 'claimable' | 'owned_other' | 'unregistered';
|
|
180
|
+
/** A device a node currently reports (from `POST /api/nodes/:id/devices/discover`). */
|
|
181
|
+
interface DiscoveredDevice {
|
|
182
|
+
external_id: string;
|
|
183
|
+
model?: string | null;
|
|
184
|
+
platform?: string | null;
|
|
185
|
+
transport?: string | null;
|
|
186
|
+
state?: string | null;
|
|
187
|
+
device_id?: string | null;
|
|
188
|
+
status: DiscoveredStatus;
|
|
189
|
+
meta?: Record<string, unknown>;
|
|
190
|
+
updated_at: string;
|
|
191
|
+
}
|
|
192
|
+
/** Opaque provision spec. `node_id` is a routing hint stripped server-side. */
|
|
193
|
+
interface ProvisionSpec {
|
|
194
|
+
platform?: 'android' | 'ios' | 'vphone';
|
|
195
|
+
name?: string;
|
|
196
|
+
node_id?: string;
|
|
197
|
+
android_version?: string;
|
|
198
|
+
/** OS version chosen from the admin image catalog (e.g. "14", "17.4"). */
|
|
199
|
+
os_version?: string;
|
|
200
|
+
/** Concrete catalog image id from the wizard; the gateway resolves it to the
|
|
201
|
+
* platform / container image / version (see `images.options`). */
|
|
202
|
+
image_id?: string;
|
|
203
|
+
/** Catalog 机型 (e.g. "Pixel 8", "SM-S911B") chosen in the create wizard. Locks
|
|
204
|
+
* the fingerprint identity base to that device; omitted ⇒ backend picks a
|
|
205
|
+
* random base for the chosen android version. See `devices.profileCatalog()`. */
|
|
206
|
+
model?: string;
|
|
207
|
+
hardware?: {
|
|
208
|
+
memory_mb?: number;
|
|
209
|
+
};
|
|
210
|
+
/** ISO-3166 country (e.g. "cn", "us") for a geo-consistent SIM/carrier/locale/
|
|
211
|
+
* timezone, or "auto" to match the proxy's IP geolocation. Omitted ⇒ "auto". */
|
|
212
|
+
region?: string;
|
|
213
|
+
packages?: Array<{
|
|
214
|
+
software: string;
|
|
215
|
+
version?: string;
|
|
216
|
+
}>;
|
|
217
|
+
proxy?: ProxyUrl;
|
|
218
|
+
/** Stage Frida (the hidden florida frida-server + start script) into the
|
|
219
|
+
* device so it can be started on demand for instrumentation. Default off —
|
|
220
|
+
* Frida is an anti-detect surface, so it's opt-in per device. */
|
|
221
|
+
frida?: boolean;
|
|
222
|
+
/** Enable KernelSU root on the device (KSU-LKM, with its traces hidden at the
|
|
223
|
+
* kernel layer by aixhide). Default off — no root is the smallest anti-detect
|
|
224
|
+
* surface; opt in only when root-level capability (LSPosed dynamic hooks,
|
|
225
|
+
* system-wide Frida, privileged automation) is needed. */
|
|
226
|
+
kernelsu?: boolean;
|
|
227
|
+
/** GPU rendering mode for the device: `'host'` uses the node's hardware GPU
|
|
228
|
+
* (/dev/dri); `'guest'` uses software SwiftShader (works without a GPU);
|
|
229
|
+
* `'auto'` (or omitted) lets the node decide (host iff /dev/dri present).
|
|
230
|
+
* One image serves all modes — switching is a runtime boot arg, settable at
|
|
231
|
+
* creation and changeable later (reset spec_override). */
|
|
232
|
+
gpu_mode?: 'auto' | 'host' | 'guest';
|
|
233
|
+
config?: Record<string, unknown>;
|
|
234
|
+
[k: string]: unknown;
|
|
235
|
+
}
|
|
236
|
+
interface ProvisionResult {
|
|
237
|
+
device_id: string;
|
|
238
|
+
tier: string;
|
|
239
|
+
node_class: string;
|
|
240
|
+
}
|
|
241
|
+
/** Curated, user-editable fingerprint fields. Identity base switched by `model`
|
|
242
|
+
* (carries its android_version/build era); region by `locale` (+ `timezone`);
|
|
243
|
+
* display by dpi/width/height. Unique IDs are never hand-set. */
|
|
244
|
+
interface ProfileOverrides {
|
|
245
|
+
model?: string;
|
|
246
|
+
locale?: string;
|
|
247
|
+
timezone?: string;
|
|
248
|
+
dpi?: number;
|
|
249
|
+
width?: number;
|
|
250
|
+
height?: number;
|
|
251
|
+
}
|
|
252
|
+
/** `GET /api/devices/:id/profile` response. */
|
|
253
|
+
interface DeviceProfileView {
|
|
254
|
+
/** Full device_profile JSON (null if none stored yet). */
|
|
255
|
+
profile: Record<string, unknown> | null;
|
|
256
|
+
/** Curated subset rendered as the editable form. */
|
|
257
|
+
editable: Record<string, unknown> | null;
|
|
258
|
+
kind: 'virtual' | 'real';
|
|
259
|
+
/** How a change takes effect: virtual reboots, real pushes via LSPosed. */
|
|
260
|
+
apply: 'reboot' | 'lsposed_push';
|
|
261
|
+
/** Real device only: apps the LSPosed spoof module disguises (force-stopped on re-push). */
|
|
262
|
+
scope_pkgs: string[];
|
|
263
|
+
/** Real device only: whether the LSPosed identity layer is installed (vs. needs first-time install). */
|
|
264
|
+
disguise_installed: boolean;
|
|
265
|
+
/** Real device only: whether the disguise is currently ON (default true). When false (停用伪装),
|
|
266
|
+
* the on-device spoof config is emptied so scoped apps read the genuine identity; reversible. */
|
|
267
|
+
disguise_enabled: boolean;
|
|
268
|
+
/** Real device only: live install state for polling (null = never attempted). */
|
|
269
|
+
disguise_install_status?: 'installing' | 'installed' | 'failed' | null;
|
|
270
|
+
/** Real device only: error message when `disguise_install_status === 'failed'`. */
|
|
271
|
+
disguise_install_error?: string | null;
|
|
272
|
+
/** Real device only: whether the device is rooted (Magisk) — anti-detect install requires it. */
|
|
273
|
+
rooted: boolean;
|
|
274
|
+
choices: {
|
|
275
|
+
models: string[];
|
|
276
|
+
locales: string[];
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
/** `POST /api/devices/:id/profile` response. */
|
|
280
|
+
interface SetProfileResult {
|
|
281
|
+
profile: Record<string, unknown> | null;
|
|
282
|
+
/** Real device: pushed live to the node's LSPosed layer. Virtual: always false (applies on reboot). */
|
|
283
|
+
applied: boolean;
|
|
284
|
+
requires_restart: boolean;
|
|
285
|
+
apply: 'reboot' | 'lsposed_push';
|
|
286
|
+
/** Real device only: the now-current disguise scope after this update. */
|
|
287
|
+
scope_pkgs: string[];
|
|
288
|
+
/** Real device only: present when the live LSPosed push failed (node offline / no LSPosed); the profile is still persisted. */
|
|
289
|
+
push_error?: string | null;
|
|
290
|
+
}
|
|
291
|
+
/** `POST /api/devices/:id/anti-detect` response — the install is async (202).
|
|
292
|
+
* Poll `getProfile().disguise_install_status` for `installed`/`failed`. */
|
|
293
|
+
interface InstallAntiDetectResult {
|
|
294
|
+
/** Always `installing` — the multi-reboot install runs in the background. */
|
|
295
|
+
status: 'installing';
|
|
296
|
+
/** The device_profile installed with (generated if the device had none). */
|
|
297
|
+
profile: Record<string, unknown>;
|
|
298
|
+
}
|
|
299
|
+
/** `POST /api/devices/:id/disguise` response — toggle the real-device disguise on/off. */
|
|
300
|
+
interface SetDisguiseResult {
|
|
301
|
+
/** The now-current state (echo of the request). */
|
|
302
|
+
enabled: boolean;
|
|
303
|
+
/** Whether the live push to the node landed. The flag is persisted regardless. */
|
|
304
|
+
applied: boolean;
|
|
305
|
+
/** Present when the live push failed (node offline / no LSPosed); the flag still persisted. */
|
|
306
|
+
push_error?: string | null;
|
|
307
|
+
}
|
|
308
|
+
/** One catalog model offered under a brand; `android_version` lets the wizard
|
|
309
|
+
* filter models down to the chosen image version. */
|
|
310
|
+
interface CatalogModel {
|
|
311
|
+
/** Raw model / SKU passed to `ProvisionSpec.model` (e.g. "SM-S911B"). */
|
|
312
|
+
model: string;
|
|
313
|
+
/** Friendly display name (e.g. "Samsung Galaxy S23"). */
|
|
314
|
+
label: string;
|
|
315
|
+
android_version: string;
|
|
316
|
+
}
|
|
317
|
+
/** One brand group in the create-wizard catalog. */
|
|
318
|
+
interface CatalogBrand {
|
|
319
|
+
/** Stable lowercase brand key (e.g. "google", "samsung"). */
|
|
320
|
+
brand: string;
|
|
321
|
+
manufacturer: string;
|
|
322
|
+
label: string;
|
|
323
|
+
models: CatalogModel[];
|
|
324
|
+
}
|
|
325
|
+
/** `GET /api/admin/oem` response — the platform-level OEM singleton every project
|
|
326
|
+
* inherits until it overrides a field. Managed by `PUT /api/admin/oem`. */
|
|
327
|
+
interface PlatformOem {
|
|
328
|
+
app_name: string | null;
|
|
329
|
+
package_name: string | null;
|
|
330
|
+
brand_name: string | null;
|
|
331
|
+
logo_url: string | null;
|
|
332
|
+
brand_icon_url: string | null;
|
|
333
|
+
primary_color: string | null;
|
|
334
|
+
wallpaper_url: string | null;
|
|
335
|
+
boot_anim_url: string | null;
|
|
336
|
+
support_url: string | null;
|
|
337
|
+
support_email: string | null;
|
|
338
|
+
preinstall_packages: boolean;
|
|
339
|
+
}
|
|
340
|
+
type PlatformOemInput = Partial<Omit<PlatformOem, 'preinstall_packages'> & {
|
|
341
|
+
preinstall_packages?: boolean;
|
|
342
|
+
}>;
|
|
343
|
+
interface RegisterNodeResult {
|
|
344
|
+
id: string;
|
|
345
|
+
token: string;
|
|
346
|
+
}
|
|
347
|
+
/** Receipt from the allowlisted node runtime data-root update. The node must be
|
|
348
|
+
* restarted separately before its systemd EnvironmentFile is reloaded. */
|
|
349
|
+
interface SetDataRootResult {
|
|
350
|
+
data_root: string;
|
|
351
|
+
restart_required: true;
|
|
352
|
+
}
|
|
353
|
+
interface MdnsEntry {
|
|
354
|
+
name: string;
|
|
355
|
+
host: string;
|
|
356
|
+
port: number;
|
|
357
|
+
}
|
|
358
|
+
interface AdbScanResult {
|
|
359
|
+
paired: MdnsEntry[];
|
|
360
|
+
pairing: MdnsEntry[];
|
|
361
|
+
}
|
|
362
|
+
/** A connected iOS device and the usbmux lanes it is reachable on. */
|
|
363
|
+
interface IosDeviceRow {
|
|
364
|
+
udid: string;
|
|
365
|
+
usb: boolean;
|
|
366
|
+
wireless: boolean;
|
|
367
|
+
}
|
|
368
|
+
/** Result of the node-scoped iOS `scan` control verb. */
|
|
369
|
+
interface IosScanResult {
|
|
370
|
+
devices: IosDeviceRow[];
|
|
371
|
+
}
|
|
372
|
+
/** Access scope: 'personal' (owner only) | 'project' (project members) | 'platform' (anyone). */
|
|
373
|
+
type NodeScope = 'personal' | 'project' | 'platform';
|
|
374
|
+
/** A node row from `GET /api/nodes`. */
|
|
375
|
+
interface NodeRow {
|
|
376
|
+
id: string;
|
|
377
|
+
name: string;
|
|
378
|
+
status: 'online' | 'offline';
|
|
379
|
+
last_seen_at: string | null;
|
|
380
|
+
created_at: string;
|
|
381
|
+
scope: NodeScope;
|
|
382
|
+
region: string | null;
|
|
383
|
+
device_count: number;
|
|
384
|
+
/** 平台(公共)节点的起始价格——最低规格档的小时费率;非平台节点为 null。
|
|
385
|
+
* 公共节点列表展示「¥x/小时 起」而非设备数。 */
|
|
386
|
+
starting_price?: Decimal | null;
|
|
387
|
+
/** starting_price 的币种(默认 CNY)。 */
|
|
388
|
+
price_currency?: string | null;
|
|
389
|
+
owner_user_id: string | null;
|
|
390
|
+
is_owner: boolean;
|
|
391
|
+
is_platform: boolean;
|
|
392
|
+
/** Node-reported capabilities (Hello): redroid/ios/vphone_capable, capacity,
|
|
393
|
+
* and `system{os,arch,sdk_version}`. Null until the node has connected. */
|
|
394
|
+
reported_caps?: Record<string, unknown> | null;
|
|
395
|
+
/** Owner restrictions on top of reported_caps, e.g. `{real_devices:false}`. */
|
|
396
|
+
owner_policy?: NodeOwnerPolicy | null;
|
|
397
|
+
/** reported ∩ owner_policy — what the node may actually do. */
|
|
398
|
+
effective_caps?: NodeEffectiveCaps;
|
|
399
|
+
}
|
|
400
|
+
/** Owner-set capability restrictions (only disable, never enable). */
|
|
401
|
+
interface NodeOwnerPolicy {
|
|
402
|
+
android?: boolean;
|
|
403
|
+
ios?: boolean;
|
|
404
|
+
real_devices?: boolean;
|
|
405
|
+
}
|
|
406
|
+
interface NodeEffectiveCaps {
|
|
407
|
+
android: boolean;
|
|
408
|
+
ios: boolean;
|
|
409
|
+
real_devices: boolean;
|
|
410
|
+
}
|
|
411
|
+
interface RegisterNodeInput {
|
|
412
|
+
name: string;
|
|
413
|
+
scope?: NodeScope;
|
|
414
|
+
region?: string | null;
|
|
415
|
+
}
|
|
416
|
+
interface UpdateNodeInput {
|
|
417
|
+
name?: string;
|
|
418
|
+
scope?: NodeScope;
|
|
419
|
+
region?: string | null;
|
|
420
|
+
owner_policy?: NodeOwnerPolicy;
|
|
421
|
+
}
|
|
422
|
+
/** The stable lifecycle of one device target. Only the final three states are terminal. */
|
|
423
|
+
type AgentTaskTargetStatus = 'queued' | 'dispatching' | 'running' | 'verifying' | 'blocked' | 'succeeded' | 'failed' | 'cancel_requested' | 'cancelled' | 'expired';
|
|
424
|
+
/** A durable artifact or structured observation produced by an agent attempt. */
|
|
425
|
+
interface AgentTaskEvidence {
|
|
426
|
+
kind: string;
|
|
427
|
+
label?: string | null;
|
|
428
|
+
uri?: string | null;
|
|
429
|
+
content_type?: string | null;
|
|
430
|
+
data?: unknown;
|
|
431
|
+
}
|
|
432
|
+
/** A user/policy gate that must be resolved before a target can continue. */
|
|
433
|
+
interface AgentTaskBlocker {
|
|
434
|
+
code: string;
|
|
435
|
+
message: string;
|
|
436
|
+
approval_id?: string | null;
|
|
437
|
+
data?: unknown;
|
|
438
|
+
}
|
|
439
|
+
/** Stable target identity plus the current immutable attempt, if it has started. */
|
|
440
|
+
interface AgentTaskTarget {
|
|
441
|
+
target_id: string;
|
|
442
|
+
device_id: string;
|
|
443
|
+
status: AgentTaskTargetStatus;
|
|
444
|
+
attempt_id?: string | null;
|
|
445
|
+
error?: string | null;
|
|
446
|
+
blocker?: AgentTaskBlocker | null;
|
|
447
|
+
evidence?: AgentTaskEvidence[];
|
|
448
|
+
}
|
|
449
|
+
interface AgentTaskSubmitInput {
|
|
450
|
+
agent: 'claude' | 'codex';
|
|
451
|
+
prompt: string;
|
|
452
|
+
device_ids: string[];
|
|
453
|
+
max_concurrency: number;
|
|
454
|
+
/** Defaults server-side to `device_standard_v1`; observe/privileged policies are not available to CLI agent tasks. */
|
|
455
|
+
policy_id?: 'device_standard_v1';
|
|
456
|
+
}
|
|
457
|
+
interface AgentTaskSubmitResult {
|
|
458
|
+
task_id: string;
|
|
459
|
+
targets: AgentTaskTarget[];
|
|
460
|
+
}
|
|
461
|
+
/** Current immutable attempt included when a target has an active attempt. */
|
|
462
|
+
interface AgentTaskCurrentAttempt {
|
|
463
|
+
attempt_id: string;
|
|
464
|
+
attempt_no: number;
|
|
465
|
+
status: string;
|
|
466
|
+
accepted_at: string | null;
|
|
467
|
+
started_at: string | null;
|
|
468
|
+
finished_at: string | null;
|
|
469
|
+
result: Record<string, unknown> | null;
|
|
470
|
+
error: string | null;
|
|
471
|
+
}
|
|
472
|
+
/** Target shape returned by the durable AgentTask read endpoint. */
|
|
473
|
+
interface AgentTaskReadTarget {
|
|
474
|
+
target_id: string;
|
|
475
|
+
device_id: string;
|
|
476
|
+
status: string;
|
|
477
|
+
result: Record<string, unknown> | null;
|
|
478
|
+
error: string | null;
|
|
479
|
+
blocker: string | null;
|
|
480
|
+
evidence: Record<string, unknown> | null;
|
|
481
|
+
current_attempt: AgentTaskCurrentAttempt | null;
|
|
482
|
+
}
|
|
483
|
+
/** Full durable AgentTask snapshot used to restore state after reload. */
|
|
484
|
+
interface AgentTaskReadResult {
|
|
485
|
+
task_id: string;
|
|
486
|
+
status: string;
|
|
487
|
+
agent: string;
|
|
488
|
+
prompt: string;
|
|
489
|
+
policy_id: string;
|
|
490
|
+
max_concurrency: number;
|
|
491
|
+
targets: AgentTaskReadTarget[];
|
|
492
|
+
}
|
|
493
|
+
/** Cursor-ordered v2 event retained by the generic execution stream ledger. */
|
|
494
|
+
interface AgentTaskEvent {
|
|
495
|
+
cursor: number;
|
|
496
|
+
run_id: string;
|
|
497
|
+
target_id?: string;
|
|
498
|
+
attempt_id?: string;
|
|
499
|
+
device_id?: string;
|
|
500
|
+
node_seq?: number;
|
|
501
|
+
kind: string;
|
|
502
|
+
payload: Record<string, unknown>;
|
|
503
|
+
created_at: string;
|
|
504
|
+
}
|
|
505
|
+
interface AgentTaskEventsResult {
|
|
506
|
+
events: AgentTaskEvent[];
|
|
507
|
+
next_cursor?: number;
|
|
508
|
+
has_more?: boolean;
|
|
509
|
+
}
|
|
510
|
+
type ClusterMode = {
|
|
511
|
+
type: 'broadcast';
|
|
512
|
+
} | {
|
|
513
|
+
type: 'mirror';
|
|
514
|
+
leader: string;
|
|
515
|
+
};
|
|
516
|
+
interface Cluster {
|
|
517
|
+
id: string;
|
|
518
|
+
name: string;
|
|
519
|
+
description: string | null;
|
|
520
|
+
device_ids: string[];
|
|
521
|
+
default_mode: ClusterMode | Record<string, unknown>;
|
|
522
|
+
created_at: string;
|
|
523
|
+
updated_at: string;
|
|
524
|
+
}
|
|
525
|
+
interface CreateClusterInput {
|
|
526
|
+
name: string;
|
|
527
|
+
description?: string | null;
|
|
528
|
+
device_ids: string[];
|
|
529
|
+
default_mode?: ClusterMode;
|
|
530
|
+
}
|
|
531
|
+
interface ScriptSummary {
|
|
532
|
+
id: string;
|
|
533
|
+
name: string;
|
|
534
|
+
description?: string;
|
|
535
|
+
platform?: string;
|
|
536
|
+
icon_url?: string;
|
|
537
|
+
cover_url?: string;
|
|
538
|
+
visibility?: 'user' | 'project' | 'system';
|
|
539
|
+
updated_at: string;
|
|
540
|
+
}
|
|
541
|
+
/** 结构化脚本参数定义。存进 `Script.variables.__schema__`(JSONB,后端透传,
|
|
542
|
+
* 无校验)。无 `__schema__` 的旧脚本由 `variablesToSchema` 降级为一组 text 字段。 */
|
|
543
|
+
interface ScriptParam {
|
|
544
|
+
/** 参数键(脚本代码里读取的名字)。 */
|
|
545
|
+
key: string;
|
|
546
|
+
/** 展示标签;缺省用 key。 */
|
|
547
|
+
label?: string;
|
|
548
|
+
/** 控件类型。 */
|
|
549
|
+
type: 'text' | 'textarea' | 'number' | 'select' | 'boolean';
|
|
550
|
+
/** 默认值(字符串化存储)。 */
|
|
551
|
+
default?: string;
|
|
552
|
+
/** type==='select' 时的候选项。 */
|
|
553
|
+
options?: string[];
|
|
554
|
+
/** 创建任务时是否提供「随机取值」开关(仅文本类有意义)。 */
|
|
555
|
+
randomable?: boolean;
|
|
556
|
+
/** 标记为「目标字段」,全脚本唯一;创建任务时渲染为目标 textarea(每行一个目标)。 */
|
|
557
|
+
isTarget?: boolean;
|
|
558
|
+
}
|
|
559
|
+
interface Script {
|
|
560
|
+
id?: string;
|
|
561
|
+
name: string;
|
|
562
|
+
description?: string;
|
|
563
|
+
platform?: string;
|
|
564
|
+
language?: 'ts' | 'js';
|
|
565
|
+
code: string;
|
|
566
|
+
/** 动态参数;结构化形态为 `{ __schema__: ScriptParam[], <key>: <default>, ... }`。 */
|
|
567
|
+
variables?: Record<string, unknown>;
|
|
568
|
+
icon_url?: string;
|
|
569
|
+
cover_url?: string;
|
|
570
|
+
visibility?: 'user' | 'project' | 'system';
|
|
571
|
+
updated_at?: string;
|
|
572
|
+
}
|
|
573
|
+
/** Mirrors backend `CreateLocatorRequest` (backend/src/api/locators.rs) —
|
|
574
|
+
* `platform` is REQUIRED server-side ("android" | "ios" | "macos" | "windows"). */
|
|
575
|
+
interface CreateLocatorInput {
|
|
576
|
+
name: string;
|
|
577
|
+
strategy: string;
|
|
578
|
+
value: string;
|
|
579
|
+
platform: string;
|
|
580
|
+
element_label?: string;
|
|
581
|
+
project_id?: string;
|
|
582
|
+
visibility?: string;
|
|
583
|
+
}
|
|
584
|
+
interface Locator {
|
|
585
|
+
id: string;
|
|
586
|
+
name: string;
|
|
587
|
+
strategy: string;
|
|
588
|
+
value: string;
|
|
589
|
+
[key: string]: unknown;
|
|
590
|
+
}
|
|
591
|
+
interface FleetRunDeviceRow {
|
|
592
|
+
device_id: string;
|
|
593
|
+
status: string;
|
|
594
|
+
last_error?: string | null;
|
|
595
|
+
output?: string | null;
|
|
596
|
+
}
|
|
597
|
+
interface FleetRunDetail {
|
|
598
|
+
run_id: string;
|
|
599
|
+
status?: string | null;
|
|
600
|
+
devices?: FleetRunDeviceRow[];
|
|
601
|
+
}
|
|
602
|
+
/** serde externally-tagged `FleetMode` (backend/src/fleet/mode.rs):
|
|
603
|
+
* unit variant as string, payload variants as single-key objects. */
|
|
604
|
+
type FleetMode = 'Broadcast' | {
|
|
605
|
+
Mirror: {
|
|
606
|
+
leader: string;
|
|
607
|
+
};
|
|
608
|
+
} | {
|
|
609
|
+
Sharded: {
|
|
610
|
+
strategy: unknown;
|
|
611
|
+
};
|
|
612
|
+
};
|
|
613
|
+
interface FleetRunSubmit {
|
|
614
|
+
script: Script;
|
|
615
|
+
mode?: FleetMode;
|
|
616
|
+
device_ids: string[];
|
|
617
|
+
}
|
|
618
|
+
/** Result of running a power-kind shortcut on ONE device. `result` is the raw
|
|
619
|
+
* backend power JSON (e.g. `{ rebooted: true }`); `error` is set when the
|
|
620
|
+
* per-device power call rejected. */
|
|
621
|
+
interface PowerRunResult {
|
|
622
|
+
device_id: string;
|
|
623
|
+
ok: boolean;
|
|
624
|
+
result?: unknown;
|
|
625
|
+
error?: string;
|
|
626
|
+
}
|
|
627
|
+
/** Result of submitting + awaiting a script-kind shortcut as a Broadcast fleet
|
|
628
|
+
* run. `detail` is the terminal (or last-polled) run state with per-device
|
|
629
|
+
* status/output. `timedOut` = polling cap hit before all devices reached a
|
|
630
|
+
* terminal status (the run keeps going server-side). */
|
|
631
|
+
interface ShortcutRunResult {
|
|
632
|
+
run_id: string;
|
|
633
|
+
detail: FleetRunDetail;
|
|
634
|
+
timedOut: boolean;
|
|
635
|
+
}
|
|
636
|
+
interface TaskTarget {
|
|
637
|
+
device_id: string;
|
|
638
|
+
status: string;
|
|
639
|
+
result?: unknown;
|
|
640
|
+
error?: string | null;
|
|
641
|
+
}
|
|
642
|
+
interface TaskStatus {
|
|
643
|
+
task_id: string;
|
|
644
|
+
status: string;
|
|
645
|
+
targets: TaskTarget[];
|
|
646
|
+
}
|
|
647
|
+
/** Submit response for `POST /api/webhook/tasks` (also produced by `FlowRun`). */
|
|
648
|
+
interface TaskSubmitResult {
|
|
649
|
+
task_id: string;
|
|
650
|
+
targets: {
|
|
651
|
+
device_id: string;
|
|
652
|
+
status: string;
|
|
653
|
+
}[];
|
|
654
|
+
}
|
|
655
|
+
interface TaskSummary {
|
|
656
|
+
task_id: string;
|
|
657
|
+
status: string;
|
|
658
|
+
source: string;
|
|
659
|
+
created_at: string;
|
|
660
|
+
updated_at: string;
|
|
661
|
+
total: number;
|
|
662
|
+
finished: number;
|
|
663
|
+
/** 提交时的参数(后端 `tasks.params` JSONB)。批次入队时含 `__batch__`/`__target__`,
|
|
664
|
+
* 供任务页按批次分组、展示目标子表(刷新/换端后仍可云同步重建)。 */
|
|
665
|
+
params?: Record<string, unknown>;
|
|
666
|
+
}
|
|
667
|
+
interface TaskEvent {
|
|
668
|
+
id: number;
|
|
669
|
+
task_id: string;
|
|
670
|
+
external_id: string | null;
|
|
671
|
+
kind: string;
|
|
672
|
+
step_index: number | null;
|
|
673
|
+
status: string | null;
|
|
674
|
+
data: unknown;
|
|
675
|
+
created_at: string;
|
|
676
|
+
}
|
|
677
|
+
interface TaskListFilter {
|
|
678
|
+
deviceId?: string;
|
|
679
|
+
status?: string;
|
|
680
|
+
limit?: number;
|
|
681
|
+
offset?: number;
|
|
682
|
+
}
|
|
683
|
+
interface TaskListResult {
|
|
684
|
+
tasks: TaskSummary[];
|
|
685
|
+
limit: number;
|
|
686
|
+
offset: number;
|
|
687
|
+
}
|
|
688
|
+
interface TaskEventsResult {
|
|
689
|
+
task_id: string;
|
|
690
|
+
events: TaskEvent[];
|
|
691
|
+
limit: number;
|
|
692
|
+
offset: number;
|
|
693
|
+
}
|
|
694
|
+
interface WebhookConfig {
|
|
695
|
+
id: string;
|
|
696
|
+
url: string;
|
|
697
|
+
events: string[];
|
|
698
|
+
enabled: boolean;
|
|
699
|
+
}
|
|
700
|
+
interface CreateWebhookInput {
|
|
701
|
+
id: string;
|
|
702
|
+
url: string;
|
|
703
|
+
secret: string;
|
|
704
|
+
events: string[];
|
|
705
|
+
enabled: boolean;
|
|
706
|
+
}
|
|
707
|
+
interface LlmTestResult {
|
|
708
|
+
ok: boolean;
|
|
709
|
+
base_url: string;
|
|
710
|
+
status: number | null;
|
|
711
|
+
latency_ms: number;
|
|
712
|
+
model: string | null;
|
|
713
|
+
models: string[];
|
|
714
|
+
error: string | null;
|
|
715
|
+
}
|
|
716
|
+
type Decimal = number | string;
|
|
717
|
+
/** A provisionable version offered by the device-create wizard (slim; from the
|
|
718
|
+
* active, admin-curated image catalog). No internal `image_tag` / urls. */
|
|
719
|
+
interface ImageOption {
|
|
720
|
+
/** Concrete artifact id — pass as `ProvisionSpec.image_id` at provision. */
|
|
721
|
+
id: string;
|
|
722
|
+
platform: string;
|
|
723
|
+
version: string;
|
|
724
|
+
label: string;
|
|
725
|
+
rooted: boolean;
|
|
726
|
+
/** Container image tag (= node `nerdctl` repo:tag). Match against a node's
|
|
727
|
+
* reported `installed_images` to show 已装/未装 and filter by node support. */
|
|
728
|
+
image_tag: string;
|
|
729
|
+
}
|
|
730
|
+
interface ImageArtifact {
|
|
731
|
+
id: string;
|
|
732
|
+
platform: string;
|
|
733
|
+
os_version: string;
|
|
734
|
+
rooted: boolean;
|
|
735
|
+
image_tag: string;
|
|
736
|
+
artifact_url: string | null;
|
|
737
|
+
sha256: string | null;
|
|
738
|
+
signature: string | null;
|
|
739
|
+
version: string;
|
|
740
|
+
size_bytes: number | null;
|
|
741
|
+
active: boolean;
|
|
742
|
+
created_at: string;
|
|
743
|
+
updated_at: string;
|
|
744
|
+
}
|
|
745
|
+
interface ImageInput {
|
|
746
|
+
platform?: string;
|
|
747
|
+
os_version: string;
|
|
748
|
+
rooted?: boolean;
|
|
749
|
+
image_tag: string;
|
|
750
|
+
artifact_url?: string | null;
|
|
751
|
+
sha256?: string | null;
|
|
752
|
+
signature?: string | null;
|
|
753
|
+
version?: string;
|
|
754
|
+
size_bytes?: number | null;
|
|
755
|
+
active?: boolean;
|
|
756
|
+
}
|
|
757
|
+
interface DeviceRate {
|
|
758
|
+
id: string;
|
|
759
|
+
node_class: string;
|
|
760
|
+
tier: string;
|
|
761
|
+
rate_per_hour: Decimal;
|
|
762
|
+
currency: string;
|
|
763
|
+
active: boolean;
|
|
764
|
+
updated_at: string;
|
|
765
|
+
}
|
|
766
|
+
interface RateInput {
|
|
767
|
+
node_class: string;
|
|
768
|
+
tier: string;
|
|
769
|
+
rate_per_hour: number;
|
|
770
|
+
currency?: string;
|
|
771
|
+
active?: boolean;
|
|
772
|
+
}
|
|
773
|
+
interface BillingPlan {
|
|
774
|
+
id: string;
|
|
775
|
+
name: string;
|
|
776
|
+
kind: string;
|
|
777
|
+
tier: string;
|
|
778
|
+
period: string;
|
|
779
|
+
price: Decimal;
|
|
780
|
+
included_hours: Decimal | null;
|
|
781
|
+
overage_rate_per_hour: Decimal | null;
|
|
782
|
+
currency: string;
|
|
783
|
+
active: boolean;
|
|
784
|
+
updated_at: string;
|
|
785
|
+
}
|
|
786
|
+
interface PlanInput {
|
|
787
|
+
name: string;
|
|
788
|
+
kind: string;
|
|
789
|
+
tier: string;
|
|
790
|
+
period: string;
|
|
791
|
+
price: number;
|
|
792
|
+
included_hours?: number | null;
|
|
793
|
+
overage_rate_per_hour?: number | null;
|
|
794
|
+
currency?: string;
|
|
795
|
+
active?: boolean;
|
|
796
|
+
}
|
|
797
|
+
/** 计费用量会话记录(billing usage row)。注意:与 `core/device-session.ts`
|
|
798
|
+
* 的 `DeviceSession` 直连会话类**不是同一概念**,故此处用 `DeviceUsageSession`
|
|
799
|
+
* 命名以避免 barrel 重名冲突。 */
|
|
800
|
+
interface DeviceUsageSession {
|
|
801
|
+
id: string;
|
|
802
|
+
project_id: string;
|
|
803
|
+
device_id: string;
|
|
804
|
+
node_class: string;
|
|
805
|
+
tier: string;
|
|
806
|
+
kind: string;
|
|
807
|
+
started_at: string;
|
|
808
|
+
ended_at: string | null;
|
|
809
|
+
billed_seconds: number | null;
|
|
810
|
+
gross_cost: Decimal | null;
|
|
811
|
+
currency: string;
|
|
812
|
+
status: string;
|
|
813
|
+
}
|
|
814
|
+
interface RebateLedgerRow {
|
|
815
|
+
id: string;
|
|
816
|
+
project_id: string;
|
|
817
|
+
session_id: string | null;
|
|
818
|
+
period: string;
|
|
819
|
+
gross: Decimal;
|
|
820
|
+
rebate_amount: Decimal;
|
|
821
|
+
currency: string;
|
|
822
|
+
status: string;
|
|
823
|
+
created_at: string;
|
|
824
|
+
}
|
|
825
|
+
/** 钱包流水一行(`account_balances` 记账,按 owner_user_id)。 */
|
|
826
|
+
interface BalanceLedgerRow {
|
|
827
|
+
id: string;
|
|
828
|
+
owner_user_id: string;
|
|
829
|
+
kind: 'topup' | 'platform_session' | 'subscription' | 'own_node_daily' | 'adjust';
|
|
830
|
+
amount: Decimal;
|
|
831
|
+
ref: string;
|
|
832
|
+
balance_after: Decimal;
|
|
833
|
+
currency: string;
|
|
834
|
+
created_at: string;
|
|
835
|
+
}
|
|
836
|
+
/** `GET /api/billing/balance` — 当前钱包余额 + 最近流水。 */
|
|
837
|
+
interface BalanceResp {
|
|
838
|
+
balance: Decimal;
|
|
839
|
+
currency: string;
|
|
840
|
+
recent: BalanceLedgerRow[];
|
|
841
|
+
}
|
|
842
|
+
/** 一条项目订阅(`GET /api/billing/subscriptions` 一行)。 */
|
|
843
|
+
interface ProjectSubscription {
|
|
844
|
+
id: string;
|
|
845
|
+
project_id: string;
|
|
846
|
+
plan_id: string;
|
|
847
|
+
tier: string;
|
|
848
|
+
started_at: string;
|
|
849
|
+
expires_at: string;
|
|
850
|
+
/** 剩余小时(按时长套餐);包月/不计时为 null。 */
|
|
851
|
+
remaining_hours: Decimal | null;
|
|
852
|
+
bound_device_id: string | null;
|
|
853
|
+
status: string;
|
|
854
|
+
created_at: string;
|
|
855
|
+
}
|
|
856
|
+
/** 自有节点单日计费(`GET /api/billing/own-node-charges` 一行)。 */
|
|
857
|
+
interface OwnNodeDailyCharge {
|
|
858
|
+
id: string;
|
|
859
|
+
owner_user_id: string;
|
|
860
|
+
day: string;
|
|
861
|
+
device_count: number;
|
|
862
|
+
billable: number;
|
|
863
|
+
blocks: number;
|
|
864
|
+
free_devices: number;
|
|
865
|
+
amount: Decimal;
|
|
866
|
+
currency: string;
|
|
867
|
+
created_at: string;
|
|
868
|
+
updated_at: string;
|
|
869
|
+
}
|
|
870
|
+
/** `POST /api/billing/subscriptions` 入参。`plan_id` 由调用方传入
|
|
871
|
+
* (caller 套餐目录端点为 follow-up,spec §5.4)。 */
|
|
872
|
+
interface SubscribeInput {
|
|
873
|
+
plan_id: string;
|
|
874
|
+
bound_device_id?: string;
|
|
875
|
+
}
|
|
876
|
+
/** `POST /api/admin/billing/balance/topup` 入参(admin 给指定用户钱包充值)。 */
|
|
877
|
+
interface TopupInput {
|
|
878
|
+
owner_user_id: string;
|
|
879
|
+
amount: number;
|
|
880
|
+
note?: string;
|
|
881
|
+
}
|
|
882
|
+
/** 充值结果——返回新余额。 */
|
|
883
|
+
interface TopupResult {
|
|
884
|
+
owner_user_id: string;
|
|
885
|
+
new_balance: Decimal;
|
|
886
|
+
}
|
|
887
|
+
/** 列表一行——无明文/hash,只含展示前缀与生命周期时间戳。 */
|
|
888
|
+
interface ApiTokenRow {
|
|
889
|
+
id: string;
|
|
890
|
+
name: string;
|
|
891
|
+
/** 展示前缀(如 `aixpat_AbCdEf`),供列表识别。 */
|
|
892
|
+
token_prefix: string;
|
|
893
|
+
/** pin 到单项目时为该项目 id;null = 名下所有项目。 */
|
|
894
|
+
project_id: string | null;
|
|
895
|
+
last_used_at: string | null;
|
|
896
|
+
expires_at: string | null;
|
|
897
|
+
/** 非空 = 已撤销。 */
|
|
898
|
+
revoked_at: string | null;
|
|
899
|
+
created_at: string;
|
|
900
|
+
}
|
|
901
|
+
/** `POST /api/tokens` 入参。 */
|
|
902
|
+
interface CreateTokenInput {
|
|
903
|
+
name: string;
|
|
904
|
+
project_id?: string;
|
|
905
|
+
expires_at?: string;
|
|
906
|
+
}
|
|
907
|
+
/** create / rotate 响应——`token` 明文仅此一次返回。 */
|
|
908
|
+
interface CreatedToken {
|
|
909
|
+
id: string;
|
|
910
|
+
name: string;
|
|
911
|
+
/** 明文 PAT(`aixpat_…`),仅创建/轮换时返回一次。 */
|
|
912
|
+
token: string;
|
|
913
|
+
token_prefix: string;
|
|
914
|
+
project_id: string | null;
|
|
915
|
+
expires_at: string | null;
|
|
916
|
+
}
|
|
917
|
+
interface ShortcutParam {
|
|
918
|
+
key: string;
|
|
919
|
+
label: string;
|
|
920
|
+
type: 'text' | 'url' | 'number' | 'select' | 'boolean';
|
|
921
|
+
required?: boolean;
|
|
922
|
+
default?: unknown;
|
|
923
|
+
options?: string[];
|
|
924
|
+
placeholder?: string;
|
|
925
|
+
}
|
|
926
|
+
interface Shortcut {
|
|
927
|
+
id: string;
|
|
928
|
+
name: string;
|
|
929
|
+
icon?: string | null;
|
|
930
|
+
platform: 'android' | 'ios' | 'any';
|
|
931
|
+
visibility: 'system' | 'user';
|
|
932
|
+
owner_user_id?: string | null;
|
|
933
|
+
params: ShortcutParam[];
|
|
934
|
+
body: string;
|
|
935
|
+
language: string;
|
|
936
|
+
confirm: boolean;
|
|
937
|
+
sort_order: number;
|
|
938
|
+
/** `script` = device.* function script (run via fleet); `power` = lifecycle
|
|
939
|
+
* action where `body` is a device power action (start/stop/reboot) called
|
|
940
|
+
* on the backend, not a script. */
|
|
941
|
+
kind: 'script' | 'power';
|
|
942
|
+
}
|
|
943
|
+
/** Create/update payload (server forces visibility=user + owner=caller). */
|
|
944
|
+
interface NewShortcut {
|
|
945
|
+
name: string;
|
|
946
|
+
icon?: string | null;
|
|
947
|
+
platform?: 'android' | 'ios' | 'any';
|
|
948
|
+
params?: ShortcutParam[];
|
|
949
|
+
body: string;
|
|
950
|
+
language?: string;
|
|
951
|
+
confirm?: boolean;
|
|
952
|
+
sort_order?: number;
|
|
953
|
+
kind?: 'script' | 'power';
|
|
954
|
+
}
|
|
955
|
+
/** An APKPure search hit (mirrors backend `apkpure::Candidate`). */
|
|
956
|
+
interface AppCandidate {
|
|
957
|
+
package: string;
|
|
958
|
+
label: string | null;
|
|
959
|
+
icon_url: string | null;
|
|
960
|
+
banner_url: string | null;
|
|
961
|
+
version: string | null;
|
|
962
|
+
kind: 'apk' | 'xapk';
|
|
963
|
+
}
|
|
964
|
+
interface AppTemplateItemAndroid {
|
|
965
|
+
package: string;
|
|
966
|
+
version?: string;
|
|
967
|
+
}
|
|
968
|
+
interface AppTemplateItemIos {
|
|
969
|
+
bundle_id: string;
|
|
970
|
+
name?: string;
|
|
971
|
+
}
|
|
972
|
+
interface AppTemplate {
|
|
973
|
+
id: string;
|
|
974
|
+
name: string;
|
|
975
|
+
platform: 'android' | 'ios';
|
|
976
|
+
owner_user_id: string;
|
|
977
|
+
items: Array<AppTemplateItemAndroid | AppTemplateItemIos>;
|
|
978
|
+
}
|
|
979
|
+
interface NewAppTemplate {
|
|
980
|
+
name: string;
|
|
981
|
+
platform: 'android' | 'ios';
|
|
982
|
+
items: AppTemplate['items'];
|
|
983
|
+
}
|
|
984
|
+
interface IosLibraryApp {
|
|
985
|
+
bundle_id: string;
|
|
986
|
+
name: string;
|
|
987
|
+
version: string;
|
|
988
|
+
path?: string;
|
|
989
|
+
}
|
|
990
|
+
interface IosAccountState {
|
|
991
|
+
logged_in: boolean;
|
|
992
|
+
account?: {
|
|
993
|
+
name: string;
|
|
994
|
+
email: string;
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
interface IosLoginResult {
|
|
998
|
+
status: 'ok' | 'needs_2fa';
|
|
999
|
+
account?: {
|
|
1000
|
+
name: string;
|
|
1001
|
+
email: string;
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
export type { FleetRunSubmit as $, AgentTaskTargetStatus as A, BalanceLedgerRow as B, CatalogBrand as C, DeviceRow as D, Cluster as E, ClusterMode as F, CreateClusterInput as G, CreateLocatorInput as H, CreateProjectInput as I, CreateProjectResult as J, CreateTokenInput as K, CreateWebhookInput as L, CreatedToken as M, NodeRow as N, DeveloperRef as O, ProvisionSpec as P, DeviceLocation as Q, DeviceOp as R, Script as S, DeviceProfileView as T, DeviceRate as U, DeviceUsageSession as V, DiscoveredStatus as W, ElementNode as X, FleetMode as Y, FleetRunDetail as Z, FleetRunDeviceRow as _, ProvisionResult as a, VerifyCodeResult as a$, ImageArtifact as a0, ImageInput as a1, ImageOption as a2, InstallAntiDetectResult as a3, IosAccountState as a4, IosDeviceRow as a5, IosLibraryApp as a6, IosLoginResult as a7, IosScanResult as a8, KnownDeviceOpName as a9, ProxyUrl as aA, RateInput as aB, RebateLedgerRow as aC, RecycledDeviceRow as aD, RegisterNodeInput as aE, RegisterNodeResult as aF, ScreenshotResult as aG, SendCodeResult as aH, SetDataRootResult as aI, SetDisguiseResult as aJ, SetProfileResult as aK, Shortcut as aL, ShortcutParam as aM, ShortcutRunResult as aN, SubscribeInput as aO, TaskEvent as aP, TaskEventsResult as aQ, TaskListFilter as aR, TaskListResult as aS, TaskStatus as aT, TaskSubmitResult as aU, TaskSummary as aV, TaskTarget as aW, TopupInput as aX, TopupResult as aY, UpdateNodeInput as aZ, User as a_, LlmTestResult as aa, Locator as ab, MdnsEntry as ac, NewAppTemplate as ad, NewShortcut as ae, NodeEffectiveCaps as af, NodeOwnerPolicy as ag, NodeScope as ah, OwnNodeDailyCharge as ai, PlanInput as aj, PlatformOem as ak, PlatformOemInput as al, PowerAction as am, PowerRunResult as an, ProfileOverrides as ao, Project as ap, ProjectSubscription as aq, ProjectUserResult as ar, ProvisionUserInput as as, ProvisionUserResult as at, ProxyApplyReceipt as au, ProxyApplyStatus as av, ProxyPatchResult as aw, ProxyProbe as ax, ProxyProbeErrorCode as ay, ProxySummary as az, DiscoveredDevice as b, WebhookConfig as b0, AgentTaskTarget as c, AgentTaskBlocker as d, AgentTaskEvidence as e, ScriptSummary as f, Decimal as g, ScriptParam as h, AdbScanResult as i, AgentTaskCurrentAttempt as j, AgentTaskEvent as k, AgentTaskEventsResult as l, AgentTaskReadResult as m, AgentTaskReadTarget as n, AgentTaskSubmitInput as o, AgentTaskSubmitResult as p, ApiTokenRow as q, AppCandidate as r, AppEntry as s, AppTemplate as t, AppTemplateItemAndroid as u, AppTemplateItemIos as v, AuthResult as w, BalanceResp as x, BillingPlan as y, CatalogModel as z };
|