@swipt/cli 0.1.0-nightly.94 → 0.1.0-nightly.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/cli/cli.js +1 -1
  2. package/dist/cli/cli.js.map +1 -1
  3. package/dist/cli/commands/data/read.js +4 -6
  4. package/dist/cli/commands/data/read.js.map +1 -1
  5. package/dist/cli/commands/device/stop.js +3 -3
  6. package/dist/cli/commands/device/stop.js.map +1 -1
  7. package/dist/cli/commands/driver/driver.js +28 -0
  8. package/dist/cli/commands/driver/driver.js.map +1 -0
  9. package/dist/cli/commands/driver/index.js +1 -0
  10. package/dist/cli/commands/flags.js +8 -7
  11. package/dist/cli/commands/flags.js.map +1 -1
  12. package/dist/cli/commands/index.js +3 -0
  13. package/dist/cli/commands/index.js.map +1 -1
  14. package/dist/cli/commands/project/create.js +2 -2
  15. package/dist/cli/commands/project/create.js.map +1 -1
  16. package/dist/cli/commands/project/source.js +10 -9
  17. package/dist/cli/commands/project/source.js.map +1 -1
  18. package/dist/cli/commands/swiplet/remove.js +1 -1
  19. package/dist/cli/commands/swiplet/remove.js.map +1 -1
  20. package/dist/client.js +27 -6
  21. package/dist/client.js.map +1 -1
  22. package/dist/connection.d.ts +3 -1
  23. package/dist/connection.js +41 -52
  24. package/dist/connection.js.map +1 -1
  25. package/dist/directories.d.ts +2 -0
  26. package/dist/directories.js +9 -0
  27. package/dist/directories.js.map +1 -0
  28. package/dist/driver.d.ts +39 -0
  29. package/dist/driver.js +199 -0
  30. package/dist/driver.js.map +1 -0
  31. package/dist/i18n.d.ts +1 -1
  32. package/dist/i18n.js +43 -7
  33. package/dist/i18n.js.map +1 -1
  34. package/dist/mdns.d.ts +7 -0
  35. package/dist/mdns.js +44 -0
  36. package/dist/mdns.js.map +1 -0
  37. package/dist/output.js +6 -6
  38. package/dist/output.js.map +1 -1
  39. package/dist/passcode.d.ts +9 -0
  40. package/dist/passcode.js +81 -0
  41. package/dist/passcode.js.map +1 -0
  42. package/dist/project.js +38 -32
  43. package/dist/project.js.map +1 -1
  44. package/dist/serve.d.ts +1 -0
  45. package/dist/serve.js +124 -0
  46. package/dist/serve.js.map +1 -0
  47. package/dist/sideload.d.ts +0 -1
  48. package/dist/sideload.js +82 -340
  49. package/dist/sideload.js.map +1 -1
  50. package/dist/swipt-app.d.ts +14 -0
  51. package/dist/swipt-app.js +51 -0
  52. package/dist/swipt-app.js.map +1 -0
  53. package/locales/ar.json +52 -28
  54. package/locales/bg.json +58 -34
  55. package/locales/bn.json +49 -25
  56. package/locales/ca.json +55 -31
  57. package/locales/cs.json +55 -31
  58. package/locales/da.json +50 -26
  59. package/locales/de.json +50 -26
  60. package/locales/el.json +60 -36
  61. package/locales/es-419.json +51 -27
  62. package/locales/es.json +51 -27
  63. package/locales/fi.json +51 -27
  64. package/locales/fr-CA.json +53 -29
  65. package/locales/fr.json +56 -32
  66. package/locales/gu.json +69 -45
  67. package/locales/he.json +51 -27
  68. package/locales/hi.json +50 -26
  69. package/locales/hr.json +51 -27
  70. package/locales/hu.json +62 -38
  71. package/locales/id.json +50 -26
  72. package/locales/it.json +69 -45
  73. package/locales/ja.json +50 -26
  74. package/locales/kk.json +49 -25
  75. package/locales/kn.json +49 -25
  76. package/locales/ko.json +79 -55
  77. package/locales/lt.json +50 -26
  78. package/locales/ml.json +49 -25
  79. package/locales/mr.json +56 -32
  80. package/locales/ms.json +50 -26
  81. package/locales/nb.json +50 -26
  82. package/locales/nl.json +56 -32
  83. package/locales/or.json +50 -26
  84. package/locales/pa.json +49 -25
  85. package/locales/pl.json +68 -44
  86. package/locales/pt-BR.json +51 -27
  87. package/locales/pt-PT.json +52 -28
  88. package/locales/ro.json +52 -28
  89. package/locales/ru.json +54 -30
  90. package/locales/sk.json +80 -56
  91. package/locales/sl.json +50 -26
  92. package/locales/sv.json +52 -28
  93. package/locales/ta.json +49 -25
  94. package/locales/te.json +49 -25
  95. package/locales/th.json +54 -30
  96. package/locales/tr.json +50 -26
  97. package/locales/uk.json +53 -29
  98. package/locales/ur.json +49 -25
  99. package/locales/vi.json +49 -25
  100. package/locales/zh-HK.json +54 -30
  101. package/locales/zh-Hans.json +54 -30
  102. package/locales/zh-Hant.json +60 -36
  103. package/package.json +13 -4
  104. package/dist/coredevice.d.ts +0 -22
  105. package/dist/coredevice.js +0 -329
  106. package/dist/coredevice.js.map +0 -1
@@ -1,329 +0,0 @@
1
- import { label, sameName } from "./connection.js";
2
- import { tr } from "./i18n.js";
3
- import { choose, interactive, step } from "./output.js";
4
- import { createRequire } from "node:module";
5
- import fs from "node:fs";
6
- import path from "node:path";
7
- import { execFile } from "node:child_process";
8
- import os from "node:os";
9
- import { promisify } from "node:util";
10
- import { randomUUID } from "node:crypto";
11
- import net from "node:net";
12
- // src/coredevice.ts
13
- const exec = promisify(execFile);
14
- const xcodeMissing = tr("Xcode is missing; install it from the App Store, open it once, and select it with xcode-select");
15
- async function devicectl(args, { parse = false } = {}) {
16
- const output = parse ? path.join(os.tmpdir(), `devicectl-${randomUUID()}.json`) : void 0;
17
- try {
18
- await exec("xcrun", [
19
- "devicectl",
20
- ...args,
21
- ...parse ? ["--json-output", output] : []
22
- ], { maxBuffer: Infinity });
23
- } catch (error) {
24
- if (error.code === "ENOENT") throw new Error(xcodeMissing);
25
- if (typeof error.code !== "number") throw error;
26
- const text = `${error.stdout}${error.stderr}`;
27
- if (/^(xcrun|xcode-select): /m.test(text)) throw new Error(`${xcodeMissing} (${text.trim()})`);
28
- if (text.includes("4016")) throw new Error(tr("CoreDevice can't reach the device while its loopback VPN is on; turn off Swipt's VPN on the device, then run this again."));
29
- throw new Error(text.trim() || `devicectl exited with ${error.code}`);
30
- }
31
- if (!parse) return;
32
- const parsed = JSON.parse(fs.readFileSync(output, "utf8"));
33
- fs.rmSync(output);
34
- return parsed;
35
- }
36
- const serverHint = tr("swipt-server is missing; install it with \"npm install -g @swipt/cli --include=optional\"");
37
- function serverPath() {
38
- const built = path.resolve(import.meta.dirname, "../../build/swipt-server");
39
- if (fs.existsSync(built)) return built;
40
- let packaged;
41
- try {
42
- packaged = path.join(path.dirname(createRequire(import.meta.url).resolve(`@swipt/server-${process.platform}-${process.arch}/package.json`)), "swipt-server");
43
- } catch (error) {
44
- if (error.code !== "MODULE_NOT_FOUND") throw error;
45
- return "swipt-server";
46
- }
47
- return fs.existsSync(packaged) ? packaged : "swipt-server";
48
- }
49
- async function guest(device, args) {
50
- try {
51
- await exec(serverPath(), [
52
- "guest",
53
- "-d",
54
- device.udid,
55
- "--socket",
56
- device.socket,
57
- ...args
58
- ]);
59
- } catch (error) {
60
- if (error.code === "ENOENT") throw new Error(serverHint);
61
- throw new Error(`${error.stderr ?? ""}`.replace(/^Error: /, "").trim() || error.message);
62
- }
63
- }
64
- function callGuest(device, method, params = {}) {
65
- return new Promise((resolve, reject) => {
66
- const socket = net.createConnection(device.socket, () => socket.write(`${JSON.stringify({
67
- t: "rpc",
68
- method,
69
- params
70
- })}\n`));
71
- const chunks = [];
72
- socket.on("data", (chunk) => {
73
- chunks.push(chunk);
74
- if (chunk.includes(10)) {
75
- socket.destroy();
76
- try {
77
- const reply = JSON.parse(Buffer.concat(chunks));
78
- if (reply.ok) resolve(reply.result);
79
- else reject(/* @__PURE__ */ new Error(`${method}: ${JSON.stringify(reply.error)}`));
80
- } catch (error) {
81
- reject(error);
82
- }
83
- }
84
- });
85
- socket.on("error", reject);
86
- socket.on("close", () => reject(/* @__PURE__ */ new Error(`${method}: connection closed before reply`)));
87
- });
88
- }
89
- const launchpadSocket = path.join(os.homedir(), "Library/Application Support/vphone-launchpad/control.sock");
90
- async function guests() {
91
- if (!fs.existsSync(launchpadSocket)) return [];
92
- let stdout;
93
- try {
94
- ({stdout} = await exec("vphone-launchpad-cli", ["vm", "list"]));
95
- } catch (error) {
96
- if (error.code === "ENOENT") return [];
97
- throw error;
98
- }
99
- return JSON.parse(stdout).filter((machine) => machine.state === "running" && machine.udid).map((machine) => ({
100
- name: machine.name,
101
- udid: machine.udid,
102
- socket: machine.controlSocket,
103
- virtual: true
104
- }));
105
- }
106
- const guestUDID = /^0000FE01-/;
107
- const reachability = tr("unlock the device and connect it with a USB cable or the same network as this Mac");
108
- const deviceLine = (device) => ` ${device.name} ${device.udid}${device.offline ? ` ${tr("(offline)")}` : ""}`;
109
- async function findDevice(context, { required = true, filter }) {
110
- const given = context.options.device;
111
- const [listed, virtual] = await step(tr("looking for devices"), () => Promise.all([devicectl(["list", "devices"], { parse: true }), guests()]), { transient: true });
112
- const paired = [...listed.result.devices.filter((device) => device.hardwareProperties.platform === "iOS" && ["physical", void 0].includes(device.hardwareProperties.reality) && !guestUDID.test(device.hardwareProperties.udid)).map((device) => ({
113
- name: device.deviceProperties.name,
114
- udid: device.hardwareProperties.udid,
115
- offline: device.connectionProperties.tunnelState === "unavailable"
116
- })), ...virtual];
117
- const named = (device) => sameName(device.udid, given) || sameName(label(device.name), label(given));
118
- const devices = paired.filter((device) => !device.offline);
119
- const matches = given ? devices.filter(named) : devices;
120
- if ((given || !required) && matches.length === 1) return matches[0];
121
- if (paired.length === 0) throw new Error(tr("No iPhone or iPad is paired with this Mac; connect one with a USB cable, unlock it, and trust this Mac."));
122
- const offline = given && paired.find(named);
123
- if (matches.length === 0 && offline) throw new Error(tr("{device} is offline; {hint}.", {
124
- device: offline.name,
125
- hint: reachability
126
- }));
127
- if (devices.length === 0) throw new Error(`${tr("Every paired iPhone and iPad is offline; {hint}:", { hint: reachability })}\n${paired.map(deviceLine).join("\n")}`);
128
- const reason = !given ? tr("Choose a device with -d NAME|UDID") : matches.length === 0 ? tr("No iPhone or iPad is named {name}", { name: given }) : tr("More than one iPhone or iPad is named {name}; choose one by UDID", { name: given });
129
- const failure = /* @__PURE__ */ new Error(`${tr("{reason}; paired iPhone and iPad devices:", { reason })}\n${paired.map(deviceLine).join("\n")}`);
130
- if (matches.length === 0) throw failure;
131
- const choices = filter !== void 0 && interactive(context) ? await filter(matches) : matches;
132
- return choose(context, tr("Choose a device"), choices.map((device) => ({
133
- name: `${device.name} ${device.udid}`,
134
- short: device.name,
135
- value: device
136
- })), failure);
137
- }
138
- const apps = async (device) => device.virtual ? guestApps(device) : (await devicectl([
139
- "device",
140
- "info",
141
- "apps",
142
- "--device",
143
- device.udid
144
- ], { parse: true })).result.apps;
145
- const lockedError = /BSErrorCodeDescription = Locked|device is locked/;
146
- const installApp = async (device, app, id) => device.virtual ? guest(device, [
147
- "install",
148
- app,
149
- id
150
- ]) : devicectl([
151
- "device",
152
- "install",
153
- "app",
154
- "--device",
155
- device.udid,
156
- app
157
- ]);
158
- const uninstallApp = async (device, id) => device.virtual ? callGuest(device, "apps.uninstall", {
159
- bundle_id: id,
160
- force: true
161
- }) : devicectl([
162
- "device",
163
- "uninstall",
164
- "app",
165
- "--device",
166
- device.udid,
167
- id
168
- ]);
169
- const launchApp = async (device, id, args = []) => device.virtual ? launchOnGuest(device, id) : devicectl([
170
- "device",
171
- "process",
172
- "launch",
173
- "--terminate-existing",
174
- "--device",
175
- device.udid,
176
- id,
177
- ...args.length > 0 ? ["--", ...args] : []
178
- ]);
179
- async function terminateApp(device, id) {
180
- if (device.virtual) {
181
- await callGuest(device, "apps.terminate", { bundle_id: id });
182
- return;
183
- }
184
- const [listed, { result }] = await Promise.all([apps(device), devicectl([
185
- "device",
186
- "info",
187
- "processes",
188
- "--device",
189
- device.udid
190
- ], { parse: true })]);
191
- const { url } = listed.find((app) => app.bundleIdentifier === id);
192
- const running = result.runningProcesses.find((process) => process.executable?.startsWith(url));
193
- if (running !== void 0) await devicectl([
194
- "device",
195
- "process",
196
- "terminate",
197
- "--device",
198
- device.udid,
199
- "--pid",
200
- String(running.processIdentifier)
201
- ]);
202
- }
203
- async function guestApps(device) {
204
- const { apps: listed } = await callGuest(device, "apps.list");
205
- return listed.map((app) => ({
206
- bundleIdentifier: app.bundle_id,
207
- version: app.version,
208
- bundleVersion: app.build
209
- }));
210
- }
211
- async function launchOnGuest(device, id) {
212
- const until = Date.now() + 3e4;
213
- while (true) {
214
- try {
215
- await callGuest(device, "screen.unlock");
216
- await callGuest(device, "apps.launch", { bundle_id: id });
217
- return;
218
- } catch (error) {
219
- if (Date.now() > until) throw error;
220
- }
221
- await new Promise((resolve) => setTimeout(resolve, 1e3));
222
- }
223
- }
224
- const configureGuest = (device, id, name) => guest(device, [
225
- "configure",
226
- id,
227
- name
228
- ]);
229
- async function coreDevice(context, options = {}) {
230
- const device = await findDevice(context, options);
231
- if (device.virtual) await step(tr("pairing with {device}", { device: device.name }), () => guest(device, ["pair"]), { transient: true });
232
- return device;
233
- }
234
- async function guestContainer(device, id) {
235
- const { data_path: root } = await callGuest(device, "apps.data_dir", { bundle_id: id });
236
- return root;
237
- }
238
- const containerOptions = (id) => [
239
- "--domain-type",
240
- "appDataContainer",
241
- "--domain-identifier",
242
- id
243
- ];
244
- async function containerHasFile(device, id, file) {
245
- if (device.virtual) {
246
- const root = await guestContainer(device, id);
247
- const { entries } = await callGuest(device, "files.list", { path: path.posix.join(root, path.posix.dirname(file)) }).catch(() => ({ entries: [] }));
248
- return entries.some((it) => it.name === path.posix.basename(file));
249
- }
250
- const { result } = await devicectl([
251
- "device",
252
- "info",
253
- "files",
254
- "--device",
255
- device.udid,
256
- ...containerOptions(id)
257
- ], { parse: true });
258
- return result.files.some((it) => it.relativePath === file);
259
- }
260
- async function pullFromContainer(device, id, source, destination) {
261
- if (device.virtual) {
262
- const root = await guestContainer(device, id);
263
- const { content } = await callGuest(device, "files.read", {
264
- path: path.posix.join(root, source),
265
- binary: true
266
- });
267
- fs.writeFileSync(destination, Buffer.from(content, "base64"));
268
- return;
269
- }
270
- await devicectl([
271
- "device",
272
- "copy",
273
- "from",
274
- "--device",
275
- device.udid,
276
- "--source",
277
- source,
278
- "--destination",
279
- destination,
280
- ...containerOptions(id)
281
- ]);
282
- }
283
- const containerOwner = "501:501";
284
- async function pushToContainer(device, id, source, destination) {
285
- if (device.virtual) {
286
- const root = await guestContainer(device, id);
287
- const target = path.posix.join(root, destination);
288
- const directory = path.posix.dirname(target);
289
- await callGuest(device, "files.mkdir", { path: directory });
290
- await callGuest(device, "files.chown", {
291
- path: directory,
292
- owner: containerOwner
293
- });
294
- await callGuest(device, "files.write", {
295
- path: target,
296
- content: fs.readFileSync(source).toString("base64"),
297
- encoding: "base64"
298
- });
299
- await callGuest(device, "files.chown", {
300
- path: target,
301
- owner: containerOwner
302
- });
303
- return;
304
- }
305
- await devicectl([
306
- "device",
307
- "copy",
308
- "to",
309
- "--device",
310
- device.udid,
311
- "--source",
312
- source,
313
- "--destination",
314
- destination,
315
- ...containerOptions(id)
316
- ]);
317
- }
318
- const provisioningProfiles = async (udid) => (await devicectl([
319
- "device",
320
- "profile",
321
- "list",
322
- "--type",
323
- "provisioning",
324
- "--device",
325
- udid
326
- ], { parse: true })).result.provisioningProfiles;
327
- export { apps, configureGuest, containerHasFile, coreDevice, devicectl, installApp, launchApp, lockedError, provisioningProfiles, pullFromContainer, pushToContainer, serverHint, serverPath, terminateApp, uninstallApp };
328
-
329
- //# sourceMappingURL=coredevice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coredevice.js","names":[],"sources":["../src/coredevice.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport net from \"node:net\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { label, sameName } from \"./connection\";\nimport { tr } from \"./i18n\";\nimport { choose, interactive, step } from \"./output\";\n\nconst exec = promisify(execFile);\n\nconst xcodeMissing = tr(\n \"Xcode is missing; install it from the App Store, open it once, and select it with xcode-select\",\n);\n\nexport async function devicectl(args, { parse = false } = {}) {\n const output = parse\n ? path.join(os.tmpdir(), `devicectl-${randomUUID()}.json`)\n : undefined;\n try {\n await exec(\n \"xcrun\",\n [\"devicectl\", ...args, ...(parse ? [\"--json-output\", output] : [])],\n { maxBuffer: Infinity },\n );\n } catch (error) {\n if (error.code === \"ENOENT\") {\n throw new Error(xcodeMissing);\n }\n if (typeof error.code !== \"number\") {\n throw error;\n }\n const text = `${error.stdout}${error.stderr}`;\n if (/^(xcrun|xcode-select): /m.test(text)) {\n throw new Error(`${xcodeMissing} (${text.trim()})`);\n }\n if (text.includes(\"4016\")) {\n throw new Error(\n tr(\n \"CoreDevice can't reach the device while its loopback VPN is on; turn off Swipt's VPN on the device, then run this again.\",\n ),\n );\n }\n throw new Error(text.trim() || `devicectl exited with ${error.code}`);\n }\n if (!parse) {\n return undefined;\n }\n const parsed = JSON.parse(fs.readFileSync(output, \"utf8\"));\n fs.rmSync(output);\n return parsed;\n}\n\nexport const serverHint = tr(\n 'swipt-server is missing; install it with \"npm install -g @swipt/cli --include=optional\"',\n);\n\nexport function serverPath() {\n const built = path.resolve(import.meta.dirname, \"../../build/swipt-server\");\n if (fs.existsSync(built)) {\n return built;\n }\n let packaged;\n try {\n packaged = path.join(\n path.dirname(\n createRequire(import.meta.url).resolve(\n `@swipt/server-${process.platform}-${process.arch}/package.json`,\n ),\n ),\n \"swipt-server\",\n );\n } catch (error) {\n if (error.code !== \"MODULE_NOT_FOUND\") {\n throw error;\n }\n return \"swipt-server\";\n }\n return fs.existsSync(packaged) ? packaged : \"swipt-server\";\n}\n\nasync function guest(device, args) {\n try {\n await exec(serverPath(), [\n \"guest\",\n \"-d\",\n device.udid,\n \"--socket\",\n device.socket,\n ...args,\n ]);\n } catch (error) {\n if (error.code === \"ENOENT\") {\n throw new Error(serverHint);\n }\n throw new Error(\n `${error.stderr ?? \"\"}`.replace(/^Error: /, \"\").trim() || error.message,\n );\n }\n}\n\nfunction callGuest(device, method, params = {}) {\n return new Promise<any>((resolve, reject) => {\n const socket = net.createConnection(device.socket, () =>\n socket.write(`${JSON.stringify({ t: \"rpc\", method, params })}\\n`),\n );\n const chunks = [];\n socket.on(\"data\", (chunk) => {\n chunks.push(chunk);\n if (chunk.includes(10)) {\n socket.destroy();\n try {\n const reply = JSON.parse(Buffer.concat(chunks) as unknown as string);\n if (reply.ok) {\n resolve(reply.result);\n } else {\n reject(new Error(`${method}: ${JSON.stringify(reply.error)}`));\n }\n } catch (error) {\n reject(error);\n }\n }\n });\n socket.on(\"error\", reject);\n socket.on(\"close\", () =>\n reject(new Error(`${method}: connection closed before reply`)),\n );\n });\n}\n\nconst launchpadSocket = path.join(\n os.homedir(),\n \"Library/Application Support/vphone-launchpad/control.sock\",\n);\n\nasync function guests() {\n if (!fs.existsSync(launchpadSocket)) {\n return [];\n }\n let stdout;\n try {\n ({ stdout } = await exec(\"vphone-launchpad-cli\", [\"vm\", \"list\"]));\n } catch (error) {\n if (error.code === \"ENOENT\") {\n return [];\n }\n throw error;\n }\n return JSON.parse(stdout)\n .filter((machine) => machine.state === \"running\" && machine.udid)\n .map((machine) => ({\n name: machine.name,\n udid: machine.udid,\n socket: machine.controlSocket,\n virtual: true,\n }));\n}\n\n// vphone guests are built with chip ID 0xFE01, which their UDID starts with\n// (vphone-cli 8c3630c7, Research/Guest/xcode_install_signature_gate.md).\nconst guestUDID = /^0000FE01-/;\n\nconst reachability = tr(\n \"unlock the device and connect it with a USB cable or the same network as this Mac\",\n);\n\nconst deviceLine = (device) =>\n ` ${device.name} ${device.udid}${device.offline ? ` ${tr(\"(offline)\")}` : \"\"}`;\n\ninterface DeviceQuery {\n required?: boolean;\n filter?: (devices: any[]) => Promise<any[]> | any[];\n}\n\nasync function findDevice(context, { required = true, filter }: DeviceQuery) {\n const given = context.options.device;\n const [listed, virtual] = await step(\n tr(\"looking for devices\"),\n () =>\n Promise.all([devicectl([\"list\", \"devices\"], { parse: true }), guests()]),\n { transient: true },\n );\n const paired = [\n ...listed.result.devices\n .filter(\n (device) =>\n device.hardwareProperties.platform === \"iOS\" &&\n [\"physical\", undefined].includes(device.hardwareProperties.reality) &&\n !guestUDID.test(device.hardwareProperties.udid),\n )\n .map((device) => ({\n name: device.deviceProperties.name,\n udid: device.hardwareProperties.udid,\n offline: device.connectionProperties.tunnelState === \"unavailable\",\n })),\n ...virtual,\n ];\n const named = (device) =>\n sameName(device.udid, given) || sameName(label(device.name), label(given));\n const devices = paired.filter((device) => !device.offline);\n const matches = given ? devices.filter(named) : devices;\n if ((given || !required) && matches.length === 1) {\n return matches[0];\n }\n if (paired.length === 0) {\n throw new Error(\n tr(\n \"No iPhone or iPad is paired with this Mac; connect one with a USB cable, unlock it, and trust this Mac.\",\n ),\n );\n }\n const offline = given && paired.find(named);\n if (matches.length === 0 && offline) {\n throw new Error(\n tr(\"{device} is offline; {hint}.\", {\n device: offline.name,\n hint: reachability,\n }),\n );\n }\n if (devices.length === 0) {\n throw new Error(\n `${tr(\"Every paired iPhone and iPad is offline; {hint}:\", { hint: reachability })}\\n${paired.map(deviceLine).join(\"\\n\")}`,\n );\n }\n const reason = !given\n ? tr(\"Choose a device with -d NAME|UDID\")\n : matches.length === 0\n ? tr(\"No iPhone or iPad is named {name}\", { name: given })\n : tr(\"More than one iPhone or iPad is named {name}; choose one by UDID\", {\n name: given,\n });\n const failure = new Error(\n `${tr(\"{reason}; paired iPhone and iPad devices:\", { reason })}\\n${paired.map(deviceLine).join(\"\\n\")}`,\n );\n if (matches.length === 0) {\n throw failure;\n }\n const choices =\n filter !== undefined && interactive(context)\n ? await filter(matches)\n : matches;\n return choose(\n context,\n tr(\"Choose a device\"),\n choices.map((device) => ({\n name: `${device.name} ${device.udid}`,\n short: device.name,\n value: device,\n })),\n failure,\n );\n}\n\nexport const apps = async (device) =>\n device.virtual\n ? guestApps(device)\n : (\n await devicectl([\"device\", \"info\", \"apps\", \"--device\", device.udid], {\n parse: true,\n })\n ).result.apps;\n\nexport const lockedError = /BSErrorCodeDescription = Locked|device is locked/;\n\nexport const installApp = async (device, app, id) =>\n device.virtual\n ? guest(device, [\"install\", app, id])\n : devicectl([\"device\", \"install\", \"app\", \"--device\", device.udid, app]);\n\nexport const uninstallApp = async (device, id) =>\n device.virtual\n ? callGuest(device, \"apps.uninstall\", { bundle_id: id, force: true })\n : devicectl([\"device\", \"uninstall\", \"app\", \"--device\", device.udid, id]);\n\nexport const launchApp = async (device, id, args = []) =>\n device.virtual\n ? launchOnGuest(device, id)\n : devicectl([\n \"device\",\n \"process\",\n \"launch\",\n \"--terminate-existing\",\n \"--device\",\n device.udid,\n id,\n ...(args.length > 0 ? [\"--\", ...args] : []),\n ]);\n\nexport async function terminateApp(device, id) {\n if (device.virtual) {\n await callGuest(device, \"apps.terminate\", { bundle_id: id });\n return;\n }\n const [listed, { result }] = await Promise.all([\n apps(device),\n devicectl([\"device\", \"info\", \"processes\", \"--device\", device.udid], {\n parse: true,\n }),\n ]);\n const { url } = listed.find((app) => app.bundleIdentifier === id);\n const running = result.runningProcesses.find((process) =>\n process.executable?.startsWith(url),\n );\n if (running !== undefined) {\n await devicectl([\n \"device\",\n \"process\",\n \"terminate\",\n \"--device\",\n device.udid,\n \"--pid\",\n String(running.processIdentifier),\n ]);\n }\n}\n\nasync function guestApps(device) {\n const { apps: listed } = await callGuest(device, \"apps.list\");\n return listed.map((app) => ({\n bundleIdentifier: app.bundle_id,\n version: app.version,\n bundleVersion: app.build,\n }));\n}\n\nasync function launchOnGuest(device, id) {\n const until = Date.now() + 30_000;\n while (true) {\n try {\n await callGuest(device, \"screen.unlock\");\n await callGuest(device, \"apps.launch\", { bundle_id: id });\n return;\n } catch (error) {\n if (Date.now() > until) {\n throw error;\n }\n }\n await new Promise((resolve) => setTimeout(resolve, 1_000));\n }\n}\n\nexport const configureGuest = (device, id, name) =>\n guest(device, [\"configure\", id, name]);\n\nexport async function coreDevice(context, options: DeviceQuery = {}) {\n const device = await findDevice(context, options);\n if (device.virtual) {\n await step(\n tr(\"pairing with {device}\", { device: device.name }),\n () => guest(device, [\"pair\"]),\n { transient: true },\n );\n }\n return device;\n}\n\nasync function guestContainer(device, id) {\n const { data_path: root } = await callGuest(device, \"apps.data_dir\", {\n bundle_id: id,\n });\n return root;\n}\n\nconst containerOptions = (id) => [\n \"--domain-type\",\n \"appDataContainer\",\n \"--domain-identifier\",\n id,\n];\n\nexport async function containerHasFile(device, id, file) {\n if (device.virtual) {\n const root = await guestContainer(device, id);\n const directory = path.posix.join(root, path.posix.dirname(file));\n const { entries } = await callGuest(device, \"files.list\", {\n path: directory,\n }).catch(() => ({ entries: [] }));\n return entries.some((it) => it.name === path.posix.basename(file));\n }\n const { result } = await devicectl(\n [\n \"device\",\n \"info\",\n \"files\",\n \"--device\",\n device.udid,\n ...containerOptions(id),\n ],\n { parse: true },\n );\n return result.files.some((it) => it.relativePath === file);\n}\n\nexport async function pullFromContainer(device, id, source, destination) {\n if (device.virtual) {\n const root = await guestContainer(device, id);\n const { content } = await callGuest(device, \"files.read\", {\n path: path.posix.join(root, source),\n binary: true,\n });\n fs.writeFileSync(destination, Buffer.from(content, \"base64\"));\n return;\n }\n await devicectl([\n \"device\",\n \"copy\",\n \"from\",\n \"--device\",\n device.udid,\n \"--source\",\n source,\n \"--destination\",\n destination,\n ...containerOptions(id),\n ]);\n}\n\nconst containerOwner = \"501:501\";\n\nexport async function pushToContainer(device, id, source, destination) {\n if (device.virtual) {\n const root = await guestContainer(device, id);\n const target = path.posix.join(root, destination);\n const directory = path.posix.dirname(target);\n await callGuest(device, \"files.mkdir\", { path: directory });\n await callGuest(device, \"files.chown\", {\n path: directory,\n owner: containerOwner,\n });\n await callGuest(device, \"files.write\", {\n path: target,\n content: fs.readFileSync(source).toString(\"base64\"),\n encoding: \"base64\",\n });\n await callGuest(device, \"files.chown\", {\n path: target,\n owner: containerOwner,\n });\n return;\n }\n await devicectl([\n \"device\",\n \"copy\",\n \"to\",\n \"--device\",\n device.udid,\n \"--source\",\n source,\n \"--destination\",\n destination,\n ...containerOptions(id),\n ]);\n}\n\nexport const provisioningProfiles = async (udid) =>\n (\n await devicectl(\n [\"device\", \"profile\", \"list\", \"--type\", \"provisioning\", \"--device\", udid],\n { parse: true },\n )\n ).result.provisioningProfiles;\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,OAAO,UAAU,QAA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