peachsim 0.1.2411 → 0.1.2421

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 (146) hide show
  1. package/README.md +1 -1
  2. package/cli/catalog/content.ts +6 -3
  3. package/cli/catalog/meta.ts +63 -17
  4. package/cli/catalog/routes.ts +4 -0
  5. package/cli/cloud-box-artifact.ts +45 -24
  6. package/cli/cloud-client.ts +6 -2
  7. package/cli/command-registry.ts +3 -1
  8. package/cli/commands/control.ts +74 -55
  9. package/cli/commands/desktop.ts +3 -3
  10. package/cli/commands/electron.ts +7 -5
  11. package/cli/commands/kotlin.ts +8 -1
  12. package/cli/commands/platform.ts +5 -7
  13. package/cli/commands/profile.ts +2 -2
  14. package/cli/commands/settings.ts +90 -0
  15. package/cli/commands/shell-url.ts +18 -10
  16. package/cli/commands/swift.ts +3 -1
  17. package/cli/main.ts +6 -0
  18. package/cli/outbound-endpoints.ts +17 -15
  19. package/cli/settings-flags.ts +115 -0
  20. package/dist-lib/agent-daemon-client.cjs +1 -1
  21. package/dist-lib/agent-events.cjs +1 -1
  22. package/dist-lib/attached-projects.cjs +1 -1
  23. package/dist-lib/auth/shared-session.cjs +1 -1
  24. package/dist-lib/backend-origin.cjs +1 -1
  25. package/dist-lib/beta.cjs +1 -1
  26. package/dist-lib/beta.mjs +1 -1
  27. package/dist-lib/bridge-constants.cjs +1 -1
  28. package/dist-lib/bridge-contract-input.cjs +1 -1
  29. package/dist-lib/bridge-contract-input.mjs +1 -1
  30. package/dist-lib/bridge-contract.cjs +1 -1
  31. package/dist-lib/bridge-contract.mjs +1 -1
  32. package/dist-lib/bundle-channel.cjs +3706 -1818
  33. package/dist-lib/capture-contract.cjs +1 -1
  34. package/dist-lib/capture-contract.mjs +1 -1
  35. package/dist-lib/cloud-contract.cjs +1 -1
  36. package/dist-lib/cloud-contract.mjs +1 -1
  37. package/dist-lib/cloud-test-args.cjs +1 -1
  38. package/dist-lib/cloud-test-args.mjs +1 -1
  39. package/dist-lib/cloud.cjs +1 -1
  40. package/dist-lib/cloud.mjs +1 -1
  41. package/dist-lib/config.cjs +3 -7
  42. package/dist-lib/config.mjs +3 -7
  43. package/dist-lib/detox/index.cjs +4 -4
  44. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  45. package/dist-lib/expo-swift-bundle.cjs +17144 -15295
  46. package/dist-lib/expo-swift-metadata.cjs +1 -1
  47. package/dist-lib/expo-swift-metadata.mjs +1 -1
  48. package/dist-lib/home-paths.cjs +1 -1
  49. package/dist-lib/host/bridge-host.cjs +63288 -62269
  50. package/dist-lib/host/fetch-proxy-handler.cjs +1598 -211
  51. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  52. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  53. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  54. package/dist-lib/host/websocket-proxy.cjs +1 -1
  55. package/dist-lib/index.cjs +3007 -1512
  56. package/dist-lib/jump-to-source-babel.cjs +1 -1
  57. package/dist-lib/jump-to-source-native.cjs +1 -1
  58. package/dist-lib/kotlin-host.cjs +972 -246
  59. package/dist-lib/menu.cjs +1 -1
  60. package/dist-lib/menu.mjs +1 -1
  61. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  62. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  63. package/dist-lib/metro-production-bundle.cjs +1 -1
  64. package/dist-lib/metro-production-bundle.mjs +1 -1
  65. package/dist-lib/metro.cjs +1742 -247
  66. package/dist-lib/native-app-identity-project.cjs +40 -204
  67. package/dist-lib/native-app-identity-project.mjs +40 -204
  68. package/dist-lib/native-app-identity.cjs +1 -1
  69. package/dist-lib/native-app-identity.mjs +1 -1
  70. package/dist-lib/native-firebase-metadata.cjs +1 -1
  71. package/dist-lib/native-firebase-metadata.mjs +1 -1
  72. package/dist-lib/pdfium-raster.cjs +1 -1
  73. package/dist-lib/pdfium-raster.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 +1 -1
  77. package/dist-lib/public-brand.cjs +1 -1
  78. package/dist-lib/public-origins-lib-esm.json +26 -24
  79. package/dist-lib/public-origins-lib.json +198 -117
  80. package/dist-lib/react-native-host-modules.cjs +1 -1
  81. package/dist-lib/react-native-host-modules.mjs +1 -1
  82. package/dist-lib/reap-browser.cjs +1 -1
  83. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  84. package/dist-lib/sdk.cjs +1 -1
  85. package/dist-lib/sdk.mjs +1 -1
  86. package/dist-lib/skills.cjs +21765 -20511
  87. package/dist-lib/swift-compile.cjs +48 -228
  88. package/dist-lib/swift-compile.mjs +48 -228
  89. package/dist-lib/swift-package.cjs +1 -1
  90. package/dist-lib/swift-package.mjs +1 -1
  91. package/dist-lib/swift-submit.cjs +1 -1
  92. package/dist-lib/swift-submit.mjs +1 -1
  93. package/dist-lib/swift-toolchain.cjs +1 -199
  94. package/dist-lib/swift.cjs +1 -1
  95. package/dist-lib/vite-swift.cjs +227 -251
  96. package/dist-lib/vite.cjs +5240 -3788
  97. package/dist-lib/worklet-executable.cjs +1 -1
  98. package/dist-lib/worklet-executable.mjs +1 -1
  99. package/dist-types/packages/peach-engine/src/config.d.ts +1 -4
  100. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -0
  101. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -0
  102. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +4 -0
  103. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +5 -0
  104. package/kotlin/README.md +4 -3
  105. package/kotlin/sdk.tar.gz +0 -0
  106. package/kotlin/toolchain.json +3 -6
  107. package/package.json +1 -1
  108. package/runtime-companion.json +1 -1
  109. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1 -43
  110. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayerContents.h +55 -0
  111. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap +3 -3
  112. package/sdk/ios/usr/include/ObjectiveC.apinotes +0 -24
  113. package/sdk/ios/usr/include/grp.h +93 -0
  114. package/sdk/ios/usr/include/netinet/tcp.h +299 -0
  115. package/sdk/ios/wasm/include/netinet/tcp.h +6 -0
  116. package/sdk/ios/wasm/include/stdlib.h +1 -0
  117. package/sdk/ios/wasm/include/unistd.h +2 -0
  118. package/skills/contrast/SKILL.md +1 -0
  119. package/skills/peach-setup/SKILL.md +11 -1
  120. package/src/android-bridge-dependencies.ts +1 -1
  121. package/src/app-config.ts +7 -0
  122. package/src/binaryen.lock.json +21 -0
  123. package/src/cocoapods-trunk.ts +52 -0
  124. package/src/config.ts +21 -31
  125. package/src/expo-native-workspace.ts +4 -0
  126. package/src/kotlin-host.ts +1 -1
  127. package/src/kotlin-sdk.ts +7 -7
  128. package/src/kotlin-toolchain.ts +28 -24
  129. package/src/kotlinSdkContract.ts +2 -2
  130. package/src/native-bundles.ts +5 -2
  131. package/src/native-static-libraries.ts +38 -5
  132. package/src/podfile-cocoapods.ts +1473 -0
  133. package/src/podspec-cocoapods.ts +331 -106
  134. package/src/podspec-ruby-stdlib.ts +134 -19
  135. package/src/podspec-ruby.ts +199 -46
  136. package/src/settingsContract.ts +74 -0
  137. package/src/swift-compile.ts +1 -1
  138. package/src/swift-compiler-digest.ts +1 -0
  139. package/src/swift-host.ts +107 -15
  140. package/src/swift-objc-compile.ts +5 -0
  141. package/src/swift-packages.ts +75 -0
  142. package/src/swift-shared-sdk.ts +19 -0
  143. package/src/swift-toolchain.ts +2 -201
  144. package/src/turbo-source.ts +7 -37
  145. package/src/wasm-optimize.ts +4 -27
  146. package/src/xcode-project.ts +22 -7
@@ -0,0 +1,299 @@
1
+ /*
2
+ * Copyright (c) 2000-2018 Apple 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
+ * Copyright (c) 1982, 1986, 1993
30
+ * The Regents of the University of California. All rights reserved.
31
+ *
32
+ * Redistribution and use in source and binary forms, with or without
33
+ * modification, are permitted provided that the following conditions
34
+ * are met:
35
+ * 1. Redistributions of source code must retain the above copyright
36
+ * notice, this list of conditions and the following disclaimer.
37
+ * 2. Redistributions in binary form must reproduce the above copyright
38
+ * notice, this list of conditions and the following disclaimer in the
39
+ * documentation and/or other materials provided with the distribution.
40
+ * 3. All advertising materials mentioning features or use of this software
41
+ * must display the following acknowledgement:
42
+ * This product includes software developed by the University of
43
+ * California, Berkeley and its contributors.
44
+ * 4. Neither the name of the University nor the names of its contributors
45
+ * may be used to endorse or promote products derived from this software
46
+ * without specific prior written permission.
47
+ *
48
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58
+ * SUCH DAMAGE.
59
+ *
60
+ * @(#)tcp.h 8.1 (Berkeley) 6/10/93
61
+ * $FreeBSD: src/sys/netinet/tcp.h,v 1.13.2.3 2001/03/01 22:08:42 jlemon Exp $
62
+ */
63
+
64
+ #ifndef _NETINET_TCP_H_
65
+ #define _NETINET_TCP_H_
66
+ #include <sys/appleapiopts.h>
67
+ #include <sys/socket.h>
68
+ #include <sys/types.h>
69
+
70
+ #include <machine/endian.h>
71
+ #include <machine/types.h> /* __uint32_t */
72
+ #include <netinet/in.h>
73
+
74
+ #include <sys/types.h>
75
+
76
+ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
77
+ typedef __uint32_t tcp_seq;
78
+ typedef __uint32_t tcp_cc; /* connection count per rfc1644 */
79
+
80
+ #define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */
81
+ #define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */
82
+
83
+ /*
84
+ * TCP header.
85
+ * Per RFC 793, September, 1981.
86
+ */
87
+ struct tcphdr {
88
+ unsigned short th_sport; /* source port */
89
+ unsigned short th_dport; /* destination port */
90
+ tcp_seq th_seq; /* sequence number */
91
+ tcp_seq th_ack; /* acknowledgement number */
92
+ #if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
93
+ unsigned int th_x2:4, /* (unused) */
94
+ th_off:4; /* data offset */
95
+ #endif
96
+ #if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
97
+ unsigned int th_off:4, /* data offset */
98
+ th_x2:4; /* (unused) */
99
+ #endif
100
+ unsigned char th_flags;
101
+ #define TH_FIN 0x01
102
+ #define TH_SYN 0x02
103
+ #define TH_RST 0x04
104
+ #define TH_PUSH 0x08
105
+ #define TH_ACK 0x10
106
+ #define TH_URG 0x20
107
+ #define TH_ECE 0x40
108
+ #define TH_CWR 0x80
109
+ #define TH_AE 0x100 /* maps into th_x2 */
110
+ #define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR)
111
+ #define TH_FLAGS_ALL (TH_FLAGS|TH_PUSH)
112
+ #define TH_ACCEPT (TH_FIN|TH_SYN|TH_RST|TH_ACK)
113
+ #define TH_ACE (TH_AE|TH_CWR|TH_ECE)
114
+
115
+ unsigned short th_win; /* window */
116
+ unsigned short th_sum; /* checksum */
117
+ unsigned short th_urp; /* urgent pointer */
118
+ };
119
+
120
+ #define TCPOPT_EOL 0
121
+ #define TCPOLEN_EOL 1
122
+ #define TCPOPT_NOP 1
123
+ #define TCPOLEN_NOP 1
124
+ #define TCPOPT_MAXSEG 2
125
+ #define TCPOLEN_MAXSEG 4
126
+ #define TCPOPT_WINDOW 3
127
+ #define TCPOLEN_WINDOW 3
128
+ #define TCPOPT_SACK_PERMITTED 4 /* SACK capability in SYN */
129
+ #define TCPOLEN_SACK_PERMITTED 2
130
+ #define TCPOPT_SACK 5
131
+ #define TCPOLEN_SACKHDR 2
132
+ #define TCPOLEN_SACK 8 /* len of sack block */
133
+ #define TCPOPT_TIMESTAMP 8
134
+ #define TCPOLEN_TIMESTAMP 10
135
+ #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
136
+ #define TCPOPT_TSTAMP_HDR \
137
+ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
138
+
139
+ #define MAX_TCPOPTLEN 40 /* Absolute maximum TCP options len */
140
+
141
+ #define TCPOPT_CC 11 /* CC options: RFC-1644 */
142
+ #define TCPOPT_CCNEW 12
143
+ #define TCPOPT_CCECHO 13
144
+ #define TCPOLEN_CC 6
145
+ #define TCPOLEN_CC_APPA (TCPOLEN_CC+2)
146
+ #define TCPOPT_CC_HDR(ccopt) \
147
+ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
148
+ #define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */
149
+ #define TCPOLEN_SIGNATURE 18
150
+ #if MPTCP
151
+ #define TCPOPT_MULTIPATH 30
152
+ #endif
153
+
154
+ #define TCPOPT_FASTOPEN 34
155
+ #define TCPOLEN_FASTOPEN_REQ 2
156
+
157
+ #define TCPOPT_ACCECN0 172 /* AccECN Order 0 */
158
+ #define TCPOPT_ACCECN1 174 /* AccECN Order 1 */
159
+ #define TCPOLEN_ACCECN_EMPTY 2 /* Empty option contains kind and length */
160
+ #define TCPOLEN_ACCECN_COUNTER 3 /* Length of each AccECN counter */
161
+
162
+ /* Option definitions */
163
+ #define TCPOPT_SACK_PERMIT_HDR \
164
+ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK_PERMITTED<<8|TCPOLEN_SACK_PERMITTED)
165
+ #define TCPOPT_SACK_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK<<8)
166
+ /* Miscellaneous constants */
167
+ #define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at sender side */
168
+
169
+ /*
170
+ * A SACK option that specifies n blocks will have a length of (8*n + 2)
171
+ * bytes, so the 40 bytes available for TCP options can specify a
172
+ * maximum of 4 blocks.
173
+ */
174
+
175
+ #define TCP_MAX_SACK 4 /* MAX # SACKs sent in any segment */
176
+
177
+
178
+ /*
179
+ * Default maximum segment size for TCP.
180
+ * With an IP MTU of 576, this is 536,
181
+ * but 512 is probably more convenient.
182
+ * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
183
+ */
184
+ #define TCP_MSS 512
185
+
186
+ /*
187
+ * TCP_MINMSS is defined to be 216 which is fine for the smallest
188
+ * link MTU (256 bytes, SLIP interface) in the Internet.
189
+ * However it is very unlikely to come across such low MTU interfaces
190
+ * these days (anno dato 2004).
191
+ * Probably it can be set to 512 without ill effects. But we play safe.
192
+ * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments.
193
+ * Setting this to "0" disables the minmss check.
194
+ */
195
+ #define TCP_MINMSS 216
196
+
197
+ /*
198
+ * Default maximum segment size for TCP6.
199
+ * With an IP6 MSS of 1280, this is 1220,
200
+ * but 1024 is probably more convenient. (xxx kazu in doubt)
201
+ * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr))
202
+ */
203
+ #define TCP6_MSS 1024
204
+
205
+ #define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
206
+ #define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
207
+
208
+ #define TCP_MAX_WINSHIFT 14 /* maximum window shift */
209
+
210
+ #define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
211
+ #define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
212
+ /* max space left for options */
213
+ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
214
+
215
+ /*
216
+ * User-settable options (used with setsockopt).
217
+ */
218
+ #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
219
+ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
220
+ #define TCP_MAXSEG 0x02 /* set maximum segment size */
221
+ #define TCP_NOPUSH 0x04 /* don't push last block of write */
222
+ #define TCP_NOOPT 0x08 /* don't use TCP options */
223
+ #define TCP_KEEPALIVE 0x10 /* idle time used when SO_KEEPALIVE is enabled */
224
+ #define TCP_CONNECTIONTIMEOUT 0x20 /* connection timeout */
225
+ #define PERSIST_TIMEOUT 0x40 /* time after which a connection in
226
+ * persist timeout will terminate.
227
+ * see draft-ananth-tcpm-persist-02.txt
228
+ */
229
+ #define TCP_RXT_CONNDROPTIME 0x80 /* time after which tcp retransmissions will be
230
+ * stopped and the connection will be dropped
231
+ */
232
+ #define TCP_RXT_FINDROP 0x100 /* when this option is set, drop a connection
233
+ * after retransmitting the FIN 3 times. It will
234
+ * prevent holding too many mbufs in socket
235
+ * buffer queues.
236
+ */
237
+ #define TCP_KEEPINTVL 0x101 /* interval between keepalives */
238
+ #define TCP_KEEPCNT 0x102 /* number of keepalives before close */
239
+ #define TCP_SENDMOREACKS 0x103 /* always ack every other packet */
240
+ #define TCP_ENABLE_ECN 0x104 /* Enable ECN on a connection */
241
+ #define TCP_FASTOPEN 0x105 /* Enable/Disable TCP Fastopen on this socket */
242
+ #define TCP_CONNECTION_INFO 0x106 /* State of TCP connection */
243
+
244
+
245
+
246
+ #define TCP_NOTSENT_LOWAT 0x201 /* Low water mark for TCP unsent data */
247
+
248
+ struct tcp_connection_info {
249
+ u_int8_t tcpi_state; /* connection state */
250
+ u_int8_t tcpi_snd_wscale; /* Window scale for send window */
251
+ u_int8_t tcpi_rcv_wscale; /* Window scale for receive window */
252
+ u_int8_t __pad1;
253
+ u_int32_t tcpi_options; /* TCP options supported */
254
+ #define TCPCI_OPT_TIMESTAMPS 0x00000001 /* Timestamps enabled */
255
+ #define TCPCI_OPT_SACK 0x00000002 /* SACK enabled */
256
+ #define TCPCI_OPT_WSCALE 0x00000004 /* Window scaling enabled */
257
+ #define TCPCI_OPT_ECN 0x00000008 /* ECN enabled */
258
+ u_int32_t tcpi_flags; /* flags */
259
+ #define TCPCI_FLAG_LOSSRECOVERY 0x00000001
260
+ #define TCPCI_FLAG_REORDERING_DETECTED 0x00000002
261
+ u_int32_t tcpi_rto; /* retransmit timeout in ms */
262
+ u_int32_t tcpi_maxseg; /* maximum segment size supported */
263
+ u_int32_t tcpi_snd_ssthresh; /* slow start threshold in bytes */
264
+ u_int32_t tcpi_snd_cwnd; /* send congestion window in bytes */
265
+ u_int32_t tcpi_snd_wnd; /* send widnow in bytes */
266
+ u_int32_t tcpi_snd_sbbytes; /* bytes in send socket buffer, including in-flight data */
267
+ u_int32_t tcpi_rcv_wnd; /* receive window in bytes*/
268
+ u_int32_t tcpi_rttcur; /* most recent RTT in ms */
269
+ u_int32_t tcpi_srtt; /* average RTT in ms */
270
+ u_int32_t tcpi_rttvar; /* RTT variance */
271
+ u_int32_t
272
+ tcpi_tfo_cookie_req:1, /* Cookie requested? */
273
+ tcpi_tfo_cookie_rcv:1, /* Cookie received? */
274
+ tcpi_tfo_syn_loss:1, /* Fallback to reg. TCP after SYN-loss */
275
+ tcpi_tfo_syn_data_sent:1, /* SYN+data has been sent out */
276
+ tcpi_tfo_syn_data_acked:1, /* SYN+data has been fully acknowledged */
277
+ tcpi_tfo_syn_data_rcv:1, /* Server received SYN+data with a valid cookie */
278
+ tcpi_tfo_cookie_req_rcv:1, /* Server received cookie-request */
279
+ tcpi_tfo_cookie_sent:1, /* Server announced cookie */
280
+ tcpi_tfo_cookie_invalid:1, /* Server received an invalid cookie */
281
+ tcpi_tfo_cookie_wrong:1, /* Our sent cookie was wrong */
282
+ tcpi_tfo_no_cookie_rcv:1, /* We did not receive a cookie upon our request */
283
+ tcpi_tfo_heuristics_disable:1, /* TFO-heuristics disabled it */
284
+ tcpi_tfo_send_blackhole:1, /* A sending-blackhole got detected */
285
+ tcpi_tfo_recv_blackhole:1, /* A receiver-blackhole got detected */
286
+ tcpi_tfo_onebyte_proxy:1, /* A proxy acknowledges all but one byte of the SYN */
287
+ __pad2:17;
288
+ u_int64_t tcpi_txpackets __attribute__((aligned(8)));
289
+ u_int64_t tcpi_txbytes __attribute__((aligned(8)));
290
+ u_int64_t tcpi_txretransmitbytes __attribute__((aligned(8)));
291
+ u_int64_t tcpi_rxpackets __attribute__((aligned(8)));
292
+ u_int64_t tcpi_rxbytes __attribute__((aligned(8)));
293
+ u_int64_t tcpi_rxoutoforderbytes __attribute__((aligned(8)));
294
+ u_int64_t tcpi_txretransmitpackets __attribute__((aligned(8)));
295
+ };
296
+ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
297
+
298
+
299
+ #endif
@@ -0,0 +1,6 @@
1
+ #pragma once
2
+ // darwin's tcp option numbers (TCP_KEEPALIVE, TCP_KEEPINTVL) and records, from
3
+ // its own header; the socket host reads darwin's numbers, so the installed
4
+ // libc's linux numbers are never read.
5
+ #include "../../../usr/include/netinet/tcp.h"
6
+ #define _NETINET_TCP_H
@@ -28,6 +28,7 @@ void arc4random_stir(void);
28
28
  char *realpath(const char *__restrict, char *__restrict) __asm__("__peach_darwin_realpath");
29
29
  char *setstate(const char *);
30
30
  int mkstemp(char *);
31
+ char *mkdtemp(char *);
31
32
  char *ecvt(double, int, int *__restrict, int *__restrict);
32
33
  char *fcvt(double, int, int *__restrict, int *__restrict);
33
34
  char *gcvt(double, int, char *);
@@ -35,6 +35,8 @@ int pthread_getugid_np(uid_t *, gid_t *);
35
35
  int dup(int) __asm__("__peach_darwin_dup");
36
36
  int dup2(int, int) __asm__("__peach_darwin_dup2");
37
37
  int pipe(int [2]);
38
+ pid_t setsid(void);
39
+ int chown(const char *, uid_t, gid_t);
38
40
  int mkpath_np(const char *, mode_t);
39
41
  #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
40
42
  long syscall(long, ...);
@@ -41,6 +41,7 @@ automation, inspecting the render tree, and managing sims.
41
41
  | `peach shell` | drive shell state and simulator chrome |
42
42
  | `peach mode` | toggle screenshot, touch indicators, the agent indicator, and 3D display modes |
43
43
  | `peach device` | inspect or change the live device preset for a sim |
44
+ | `peach settings` | read or change the device settings of a running sim |
44
45
  | `peach network` | inspect live network traffic from the running peach worker |
45
46
  | `peach logs` | inspect live console output from the running peach worker |
46
47
  | `peach debug` | drive __sootsimDebug: channels, snapshots, and inspectors |
@@ -46,7 +46,7 @@ the target is unchanged. Pin once with `peach use <id>` and keep that sim for
46
46
  the investigation; `--sim <id>` overrides the selection for one call.
47
47
 
48
48
  - Run `peach list` before opening another sim. Use `--new` only for concurrent
49
- work. `--profile` and `--ephemeral` also create isolated browser trees.
49
+ work. `--storage-profile` and `--ephemeral` also create isolated browser trees.
50
50
  - Never force a lease held by another CLI. Use a separate sim instead; close
51
51
  only sims you own with `peach close <id>`.
52
52
  - After reconnecting, check the sim id printed by commands and confirm the tree.
@@ -58,6 +58,16 @@ available for automation. Let ordinary opens select the supported window for
58
58
  the platform. A yellow GPU-disabled indicator means software rendering; check
59
59
  GPU configuration before treating its performance as representative.
60
60
 
61
+ To open with device settings (dynamic type, bold text, increase contrast,
62
+ appearance, locale), name them under `profiles` in the app's `peach.config.ts`
63
+ and pass `--profile <name>`, or pass one-off flags such as `--font-size 1.786`,
64
+ `--increase-contrast on` or `--theme dark`. `peach settings` reads a running
65
+ sim's settings and takes the same profile and flags to change them live.
66
+
67
+ ```ts
68
+ profiles: { accessibility: { fontSize: 1.786, boldText: true, increaseContrast: true } }
69
+ ```
70
+
61
71
  For clean isolated captures use `--new --ephemeral --driver playwright`.
62
72
  Native pixel comparisons also need `--render-resolution high`; use
63
73
  `peach-visual` for capture conditions.
@@ -40,7 +40,7 @@ export async function collectAndroidBridgeDependencies(
40
40
  const [sdk, ready] = await Promise.all([
41
41
  installKotlinSdkArchive(
42
42
  fs.readFileSync(path.join(moduleRoot, 'sdk.tar.gz')),
43
- toolchain.compiler.sha256,
43
+ toolchain.compiler,
44
44
  ),
45
45
  ensureToolchain(toolchain),
46
46
  ])
package/src/app-config.ts CHANGED
@@ -6,6 +6,7 @@ import { resolveAppStubs, wireSlotMigration, type AppStubs } from '../cli/app-st
6
6
  import * as peachConfigModule from './config'
7
7
  import { isPeachConfig, type PeachConfig } from './config'
8
8
  import { rnxPublicBrand } from './public-brand'
9
+ import { readSettingsProfile } from './settingsContract'
9
10
  import { loadStoreKitTestStore } from './storekit-test-store'
10
11
 
11
12
  // `{ file }` entries are relative to the config file; the engine loads them by
@@ -88,6 +89,12 @@ async function loadConfigFile(
88
89
  if (!isPeachConfig(loaded)) {
89
90
  throw new Error('the default export must be a peach config object')
90
91
  }
92
+ if (Object.hasOwn(loaded, 'settings'))
93
+ throw new Error(
94
+ 'settings moved under profiles, each a name for a set of device settings: profiles: { accessibility: { fontSize: 1.786, increaseContrast: true } }, applied with peach open --profile accessibility',
95
+ )
96
+ for (const [name, profile] of Object.entries(loaded.profiles ?? {}))
97
+ readSettingsProfile(profile, `profiles.${name}`)
91
98
  if (loaded.nativeHybridObjects !== undefined)
92
99
  throw new Error(
93
100
  'nativeHybridObjects moved under packages, keyed by the package that registers each name: packages: { "<package>": { hybridObjects: { <Name>: "unsupported" | "./file.ts" } } }',
@@ -0,0 +1,21 @@
1
+ {
2
+ "version": "132",
3
+ "licenseSha256": "64c0d02491e16eced74826440ecd2bcf7722d37fa586faf457b2494293afbffe",
4
+ "platforms": {
5
+ "linux-x64": {
6
+ "asset": "x86_64-linux",
7
+ "upstreamSha256": "195ddc94f9bc89f45abdabb0b9eea86023d727ba90eac8b35b80f2544fc30572",
8
+ "sha256": "0396b1a540e9f97f30eb6a378d829305c218c821a0bd88c74e83d3d6923dad0b"
9
+ },
10
+ "linux-arm64": {
11
+ "asset": "aarch64-linux",
12
+ "upstreamSha256": "c58562417836c5d0493d89bdefc434933bdc097db641b483df86bcfa557a107f",
13
+ "sha256": "25e3747f19614b0281a28b9a909ddc602b546ccdfacebc8cae2f7165665328fa"
14
+ },
15
+ "darwin-arm64": {
16
+ "asset": "arm64-macos",
17
+ "upstreamSha256": "98aad827847af7ef990ed7098d885725c8e5b5aae75073403635617ae4e259aa",
18
+ "sha256": "34281566fe32df71337aaf0b60aa265dc853587d92bda0b5b1fac8aed8c2f8ab"
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,52 @@
1
+ // CocoaPods trunk through its CDN, as CocoaPods' CDNSource reads it: a pod's
2
+ // published versions sit in a shard file named for the md5 of its name, and
3
+ // each version's JSON podspec under the same shard.
4
+ import { createHash } from 'node:crypto'
5
+ import fs from 'node:fs'
6
+ import path from 'node:path'
7
+ import { cacheDir } from './home-paths'
8
+
9
+ const shard = (name: string) =>
10
+ createHash('md5').update(name).digest('hex').slice(0, 3).split('')
11
+
12
+ // the version lists change as pods publish, so a process reads each shard once
13
+ const shards = new Map<string, Promise<string>>()
14
+
15
+ async function cdnText(url: string): Promise<string> {
16
+ const response = await fetch(url)
17
+ if (!response.ok) throw new Error(`CocoaPods trunk ${url}: HTTP ${response.status}`)
18
+ return response.text()
19
+ }
20
+
21
+ /** the versions trunk publishes for `name`, or null when trunk has no such pod. */
22
+ export async function trunkVersions(name: string): Promise<string[] | null> {
23
+ const key = shard(name).join('_')
24
+ let text = shards.get(key)
25
+ if (!text) {
26
+ text = cdnText(`https://cdn.cocoapods.org/all_pods_versions_${key}.txt`)
27
+ shards.set(key, text)
28
+ }
29
+ const line = (await text).split('\n').find((entry) => entry.startsWith(`${name}/`))
30
+ if (!line) return null
31
+ return line
32
+ .slice(name.length + 1)
33
+ .split('/')
34
+ .filter(Boolean)
35
+ }
36
+
37
+ /** the cached file holding trunk's JSON podspec for `name` at `version`. */
38
+ export async function trunkSpecificationFile(
39
+ name: string,
40
+ version: string,
41
+ ): Promise<string> {
42
+ const file = path.join(cacheDir(), 'cocoapods-trunk', name, `${version}.podspec.json`)
43
+ if (fs.existsSync(file)) return file
44
+ const text = await cdnText(
45
+ `https://cdn.cocoapods.org/Specs/${shard(name).join('/')}/${name}/${version}/${name}.podspec.json`,
46
+ )
47
+ fs.mkdirSync(path.dirname(file), { recursive: true })
48
+ const staged = `${file}.${process.pid}`
49
+ fs.writeFileSync(staged, text)
50
+ fs.renameSync(staged, file)
51
+ return file
52
+ }
package/src/config.ts CHANGED
@@ -1,4 +1,4 @@
1
- // peach.config.ts — per-app module resolution, turbo modules, env, state, and settings.
1
+ // peach.config.ts — per-app module resolution, native stubs, env, state, and settings profiles.
2
2
  //
3
3
  // usage:
4
4
  // import { defineConfig } from 'peachsim/config'
@@ -8,7 +8,9 @@ import { isValidRuntimeVersion } from '@contrast/runtime-delivery/version'
8
8
  import { findBundleFooter } from '@peach/globals/bundle-global-footer'
9
9
  import { isRecord } from './is-record'
10
10
  import { isNativeViewSource, type NativeViewSource } from './nativeViewSourceContract'
11
+ import type { SettingsProfile } from './settingsContract'
11
12
  export type { NativeViewSource } from './nativeViewSourceContract'
13
+ export type { SettingsProfile } from './settingsContract'
12
14
  import type { RevenueCatTestStoreConfig } from '@peach/compat/revenuecat-test-store'
13
15
 
14
16
  export type NativeRenderer = 'paper' | 'fabric'
@@ -137,7 +139,7 @@ export function isPackageStubs(value: unknown): value is PackageStubs {
137
139
  )
138
140
  }
139
141
 
140
- export interface PeachConfig<Settings extends Record<string, any> = Record<string, any>> {
142
+ export interface PeachConfig {
141
143
  storeKit?: { configuration: string }
142
144
  // host-only engine selection. omitted means the current stable runtime.
143
145
  runtimeVersion?: string
@@ -164,7 +166,10 @@ export interface PeachConfig<Settings extends Record<string, any> = Record<strin
164
166
  network?: {
165
167
  remap?: Record<string, string>
166
168
  }
167
- settings?: Partial<Settings>
169
+ // named device settings (dynamic type, contrast, appearance, locale) that
170
+ // `peach open --profile <name>` and `peach settings --profile <name>`
171
+ // apply. the cli reads them; they never travel to the engine.
172
+ profiles?: Record<string, SettingsProfile>
168
173
  // the properties a native host hands the root component at launch, the
169
174
  // initialProperties of RCTRootView / runApplication's initialProps.
170
175
  initialProps?: Record<string, unknown>
@@ -202,9 +207,7 @@ export function collectConfiguredFileModules(config?: PeachConfig): string[] {
202
207
  ]
203
208
  }
204
209
 
205
- export function isPeachConfig<Settings extends Record<string, any> = Record<string, any>>(
206
- value: unknown,
207
- ): value is PeachConfig<Settings> {
210
+ export function isPeachConfig(value: unknown): value is PeachConfig {
208
211
  if (!isRecord(value)) return false
209
212
  return (
210
213
  (value.storeKit === undefined ||
@@ -232,7 +235,7 @@ export function isPeachConfig<Settings extends Record<string, any> = Record<stri
232
235
  'nativeHybridObjects',
233
236
  'env',
234
237
  'network',
235
- 'settings',
238
+ 'profiles',
236
239
  'initialProps',
237
240
  'initialState',
238
241
  ].every((key) => value[key] === undefined || isRecord(value[key])) &&
@@ -308,9 +311,7 @@ export function detachPeachBundleConfigFooter(source: string): {
308
311
  }
309
312
  }
310
313
 
311
- export function defineConfig<Settings extends Record<string, any> = Record<string, any>>(
312
- config: PeachConfig<Settings>,
313
- ): PeachConfig<Settings> {
314
+ export function defineConfig(config: PeachConfig): PeachConfig {
314
315
  return config
315
316
  }
316
317
 
@@ -318,9 +319,7 @@ function hasOwnKeys(value: Record<string, unknown> | undefined): boolean {
318
319
  return !!value && Object.keys(value).length > 0
319
320
  }
320
321
 
321
- export function hasPeachConfig<
322
- Settings extends Record<string, any> = Record<string, any>,
323
- >(config?: PeachConfig<Settings> | null): config is PeachConfig<Settings> {
322
+ export function hasPeachConfig(config?: PeachConfig | null): config is PeachConfig {
324
323
  if (!config) return false
325
324
  return (
326
325
  config.nativeRenderer !== undefined ||
@@ -333,18 +332,15 @@ export function hasPeachConfig<
333
332
  hasOwnKeys(config.nativeHybridObjects) ||
334
333
  hasOwnKeys(config.env as Record<string, unknown> | undefined) ||
335
334
  hasOwnKeys(config.network?.remap as Record<string, unknown> | undefined) ||
336
- hasOwnKeys(config.settings as Record<string, unknown> | undefined) ||
337
335
  hasOwnKeys(config.initialProps) ||
338
336
  hasOwnKeys(config.initialState as Record<string, unknown> | undefined)
339
337
  )
340
338
  }
341
339
 
342
- export function mergePeachConfig<
343
- Settings extends Record<string, any> = Record<string, any>,
344
- >(
345
- base?: PeachConfig<Settings> | null,
346
- override?: PeachConfig<Settings> | null,
347
- ): PeachConfig<Settings> | undefined {
340
+ export function mergePeachConfig(
341
+ base?: PeachConfig | null,
342
+ override?: PeachConfig | null,
343
+ ): PeachConfig | undefined {
348
344
  if (!hasPeachConfig(base) && !hasPeachConfig(override)) return undefined
349
345
  if (!hasPeachConfig(base)) return override ? { ...override } : undefined
350
346
  if (!hasPeachConfig(override)) return base ? { ...base } : undefined
@@ -368,18 +364,14 @@ export function mergePeachConfig<
368
364
  network: {
369
365
  remap: { ...(base.network?.remap || {}), ...(override.network?.remap || {}) },
370
366
  },
371
- settings: {
372
- ...(base.settings || {}),
373
- ...(override.settings || {}),
374
- } as Partial<Settings>,
375
367
  initialProps: { ...(base.initialProps || {}), ...(override.initialProps || {}) },
376
368
  initialState: { ...(base.initialState || {}), ...(override.initialState || {}) },
377
369
  }
378
370
  }
379
371
 
380
- export function readPeachConfigFromSearchParams<
381
- Settings extends Record<string, any> = Record<string, any>,
382
- >(searchParams: URLSearchParams): PeachConfig<Settings> | undefined {
372
+ export function readPeachConfigFromSearchParams(
373
+ searchParams: URLSearchParams,
374
+ ): PeachConfig | undefined {
383
375
  const raw = searchParams.get(PEACH_CONFIG_QUERY_PARAM)
384
376
  if (!raw) return undefined
385
377
  let parsed: unknown
@@ -391,12 +383,10 @@ export function readPeachConfigFromSearchParams<
391
383
  return undefined
392
384
  }
393
385
  if (isRecord(parsed)) readNativeRenderer(parsed.nativeRenderer)
394
- return isPeachConfig<Settings>(parsed) && hasPeachConfig(parsed) ? parsed : undefined
386
+ return isPeachConfig(parsed) && hasPeachConfig(parsed) ? parsed : undefined
395
387
  }
396
388
 
397
- export function applyPeachConfigToUrl<
398
- Settings extends Record<string, any> = Record<string, any>,
399
- >(url: string, config?: PeachConfig<Settings> | null): string {
389
+ export function applyPeachConfigToUrl(url: string, config?: PeachConfig | null): string {
400
390
  const parsed = new URL(url)
401
391
  if (hasPeachConfig(config)) {
402
392
  parsed.searchParams.set(PEACH_CONFIG_QUERY_PARAM, JSON.stringify(config))
@@ -124,6 +124,10 @@ export async function hashExpoSourceWorkspace(app: string, signal?: AbortSignal)
124
124
  return { root, hash }
125
125
  }
126
126
 
127
+ export async function hashExpoNativeWorkspaceInputs(app: string) {
128
+ return (await hashWorkspaceInputs(app, false, undefined, true)).nativeHash
129
+ }
130
+
127
131
  // a portable producer cannot claim the live app's hash unless the prepared
128
132
  // copy actually holds those bytes, including files outside the native graph.
129
133
  export async function verifyExpoWorkspaceCopy(app: string, work: string) {
@@ -52,7 +52,7 @@ const run = promisify(execFile)
52
52
  function loadKotlinSdk(moduleRoot: string, toolchain: KotlinToolchain) {
53
53
  return installKotlinSdkArchive(
54
54
  fs.readFileSync(path.join(moduleRoot, 'sdk.tar.gz')),
55
- toolchain.compiler.sha256,
55
+ toolchain.compiler,
56
56
  )
57
57
  }
58
58