@swmansion/argent 0.34.1-next.42 → 0.34.1-next.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli-cmds.mjs CHANGED
@@ -36259,7 +36259,7 @@ function isCi(env = process.env) {
36259
36259
  var SESSION_ID2 = randomUUID5();
36260
36260
  function readCliVersion() {
36261
36261
  if (true) {
36262
- return "0.34.1-next.42";
36262
+ return "0.34.1-next.44";
36263
36263
  }
36264
36264
  return "0.0.0";
36265
36265
  }
@@ -16945,7 +16945,7 @@ function isCi(env = process.env) {
16945
16945
  var SESSION_ID = randomUUID4();
16946
16946
  function readCliVersion() {
16947
16947
  if (true) {
16948
- return "0.34.1-next.42";
16948
+ return "0.34.1-next.44";
16949
16949
  }
16950
16950
  return "0.0.0";
16951
16951
  }
@@ -38,6 +38,7 @@
38
38
  </BuildAction>
39
39
  <TestAction
40
40
  buildConfiguration = "Debug"
41
+ preferredScreenCaptureFormat = "screenshots"
41
42
  selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
42
43
  selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43
44
  shouldUseLaunchSchemeArgsEnv = "YES">
@@ -112,6 +112,9 @@ final class ArgentRunnerSession: XCTestCase {
112
112
  finishLock.unlock()
113
113
 
114
114
  let server = RunnerHTTPServer(
115
+ tunnelAddress: ProcessInfo.processInfo.environment["ARGENT_RUNNER_ADDRESS"].flatMap {
116
+ $0.isEmpty ? nil : $0
117
+ },
115
118
  dispatch: { [weak self] body, deliver in
116
119
  self?.dispatch(body: body, deliver: deliver)
117
120
  },
@@ -4,10 +4,8 @@ import Network
4
4
  /// Minimal single-purpose HTTP/1.1 endpoint on NWListener: each connection
5
5
  /// carries one POSTed JSON command and receives one JSON reply, then closes.
6
6
  ///
7
- /// The listener is unauthenticated, so it binds loopback-only. The host
8
- /// reaches the runner through a usbmux forwarded stream that terminates on
9
- /// the device's own loopback. Bodies are opaque bytes handed to the
10
- /// dispatch closure.
7
+ /// USB uses a loopback listener. A CoreDevice connection binds only the
8
+ /// device's tunnel IPv6 address. Access follows the transport's host-level trust.
11
9
  final class RunnerHTTPServer {
12
10
  struct Reply {
13
11
  let status: Int
@@ -35,25 +33,39 @@ final class RunnerHTTPServer {
35
33
  /// interface is unavailable). Carries the failure description.
36
34
  private let onListenerFailure: (String) -> Void
37
35
  private var listener: NWListener?
36
+ private let tunnelAddress: String?
38
37
 
39
38
  init(
39
+ tunnelAddress: String? = nil,
40
40
  dispatch: @escaping (Data, @escaping (Reply) -> Void) -> Void,
41
41
  onFinish: @escaping () -> Void,
42
42
  onListenerFailure: @escaping (String) -> Void
43
43
  ) {
44
+ self.tunnelAddress = tunnelAddress
44
45
  self.dispatch = dispatch
45
46
  self.onFinish = onFinish
46
47
  self.onListenerFailure = onListenerFailure
47
48
  }
48
49
 
49
- /// Starts listening on loopback, on the given port or a system-assigned
50
+ /// Starts listening on the selected interface, on the given port or a system-assigned
50
51
  /// one when the port is 0.
51
52
  func start(port: UInt16) throws {
52
- // Restrict to the loopback interface rather than pinning a 127.0.0.1
53
- // endpoint. The interface restriction admits either address family and
54
- // keeps port-0 auto-assignment and the .port readback working.
55
53
  let parameters = NWParameters.tcp
56
- parameters.requiredInterfaceType = .loopback
54
+ if let address = tunnelAddress {
55
+ guard let ipv6 = IPv6Address(address),
56
+ let prefix = ipv6.rawValue.first, prefix & 0xfe == 0xfc
57
+ else {
58
+ throw NSError(domain: "ArgentRunner", code: 1, userInfo: [
59
+ NSLocalizedDescriptionKey: "Expected a CoreDevice tunnel IPv6 address"
60
+ ])
61
+ }
62
+ // Bind the tunnel only, never Wi-Fi or a wildcard address.
63
+ parameters.requiredLocalEndpoint = .hostPort(
64
+ host: NWEndpoint.Host(address), port: NWEndpoint.Port(rawValue: port)!
65
+ )
66
+ } else {
67
+ parameters.requiredInterfaceType = .loopback
68
+ }
57
69
  let listener: NWListener
58
70
 
59
71
  if port > 0, let nwPort = NWEndpoint.Port(rawValue: port) {
@@ -550,7 +550,7 @@ export interface ArgentToolArgs {
550
550
  port?: number;
551
551
  /** Maximum number of requests to return: the most recent ones, oldest first. 0 returns only the header and the total. On a Mac app it counts events, not requests: one request gives several events. 0 returns no events. */
552
552
  limit?: number;
553
- /** Clear the log after reading. On Android, the IDs of cleared requests still work in view-network-request-details */
553
+ /** Clear the log after reading. On iOS and Android, the IDs of cleared requests still work in view-network-request-details */
554
554
  clear?: boolean;
555
555
  /** Android only: turn native capture off for this app instead of listing. Other apps keep theirs. */
556
556
  stop?: boolean;
@@ -991,9 +991,9 @@ export interface ArgentToolArgs {
991
991
  "view-network-request-details": {
992
992
  /** Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. */
993
993
  port?: number;
994
- /** Device id from list-devices (iOS simulator UDID or Android serial), the same id used with debugger-connect. An android- ID needs no debugger connection. */
994
+ /** Device id from list-devices (iOS simulator UDID or Android serial), the same id used with debugger-connect. An ios- or android- ID needs no debugger connection. */
995
995
  device_id: string;
996
- /** The requestId from view-network-logs, or an android- ID from native-network-logs. */
996
+ /** The requestId from view-network-logs, or an ios- or android- ID from native-network-logs. */
997
997
  requestId: string;
998
998
  /** Whether to include the response body (if captured). */
999
999
  includeBody?: boolean;