@alwith/module-device 0.6.1 → 0.6.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.
- package/dist/{chunk-sbhrg9jp.js → chunk-35bn393s.js} +2 -2
- package/dist/{chunk-ctffar6x.js → chunk-3n6qrzdg.js} +2 -2
- package/dist/{chunk-rqdjybwe.js → chunk-3zjj07q7.js} +2 -2
- package/dist/chunk-40mwa0cy.js +2 -0
- package/dist/chunk-7n1fmm2p.js +2 -0
- package/dist/chunk-cyvmm690.js +5 -0
- package/dist/chunk-ge4zgdtr.js +2 -0
- package/dist/chunk-j6sbvhyq.js +2 -0
- package/dist/chunk-mx5dd23x.js +2 -0
- package/dist/chunk-pa4b54h3.js +2 -0
- package/dist/chunk-pxyqksfz.js +2 -0
- package/dist/chunk-tp1d4pv6.js +2 -0
- package/dist/chunk-xd4kq6pe.js +2 -0
- package/dist/generated/commands.d.ts +155 -0
- package/dist/generated/commands.js +1 -1
- package/dist/index.js +1 -1
- package/dist/preview/activity.d.ts +6 -0
- package/dist/preview/activity.js +1 -0
- package/dist/preview/bezel.js +1 -1
- package/dist/preview/captures.d.ts +8 -0
- package/dist/preview/captures.js +1 -0
- package/dist/preview/device-panel.d.ts +1 -1
- package/dist/preview/device-panel.js +1 -1
- package/dist/preview/gestures.d.ts +1 -1
- package/dist/preview/gestures.js +1 -1
- package/dist/preview/index.d.ts +1 -1
- package/dist/preview/index.js +1 -1
- package/dist/preview/inspection.d.ts +21 -0
- package/dist/preview/inspection.js +1 -0
- package/dist/preview/inspector.d.ts +26 -0
- package/dist/preview/inspector.js +1 -0
- package/dist/preview/live-touch.d.ts +16 -0
- package/dist/preview/live-touch.js +1 -0
- package/dist/preview/locales.js +1 -1
- package/dist/preview/native-view.d.ts +22 -0
- package/dist/preview/native-view.js +1 -0
- package/dist/preview/screens.js +1 -1
- package/dist/preview/types.d.ts +87 -1
- package/dist/tauri.d.ts +23 -0
- package/dist/tauri.js +1 -1
- package/native/darwin-arm64/THIRD_PARTY_NOTICES.md +39 -9
- package/native/darwin-arm64/alwith-device-helper +0 -0
- package/native/darwin-arm64/artifact.json +2 -2
- package/native/darwin-arm64/libalwith_native_device.dylib +0 -0
- package/native/darwin-arm64/licenses/form_urlencoded-1.2.2/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/icu_collections-2.4.0/LICENSE +46 -0
- package/native/darwin-arm64/licenses/icu_locale_core-2.4.0/LICENSE +46 -0
- package/native/darwin-arm64/licenses/icu_normalizer-2.4.0/LICENSE +46 -0
- package/native/darwin-arm64/licenses/icu_normalizer_data-2.4.0/LICENSE +46 -0
- package/native/darwin-arm64/licenses/icu_properties-2.4.0/LICENSE +46 -0
- package/native/darwin-arm64/licenses/icu_properties_data-2.4.0/LICENSE +46 -0
- package/native/darwin-arm64/licenses/icu_provider-2.4.0/LICENSE +46 -0
- package/native/darwin-arm64/licenses/idna-1.1.0/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/idna_adapter-1.2.2/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/litemap-0.8.3/LICENSE +46 -0
- package/native/darwin-arm64/licenses/memmap2-0.9.12/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/memmap2-0.9.12/LICENSE-MIT +26 -0
- package/native/darwin-arm64/licenses/percent-encoding-2.3.2/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/potential_utf-0.1.6/LICENSE +46 -0
- package/native/darwin-arm64/licenses/smallvec-1.16.5/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/smallvec-1.16.5/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/stable_deref_trait-1.2.1/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/stable_deref_trait-1.2.1/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/synstructure-0.14.0/LICENSE +7 -0
- package/native/darwin-arm64/licenses/tinystr-0.8.5/LICENSE +46 -0
- package/native/darwin-arm64/licenses/url-2.5.8/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/url-2.5.8/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/utf8_iter-1.1.0/LICENSE-APACHE +202 -0
- package/native/darwin-arm64/licenses/utf8_iter-1.1.0/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/utf_types-1.0.0/LICENSE-APACHE +202 -0
- package/native/darwin-arm64/licenses/utf_types-1.0.0/LICENSE-MIT +25 -0
- package/native/darwin-arm64/licenses/uuid-1.29.2/LICENSE-APACHE +201 -0
- package/native/darwin-arm64/licenses/writeable-0.6.4/LICENSE +46 -0
- package/native/darwin-arm64/licenses/yoke-0.8.4/LICENSE +46 -0
- package/native/darwin-arm64/licenses/yoke-derive-0.8.4/LICENSE +46 -0
- package/native/darwin-arm64/licenses/zerofrom-0.1.8/LICENSE +46 -0
- package/native/darwin-arm64/licenses/zerofrom-derive-0.1.8/LICENSE +46 -0
- package/native/darwin-arm64/licenses/zerotrie-0.2.5/LICENSE +46 -0
- package/native/darwin-arm64/licenses/zerovec-0.11.9/LICENSE +46 -0
- package/native/darwin-arm64/licenses/zerovec-derive-0.11.7/LICENSE +46 -0
- package/native/win32-x64/THIRD_PARTY_NOTICES.md +38 -8
- package/native/win32-x64/alwith_native_device.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/native/win32-x64/licenses/displaydoc-0.2.7/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/form_urlencoded-1.2.2/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/form_urlencoded-1.2.2/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/icu_collections-2.4.0/LICENSE +46 -0
- package/native/win32-x64/licenses/icu_locale_core-2.4.0/LICENSE +46 -0
- package/native/win32-x64/licenses/icu_normalizer-2.4.0/LICENSE +46 -0
- package/native/win32-x64/licenses/icu_normalizer_data-2.4.0/LICENSE +46 -0
- package/native/win32-x64/licenses/icu_properties-2.4.0/LICENSE +46 -0
- package/native/win32-x64/licenses/icu_properties_data-2.4.0/LICENSE +46 -0
- package/native/win32-x64/licenses/icu_provider-2.4.0/LICENSE +46 -0
- package/native/win32-x64/licenses/idna-1.1.0/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/idna-1.1.0/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/idna_adapter-1.2.2/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/idna_adapter-1.2.2/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/itertools-0.15.0/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/itoa-1.0.19/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/litemap-0.8.3/LICENSE +46 -0
- package/native/win32-x64/licenses/memmap2-0.9.12/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/memmap2-0.9.12/LICENSE-MIT +26 -0
- package/native/win32-x64/licenses/percent-encoding-2.3.2/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/percent-encoding-2.3.2/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/potential_utf-0.1.6/LICENSE +46 -0
- package/native/win32-x64/licenses/prost-0.14.6/LICENSE +201 -0
- package/native/win32-x64/licenses/prost-derive-0.14.6/LICENSE +201 -0
- package/native/win32-x64/licenses/smallvec-1.16.5/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/smallvec-1.16.5/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/stable_deref_trait-1.2.1/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/stable_deref_trait-1.2.1/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/syn-3.0.10/LICENSE-MIT +23 -0
- package/native/win32-x64/licenses/synstructure-0.14.0/LICENSE +7 -0
- package/native/win32-x64/licenses/tinystr-0.8.5/LICENSE +46 -0
- package/native/win32-x64/licenses/url-2.5.8/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/url-2.5.8/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/utf8_iter-1.1.0/LICENSE-APACHE +202 -0
- package/native/win32-x64/licenses/utf8_iter-1.1.0/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/utf_types-1.0.0/LICENSE-APACHE +202 -0
- package/native/win32-x64/licenses/utf_types-1.0.0/LICENSE-MIT +25 -0
- package/native/win32-x64/licenses/uuid-1.29.2/LICENSE-APACHE +201 -0
- package/native/win32-x64/licenses/writeable-0.6.4/LICENSE +46 -0
- package/native/win32-x64/licenses/yoke-0.8.4/LICENSE +46 -0
- package/native/win32-x64/licenses/yoke-derive-0.8.4/LICENSE +46 -0
- package/native/win32-x64/licenses/zerofrom-0.1.8/LICENSE +46 -0
- package/native/win32-x64/licenses/zerofrom-derive-0.1.8/LICENSE +46 -0
- package/native/win32-x64/licenses/zerotrie-0.2.5/LICENSE +46 -0
- package/native/win32-x64/licenses/zerovec-0.11.9/LICENSE +46 -0
- package/native/win32-x64/licenses/zerovec-derive-0.11.7/LICENSE +46 -0
- package/package.json +2 -2
- package/dist/chunk-48n5t82k.js +0 -2
- package/dist/chunk-f0y4sedm.js +0 -2
- package/dist/chunk-mcpaya08.js +0 -2
- package/dist/chunk-s4svy2y1.js +0 -2
- /package/native/darwin-arm64/licenses/{crc32fast-1.5.4 → crc32fast-1.5.5}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{crc32fast-1.5.4 → crc32fast-1.5.5}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{errno-0.3.14 → displaydoc-0.2.7}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{itoa-1.0.18 → displaydoc-0.2.7}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{itertools-0.14.0 → errno-0.3.15}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{errno-0.3.14 → errno-0.3.15}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{uuid-1.29.1 → form_urlencoded-1.2.2}/LICENSE-APACHE +0 -0
- /package/native/{win32-x64/licenses/itertools-0.14.0 → darwin-arm64/licenses/idna-1.1.0}/LICENSE-APACHE +0 -0
- /package/native/{win32-x64/licenses/uuid-1.29.1 → darwin-arm64/licenses/idna_adapter-1.2.2}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{prost-0.14.4/LICENSE → itertools-0.15.0/LICENSE-APACHE} +0 -0
- /package/native/darwin-arm64/licenses/{itertools-0.14.0 → itertools-0.15.0}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{itoa-1.0.18 → itoa-1.0.19}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{syn-3.0.9 → itoa-1.0.19}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{mio-1.2.4 → mio-1.2.5}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{prost-derive-0.14.4/LICENSE → percent-encoding-2.3.2/LICENSE-APACHE} +0 -0
- /package/native/{win32-x64/licenses/prost-0.14.4 → darwin-arm64/licenses/prost-0.14.6}/LICENSE +0 -0
- /package/native/{win32-x64/licenses/prost-derive-0.14.4 → darwin-arm64/licenses/prost-derive-0.14.6}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{syn-3.0.9 → syn-3.0.10}/LICENSE-APACHE +0 -0
- /package/native/{win32-x64/licenses/itoa-1.0.18 → darwin-arm64/licenses/syn-3.0.10}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{uuid-1.29.1 → uuid-1.29.2}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{crc32fast-1.5.4 → crc32fast-1.5.5}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{crc32fast-1.5.4 → crc32fast-1.5.5}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{syn-3.0.9 → displaydoc-0.2.7}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{itertools-0.14.0 → itertools-0.15.0}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{itoa-1.0.18 → itoa-1.0.19}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{mio-1.2.4 → mio-1.2.5}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{syn-3.0.9 → syn-3.0.10}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{uuid-1.29.1 → uuid-1.29.2}/LICENSE-MIT +0 -0
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { type EventCallback as __t3Callback, type EventTarget as __t3Target } from '@tauri-apps/api/event';
|
|
2
2
|
export declare const commands: {
|
|
3
|
+
readonly tools: () => Promise<Value[]>;
|
|
4
|
+
readonly toolCall: (args: {
|
|
5
|
+
"sessionId": string;
|
|
6
|
+
"requestId": string;
|
|
7
|
+
"name": string;
|
|
8
|
+
"arguments": Value;
|
|
9
|
+
}) => Promise<Value>;
|
|
10
|
+
readonly toolCancel: (args: {
|
|
11
|
+
"sessionId": string;
|
|
12
|
+
"requestId": string;
|
|
13
|
+
}) => Promise<null>;
|
|
3
14
|
readonly context: () => Promise<{
|
|
4
15
|
registration: Registration;
|
|
5
16
|
carrier: DeviceCarrier;
|
|
@@ -26,10 +37,51 @@ export declare const commands: {
|
|
|
26
37
|
readonly frame: (args: {
|
|
27
38
|
"udid": string;
|
|
28
39
|
}) => Promise<string>;
|
|
40
|
+
readonly nativeViewSupported: (args: {
|
|
41
|
+
"platform": Platform;
|
|
42
|
+
}) => Promise<boolean>;
|
|
43
|
+
readonly nativeViewMount: (args: {
|
|
44
|
+
"sessionId": string;
|
|
45
|
+
"udid": string;
|
|
46
|
+
"layout": NativeViewLayout;
|
|
47
|
+
}) => Promise<string>;
|
|
48
|
+
readonly nativeViewUpdate: (args: {
|
|
49
|
+
"id": string;
|
|
50
|
+
"layout": NativeViewLayout;
|
|
51
|
+
}) => Promise<null>;
|
|
52
|
+
readonly nativeViewUnmount: (args: {
|
|
53
|
+
"id": string;
|
|
54
|
+
}) => Promise<null>;
|
|
55
|
+
readonly nativeViewStatus: (args: {
|
|
56
|
+
"id": string;
|
|
57
|
+
}) => Promise<NativeViewStatus_Serialize>;
|
|
29
58
|
readonly gesture: (args: {
|
|
30
59
|
"udid": string;
|
|
31
60
|
"gesture": Gesture;
|
|
32
61
|
}) => Promise<null>;
|
|
62
|
+
readonly inspect: (args: {
|
|
63
|
+
"sessionId": string;
|
|
64
|
+
"udid": string;
|
|
65
|
+
}) => Promise<string>;
|
|
66
|
+
readonly capabilities: (args: {
|
|
67
|
+
"sessionId": string;
|
|
68
|
+
"udid": string;
|
|
69
|
+
}) => Promise<DeviceCapabilities_Serialize>;
|
|
70
|
+
readonly monitorDensity: () => Promise<number | null>;
|
|
71
|
+
readonly activity: (args: {
|
|
72
|
+
"sessionId": string;
|
|
73
|
+
}) => Promise<DeviceActivity_Serialize[]>;
|
|
74
|
+
readonly captureList: (args: {
|
|
75
|
+
"sessionId": string;
|
|
76
|
+
}) => Promise<DeviceCapture[]>;
|
|
77
|
+
readonly captureAccess: (args: {
|
|
78
|
+
"sessionId": string;
|
|
79
|
+
"id": string;
|
|
80
|
+
}) => Promise<string>;
|
|
81
|
+
readonly captureRemove: (args: {
|
|
82
|
+
"sessionId": string;
|
|
83
|
+
"id": string;
|
|
84
|
+
}) => Promise<null>;
|
|
33
85
|
readonly appearance: (args: {
|
|
34
86
|
"udid": string;
|
|
35
87
|
}) => Promise<string>;
|
|
@@ -71,6 +123,9 @@ export declare const commands: {
|
|
|
71
123
|
} | null>;
|
|
72
124
|
};
|
|
73
125
|
export type CommandErrors = {
|
|
126
|
+
"tools": NativeError;
|
|
127
|
+
"toolCall": NativeError;
|
|
128
|
+
"toolCancel": NativeError;
|
|
74
129
|
"context": NativeError;
|
|
75
130
|
"bind": NativeError;
|
|
76
131
|
"stopSession": NativeError;
|
|
@@ -79,7 +134,19 @@ export type CommandErrors = {
|
|
|
79
134
|
"attach": NativeError;
|
|
80
135
|
"detach": NativeError;
|
|
81
136
|
"frame": NativeError;
|
|
137
|
+
"nativeViewSupported": never;
|
|
138
|
+
"nativeViewMount": NativeError;
|
|
139
|
+
"nativeViewUpdate": NativeError;
|
|
140
|
+
"nativeViewUnmount": NativeError;
|
|
141
|
+
"nativeViewStatus": NativeError;
|
|
82
142
|
"gesture": NativeError;
|
|
143
|
+
"inspect": NativeError;
|
|
144
|
+
"capabilities": NativeError;
|
|
145
|
+
"monitorDensity": NativeError;
|
|
146
|
+
"activity": never;
|
|
147
|
+
"captureList": NativeError;
|
|
148
|
+
"captureAccess": NativeError;
|
|
149
|
+
"captureRemove": NativeError;
|
|
83
150
|
"appearance": NativeError;
|
|
84
151
|
"setAppearance": NativeError;
|
|
85
152
|
"setStatusBar": NativeError;
|
|
@@ -109,11 +176,13 @@ export type AttachmentInfo_Deserialize = {
|
|
|
109
176
|
systemVersion: string;
|
|
110
177
|
owner: Owner;
|
|
111
178
|
attachedAt: string;
|
|
179
|
+
inputRevision?: number;
|
|
112
180
|
pixelWidth?: number | null;
|
|
113
181
|
pixelHeight?: number | null;
|
|
114
182
|
pointWidth?: number | null;
|
|
115
183
|
pointHeight?: number | null;
|
|
116
184
|
rotation?: number | null;
|
|
185
|
+
deviceRotation?: number | null;
|
|
117
186
|
recordingPath?: string | null;
|
|
118
187
|
app?: LaunchedApp | null;
|
|
119
188
|
};
|
|
@@ -124,20 +193,46 @@ export type AttachmentInfo_Serialize = {
|
|
|
124
193
|
systemVersion: string;
|
|
125
194
|
owner: Owner;
|
|
126
195
|
attachedAt: string;
|
|
196
|
+
inputRevision: number;
|
|
127
197
|
pixelWidth: number | null;
|
|
128
198
|
pixelHeight: number | null;
|
|
129
199
|
pointWidth: number | null;
|
|
130
200
|
pointHeight: number | null;
|
|
131
201
|
rotation: number | null;
|
|
202
|
+
deviceRotation: number | null;
|
|
132
203
|
recordingPath: string | null;
|
|
133
204
|
app: LaunchedApp | null;
|
|
134
205
|
};
|
|
206
|
+
export type ContactPhase = "begin" | "move" | "end" | "cancel";
|
|
135
207
|
export type CrashReport = {
|
|
136
208
|
path: string;
|
|
137
209
|
process: string;
|
|
138
210
|
timestamp: string;
|
|
139
211
|
summary: string;
|
|
140
212
|
};
|
|
213
|
+
export type DeviceActivity = DeviceActivity_Serialize | DeviceActivity_Deserialize;
|
|
214
|
+
export type DeviceActivity_Deserialize = {
|
|
215
|
+
id: string;
|
|
216
|
+
sessionId: string;
|
|
217
|
+
udid: string;
|
|
218
|
+
origin: string;
|
|
219
|
+
action: string;
|
|
220
|
+
startedAt: number;
|
|
221
|
+
durationMs?: number | null;
|
|
222
|
+
status: string;
|
|
223
|
+
error?: string | null;
|
|
224
|
+
};
|
|
225
|
+
export type DeviceActivity_Serialize = {
|
|
226
|
+
id: string;
|
|
227
|
+
sessionId: string;
|
|
228
|
+
udid: string;
|
|
229
|
+
origin: string;
|
|
230
|
+
action: string;
|
|
231
|
+
startedAt: number;
|
|
232
|
+
durationMs: number | null;
|
|
233
|
+
status: string;
|
|
234
|
+
error: string | null;
|
|
235
|
+
};
|
|
141
236
|
export type DeviceAttachments = DeviceAttachments_Serialize | DeviceAttachments_Deserialize;
|
|
142
237
|
export type DeviceAttachments_Deserialize = {
|
|
143
238
|
revision: number;
|
|
@@ -148,6 +243,25 @@ export type DeviceAttachments_Serialize = {
|
|
|
148
243
|
attachments: AttachmentInfo_Serialize[];
|
|
149
244
|
};
|
|
150
245
|
export type DeviceButton = "HOME" | "LOCK" | "SIRI" | "BACK" | "RECENTS";
|
|
246
|
+
export type DeviceCapabilities = DeviceCapabilities_Serialize | DeviceCapabilities_Deserialize;
|
|
247
|
+
export type DeviceCapabilities_Deserialize = {
|
|
248
|
+
densityDpi?: number | null;
|
|
249
|
+
hingeAngle?: number | null;
|
|
250
|
+
};
|
|
251
|
+
export type DeviceCapabilities_Serialize = {
|
|
252
|
+
densityDpi: number | null;
|
|
253
|
+
hingeAngle: number | null;
|
|
254
|
+
};
|
|
255
|
+
export type DeviceCapture = {
|
|
256
|
+
id: string;
|
|
257
|
+
sessionId: string;
|
|
258
|
+
udid: string;
|
|
259
|
+
path: string;
|
|
260
|
+
name: string;
|
|
261
|
+
kind: string;
|
|
262
|
+
createdAt: number;
|
|
263
|
+
bytes: number;
|
|
264
|
+
};
|
|
151
265
|
export type DeviceCarrier = {
|
|
152
266
|
command: string;
|
|
153
267
|
args: string[];
|
|
@@ -158,6 +272,10 @@ export type DeviceSessionConnection = {
|
|
|
158
272
|
carrier: DeviceCarrier;
|
|
159
273
|
};
|
|
160
274
|
export type Gesture = {
|
|
275
|
+
type: "contact";
|
|
276
|
+
phase: ContactPhase;
|
|
277
|
+
contacts: TouchPoint[];
|
|
278
|
+
} | {
|
|
161
279
|
type: "tap";
|
|
162
280
|
x: number;
|
|
163
281
|
y: number;
|
|
@@ -186,6 +304,9 @@ export type Gesture = {
|
|
|
186
304
|
} | {
|
|
187
305
|
type: "button";
|
|
188
306
|
name: DeviceButton;
|
|
307
|
+
} | {
|
|
308
|
+
type: "hinge";
|
|
309
|
+
angle: number;
|
|
189
310
|
} | {
|
|
190
311
|
type: "shake";
|
|
191
312
|
} | {
|
|
@@ -243,6 +364,37 @@ export type NativeError = {
|
|
|
243
364
|
} & {
|
|
244
365
|
[key in string]: unknown;
|
|
245
366
|
};
|
|
367
|
+
export type NativeViewLayout = {
|
|
368
|
+
occlusions: NativeViewOcclusion[];
|
|
369
|
+
x: number;
|
|
370
|
+
y: number;
|
|
371
|
+
width: number;
|
|
372
|
+
height: number;
|
|
373
|
+
clipX: number;
|
|
374
|
+
clipY: number;
|
|
375
|
+
clipWidth: number;
|
|
376
|
+
clipHeight: number;
|
|
377
|
+
radius: number;
|
|
378
|
+
rotation: number;
|
|
379
|
+
maxFps: number;
|
|
380
|
+
visible: boolean;
|
|
381
|
+
};
|
|
382
|
+
export type NativeViewOcclusion = {
|
|
383
|
+
x: number;
|
|
384
|
+
y: number;
|
|
385
|
+
width: number;
|
|
386
|
+
height: number;
|
|
387
|
+
};
|
|
388
|
+
export type NativeViewStatus = NativeViewStatus_Serialize | NativeViewStatus_Deserialize;
|
|
389
|
+
export type NativeViewStatus_Deserialize = {
|
|
390
|
+
frames: number;
|
|
391
|
+
error?: string | null;
|
|
392
|
+
};
|
|
393
|
+
export type NativeViewStatus_Serialize = {
|
|
394
|
+
frames: number;
|
|
395
|
+
error: string | null;
|
|
396
|
+
};
|
|
397
|
+
export type Number = number;
|
|
246
398
|
export type Owner = {
|
|
247
399
|
type: "development_session";
|
|
248
400
|
id: string;
|
|
@@ -270,5 +422,8 @@ export type TouchPoint = {
|
|
|
270
422
|
x: number;
|
|
271
423
|
y: number;
|
|
272
424
|
};
|
|
425
|
+
export type Value = null | boolean | number | string | Value[] | {
|
|
426
|
+
[key in string]: Value;
|
|
427
|
+
};
|
|
273
428
|
export declare function isNativeError(error: unknown): error is NativeError;
|
|
274
429
|
export declare function nativeErrorMessage(error: unknown): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e,
|
|
1
|
+
import{e,g,T,B}from"../chunk-7n1fmm2p.js";export{e as commands,g as events,T as isNativeError,B as nativeErrorMessage};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L,I,h}from"./chunk-3zjj07q7.js";import{a,r}from"./chunk-35bn393s.js";export{I as DEVICE_INSTRUCTIONS,L as DEVICE_SERVER_NAME,h as deviceContext,a as deviceLocales,r as resolveDeviceLabels};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N}from"../chunk-ge4zgdtr.js";export{N as ActivityDrawer};
|
package/dist/preview/bezel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P,i,u,d}from"../chunk-xd4kq6pe.js";export{d as Bezel,P as FRAMES,i as frameKindFor,u as screenPlacement};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DeviceBridge, DeviceCapture } from "./types";
|
|
2
|
+
export declare function Captures({ bridge, language, revision, onClose, onAdd }: {
|
|
3
|
+
bridge: DeviceBridge;
|
|
4
|
+
language?: string;
|
|
5
|
+
revision: number;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onAdd?: (capture: DeviceCapture, url: string) => Promise<void>;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C}from"../chunk-pa4b54h3.js";export{C as Captures};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { DevicePanelProps } from "./types";
|
|
2
|
-
export declare function DevicePanel({ bridge, platform: initialPlatform, udid, language, agentName, pollFps: initialFps, maximized, onMaximize, onClose, className }: DevicePanelProps): import("react").JSX.Element;
|
|
2
|
+
export declare function DevicePanel({ bridge, onAddContext, onAddCapture, platform: initialPlatform, udid, initialDeviceId, onDeviceChange, language, agentName, pollFps: initialFps, maximized, onMaximize, windowAction, windowGrip, onClose, className }: DevicePanelProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{z}from"../chunk-j6sbvhyq.js";import"../chunk-40mwa0cy.js";import"../chunk-tp1d4pv6.js";import"../chunk-cyvmm690.js";import"../chunk-3n6qrzdg.js";import"../chunk-xd4kq6pe.js";import"../chunk-mx5dd23x.js";import"../chunk-35bn393s.js";import"../chunk-pa4b54h3.js";import"../chunk-ge4zgdtr.js";import"../chunk-arw91r4t.js";import"../chunk-pxyqksfz.js";export{z as DevicePanel};
|
|
@@ -35,7 +35,7 @@ export declare function pointFor(rect: {
|
|
|
35
35
|
top: number;
|
|
36
36
|
width: number;
|
|
37
37
|
height: number;
|
|
38
|
-
}, clientX: number, clientY: number, pointWidth: number, pointHeight: number): {
|
|
38
|
+
}, clientX: number, clientY: number, pointWidth: number, pointHeight: number, rotation?: number): {
|
|
39
39
|
x: number;
|
|
40
40
|
y: number;
|
|
41
41
|
} | null;
|
package/dist/preview/gestures.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{v,o,s,f,b,l,c,M}from"../chunk-40mwa0cy.js";export{s as ANDROID_SHORTCUTS,o as IOS_SHORTCUTS,v as KEY_CODES,l as keyGesture,M as pathGesture,c as pointFor,f as releaseGesture,b as shortcutKey};
|
package/dist/preview/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export { deviceLocales, fill, resolveDeviceLabels } from "./locales";
|
|
|
6
6
|
export type { PanelLabels } from "./locales";
|
|
7
7
|
export { MenuButton } from "./menu";
|
|
8
8
|
export type { MenuEntry } from "./menu";
|
|
9
|
-
export type { AttachmentInfo, DeviceBridge, DeviceGesture, DeviceOwner, DevicePanelProps, LaunchedApp, LogEntry, LogPage, ManagedDevice } from "./types";
|
|
9
|
+
export type { AttachmentInfo, DeviceBridge, DeviceActivity, DeviceCapture, DeviceGesture, DeviceOwner, DevicePanelProps, LaunchedApp, LogEntry, LogPage, ManagedDevice } from "./types";
|
package/dist/preview/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P,i,u,d}from"../chunk-xd4kq6pe.js";import"../chunk-ge4zgdtr.js";import"../chunk-pa4b54h3.js";import{v,o,s,f,b,l,c}from"../chunk-40mwa0cy.js";import"../chunk-cyvmm690.js";import"../chunk-pxyqksfz.js";import"../chunk-mx5dd23x.js";import{a,r,t}from"../chunk-35bn393s.js";import{n}from"../chunk-arw91r4t.js";import"../chunk-tp1d4pv6.js";import"../chunk-3n6qrzdg.js";import{z}from"../chunk-j6sbvhyq.js";export{s as ANDROID_SHORTCUTS,d as Bezel,z as DevicePanel,P as FRAMES,o as IOS_SHORTCUTS,v as KEY_CODES,n as MenuButton,a as deviceLocales,t as fill,i as frameKindFor,l as keyGesture,c as pointFor,f as releaseGesture,r as resolveDeviceLabels,u as screenPlacement,b as shortcutKey};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DeviceElement {
|
|
2
|
+
id: string;
|
|
3
|
+
depth: number;
|
|
4
|
+
label: string;
|
|
5
|
+
role: string;
|
|
6
|
+
identifier: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
frame: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
properties: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export declare function parseInspection(source: string, platform: string): DeviceElement[];
|
|
17
|
+
export declare function elementsAt(elements: DeviceElement[], point: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
}): DeviceElement[];
|
|
21
|
+
export declare function elementContext(deviceName: string, platform: string, element: DeviceElement, note: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S,w,k}from"../chunk-cyvmm690.js";export{k as elementContext,w as elementsAt,S as parseInspection};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DeviceElement } from "./inspection";
|
|
2
|
+
export declare function inspectionLabels(language?: string): {
|
|
3
|
+
inspect: string;
|
|
4
|
+
refresh: string;
|
|
5
|
+
close: string;
|
|
6
|
+
note: string;
|
|
7
|
+
add: string;
|
|
8
|
+
copy: string;
|
|
9
|
+
empty: string;
|
|
10
|
+
loading: string;
|
|
11
|
+
previous: string;
|
|
12
|
+
next: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function Inspector({ elements, selected, loading, error, language, onSelect, onRefresh, onClose, onAdd, onCopy, onCycle }: {
|
|
15
|
+
elements: DeviceElement[];
|
|
16
|
+
selected: DeviceElement | null;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
error: string | null;
|
|
19
|
+
language?: string;
|
|
20
|
+
onSelect: (element: DeviceElement) => void;
|
|
21
|
+
onRefresh: () => void;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
onAdd?: (element: DeviceElement, note: string) => Promise<void>;
|
|
24
|
+
onCopy: (text: string) => Promise<void>;
|
|
25
|
+
onCycle: (direction: number) => void;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m,E}from"../chunk-pxyqksfz.js";export{E as Inspector,m as inspectionLabels};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DeviceGesture } from "./types";
|
|
2
|
+
type Contact = Extract<DeviceGesture, {
|
|
3
|
+
type: "contact";
|
|
4
|
+
}>;
|
|
5
|
+
export declare class LiveTouch {
|
|
6
|
+
private queue;
|
|
7
|
+
private sending;
|
|
8
|
+
private active;
|
|
9
|
+
private send;
|
|
10
|
+
private error;
|
|
11
|
+
constructor(send: (input: DeviceGesture) => Promise<void>, error: (error: unknown) => void);
|
|
12
|
+
push(phase: Contact["phase"], contacts: Contact["contacts"]): void;
|
|
13
|
+
cancel(): void;
|
|
14
|
+
private drain;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p}from"../chunk-mx5dd23x.js";export{p as LiveTouch};
|
package/dist/preview/locales.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,r,t}from"../chunk-35bn393s.js";export{a as deviceLocales,t as fill,r as resolveDeviceLabels};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { NativeDeviceView, NativeViewLayout } from "./types";
|
|
2
|
+
export declare function intersect(a: {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}, b: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}): {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function viewLayout(node: HTMLElement): NativeViewLayout;
|
|
19
|
+
export declare function useNativeView(api: NativeDeviceView | undefined, platform: string, udid: string, fps: number, onError: (message: string | null) => void, onFps: (fps: number) => void): {
|
|
20
|
+
supported: boolean | null;
|
|
21
|
+
ref: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null>>;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y,R,x}from"../chunk-tp1d4pv6.js";export{y as intersect,x as useNativeView,R as viewLayout};
|
package/dist/preview/screens.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{D,A}from"../chunk-3n6qrzdg.js";import"../chunk-35bn393s.js";export{D as AttachScreen,A as ConsentScreen};
|
package/dist/preview/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
export interface ManagedDevice {
|
|
2
3
|
id: string;
|
|
3
4
|
platform: string;
|
|
@@ -25,11 +26,13 @@ export interface AttachmentInfo {
|
|
|
25
26
|
systemVersion: string;
|
|
26
27
|
owner: DeviceOwner;
|
|
27
28
|
attachedAt: string;
|
|
29
|
+
inputRevision?: number;
|
|
28
30
|
pixelWidth: number | null;
|
|
29
31
|
pixelHeight: number | null;
|
|
30
32
|
pointWidth?: number | null;
|
|
31
33
|
pointHeight?: number | null;
|
|
32
34
|
rotation?: number | null;
|
|
35
|
+
deviceRotation?: number | null;
|
|
33
36
|
recordingPath?: string | null;
|
|
34
37
|
app: LaunchedApp | null;
|
|
35
38
|
}
|
|
@@ -51,6 +54,13 @@ export interface LogPage {
|
|
|
51
54
|
captureStartedAt: string;
|
|
52
55
|
}
|
|
53
56
|
export type DeviceGesture = {
|
|
57
|
+
type: "contact";
|
|
58
|
+
phase: "begin" | "move" | "end" | "cancel";
|
|
59
|
+
contacts: {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
}[];
|
|
63
|
+
} | {
|
|
54
64
|
type: "tap";
|
|
55
65
|
x: number;
|
|
56
66
|
y: number;
|
|
@@ -82,6 +92,9 @@ export type DeviceGesture = {
|
|
|
82
92
|
} | {
|
|
83
93
|
type: "button";
|
|
84
94
|
name: "HOME" | "LOCK" | "SIRI" | "BACK" | "RECENTS";
|
|
95
|
+
} | {
|
|
96
|
+
type: "hinge";
|
|
97
|
+
angle: number;
|
|
85
98
|
} | {
|
|
86
99
|
type: "shake";
|
|
87
100
|
} | {
|
|
@@ -90,14 +103,78 @@ export type DeviceGesture = {
|
|
|
90
103
|
type: "rotate";
|
|
91
104
|
direction: "left" | "right";
|
|
92
105
|
};
|
|
106
|
+
export interface NativeViewLayout {
|
|
107
|
+
occlusions: {
|
|
108
|
+
x: number;
|
|
109
|
+
y: number;
|
|
110
|
+
width: number;
|
|
111
|
+
height: number;
|
|
112
|
+
}[];
|
|
113
|
+
rotation: number;
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
width: number;
|
|
117
|
+
height: number;
|
|
118
|
+
clipX: number;
|
|
119
|
+
clipY: number;
|
|
120
|
+
clipWidth: number;
|
|
121
|
+
clipHeight: number;
|
|
122
|
+
radius: number;
|
|
123
|
+
maxFps: number;
|
|
124
|
+
visible: boolean;
|
|
125
|
+
}
|
|
126
|
+
export interface NativeDeviceView {
|
|
127
|
+
supported(platform: string): Promise<boolean>;
|
|
128
|
+
mount(udid: string, layout: NativeViewLayout): Promise<string>;
|
|
129
|
+
update(id: string, layout: NativeViewLayout): Promise<void>;
|
|
130
|
+
unmount(id: string): Promise<void>;
|
|
131
|
+
status(id: string): Promise<{
|
|
132
|
+
frames: number;
|
|
133
|
+
error: string | null;
|
|
134
|
+
}>;
|
|
135
|
+
}
|
|
136
|
+
export interface DeviceActivity {
|
|
137
|
+
id: string;
|
|
138
|
+
sessionId: string;
|
|
139
|
+
udid: string;
|
|
140
|
+
origin: string;
|
|
141
|
+
action: string;
|
|
142
|
+
startedAt: number;
|
|
143
|
+
durationMs: number | null;
|
|
144
|
+
status: string;
|
|
145
|
+
error: string | null;
|
|
146
|
+
}
|
|
147
|
+
export interface DeviceCapture {
|
|
148
|
+
id: string;
|
|
149
|
+
sessionId: string;
|
|
150
|
+
udid: string;
|
|
151
|
+
path: string;
|
|
152
|
+
name: string;
|
|
153
|
+
kind: string;
|
|
154
|
+
createdAt: number;
|
|
155
|
+
bytes: number;
|
|
156
|
+
}
|
|
93
157
|
export interface DeviceBridge {
|
|
158
|
+
nativeView?: NativeDeviceView;
|
|
94
159
|
listDevices(platform: string): Promise<ManagedDevice[]>;
|
|
95
160
|
attach(udid: string | undefined, platform: string): Promise<AttachmentInfo>;
|
|
96
161
|
detach(udid: string): Promise<void>;
|
|
97
162
|
captureFrame(udid: string): Promise<string | null>;
|
|
98
163
|
gesture(udid: string, gesture: DeviceGesture): Promise<void>;
|
|
99
|
-
subscribe(listener: (attachments: AttachmentInfo[]) => void): () => void;
|
|
164
|
+
subscribe(listener: (attachments: AttachmentInfo[]) => void, onError?: (error: unknown) => void): () => void;
|
|
100
165
|
takeOver?(udid: string): Promise<void>;
|
|
166
|
+
readActivity?(): Promise<DeviceActivity[]>;
|
|
167
|
+
listCaptures?(): Promise<DeviceCapture[]>;
|
|
168
|
+
captureUrl?(id: string): Promise<string>;
|
|
169
|
+
removeCapture?(id: string): Promise<void>;
|
|
170
|
+
revealCapture?(path: string): Promise<void>;
|
|
171
|
+
monitorDensity?(): Promise<number | null>;
|
|
172
|
+
capabilities?(udid: string): Promise<{
|
|
173
|
+
densityDpi: number | null;
|
|
174
|
+
hingeAngle: number | null;
|
|
175
|
+
}>;
|
|
176
|
+
inspect?(udid: string): Promise<string>;
|
|
177
|
+
copyText?(text: string): Promise<void>;
|
|
101
178
|
appearance?(udid: string): Promise<string>;
|
|
102
179
|
setAppearance?(udid: string, mode: "light" | "dark"): Promise<void>;
|
|
103
180
|
setStatusBar?(udid: string, look: "showcase" | "live"): Promise<void>;
|
|
@@ -119,12 +196,21 @@ export interface DeviceBridge {
|
|
|
119
196
|
}
|
|
120
197
|
export interface DevicePanelProps {
|
|
121
198
|
bridge: DeviceBridge;
|
|
199
|
+
onAddContext?: (text: string) => Promise<void>;
|
|
200
|
+
onAddCapture?: (capture: DeviceCapture, url: string) => Promise<void>;
|
|
122
201
|
platform?: "ios" | "android";
|
|
123
202
|
udid?: string;
|
|
203
|
+
initialDeviceId?: string;
|
|
204
|
+
onDeviceChange?: (udid: string | undefined) => void;
|
|
124
205
|
language?: string;
|
|
125
206
|
agentName?: string;
|
|
126
207
|
pollFps?: number;
|
|
127
208
|
maximized?: boolean;
|
|
209
|
+
windowGrip?: ReactNode;
|
|
210
|
+
windowAction?: {
|
|
211
|
+
label: string;
|
|
212
|
+
onSelect: () => void;
|
|
213
|
+
};
|
|
128
214
|
onMaximize?: () => void;
|
|
129
215
|
onClose?: () => void;
|
|
130
216
|
className?: string;
|
package/dist/tauri.d.ts
CHANGED
|
@@ -9,3 +9,26 @@ export declare function deviceSessionContext(): Promise<{
|
|
|
9
9
|
appendSystemPrompt?: string;
|
|
10
10
|
bind?: (sessionId: string) => Promise<void>;
|
|
11
11
|
}>;
|
|
12
|
+
export interface DeviceToolDefinition {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
inputSchema: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface DeviceToolResult {
|
|
18
|
+
isError: boolean;
|
|
19
|
+
content: ({
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: "image";
|
|
24
|
+
data: string;
|
|
25
|
+
mimeType: string;
|
|
26
|
+
})[];
|
|
27
|
+
}
|
|
28
|
+
export declare function deviceToolDefinitions(): Promise<DeviceToolDefinition[]>;
|
|
29
|
+
export declare function callDeviceTool(name: string, args: Record<string, unknown>, context: {
|
|
30
|
+
sessionId: string;
|
|
31
|
+
requestId: string;
|
|
32
|
+
signal: AbortSignal;
|
|
33
|
+
projectPath?: string;
|
|
34
|
+
}): Promise<DeviceToolResult>;
|
package/dist/tauri.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e,
|
|
1
|
+
import{e,g}from"./chunk-7n1fmm2p.js";import"./chunk-35bn393s.js";import{h}from"./chunk-3zjj07q7.js";import{convertFileSrc as w,isTauri as y}from"@tauri-apps/api/core";function v(n){if(n==="ios"||n==="android")return n;throw Error(`Unsupported device platform: ${n}`)}function A(n){return{nativeView:{supported:(t)=>e.nativeViewSupported({platform:v(t)}),mount:(t,r)=>e.nativeViewMount({sessionId:n,udid:t,layout:r}),update:async(t,r)=>{await e.nativeViewUpdate({id:t,layout:r})},unmount:async(t)=>{await e.nativeViewUnmount({id:t})},status:(t)=>e.nativeViewStatus({id:t})},listDevices:(t)=>e.list({platform:v(t)}),attach:(t,r)=>e.attach({sessionId:n,platform:v(r),udid:t??null}),detach:async(t)=>{await e.detach({udid:t})},captureFrame:(t)=>e.frame({udid:t}),gesture:async(t,r)=>{await e.gesture({udid:t,gesture:r})},readActivity:()=>e.activity({sessionId:n}),listCaptures:()=>e.captureList({sessionId:n}),captureUrl:async(t)=>w(await e.captureAccess({sessionId:n,id:t})),removeCapture:async(t)=>{await e.captureRemove({sessionId:n,id:t})},monitorDensity:()=>e.monitorDensity(),capabilities:(t)=>e.capabilities({sessionId:n,udid:t}),inspect:(t)=>e.inspect({sessionId:n,udid:t}),appearance:(t)=>e.appearance({udid:t}),setAppearance:async(t,r)=>{await e.setAppearance({udid:t,mode:r})},setStatusBar:async(t,r)=>{await e.setStatusBar({udid:t,look:r})},shutdown:async(t)=>{await e.shutdown({udid:t})},restart:async(t)=>{await e.restart({udid:t})},readLogs:(t,r)=>e.logs({udid:t,query:{sinceSeq:r.sinceSeq??null,tail:r.tail??null,minLevel:r.minLevel??null,filter:r.filter??null}}),startRecording:(t)=>e.recordStart({udid:t}),stopRecording:(t)=>e.recordStop({udid:t}),saveScreenshot:(t)=>e.saveScreenshot({udid:t}),subscribe:(t,r)=>{if(!y())return()=>{};let s=!1,u,c=(a)=>a.filter((d)=>d.owner.type==="development_session"&&d.owner.id===n),p=-1;return g["device:attachments"].listen(({payload:a})=>{if(!s&&a.revision>p)p=a.revision,t(c(a.attachments))}).then(async(a)=>{if(s){a();return}u=a;let d=p,l=await e.attachments();if(!s&&p===d)t(c(l))}).catch((a)=>{if(!s)r?.(a)}),()=>{s=!0,u?.()}}}}async function x(){if(!y())return{mcpServers:[]};let n=await e.context();if(!n)return{mcpServers:[]};let t=await h(()=>Promise.resolve(n.registration),n.carrier),r=n.registration.token;return{mcpServers:t.mcpServers,...t.appendSystemPrompt?{appendSystemPrompt:t.appendSystemPrompt}:{},bind:async(s)=>{await e.bind({token:r,sessionId:s})}}}async function P(){let n=await e.tools();if(!Array.isArray(n)||n.some((t)=>!t||typeof t!=="object"||Array.isArray(t)||typeof t.name!=="string"||typeof t.description!=="string"||!t.inputSchema||typeof t.inputSchema!=="object"||Array.isArray(t.inputSchema)))throw Error("Invalid device tool definitions");return n}async function T(n,t,r){let{sessionId:s,requestId:u,signal:c}=r;c.throwIfAborted();let p=t.platform==="android"?"android":"ios",a=r.projectPath?`alwith:device:target:${JSON.stringify([r.projectPath,p])}`:null,d=t;if(n==="control"&&t.action==="attach"&&t.udid===void 0&&a){let o=localStorage.getItem(a);if(o){if((await e.list({platform:p})).some((i)=>i.id===o))d={...t,udid:o}}}c.throwIfAborted();let l=()=>{e.toolCancel({sessionId:s,requestId:u}).catch((o)=>console.error("Cannot cancel device operation",o))};c.addEventListener("abort",l,{once:!0});try{let o=await e.toolCall({sessionId:s,requestId:u,name:n,arguments:d});if(c.throwIfAborted(),!o||typeof o!=="object"||!("isError"in o)||typeof o.isError!=="boolean"||!("content"in o)||!Array.isArray(o.content)||o.content.some((i)=>!i||typeof i!=="object"||!("type"in i)||(i.type==="text"?!("text"in i)||typeof i.text!=="string":i.type==="image"?!("data"in i)||typeof i.data!=="string"||!("mimeType"in i)||typeof i.mimeType!=="string":!0)))throw Error("Invalid device tool result");let f=o;if(!f.isError&&n==="control"&&t.action==="attach"&&a){let i=f.content.find((m)=>m.type==="text");if(i?.type==="text"){let m=JSON.parse(i.text);if(typeof m.attachment?.udid==="string")localStorage.setItem(a,m.attachment.udid)}}return f}finally{c.removeEventListener("abort",l)}}export{T as callDeviceTool,A as deviceBridge,x as deviceSessionContext,P as deviceToolDefinitions};
|