agent-device 0.21.23 → 0.21.25

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 (435) hide show
  1. package/README.md +6 -6
  2. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.23.apk → agent-device-android-ime-helper-0.21.25.apk} +0 -0
  3. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.25.apk.sha256 +1 -0
  4. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.23.manifest.json → agent-device-android-ime-helper-0.21.25.manifest.json} +4 -4
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.25.apk +0 -0
  6. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.25.apk.sha256 +1 -0
  7. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.25.manifest.json +16 -0
  8. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/SnapshotTraversal.swift +12 -6
  9. package/apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/RectResponseTests.swift +21 -0
  10. package/apple/snapshot-bridge/README.md +9 -7
  11. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +159 -4
  12. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerHttpRequestFraming.swift +139 -0
  13. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerListenerPeer.swift +41 -0
  14. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerListenerToken.swift +25 -0
  15. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift +56 -0
  16. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +14 -5
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Environment.swift +18 -11
  18. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +8 -0
  19. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +12 -0
  20. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +25 -1
  21. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCaptureTarget.swift +1 -1
  22. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotExecution.swift +29 -5
  23. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +0 -3
  24. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +35 -13
  25. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryConfirmation.swift +59 -26
  26. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +19 -5
  27. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +50 -106
  28. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +142 -54
  29. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +4 -1
  30. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +21 -19
  31. package/dist/src/absence-observation-errors.js +1 -0
  32. package/dist/src/adapter.js +1 -1
  33. package/dist/src/adb-executor.js +2 -2
  34. package/dist/src/adb-failure.js +2 -2
  35. package/dist/src/adb.js +1 -1
  36. package/dist/src/agent-browser-lifecycle.js +1 -1
  37. package/dist/src/agent-browser-process-record.js +1 -1
  38. package/dist/src/agent-browser-provider.js +1 -1
  39. package/dist/src/agent-browser-tool.js +1 -1
  40. package/dist/src/agent-device-client.js +2 -2
  41. package/dist/src/alert.js +1 -1
  42. package/dist/src/android-adb.d.ts +3 -2
  43. package/dist/src/android-adb.js +1 -1
  44. package/dist/src/android-input-ownership.js +1 -1
  45. package/dist/src/android-system-surface-disclosure.js +1 -0
  46. package/dist/src/android-text-entry.js +1 -0
  47. package/dist/src/android.js +1 -1
  48. package/dist/src/app-backend.js +1 -1
  49. package/dist/src/app-helpers.js +1 -1
  50. package/dist/src/app-inventory.d.ts +4 -0
  51. package/dist/src/app-launch.js +1 -1
  52. package/dist/src/app-lifecycle.js +4 -3
  53. package/dist/src/app-lifecycle2.js +2 -2
  54. package/dist/src/app-log-files.js +1 -1
  55. package/dist/src/app-log-reconnect.js +1 -1
  56. package/dist/src/app-log-runtime2.js +3 -3
  57. package/dist/src/app-resolution-facade.js +1 -1
  58. package/dist/src/app-resolution.js +2 -2
  59. package/dist/src/app-state-runtime.d.ts +15 -0
  60. package/dist/src/apple-runner-platform.js +1 -1
  61. package/dist/src/application-lifecycle-interaction.js +1 -1
  62. package/dist/src/artifact-download.js +1 -1
  63. package/dist/src/auth.js +1 -1
  64. package/dist/src/aws-device-farm-connection.js +1 -0
  65. package/dist/src/back-mode.js +1 -1
  66. package/dist/src/backend-snapshot-options.js +1 -1
  67. package/dist/src/boot-diagnostics.js +1 -1
  68. package/dist/src/browserstack-connection.js +1 -0
  69. package/dist/src/capture-disclosure.js +1 -0
  70. package/dist/src/cli-config.js +1 -1
  71. package/dist/src/cli-help.js +36 -17
  72. package/dist/src/cli-output.js +1 -1
  73. package/dist/src/cli-runner.js +3 -1
  74. package/dist/src/cli.js +3 -4
  75. package/dist/src/client-companion-tunnel.js +1 -0
  76. package/dist/src/client-metro.js +1 -1
  77. package/dist/src/client-types.d.ts +15 -7
  78. package/dist/src/cloud-artifacts.d.ts +3 -2
  79. package/dist/src/code-signature-cache.js +1 -1
  80. package/dist/src/code-signature.js +1 -1
  81. package/dist/src/command-metadata.js +73 -1
  82. package/dist/src/command-policy.js +1 -0
  83. package/dist/src/command-schema.js +3 -3
  84. package/dist/src/command-surface.js +1 -1
  85. package/dist/src/command-tools.js +2 -2
  86. package/dist/src/connection-runtime.js +1 -1
  87. package/dist/src/connection-verification.js +1 -0
  88. package/dist/src/connection.js +5 -5
  89. package/dist/src/contracts.d.ts +1 -1
  90. package/dist/src/contracts.js +1 -1
  91. package/dist/src/daemon-client-lease-beat.js +1 -1
  92. package/dist/src/daemon-client-lifecycle.js +1 -1
  93. package/dist/src/daemon-client-liveness-probe.js +1 -1
  94. package/dist/src/daemon-policy-file.js +1 -1
  95. package/dist/src/daemon-registration-owner.js +1 -1
  96. package/dist/src/daemon-registration.js +1 -1
  97. package/dist/src/daemon-resolution.js +3 -1
  98. package/dist/src/debug-symbols-facade.js +1 -1
  99. package/dist/src/device-claim-inspection.js +1 -1
  100. package/dist/src/device-input-state.d.ts +6 -17
  101. package/dist/src/device-inventory-context.js +1 -1
  102. package/dist/src/device-readiness-runtime.js +1 -1
  103. package/dist/src/device-release.js +1 -1
  104. package/dist/src/device-selection-resolver.js +1 -1
  105. package/dist/src/device-shell.js +1 -1
  106. package/dist/src/device.js +3 -1
  107. package/dist/src/devicectl.js +1 -1
  108. package/dist/src/diagnostics.js +1 -1
  109. package/dist/src/doctor-facade.js +1 -1
  110. package/dist/src/durable-capture-resource.js +1 -1
  111. package/dist/src/durable-resource.js +1 -1
  112. package/dist/src/engine-eval-script.js +1 -1
  113. package/dist/src/error.js +1 -1
  114. package/dist/src/exec.js +1 -1
  115. package/dist/src/expo-dev-client-launch.js +1 -0
  116. package/dist/src/file.js +3 -1
  117. package/dist/src/find.js +1 -1
  118. package/dist/src/finders.js +1 -1
  119. package/dist/src/generic-settle.js +1 -1
  120. package/dist/src/generic.js +1 -1
  121. package/dist/src/gesture-admission.js +1 -1
  122. package/dist/src/gesture-plan-types.d.ts +2 -5
  123. package/dist/src/gesture-plan.js +1 -1
  124. package/dist/src/gesture-runtime.js +1 -1
  125. package/dist/src/harmonyos.js +1 -1
  126. package/dist/src/hdc.js +1 -1
  127. package/dist/src/helper.js +2 -2
  128. package/dist/src/human-control.js +1 -1
  129. package/dist/src/ime-rebind.js +1 -1
  130. package/dist/src/ime-state.js +1 -1
  131. package/dist/src/index.d.ts +4 -4
  132. package/dist/src/index.js +1 -1
  133. package/dist/src/input-actions.js +1 -1
  134. package/dist/src/input-actions2.js +2 -2
  135. package/dist/src/install-source-network-transport.js +1 -1
  136. package/dist/src/install-source2.js +1 -1
  137. package/dist/src/interaction-error.js +1 -0
  138. package/dist/src/interaction-positionals.js +1 -1
  139. package/dist/src/interaction.js +1 -1
  140. package/dist/src/interaction2.js +1 -1
  141. package/dist/src/interactor-operation-catalog.js +1 -1
  142. package/dist/src/interactor.js +5 -5
  143. package/dist/src/interactor2.js +1 -1
  144. package/dist/src/interactors.js +1 -1
  145. package/dist/src/internal/bin.js +1 -1
  146. package/dist/src/internal/daemon.js +5 -1
  147. package/dist/src/internal/png-worker.js +1 -1
  148. package/dist/src/inventory.js +2 -2
  149. package/dist/src/inventory2.js +1 -1
  150. package/dist/src/inventory6.js +1 -1
  151. package/dist/src/io.d.ts +2 -2
  152. package/dist/src/ios-client.js +1 -1
  153. package/dist/src/ios-settings.js +1 -1
  154. package/dist/src/ios-snapshot-acquisition.js +1 -1
  155. package/dist/src/ios-snapshot-adapter.js +1 -1
  156. package/dist/src/ios-snapshot-engine.js +1 -1
  157. package/dist/src/ios-snapshot-runtime.js +1 -1
  158. package/dist/src/keyed-lock.js +1 -1
  159. package/dist/src/launch-confirmation.js +1 -1
  160. package/dist/src/lease.js +1 -1
  161. package/dist/src/limrun-runtime-dependencies.js +1 -1
  162. package/dist/src/limrun.d.ts +5 -564
  163. package/dist/src/limrun.js +1 -1
  164. package/dist/src/linux.js +1 -1
  165. package/dist/src/load.js +1 -1
  166. package/dist/src/local-interactor-operation-set.js +1 -1
  167. package/dist/src/log-stream.js +9 -9
  168. package/dist/src/mechanics.js +16 -16
  169. package/dist/src/metro.js +1 -1
  170. package/dist/src/metro2.js +1 -1
  171. package/dist/src/mobile-snapshot-semantics.js +1 -1
  172. package/dist/src/observability.js +1 -1
  173. package/dist/src/observation.js +1 -2
  174. package/dist/src/open-target-resolution.js +1 -1
  175. package/dist/src/output-path.js +1 -1
  176. package/dist/src/overlay.js +1 -3
  177. package/dist/src/perf-facade.js +1 -1
  178. package/dist/src/perf-runtime-operation-builder.js +1 -1
  179. package/dist/src/perf-runtime.js +1 -1
  180. package/dist/src/perf-target.js +1 -1
  181. package/dist/src/physical-device-control.js +1 -1
  182. package/dist/src/platform-request-scope.js +1 -1
  183. package/dist/src/platform-runtime-android-adb-host.js +1 -1
  184. package/dist/src/platform-runtime-app-log-android-transport.js +1 -1
  185. package/dist/src/platform-runtime-apple-resources.js +1 -0
  186. package/dist/src/platform-runtime-claim-recovery.js +1 -0
  187. package/dist/src/platform-runtime-daemon-services.js +1 -0
  188. package/dist/src/platform-runtime-host.js +1 -1
  189. package/dist/src/platform-runtime-network-web-transport.js +1 -1
  190. package/dist/src/platform-runtime-open-target.js +1 -1
  191. package/dist/src/platform-runtime-operation-host.js +4 -4
  192. package/dist/src/platform-runtime-runtime-hints.js +2 -2
  193. package/dist/src/platform-runtime-screen-recording-android-host.js +1 -1
  194. package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
  195. package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
  196. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  197. package/dist/src/platform-runtime-screen-recording-harmony-host.js +1 -1
  198. package/dist/src/platform-runtime-screen-recording-web-host.js +1 -1
  199. package/dist/src/platform-runtime-unavailable.js +1 -1
  200. package/dist/src/platform-runtime.js +1 -1
  201. package/dist/src/platform-runtime2.js +1 -1
  202. package/dist/src/plugin.js +1 -0
  203. package/dist/src/plugins/webdriver.d.ts +111 -0
  204. package/dist/src/plugins/webdriver.js +1 -0
  205. package/dist/src/plugins.d.ts +2 -1
  206. package/dist/src/plugins2.js +1 -1
  207. package/dist/src/png-crop-bytes.js +1 -1
  208. package/dist/src/png-resize.js +1 -0
  209. package/dist/src/png-worker-client.js +1 -1
  210. package/dist/src/png-worker-contract.js +1 -1
  211. package/dist/src/process-entry.js +1 -1
  212. package/dist/src/process-exit.js +1 -1
  213. package/dist/src/process.js +1 -1
  214. package/dist/src/provider-credential-fingerprint.js +1 -1
  215. package/dist/src/provider-device-admission.js +1 -1
  216. package/dist/src/provider-device-runtime.d.ts +556 -0
  217. package/dist/src/provider-policy.js +1 -0
  218. package/dist/src/provider-profile-fields.js +1 -1
  219. package/dist/src/provider-webdriver.js +1 -2
  220. package/dist/src/proxy.js +2 -2
  221. package/dist/src/quality-warnings.js +1 -1
  222. package/dist/src/react-devtools.js +2 -0
  223. package/dist/src/react-native-overlay2.js +3 -0
  224. package/dist/src/react-native.js +1 -1
  225. package/dist/src/record-runtime.js +1 -1
  226. package/dist/src/record-trace.js +1 -1
  227. package/dist/src/recording.js +2 -2
  228. package/dist/src/register-builtins.js +1 -1
  229. package/dist/src/remote-bridge.js +1 -0
  230. package/dist/src/remote-config-core.js +1 -0
  231. package/dist/src/remote-config.js +1 -1
  232. package/dist/src/remote-config2.js +1 -1
  233. package/dist/src/replay-backend-registry.js +1 -0
  234. package/dist/src/replay-divergence.js +1 -1
  235. package/dist/src/replay-maestro-backend.js +117 -0
  236. package/dist/src/replay-script-selection.js +1 -0
  237. package/dist/src/replay.js +1 -3
  238. package/dist/src/replay2.js +1 -0
  239. package/dist/src/reporting.js +3 -3
  240. package/dist/src/request-cancel.js +1 -1
  241. package/dist/src/request-providers.js +1 -1
  242. package/dist/src/request-runtime-binding.js +1 -1
  243. package/dist/src/result-serialization.js +1 -1
  244. package/dist/src/retry.js +1 -1
  245. package/dist/src/retry2.js +1 -0
  246. package/dist/src/runner-artifact-manifest.js +1 -1
  247. package/dist/src/runner-cache-retention.js +1 -0
  248. package/dist/src/runner-cache-trim.js +1 -0
  249. package/dist/src/runner-client.js +1 -1
  250. package/dist/src/runner-dev-tools-security.js +1 -1
  251. package/dist/src/runner-device-readiness.js +1 -1
  252. package/dist/src/runner-device-set.js +1 -0
  253. package/dist/src/runner-error-classification.js +3 -3
  254. package/dist/src/runner-exchange.js +1 -1
  255. package/dist/src/runner-lease.js +1 -0
  256. package/dist/src/runner-operations-facade.js +1 -1
  257. package/dist/src/runner-retention.js +1 -0
  258. package/dist/src/runner-start-budget.js +1 -1
  259. package/dist/src/runner-startup-transport.js +1 -0
  260. package/dist/src/runner-toolchain-probe.js +2 -0
  261. package/dist/src/runner.js +2 -1
  262. package/dist/src/runtime-command-surface.js +1 -0
  263. package/dist/src/runtime-deployment.js +1 -0
  264. package/dist/src/runtime-factory.js +1 -0
  265. package/dist/src/runtime-session.js +1 -0
  266. package/dist/src/runtime-transport-hints.js +1 -1
  267. package/dist/src/runtime.js +2 -1
  268. package/dist/src/runtime10.js +2 -2
  269. package/dist/src/runtime2.js +4 -4
  270. package/dist/src/runtime3.js +1 -1
  271. package/dist/src/runtime4.js +5 -5
  272. package/dist/src/runtime5.js +1 -1
  273. package/dist/src/runtime6.js +1 -1
  274. package/dist/src/runtime7.js +1 -1
  275. package/dist/src/runtime8.js +1 -1
  276. package/dist/src/runtime9.js +1 -1
  277. package/dist/src/screen-recording-transport.js +1 -1
  278. package/dist/src/screenshot-density.js +1 -1
  279. package/dist/src/screenshot-image.js +1 -1
  280. package/dist/src/screenshot-runtime.js +1 -1
  281. package/dist/src/screenshot3.js +5 -5
  282. package/dist/src/sdk-batch-runner.js +2 -2
  283. package/dist/src/sdk-batch.js +2 -2
  284. package/dist/src/sdk-contracts.d.ts +20 -29
  285. package/dist/src/sdk-contracts.js +2 -2
  286. package/dist/src/sdk-device.js +1 -1
  287. package/dist/src/sdk-finders.d.ts +1 -1
  288. package/dist/src/sdk-finders.js +1 -1
  289. package/dist/src/sdk-io.d.ts +4 -2
  290. package/dist/src/sdk-remote-config.d.ts +4 -0
  291. package/dist/src/sdk-remote-config.js +1 -1
  292. package/dist/src/sdk-selectors.d.ts +5 -6
  293. package/dist/src/sdk-selectors.js +1 -1
  294. package/dist/src/selection.js +0 -0
  295. package/dist/src/selector-pipeline-policy.js +1 -1
  296. package/dist/src/selector-runtime.js +1 -1
  297. package/dist/src/selectors.js +1 -1
  298. package/dist/src/server.js +2 -2
  299. package/dist/src/session-allocation.js +1 -1
  300. package/dist/src/session-replay-runtime-failure-response.js +1 -0
  301. package/dist/src/session-runtime-admission.js +1 -1
  302. package/dist/src/session.js +1 -1
  303. package/dist/src/session2.js +5 -5
  304. package/dist/src/settings.js +1 -1
  305. package/dist/src/settings2.js +1 -1
  306. package/dist/src/simctl-settings.js +1 -1
  307. package/dist/src/simctl.js +1 -1
  308. package/dist/src/simulator-boot.js +1 -1
  309. package/dist/src/simulator-state.js +1 -1
  310. package/dist/src/simulator.js +1 -1
  311. package/dist/src/snapshot-capture-annotations.js +1 -1
  312. package/dist/src/snapshot-chrome.js +1 -0
  313. package/dist/src/snapshot-desktop-projection.js +1 -1
  314. package/dist/src/snapshot-evidence.js +1 -0
  315. package/dist/src/snapshot-node-lookup.js +1 -0
  316. package/dist/src/snapshot-occlusion.js +1 -0
  317. package/dist/src/snapshot-quality-verdict.js +1 -0
  318. package/dist/src/snapshot-runtime-binding.js +1 -1
  319. package/dist/src/snapshot-runtime.js +1 -1
  320. package/dist/src/snapshot-state.js +1 -1
  321. package/dist/src/snapshot.js +1 -1
  322. package/dist/src/snapshot2.js +1 -1
  323. package/dist/src/snapshot3.js +1 -1
  324. package/dist/src/src.js +5 -1
  325. package/dist/src/src2.js +1 -1
  326. package/dist/src/src3.js +2 -1
  327. package/dist/src/store.js +1 -1
  328. package/dist/src/surface-snapshot2.js +1 -1
  329. package/dist/src/target-evidence-tree.js +1 -0
  330. package/dist/src/target-evidence.js +1 -1
  331. package/dist/src/text-entry-focus.js +1 -1
  332. package/dist/src/tool-provider2.js +1 -1
  333. package/dist/src/touch-runtime.js +1 -1
  334. package/dist/src/touch-runtime2.js +1 -1
  335. package/dist/src/tree.js +1 -1
  336. package/dist/src/tv-remote.js +1 -1
  337. package/dist/src/type-text-runtime.js +1 -1
  338. package/dist/src/undici.js +8 -8
  339. package/dist/src/update-check.js +1 -1
  340. package/dist/src/vars.js +1 -1
  341. package/dist/src/version.js +1 -1
  342. package/dist/src/video.js +2 -2
  343. package/dist/src/wait.js +1 -0
  344. package/dist/src/web.js +1 -1
  345. package/dist/src/web2.js +1 -1
  346. package/package.json +22 -19
  347. package/server.json +2 -2
  348. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.23.apk.sha256 +0 -1
  349. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.23.apk +0 -0
  350. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.23.apk.sha256 +0 -1
  351. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.23.manifest.json +0 -16
  352. package/dist/src/adb-transport.js +0 -1
  353. package/dist/src/alert-runtime.js +0 -1
  354. package/dist/src/app-deployment-resolution.js +0 -2
  355. package/dist/src/app-inventory-contract.js +0 -1
  356. package/dist/src/app-log-session-resource.js +0 -1
  357. package/dist/src/application-lifecycle-runtime.js +0 -1
  358. package/dist/src/auth-session.js +0 -1
  359. package/dist/src/cache.js +0 -1
  360. package/dist/src/capabilities.js +0 -1
  361. package/dist/src/capture.js +0 -1
  362. package/dist/src/catalog.js +0 -1
  363. package/dist/src/click-button.js +0 -1
  364. package/dist/src/client-metro-companion.js +0 -1
  365. package/dist/src/client-options.js +0 -3
  366. package/dist/src/compatibility-policy.js +0 -1
  367. package/dist/src/daemon-artifacts.js +0 -1
  368. package/dist/src/daemon-client-transport.js +0 -1
  369. package/dist/src/daemon-http.js +0 -1
  370. package/dist/src/device-claim-rule.js +0 -1
  371. package/dist/src/device-rotation.js +0 -1
  372. package/dist/src/device-session.js +0 -3
  373. package/dist/src/device2.js +0 -1
  374. package/dist/src/device3.js +0 -3
  375. package/dist/src/dispatch-resolve.js +0 -4
  376. package/dist/src/format.js +0 -1
  377. package/dist/src/gesture-plan-types.js +0 -1
  378. package/dist/src/host.js +0 -1
  379. package/dist/src/human-control-contract.js +0 -1
  380. package/dist/src/interaction-ref-policy.js +0 -1
  381. package/dist/src/interactor-operation-binding.js +0 -1
  382. package/dist/src/keyboard-actions.js +0 -1
  383. package/dist/src/lease-context.js +0 -1
  384. package/dist/src/lease-registry-scope.js +0 -1
  385. package/dist/src/lease-scope.js +0 -1
  386. package/dist/src/managed-device-scope.js +0 -1
  387. package/dist/src/observe-until.js +0 -1
  388. package/dist/src/output-common.js +0 -5
  389. package/dist/src/owner-identity.js +0 -3
  390. package/dist/src/path-resolution.js +0 -1
  391. package/dist/src/perf-runtime-plan.js +0 -1
  392. package/dist/src/platform-runtime-app-log-process.js +0 -1
  393. package/dist/src/platform-runtime-managed-owner.js +0 -1
  394. package/dist/src/platform-runtime-screen-recording-process-host.js +0 -1
  395. package/dist/src/png.js +0 -1
  396. package/dist/src/prepare-kind.js +0 -1
  397. package/dist/src/provider-device-runtimes.js +0 -1
  398. package/dist/src/provider-session-ownership.js +0 -2
  399. package/dist/src/providers.js +0 -1
  400. package/dist/src/registry.js +0 -68
  401. package/dist/src/request-admission.js +0 -1
  402. package/dist/src/request-cancellation.js +0 -1
  403. package/dist/src/request-progress-protocol.js +0 -1
  404. package/dist/src/runner-cache-metadata.js +0 -3
  405. package/dist/src/runner-disposal.js +0 -1
  406. package/dist/src/runner-session-types.js +0 -1
  407. package/dist/src/runtime-admission.js +0 -1
  408. package/dist/src/screen-recording-admission-ledger.js +0 -1
  409. package/dist/src/screen-recording-resource-recovery.js +0 -1
  410. package/dist/src/screenshot-result.js +0 -1
  411. package/dist/src/script.js +0 -1
  412. package/dist/src/scroll-command.js +0 -1
  413. package/dist/src/scroll-gesture.js +0 -1
  414. package/dist/src/scroll-indicator.js +0 -1
  415. package/dist/src/session-artifact-paths.js +0 -1
  416. package/dist/src/session-paths.js +0 -1
  417. package/dist/src/session-repair-tombstone.js +0 -1
  418. package/dist/src/session-routing.js +0 -1
  419. package/dist/src/session-snapshot.js +0 -1
  420. package/dist/src/snapshot4.js +0 -1
  421. package/dist/src/src4.js +0 -1
  422. package/dist/src/src5.js +0 -1
  423. package/dist/src/src6.js +0 -1
  424. package/dist/src/src7.js +0 -2
  425. package/dist/src/src8.js +0 -115
  426. package/dist/src/string-enum.js +0 -1
  427. package/dist/src/success-text.js +0 -1
  428. package/dist/src/timeouts.js +0 -1
  429. package/dist/src/touch-reference-frame.js +0 -1
  430. package/dist/src/transport.js +0 -3
  431. package/dist/src/ttl-memo.js +0 -1
  432. package/dist/src/verified-file.js +0 -1
  433. package/dist/src/viewport.js +0 -1
  434. package/dist/src/window-state.js +0 -1
  435. /package/dist/src/{doctor-output.js → doctor-lines.js} +0 -0
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime.js";import{P as t}from"./sdk-contracts.js";import{r as n,t as r}from"./png.js";import{t as i}from"./png-encode.js";import a from"node:zlib";const o=[137,80,78,71,13,10,26,10],s=[`IHDR`,`PLTE`,`IDAT`,`IEND`],c=/^[A-Za-z]{4}$/;function l(e){return!c.test(e)||e[0]<=`Z`&&!s.includes(e)}function u(e){return o.every((t,n)=>e[n]===t)}function d(e){if(e.length<33||!u(e))return null;let t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);if(t.readUInt32BE(8)!==13||t.toString(`ascii`,12,16)!==`IHDR`)return null;let n=t.subarray(12,29);return t.readUInt32BE(29)===a.crc32(n)>>>0?{width:t.readUInt32BE(16),height:t.readUInt32BE(20),bitDepth:e[24],colorType:e[25],compressionMethod:e[26],filterMethod:e[27],interlace:e[28]}:null}function f(e){return e===2?3:e===6?4:null}function p(e){if(!u(e))return null;let t=Buffer.from(e.buffer,e.byteOffset,e.byteLength),n=[],r=8;for(;r+12<=e.length;){let i=t.readUInt32BE(r);if(i>2147483647||r+12+i>e.length)return null;let o=t.subarray(r+4,r+8+i);if(t.readUInt32BE(r+8+i)!==a.crc32(o)>>>0)return null;let s=t.toString(`ascii`,r+4,r+8);if(l(s))return null;if(n.push({type:s,data:t.subarray(r+8,r+8+i)}),s===`IEND`)return r+12+i===e.length?n:null;r+=12+i}return null}const m=[0,1,2,3,4];function h(e,t,n,r){switch(e){case 1:return t;case 2:return n;case 3:return t+n>>1;case 4:return g(t,n,r);default:return 0}}function g(e,t,n){let r=e+t-n,i=Math.abs(r-e),a=Math.abs(r-t),o=Math.abs(r-n);return i<=a&&i<=o?e:a<=o?t:n}function _(e,t){return e+t&255}function v(e){let t=d(e);return t===null||t.bitDepth!==8||t.compressionMethod!==0||t.filterMethod!==0||t.interlace!==0||f(t.colorType)===null?null:t}function y(e,t,n){let r=f(t.colorType);if(r===null)return null;let i=D(e);if(i===null)return null;let a=t.width*r,o=t.height*(a+1),s=E(i,o);if(s===null||s.length<o)return null;for(let e=0;e<n.y+n.height;e+=1)if(!b(s,e,a,r))return null;if(!C(s,n.y+n.height,t.height,a))return null;let c=r===4&&!w(s,n,a)?4:3;return{width:n.width,height:n.height,channels:c,pixels:T(s,n,a,r,c)}}function b(e,t,n,r){let i=t*(n+1)+1,a=e[i-1];return m.includes(a)?a===0?!0:t===0?x(e,i,n,r,a):S(e,i,n,r,a):!1}function x(e,t,n,r,i){let a=t+n;if(i===1||i===4){for(let n=t+r;n<a;n+=1)e[n]=_(e[n],e[n-r]);return!0}for(let n=t;n<a;n+=1){let a=n>=t+r?e[n-r]:0;e[n]=_(e[n],h(i,a,0,0))}return!0}function S(e,t,n,r,i){let a=t+n,o=t-(n+1);if(i===1){for(let n=t+r;n<a;n+=1)e[n]=_(e[n],e[n-r]);return!0}if(i===2){for(let n=t;n<a;n+=1)e[n]=_(e[n],e[o+(n-t)]);return!0}for(let n=t;n<a;n+=1){let a=n-t,s=n>=t+r?e[n-r]:0;e[n]=_(e[n],h(i,s,e[o+a],n>=t+r?e[o+a-r]:0))}return!0}function C(e,t,n,r){for(let i=t;i<n;i+=1)if(!m.includes(e[i*(r+1)]))return!1;return!0}function w(e,t,n){let r=255;for(let i=t.y;i<t.y+t.height&&r===255;i+=1){let a=i*(n+1)+4;for(let n=0;n<t.width;n+=1)r&=e[a+(t.x+n)*4]}return r===255}function T(e,t,n,r,i){let a=t.width*i,o=new Uint8Array(t.height*a);for(let s=0;s<t.height;s+=1){let c=(s+t.y)*(n+1)+1+t.x*r,l=s*a;if(r===i)o.set(e.subarray(c,c+t.width*r),l);else for(let n=0;n<t.width;n+=1){let t=c+n*r,a=l+n*i;o[a]=e[t],o[a+1]=e[t+1],o[a+2]=e[t+2]}}return o}function E(e,t){try{return a.inflateSync(e,{maxOutputLength:t})}catch{return null}}function D(e){let t=p(e);if(t===null)return null;let n=[];for(let e of t){if(e.type===`PLTE`||e.type===`tRNS`)return null;e.type===`IDAT`&&n.push(e.data)}return n.length===0?null:Buffer.concat(n)}var O=e({cropPngBytes:()=>k});function k(e,t,n){let r=v(e);if(r!==null&&!N(t,r.width,r.height)){M(t,r.width,r.height);let n=y(e,r,t);if(n!==null)return i(n.pixels,n.width,n.height,n.channels)}return A(e,t,n)}function A(e,t,i){let a=r(e,i);return M(t,a.width,a.height),N(t,a.width,a.height)?null:n.PNG.sync.write(j(a,t))}function j(e,t){let r=new n.PNG({width:t.width,height:t.height});for(let n=0;n<t.height;n+=1){let i=((n+t.y)*e.width+t.x)*4;e.data.copy(r.data,n*r.width*4,i,i+t.width*4)}return r}function M(e,n,r){if(e.x+e.width>n||e.y+e.height>r)throw new t(`INVALID_ARGS`,`Screenshot crop box ${e.width}x${e.height} at (${e.x}, ${e.y}) exceeds the ${n}x${r} image`)}function N(e,t,n){return e.x===0&&e.y===0&&e.width===t&&e.height===n}export{O as n,k as t};
1
+ import{r as e}from"./rolldown-runtime.js";import{P as t}from"./sdk-contracts.js";import{i as n,o as r}from"./png-worker-contract.js";import{t as i}from"./png-encode.js";import a from"node:zlib";const o=[137,80,78,71,13,10,26,10],s=[`IHDR`,`PLTE`,`IDAT`,`IEND`],c=/^[A-Za-z]{4}$/;function l(e){return!c.test(e)||e[0]<=`Z`&&!s.includes(e)}function u(e){return o.every((t,n)=>e[n]===t)}function d(e){if(e.length<33||!u(e))return null;let t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);if(t.readUInt32BE(8)!==13||t.toString(`ascii`,12,16)!==`IHDR`)return null;let n=t.subarray(12,29);return t.readUInt32BE(29)===a.crc32(n)>>>0?{width:t.readUInt32BE(16),height:t.readUInt32BE(20),bitDepth:e[24],colorType:e[25],compressionMethod:e[26],filterMethod:e[27],interlace:e[28]}:null}function f(e){return e===2?3:e===6?4:null}function p(e){if(!u(e))return null;let t=Buffer.from(e.buffer,e.byteOffset,e.byteLength),n=[],r=8;for(;r+12<=e.length;){let i=t.readUInt32BE(r);if(i>2147483647||r+12+i>e.length)return null;let o=t.subarray(r+4,r+8+i);if(t.readUInt32BE(r+8+i)!==a.crc32(o)>>>0)return null;let s=t.toString(`ascii`,r+4,r+8);if(l(s))return null;if(n.push({type:s,data:t.subarray(r+8,r+8+i)}),s===`IEND`)return r+12+i===e.length?n:null;r+=12+i}return null}const m=[0,1,2,3,4];function h(e,t,n,r){switch(e){case 1:return t;case 2:return n;case 3:return t+n>>1;case 4:return g(t,n,r);default:return 0}}function g(e,t,n){let r=e+t-n,i=Math.abs(r-e),a=Math.abs(r-t),o=Math.abs(r-n);return i<=a&&i<=o?e:a<=o?t:n}function _(e,t){return e+t&255}function v(e){let t=d(e);return t===null||t.bitDepth!==8||t.compressionMethod!==0||t.filterMethod!==0||t.interlace!==0||f(t.colorType)===null?null:t}function y(e,t,n){let r=f(t.colorType);if(r===null)return null;let i=D(e);if(i===null)return null;let a=t.width*r,o=t.height*(a+1),s=E(i,o);if(s===null||s.length<o)return null;for(let e=0;e<n.y+n.height;e+=1)if(!b(s,e,a,r))return null;if(!C(s,n.y+n.height,t.height,a))return null;let c=r===4&&!w(s,n,a)?4:3;return{width:n.width,height:n.height,channels:c,pixels:T(s,n,a,r,c)}}function b(e,t,n,r){let i=t*(n+1)+1,a=e[i-1];return m.includes(a)?a===0?!0:t===0?x(e,i,n,r,a):S(e,i,n,r,a):!1}function x(e,t,n,r,i){let a=t+n;if(i===1||i===4){for(let n=t+r;n<a;n+=1)e[n]=_(e[n],e[n-r]);return!0}for(let n=t;n<a;n+=1){let a=n>=t+r?e[n-r]:0;e[n]=_(e[n],h(i,a,0,0))}return!0}function S(e,t,n,r,i){let a=t+n,o=t-(n+1);if(i===1){for(let n=t+r;n<a;n+=1)e[n]=_(e[n],e[n-r]);return!0}if(i===2){for(let n=t;n<a;n+=1)e[n]=_(e[n],e[o+(n-t)]);return!0}for(let n=t;n<a;n+=1){let a=n-t,s=n>=t+r?e[n-r]:0;e[n]=_(e[n],h(i,s,e[o+a],n>=t+r?e[o+a-r]:0))}return!0}function C(e,t,n,r){for(let i=t;i<n;i+=1)if(!m.includes(e[i*(r+1)]))return!1;return!0}function w(e,t,n){let r=255;for(let i=t.y;i<t.y+t.height&&r===255;i+=1){let a=i*(n+1)+4;for(let n=0;n<t.width;n+=1)r&=e[a+(t.x+n)*4]}return r===255}function T(e,t,n,r,i){let a=t.width*i,o=new Uint8Array(t.height*a);for(let s=0;s<t.height;s+=1){let c=(s+t.y)*(n+1)+1+t.x*r,l=s*a;if(r===i)o.set(e.subarray(c,c+t.width*r),l);else for(let n=0;n<t.width;n+=1){let t=c+n*r,a=l+n*i;o[a]=e[t],o[a+1]=e[t+1],o[a+2]=e[t+2]}}return o}function E(e,t){try{return a.inflateSync(e,{maxOutputLength:t})}catch{return null}}function D(e){let t=p(e);if(t===null)return null;let n=[];for(let e of t){if(e.type===`PLTE`||e.type===`tRNS`)return null;e.type===`IDAT`&&n.push(e.data)}return n.length===0?null:Buffer.concat(n)}var O=e({cropPngBytes:()=>k});function k(e,t,n){let r=v(e);if(r!==null&&!N(t,r.width,r.height)){M(t,r.width,r.height);let n=y(e,r,t);if(n!==null)return i(n.pixels,n.width,n.height,n.channels)}return A(e,t,n)}function A(e,t,i){let a=n(e,i);return M(t,a.width,a.height),N(t,a.width,a.height)?null:r.PNG.sync.write(j(a,t))}function j(e,t){let n=new r.PNG({width:t.width,height:t.height});for(let r=0;r<t.height;r+=1){let i=((r+t.y)*e.width+t.x)*4;e.data.copy(n.data,r*n.width*4,i,i+t.width*4)}return n}function M(e,n,r){if(e.x+e.width>n||e.y+e.height>r)throw new t(`INVALID_ARGS`,`Screenshot crop box ${e.width}x${e.height} at (${e.x}, ${e.y}) exceeds the ${n}x${r} image`)}function N(e,t,n){return e.x===0&&e.y===0&&e.width===t&&e.height===n}export{O as n,k as t};
@@ -0,0 +1 @@
1
+ import{P as e}from"./sdk-contracts.js";import{pt as t}from"./tv-remote.js";import{i as n,o as r}from"./png-worker-client.js";import{o as i}from"./png-worker-contract.js";import{promises as a}from"node:fs";async function o(i,o){let{min:s,max:l}=t;if(!Number.isFinite(o)||o<s||o>l)throw new e(`INVALID_ARGS`,`Screenshot scale must be between ${s} and ${l}`);if(o===1)return;let u=await n(await a.readFile(i),`screenshot`),d=Math.max(1,Math.round(u.width*o)),f=Math.max(1,Math.round(u.height*o));await a.writeFile(i,await r(c(u,d,f)))}async function s(t,i,o){if(!Number.isInteger(i)||i<1||!Number.isInteger(o)||o<1)throw new e(`INVALID_ARGS`,`Screenshot resize dimensions must be positive integers`);let s=await n(await a.readFile(t),`screenshot`);(s.width!==i||s.height!==o)&&await a.writeFile(t,await r(c(s,i,o)))}function c(e,t,n){let r=new i.PNG({width:t,height:n});for(let i=0;i<n;i+=1){let a=i*e.height/n,o=(i+1)*e.height/n;for(let n=0;n<t;n+=1){let s=n*e.width/t,c=(n+1)*e.width/t,l=0,u=0,d=0,f=0,p=0;for(let t=Math.floor(a);t<Math.ceil(o);t+=1){let n=Math.min(t+1,o)-Math.max(t,a);for(let r=Math.floor(s);r<Math.ceil(c);r+=1){let i=n*(Math.min(r+1,c)-Math.max(r,s)),a=(t*e.width+r)*4;l+=(e.data[a]??0)*i,u+=(e.data[a+1]??0)*i,d+=(e.data[a+2]??0)*i,f+=(e.data[a+3]??0)*i,p+=i}}let m=(i*r.width+n)*4;r.data[m]=Math.round(l/p),r.data[m+1]=Math.round(u/p),r.data[m+2]=Math.round(d/p),r.data[m+3]=Math.round(f/p)}}return r}export{s as n,o as r,c as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime.js";import{P as t,rt as n}from"./sdk-contracts.js";import{r}from"./diagnostics.js";import"./diagnostics2.js";import{n as i,r as a,t as o}from"./png.js";import{n as s,r as c,t as l}from"./png-worker-contract.js";import u from"node:fs";import d from"node:path";import{fileURLToPath as f}from"node:url";import{Worker as p}from"node:worker_threads";function m(e,t){try{let n=f(e),r=d.extname(n)||`.js`;return[d.join(d.dirname(n),`${t}${r}`),d.join(d.dirname(n),`internal`,`${t}${r}`)].find(e=>u.existsSync(e))??null}catch{return null}}var h=e({computePngRgbDifferenceAsync:()=>L,computeScreenshotDiffPixelsAsync:()=>R,cropPngBytesAsync:()=>I,decodePngAsync:()=>M,decodeScreenshotImageAsync:()=>N,encodePngAsync:()=>F,prewarmPngWorker:()=>A,terminatePngWorker:()=>j,transcodeScreenshotToPngAsync:()=>z}),g=class extends Error{};let _=null,v=!1,y=!1,b=0;const x=new Map;function S(e){v=!0,!y&&(y=!0,r({level:`warn`,phase:`png_worker_unavailable`,data:{reason:e}}),process.emitWarning(`PNG worker unavailable, falling back to in-process PNG processing: ${e}`))}function C(e){let r=x.get(e.id);r&&(x.delete(e.id),E(),e.ok?r.resolve(e.result):r.reject(new t(n(e.error.code),e.error.message,e.error.details)))}function w(e,t){_===e&&(S(t.message),_=null,e.terminate().catch(()=>{}),T(new g(`PNG worker failed: ${t.message}`)))}function T(e){let t=[...x.values()];x.clear();for(let n of t)n.reject(e)}function E(){_&&(x.size>0?_.ref():_.unref())}function D(){if(v)return null;if(_)return _;let e=m(import.meta.url,`png-worker`);if(!e)return S(`worker entry module not found next to the current module`),null;try{let t=new p(e,{execArgv:e.endsWith(`.ts`)?[`--experimental-strip-types`]:[]});return t.on(`message`,C),t.on(`error`,e=>{w(t,e)}),t.on(`exit`,e=>{w(t,Error(`PNG worker exited with code ${e}`))}),t.unref(),_=t,t}catch(e){return S(`failed to spawn worker: ${e instanceof Error?e.message:String(e)}`),null}}function O(e){let t=D();if(!t)return Promise.reject(new g(`PNG worker is unavailable`));b+=1;let n=b;return new Promise((r,i)=>{x.set(n,{resolve:r,reject:i}),E();try{t.postMessage({...e,id:n})}catch(e){x.delete(n),E(),i(new g(`failed to post job to PNG worker: ${e instanceof Error?e.message:String(e)}`))}})}async function k(e,t){try{return await O(e)}catch(e){if(e instanceof g)return await t();throw e}}function A(){D()}async function j(){let e=_;_=null,T(new g(`PNG worker terminated`)),e&&await e.terminate()}async function M(e,t){return P(await k({kind:`decode`,png:e,label:t},()=>{let n=o(e,t);return{kind:`decode`,width:n.width,height:n.height,data:n.data}}))}async function N(e,t){return P(await k({kind:`decode-image`,image:e,label:t},async()=>{let{decodeScreenshotImage:n}=await import(`./screenshot-image.js`),r=n(e,t);return{kind:`decode-image`,width:r.width,height:r.height,data:r.data}}))}function P(e){let t=new a.PNG({width:e.width,height:e.height});return t.data=l(e.data),t}async function F(e){let t=await k({kind:`encode`,width:e.width,height:e.height,data:e.data},()=>({kind:`encode`,png:a.PNG.sync.write(e)}));return l(t.png)}async function I(e,t,n){let r=await k({kind:`crop`,png:e,label:n,box:t},async()=>{let{cropPngBytes:r}=await import(`./png-crop-bytes.js`).then(e=>e.n);return{kind:`crop`,png:r(e,t,n)}});return r.png===null?null:l(r.png)}async function L(e,t,n){let{kind:r,...i}=await k({kind:`rgb-difference`,firstPng:e,secondPng:t,label:n},()=>({kind:`rgb-difference`,...s(o(e,n),o(t,n))}));return i}async function R(e){let{kind:t,...n}=await k({kind:`diff-pixels`,...e},()=>({kind:`diff-pixels`,...c(e)}));return{...n,diffData:l(n.diffData)}}async function z(e,t){if(i(e))return e;let n=await k({kind:`jpeg-to-png`,image:e,label:t},async()=>{let{transcodeScreenshotToPng:n}=await import(`./screenshot-image.js`);return{kind:`jpeg-to-png`,png:n(e,t)}});return l(n.png)}export{N as a,A as c,M as i,j as l,R as n,F as o,I as r,h as s,L as t};
1
+ import{r as e}from"./rolldown-runtime.js";import{P as t,it as n}from"./sdk-contracts.js";import{r}from"./diagnostics.js";import"./diagnostics2.js";import{a as i,i as a,n as o,o as s,r as c,t as l}from"./png-worker-contract.js";import u from"node:fs";import d from"node:path";import{fileURLToPath as f}from"node:url";import{Worker as p}from"node:worker_threads";function m(e,t){try{let n=f(e),r=d.extname(n)||`.js`;return[d.join(d.dirname(n),`${t}${r}`),d.join(d.dirname(n),`internal`,`${t}${r}`)].find(e=>u.existsSync(e))??null}catch{return null}}var h=e({computePngRgbDifferenceAsync:()=>L,computeScreenshotDiffPixelsAsync:()=>R,cropPngBytesAsync:()=>I,decodePngAsync:()=>M,decodeScreenshotImageAsync:()=>N,encodePngAsync:()=>F,prewarmPngWorker:()=>A,terminatePngWorker:()=>j,transcodeScreenshotToPngAsync:()=>z}),g=class extends Error{};let _=null,v=!1,y=!1,b=0;const x=new Map;function S(e){v=!0,!y&&(y=!0,r({level:`warn`,phase:`png_worker_unavailable`,data:{reason:e}}),process.emitWarning(`PNG worker unavailable, falling back to in-process PNG processing: ${e}`))}function C(e){let r=x.get(e.id);r&&(x.delete(e.id),E(),e.ok?r.resolve(e.result):r.reject(new t(n(e.error.code),e.error.message,e.error.details)))}function w(e,t){_===e&&(S(t.message),_=null,e.terminate().catch(()=>{}),T(new g(`PNG worker failed: ${t.message}`)))}function T(e){let t=[...x.values()];x.clear();for(let n of t)n.reject(e)}function E(){_&&(x.size>0?_.ref():_.unref())}function D(){if(v)return null;if(_)return _;let e=m(import.meta.url,`png-worker`);if(!e)return S(`worker entry module not found next to the current module`),null;try{let t=new p(e,{execArgv:e.endsWith(`.ts`)?[`--experimental-strip-types`]:[]});return t.on(`message`,C),t.on(`error`,e=>{w(t,e)}),t.on(`exit`,e=>{w(t,Error(`PNG worker exited with code ${e}`))}),t.unref(),_=t,t}catch(e){return S(`failed to spawn worker: ${e instanceof Error?e.message:String(e)}`),null}}function O(e){let t=D();if(!t)return Promise.reject(new g(`PNG worker is unavailable`));b+=1;let n=b;return new Promise((r,i)=>{x.set(n,{resolve:r,reject:i}),E();try{t.postMessage({...e,id:n})}catch(e){x.delete(n),E(),i(new g(`failed to post job to PNG worker: ${e instanceof Error?e.message:String(e)}`))}})}async function k(e,t){try{return await O(e)}catch(e){if(e instanceof g)return await t();throw e}}function A(){D()}async function j(){let e=_;_=null,T(new g(`PNG worker terminated`)),e&&await e.terminate()}async function M(e,t){return P(await k({kind:`decode`,png:e,label:t},()=>{let n=a(e,t);return{kind:`decode`,width:n.width,height:n.height,data:n.data}}))}async function N(e,t){return P(await k({kind:`decode-image`,image:e,label:t},async()=>{let{decodeScreenshotImage:n}=await import(`./screenshot-image.js`),r=n(e,t);return{kind:`decode-image`,width:r.width,height:r.height,data:r.data}}))}function P(e){let t=new s.PNG({width:e.width,height:e.height});return t.data=l(e.data),t}async function F(e){let t=await k({kind:`encode`,width:e.width,height:e.height,data:e.data},()=>({kind:`encode`,png:s.PNG.sync.write(e)}));return l(t.png)}async function I(e,t,n){let r=await k({kind:`crop`,png:e,label:n,box:t},async()=>{let{cropPngBytes:r}=await import(`./png-crop-bytes.js`).then(e=>e.n);return{kind:`crop`,png:r(e,t,n)}});return r.png===null?null:l(r.png)}async function L(e,t,n){let{kind:r,...i}=await k({kind:`rgb-difference`,firstPng:e,secondPng:t,label:n},()=>({kind:`rgb-difference`,...o(a(e,n),a(t,n))}));return i}async function R(e){let{kind:t,...n}=await k({kind:`diff-pixels`,...e},()=>({kind:`diff-pixels`,...c(e)}));return{...n,diffData:l(n.diffData)}}async function z(e,t){if(i(e))return e;let n=await k({kind:`jpeg-to-png`,image:e,label:t},async()=>{let{transcodeScreenshotToPng:n}=await import(`./screenshot-image.js`);return{kind:`jpeg-to-png`,png:n(e,t)}});return l(n.png)}export{N as a,A as c,M as i,j as l,R as n,F as o,I as r,h as s,L as t};
@@ -1 +1 @@
1
- const e=.78,t={r:220,g:0,b:0};function n(n){let{baselineData:a,currentData:o,maxColorDistance:s}=n,c=n.width*n.height,l=Buffer.alloc(c*4),u=new Uint8Array(c),d=0;for(let n=0,c=0;n<a.length;n+=4,c+=1){let f=a[n]-o[n],p=a[n+1]-o[n+1],m=a[n+2]-o[n+2];if(Math.sqrt(f**2+p**2+m**2)>s){d+=1,u[c]=1;let a=r(o,n);l[n]=i(a,t.r,e),l[n+1]=i(a,t.g,e),l[n+2]=i(a,t.b,e),l[n+3]=255;continue}let h=r(o,n);l[n]=h,l[n+1]=h,l[n+2]=h,l[n+3]=255}return{diffData:l,diffMask:u,differentPixels:d}}function r(e,t){return i(Math.round(e[t]*.299+e[t+1]*.587+e[t+2]*.114),255,.72)}function i(e,t,n){return Math.round(e*(1-n)+t*n)}function a(e,t){let n={first:{width:e.width,height:e.height,dataLength:e.data.length},second:{width:t.width,height:t.height,dataLength:t.data.length}};if(e.width!==t.width||e.height!==t.height)return{...n,status:`dimension_mismatch`};let r=e.width*e.height;if(e.data.length!==t.data.length||e.data.length!==r*4)return{...n,status:`data_length_mismatch`};let i=0;for(let n=0;n<e.data.length;n+=4)i+=Math.abs(e.data[n]-t.data[n]),i+=Math.abs(e.data[n+1]-t.data[n+1]),i+=Math.abs(e.data[n+2]-t.data[n+2]);return{...n,status:`compared`,differencePercent:100*i/(765*r)}}function o(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}export{a as n,n as r,o as t};
1
+ import{i as e,t}from"./rolldown-runtime.js";import{P as n}from"./sdk-contracts.js";var r=t(((t,n)=>{let r=e(`util`),i=e(`stream`),a=n.exports=function(){i.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding=`utf8`,this.writable=!0};r.inherits(a,i),a.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit(`drain`))}.bind(this))},a.prototype.write=function(e,t){if(!this.writable)return this.emit(`error`,Error(`Stream not writable`)),!1;let n;return n=Buffer.isBuffer(e)?e:Buffer.from(e,t||this._encoding),this._buffers.push(n),this._buffered+=n.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused},a.prototype.end=function(e,t){e&&this.write(e,t),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit(`error`,Error(`Unexpected end of input`)),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit(`close`))},a.prototype._processReadAllowingLess=function(e){this._reads.shift();let t=this._buffers[0];t.length>e.length?(this._buffered-=e.length,this._buffers[0]=t.slice(e.length),e.func.call(this,t.slice(0,e.length))):(this._buffered-=t.length,this._buffers.shift(),e.func.call(this,t))},a.prototype._processRead=function(e){this._reads.shift();let t=0,n=0,r=Buffer.alloc(e.length);for(;t<e.length;){let i=this._buffers[n++],a=Math.min(i.length,e.length-t);i.copy(r,t,0,a),t+=a,a!==i.length&&(this._buffers[--n]=i.slice(a))}n>0&&this._buffers.splice(0,n),this._buffered-=e.length,e.func.call(this,r)},a.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let e=this._reads[0];if(e.allowLess)this._processReadAllowingLess(e);else if(this._buffered>=e.length)this._processRead(e);else break}this._buffers&&!this.writable&&this._end()}catch(e){this.emit(`error`,e)}}})),i=t((e=>{let t=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];e.getImagePasses=function(e,n){let r=[],i=e%8,a=n%8,o=(e-i)/8,s=(n-a)/8;for(let e=0;e<t.length;e++){let n=t[e],c=o*n.x.length,l=s*n.y.length;for(let e=0;e<n.x.length&&n.x[e]<i;e++)c++;for(let e=0;e<n.y.length&&n.y[e]<a;e++)l++;c>0&&l>0&&r.push({width:c,height:l,index:e})}return r},e.getInterlaceIterator=function(e){return function(n,r,i){let a=n%t[i].x.length,o=(n-a)/t[i].x.length*8+t[i].x[a],s=r%t[i].y.length,c=(r-s)/t[i].y.length*8+t[i].y[s];return o*4+c*e*4}}})),a=t(((e,t)=>{t.exports=function(e,t,n){let r=e+t-n,i=Math.abs(r-e),a=Math.abs(r-t),o=Math.abs(r-n);return i<=a&&i<=o?e:a<=o?t:n}})),o=t(((e,t)=>{let n=i(),r=a();function o(e,t,n){let r=e*t;return n!==8&&(r=Math.ceil(r/(8/n))),r}let s=t.exports=function(e,t){let r=e.width,i=e.height,a=e.interlace,s=e.bpp,c=e.depth;if(this.read=t.read,this.write=t.write,this.complete=t.complete,this._imageIndex=0,this._images=[],a){let e=n.getImagePasses(r,i);for(let t=0;t<e.length;t++)this._images.push({byteWidth:o(e[t].width,s,c),height:e[t].height,lineIndex:0})}else this._images.push({byteWidth:o(r,s,c),height:i,lineIndex:0});this._xComparison=c===8?s:c===16?s*2:1};s.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},s.prototype._unFilterType1=function(e,t,n){let r=this._xComparison,i=r-1;for(let a=0;a<n;a++){let n=e[1+a],o=a>i?t[a-r]:0;t[a]=n+o}},s.prototype._unFilterType2=function(e,t,n){let r=this._lastLine;for(let i=0;i<n;i++){let n=e[1+i],a=r?r[i]:0;t[i]=n+a}},s.prototype._unFilterType3=function(e,t,n){let r=this._xComparison,i=r-1,a=this._lastLine;for(let o=0;o<n;o++){let n=e[1+o],s=a?a[o]:0,c=o>i?t[o-r]:0,l=Math.floor((c+s)/2);t[o]=n+l}},s.prototype._unFilterType4=function(e,t,n){let i=this._xComparison,a=i-1,o=this._lastLine;for(let s=0;s<n;s++){let n=e[1+s],c=o?o[s]:0,l=s>a?t[s-i]:0,u=s>a&&o?o[s-i]:0,d=r(l,c,u);t[s]=n+d}},s.prototype._reverseFilterLine=function(e){let t=e[0],n,r=this._images[this._imageIndex],i=r.byteWidth;if(t===0)n=e.slice(1,i+1);else switch(n=Buffer.alloc(i),t){case 1:this._unFilterType1(e,n,i);break;case 2:this._unFilterType2(e,n,i);break;case 3:this._unFilterType3(e,n,i);break;case 4:this._unFilterType4(e,n,i);break;default:throw Error(`Unrecognised filter type - `+t)}this.write(n),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=n,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}})),s=t(((t,n)=>{let i=e(`util`),a=r(),s=o(),c=n.exports=function(e){a.call(this);let t=[],n=this;this._filter=new s(e,{read:this.read.bind(this),write:function(e){t.push(e)},complete:function(){n.emit(`complete`,Buffer.concat(t))}}),this._filter.start()};i.inherits(c,a)})),c=t(((e,t)=>{t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}})),l=t(((e,t)=>{let n=[];(function(){for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t&1?t=3988292384^t>>>1:t>>>=1;n[e]=t}})();let r=t.exports=function(){this._crc=-1};r.prototype.write=function(e){for(let t=0;t<e.length;t++)this._crc=n[(this._crc^e[t])&255]^this._crc>>>8;return!0},r.prototype.crc32=function(){return this._crc^-1},r.crc32=function(e){let t=-1;for(let r=0;r<e.length;r++)t=n[(t^e[r])&255]^t>>>8;return t^-1}})),u=t(((e,t)=>{let n=c(),r=l(),i=t.exports=function(e,t){this._options=e,e.checkCRC=e.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=t.read,this.error=t.error,this.metadata=t.metadata,this.gamma=t.gamma,this.transColor=t.transColor,this.palette=t.palette,this.parsed=t.parsed,this.inflateData=t.inflateData,this.finished=t.finished,this.simpleTransparency=t.simpleTransparency,this.headersFinished=t.headersFinished||function(){}};i.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},i.prototype._parseSignature=function(e){let t=n.PNG_SIGNATURE;for(let n=0;n<t.length;n++)if(e[n]!==t[n]){this.error(Error(`Invalid file signature`));return}this.read(8,this._parseChunkBegin.bind(this))},i.prototype._parseChunkBegin=function(e){let t=e.readUInt32BE(0),i=e.readUInt32BE(4),a=``;for(let t=4;t<8;t++)a+=String.fromCharCode(e[t]);let o=!!(e[4]&32);if(!this._hasIHDR&&i!==n.TYPE_IHDR){this.error(Error(`Expected IHDR on beggining`));return}if(this._crc=new r,this._crc.write(Buffer.from(a)),this._chunks[i])return this._chunks[i](t);if(!o){this.error(Error(`Unsupported critical chunk type `+a));return}this.read(t+4,this._skipChunk.bind(this))},i.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},i.prototype._parseChunkEnd=function(e){let t=e.readInt32BE(0),n=this._crc.crc32();if(this._options.checkCRC&&n!==t){this.error(Error(`Crc error - `+t+` - `+n));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleIHDR=function(e){this.read(e,this._parseIHDR.bind(this))},i.prototype._parseIHDR=function(e){this._crc.write(e);let t=e.readUInt32BE(0),r=e.readUInt32BE(4),i=e[8],a=e[9],o=e[10],s=e[11],c=e[12];if(i!==8&&i!==4&&i!==2&&i!==1&&i!==16){this.error(Error(`Unsupported bit depth `+i));return}if(!(a in n.COLORTYPE_TO_BPP_MAP)){this.error(Error(`Unsupported color type`));return}if(o!==0){this.error(Error(`Unsupported compression method`));return}if(s!==0){this.error(Error(`Unsupported filter method`));return}if(c!==0&&c!==1){this.error(Error(`Unsupported interlace method`));return}this._colorType=a;let l=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:t,height:r,depth:i,interlace:!!c,palette:!!(a&n.COLORTYPE_PALETTE),color:!!(a&n.COLORTYPE_COLOR),alpha:!!(a&n.COLORTYPE_ALPHA),bpp:l,colorType:a}),this._handleChunkEnd()},i.prototype._handlePLTE=function(e){this.read(e,this._parsePLTE.bind(this))},i.prototype._parsePLTE=function(e){this._crc.write(e);let t=Math.floor(e.length/3);for(let n=0;n<t;n++)this._palette.push([e[n*3],e[n*3+1],e[n*3+2],255]);this.palette(this._palette),this._handleChunkEnd()},i.prototype._handleTRNS=function(e){this.simpleTransparency(),this.read(e,this._parseTRNS.bind(this))},i.prototype._parseTRNS=function(e){if(this._crc.write(e),this._colorType===n.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(Error(`Transparency chunk must be after palette`));return}if(e.length>this._palette.length){this.error(Error(`More transparent colors than palette size`));return}for(let t=0;t<e.length;t++)this._palette[t][3]=e[t];this.palette(this._palette)}this._colorType===n.COLORTYPE_GRAYSCALE&&this.transColor([e.readUInt16BE(0)]),this._colorType===n.COLORTYPE_COLOR&&this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)]),this._handleChunkEnd()},i.prototype._handleGAMA=function(e){this.read(e,this._parseGAMA.bind(this))},i.prototype._parseGAMA=function(e){this._crc.write(e),this.gamma(e.readUInt32BE(0)/n.GAMMA_DIVISION),this._handleChunkEnd()},i.prototype._handleIDAT=function(e){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-e,this._parseIDAT.bind(this,e))},i.prototype._parseIDAT=function(e,t){if(this._crc.write(t),this._colorType===n.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw Error(`Expected palette not found`);this.inflateData(t);let r=e-t.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},i.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))},i.prototype._parseIEND=function(e){this._crc.write(e),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}})),d=t((e=>{let t=i(),n=[function(){},function(e,t,n,r){if(r===t.length)throw Error(`Ran out of data`);let i=t[r];e[n]=i,e[n+1]=i,e[n+2]=i,e[n+3]=255},function(e,t,n,r){if(r+1>=t.length)throw Error(`Ran out of data`);let i=t[r];e[n]=i,e[n+1]=i,e[n+2]=i,e[n+3]=t[r+1]},function(e,t,n,r){if(r+2>=t.length)throw Error(`Ran out of data`);e[n]=t[r],e[n+1]=t[r+1],e[n+2]=t[r+2],e[n+3]=255},function(e,t,n,r){if(r+3>=t.length)throw Error(`Ran out of data`);e[n]=t[r],e[n+1]=t[r+1],e[n+2]=t[r+2],e[n+3]=t[r+3]}],r=[function(){},function(e,t,n,r){let i=t[0];e[n]=i,e[n+1]=i,e[n+2]=i,e[n+3]=r},function(e,t,n){let r=t[0];e[n]=r,e[n+1]=r,e[n+2]=r,e[n+3]=t[1]},function(e,t,n,r){e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=r},function(e,t,n){e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=t[3]}];function a(e,t){let n=[],r=0;function i(){if(r===e.length)throw Error(`Ran out of data`);let i=e[r];r++;let a,o,s,c,l,u,d,f;switch(t){default:throw Error(`unrecognised depth`);case 16:d=e[r],r++,n.push((i<<8)+d);break;case 4:d=i&15,f=i>>4,n.push(f,d);break;case 2:l=i&3,u=i>>2&3,d=i>>4&3,f=i>>6&3,n.push(f,d,u,l);break;case 1:a=i&1,o=i>>1&1,s=i>>2&1,c=i>>3&1,l=i>>4&1,u=i>>5&1,d=i>>6&1,f=i>>7&1,n.push(f,d,u,l,c,s,o,a)}}return{get:function(e){for(;n.length<e;)i();let t=n.slice(0,e);return n=n.slice(e),t},resetAfterLine:function(){n.length=0},end:function(){if(r!==e.length)throw Error(`extra data found`)}}}function o(e,t,r,i,a,o){let s=e.width,c=e.height,l=e.index;for(let e=0;e<c;e++)for(let c=0;c<s;c++){let s=r(c,e,l);n[i](t,a,s,o),o+=i}return o}function s(e,t,n,i,a,o){let s=e.width,c=e.height,l=e.index;for(let e=0;e<c;e++){for(let c=0;c<s;c++){let s=a.get(i),u=n(c,e,l);r[i](t,s,u,o)}a.resetAfterLine()}}e.dataToBitMap=function(e,n){let r=n.width,i=n.height,c=n.depth,l=n.bpp,u=n.interlace,d;c!==8&&(d=a(e,c));let f;f=c<=8?Buffer.alloc(r*i*4):new Uint16Array(r*i*4);let p=2**c-1,m=0,h,g;if(u)h=t.getImagePasses(r,i),g=t.getInterlaceIterator(r,i);else{let e=0;g=function(){let t=e;return e+=4,t},h=[{width:r,height:i}]}for(let t=0;t<h.length;t++)c===8?m=o(h[t],f,g,l,e,m):s(h[t],f,g,l,d,p);if(c===8){if(m!==e.length)throw Error(`extra data found`)}else d.end();return f}})),f=t(((e,t)=>{function n(e,t,n,r,i){let a=0;for(let o=0;o<r;o++)for(let r=0;r<n;r++){let n=i[e[a]];if(!n)throw Error(`index `+e[a]+` not in palette`);for(let e=0;e<4;e++)t[a+e]=n[e];a+=4}}function r(e,t,n,r,i){let a=0;for(let o=0;o<r;o++)for(let r=0;r<n;r++){let n=!1;if(i.length===1?i[0]===e[a]&&(n=!0):i[0]===e[a]&&i[1]===e[a+1]&&i[2]===e[a+2]&&(n=!0),n)for(let e=0;e<4;e++)t[a+e]=0;a+=4}}function i(e,t,n,r,i){let a=2**i-1,o=0;for(let i=0;i<r;i++)for(let r=0;r<n;r++){for(let n=0;n<4;n++)t[o+n]=Math.floor(e[o+n]*255/a+.5);o+=4}}t.exports=function(e,t,a=!1){let o=t.depth,s=t.width,c=t.height,l=t.colorType,u=t.transColor,d=t.palette,f=e;return l===3?n(e,f,s,c,d):(u&&r(e,f,s,c,u),o!==8&&!a&&(o===16&&(f=Buffer.alloc(s*c*4)),i(e,f,s,c,o))),f}})),p=t(((t,n)=>{let i=e(`util`),a=e(`zlib`),o=r(),c=s(),l=u(),p=d(),m=f(),h=n.exports=function(e){o.call(this),this._parser=new l(e,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,`gamma`),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=e,this.writable=!0,this._parser.start()};i.inherits(h,o),h.prototype._handleError=function(e){this.emit(`error`,e),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on(`error`,function(){})),this.errord=!0},h.prototype._inflateData=function(e){if(!this._inflate){if(this._bitmapInfo.interlace)this._inflate=a.createInflate(),this._inflate.on(`error`,this.emit.bind(this,`error`)),this._filter.on(`complete`,this._complete.bind(this)),this._inflate.pipe(this._filter);else{let e=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,t=Math.max(e,a.Z_MIN_CHUNK);this._inflate=a.createInflate({chunkSize:t});let n=e,r=this.emit.bind(this,`error`);this._inflate.on(`error`,function(e){n&&r(e)}),this._filter.on(`complete`,this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on(`data`,function(e){n&&(e.length>n&&(e=e.slice(0,n)),n-=e.length,i(e))}),this._inflate.on(`end`,this._filter.end.bind(this._filter))}}this._inflate.write(e)},h.prototype._handleMetaData=function(e){this._metaData=e,this._bitmapInfo=Object.create(e),this._filter=new c(this._bitmapInfo)},h.prototype._handleTransColor=function(e){this._bitmapInfo.transColor=e},h.prototype._handlePalette=function(e){this._bitmapInfo.palette=e},h.prototype._simpleTransparency=function(){this._metaData.alpha=!0},h.prototype._headersFinished=function(){this.emit(`metadata`,this._metaData)},h.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit(`error`,`No Inflate block`))},h.prototype._complete=function(e){if(this.errord)return;let t;try{let n=p.dataToBitMap(e,this._bitmapInfo);t=m(n,this._bitmapInfo,this._options.skipRescale),n=null}catch(e){this._handleError(e);return}this.emit(`parsed`,t)}})),m=t(((e,t)=>{let n=c();t.exports=function(e,t,r,i){let a=[n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(i.colorType)!==-1;if(i.colorType===i.inputColorType){let t=(function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]!==256})();if(i.bitDepth===8||i.bitDepth===16&&t)return e}let o=i.bitDepth===16?new Uint16Array(e.buffer):e,s=255,c=n.COLORTYPE_TO_BPP_MAP[i.inputColorType];c===4&&!i.inputHasAlpha&&(c=3);let l=n.COLORTYPE_TO_BPP_MAP[i.colorType];i.bitDepth===16&&(s=65535,l*=2);let u=Buffer.alloc(t*r*l),d=0,f=0,p=i.bgColor||{};p.red===void 0&&(p.red=s),p.green===void 0&&(p.green=s),p.blue===void 0&&(p.blue=s);function m(){let e,t,r,c=s;switch(i.inputColorType){case n.COLORTYPE_COLOR_ALPHA:c=o[d+3],e=o[d],t=o[d+1],r=o[d+2];break;case n.COLORTYPE_COLOR:e=o[d],t=o[d+1],r=o[d+2];break;case n.COLORTYPE_ALPHA:c=o[d+1],e=o[d],t=e,r=e;break;case n.COLORTYPE_GRAYSCALE:e=o[d],t=e,r=e;break;default:throw Error(`input color type:`+i.inputColorType+` is not supported at present`)}return i.inputHasAlpha&&(a||(c/=s,e=Math.min(Math.max(Math.round((1-c)*p.red+c*e),0),s),t=Math.min(Math.max(Math.round((1-c)*p.green+c*t),0),s),r=Math.min(Math.max(Math.round((1-c)*p.blue+c*r),0),s))),{red:e,green:t,blue:r,alpha:c}}for(let e=0;e<r;e++)for(let e=0;e<t;e++){let e=m(o,d);switch(i.colorType){case n.COLORTYPE_COLOR_ALPHA:case n.COLORTYPE_COLOR:i.bitDepth===8?(u[f]=e.red,u[f+1]=e.green,u[f+2]=e.blue,a&&(u[f+3]=e.alpha)):(u.writeUInt16BE(e.red,f),u.writeUInt16BE(e.green,f+2),u.writeUInt16BE(e.blue,f+4),a&&u.writeUInt16BE(e.alpha,f+6));break;case n.COLORTYPE_ALPHA:case n.COLORTYPE_GRAYSCALE:{let t=(e.red+e.green+e.blue)/3;i.bitDepth===8?(u[f]=t,a&&(u[f+1]=e.alpha)):(u.writeUInt16BE(t,f),a&&u.writeUInt16BE(e.alpha,f+2));break}default:throw Error(`unrecognised color Type `+i.colorType)}d+=c,f+=l}return u}})),h=t(((e,t)=>{let n=a();function r(e,t,n,r,i){for(let a=0;a<n;a++)r[i+a]=e[t+a]}function i(e,t,n){let r=0,i=t+n;for(let n=t;n<i;n++)r+=Math.abs(e[n]);return r}function o(e,t,n,r,i,a){for(let o=0;o<n;o++){let n=o>=a?e[t+o-a]:0,s=e[t+o]-n;r[i+o]=s}}function s(e,t,n,r){let i=0;for(let a=0;a<n;a++){let n=a>=r?e[t+a-r]:0,o=e[t+a]-n;i+=Math.abs(o)}return i}function c(e,t,n,r,i){for(let a=0;a<n;a++){let o=t>0?e[t+a-n]:0,s=e[t+a]-o;r[i+a]=s}}function l(e,t,n){let r=0,i=t+n;for(let a=t;a<i;a++){let i=t>0?e[a-n]:0,o=e[a]-i;r+=Math.abs(o)}return r}function u(e,t,n,r,i,a){for(let o=0;o<n;o++){let s=o>=a?e[t+o-a]:0,c=t>0?e[t+o-n]:0,l=e[t+o]-(s+c>>1);r[i+o]=l}}function d(e,t,n,r){let i=0;for(let a=0;a<n;a++){let o=a>=r?e[t+a-r]:0,s=t>0?e[t+a-n]:0,c=e[t+a]-(o+s>>1);i+=Math.abs(c)}return i}function f(e,t,r,i,a,o){for(let s=0;s<r;s++){let c=s>=o?e[t+s-o]:0,l=t>0?e[t+s-r]:0,u=t>0&&s>=o?e[t+s-(r+o)]:0,d=e[t+s]-n(c,l,u);i[a+s]=d}}function p(e,t,r,i){let a=0;for(let o=0;o<r;o++){let s=o>=i?e[t+o-i]:0,c=t>0?e[t+o-r]:0,l=t>0&&o>=i?e[t+o-(r+i)]:0,u=e[t+o]-n(s,c,l);a+=Math.abs(u)}return a}let m={0:r,1:o,2:c,3:u,4:f},h={0:i,1:s,2:l,3:d,4:p};t.exports=function(e,t,n,r,i){let a;if(!(`filterType`in r)||r.filterType===-1)a=[0,1,2,3,4];else if(typeof r.filterType==`number`)a=[r.filterType];else throw Error(`unrecognised filter types`);r.bitDepth===16&&(i*=2);let o=t*i,s=0,c=0,l=Buffer.alloc((o+1)*n),u=a[0];for(let t=0;t<n;t++){if(a.length>1){let t=1/0;for(let n=0;n<a.length;n++){let r=h[a[n]](e,c,o,i);r<t&&(u=a[n],t=r)}}l[s]=u,s++,m[u](e,c,o,l,s,i),s+=o,c+=o}return l}})),g=t(((t,n)=>{let r=c(),i=l(),a=m(),o=h(),s=e(`zlib`),u=n.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=e.deflateLevel==null?9:e.deflateLevel,e.deflateStrategy=e.deflateStrategy==null?3:e.deflateStrategy,e.inputHasAlpha=e.inputHasAlpha==null||e.inputHasAlpha,e.deflateFactory=e.deflateFactory||s.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType=typeof e.colorType==`number`?e.colorType:r.COLORTYPE_COLOR_ALPHA,e.inputColorType=typeof e.inputColorType==`number`?e.inputColorType:r.COLORTYPE_COLOR_ALPHA,[r.COLORTYPE_GRAYSCALE,r.COLORTYPE_COLOR,r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(e.colorType)===-1)throw Error(`option color type:`+e.colorType+` is not supported at present`);if([r.COLORTYPE_GRAYSCALE,r.COLORTYPE_COLOR,r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(e.inputColorType)===-1)throw Error(`option input color type:`+e.inputColorType+` is not supported at present`);if(e.bitDepth!==8&&e.bitDepth!==16)throw Error(`option bit depth:`+e.bitDepth+` is not supported at present`)};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(e,t,n){let i=a(e,t,n,this._options),s=r.COLORTYPE_TO_BPP_MAP[this._options.colorType];return o(i,t,n,this._options,s)},u.prototype._packChunk=function(e,t){let n=t?t.length:0,r=Buffer.alloc(n+12);return r.writeUInt32BE(n,0),r.writeUInt32BE(e,4),t&&t.copy(r,8),r.writeInt32BE(i.crc32(r.slice(4,r.length-4)),r.length-4),r},u.prototype.packGAMA=function(e){let t=Buffer.alloc(4);return t.writeUInt32BE(Math.floor(e*r.GAMMA_DIVISION),0),this._packChunk(r.TYPE_gAMA,t)},u.prototype.packIHDR=function(e,t){let n=Buffer.alloc(13);return n.writeUInt32BE(e,0),n.writeUInt32BE(t,4),n[8]=this._options.bitDepth,n[9]=this._options.colorType,n[10]=0,n[11]=0,n[12]=0,this._packChunk(r.TYPE_IHDR,n)},u.prototype.packIDAT=function(e){return this._packChunk(r.TYPE_IDAT,e)},u.prototype.packIEND=function(){return this._packChunk(r.TYPE_IEND,null)}})),_=t(((t,n)=>{let r=e(`util`),i=e(`stream`),a=c(),o=g(),s=n.exports=function(e){i.call(this);let t=e||{};this._packer=new o(t),this._deflate=this._packer.createDeflate(),this.readable=!0};r.inherits(s,i),s.prototype.pack=function(e,t,n,r){this.emit(`data`,Buffer.from(a.PNG_SIGNATURE)),this.emit(`data`,this._packer.packIHDR(t,n)),r&&this.emit(`data`,this._packer.packGAMA(r));let i=this._packer.filterData(e,t,n);this._deflate.on(`error`,this.emit.bind(this,`error`)),this._deflate.on(`data`,function(e){this.emit(`data`,this._packer.packIDAT(e))}.bind(this)),this._deflate.on(`end`,function(){this.emit(`data`,this._packer.packIEND()),this.emit(`end`)}.bind(this)),this._deflate.end(i)}})),v=t(((t,n)=>{let r=e(`assert`).ok,i=e(`zlib`),a=e(`util`),o=e(`buffer`).kMaxLength;function s(e){if(!(this instanceof s))return new s(e);e&&e.chunkSize<i.Z_MIN_CHUNK&&(e.chunkSize=i.Z_MIN_CHUNK),i.Inflate.call(this,e),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,e&&e.maxLength!=null&&(this._maxLength=e.maxLength)}function c(e){return new s(e)}function l(e,t){t&&process.nextTick(t),e._handle&&=(e._handle.close(),null)}s.prototype._processChunk=function(e,t,n){if(typeof n==`function`)return i.Inflate._processChunk.call(this,e,t,n);let a=this,s=e&&e.length,c=this._chunkSize-this._offset,u=this._maxLength,d=0,f=[],p=0,m;this.on(`error`,function(e){m=e});function h(e,t){if(a._hadError)return;let n=c-t;if(r(n>=0,`have should not go down`),n>0){let e=a._buffer.slice(a._offset,a._offset+n);if(a._offset+=n,e.length>u&&(e=e.slice(0,u)),f.push(e),p+=e.length,u-=e.length,u===0)return!1}return(t===0||a._offset>=a._chunkSize)&&(c=a._chunkSize,a._offset=0,a._buffer=Buffer.allocUnsafe(a._chunkSize)),t===0&&(d+=s-e,s=e,!0)}r(this._handle,`zlib binding closed`);let g;do g=this._handle.writeSync(t,e,d,s,this._buffer,this._offset,c),g||=this._writeState;while(!this._hadError&&h(g[0],g[1]));if(this._hadError)throw m;if(p>=o)throw l(this),RangeError(`Cannot create final Buffer. It would be larger than 0x`+o.toString(16)+` bytes`);let _=Buffer.concat(f,p);return l(this),_},a.inherits(s,i.Inflate);function u(e,t){if(typeof t==`string`&&(t=Buffer.from(t)),!(t instanceof Buffer))throw TypeError(`Not a string or buffer`);let n=e._finishFlushFlag;return n??=i.Z_FINISH,e._processChunk(t,n)}function d(e,t){return u(new s(t),e)}n.exports=t=d,t.Inflate=s,t.createInflate=c,t.inflateSync=d})),y=t(((e,t)=>{let n=t.exports=function(e){this._buffer=e,this._reads=[]};n.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t})},n.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let e=this._reads[0];if(this._buffer.length&&(this._buffer.length>=e.length||e.allowLess)){this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length),e.func.call(this,t.slice(0,e.length))}else break}if(this._reads.length>0)throw Error(`There are some read requests waitng on finished stream`);if(this._buffer.length>0)throw Error(`unrecognised content at end of stream`)}})),b=t((e=>{let t=y(),n=o();e.process=function(e,r){let i=[],a=new t(e);return new n(r,{read:a.read.bind(a),write:function(e){i.push(e)},complete:function(){}}).start(),a.process(),Buffer.concat(i)}})),x=t(((t,n)=>{let r=!0,i=e(`zlib`),a=v();i.deflateSync||(r=!1);let o=y(),s=b(),c=u(),l=d(),p=f();n.exports=function(e,t){if(!r)throw Error(`To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0`);let n;function u(e){n=e}let d;function f(e){d=e}function m(e){d.transColor=e}function h(e){d.palette=e}function g(){d.alpha=!0}let _;function v(e){_=e}let y=[];function b(e){y.push(e)}let x=new o(e);if(new c(t,{read:x.read.bind(x),error:u,metadata:f,gamma:v,palette:h,transColor:m,inflateData:b,simpleTransparency:g}).start(),x.process(),n)throw n;let S=Buffer.concat(y);y.length=0;let C;if(d.interlace)C=i.inflateSync(S);else{let e=((d.width*d.bpp*d.depth+7>>3)+1)*d.height;C=a(S,{chunkSize:e,maxLength:e})}if(S=null,!C||!C.length)throw Error(`bad png - invalid inflate data response`);let w=s.process(C,d);S=null;let T=l.dataToBitMap(w,d);w=null;let E=p(T,d,t.skipRescale);return d.data=E,d.gamma=_||0,d}})),S=t(((t,n)=>{let r=!0,i=e(`zlib`);i.deflateSync||(r=!1);let a=c(),o=g();n.exports=function(e,t){if(!r)throw Error(`To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0`);let n=new o(t||{}),s=[];s.push(Buffer.from(a.PNG_SIGNATURE)),s.push(n.packIHDR(e.width,e.height)),e.gamma&&s.push(n.packGAMA(e.gamma));let c=n.filterData(e.data,e.width,e.height),l=i.deflateSync(c,n.getDeflateOptions());if(c=null,!l||!l.length)throw Error(`bad png - invalid compressed data response`);return s.push(n.packIDAT(l)),s.push(n.packIEND()),Buffer.concat(s)}})),C=t((e=>{let t=x(),n=S();e.read=function(e,n){return t(e,n||{})},e.write=function(e,t){return n(e,t)}})),w=t((t=>{let n=e(`util`),r=e(`stream`),i=p(),a=_(),o=C(),s=t.PNG=function(e){r.call(this),e||={},this.width=e.width|0,this.height=e.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new i(e),this._parser.on(`error`,this.emit.bind(this,`error`)),this._parser.on(`close`,this._handleClose.bind(this)),this._parser.on(`metadata`,this._metadata.bind(this)),this._parser.on(`gamma`,this._gamma.bind(this)),this._parser.on(`parsed`,function(e){this.data=e,this.emit(`parsed`,e)}.bind(this)),this._packer=new a(e),this._packer.on(`data`,this.emit.bind(this,`data`)),this._packer.on(`end`,this.emit.bind(this,`end`)),this._parser.on(`close`,this._handleClose.bind(this)),this._packer.on(`error`,this.emit.bind(this,`error`))};n.inherits(s,r),s.sync=o,s.prototype.pack=function(){return!this.data||!this.data.length?(this.emit(`error`,`No data provided`),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)},s.prototype.parse=function(e,t){if(t){let e,n;e=function(e){this.removeListener(`error`,n),this.data=e,t(null,this)}.bind(this),n=function(n){this.removeListener(`parsed`,e),t(n,null)}.bind(this),this.once(`parsed`,e),this.once(`error`,n)}return this.end(e),this},s.prototype.write=function(e){return this._parser.write(e),!0},s.prototype.end=function(e){this._parser.end(e)},s.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit(`metadata`,e)},s.prototype._gamma=function(e){this.gamma=e},s.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit(`close`)},s.bitblt=function(e,t,n,r,i,a,o,s){if(n|=0,r|=0,i|=0,a|=0,o|=0,s|=0,n>e.width||r>e.height||n+i>e.width||r+a>e.height)throw Error(`bitblt reading outside image`);if(o>t.width||s>t.height||o+i>t.width||s+a>t.height)throw Error(`bitblt writing outside image`);for(let c=0;c<a;c++)e.data.copy(t.data,(s+c)*t.width+o<<2,(r+c)*e.width+n<<2,(r+c)*e.width+n+i<<2)},s.prototype.bitblt=function(e,t,n,r,i,a,o){return s.bitblt(this,e,t,n,r,i,a,o),this},s.adjustGamma=function(e){if(e.gamma){for(let t=0;t<e.height;t++)for(let n=0;n<e.width;n++){let r=e.width*t+n<<2;for(let t=0;t<3;t++){let n=e.data[r+t]/255;n**=1/2.2/e.gamma,e.data[r+t]=Math.round(n*255)}}e.gamma=0}},s.prototype.adjustGamma=function(){s.adjustGamma(this)}}))();const T=Buffer.from([137,80,78,71,13,10,26,10]);function E(e){return e.subarray(0,T.length).equals(T)}function D(e,t){try{return w.PNG.sync.read(e)}catch(e){throw new n(`COMMAND_FAILED`,`Failed to decode ${t} as PNG`,{label:t,reason:e instanceof Error?e.message:String(e)})}}const O=.78,k={r:220,g:0,b:0};function A(e){let{baselineData:t,currentData:n,maxColorDistance:r}=e,i=e.width*e.height,a=Buffer.alloc(i*4),o=new Uint8Array(i),s=0;for(let e=0,i=0;e<t.length;e+=4,i+=1){let c=t[e]-n[e],l=t[e+1]-n[e+1],u=t[e+2]-n[e+2];if(Math.sqrt(c**2+l**2+u**2)>r){s+=1,o[i]=1;let t=j(n,e);a[e]=M(t,k.r,O),a[e+1]=M(t,k.g,O),a[e+2]=M(t,k.b,O),a[e+3]=255;continue}let d=j(n,e);a[e]=d,a[e+1]=d,a[e+2]=d,a[e+3]=255}return{diffData:a,diffMask:o,differentPixels:s}}function j(e,t){return M(Math.round(e[t]*.299+e[t+1]*.587+e[t+2]*.114),255,.72)}function M(e,t,n){return Math.round(e*(1-n)+t*n)}function N(e,t){let n={first:{width:e.width,height:e.height,dataLength:e.data.length},second:{width:t.width,height:t.height,dataLength:t.data.length}};if(e.width!==t.width||e.height!==t.height)return{...n,status:`dimension_mismatch`};let r=e.width*e.height;if(e.data.length!==t.data.length||e.data.length!==r*4)return{...n,status:`data_length_mismatch`};let i=0;for(let n=0;n<e.data.length;n+=4)i+=Math.abs(e.data[n]-t.data[n]),i+=Math.abs(e.data[n+1]-t.data[n+1]),i+=Math.abs(e.data[n+2]-t.data[n+2]);return{...n,status:`compared`,differencePercent:100*i/(765*r)}}function P(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}export{E as a,D as i,N as n,w as o,A as r,P as t};
@@ -1 +1 @@
1
- import{exitAfterFlush as e}from"./process-exit.js";async function t(t,n=async()=>await import(`./cli.js`)){let{runCli:r}=await n();return await r(t),await e(0)}export{t as runCliProcess};
1
+ import{exitAfterFlush as e}from"./process-exit.js";async function t(t,n=async()=>await import(`./cli.js`).then(e=>e.t)){let{runCli:r}=await n();return await r(t),await e(0)}export{t as runCliProcess};
@@ -1 +1 @@
1
- import{t as e}from"./timeouts.js";import"./retry.js";async function t(t){await Promise.race([n(),e(2e3)]),process.exit(t)}async function n(){await Promise.all([r(process.stdout),r(process.stderr)])}function r(e){return e.writableLength===0?Promise.resolve():new Promise(t=>{e.once(`drain`,t)})}export{t as exitAfterFlush};
1
+ import{i as e}from"./retry.js";import"./retry2.js";async function t(t){await Promise.race([n(),e(2e3)]),process.exit(t)}async function n(){await Promise.all([r(process.stdout),r(process.stderr)])}function r(e){return e.writableLength===0?Promise.resolve():new Promise(t=>{e.once(`drain`,t)})}export{t as exitAfterFlush};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime.js";import{C as t,D as n,E as r,M as i,O as a,S as o,T as ee,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,k as g,l as _,m as v,n as y,o as b,p as x,r as S,s as te,t as ne,u as re,v as ie,w as C,x as w,y as T}from"./owner-identity.js";import{h as E}from"./exec.js";import D from"node:fs";import O from"node:path";async function k(e,t={}){let n=j(),r=M(t);for(let t of e.read()){if(!A(t))continue;let i=await N(t,r,n);i.length===0?e.clear(t.scope):i.length!==t.records.length&&e.replace(t.scope,i)}return Object.freeze(n)}function A(e){return e.status===`decoded`}function j(){return{inspected:0,inspectedPids:[],terminated:0,terminatedPids:[],missing:0,missingPids:[],ownershipLost:0,ownershipLostPids:[],skippedForOpenWebSession:!1}}function M(e){return{openWebSession:(e.openWebSessionNames??[]).length>0,purposes:e.purposes?new Set(e.purposes):void 0,termTimeoutMs:e.termTimeoutMs??1500,killTimeoutMs:e.killTimeoutMs??1e3}}async function N(e,t,n){let r=[];for(let i of e.records){if(P(e.scope.kind,i,t)){r.push(i),I(e.scope.kind,i,t)&&(n.skippedForOpenWebSession=!0);continue}n.inspected+=1,n.inspectedPids.push(i.pid),L(n,i,await ae(i,t),r)}return r}function P(e,t,n){return!F(t,n)||I(e,t,n)}function F(e,t){return t.purposes===void 0||t.purposes.has(e.purpose)}function I(e,t,n){return e===`daemon`&&t.purpose===`managed-web-browser`&&n.openWebSession}function L(e,t,n,r){if(n===`terminated`){e.terminated+=1,e.terminatedPids.push(t.pid);return}if(n===`missing`){e.missing+=1,e.missingPids.push(t.pid);return}e.ownershipLost+=1,e.ownershipLostPids.push(t.pid),r.push(t)}async function ae(e,t){let n=R(e);return n===void 0?(U(e.pid,z(e)),await B(e,t)):n}function R(e){return e.pid===process.pid||!v(e.pid)||p(e.pid)?`missing`:H(e)?void 0:`ownership-lost`}function z(e){return e.purpose===`simctl-screen-recording`?`SIGINT`:`SIGTERM`}async function B(e,t){let n=await V(e,t.termTimeoutMs);return n===`exited`?`terminated`:n===`ownership-lost`?`ownership-lost`:(U(e.pid,`SIGKILL`),await V(e,t.killTimeoutMs)===`exited`?`terminated`:`ownership-lost`)}async function V(e,t){return await a(e.pid,t),!v(e.pid)||p(e.pid)?`exited`:H(e)?`owned-alive`:`ownership-lost`}function H(e){return C(e.pid)===e.startTime&&o(e.pid)===e.command}function U(e,t){try{process.kill(e,t)}catch{}}const W=`owned-processes.json`;function G(e){let t=O.resolve(e.stateDir),n=O.resolve(e.sessionsDir),r=O.join(t,W),a=t=>{if(t.kind===`daemon`)return r;let i=O.resolve(e.resolveSessionDir(t.sessionId));if(O.dirname(i)!==n)throw TypeError(`owned process session scope must resolve directly under the sessions dir`);return O.join(i,W)};return Object.freeze({replace(e,t){let n=J(t),r=a(e);if(n.length===0){Y(r);return}let o=O.dirname(r);D.mkdirSync(o,{recursive:!0}),i(r,e=>{let t=D.openSync(e,`wx`,384);try{D.writeFileSync(t,`${JSON.stringify({version:1,processes:n})}\n`,`utf8`),D.fsyncSync(t)}finally{D.closeSync(t)}X(r),D.renameSync(e,r)})},clear(e){Y(a(e))},read(){return q(n,r)}})}function K(e,t){let n;try{X(e),n=JSON.parse(D.readFileSync(e,`utf8`))}catch(n){return{scope:t,path:e,status:`invalid`,records:[],message:$(n)}}if(!se(n))return{scope:t,path:e,status:`invalid`,records:[],message:`owned process record must contain version 1 and a processes array`};try{return{scope:t,path:e,status:`decoded`,records:J(n.processes)}}catch(n){return{scope:t,path:e,status:`invalid`,records:[],message:$(n)}}}function q(e,t){let n=[];if(Z(t)&&n.push(K(t,{kind:`daemon`})),!D.existsSync(e))return n;for(let t of D.readdirSync(e,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name))){if(!t.isDirectory())continue;let r=O.join(e,t.name,W);Z(r)&&n.push(K(r,{kind:`session`,sessionId:t.name}))}return n}function J(e){let t=new Set,n=[];for(let r of e){if(!oe(r))throw TypeError(`owned process record has an invalid identity or purpose`);if(t.has(r.pid))throw TypeError(`duplicate owned process pid ${r.pid}`);t.add(r.pid),n.push(Object.freeze({pid:r.pid,startTime:r.startTime,command:r.command,purpose:r.purpose}))}return n.sort((e,t)=>e.pid-t.pid)}function oe(e){return Number.isInteger(e.pid)&&e.pid>0&&typeof e.startTime==`string`&&e.startTime.length>0&&typeof e.command==`string`&&e.command.length>0&&typeof e.purpose==`string`&&e.purpose.length>0}function se(e){return typeof e==`object`&&!!e&&`version`in e&&e.version===1&&`processes`in e&&Array.isArray(e.processes)}function Y(e){try{X(e),D.unlinkSync(e)}catch(e){if(!Q(e))throw e}}function X(e){try{let t=D.lstatSync(e);if(t.isSymbolicLink())throw Error(`Refusing to follow an owned process record symlink`);if(!t.isFile())throw Error(`Owned process record is not a regular file`)}catch(e){if(!Q(e))throw e}}function Z(e){try{return D.lstatSync(e).isFile()}catch{return!1}}function Q(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`)}function $(e){return e instanceof Error?e.message:`owned process record is invalid`}var ce=e({classifyOwnerLiveness:()=>ne,classifyOwnerLivenessFromObservation:()=>y,createOwnedProcessRecordStore:()=>G,expandProcessTree:()=>te,hostCurrentWorkingDirectory:()=>u,hostEnvironment:()=>_,hostNodeExecutablePath:()=>re,hostNodeVersion:()=>d,hostPlatform:()=>f,hostProcessId:()=>x,isProcessAlive:()=>v,isProcessGroupAlive:()=>m,isProcessPid:()=>S,isProcessZombie:()=>p,listHostProcesses:()=>s,ownerIdentityDiffers:()=>h,ownerIdentityMatches:()=>c,readCurrentOwnerIdentity:()=>b,readHostCpuArch:()=>ie,readHostCpuArchSync:()=>T,readHostEnvironmentVariable:()=>l,readHostProcessIdentityObservations:()=>w,readOwnedProcessRecordFile:()=>K,readProcessCommand:()=>o,readProcessIdentityFacts:()=>t,readProcessStartTime:()=>C,reapOwnedProcessRecordsAtStartup:()=>k,signalPidsBestEffort:()=>ee,signalProcessGroupBestEffort:()=>E,stopPidsWithEscalation:()=>r,uniquePositivePids:()=>n,waitForProcessExit:()=>a,writeHostStderr:()=>g});export{G as n,k as r,ce as t};
1
+ import{r as e}from"./rolldown-runtime.js";import{A as t,B as n,C as r,D as i,E as a,M as o,N as s,O as c,P as l,S as u,T as d,_ as f,b as ee,c as p,d as m,f as h,g,h as _,j as v,k as y,l as b,m as x,o as S,p as te,s as ne,u as re,v as ie,w as C,x as w,y as T}from"./file.js";import{h as E}from"./exec.js";import D from"node:fs";import O from"node:path";async function k(e,t={}){let n=j(),r=M(t);for(let t of e.read()){if(!A(t))continue;let i=await N(t,r,n);i.length===0?e.clear(t.scope):i.length!==t.records.length&&e.replace(t.scope,i)}return Object.freeze(n)}function A(e){return e.status===`decoded`}function j(){return{inspected:0,inspectedPids:[],terminated:0,terminatedPids:[],missing:0,missingPids:[],ownershipLost:0,ownershipLostPids:[],skippedForOpenWebSession:!1}}function M(e){return{openWebSession:(e.openWebSessionNames??[]).length>0,purposes:e.purposes?new Set(e.purposes):void 0,termTimeoutMs:e.termTimeoutMs??1500,killTimeoutMs:e.killTimeoutMs??1e3}}async function N(e,t,n){let r=[];for(let i of e.records){if(P(e.scope.kind,i,t)){r.push(i),I(e.scope.kind,i,t)&&(n.skippedForOpenWebSession=!0);continue}n.inspected+=1,n.inspectedPids.push(i.pid),L(n,i,await ae(i,t),r)}return r}function P(e,t,n){return!F(t,n)||I(e,t,n)}function F(e,t){return t.purposes===void 0||t.purposes.has(e.purpose)}function I(e,t,n){return e===`daemon`&&t.purpose===`managed-web-browser`&&n.openWebSession}function L(e,t,n,r){if(n===`terminated`){e.terminated+=1,e.terminatedPids.push(t.pid);return}if(n===`missing`){e.missing+=1,e.missingPids.push(t.pid);return}e.ownershipLost+=1,e.ownershipLostPids.push(t.pid),r.push(t)}async function ae(e,t){let n=await R(e);return n===void 0?(U(e.pid,z(e)),await B(e,t)):n}async function R(e){if(e.pid===process.pid||!T(e.pid))return`missing`;let t=await c(e.pid);return t.zombie?`missing`:H(e,t)?void 0:`ownership-lost`}function z(e){return e.purpose===`simctl-screen-recording`?`SIGINT`:`SIGTERM`}async function B(e,t){let n=await V(e,t.termTimeoutMs);return n===`exited`?`terminated`:n===`ownership-lost`?`ownership-lost`:(U(e.pid,`SIGKILL`),await V(e,t.killTimeoutMs)===`exited`?`terminated`:`ownership-lost`)}async function V(e,t){if(await s(e.pid,t),!T(e.pid))return`exited`;let n=await c(e.pid);return n.zombie?`exited`:H(e,n)?`owned-alive`:`ownership-lost`}function H(e,t){return t.startTime===e.startTime&&t.command===e.command}function U(e,t){try{process.kill(e,t)}catch{}}const W=`owned-processes.json`;function G(e){let t=O.resolve(e.stateDir),r=O.resolve(e.sessionsDir),i=O.join(t,W),a=t=>{if(t.kind===`daemon`)return i;let n=O.resolve(e.resolveSessionDir(t.sessionId));if(O.dirname(n)!==r)throw TypeError(`owned process session scope must resolve directly under the sessions dir`);return O.join(n,W)};return Object.freeze({replace(e,t){let r=J(t),i=a(e);if(r.length===0){Y(i);return}let o=O.dirname(i);D.mkdirSync(o,{recursive:!0}),n(i,e=>{let t=D.openSync(e,`wx`,384);try{D.writeFileSync(t,`${JSON.stringify({version:1,processes:r})}\n`,`utf8`),D.fsyncSync(t)}finally{D.closeSync(t)}X(i),D.renameSync(e,i)})},clear(e){Y(a(e))},read(){return q(r,i)}})}function K(e,t){let n;try{X(e),n=JSON.parse(D.readFileSync(e,`utf8`))}catch(n){return{scope:t,path:e,status:`invalid`,records:[],message:$(n)}}if(!se(n))return{scope:t,path:e,status:`invalid`,records:[],message:`owned process record must contain version 1 and a processes array`};try{return{scope:t,path:e,status:`decoded`,records:J(n.processes)}}catch(n){return{scope:t,path:e,status:`invalid`,records:[],message:$(n)}}}function q(e,t){let n=[];if(Z(t)&&n.push(K(t,{kind:`daemon`})),!D.existsSync(e))return n;for(let t of D.readdirSync(e,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name))){if(!t.isDirectory())continue;let r=O.join(e,t.name,W);Z(r)&&n.push(K(r,{kind:`session`,sessionId:t.name}))}return n}function J(e){let t=new Set,n=[];for(let r of e){if(!oe(r))throw TypeError(`owned process record has an invalid identity or purpose`);if(t.has(r.pid))throw TypeError(`duplicate owned process pid ${r.pid}`);t.add(r.pid),n.push(Object.freeze({pid:r.pid,startTime:r.startTime,command:r.command,purpose:r.purpose}))}return n.sort((e,t)=>e.pid-t.pid)}function oe(e){return Number.isInteger(e.pid)&&e.pid>0&&typeof e.startTime==`string`&&e.startTime.length>0&&typeof e.command==`string`&&e.command.length>0&&typeof e.purpose==`string`&&e.purpose.length>0}function se(e){return typeof e==`object`&&!!e&&`version`in e&&e.version===1&&`processes`in e&&Array.isArray(e.processes)}function Y(e){try{X(e),D.unlinkSync(e)}catch(e){if(!Q(e))throw e}}function X(e){try{let t=D.lstatSync(e);if(t.isSymbolicLink())throw Error(`Refusing to follow an owned process record symlink`);if(!t.isFile())throw Error(`Owned process record is not a regular file`)}catch(e){if(!Q(e))throw e}}function Z(e){try{return D.lstatSync(e).isFile()}catch{return!1}}function Q(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`)}function $(e){return e instanceof Error?e.message:`owned process record is invalid`}var ce=e({classifyOwnerLiveness:()=>S,classifyOwnerLivenessFromObservation:()=>ne,createOwnedProcessRecordStore:()=>G,expandProcessTree:()=>h,hostCurrentWorkingDirectory:()=>te,hostEnvironment:()=>x,hostNodeExecutablePath:()=>_,hostNodeVersion:()=>g,hostPlatform:()=>f,hostProcessId:()=>ie,isProcessAlive:()=>T,isProcessGroupAlive:()=>ee,isProcessPid:()=>p,isProcessZombie:()=>w,listHostProcesses:()=>u,ownerIdentityDiffers:()=>b,ownerIdentityMatches:()=>re,readCurrentOwnerIdentity:()=>m,readHostCpuArch:()=>r,readHostCpuArchSync:()=>C,readHostEnvironmentVariable:()=>d,readHostProcessIdentityObservations:()=>a,readOwnedProcessRecordFile:()=>K,readProcessCommand:()=>i,readProcessIdentityFacts:()=>c,readProcessStartTime:()=>y,reapOwnedProcessRecordsAtStartup:()=>k,signalPidsBestEffort:()=>t,signalProcessGroupBestEffort:()=>E,stopPidsWithEscalation:()=>v,uniquePositivePids:()=>o,waitForProcessExit:()=>s,writeHostStderr:()=>l});export{G as n,k as r,ce as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime.js";import{n as t,o as n,t as r}from"./providers.js";import{r as i}from"./provider-limrun-credentials.js";import a from"node:crypto";var o=e({providerCredentialFingerprint:()=>c,readDaemonProviderCredentials:()=>l});const s=new Map([[`limrun`,i],[t.browserStack,e=>{let{username:t,accessKey:i}=n(e);return{[r.username]:t,[r.accessKey]:i}}]]);function c(e,t,n){let r=s.get(e);return r?u(r(t,n)):void 0}function l(e,t){let n={...e};return{fingerprint:(e,t)=>c(e,n,t),stateDir:t}}function u(e){let t=Object.entries(e).filter(e=>e[1]!==void 0).sort(([e],[t])=>e.localeCompare(t));if(t.length!==0)return`v1:${a.createHash(`sha256`).update(JSON.stringify(t)).digest(`hex`).slice(0,16)}`}export{l as n,o as t};
1
+ import{r as e}from"./rolldown-runtime.js";import{d as t,i as n,n as r}from"./store.js";import{r as i}from"./provider-limrun-credentials.js";import a from"node:crypto";var o=e({providerCredentialFingerprint:()=>c,readDaemonProviderCredentials:()=>u});const s=new Map([[`limrun`,i]]);function c(e,t,n){let r=s.get(e);if(r)return d(r(t,n));let i=l(e,t);return i?d(Object.fromEntries(i.map(e=>[e,t[e]?.trim()?t[e]:void 0]))):void 0}function l(e,i){return n.includes(e)?t(e)?.credentialVariables:r(i).find(t=>t.agentDevicePlugin.provider===e)?.agentDevicePlugin.credentialVariables}function u(e,t){let n={...e};return{fingerprint:(e,t)=>c(e,n,t),stateDir:t}}function d(e){let t=Object.entries(e).filter(e=>e[1]!==void 0).sort(([e],[t])=>e.localeCompare(t));if(t.length!==0)return`v1:${a.createHash(`sha256`).update(JSON.stringify(t)).digest(`hex`).slice(0,16)}`}export{u as n,o as t};
@@ -1 +1 @@
1
- import{P as e}from"./sdk-contracts.js";import{mn as t}from"./sdk-batch.js";import{t as n}from"./script.js";import{t as r}from"./session-paths.js";const i=/^\$\{([A-Z_][A-Z0-9_]*)\}$/;function a(t){if(t!==t.trim()||!n.test(t))throw new e(`INVALID_ARGS`,`Invalid --record-as variable "${t}": use uppercase letters, digits, and underscores (for example PASSWORD).`);if(t.startsWith(`AD_`))throw new e(`INVALID_ARGS`,`Invalid --record-as variable "${t}": the AD_* namespace is reserved for built-in replay variables.`);return t}function o(e){return`\${${e}}`}function ee(e){let t=i.exec(e);if(!(!t?.[1]||t[1].startsWith(`AD_`)))return t[1]}function s(e){let t=e.result?.text;if(typeof t==`string`)return t;let n=e.positionals??[];return n.length===0?``:n[0]?.startsWith(`@`)?n.length>=3?n.slice(2).join(` `):n.slice(1).join(` `):n.length>=3&&!Number.isNaN(Number(n[0]))&&!Number.isNaN(Number(n[1]))?n.slice(2).join(` `):n.slice(1).join(` `)}const c={kind:`none`};function l(e,t){if(t.path===void 0){let n=e??{kind:`default`,force:!1};return t.force?{...n,force:!0}:n}let n=e?.force===!0&&(e.kind==="default"||e.path===t.path);return{kind:`explicit`,path:t.path,force:t.force||n}}function te(e){return e.kind===`repair`?{...e,status:`armed`}:e}function u(e){return e.kind===`none`?void 0:e.target}function d(e){return e.kind===`repair`&&(e.status===`complete`||e.status===`close-succeeded`)}function f(e){return e.kind===`authoring`&&e.status===`aborted`}function p(e){return e.kind===`authoring`?e.status===`armed`:e.kind===`repair`}function m(e){return e.kind===`repair`?e.status===`committed`:e.kind===`authoring`&&e.status===`published`}function h(e){return{kind:`authoring`,status:`armed`,target:l(void 0,e)}}function g(e){return e.kind!==`authoring`||e.status!==`armed`?e:{...e,status:`aborted`}}function _(e,t){return e.kind===`authoring`?{kind:`authoring`,status:`published`,target:{kind:`explicit`,path:t,force:e.target.force}}:e}function v(e,t){let n=e.kind===`repair`?e:void 0,r=n?.sourcePath??t.sourcePath;return{kind:`repair`,status:n?.status??`armed`,target:l(n?.target,t.requested),boundary:n?.boundary??t.boundary,...r===void 0?{}:{sourcePath:r},...n?.closeReceipt===void 0?{}:{closeReceipt:n.closeReceipt}}}function y(e){return e.kind!==`repair`||e.status!==`armed`?e:{...e,status:`complete`}}function b(e,t){return e.kind===`repair`?{...e,status:e.status===`complete`?`close-succeeded`:e.status,closeReceipt:t}:e}function ne(e){if(e.kind!==`repair`)return e;let{closeReceipt:t,...n}=e;return{...n,status:`committed`}}function re(e){if(e.kind!==`repair`)return e;let{closeReceipt:t,...n}=e;return{...n,status:`aborted`}}function ie(e){return e.kind===`repair`?e.boundary:void 0}function ae(e){return e.kind===`repair`?e.sourcePath:void 0}function x(e){return e.kind===`repair`&&e.status!==`committed`}function S(e){let t=u(e);return t?.kind===`explicit`?t.path:void 0}function C(e){return u(e)?.force===!0}function w(e){return e?.scriptPublication??c}function T(e){let t=w(e);return t.kind===`authoring`&&t.status===`armed`}function E(e,t){e.scriptPublication=h({path:t.path===void 0?void 0:r(t.path),force:t.force===!0})}function D(e){e.scriptPublication=g(w(e))}function O(e){return p(w(e))}function k(e,t){if(!t.saveScript||f(w(e)))return;let n={path:typeof t.saveScript==`string`?r(t.saveScript):void 0,force:t.force===!0},i=w(e);if(i.kind===`repair`){e.scriptPublication=v(i,{requested:n,boundary:i.boundary,sourcePath:i.sourcePath});return}if(i.kind===`authoring`){e.scriptPublication={...i,target:l(i.target,n)};return}e.scriptPublication=h(n)}function A(e,t){let n=w(e);n.kind===`authoring`&&(e.scriptPublication={...n,target:l(n.target,{path:t.explicitPath===void 0?void 0:r(t.explicitPath),force:t.liveForce===!0})})}function j(e,t){e.scriptPublication=_(w(e),t)}function M(e,t){let n=w(e);n.kind===`authoring`&&(e.scriptPublication=_(n,t))}function N(e,t){return t===!0||C(w(e))}function P(e){return m(w(e))}const F=new Set(`action.backend.cost.delayMs.evidence.gesture.hint.kind.maestroFallbackReason.maestroNonHittableCoordinateFallbackAllowed.maestroNonHittableCoordinateFallbackUsed.message.platform.ref.referenceHeight.referenceWidth.refLabel.resolution.selector.selectorChain.settle.targetHittable.targetKind.text.warning.x.y`.split(`.`)),I=new Set([`action`,`backend`,`gesture`,`kind`,`platform`,`ref`,`selector`,`targetKind`]),L=new Set([`cost`,`evidence`,`resolution`,`settle`]),R=new Map([[`cost`,new Set([`nodeCount`,`runnerRoundTrips`,`wallClockMs`])],[`evidence`,new Set([`changedFromBefore`,`digest`,`foregroundApp`,`interactiveNodeCount`,`nodeCount`])],[`resolution`,new Set([`alternatives`,`kind`,`matchCount`,`phase`,`source`,`tiebreak`,`winnerDiagnostic`])],[`resolution.alternatives`,new Set([`diagnosticRef`,`label`,`role`])],[`resolution.winnerDiagnostic`,new Set([`diagnosticRef`,`label`,`role`])],[`settle`,new Set([`captures`,`diff`,`hint`,`quietMs`,`refs`,`refsGeneration`,`settled`,`tail`,`tailTruncated`,`timeoutMs`,`waitedMs`])],[`settle.diff`,new Set([`lines`,`summary`,`truncated`])],[`settle.diff.lines`,new Set([`kind`,`ref`,`text`])],[`settle.diff.summary`,new Set([`additions`,`removals`,`unchanged`])],[`settle.refs`,new Set([`ref`])],[`settle.tail`,new Set([`label`,`ref`,`role`])]]),z=new Set([`evidence.digest`,`evidence.foregroundApp`,`resolution.alternatives.diagnosticRef`,`resolution.alternatives.role`,`resolution.kind`,`resolution.phase`,`resolution.source`,`resolution.tiebreak`,`resolution.winnerDiagnostic.diagnosticRef`,`resolution.winnerDiagnostic.role`,`settle.diff.lines.kind`,`settle.diff.lines.ref`,`settle.refs.ref`,`settle.tail.ref`,`settle.tail.role`]);function oe(e,t,n){if(!e)return e;let r=ue(e.selectorChain),i=e=>K(e,t);return{...q(e,e=>le(e,t,n),i),...typeof e.text==`string`?{text:n}:{},...r?{selectorChain:r.filter(e=>!i(e))}:{}}}function B(e,t){if(!e)return e;let n=X(t);return q(e,e=>Z(e,n),e=>W(e,t))}function V(e,t){if(!e)return e;let n=X(t);return{...e,...e.label===void 0?{}:{label:Z(e.label,n)},ancestry:e.ancestry.map(e=>({...e,...e.label===void 0?{}:{label:Z(e.label,n)}})),...e.scrollRegion?{scrollRegion:{...e.scrollRegion,...e.scrollRegion.label===void 0?{}:{label:Z(e.scrollRegion.label,n)}}}:{}}}function H(e,t){return!!(e.label!==void 0&&U(e.label,t)||e.ancestry.some(e=>e.label&&U(e.label,t))||e.scrollRegion?.label&&U(e.scrollRegion.label,t))}function U(e,t){for(let n of t.keys())if(e.includes(n))return!0;return!1}function W(e,t){for(let n of t.keys())if(K(e,n))return!0;return!1}function G(e,t,n){return!e||!t?e:{...e,...e.label===t?{label:n}:{},ancestry:e.ancestry.map(e=>({...e,...e.label===t?{label:n}:{}})),...e.scrollRegion?{scrollRegion:{...e.scrollRegion,...e.scrollRegion.label===t?{label:n}:{}}}:{}}}function K(e,n){return t(e,n)}function q(e,t,n){return Object.fromEntries(Object.entries(e).map(([e,r])=>[F.has(e)?e:t(e),se(r,e,t,n)]))}function se(e,t,n,r){return typeof e==`string`&&I.has(t)?e:t===`selectorChain`&&Q(e)?ce(e,r):J(e,n,r,L.has(t)?t:void 0)}function J(e,t,n,r){if(typeof e==`string`)return r&&z.has(r)?e:t(e);if(Array.isArray(e))return e.map(e=>J(e,t,n,r));if(!e||typeof e!=`object`)return e;let i=r?R.get(r):void 0;return Object.fromEntries(Object.entries(e).map(([e,a])=>{let o=i?.has(e)===!0;return[o?e:t(e),J(a,t,n,o?`${r}.${e}`:void 0)]}))}function ce(e,t){return e.filter(e=>!t(e))}function le(e,t,n){if(!t)return e;let r=n?e.split(n):[e];return r.every(e=>!e.includes(t))?e:t.trim()?r.map(e=>e.replaceAll(t,n)).join(n):n}const Y=/\$\{[A-Z_][A-Z0-9_]*\}/y;function X(e){return[...e].sort(([e],[t])=>t.length-e.length)}function Z(e,t){if(!e||t.length===0)return e;let n=``,r=0;scan:for(;r<e.length;){for(let[i,a]of t)if(e.startsWith(i,r)){n+=a,r+=i.length;continue scan}if(e[r]===`$`){Y.lastIndex=r;let t=Y.exec(e);if(t){n+=t[0],r+=t[0].length;continue}}n+=e[r],r+=1}return n}function Q(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function ue(e){return Q(e)?e:void 0}let $={isActive:()=>!1};function de(e){$=e}function fe(e){return $.isActive(e)}export{C as A,p as C,b as D,y as E,a as F,s as M,ee as N,ie as O,o as P,te as S,x as T,A as _,B as a,v as b,D as c,N as d,T as f,M as g,j as h,G as i,S as j,ae as k,k as l,P as m,fe as n,V as o,O as p,oe as r,H as s,de as t,E as u,c as v,d as w,ne as x,re as y};
1
+ let e={isActive:()=>!1};function t(t){e=t}function n(t){return e.isActive(t)}export{n,t};