peachsim 0.1.1667 → 0.1.1673

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 (178) hide show
  1. package/README.md +1 -1
  2. package/cli/bridge-flow-runner.ts +4 -1
  3. package/cli/commands/coverage-swift.ts +291 -0
  4. package/cli/commands/coverage.ts +168 -24
  5. package/cli/commands/diagnose.ts +1 -19
  6. package/cli/commands/react.ts +3 -18
  7. package/cli/commands/screenshot.ts +1 -1
  8. package/cli/commands/screenshots-capture.ts +1 -1
  9. package/cli/drivers/playwright-provisioning.ts +1 -4
  10. package/cli/drivers/playwright.ts +15 -1
  11. package/cli/scene-video.ts +1 -1
  12. package/cli/ui.ts +20 -0
  13. package/cli/ws-bridge.ts +7 -36
  14. package/detox/frame-identity.cjs +21 -0
  15. package/detox/frame-identity.d.cts +6 -0
  16. package/detox/index.ts +39 -33
  17. package/detox/jest-environment.cjs +4 -1
  18. package/detox/jest-setup-after-env.cjs +0 -4
  19. package/detox/navigation-lifecycle.ts +2 -2
  20. package/detox/proof-observer.ts +126 -0
  21. package/dist-lib/agent-daemon-client.cjs +29 -1
  22. package/dist-lib/agent-events.cjs +1 -1
  23. package/dist-lib/attached-projects.cjs +10 -1
  24. package/dist-lib/auth/shared-session.cjs +1 -1
  25. package/dist-lib/backend-origin.cjs +1 -1
  26. package/dist-lib/beta.cjs +1 -1
  27. package/dist-lib/beta.mjs +1 -1
  28. package/dist-lib/bridge-constants.cjs +1 -1
  29. package/dist-lib/bridge-contract-input.cjs +1 -1
  30. package/dist-lib/bridge-contract-input.mjs +1 -1
  31. package/dist-lib/bridge-contract.cjs +1 -1
  32. package/dist-lib/bridge-contract.mjs +1 -1
  33. package/dist-lib/bundle-channel.cjs +530 -154
  34. package/dist-lib/capture-contract.cjs +1 -1
  35. package/dist-lib/capture-contract.mjs +1 -1
  36. package/dist-lib/cloud-contract.cjs +1 -1
  37. package/dist-lib/cloud-contract.mjs +1 -1
  38. package/dist-lib/cloud-test-args.cjs +1 -1
  39. package/dist-lib/cloud-test-args.mjs +1 -1
  40. package/dist-lib/cloud.cjs +1 -1
  41. package/dist-lib/cloud.mjs +1 -1
  42. package/dist-lib/config.cjs +1 -1
  43. package/dist-lib/config.mjs +1 -1
  44. package/dist-lib/detox/index.cjs +5074 -7353
  45. package/dist-lib/detox/jest-environment.cjs +4 -1
  46. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  47. package/dist-lib/expo-swift-bundle.cjs +578 -151
  48. package/dist-lib/expo-swift-metadata.cjs +1 -1
  49. package/dist-lib/expo-swift-metadata.mjs +1 -1
  50. package/dist-lib/home-paths.cjs +1 -1
  51. package/dist-lib/host/bridge-host.cjs +660 -192
  52. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  53. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  54. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  55. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  56. package/dist-lib/host/websocket-proxy.cjs +1 -1
  57. package/dist-lib/index.cjs +206 -6
  58. package/dist-lib/jump-to-source-babel.cjs +1 -1
  59. package/dist-lib/jump-to-source-native.cjs +1 -1
  60. package/dist-lib/kotlin-host.cjs +1 -1
  61. package/dist-lib/menu.cjs +1 -1
  62. package/dist-lib/menu.mjs +1 -1
  63. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  64. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  65. package/dist-lib/metro-production-bundle.cjs +10 -1
  66. package/dist-lib/metro-production-bundle.mjs +12 -1
  67. package/dist-lib/metro.cjs +155 -5
  68. package/dist-lib/native-app-identity-project.cjs +43 -5
  69. package/dist-lib/native-app-identity-project.mjs +43 -5
  70. package/dist-lib/native-app-identity.cjs +1 -1
  71. package/dist-lib/native-app-identity.mjs +1 -1
  72. package/dist-lib/native-firebase-metadata.cjs +1 -1
  73. package/dist-lib/native-firebase-metadata.mjs +1 -1
  74. package/dist-lib/plist.cjs +1 -1
  75. package/dist-lib/plist.mjs +1 -1
  76. package/dist-lib/profiles.cjs +21 -1
  77. package/dist-lib/public-brand.cjs +1 -1
  78. package/dist-lib/public-origins-lib-esm.json +73 -27
  79. package/dist-lib/public-origins-lib-static.json +1 -1
  80. package/dist-lib/public-origins-lib.json +563 -183
  81. package/dist-lib/react-native-host-modules.cjs +1 -1
  82. package/dist-lib/react-native-host-modules.mjs +1 -1
  83. package/dist-lib/reap-browser.cjs +964 -0
  84. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  85. package/dist-lib/sdk.cjs +1 -1
  86. package/dist-lib/sdk.mjs +1 -1
  87. package/dist-lib/skills.cjs +963 -521
  88. package/dist-lib/swift-compile.cjs +276 -86
  89. package/dist-lib/swift-compile.mjs +276 -86
  90. package/dist-lib/swift-package.cjs +34 -4
  91. package/dist-lib/swift-package.mjs +33 -4
  92. package/dist-lib/swift-submit.cjs +2 -2
  93. package/dist-lib/swift-submit.mjs +2 -2
  94. package/dist-lib/swift-toolchain.cjs +25 -44
  95. package/dist-lib/swift.cjs +1 -1
  96. package/dist-lib/vite-swift.cjs +579 -113
  97. package/dist-lib/vite.cjs +61 -2
  98. package/dist-lib/worklet-executable.cjs +1 -1
  99. package/dist-lib/worklet-executable.mjs +1 -1
  100. package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +7 -0
  101. package/dist-types/packages/peach-engine/src/engine/glass-material.d.ts +1 -1
  102. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -0
  103. package/dist-types/packages/peach-engine/src/engine/inspect-outline.d.ts +2 -1
  104. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
  105. package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +3 -1
  106. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +7 -0
  107. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime-kind.d.ts +24 -0
  108. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +4 -2
  109. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +1 -0
  110. package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +18 -0
  111. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  112. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +1 -0
  113. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  114. package/package.json +1 -1
  115. package/runtime-companion.json +1 -1
  116. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +2 -0
  117. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +36 -0
  118. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStore.h +439 -0
  119. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreCopySpecific.h +216 -0
  120. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreKey.h +267 -0
  121. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetwork.h +204 -0
  122. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkConfiguration.h +1393 -0
  123. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkConnection.h +568 -0
  124. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkReachability.h +369 -0
  125. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferences.h +473 -0
  126. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferencesPath.h +179 -0
  127. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferencesSetSpecific.h +95 -0
  128. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCSchemaDefinitions.h +2395 -0
  129. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SystemConfiguration.h +184 -0
  130. package/sdk/ios/usr/include/libkern/OSByteOrder.h +315 -0
  131. package/sdk/ios/usr/include/libkern/machine/OSByteOrder.h +147 -0
  132. package/src/bridge-contract.ts +42 -0
  133. package/src/chromium-admission.ts +196 -0
  134. package/src/host/bridge-host.ts +6 -43
  135. package/src/launch-deadline.ts +74 -0
  136. package/src/nitro-adapter.lock.json +3 -3
  137. package/src/profiles.ts +21 -0
  138. package/src/react-native-coverage/capability-reference-resolution.ts +402 -0
  139. package/src/react-native-coverage/capability-source-references.ts +1296 -0
  140. package/src/react-native-coverage/native-typescript-parser.ts +74 -0
  141. package/src/react-native-coverage/project-aliases.ts +207 -0
  142. package/src/react-native-coverage/verified-reach.ts +47 -0
  143. package/src/reap-browser.ts +1019 -0
  144. package/src/skills/builtin/a11y-review.ts +1 -1
  145. package/src/skills/builtin/perf-profile.ts +1 -1
  146. package/src/skills/builtin/screenshot-all.ts +1 -1
  147. package/src/skills/builtin/visual-diff.ts +1 -1
  148. package/src/swift-compile.ts +107 -56
  149. package/src/swift-coverage/indexdump.ts +80 -0
  150. package/src/swift-coverage/indexing.ts +147 -0
  151. package/src/swift-coverage/package.ts +230 -0
  152. package/src/swift-coverage/provenance.ts +47 -0
  153. package/src/swift-coverage/reader.ts +81 -0
  154. package/src/swift-coverage/source.ts +252 -0
  155. package/src/swift-coverage/types.ts +58 -0
  156. package/src/swift-coverage/xcode-assets.ts +175 -0
  157. package/src/swift-coverage/xcode-bridging.ts +160 -0
  158. package/src/swift-coverage/xcode-packages.ts +251 -0
  159. package/src/swift-coverage/xcode-strings.ts +78 -0
  160. package/src/swift-coverage/xcode.ts +656 -0
  161. package/src/swift-distribution.lock.json +8 -8
  162. package/src/swift-host.ts +21 -1
  163. package/src/swift-objc-import.ts +191 -27
  164. package/src/swift-objc-standin.ts +4 -2
  165. package/src/swift-package-manifest.ts +134 -13
  166. package/src/swift-package.ts +46 -4
  167. package/src/swift-submit.ts +2 -1
  168. package/src/swift-toolchain.ts +36 -61
  169. package/src/worker-system-chunks.ts +3 -10
  170. package/src/xcode-project.ts +5 -5
  171. package/detox/attempt-events.cjs +0 -914
  172. package/detox/attempt-events.d.cts +0 -113
  173. package/detox/motion-change.cjs +0 -524
  174. package/detox/motion-change.d.cts +0 -140
  175. package/detox/motion-leg-starts.cjs +0 -20
  176. package/detox/motion-leg-starts.d.cts +0 -8
  177. package/detox/proof-frame.cjs +0 -190
  178. package/detox/record-block-execution.cjs +0 -78
@@ -0,0 +1,184 @@
1
+ /*
2
+ * Copyright (c) 2000-2004, 2006, 2008-2010, 2012, 2015, 2017, 2018, 2021 Apple Inc. All rights reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+
24
+ #ifndef _SYSTEMCONFIGURATION_H
25
+ #define _SYSTEMCONFIGURATION_H
26
+
27
+ #include <os/availability.h>
28
+ #include <sys/cdefs.h>
29
+ #include <CoreFoundation/CoreFoundation.h>
30
+
31
+
32
+ /*!
33
+ @header SystemConfiguration
34
+ @discussion The System Configuration framework provides access to the
35
+ data used to configure a running system. The APIs provided
36
+ by this framework communicate with the configd daemon.
37
+
38
+ The configd daemon manages a dynamic store reflecting the
39
+ desired configuration settings as well as the current state
40
+ of the system. The daemon provides a notification mechanism
41
+ for processes that need to be aware of changes made to the
42
+ data. Lastly, the daemon loads a number of bundles (or
43
+ plug-ins) that monitor low-level kernel events and, through
44
+ a set of policy modules, keep the state data up to date.
45
+ */
46
+
47
+ /*!
48
+ @enum Error codes
49
+ @discussion Returned error codes.
50
+ @constant kSCStatusOK Success
51
+ @constant kSCStatusFailed Non-specific Failure
52
+ @constant kSCStatusInvalidArgument Invalid argument
53
+ @constant kSCStatusAccessError Permission denied
54
+ @constant kSCStatusNoKey No such key
55
+ @constant kSCStatusKeyExists Data associated with key already defined
56
+ @constant kSCStatusLocked Lock already held
57
+ @constant kSCStatusNeedLock Lock required for this operation
58
+ @constant kSCStatusNoStoreSession Configuration daemon session not active
59
+ @constant kSCStatusNoStoreServer Configuration daemon not (or no longer) available
60
+ @constant kSCStatusNotifierActive Notifier is currently active
61
+ @constant kSCStatusNoPrefsSession Preferences session not active
62
+ @constant kSCStatusPrefsBusy Preferences update currently in progress
63
+ @constant kSCStatusNoConfigFile Configuration file not found
64
+ @constant kSCStatusNoLink No such link
65
+ @constant kSCStatusStale Write attempted on stale version of object
66
+ @constant kSCStatusMaxLink Maximum link count exceeded
67
+ @constant kSCStatusReachabilityUnknown
68
+ A determination could not be made regarding the reachability
69
+ of the specified nodename or address.
70
+ @constant kSCStatusConnectionNoService Network service for connection not available
71
+ */
72
+ enum {
73
+ /*
74
+ * Generic error codes
75
+ */
76
+ kSCStatusOK = 0, /* Success */
77
+ kSCStatusFailed = 1001, /* Non-specific failure */
78
+ kSCStatusInvalidArgument = 1002, /* Invalid argument */
79
+ kSCStatusAccessError = 1003, /* Permission denied
80
+ - must be root to obtain lock
81
+ - could not create access/create preferences
82
+ */
83
+ kSCStatusNoKey = 1004, /* No such key */
84
+ kSCStatusKeyExists = 1005, /* Key already defined */
85
+ kSCStatusLocked = 1006, /* Lock already held */
86
+ kSCStatusNeedLock = 1007, /* Lock required for this operation */
87
+ /*
88
+ * SCDynamicStore error codes
89
+ */
90
+ kSCStatusNoStoreSession = 2001, /* Configuration daemon session not active */
91
+ kSCStatusNoStoreServer = 2002, /* Configuration daemon not (no longer) available */
92
+ kSCStatusNotifierActive = 2003, /* Notifier is currently active */
93
+ /*
94
+ * SCPreferences error codes
95
+ */
96
+ kSCStatusNoPrefsSession = 3001, /* Preference session not active */
97
+ kSCStatusPrefsBusy = 3002, /* Preferences update currently in progress */
98
+ kSCStatusNoConfigFile = 3003, /* Configuration file not found */
99
+ kSCStatusNoLink = 3004, /* No such link */
100
+ kSCStatusStale = 3005, /* Write attempted on stale version of object */
101
+ kSCStatusMaxLink = 3006, /* Maximum link count exceeded */
102
+ /*
103
+ * SCNetwork error codes
104
+ */
105
+ kSCStatusReachabilityUnknown = 4001, /* Network reachability cannot be determined */
106
+ /*
107
+ * SCNetworkConnection error codes
108
+ */
109
+ kSCStatusConnectionNoService
110
+ API_AVAILABLE(macos(10.6))
111
+ API_UNAVAILABLE(ios, tvos, watchos)
112
+ = 5001, /* Network service for connection not available */
113
+ kSCStatusConnectionIgnore
114
+ API_AVAILABLE(macos(10.9))
115
+ API_UNAVAILABLE(ios, tvos, watchos)
116
+ = 5002, /* Network connection information not available at this time */
117
+ };
118
+
119
+
120
+ /* SCDynamicStore APIs */
121
+ #include <SystemConfiguration/SCDynamicStore.h>
122
+ #include <SystemConfiguration/SCDynamicStoreKey.h>
123
+ #include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
124
+
125
+ /* SCPreferences APIs */
126
+ #include <SystemConfiguration/SCPreferences.h>
127
+ #include <SystemConfiguration/SCPreferencesPath.h>
128
+ #include <SystemConfiguration/SCPreferencesSetSpecific.h>
129
+
130
+ /* Schema Definitions (for SCDynamicStore and SCPreferences) */
131
+ #include <SystemConfiguration/SCSchemaDefinitions.h>
132
+
133
+ /* SCNetworkConfiguration APIs */
134
+ #include <SystemConfiguration/SCNetworkConfiguration.h>
135
+
136
+ /* SCNetworkReachability and SCNetworkConnection APIs */
137
+ #include <SystemConfiguration/SCNetwork.h>
138
+ #include <SystemConfiguration/SCNetworkReachability.h>
139
+ #include <SystemConfiguration/SCNetworkConnection.h>
140
+
141
+ CF_IMPLICIT_BRIDGING_ENABLED
142
+ CF_ASSUME_NONNULL_BEGIN
143
+
144
+ /*!
145
+ @const kCFErrorDomainSystemConfiguration
146
+ @discussion CFError domain associated with errors reported by
147
+ the SystemConfiguration.framework.
148
+ */
149
+ extern const CFStringRef kCFErrorDomainSystemConfiguration API_AVAILABLE(macos(10.5), ios(2.0));
150
+
151
+ __BEGIN_DECLS
152
+
153
+ /*!
154
+ @function SCCopyLastError
155
+ @discussion Returns the most recent status or error code generated
156
+ as the result of calling a System Configuration framework API.
157
+ @result Returns the last error encountered.
158
+ */
159
+ CFErrorRef SCCopyLastError (void) API_AVAILABLE(macos(10.5), ios(2.0));
160
+
161
+ /*!
162
+ @function SCError
163
+ @discussion Returns the most recent status or error code generated
164
+ as the result of calling a System Configuration framework API.
165
+ @result Returns the last error encountered.
166
+ */
167
+ int SCError (void) API_AVAILABLE(macos(10.1), ios(2.0));
168
+
169
+ /*!
170
+ @function SCErrorString
171
+ @discussion Returns a pointer to the message string
172
+ associated with the specified status or error
173
+ number.
174
+ @param status The status or error number.
175
+ @result Returns a pointer to the error message string.
176
+ */
177
+ const char * SCErrorString (int status) API_AVAILABLE(macos(10.1), ios(2.0));
178
+
179
+ __END_DECLS
180
+
181
+ CF_ASSUME_NONNULL_END
182
+ CF_IMPLICIT_BRIDGING_DISABLED
183
+
184
+ #endif /* _SYSTEMCONFIGURATION_H */
@@ -0,0 +1,315 @@
1
+ /*
2
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
3
+ *
4
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. The rights granted to you under the License
10
+ * may not be used to create, or enable the creation or redistribution of,
11
+ * unlawful or unlicensed copies of an Apple operating system, or to
12
+ * circumvent, violate, or enable the circumvention or violation of, any
13
+ * terms of an Apple operating system software license agreement.
14
+ *
15
+ * Please obtain a copy of the License at
16
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
17
+ *
18
+ * The Original Code and all software distributed under the License are
19
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23
+ * Please see the License for the specific language governing rights and
24
+ * limitations under the License.
25
+ *
26
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
+ */
28
+
29
+ #ifndef _OS_OSBYTEORDER_H
30
+ #define _OS_OSBYTEORDER_H
31
+
32
+ #include <stdint.h>
33
+ #include <libkern/_OSByteOrder.h>
34
+
35
+ /* Macros for swapping constant values in the preprocessing stage. */
36
+ #define OSSwapConstInt16(x) __DARWIN_OSSwapConstInt16(x)
37
+ #define OSSwapConstInt32(x) __DARWIN_OSSwapConstInt32(x)
38
+ #define OSSwapConstInt64(x) __DARWIN_OSSwapConstInt64(x)
39
+
40
+ #if !defined(__DARWIN_OS_INLINE)
41
+ # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
42
+ # define __DARWIN_OS_INLINE static inline
43
+ # elif defined(__MWERKS__) || defined(__cplusplus)
44
+ # define __DARWIN_OS_INLINE static inline
45
+ # else
46
+ # define __DARWIN_OS_INLINE static __inline__
47
+ # endif
48
+ #endif
49
+
50
+ #if defined(__GNUC__)
51
+
52
+ #if defined (__arm__) || defined(__arm64__)
53
+ #include <libkern/arm/OSByteOrder.h>
54
+ #else
55
+ #include <libkern/machine/OSByteOrder.h>
56
+ #endif
57
+
58
+ #else /* ! __GNUC__ */
59
+
60
+ #include <libkern/machine/OSByteOrder.h>
61
+
62
+ #endif /* __GNUC__ */
63
+
64
+ #define OSSwapInt16(x) __DARWIN_OSSwapInt16(x)
65
+ #define OSSwapInt32(x) __DARWIN_OSSwapInt32(x)
66
+ #define OSSwapInt64(x) __DARWIN_OSSwapInt64(x)
67
+
68
+ enum {
69
+ OSUnknownByteOrder,
70
+ OSLittleEndian,
71
+ OSBigEndian
72
+ };
73
+
74
+ __DARWIN_OS_INLINE
75
+ int32_t
76
+ OSHostByteOrder(void)
77
+ {
78
+ #if defined(__LITTLE_ENDIAN__)
79
+ return OSLittleEndian;
80
+ #elif defined(__BIG_ENDIAN__)
81
+ return OSBigEndian;
82
+ #else
83
+ return OSUnknownByteOrder;
84
+ #endif
85
+ }
86
+
87
+ #define OSReadBigInt(x, y) OSReadBigInt32(x, y)
88
+ #define OSWriteBigInt(x, y, z) OSWriteBigInt32(x, y, z)
89
+ #define OSSwapBigToHostInt(x) OSSwapBigToHostInt32(x)
90
+ #define OSSwapHostToBigInt(x) OSSwapHostToBigInt32(x)
91
+ #define OSReadLittleInt(x, y) OSReadLittleInt32(x, y)
92
+ #define OSWriteLittleInt(x, y, z) OSWriteLittleInt32(x, y, z)
93
+ #define OSSwapHostToLittleInt(x) OSSwapHostToLittleInt32(x)
94
+ #define OSSwapLittleToHostInt(x) OSSwapLittleToHostInt32(x)
95
+
96
+ /* Functions for loading native endian values. */
97
+
98
+ __DARWIN_OS_INLINE
99
+ uint16_t
100
+ _OSReadInt16(
101
+ const volatile void * base,
102
+ uintptr_t byteOffset
103
+ )
104
+ {
105
+ return *(volatile uint16_t *)((uintptr_t)base + byteOffset);
106
+ }
107
+
108
+ __DARWIN_OS_INLINE
109
+ uint32_t
110
+ _OSReadInt32(
111
+ const volatile void * base,
112
+ uintptr_t byteOffset
113
+ )
114
+ {
115
+ return *(volatile uint32_t *)((uintptr_t)base + byteOffset);
116
+ }
117
+
118
+ __DARWIN_OS_INLINE
119
+ uint64_t
120
+ _OSReadInt64(
121
+ const volatile void * base,
122
+ uintptr_t byteOffset
123
+ )
124
+ {
125
+ return *(volatile uint64_t *)((uintptr_t)base + byteOffset);
126
+ }
127
+
128
+ /* Functions for storing native endian values. */
129
+
130
+ __DARWIN_OS_INLINE
131
+ void
132
+ _OSWriteInt16(
133
+ volatile void * base,
134
+ uintptr_t byteOffset,
135
+ uint16_t data
136
+ )
137
+ {
138
+ *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data;
139
+ }
140
+
141
+ __DARWIN_OS_INLINE
142
+ void
143
+ _OSWriteInt32(
144
+ volatile void * base,
145
+ uintptr_t byteOffset,
146
+ uint32_t data
147
+ )
148
+ {
149
+ *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data;
150
+ }
151
+
152
+ __DARWIN_OS_INLINE
153
+ void
154
+ _OSWriteInt64(
155
+ volatile void * base,
156
+ uintptr_t byteOffset,
157
+ uint64_t data
158
+ )
159
+ {
160
+ *(volatile uint64_t *)((uintptr_t)base + byteOffset) = data;
161
+ }
162
+
163
+ #if defined(__BIG_ENDIAN__)
164
+
165
+ /* Functions for loading big endian to host endianess. */
166
+
167
+ #define OSReadBigInt16(base, byteOffset) _OSReadInt16(base, byteOffset)
168
+ #define OSReadBigInt32(base, byteOffset) _OSReadInt32(base, byteOffset)
169
+ #define OSReadBigInt64(base, byteOffset) _OSReadInt64(base, byteOffset)
170
+
171
+ /* Functions for storing host endianess to big endian. */
172
+
173
+ #define OSWriteBigInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data)
174
+ #define OSWriteBigInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data)
175
+ #define OSWriteBigInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data)
176
+
177
+ /* Functions for loading little endian to host endianess. */
178
+
179
+ #define OSReadLittleInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset)
180
+ #define OSReadLittleInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset)
181
+ #define OSReadLittleInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset)
182
+
183
+ /* Functions for storing host endianess to little endian. */
184
+
185
+ #define OSWriteLittleInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data)
186
+ #define OSWriteLittleInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data)
187
+ #define OSWriteLittleInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data)
188
+
189
+ /* Host endianess to big endian byte swapping macros for constants. */
190
+
191
+ #define OSSwapHostToBigConstInt16(x) ((uint16_t)(x))
192
+ #define OSSwapHostToBigConstInt32(x) ((uint32_t)(x))
193
+ #define OSSwapHostToBigConstInt64(x) ((uint64_t)(x))
194
+
195
+ /* Generic host endianess to big endian byte swapping functions. */
196
+
197
+ #define OSSwapHostToBigInt16(x) ((uint16_t)(x))
198
+ #define OSSwapHostToBigInt32(x) ((uint32_t)(x))
199
+ #define OSSwapHostToBigInt64(x) ((uint64_t)(x))
200
+
201
+ /* Host endianess to little endian byte swapping macros for constants. */
202
+
203
+ #define OSSwapHostToLittleConstInt16(x) OSSwapConstInt16(x)
204
+ #define OSSwapHostToLittleConstInt32(x) OSSwapConstInt32(x)
205
+ #define OSSwapHostToLittleConstInt64(x) OSSwapConstInt64(x)
206
+
207
+ /* Generic host endianess to little endian byte swapping functions. */
208
+
209
+ #define OSSwapHostToLittleInt16(x) OSSwapInt16(x)
210
+ #define OSSwapHostToLittleInt32(x) OSSwapInt32(x)
211
+ #define OSSwapHostToLittleInt64(x) OSSwapInt64(x)
212
+
213
+ /* Big endian to host endianess byte swapping macros for constants. */
214
+
215
+ #define OSSwapBigToHostConstInt16(x) ((uint16_t)(x))
216
+ #define OSSwapBigToHostConstInt32(x) ((uint32_t)(x))
217
+ #define OSSwapBigToHostConstInt64(x) ((uint64_t)(x))
218
+
219
+ /* Generic big endian to host endianess byte swapping functions. */
220
+
221
+ #define OSSwapBigToHostInt16(x) ((uint16_t)(x))
222
+ #define OSSwapBigToHostInt32(x) ((uint32_t)(x))
223
+ #define OSSwapBigToHostInt64(x) ((uint64_t)(x))
224
+
225
+ /* Little endian to host endianess byte swapping macros for constants. */
226
+
227
+ #define OSSwapLittleToHostConstInt16(x) OSSwapConstInt16(x)
228
+ #define OSSwapLittleToHostConstInt32(x) OSSwapConstInt32(x)
229
+ #define OSSwapLittleToHostConstInt64(x) OSSwapConstInt64(x)
230
+
231
+ /* Generic little endian to host endianess byte swapping functions. */
232
+
233
+ #define OSSwapLittleToHostInt16(x) OSSwapInt16(x)
234
+ #define OSSwapLittleToHostInt32(x) OSSwapInt32(x)
235
+ #define OSSwapLittleToHostInt64(x) OSSwapInt64(x)
236
+
237
+ #elif defined(__LITTLE_ENDIAN__)
238
+
239
+ /* Functions for loading big endian to host endianess. */
240
+
241
+ #define OSReadBigInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset)
242
+ #define OSReadBigInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset)
243
+ #define OSReadBigInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset)
244
+
245
+ /* Functions for storing host endianess to big endian. */
246
+
247
+ #define OSWriteBigInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data)
248
+ #define OSWriteBigInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data)
249
+ #define OSWriteBigInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data)
250
+
251
+ /* Functions for loading little endian to host endianess. */
252
+
253
+ #define OSReadLittleInt16(base, byteOffset) _OSReadInt16(base, byteOffset)
254
+ #define OSReadLittleInt32(base, byteOffset) _OSReadInt32(base, byteOffset)
255
+ #define OSReadLittleInt64(base, byteOffset) _OSReadInt64(base, byteOffset)
256
+
257
+ /* Functions for storing host endianess to little endian. */
258
+
259
+ #define OSWriteLittleInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data)
260
+ #define OSWriteLittleInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data)
261
+ #define OSWriteLittleInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data)
262
+
263
+ /* Host endianess to big endian byte swapping macros for constants. */
264
+
265
+ #define OSSwapHostToBigConstInt16(x) OSSwapConstInt16(x)
266
+ #define OSSwapHostToBigConstInt32(x) OSSwapConstInt32(x)
267
+ #define OSSwapHostToBigConstInt64(x) OSSwapConstInt64(x)
268
+
269
+ /* Generic host endianess to big endian byte swapping functions. */
270
+
271
+ #define OSSwapHostToBigInt16(x) OSSwapInt16(x)
272
+ #define OSSwapHostToBigInt32(x) OSSwapInt32(x)
273
+ #define OSSwapHostToBigInt64(x) OSSwapInt64(x)
274
+
275
+ /* Host endianess to little endian byte swapping macros for constants. */
276
+
277
+ #define OSSwapHostToLittleConstInt16(x) ((uint16_t)(x))
278
+ #define OSSwapHostToLittleConstInt32(x) ((uint32_t)(x))
279
+ #define OSSwapHostToLittleConstInt64(x) ((uint64_t)(x))
280
+
281
+ /* Generic host endianess to little endian byte swapping functions. */
282
+
283
+ #define OSSwapHostToLittleInt16(x) ((uint16_t)(x))
284
+ #define OSSwapHostToLittleInt32(x) ((uint32_t)(x))
285
+ #define OSSwapHostToLittleInt64(x) ((uint64_t)(x))
286
+
287
+ /* Big endian to host endianess byte swapping macros for constants. */
288
+
289
+ #define OSSwapBigToHostConstInt16(x) OSSwapConstInt16(x)
290
+ #define OSSwapBigToHostConstInt32(x) OSSwapConstInt32(x)
291
+ #define OSSwapBigToHostConstInt64(x) OSSwapConstInt64(x)
292
+
293
+ /* Generic big endian to host endianess byte swapping functions. */
294
+
295
+ #define OSSwapBigToHostInt16(x) OSSwapInt16(x)
296
+ #define OSSwapBigToHostInt32(x) OSSwapInt32(x)
297
+ #define OSSwapBigToHostInt64(x) OSSwapInt64(x)
298
+
299
+ /* Little endian to host endianess byte swapping macros for constants. */
300
+
301
+ #define OSSwapLittleToHostConstInt16(x) ((uint16_t)(x))
302
+ #define OSSwapLittleToHostConstInt32(x) ((uint32_t)(x))
303
+ #define OSSwapLittleToHostConstInt64(x) ((uint64_t)(x))
304
+
305
+ /* Generic little endian to host endianess byte swapping functions. */
306
+
307
+ #define OSSwapLittleToHostInt16(x) ((uint16_t)(x))
308
+ #define OSSwapLittleToHostInt32(x) ((uint32_t)(x))
309
+ #define OSSwapLittleToHostInt64(x) ((uint64_t)(x))
310
+
311
+ #else
312
+ #error Unknown endianess.
313
+ #endif
314
+
315
+ #endif /* ! _OS_OSBYTEORDER_H */
@@ -0,0 +1,147 @@
1
+ /*
2
+ * Copyright (c) 2000-2023 Apple Computer, Inc. All rights reserved.
3
+ *
4
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. The rights granted to you under the License
10
+ * may not be used to create, or enable the creation or redistribution of,
11
+ * unlawful or unlicensed copies of an Apple operating system, or to
12
+ * circumvent, violate, or enable the circumvention or violation of, any
13
+ * terms of an Apple operating system software license agreement.
14
+ *
15
+ * Please obtain a copy of the License at
16
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
17
+ *
18
+ * The Original Code and all software distributed under the License are
19
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23
+ * Please see the License for the specific language governing rights and
24
+ * limitations under the License.
25
+ *
26
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
+ */
28
+
29
+ #ifndef _OS_OSBYTEORDERMACHINE_H
30
+ #define _OS_OSBYTEORDERMACHINE_H
31
+
32
+ #if !defined(__GNUC__) || (!defined(__i386__) && !defined(__x86_64__) && !defined (__arm__) && !defined(__arm64__))
33
+
34
+ #include <stdint.h>
35
+
36
+ #if !defined(OS_INLINE)
37
+ # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
38
+ # define OS_INLINE static inline
39
+ # elif defined(__MWERKS__) || defined(__cplusplus)
40
+ # define OS_INLINE static inline
41
+ # else
42
+ # define OS_INLINE static __inline__
43
+ # endif
44
+ #endif
45
+
46
+ /* Generic byte swapping functions. */
47
+
48
+ OS_INLINE
49
+ uint16_t
50
+ _OSSwapInt16(
51
+ uint16_t data
52
+ )
53
+ {
54
+ return OSSwapConstInt16(data);
55
+ }
56
+
57
+ OS_INLINE
58
+ uint32_t
59
+ _OSSwapInt32(
60
+ uint32_t data
61
+ )
62
+ {
63
+ return OSSwapConstInt32(data);
64
+ }
65
+
66
+ OS_INLINE
67
+ uint64_t
68
+ _OSSwapInt64(
69
+ uint64_t data
70
+ )
71
+ {
72
+ return OSSwapConstInt64(data);
73
+ }
74
+
75
+ /* Functions for byte reversed loads. */
76
+
77
+ OS_INLINE
78
+ uint16_t
79
+ OSReadSwapInt16(
80
+ const volatile void * base,
81
+ uintptr_t byteOffset
82
+ )
83
+ {
84
+ uint16_t data = *(volatile uint16_t *)((uintptr_t)base + byteOffset);
85
+ return _OSSwapInt16(data);
86
+ }
87
+
88
+ OS_INLINE
89
+ uint32_t
90
+ OSReadSwapInt32(
91
+ const volatile void * base,
92
+ uintptr_t byteOffset
93
+ )
94
+ {
95
+ uint32_t data = *(volatile uint32_t *)((uintptr_t)base + byteOffset);
96
+ return _OSSwapInt32(data);
97
+ }
98
+
99
+ OS_INLINE
100
+ uint64_t
101
+ OSReadSwapInt64(
102
+ const volatile void * base,
103
+ uintptr_t byteOffset
104
+ )
105
+ {
106
+ uint64_t data = *(volatile uint64_t *)((uintptr_t)base + byteOffset);
107
+ return _OSSwapInt64(data);
108
+ }
109
+
110
+ /* Functions for byte reversed stores. */
111
+
112
+ OS_INLINE
113
+ void
114
+ OSWriteSwapInt16(
115
+ volatile void * base,
116
+ uintptr_t byteOffset,
117
+ uint16_t data
118
+ )
119
+ {
120
+ *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data);
121
+ }
122
+
123
+ OS_INLINE
124
+ void
125
+ OSWriteSwapInt32(
126
+ volatile void * base,
127
+ uintptr_t byteOffset,
128
+ uint32_t data
129
+ )
130
+ {
131
+ *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data);
132
+ }
133
+
134
+ OS_INLINE
135
+ void
136
+ OSWriteSwapInt64(
137
+ volatile void * base,
138
+ uintptr_t byteOffset,
139
+ uint64_t data
140
+ )
141
+ {
142
+ *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data);
143
+ }
144
+
145
+ #endif /* !defined(__GNUC__) || (!defined(__i386__) && !defined(__x86_64__) && !defined (__arm__) && !defined(__arm64__)) */
146
+
147
+ #endif /* ! _OS_OSBYTEORDERMACHINE_H */
@@ -691,3 +691,45 @@ export function commandWritesSim(msg: {
691
691
  if (msg.readOnly === true) return false
692
692
  return WRITE_COMMAND_TYPES.has(msg.type)
693
693
  }
694
+
695
+ // one sim (or contrast tab) the bridge host reports from bridge:list-sims.
696
+ export interface BridgeSimInfo {
697
+ id: string
698
+ origin?: string
699
+ url?: string
700
+ title?: string
701
+ userAgent?: string
702
+ connectedAt: number
703
+ lastSeenAt: number
704
+ lastActiveAt?: number
705
+ isPrimary: boolean
706
+ readyState: 'open' | 'closing' | 'closed'
707
+ attachedCliCount?: number
708
+ lockedBy?: string
709
+ lockedByKind?: 'cli' | 'user-active'
710
+ lockExpiresAt?: number
711
+ // true when the lease belongs to the caller asking for this list. the
712
+ // server computes it because `lockedBy` is a display string (a cliLabel
713
+ // like "open --describe", or "active user") and cannot be compared
714
+ // against an identity key by the client.
715
+ lockedByMe?: boolean
716
+ userFocused?: boolean
717
+ userVisible?: boolean
718
+ visibilityState?: string
719
+ documentFocused?: boolean
720
+ /** registration "kind" — lets a single daemon host multiple surface
721
+ * types. omitted / unknown defaults to 'sootsim'. the contrast web
722
+ * IDE registers with kind='contrast'; CLI consumers filter by this
723
+ * rather than running a parallel bridge. */
724
+ kind?: string
725
+ /** opaque metadata supplied at register time (e.g. projectId, route,
726
+ * attached iOS sim id for a contrast tab). free-form by design — the
727
+ * daemon does not interpret it, only stores + reports it back. */
728
+ meta?: Record<string, unknown>
729
+ /** why a retained disconnected sim left, e.g. which owned browser host
730
+ * exited. present only on readyState 'closed' entries served with
731
+ * includeRetained. */
732
+ disconnectCause?: string
733
+ /** epoch-ms the sim socket closed. present with disconnectCause. */
734
+ disconnectedAt?: number
735
+ }