@mcesystems/apple-kit 1.0.8 → 1.0.10
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/index.js +767 -1
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +800 -5
- package/dist/index.mjs.map +4 -4
- package/package.json +1 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/utils/debug.ts", "../src/logic/actions/device.ts", "../src/logic/dataParser.ts", "../src/logic/actions/activation.ts", "../src/logic/actions/pair.ts", "../src/logic/actions/install.ts", "../src/logic/actions/proxy.ts", "../src/logic/appleDeviceKit.ts"],
|
|
4
|
-
"sourcesContent": ["import createDebug from \"debug\";\n\nconst debug = createDebug(\"apple-kit\");\nconst debugTask = createDebug(\"apple-kit:task\");\nconst debugWarning = createDebug(\"apple-kit:warning\");\nconst debugError = createDebug(\"apple-kit:error\");\n\n/**\n * Log general information\n */\nexport function logInfo(message: string): void {\n\tdebug(message);\n}\n\n/**\n * Log task-specific information\n */\nexport function logTask(message: string): void {\n\tdebugTask(message);\n}\n\n/**\n * Log warning messages\n */\nexport function logWarning(message: string): void {\n\tdebugWarning(message);\n}\n\n/**\n * Log error messages\n */\nexport function logError(message: string): void {\n\tdebugError(message);\n}\n", "import { type ExecOptions, exec as execCallback } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport type { AppleToolType, DeviceListEntry } from \"@/types\";\nimport type { iOSDeviceInfo } from \"@/types\";\nimport { logTask } from \"@/utils/debug\";\nimport { parseDeviceList, parsePlistOutput } from \"../dataParser\";\n\nconst execAsync = promisify(execCallback);\n\nexport interface ExecResult {\n\tstdout: string;\n\tstderr: string;\n}\n\nexport async function getDeviceInfo(udid: string): Promise<iOSDeviceInfo> {\n\tlogTask(`Getting device info for ${udid}`);\n\n\tconst result = await runIDeviceTool(\"ideviceinfo\", [\"-u\", udid]);\n\tif (!result) {\n\t\tthrow new Error(\"Failed to get device info\");\n\t}\n\n\tconst props = parsePlistOutput(result.stdout);\n\n\treturn {\n\t\tdeviceName: props.DeviceName || \"\",\n\t\tproductType: props.ProductType || \"\",\n\t\tproductVersion: props.ProductVersion || \"\",\n\t\tbuildVersion: props.BuildVersion || \"\",\n\t\tserialNumber: props.SerialNumber || \"\",\n\t\tudid: props.UniqueDeviceID || udid,\n\t\twifiAddress: props.WiFiAddress || \"\",\n\t\tbluetoothAddress: props.BluetoothAddress || \"\",\n\t\tphoneNumber: props.PhoneNumber || \"\",\n\t\tcpuArchitecture: props.CPUArchitecture || \"\",\n\t\thardwareModel: props.HardwareModel || \"\",\n\t\tmodelNumber: props.ModelNumber || \"\",\n\t\tregionInfo: props.RegionInfo || \"\",\n\t\ttimeZone: props.TimeZone || \"\",\n\t\tuniqueChipID: props.UniqueChipID || \"\",\n\t\tisPaired: true, // If we can get info, device is paired\n\t};\n}\n\nexport async function listDevices(): Promise<DeviceListEntry[]> {\n\ttry {\n\t\tconst result = await runIDeviceTool(\"idevice_id\", [\"-l\"]);\n\t\tif (!result) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn parseDeviceList(result.stdout);\n\t} catch {\n\t\treturn [];\n\t}\n}\n\n/**\n * Execute an idevice tool command\n */\nexport async function runIDeviceTool(\n\ttoolName: AppleToolType,\n\targs: string[] = [],\n\toptions: ExecOptions = {}\n): Promise<ExecResult> {\n\tconst command = `\"${toolName}${process.platform === \"win32\" ? \".exe\" : \"\"}\" ${args.map((a) => `\"${a}\"`).join(\" \")}`;\n\treturn execIDevice(command, options);\n}\n\n/**\n * Execute a command with idevice tools in PATH\n */\nasync function execIDevice(command: string, options: ExecOptions = {}): Promise<ExecResult> {\n\tconst binPath = getIDeviceBinPath();\n\n\toptions.cwd = binPath;\n\n\tconst result = await execAsync(command, {\n\t\t...options,\n\t\tenv: process.env,\n\t\twindowsHide: true,\n\t\tencoding: \"utf8\",\n\t});\n\n\treturn {\n\t\tstdout: result.stdout.toString(),\n\t\tstderr: result.stderr.toString(),\n\t};\n}\n\n/**\n * Get the path to idevice binaries from resources\n */\nfunction getResourcesBinPath(): string {\n\tconst binPath = process.env.IDeviceBinPath;\n\tif (!binPath) {\n\t\tthrow new Error(\"IDeviceBinPath is not set\");\n\t}\n\treturn binPath;\n}\n\n/**\n * Get the path to a specific idevice tool\n */\nfunction getIDeviceToolPath(toolName: string): string | null {\n\tconst binPath = getResourcesBinPath();\n\tconst ext = process.platform === \"win32\" ? \".exe\" : \"\";\n\tconst toolPath = join(binPath, `${toolName}${ext}`);\n\n\tif (existsSync(toolPath)) {\n\t\treturn toolPath;\n\t}\n\n\treturn null;\n}\n\n/**\n * Get paths to all required idevice tools\n */\nexport function getIDeviceTools() {\n\treturn {\n\t\tidevice_id: getIDeviceToolPath(\"idevice_id\"),\n\t\tideviceinfo: getIDeviceToolPath(\"ideviceinfo\"),\n\t\tideviceinstaller: getIDeviceToolPath(\"ideviceinstaller\"),\n\t\tidevicepair: getIDeviceToolPath(\"idevicepair\"),\n\t\tidevicename: getIDeviceToolPath(\"idevicename\"),\n\t\tidevicedebug: getIDeviceToolPath(\"idevicedebug\"),\n\t\tiproxy: getIDeviceToolPath(\"iproxy\"),\n\t\tideviceactivation: getIDeviceToolPath(\"ideviceactivation\"),\n\t};\n}\n\n/**\n * Get the bin path for PATH environment variable\n */\nfunction getIDeviceBinPath(): string {\n\treturn getResourcesBinPath();\n}\n", "import type { AppInfo, DeviceListEntry } from \"../types\";\n\n/**\n * Parse plist-style output from ideviceinfo\n *\n * @param output ideviceinfo output\n * @returns Plist output\n */\nexport function parsePlistOutput(output: string): Record<string, string> {\n\tconst result: Record<string, string> = {};\n\tconst lines = output.split(\"\\n\");\n\n\tfor (const line of lines) {\n\t\tconst colonIndex = line.indexOf(\":\");\n\t\tif (colonIndex > 0) {\n\t\t\tconst key = line.substring(0, colonIndex).trim();\n\t\t\tconst value = line.substring(colonIndex + 1).trim();\n\t\t\tresult[key] = value;\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Parse idevice_id output\n *\n * @param output idevice_id output\n * @returns Device list\n */\nexport function parseDeviceList(output: string): DeviceListEntry[] {\n\tconst devices: DeviceListEntry[] = [];\n\tconst lines = output.trim().split(\"\\n\");\n\n\tfor (const line of lines) {\n\t\tconst trimmed = line.trim();\n\t\tif (trimmed) {\n\t\t\t// Format: \"UDID (connection type)\" or just \"UDID\"\n\t\t\tconst match = trimmed.match(/^([A-Fa-f0-9-]+)(?:\\s+\\((\\w+)\\))?/);\n\t\t\tif (match) {\n\t\t\t\tdevices.push({\n\t\t\t\t\tudid: match[1],\n\t\t\t\t\tconnectionType: match[2] === \"Network\" ? 2 : 1,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn devices;\n}\n\n/**\n * Parse ideviceinstaller list output\n *\n * @param output ideviceinstaller list output\n * @returns App list\n */\nexport function parseAppList(output: string): AppInfo[] {\n\tconst apps: AppInfo[] = [];\n\tconst lines = output.trim().split(\"\\n\");\n\n\tfor (const line of lines) {\n\t\t// Format: \"com.example.app, Version, \"Display Name\"\"\n\t\tconst match = line.match(/^([^,]+),\\s*([^,]+),\\s*\"?([^\"]+)\"?/);\n\t\tif (match) {\n\t\t\tapps.push({\n\t\t\t\tbundleId: match[1].trim(),\n\t\t\t\tversion: match[2].trim(),\n\t\t\t\tdisplayName: match[3].trim(),\n\t\t\t\tbundleVersion: \"\",\n\t\t\t});\n\t\t}\n\t}\n\n\treturn apps;\n}\n", "import type { ActivationState } from \"@/types\";\nimport { logTask } from \"@/utils/debug\";\nimport { runIDeviceTool } from \"./device\";\n\nexport async function getActivationState(udid: string): Promise<ActivationState> {\n\tlogTask(`Getting activation state for device ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"ideviceinfo\", [\"-u\", udid, \"-k\", \"ActivationState\"]);\n\t\tif (!result) {\n\t\t\treturn {\n\t\t\t\tisActivated: false,\n\t\t\t\tactivationState: \"Unknown\",\n\t\t\t};\n\t\t}\n\n\t\tconst { stdout } = result;\n\t\tconst state = stdout.trim();\n\n\t\treturn {\n\t\t\tisActivated: state === \"Activated\",\n\t\t\tactivationState: state,\n\t\t};\n\t} catch {\n\t\treturn {\n\t\t\tisActivated: false,\n\t\t\tactivationState: \"Unknown\",\n\t\t};\n\t}\n}\n\nexport async function activate(udid: string): Promise<boolean> {\n\tlogTask(`Activating device ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"ideviceactivation\", [\"-u\", udid, \"activate\"]);\n\t\tif (!result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tresult.stdout.toLowerCase().includes(\"success\") ||\n\t\t\tresult.stdout.toLowerCase().includes(\"activated\")\n\t\t);\n\t} catch (error) {\n\t\tconst errorMsg = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`Activation failed: ${errorMsg}`);\n\t}\n}\n\nexport interface ApplicationConfig {\n\tname: string;\n\tbundleId: string;\n\tversion: string;\n\tbuild: string;\n\ticon: string;\n\ticonData: Buffer;\n}\n", "import { logInfo, logTask } from \"@/utils/debug\";\nimport { runIDeviceTool } from \"./device\";\n\nexport async function isPaired(udid: string): Promise<boolean> {\n\tlogTask(`Checking pairing status for ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"idevicepair\", [\"-u\", udid, \"validate\"]);\n\t\tif (!result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn result.stdout.toLowerCase().includes(\"success\");\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport async function trustDevice(\n\tudid: string,\n\ttimeout = 60000,\n\tonWaitingForTrust?: () => void\n): Promise<boolean> {\n\tlogTask(`Trusting device ${udid}`);\n\n\t// Check if already paired\n\tif (await isPaired(udid)) {\n\t\tlogInfo(`Device ${udid} is already trusted`);\n\t\treturn true;\n\t}\n\n\t// Initiate pairing - this shows the trust dialog on the device\n\tlogInfo(`Initiating pairing for device ${udid}`);\n\tconst pairResult = await pair(udid);\n\n\tif (pairResult) {\n\t\tlogInfo(`Device ${udid} paired successfully`);\n\t\treturn true;\n\t}\n\n\t// Pairing initiated but user needs to accept on device\n\tlogInfo(\"Please accept the trust dialog on the device...\");\n\tonWaitingForTrust?.();\n\n\t// Wait for user to accept\n\ttry {\n\t\tawait waitForPairing(udid, timeout, 1000);\n\t\tlogInfo(`Device ${udid} is now trusted`);\n\t\treturn true;\n\t} catch {\n\t\tlogInfo(`Timeout waiting for trust acceptance on device ${udid}`);\n\t\treturn false;\n\t}\n}\n\nexport async function waitForPairing(\n\tudid: string,\n\ttimeout = 120000,\n\tpollInterval = 1000\n): Promise<boolean> {\n\tlogTask(`Waiting for pairing on device ${udid}`);\n\n\tconst startTime = Date.now();\n\n\twhile (Date.now() - startTime < timeout) {\n\t\tif (await isPaired(udid)) {\n\t\t\tlogInfo(`Device ${udid} is now paired`);\n\t\t\treturn true;\n\t\t}\n\n\t\tawait new Promise((resolve) => setTimeout(resolve, pollInterval));\n\t}\n\n\tthrow new Error(`Timeout waiting for device pairing after ${timeout}ms`);\n}\n\nexport async function pair(udid: string): Promise<boolean> {\n\tlogTask(`Initiating pairing for device ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"idevicepair\", [\"-u\", udid, \"pair\"]);\n\t\tif (!result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn result.stdout.toLowerCase().includes(\"success\");\n\t} catch (error) {\n\t\tconst errorMsg = error instanceof Error ? error.message : String(error);\n\t\tif (errorMsg.includes(\"Please accept the trust dialog\")) {\n\t\t\t// Pairing dialog shown on device\n\t\t\treturn false;\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nexport async function unpair(udid: string): Promise<boolean> {\n\tlogTask(`Un-pairing device ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"idevicepair\", [\"-u\", udid, \"unpair\"]);\n\t\tif (!result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn result.stdout.toLowerCase().includes(\"success\");\n\t} catch {\n\t\treturn false;\n\t}\n}\n", "import type { AppInfo } from \"@/types\";\nimport { logInfo, logTask } from \"@/utils/debug\";\nimport { parseAppList } from \"../dataParser\";\nimport { runIDeviceTool } from \"./device\";\nimport { isPaired, waitForPairing } from \"./pair\";\n\nexport async function installApp(ipaPath: string, udid: string): Promise<void> {\n\tlogTask(`Installing app ${ipaPath} on device ${udid}`);\n\n\tif (!(await isPaired(udid))) {\n\t\tawait waitForPairing(udid, 10000);\n\t}\n\n\tawait runIDeviceTool(\"ideviceinstaller\", [\"-u\", udid, \"-i\", ipaPath]);\n}\n\nexport async function uninstallApp(bundleId: string, udid: string): Promise<void> {\n\tlogTask(`Uninstalling app ${bundleId} from device ${udid}`);\n\n\tif (!(await isPaired(udid))) {\n\t\tawait waitForPairing(udid, 10000);\n\t}\n\n\tawait runIDeviceTool(\"ideviceinstaller\", [\"-u\", udid, \"-U\", bundleId]);\n}\n\nexport async function listApps(udid: string): Promise<AppInfo[]> {\n\tlogTask(`Listing apps on device ${udid}`);\n\n\tif (!(await isPaired(udid))) {\n\t\tawait waitForPairing(udid, 10000);\n\t}\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"ideviceinstaller\", [\"-u\", udid, \"-l\"]);\n\t\tif (!result) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst { stdout } = result;\n\t\treturn parseAppList(stdout);\n\t} catch {\n\t\treturn [];\n\t}\n}\n\nexport async function isAppInstalled(bundleId: string, udid: string): Promise<boolean> {\n\tlogTask(`Checking if app ${bundleId} is installed on device ${udid}`);\n\n\tconst apps = await listApps(udid);\n\treturn apps.some((app) => app.bundleId === bundleId);\n}\n\nexport async function wakeDevice(udid: string): Promise<void> {\n\ttry {\n\t\tlogInfo(\"Attempting to wake device screen...\");\n\n\t\t// Try multiple methods to wake the device\n\t\t// Method 1: Query device info (wakes some devices)\n\t\tawait runIDeviceTool(\"ideviceinfo\", [\"-u\", udid, \"-k\", \"DeviceName\"]);\n\n\t\t// Method 2: Try to get activation state (another wake trigger)\n\t\ttry {\n\t\t\tawait runIDeviceTool(\"ideviceinfo\", [\"-u\", udid, \"-k\", \"ActivationState\"]);\n\t\t} catch {\n\t\t\t// Ignore\n\t\t}\n\n\t\t// Method 3: Try to validate pairing (another interaction that might wake)\n\t\ttry {\n\t\t\tawait runIDeviceTool(\"idevicepair\", [\"-u\", udid, \"validate\"]);\n\t\t} catch {\n\t\t\t// Ignore\n\t\t}\n\n\t\t// Longer delay to let screen wake and stabilize\n\t\tawait new Promise((resolve) => setTimeout(resolve, 1000));\n\n\t\tlogInfo(\"Device wake attempt completed\");\n\t} catch (error) {\n\t\t// Log but don't fail - waking is best effort\n\t\tlogInfo(\n\t\t\t`Device wake attempt failed (non-critical): ${error instanceof Error ? error.message : String(error)}`\n\t\t);\n\t}\n}\n\nexport async function launchApp(bundleId: string, args: string[], udid: string): Promise<void> {\n\tlogTask(`Launching app ${bundleId} on device ${udid}`);\n\n\tif (!(await isPaired(udid))) {\n\t\tawait waitForPairing(udid, 10000);\n\t}\n\n\t// Wake device screen first to ensure app appears\n\tawait wakeDevice(udid);\n\n\t// Try idevicedebug first (works for iOS 16 and earlier)\n\ttry {\n\t\tlogInfo(`Attempting to launch ${bundleId} using idevicedebug...`);\n\t\tconst result = await runIDeviceTool(\"idevicedebug\", [\"-u\", udid, \"run\", bundleId, ...args]);\n\t\tconst output = (result?.stdout ?? \"\") + (result?.stderr ?? \"\");\n\n\t\t// Log output for debugging\n\t\tif (output.trim()) {\n\t\t\tlogInfo(`idevicedebug output: ${output.substring(0, 200)}`);\n\t\t}\n\n\t\t// Check if it failed due to missing debugserver\n\t\tif (\n\t\t\toutput.toLowerCase().includes(\"could not start\") &&\n\t\t\toutput.toLowerCase().includes(\"debugserver\")\n\t\t) {\n\t\t\tlogInfo(\"idevicedebug requires debugserver, falling back to pymobiledevice3...\");\n\t\t\tthrow new Error(\"debugserver_not_available\");\n\t\t}\n\n\t\t// Success - app should be launched\n\t\tlogInfo(`App ${bundleId} launched successfully using idevicedebug`);\n\n\t\t// Additional delay to ensure app appears\n\t\tawait new Promise((resolve) => setTimeout(resolve, 1000));\n\t\treturn;\n\t} catch (error) {\n\t\tconst errorMsg = error instanceof Error ? error.message : String(error);\n\n\t\t// If debugserver is not available, try pymobiledevice3 (iOS 17+)\n\t\tif (\n\t\t\terrorMsg.includes(\"debugserver_not_available\") ||\n\t\t\terrorMsg.toLowerCase().includes(\"could not start\") ||\n\t\t\terrorMsg.toLowerCase().includes(\"debugserver\")\n\t\t) {\n\t\t\tlogInfo(\"idevicedebug failed, trying pymobiledevice3 for iOS 17+...\");\n\t\t\tawait launchAppWithPymobiledevice3(bundleId, args, udid);\n\t\t\treturn;\n\t\t}\n\n\t\t// Re-throw other errors\n\t\tthrow error;\n\t}\n}\n\nexport async function launchAppWithPymobiledevice3(\n\tbundleId: string,\n\targs: string[],\n\tudid: string\n): Promise<void> {\n\tlogTask(`Launching app ${bundleId} using pymobiledevice3`);\n\n\tconst { exec } = await import(\"node:child_process\");\n\tconst { promisify } = await import(\"node:util\");\n\tconst execAsync = promisify(exec);\n\n\ttry {\n\t\t// Build command: python -m pymobiledevice3 developer dvt launch --udid <UDID> --tunnel \"\" --kill-existing <bundle-id> [args...]\n\t\t// Use --tunnel \"\" to auto-detect/create tunnel for iOS 17+\n\t\t// Use --kill-existing to ensure app comes to foreground\n\t\t// Use python -m to avoid PATH issues\n\t\t// Try without tunnel first (works for some iOS versions)\n\t\t// If that fails, we'll try with tunnel\n\t\tlet cmdArgs = [\n\t\t\t\"-m\",\n\t\t\t\"pymobiledevice3\",\n\t\t\t\"developer\",\n\t\t\t\"dvt\",\n\t\t\t\"launch\",\n\t\t\t\"--udid\",\n\t\t\tudid,\n\t\t\t\"--kill-existing\", // Kill existing instance to bring app to foreground\n\t\t\tbundleId,\n\t\t\t...args,\n\t\t];\n\n\t\tlet command = `python ${cmdArgs.map((a) => `\"${a}\"`).join(\" \")}`;\n\n\t\tlogInfo(`Executing: ${command}`);\n\n\t\tconst result = await execAsync(command, {\n\t\t\twindowsHide: true,\n\t\t\tencoding: \"utf8\",\n\t\t\ttimeout: 30000, // 30 second timeout\n\t\t});\n\n\t\tconst output = result.stdout.toString() + result.stderr.toString();\n\n\t\t// Log output for debugging\n\t\tif (output.trim()) {\n\t\t\tlogInfo(`pymobiledevice3 output: ${output.substring(0, 200)}`);\n\t\t}\n\n\t\t// Check for common errors\n\t\tif (\n\t\t\toutput.toLowerCase().includes(\"developer mode\") &&\n\t\t\toutput.toLowerCase().includes(\"not enabled\")\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Developer Mode is not enabled on the device.\\n\" +\n\t\t\t\t\t\"Please enable it: Settings \u2192 Privacy & Security \u2192 Developer Mode \u2192 Enable\"\n\t\t\t);\n\t\t}\n\n\t\t// If tunnel error, try again with tunnel option\n\t\tif (\n\t\t\toutput.toLowerCase().includes(\"tunneld\") &&\n\t\t\t(output.toLowerCase().includes(\"unable to connect\") ||\n\t\t\t\toutput.toLowerCase().includes(\"invalidserviceerror\"))\n\t\t) {\n\t\t\tlogInfo(\"Tunnel required, retrying with tunnel option...\");\n\n\t\t\t// Retry with tunnel\n\t\t\tcmdArgs = [\n\t\t\t\t\"-m\",\n\t\t\t\t\"pymobiledevice3\",\n\t\t\t\t\"developer\",\n\t\t\t\t\"dvt\",\n\t\t\t\t\"launch\",\n\t\t\t\t\"--udid\",\n\t\t\t\tudid,\n\t\t\t\t\"--tunnel\",\n\t\t\t\tudid, // Use UDID for tunnel\n\t\t\t\t\"--kill-existing\",\n\t\t\t\tbundleId,\n\t\t\t\t...args,\n\t\t\t];\n\n\t\t\tcommand = `python ${cmdArgs.map((a) => `\"${a}\"`).join(\" \")}`;\n\t\t\tlogInfo(`Retrying with tunnel: ${command}`);\n\n\t\t\ttry {\n\t\t\t\tconst retryResult = await execAsync(command, {\n\t\t\t\t\twindowsHide: true,\n\t\t\t\t\tencoding: \"utf8\",\n\t\t\t\t\ttimeout: 30000,\n\t\t\t\t});\n\n\t\t\t\tconst retryOutput = retryResult.stdout.toString() + retryResult.stderr.toString();\n\t\t\t\tif (retryOutput.trim()) {\n\t\t\t\t\tlogInfo(`pymobiledevice3 retry output: ${retryOutput.substring(0, 200)}`);\n\t\t\t\t}\n\n\t\t\t\t// Check if still failing\n\t\t\t\tif (\n\t\t\t\t\tretryOutput.toLowerCase().includes(\"tunneld\") &&\n\t\t\t\t\tretryOutput.toLowerCase().includes(\"unable to connect\")\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\"Tunnel connection failed. For iOS 17+, you may need to start tunneld:\\n\" +\n\t\t\t\t\t\t\t\" python -m pymobiledevice3 remote tunneld\\n\" +\n\t\t\t\t\t\t\t\"Or ensure Developer Mode is enabled and device is unlocked.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Success on retry\n\t\t\t\tlogInfo(`App ${bundleId} launched successfully using pymobiledevice3 with tunnel`);\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 500));\n\t\t\t\treturn;\n\t\t\t} catch {\n\t\t\t\t// If retry also fails, throw the original tunnel error\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Tunnel connection failed. For iOS 17+, you may need to start tunneld:\\n\" +\n\t\t\t\t\t\t\" python -m pymobiledevice3 remote tunneld\\n\" +\n\t\t\t\t\t\t\"Or ensure Developer Mode is enabled and device is unlocked.\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\toutput.toLowerCase().includes(\"not found\") ||\n\t\t\toutput.toLowerCase().includes(\"command not found\") ||\n\t\t\toutput.toLowerCase().includes(\"cannot find\")\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"pymobiledevice3 is not installed.\\n\" +\n\t\t\t\t\t\"Install it with: python -m pip install --user pymobiledevice3\"\n\t\t\t);\n\t\t}\n\n\t\t// Check if there are any errors in output\n\t\tif (output.toLowerCase().includes(\"error\") && !output.toLowerCase().includes(\"warning\")) {\n\t\t\t// Some errors might be non-fatal, but log them\n\t\t\tlogInfo(`Warning: pymobiledevice3 reported errors: ${output.substring(0, 300)}`);\n\t\t}\n\n\t\tlogInfo(`App ${bundleId} launched successfully using pymobiledevice3`);\n\n\t\t// Longer delay to ensure app appears on screen and device wakes\n\t\tawait new Promise((resolve) => setTimeout(resolve, 1000));\n\t} catch (error) {\n\t\tconst errorMsg = error instanceof Error ? error.message : String(error);\n\n\t\t// Check if it's a command not found error\n\t\tif (\n\t\t\terrorMsg.includes(\"not found\") ||\n\t\t\terrorMsg.includes(\"command not found\") ||\n\t\t\terrorMsg.includes(\"cannot find\") ||\n\t\t\terrorMsg.includes(\"No module named\")\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"pymobiledevice3 is not installed or Python is not available.\\n\" +\n\t\t\t\t\t\"Install it with: python -m pip install --user pymobiledevice3\\n\" +\n\t\t\t\t\t\"For iOS 17+, Developer Mode must also be enabled on the device.\"\n\t\t\t);\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n", "import type { PortForwardResult } from \"@/types\";\nimport { logTask } from \"@/utils/debug\";\nimport { runIDeviceTool } from \"./device\";\n\nasync function startPortForward(\n\tlocalPort: number,\n\tdevicePort: number,\n\tudid: string\n): Promise<PortForwardResult> {\n\tlogTask(`Starting port forward ${localPort} -> ${devicePort} for device ${udid}`);\n\n\tconst result = await runIDeviceTool(\"iproxy\", [\n\t\tlocalPort.toString(),\n\t\tdevicePort.toString(),\n\t\t\"-u\",\n\t\tudid,\n\t]);\n\n\treturn {\n\t\tlocalPort,\n\t\tdevicePort,\n\t\t...result,\n\t};\n}\n\nexport async function startPortForwardAsync(\n\tlocalPort: number,\n\tdevicePort: number,\n\tudid: string,\n\t_timeout = 5000\n): Promise<PortForwardResult> {\n\tconst result = await startPortForward(localPort, devicePort, udid);\n\n\t// Give iproxy a moment to start\n\tawait new Promise((resolve) => setTimeout(resolve, 500));\n\n\t// Check if process is still running\n\tif (result.stdout.includes(\"error\") || result.stderr.includes(\"error\")) {\n\t\tthrow new Error(\"Port forwarding failed to start\");\n\t}\n\n\treturn result;\n}\n\nexport async function closePortForward(udid: string): Promise<void> {\n\tlogTask(`Closing port forward for device ${udid}`);\n\tawait runIDeviceTool(\"iproxy\", [\"-u\", udid, \"-c\"]);\n}\n", "import type { ActivationState, AppInfo, PortForwardResult, iOSDeviceInfo } from \"../types\";\nimport { logInfo } from \"../utils/debug\";\nimport { activate, getActivationState } from \"./actions/activation\";\nimport { getDeviceInfo } from \"./actions/device\";\nimport { installApp, isAppInstalled, launchApp, listApps, uninstallApp } from \"./actions/install\";\nimport { isPaired, pair, trustDevice, unpair, waitForPairing } from \"./actions/pair\";\nimport { closePortForward, startPortForwardAsync } from \"./actions/proxy\";\n\n/**\n * AppleDeviceKit - iOS device operations wrapper\n *\n * Uses idevice command-line tools for iOS device operations.\n * Each instance is associated with a specific device by UDID.\n */\nexport class AppleDeviceKit {\n\tprivate deviceId: string;\n\n\tconstructor(\n\t\tudid: string,\n\t\tprivate readonly port: number\n\t) {\n\t\tthis.deviceId = udid;\n\t\tlogInfo(`AppleDeviceKit initialized for device: ${this.deviceId}`);\n\t}\n\n\t/**\n\t * Get detailed device information\n\t */\n\tpublic async getDeviceInfo(): Promise<iOSDeviceInfo> {\n\t\treturn getDeviceInfo(this.deviceId);\n\t}\n\n\t/**\n\t * Check if device is paired/trusted with this computer\n\t */\n\tpublic async isPaired(): Promise<boolean> {\n\t\treturn isPaired(this.deviceId);\n\t}\n\n\t/**\n\t * Wait for device to be paired\n\t * Polls the pairing status until successful or timeout\n\t *\n\t * @param timeout Timeout in milliseconds (default: 120000)\n\t * @param pollInterval Poll interval in milliseconds (default: 1000)\n\t */\n\tpublic async waitForPairing(timeout = 120000, pollInterval = 1000): Promise<boolean> {\n\t\treturn waitForPairing(this.deviceId, timeout, pollInterval);\n\t}\n\n\t/**\n\t * Attempt to pair/trust the device\n\t * User must accept the trust dialog on the device\n\t */\n\tpublic async pair(): Promise<boolean> {\n\t\treturn pair(this.deviceId);\n\t}\n\n\t/**\n\t * Trust/pair the device - initiates pairing and waits for user to accept\n\t *\n\t * This is the recommended method for establishing trust with a device.\n\t * It will:\n\t * 1. Check if already paired\n\t * 2. If not, initiate pairing (shows \"Trust This Computer?\" on device)\n\t * 3. Wait for user to accept the trust dialog\n\t *\n\t * @param timeout Timeout in milliseconds to wait for user acceptance (default: 60000)\n\t * @param onWaitingForTrust Callback when waiting for user to accept trust dialog\n\t * @returns true if device is now trusted\n\t */\n\tpublic async trustDevice(timeout = 60000, onWaitingForTrust?: () => void): Promise<boolean> {\n\t\treturn trustDevice(this.deviceId, timeout, onWaitingForTrust);\n\t}\n\n\t/**\n\t * Unpair/untrust the device\n\t */\n\tpublic async unpair(): Promise<boolean> {\n\t\treturn unpair(this.deviceId);\n\t}\n\n\t/**\n\t * Install an IPA file on the device (install agent)\n\t *\n\t * @param ipaPath Path to the IPA file\n\t */\n\tpublic async installApp(ipaPath: string): Promise<void> {\n\t\tinstallApp(ipaPath, this.deviceId);\n\t}\n\n\t/**\n\t * Uninstall an app by bundle ID (uninstall agent)\n\t *\n\t * @param bundleId Application bundle identifier\n\t */\n\tpublic async uninstallApp(bundleId: string): Promise<void> {\n\t\tuninstallApp(bundleId, this.deviceId);\n\t}\n\n\t/**\n\t * Check if an app is installed on the device\n\t *\n\t * @param bundleId Application bundle identifier\n\t */\n\tpublic async isAppInstalled(bundleId: string): Promise<boolean> {\n\t\treturn isAppInstalled(bundleId, this.deviceId);\n\t}\n\n\t/**\n\t * List all installed user applications\n\t */\n\tpublic async listApps(): Promise<AppInfo[]> {\n\t\treturn listApps(this.deviceId);\n\t}\n\n\t/**\n\t * Launch an application on the device\n\t *\n\t * @param bundleId Application bundle identifier\n\t * @param args Application arguments\n\t */\n\tpublic async launchApp(bundleId: string, args: string[] = []): Promise<void> {\n\t\treturn launchApp(bundleId, args, this.deviceId);\n\t}\n\n\t/**\n\t * Start port forwarding and wait for it to be ready.\n\t * we need port forwarding to be able to connect to the device from the computer\n\t * and communicate with it using the local port.\n\t *\n\t * @param localPort Local port to listen on\n\t * @param devicePort Device port to forward to\n\t * @param _timeout Timeout in milliseconds (reserved for future use)\n\t */\n\tpublic async startPortForwardAsync(\n\t\tlocalPort: number,\n\t\tdevicePort: number,\n\t\t_timeout = 5000\n\t): Promise<PortForwardResult> {\n\t\treturn startPortForwardAsync(localPort, devicePort, this.deviceId);\n\t}\n\n\t/**\n\t * Get the activation state of the device\n\t */\n\tpublic async getActivationState(): Promise<ActivationState> {\n\t\treturn getActivationState(this.deviceId);\n\t}\n\n\t/**\n\t * Activate the device (register in apple servers), an activated device belongs to someone (a user/company).\n\t * A device that is on hello screen cannot pass the wifi step unless it is activated.\n\t * the activate save us the need of the device to be connected to the internet to do the activation\n\t * and register in apple servers.\n\t *\n\t * Note: This requires a valid activation record or Apple server access\n\t *\n\t * precondition: the device must be paired and trusted\n\t */\n\tpublic async activate(): Promise<boolean> {\n\t\treturn activate(this.deviceId);\n\t}\n\n\t/**\n\t * Get the device UDID\n\t */\n\tpublic getDeviceId(): string {\n\t\treturn this.deviceId;\n\t}\n\n\t/**\n\t * Get the logical port number\n\t */\n\tpublic getPort(): number {\n\t\treturn this.port;\n\t}\n\n\tpublic async closePortForward(): Promise<void> {\n\t\treturn closePortForward(this.deviceId);\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,OAAO,iBAAiB;AAExB,IAAM,QAAQ,YAAY,WAAW;AACrC,IAAM,YAAY,YAAY,gBAAgB;AAC9C,IAAM,eAAe,YAAY,mBAAmB;AACpD,IAAM,aAAa,YAAY,iBAAiB;AAKzC,SAAS,QAAQ,SAAuB;AAC9C,QAAM,OAAO;AACd;AAKO,SAAS,QAAQ,SAAuB;AAC9C,YAAU,OAAO;AAClB;;;ACnBA,SAA2B,QAAQ,oBAAoB;AACvD,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,iBAAiB;;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AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAa,UAAU,UAAkB,OAAiB,CAAC,GAAkB;AAC5E,WAAO,UAAU,UAAU,MAAM,KAAK,QAAQ;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAa,sBACZ,WACA,YACA,WAAW,KACkB;AAC7B,WAAO,sBAAsB,WAAW,YAAY,KAAK,QAAQ;AAAA,EAClE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAa,qBAA+C;AAC3D,WAAO,mBAAmB,KAAK,QAAQ;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,WAA6B;AACzC,WAAO,SAAS,KAAK,QAAQ;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA,EAKO,cAAsB;AAC5B,WAAO,KAAK;AAAA,EACb;AAAA;AAAA;AAAA;AAAA,EAKO,UAAkB;AACxB,WAAO,KAAK;AAAA,EACb;AAAA,EAEA,MAAa,mBAAkC;AAC9C,WAAO,iBAAiB,KAAK,QAAQ;AAAA,EACtC;AACD;",
|
|
6
|
-
"names": ["promisify", "execAsync"]
|
|
3
|
+
"sources": ["../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js", "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js", "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js", "../../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js", "../../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js", "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js", "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js", "../src/utils/debug.ts", "../src/logic/actions/device.ts", "../src/logic/dataParser.ts", "../src/logic/actions/activation.ts", "../src/logic/actions/pair.ts", "../src/logic/actions/install.ts", "../src/logic/actions/proxy.ts", "../src/logic/appleDeviceKit.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n", "'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "import createDebug from \"debug\";\n\nconst debug = createDebug(\"apple-kit\");\nconst debugTask = createDebug(\"apple-kit:task\");\nconst debugWarning = createDebug(\"apple-kit:warning\");\nconst debugError = createDebug(\"apple-kit:error\");\n\n/**\n * Log general information\n */\nexport function logInfo(message: string): void {\n\tdebug(message);\n}\n\n/**\n * Log task-specific information\n */\nexport function logTask(message: string): void {\n\tdebugTask(message);\n}\n\n/**\n * Log warning messages\n */\nexport function logWarning(message: string): void {\n\tdebugWarning(message);\n}\n\n/**\n * Log error messages\n */\nexport function logError(message: string): void {\n\tdebugError(message);\n}\n", "import { type ExecOptions, exec as execCallback } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport type { AppleToolType, DeviceListEntry } from \"@/types\";\nimport type { iOSDeviceInfo } from \"@/types\";\nimport { logTask } from \"@/utils/debug\";\nimport { parseDeviceList, parsePlistOutput } from \"../dataParser\";\n\nconst execAsync = promisify(execCallback);\n\nexport interface ExecResult {\n\tstdout: string;\n\tstderr: string;\n}\n\nexport async function getDeviceInfo(udid: string): Promise<iOSDeviceInfo> {\n\tlogTask(`Getting device info for ${udid}`);\n\n\tconst result = await runIDeviceTool(\"ideviceinfo\", [\"-u\", udid]);\n\tif (!result) {\n\t\tthrow new Error(\"Failed to get device info\");\n\t}\n\n\tconst props = parsePlistOutput(result.stdout);\n\n\treturn {\n\t\tdeviceName: props.DeviceName || \"\",\n\t\tproductType: props.ProductType || \"\",\n\t\tproductVersion: props.ProductVersion || \"\",\n\t\tbuildVersion: props.BuildVersion || \"\",\n\t\tserialNumber: props.SerialNumber || \"\",\n\t\tudid: props.UniqueDeviceID || udid,\n\t\twifiAddress: props.WiFiAddress || \"\",\n\t\tbluetoothAddress: props.BluetoothAddress || \"\",\n\t\tphoneNumber: props.PhoneNumber || \"\",\n\t\tcpuArchitecture: props.CPUArchitecture || \"\",\n\t\thardwareModel: props.HardwareModel || \"\",\n\t\tmodelNumber: props.ModelNumber || \"\",\n\t\tregionInfo: props.RegionInfo || \"\",\n\t\ttimeZone: props.TimeZone || \"\",\n\t\tuniqueChipID: props.UniqueChipID || \"\",\n\t\tisPaired: true, // If we can get info, device is paired\n\t};\n}\n\nexport async function listDevices(): Promise<DeviceListEntry[]> {\n\ttry {\n\t\tconst result = await runIDeviceTool(\"idevice_id\", [\"-l\"]);\n\t\tif (!result) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn parseDeviceList(result.stdout);\n\t} catch {\n\t\treturn [];\n\t}\n}\n\n/**\n * Execute an idevice tool command\n */\nexport async function runIDeviceTool(\n\ttoolName: AppleToolType,\n\targs: string[] = [],\n\toptions: ExecOptions = {}\n): Promise<ExecResult> {\n\tconst command = `\"${toolName}${process.platform === \"win32\" ? \".exe\" : \"\"}\" ${args.map((a) => `\"${a}\"`).join(\" \")}`;\n\treturn execIDevice(command, options);\n}\n\n/**\n * Execute a command with idevice tools in PATH\n */\nasync function execIDevice(command: string, options: ExecOptions = {}): Promise<ExecResult> {\n\tconst binPath = getIDeviceBinPath();\n\n\toptions.cwd = binPath;\n\n\tconst result = await execAsync(command, {\n\t\t...options,\n\t\tenv: process.env,\n\t\twindowsHide: true,\n\t\tencoding: \"utf8\",\n\t});\n\n\treturn {\n\t\tstdout: result.stdout.toString(),\n\t\tstderr: result.stderr.toString(),\n\t};\n}\n\n/**\n * Get the path to idevice binaries from resources\n */\nfunction getResourcesBinPath(): string {\n\tconst binPath = process.env.IDeviceBinPath;\n\tif (!binPath) {\n\t\tthrow new Error(\"IDeviceBinPath is not set\");\n\t}\n\treturn binPath;\n}\n\n/**\n * Get the path to a specific idevice tool\n */\nfunction getIDeviceToolPath(toolName: string): string | null {\n\tconst binPath = getResourcesBinPath();\n\tconst ext = process.platform === \"win32\" ? \".exe\" : \"\";\n\tconst toolPath = join(binPath, `${toolName}${ext}`);\n\n\tif (existsSync(toolPath)) {\n\t\treturn toolPath;\n\t}\n\n\treturn null;\n}\n\n/**\n * Get paths to all required idevice tools\n */\nexport function getIDeviceTools() {\n\treturn {\n\t\tidevice_id: getIDeviceToolPath(\"idevice_id\"),\n\t\tideviceinfo: getIDeviceToolPath(\"ideviceinfo\"),\n\t\tideviceinstaller: getIDeviceToolPath(\"ideviceinstaller\"),\n\t\tidevicepair: getIDeviceToolPath(\"idevicepair\"),\n\t\tidevicename: getIDeviceToolPath(\"idevicename\"),\n\t\tidevicedebug: getIDeviceToolPath(\"idevicedebug\"),\n\t\tiproxy: getIDeviceToolPath(\"iproxy\"),\n\t\tideviceactivation: getIDeviceToolPath(\"ideviceactivation\"),\n\t};\n}\n\n/**\n * Get the bin path for PATH environment variable\n */\nfunction getIDeviceBinPath(): string {\n\treturn getResourcesBinPath();\n}\n", "import type { AppInfo, DeviceListEntry } from \"../types\";\n\n/**\n * Parse plist-style output from ideviceinfo\n *\n * @param output ideviceinfo output\n * @returns Plist output\n */\nexport function parsePlistOutput(output: string): Record<string, string> {\n\tconst result: Record<string, string> = {};\n\tconst lines = output.split(\"\\n\");\n\n\tfor (const line of lines) {\n\t\tconst colonIndex = line.indexOf(\":\");\n\t\tif (colonIndex > 0) {\n\t\t\tconst key = line.substring(0, colonIndex).trim();\n\t\t\tconst value = line.substring(colonIndex + 1).trim();\n\t\t\tresult[key] = value;\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Parse idevice_id output\n *\n * @param output idevice_id output\n * @returns Device list\n */\nexport function parseDeviceList(output: string): DeviceListEntry[] {\n\tconst devices: DeviceListEntry[] = [];\n\tconst lines = output.trim().split(\"\\n\");\n\n\tfor (const line of lines) {\n\t\tconst trimmed = line.trim();\n\t\tif (trimmed) {\n\t\t\t// Format: \"UDID (connection type)\" or just \"UDID\"\n\t\t\tconst match = trimmed.match(/^([A-Fa-f0-9-]+)(?:\\s+\\((\\w+)\\))?/);\n\t\t\tif (match) {\n\t\t\t\tdevices.push({\n\t\t\t\t\tudid: match[1],\n\t\t\t\t\tconnectionType: match[2] === \"Network\" ? 2 : 1,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn devices;\n}\n\n/**\n * Parse ideviceinstaller list output\n *\n * @param output ideviceinstaller list output\n * @returns App list\n */\nexport function parseAppList(output: string): AppInfo[] {\n\tconst apps: AppInfo[] = [];\n\tconst lines = output.trim().split(\"\\n\");\n\n\tfor (const line of lines) {\n\t\t// Format: \"com.example.app, Version, \"Display Name\"\"\n\t\tconst match = line.match(/^([^,]+),\\s*([^,]+),\\s*\"?([^\"]+)\"?/);\n\t\tif (match) {\n\t\t\tapps.push({\n\t\t\t\tbundleId: match[1].trim(),\n\t\t\t\tversion: match[2].trim(),\n\t\t\t\tdisplayName: match[3].trim(),\n\t\t\t\tbundleVersion: \"\",\n\t\t\t});\n\t\t}\n\t}\n\n\treturn apps;\n}\n", "import type { ActivationState } from \"@/types\";\nimport { logTask } from \"@/utils/debug\";\nimport { runIDeviceTool } from \"./device\";\n\nexport async function getActivationState(udid: string): Promise<ActivationState> {\n\tlogTask(`Getting activation state for device ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"ideviceinfo\", [\"-u\", udid, \"-k\", \"ActivationState\"]);\n\t\tif (!result) {\n\t\t\treturn {\n\t\t\t\tisActivated: false,\n\t\t\t\tactivationState: \"Unknown\",\n\t\t\t};\n\t\t}\n\n\t\tconst { stdout } = result;\n\t\tconst state = stdout.trim();\n\n\t\treturn {\n\t\t\tisActivated: state === \"Activated\",\n\t\t\tactivationState: state,\n\t\t};\n\t} catch {\n\t\treturn {\n\t\t\tisActivated: false,\n\t\t\tactivationState: \"Unknown\",\n\t\t};\n\t}\n}\n\nexport async function activate(udid: string): Promise<boolean> {\n\tlogTask(`Activating device ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"ideviceactivation\", [\"-u\", udid, \"activate\"]);\n\t\tif (!result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tresult.stdout.toLowerCase().includes(\"success\") ||\n\t\t\tresult.stdout.toLowerCase().includes(\"activated\")\n\t\t);\n\t} catch (error) {\n\t\tconst errorMsg = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`Activation failed: ${errorMsg}`);\n\t}\n}\n\nexport interface ApplicationConfig {\n\tname: string;\n\tbundleId: string;\n\tversion: string;\n\tbuild: string;\n\ticon: string;\n\ticonData: Buffer;\n}\n", "import { logInfo, logTask } from \"@/utils/debug\";\nimport { runIDeviceTool } from \"./device\";\n\nexport async function isPaired(udid: string): Promise<boolean> {\n\tlogTask(`Checking pairing status for ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"idevicepair\", [\"-u\", udid, \"validate\"]);\n\t\tif (!result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn result.stdout.toLowerCase().includes(\"success\");\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport async function trustDevice(\n\tudid: string,\n\ttimeout = 60000,\n\tonWaitingForTrust?: () => void\n): Promise<boolean> {\n\tlogTask(`Trusting device ${udid}`);\n\n\t// Check if already paired\n\tif (await isPaired(udid)) {\n\t\tlogInfo(`Device ${udid} is already trusted`);\n\t\treturn true;\n\t}\n\n\t// Initiate pairing - this shows the trust dialog on the device\n\tlogInfo(`Initiating pairing for device ${udid}`);\n\tconst pairResult = await pair(udid);\n\n\tif (pairResult) {\n\t\tlogInfo(`Device ${udid} paired successfully`);\n\t\treturn true;\n\t}\n\n\t// Pairing initiated but user needs to accept on device\n\tlogInfo(\"Please accept the trust dialog on the device...\");\n\tonWaitingForTrust?.();\n\n\t// Wait for user to accept\n\ttry {\n\t\tawait waitForPairing(udid, timeout, 1000);\n\t\tlogInfo(`Device ${udid} is now trusted`);\n\t\treturn true;\n\t} catch {\n\t\tlogInfo(`Timeout waiting for trust acceptance on device ${udid}`);\n\t\treturn false;\n\t}\n}\n\nexport async function waitForPairing(\n\tudid: string,\n\ttimeout = 120000,\n\tpollInterval = 1000\n): Promise<boolean> {\n\tlogTask(`Waiting for pairing on device ${udid}`);\n\n\tconst startTime = Date.now();\n\n\twhile (Date.now() - startTime < timeout) {\n\t\tif (await isPaired(udid)) {\n\t\t\tlogInfo(`Device ${udid} is now paired`);\n\t\t\treturn true;\n\t\t}\n\n\t\tawait new Promise((resolve) => setTimeout(resolve, pollInterval));\n\t}\n\n\tthrow new Error(`Timeout waiting for device pairing after ${timeout}ms`);\n}\n\nexport async function pair(udid: string): Promise<boolean> {\n\tlogTask(`Initiating pairing for device ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"idevicepair\", [\"-u\", udid, \"pair\"]);\n\t\tif (!result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn result.stdout.toLowerCase().includes(\"success\");\n\t} catch (error) {\n\t\tconst errorMsg = error instanceof Error ? error.message : String(error);\n\t\tif (errorMsg.includes(\"Please accept the trust dialog\")) {\n\t\t\t// Pairing dialog shown on device\n\t\t\treturn false;\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nexport async function unpair(udid: string): Promise<boolean> {\n\tlogTask(`Un-pairing device ${udid}`);\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"idevicepair\", [\"-u\", udid, \"unpair\"]);\n\t\tif (!result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn result.stdout.toLowerCase().includes(\"success\");\n\t} catch {\n\t\treturn false;\n\t}\n}\n", "import type { AppInfo } from \"@/types\";\nimport { logInfo, logTask } from \"@/utils/debug\";\nimport { parseAppList } from \"../dataParser\";\nimport { runIDeviceTool } from \"./device\";\nimport { isPaired, waitForPairing } from \"./pair\";\n\nexport async function installApp(ipaPath: string, udid: string): Promise<void> {\n\tlogTask(`Installing app ${ipaPath} on device ${udid}`);\n\n\tif (!(await isPaired(udid))) {\n\t\tawait waitForPairing(udid, 10000);\n\t}\n\n\tawait runIDeviceTool(\"ideviceinstaller\", [\"-u\", udid, \"-i\", ipaPath]);\n}\n\nexport async function uninstallApp(bundleId: string, udid: string): Promise<void> {\n\tlogTask(`Uninstalling app ${bundleId} from device ${udid}`);\n\n\tif (!(await isPaired(udid))) {\n\t\tawait waitForPairing(udid, 10000);\n\t}\n\n\tawait runIDeviceTool(\"ideviceinstaller\", [\"-u\", udid, \"-U\", bundleId]);\n}\n\nexport async function listApps(udid: string): Promise<AppInfo[]> {\n\tlogTask(`Listing apps on device ${udid}`);\n\n\tif (!(await isPaired(udid))) {\n\t\tawait waitForPairing(udid, 10000);\n\t}\n\n\ttry {\n\t\tconst result = await runIDeviceTool(\"ideviceinstaller\", [\"-u\", udid, \"-l\"]);\n\t\tif (!result) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst { stdout } = result;\n\t\treturn parseAppList(stdout);\n\t} catch {\n\t\treturn [];\n\t}\n}\n\nexport async function isAppInstalled(bundleId: string, udid: string): Promise<boolean> {\n\tlogTask(`Checking if app ${bundleId} is installed on device ${udid}`);\n\n\tconst apps = await listApps(udid);\n\treturn apps.some((app) => app.bundleId === bundleId);\n}\n\nexport async function wakeDevice(udid: string): Promise<void> {\n\ttry {\n\t\tlogInfo(\"Attempting to wake device screen...\");\n\n\t\t// Try multiple methods to wake the device\n\t\t// Method 1: Query device info (wakes some devices)\n\t\tawait runIDeviceTool(\"ideviceinfo\", [\"-u\", udid, \"-k\", \"DeviceName\"]);\n\n\t\t// Method 2: Try to get activation state (another wake trigger)\n\t\ttry {\n\t\t\tawait runIDeviceTool(\"ideviceinfo\", [\"-u\", udid, \"-k\", \"ActivationState\"]);\n\t\t} catch {\n\t\t\t// Ignore\n\t\t}\n\n\t\t// Method 3: Try to validate pairing (another interaction that might wake)\n\t\ttry {\n\t\t\tawait runIDeviceTool(\"idevicepair\", [\"-u\", udid, \"validate\"]);\n\t\t} catch {\n\t\t\t// Ignore\n\t\t}\n\n\t\t// Longer delay to let screen wake and stabilize\n\t\tawait new Promise((resolve) => setTimeout(resolve, 1000));\n\n\t\tlogInfo(\"Device wake attempt completed\");\n\t} catch (error) {\n\t\t// Log but don't fail - waking is best effort\n\t\tlogInfo(\n\t\t\t`Device wake attempt failed (non-critical): ${error instanceof Error ? error.message : String(error)}`\n\t\t);\n\t}\n}\n\nexport async function launchApp(bundleId: string, args: string[], udid: string): Promise<void> {\n\tlogTask(`Launching app ${bundleId} on device ${udid}`);\n\n\tif (!(await isPaired(udid))) {\n\t\tawait waitForPairing(udid, 10000);\n\t}\n\n\t// Wake device screen first to ensure app appears\n\tawait wakeDevice(udid);\n\n\t// Try idevicedebug first (works for iOS 16 and earlier)\n\ttry {\n\t\tlogInfo(`Attempting to launch ${bundleId} using idevicedebug...`);\n\t\tconst result = await runIDeviceTool(\"idevicedebug\", [\"-u\", udid, \"run\", bundleId, ...args]);\n\t\tconst output = (result?.stdout ?? \"\") + (result?.stderr ?? \"\");\n\n\t\t// Log output for debugging\n\t\tif (output.trim()) {\n\t\t\tlogInfo(`idevicedebug output: ${output.substring(0, 200)}`);\n\t\t}\n\n\t\t// Check if it failed due to missing debugserver\n\t\tif (\n\t\t\toutput.toLowerCase().includes(\"could not start\") &&\n\t\t\toutput.toLowerCase().includes(\"debugserver\")\n\t\t) {\n\t\t\tlogInfo(\"idevicedebug requires debugserver, falling back to pymobiledevice3...\");\n\t\t\tthrow new Error(\"debugserver_not_available\");\n\t\t}\n\n\t\t// Success - app should be launched\n\t\tlogInfo(`App ${bundleId} launched successfully using idevicedebug`);\n\n\t\t// Additional delay to ensure app appears\n\t\tawait new Promise((resolve) => setTimeout(resolve, 1000));\n\t\treturn;\n\t} catch (error) {\n\t\tconst errorMsg = error instanceof Error ? error.message : String(error);\n\n\t\t// If debugserver is not available, try pymobiledevice3 (iOS 17+)\n\t\tif (\n\t\t\terrorMsg.includes(\"debugserver_not_available\") ||\n\t\t\terrorMsg.toLowerCase().includes(\"could not start\") ||\n\t\t\terrorMsg.toLowerCase().includes(\"debugserver\")\n\t\t) {\n\t\t\tlogInfo(\"idevicedebug failed, trying pymobiledevice3 for iOS 17+...\");\n\t\t\tawait launchAppWithPymobiledevice3(bundleId, args, udid);\n\t\t\treturn;\n\t\t}\n\n\t\t// Re-throw other errors\n\t\tthrow error;\n\t}\n}\n\nexport async function launchAppWithPymobiledevice3(\n\tbundleId: string,\n\targs: string[],\n\tudid: string\n): Promise<void> {\n\tlogTask(`Launching app ${bundleId} using pymobiledevice3`);\n\n\tconst { exec } = await import(\"node:child_process\");\n\tconst { promisify } = await import(\"node:util\");\n\tconst execAsync = promisify(exec);\n\n\ttry {\n\t\t// Build command: python -m pymobiledevice3 developer dvt launch --udid <UDID> --tunnel \"\" --kill-existing <bundle-id> [args...]\n\t\t// Use --tunnel \"\" to auto-detect/create tunnel for iOS 17+\n\t\t// Use --kill-existing to ensure app comes to foreground\n\t\t// Use python -m to avoid PATH issues\n\t\t// Try without tunnel first (works for some iOS versions)\n\t\t// If that fails, we'll try with tunnel\n\t\tlet cmdArgs = [\n\t\t\t\"-m\",\n\t\t\t\"pymobiledevice3\",\n\t\t\t\"developer\",\n\t\t\t\"dvt\",\n\t\t\t\"launch\",\n\t\t\t\"--udid\",\n\t\t\tudid,\n\t\t\t\"--kill-existing\", // Kill existing instance to bring app to foreground\n\t\t\tbundleId,\n\t\t\t...args,\n\t\t];\n\n\t\tlet command = `python ${cmdArgs.map((a) => `\"${a}\"`).join(\" \")}`;\n\n\t\tlogInfo(`Executing: ${command}`);\n\n\t\tconst result = await execAsync(command, {\n\t\t\twindowsHide: true,\n\t\t\tencoding: \"utf8\",\n\t\t\ttimeout: 30000, // 30 second timeout\n\t\t});\n\n\t\tconst output = result.stdout.toString() + result.stderr.toString();\n\n\t\t// Log output for debugging\n\t\tif (output.trim()) {\n\t\t\tlogInfo(`pymobiledevice3 output: ${output.substring(0, 200)}`);\n\t\t}\n\n\t\t// Check for common errors\n\t\tif (\n\t\t\toutput.toLowerCase().includes(\"developer mode\") &&\n\t\t\toutput.toLowerCase().includes(\"not enabled\")\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Developer Mode is not enabled on the device.\\n\" +\n\t\t\t\t\t\"Please enable it: Settings \u2192 Privacy & Security \u2192 Developer Mode \u2192 Enable\"\n\t\t\t);\n\t\t}\n\n\t\t// If tunnel error, try again with tunnel option\n\t\tif (\n\t\t\toutput.toLowerCase().includes(\"tunneld\") &&\n\t\t\t(output.toLowerCase().includes(\"unable to connect\") ||\n\t\t\t\toutput.toLowerCase().includes(\"invalidserviceerror\"))\n\t\t) {\n\t\t\tlogInfo(\"Tunnel required, retrying with tunnel option...\");\n\n\t\t\t// Retry with tunnel\n\t\t\tcmdArgs = [\n\t\t\t\t\"-m\",\n\t\t\t\t\"pymobiledevice3\",\n\t\t\t\t\"developer\",\n\t\t\t\t\"dvt\",\n\t\t\t\t\"launch\",\n\t\t\t\t\"--udid\",\n\t\t\t\tudid,\n\t\t\t\t\"--tunnel\",\n\t\t\t\tudid, // Use UDID for tunnel\n\t\t\t\t\"--kill-existing\",\n\t\t\t\tbundleId,\n\t\t\t\t...args,\n\t\t\t];\n\n\t\t\tcommand = `python ${cmdArgs.map((a) => `\"${a}\"`).join(\" \")}`;\n\t\t\tlogInfo(`Retrying with tunnel: ${command}`);\n\n\t\t\ttry {\n\t\t\t\tconst retryResult = await execAsync(command, {\n\t\t\t\t\twindowsHide: true,\n\t\t\t\t\tencoding: \"utf8\",\n\t\t\t\t\ttimeout: 30000,\n\t\t\t\t});\n\n\t\t\t\tconst retryOutput = retryResult.stdout.toString() + retryResult.stderr.toString();\n\t\t\t\tif (retryOutput.trim()) {\n\t\t\t\t\tlogInfo(`pymobiledevice3 retry output: ${retryOutput.substring(0, 200)}`);\n\t\t\t\t}\n\n\t\t\t\t// Check if still failing\n\t\t\t\tif (\n\t\t\t\t\tretryOutput.toLowerCase().includes(\"tunneld\") &&\n\t\t\t\t\tretryOutput.toLowerCase().includes(\"unable to connect\")\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\"Tunnel connection failed. For iOS 17+, you may need to start tunneld:\\n\" +\n\t\t\t\t\t\t\t\" python -m pymobiledevice3 remote tunneld\\n\" +\n\t\t\t\t\t\t\t\"Or ensure Developer Mode is enabled and device is unlocked.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Success on retry\n\t\t\t\tlogInfo(`App ${bundleId} launched successfully using pymobiledevice3 with tunnel`);\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 500));\n\t\t\t\treturn;\n\t\t\t} catch {\n\t\t\t\t// If retry also fails, throw the original tunnel error\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Tunnel connection failed. For iOS 17+, you may need to start tunneld:\\n\" +\n\t\t\t\t\t\t\" python -m pymobiledevice3 remote tunneld\\n\" +\n\t\t\t\t\t\t\"Or ensure Developer Mode is enabled and device is unlocked.\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\toutput.toLowerCase().includes(\"not found\") ||\n\t\t\toutput.toLowerCase().includes(\"command not found\") ||\n\t\t\toutput.toLowerCase().includes(\"cannot find\")\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"pymobiledevice3 is not installed.\\n\" +\n\t\t\t\t\t\"Install it with: python -m pip install --user pymobiledevice3\"\n\t\t\t);\n\t\t}\n\n\t\t// Check if there are any errors in output\n\t\tif (output.toLowerCase().includes(\"error\") && !output.toLowerCase().includes(\"warning\")) {\n\t\t\t// Some errors might be non-fatal, but log them\n\t\t\tlogInfo(`Warning: pymobiledevice3 reported errors: ${output.substring(0, 300)}`);\n\t\t}\n\n\t\tlogInfo(`App ${bundleId} launched successfully using pymobiledevice3`);\n\n\t\t// Longer delay to ensure app appears on screen and device wakes\n\t\tawait new Promise((resolve) => setTimeout(resolve, 1000));\n\t} catch (error) {\n\t\tconst errorMsg = error instanceof Error ? error.message : String(error);\n\n\t\t// Check if it's a command not found error\n\t\tif (\n\t\t\terrorMsg.includes(\"not found\") ||\n\t\t\terrorMsg.includes(\"command not found\") ||\n\t\t\terrorMsg.includes(\"cannot find\") ||\n\t\t\terrorMsg.includes(\"No module named\")\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"pymobiledevice3 is not installed or Python is not available.\\n\" +\n\t\t\t\t\t\"Install it with: python -m pip install --user pymobiledevice3\\n\" +\n\t\t\t\t\t\"For iOS 17+, Developer Mode must also be enabled on the device.\"\n\t\t\t);\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n", "import type { PortForwardResult } from \"@/types\";\nimport { logTask } from \"@/utils/debug\";\nimport { runIDeviceTool } from \"./device\";\n\nasync function startPortForward(\n\tlocalPort: number,\n\tdevicePort: number,\n\tudid: string\n): Promise<PortForwardResult> {\n\tlogTask(`Starting port forward ${localPort} -> ${devicePort} for device ${udid}`);\n\n\tconst result = await runIDeviceTool(\"iproxy\", [\n\t\tlocalPort.toString(),\n\t\tdevicePort.toString(),\n\t\t\"-u\",\n\t\tudid,\n\t]);\n\n\treturn {\n\t\tlocalPort,\n\t\tdevicePort,\n\t\t...result,\n\t};\n}\n\nexport async function startPortForwardAsync(\n\tlocalPort: number,\n\tdevicePort: number,\n\tudid: string,\n\t_timeout = 5000\n): Promise<PortForwardResult> {\n\tconst result = await startPortForward(localPort, devicePort, udid);\n\n\t// Give iproxy a moment to start\n\tawait new Promise((resolve) => setTimeout(resolve, 500));\n\n\t// Check if process is still running\n\tif (result.stdout.includes(\"error\") || result.stderr.includes(\"error\")) {\n\t\tthrow new Error(\"Port forwarding failed to start\");\n\t}\n\n\treturn result;\n}\n\nexport async function closePortForward(udid: string): Promise<void> {\n\tlogTask(`Closing port forward for device ${udid}`);\n\tawait runIDeviceTool(\"iproxy\", [\"-u\", udid, \"-c\"]);\n}\n", "import type { ActivationState, AppInfo, PortForwardResult, iOSDeviceInfo } from \"../types\";\nimport { logInfo } from \"../utils/debug\";\nimport { activate, getActivationState } from \"./actions/activation\";\nimport { getDeviceInfo } from \"./actions/device\";\nimport { installApp, isAppInstalled, launchApp, listApps, uninstallApp } from \"./actions/install\";\nimport { isPaired, pair, trustDevice, unpair, waitForPairing } from \"./actions/pair\";\nimport { closePortForward, startPortForwardAsync } from \"./actions/proxy\";\n\n/**\n * AppleDeviceKit - iOS device operations wrapper\n *\n * Uses idevice command-line tools for iOS device operations.\n * Each instance is associated with a specific device by UDID.\n */\nexport class AppleDeviceKit {\n\tprivate deviceId: string;\n\n\tconstructor(\n\t\tudid: string,\n\t\tprivate readonly port: number\n\t) {\n\t\tthis.deviceId = udid;\n\t\tlogInfo(`AppleDeviceKit initialized for device: ${this.deviceId}`);\n\t}\n\n\t/**\n\t * Get detailed device information\n\t */\n\tpublic async getDeviceInfo(): Promise<iOSDeviceInfo> {\n\t\treturn getDeviceInfo(this.deviceId);\n\t}\n\n\t/**\n\t * Check if device is paired/trusted with this computer\n\t */\n\tpublic async isPaired(): Promise<boolean> {\n\t\treturn isPaired(this.deviceId);\n\t}\n\n\t/**\n\t * Wait for device to be paired\n\t * Polls the pairing status until successful or timeout\n\t *\n\t * @param timeout Timeout in milliseconds (default: 120000)\n\t * @param pollInterval Poll interval in milliseconds (default: 1000)\n\t */\n\tpublic async waitForPairing(timeout = 120000, pollInterval = 1000): Promise<boolean> {\n\t\treturn waitForPairing(this.deviceId, timeout, pollInterval);\n\t}\n\n\t/**\n\t * Attempt to pair/trust the device\n\t * User must accept the trust dialog on the device\n\t */\n\tpublic async pair(): Promise<boolean> {\n\t\treturn pair(this.deviceId);\n\t}\n\n\t/**\n\t * Trust/pair the device - initiates pairing and waits for user to accept\n\t *\n\t * This is the recommended method for establishing trust with a device.\n\t * It will:\n\t * 1. Check if already paired\n\t * 2. If not, initiate pairing (shows \"Trust This Computer?\" on device)\n\t * 3. Wait for user to accept the trust dialog\n\t *\n\t * @param timeout Timeout in milliseconds to wait for user acceptance (default: 60000)\n\t * @param onWaitingForTrust Callback when waiting for user to accept trust dialog\n\t * @returns true if device is now trusted\n\t */\n\tpublic async trustDevice(timeout = 60000, onWaitingForTrust?: () => void): Promise<boolean> {\n\t\treturn trustDevice(this.deviceId, timeout, onWaitingForTrust);\n\t}\n\n\t/**\n\t * Unpair/untrust the device\n\t */\n\tpublic async unpair(): Promise<boolean> {\n\t\treturn unpair(this.deviceId);\n\t}\n\n\t/**\n\t * Install an IPA file on the device (install agent)\n\t *\n\t * @param ipaPath Path to the IPA file\n\t */\n\tpublic async installApp(ipaPath: string): Promise<void> {\n\t\tinstallApp(ipaPath, this.deviceId);\n\t}\n\n\t/**\n\t * Uninstall an app by bundle ID (uninstall agent)\n\t *\n\t * @param bundleId Application bundle identifier\n\t */\n\tpublic async uninstallApp(bundleId: string): Promise<void> {\n\t\tuninstallApp(bundleId, this.deviceId);\n\t}\n\n\t/**\n\t * Check if an app is installed on the device\n\t *\n\t * @param bundleId Application bundle identifier\n\t */\n\tpublic async isAppInstalled(bundleId: string): Promise<boolean> {\n\t\treturn isAppInstalled(bundleId, this.deviceId);\n\t}\n\n\t/**\n\t * List all installed user applications\n\t */\n\tpublic async listApps(): Promise<AppInfo[]> {\n\t\treturn listApps(this.deviceId);\n\t}\n\n\t/**\n\t * Launch an application on the device\n\t *\n\t * @param bundleId Application bundle identifier\n\t * @param args Application arguments\n\t */\n\tpublic async launchApp(bundleId: string, args: string[] = []): Promise<void> {\n\t\treturn launchApp(bundleId, args, this.deviceId);\n\t}\n\n\t/**\n\t * Start port forwarding and wait for it to be ready.\n\t * we need port forwarding to be able to connect to the device from the computer\n\t * and communicate with it using the local port.\n\t *\n\t * @param localPort Local port to listen on\n\t * @param devicePort Device port to forward to\n\t * @param _timeout Timeout in milliseconds (reserved for future use)\n\t */\n\tpublic async startPortForwardAsync(\n\t\tlocalPort: number,\n\t\tdevicePort: number,\n\t\t_timeout = 5000\n\t): Promise<PortForwardResult> {\n\t\treturn startPortForwardAsync(localPort, devicePort, this.deviceId);\n\t}\n\n\t/**\n\t * Get the activation state of the device\n\t */\n\tpublic async getActivationState(): Promise<ActivationState> {\n\t\treturn getActivationState(this.deviceId);\n\t}\n\n\t/**\n\t * Activate the device (register in apple servers), an activated device belongs to someone (a user/company).\n\t * A device that is on hello screen cannot pass the wifi step unless it is activated.\n\t * the activate save us the need of the device to be connected to the internet to do the activation\n\t * and register in apple servers.\n\t *\n\t * Note: This requires a valid activation record or Apple server access\n\t *\n\t * precondition: the device must be paired and trusted\n\t */\n\tpublic async activate(): Promise<boolean> {\n\t\treturn activate(this.deviceId);\n\t}\n\n\t/**\n\t * Get the device UDID\n\t */\n\tpublic getDeviceId(): string {\n\t\treturn this.deviceId;\n\t}\n\n\t/**\n\t * Get the logical port number\n\t */\n\tpublic getPort(): number {\n\t\treturn this.port;\n\t}\n\n\tpublic async closePortForward(): Promise<void> {\n\t\treturn closePortForward(this.deviceId);\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAU,KAAK,SAAS;AACvC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO,MAAM,GAAG;AAAA,MAClB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,eAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,MACnD;AACA,YAAM,IAAI;AAAA,QACR,0DACE,KAAK,UAAU,GAAG;AAAA,MACtB;AAAA,IACF;AAUA,aAAS,MAAM,KAAK;AAClB,YAAM,OAAO,GAAG;AAChB,UAAI,IAAI,SAAS,KAAK;AACpB;AAAA,MACF;AACA,UAAI,QAAQ,mIAAmI;AAAA,QAC7I;AAAA,MACF;AACA,UAAI,CAAC,OAAO;AACV;AAAA,MACF;AACA,UAAI,IAAI,WAAW,MAAM,CAAC,CAAC;AAC3B,UAAI,QAAQ,MAAM,CAAC,KAAK,MAAM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