peachsim 0.1.1654 → 0.1.1659
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/cli/app-config.ts +4 -0
- package/cli/app-stubs.ts +43 -6
- package/cli/commands/inspect/shared.ts +5 -2
- package/cli/commands/inspect/url.ts +2 -1
- package/cli/commands/screenshot.ts +5 -5
- package/cli/commands/state.ts +9 -6
- package/cli/outbound-endpoints.ts +9 -1
- package/cli/output-redaction.ts +49 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +11485 -1316
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +29 -5
- package/dist-lib/config.mjs +29 -5
- package/dist-lib/detox/index.cjs +19 -5
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +9194 -327
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +10137 -1043
- package/dist-lib/host/fetch-proxy-handler.cjs +260 -182
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +653 -338
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +443 -312
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +548 -163
- package/dist-lib/native-app-identity-project.cjs +179 -33
- package/dist-lib/native-app-identity-project.mjs +179 -33
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +23 -23
- package/dist-lib/public-origins-lib.json +96 -63
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +10885 -1596
- package/dist-lib/swift-compile.cjs +9036 -331
- package/dist-lib/swift-compile.mjs +9036 -331
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +9194 -327
- package/dist-lib/vite.cjs +149 -163
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/app-font-registry.d.ts +14 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +8 -0
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +21 -0
- package/dist-types/packages/peach-engine/src/render-worker/gesture-seam-protocol.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/test-bridge-protocol.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +5 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +25 -0
- package/kotlin/README.md +38 -23
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +2 -12
- package/runtime-companion.json +1 -1
- package/src/bundleGlobalFooter.ts +0 -2
- package/src/config.ts +54 -2
- package/src/configured-bundle-producer.ts +7 -1
- package/src/host/fetch-proxy-handler.ts +14 -33
- package/src/host/rolldown-bundle-forward.ts +71 -0
- package/src/installed-package-versions.ts +54 -2
- package/src/kotlin-host.ts +138 -285
- package/src/kotlin-module.ts +4 -7
- package/src/kotlin-sdk.ts +81 -0
- package/src/kotlin-toolchain.ts +152 -0
- package/src/kotlin-view-models.ts +1 -1
- package/src/kotlinSdkContract.ts +113 -0
- package/src/nitro-adapter.lock.json +3 -3
- package/src/nitro-bundle.ts +18 -4
- package/src/nitro-compile.ts +5 -1
- package/src/nitro-source.ts +112 -28
- package/src/nitroContract.ts +16 -4
- package/src/swift-compile.ts +295 -237
- package/src/swift-host.ts +2 -1
- package/src/swift-objc-compile.ts +117 -4
- package/src/swift-objc-sdk.ts +8792 -135
- package/src/swift-objc-standin.ts +1 -0
- package/src/swiftContract.ts +2 -0
- package/src/vite-plugin-one.ts +73 -134
- package/src/worker-system-chunks.ts +14 -4
- package/src/xcode-project.ts +261 -34
- package/kotlin/AndroidViewSources/android/content/Context.kt +0 -22
- package/kotlin/AndroidViewSources/android/content/res/Configuration.kt +0 -25
- package/kotlin/AndroidViewSources/android/content/res/Resources.kt +0 -72
- package/kotlin/AndroidViewSources/android/graphics/Canvas.kt +0 -22
- package/kotlin/AndroidViewSources/android/graphics/Color.kt +0 -13
- package/kotlin/AndroidViewSources/android/graphics/Paint.kt +0 -18
- package/kotlin/AndroidViewSources/android/util/DisplayMetrics.kt +0 -12
- package/kotlin/AndroidViewSources/android/view/View.kt +0 -211
- package/kotlin/AndroidViewSources/android/widget/FrameLayout.kt +0 -61
- package/kotlin/AndroidViewSources/android/widget/LinearLayout.kt +0 -49
- package/kotlin/AndroidViewSources/dev/peach/app/JavaFormat.kt +0 -272
- package/kotlin/AppSources/android/app/Activity.kt +0 -174
- package/kotlin/AppSources/android/app/Application.kt +0 -11
- package/kotlin/AppSources/android/app/UiModeManager.kt +0 -9
- package/kotlin/AppSources/android/content/Intent.kt +0 -16
- package/kotlin/AppSources/android/os/Bundle.kt +0 -11
- package/kotlin/AppSources/android/util/SuperNotCalledException.kt +0 -3
- package/kotlin/AppSources/android/view/Window.kt +0 -182
- package/kotlin/AppSources/android/view/WindowInsets.kt +0 -9
- package/kotlin/AppSources/android/view/WindowInsetsController.kt +0 -17
- package/kotlin/AppSources/android/view/WindowManager.kt +0 -16
- package/kotlin/AppSources/android/window/BackEvent.kt +0 -24
- package/kotlin/AppSources/android/window/OnBackAnimationCallback.kt +0 -7
- package/kotlin/AppSources/android/window/OnBackInvokedDispatcher.kt +0 -84
- package/kotlin/AppSources/androidx/activity/ActivityFlags.kt +0 -9
- package/kotlin/AppSources/androidx/activity/ActivityViewModelLazy.kt +0 -21
- package/kotlin/AppSources/androidx/activity/BackEventCompat.kt +0 -43
- package/kotlin/AppSources/androidx/activity/ComponentActivity.kt +0 -122
- package/kotlin/AppSources/androidx/activity/EdgeToEdge.kt +0 -75
- package/kotlin/AppSources/androidx/activity/ExperimentalActivityApi.kt +0 -6
- package/kotlin/AppSources/androidx/activity/OnBackPressedCallback.kt +0 -69
- package/kotlin/AppSources/androidx/activity/OnBackPressedDispatcher.kt +0 -144
- package/kotlin/AppSources/androidx/activity/OnBackPressedDispatcherOwner.kt +0 -7
- package/kotlin/AppSources/androidx/activity/compose/BackHandler.kt +0 -86
- package/kotlin/AppSources/androidx/activity/compose/ComponentActivity.kt +0 -29
- package/kotlin/AppSources/androidx/activity/compose/internal/BackHandlerCompat.kt +0 -38
- package/kotlin/AppSources/androidx/activity/compose/internal/BackHandlerDispatcherCompat.kt +0 -27
- package/kotlin/AppSources/androidx/compose/foundation/layout/WindowInsets.kt +0 -15
- package/kotlin/AppSources/androidx/compose/ui/platform/AndroidCompositionLocals.kt +0 -27
- package/kotlin/AppSources/androidx/compose/ui/platform/ComposeView.kt +0 -68
- package/kotlin/AppSources/androidx/compose/ui/res/ColorResources.kt +0 -16
- package/kotlin/AppSources/androidx/compose/ui/res/PainterResources.kt +0 -70
- package/kotlin/AppSources/androidx/compose/ui/res/StringResources.kt +0 -38
- package/kotlin/AppSources/androidx/core/view/WindowCompat.kt +0 -32
- package/kotlin/AppSources/androidx/lifecycle/AndroidViewModel.kt +0 -10
- package/kotlin/AppSources/dev/peach/app/PeachApp.kt +0 -388
- package/kotlin/AppSources/dev/peach/app/PeachDrawable.kt +0 -102
- package/kotlin/AppSources/dev/peach/app/PeachWindowHost.kt +0 -14
- package/kotlin/CompilerSources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar +0 -1
- package/kotlin/CompilerSources/PeachJniIncoming.kt +0 -243
- package/kotlin/CompilerSources/PeachJniPlugin.kt +0 -116
- package/kotlin/ComposeSources/PeachComposeHost.kt +0 -724
- package/kotlin/ComposeSources/PeachMagnifier.kt +0 -185
- package/kotlin/ComposeSources/PeachSemantics.kt +0 -127
- package/kotlin/ExpoComposeSources/PeachAndroidView.kt +0 -103
- package/kotlin/ExpoComposeSources/PeachExpoViewMount.kt +0 -24
- package/kotlin/ExpoComposeSources/dev/peach/expo/PeachExpoCompose.kt +0 -28
- package/kotlin/ExpoComposeSources/expo/modules/kotlin/views/ExpoComposeView.kt +0 -70
- package/kotlin/ExpoSources/dev/peach/expo/PeachExpoRuntime.kt +0 -516
- package/kotlin/ExpoSources/dev/peach/expo/PeachExpoTypes.kt +0 -173
- package/kotlin/ExpoSources/expo/modules/kotlin/AppContext.kt +0 -20
- package/kotlin/ExpoSources/expo/modules/kotlin/Promise.kt +0 -19
- package/kotlin/ExpoSources/expo/modules/kotlin/classcomponent/ClassComponentBuilder.kt +0 -198
- package/kotlin/ExpoSources/expo/modules/kotlin/exception/CodedException.kt +0 -126
- package/kotlin/ExpoSources/expo/modules/kotlin/functions/Functions.kt +0 -132
- package/kotlin/ExpoSources/expo/modules/kotlin/jni/JavaScriptTypedArray.kt +0 -81
- package/kotlin/ExpoSources/expo/modules/kotlin/modules/Module.kt +0 -98
- package/kotlin/ExpoSources/expo/modules/kotlin/objects/ObjectDefinitionBuilder.kt +0 -236
- package/kotlin/ExpoSources/expo/modules/kotlin/records/Record.kt +0 -12
- package/kotlin/ExpoSources/expo/modules/kotlin/runtime/Runtime.kt +0 -9
- package/kotlin/ExpoSources/expo/modules/kotlin/sharedobjects/SharedObject.kt +0 -50
- package/kotlin/ExpoSources/expo/modules/kotlin/sharedobjects/SharedObjectRegistry.kt +0 -57
- package/kotlin/ExpoSources/expo/modules/kotlin/sharedobjects/SharedRef.kt +0 -19
- package/kotlin/ExpoSources/expo/modules/kotlin/typedarray/ConcreteTypedArrays.kt +0 -158
- package/kotlin/ExpoSources/expo/modules/kotlin/typedarray/GenericTypedArray.kt +0 -8
- package/kotlin/ExpoSources/expo/modules/kotlin/typedarray/TypedArray.kt +0 -29
- package/kotlin/ExpoSources/expo/modules/kotlin/typedarray/TypedArrayIterator.kt +0 -9
- package/kotlin/ExpoSources/expo/modules/kotlin/types/AnyType.kt +0 -155
- package/kotlin/ExpoSources/expo/modules/kotlin/types/Either.kt +0 -91
- package/kotlin/ExpoSources/expo/modules/kotlin/types/Enumerable.kt +0 -6
- package/kotlin/ExpoSources/expo/modules/kotlin/viewevent/ViewEvent.kt +0 -68
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ExpoView.kt +0 -20
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewDefinitionBuilder.kt +0 -72
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewProps.kt +0 -36
- package/kotlin/JniPlatformSources/androidx/annotation/CallSuper.kt +0 -5
- package/kotlin/JniPlatformSources/com/facebook/proguard/annotations/DoNotStrip.kt +0 -5
- package/kotlin/JniPlatformSources/dalvik/annotation/optimization/FastNative.kt +0 -5
- package/kotlin/JniPlatformSources/kotlin/Synchronized.kt +0 -6
- package/kotlin/JniPlatformSources/kotlin/jvm/JvmField.kt +0 -5
- package/kotlin/JniPlatformSources/kotlin/jvm/JvmStatic.kt +0 -5
- package/kotlin/JniSources/com/facebook/jni/HybridData.kt +0 -66
- package/kotlin/JniSources/dev/peach/jni/IncomingBindings.kt +0 -157
- package/kotlin/JniSources/dev/peach/jni/NativeBindings.kt +0 -77
- package/kotlin/JniTransportSources/dev/peach/jni/integration/JniTransport.kt +0 -89
- package/kotlin/Sources/android/os/Build.kt +0 -17
- package/kotlin/Sources/android/os/Handler.kt +0 -35
- package/kotlin/Sources/android/os/Looper.kt +0 -17
- package/kotlin/Sources/android/os/MessageQueue.kt +0 -56
- package/kotlin/Sources/android/os/SystemClock.kt +0 -14
- package/kotlin/Sources/android/util/Log.kt +0 -64
- package/kotlin/Sources/androidx/annotation/DrawableRes.kt +0 -14
- package/kotlin/Sources/androidx/annotation/Keep.kt +0 -4
- package/kotlin/Sources/dev/onejs/one/OneNativeSourceDispatch.kt +0 -7
- package/kotlin/Sources/dev/onejs/one/OneNativeSourceViewDispatch.kt +0 -13
- package/kotlin/Sources/dev/onejs/one/source/OneModule.kt +0 -4
- package/kotlin/Sources/java/lang/Runnable.kt +0 -6
- package/kotlin/Sources/java/security/MessageDigest.kt +0 -114
- package/kotlin/Sources/java/util/IllegalFormatCodePointException.kt +0 -10
- package/kotlin/Sources/java/util/IllegalFormatException.kt +0 -5
- package/kotlin/Sources/kotlin/text/StringFormat.kt +0 -9
- package/kotlin/Sources/org/json/JSON.kt +0 -307
- package/kotlin/tools/abi-classes.main.kts +0 -41
- package/kotlin/tools/expo-types.main.kts +0 -127
package/cli/app-config.ts
CHANGED
|
@@ -87,6 +87,10 @@ async function loadConfigFile(
|
|
|
87
87
|
if (!isPeachConfig(loaded)) {
|
|
88
88
|
throw new Error('the default export must be a peach config object')
|
|
89
89
|
}
|
|
90
|
+
if (loaded.nativeHybridObjects !== undefined)
|
|
91
|
+
throw new Error(
|
|
92
|
+
'nativeHybridObjects moved under packages, keyed by the package that registers each name: packages: { "<package>": { hybridObjects: { <Name>: "unsupported" | "./file.ts" } } }',
|
|
93
|
+
)
|
|
90
94
|
const wire = WIRE_SLOTS.filter((slot) => loaded[slot] !== undefined)
|
|
91
95
|
if (wire.length > 0) {
|
|
92
96
|
const slots: readonly string[] = WIRE_SLOTS
|
package/cli/app-stubs.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { parseSync, type Expression, type PrivateIdentifier } from 'oxc-parser'
|
|
|
17
17
|
import { transform } from 'sucrase'
|
|
18
18
|
import {
|
|
19
19
|
isPackageStubs,
|
|
20
|
+
type HybridObjectAnswer,
|
|
20
21
|
type NativeModuleResolution,
|
|
21
22
|
type NativeStub,
|
|
22
23
|
type NativeViewResolution,
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
type PeachConfig,
|
|
26
27
|
} from '../src/config'
|
|
27
28
|
import { isRecord } from '../src/is-record'
|
|
29
|
+
import { nitroRegisteredNames } from '../src/nitro-source'
|
|
28
30
|
import { rnxPublicBrand } from '../src/public-brand'
|
|
29
31
|
import { visitParsedProgram } from '../src/visit-parsed-program'
|
|
30
32
|
import {
|
|
@@ -104,13 +106,15 @@ export function resolveAppStubs(
|
|
|
104
106
|
const target = stubTarget ?? name
|
|
105
107
|
const field = installed.peach
|
|
106
108
|
const versions = isRecord(field) ? field.versions : undefined
|
|
107
|
-
const stubs = isRecord(field)
|
|
109
|
+
const stubs = isRecord(field)
|
|
110
|
+
? { modules: field.modules, views: field.views, hybridObjects: field.hybridObjects }
|
|
111
|
+
: field
|
|
108
112
|
if (
|
|
109
113
|
!isPackageStubs(stubs) ||
|
|
110
114
|
(versions !== undefined && typeof versions !== 'string')
|
|
111
115
|
)
|
|
112
116
|
throw new Error(
|
|
113
|
-
`${name}'s package.json "peach" field must be "noop" or { versions?, modules?, views? } whose values are "noop" or file paths`,
|
|
117
|
+
`${name}'s package.json "peach" field must be "noop" or { versions?, modules?, views?, hybridObjects? } whose values are "noop" or file paths ("unsupported" or a file path for hybridObjects, never "noop")`,
|
|
114
118
|
)
|
|
115
119
|
const providerVersion =
|
|
116
120
|
typeof installed.version === 'string' ? installed.version : null
|
|
@@ -173,9 +177,14 @@ export function resolveAppStubs(
|
|
|
173
177
|
sources.sort((a, b) => ORDER[a.origin] - ORDER[b.origin])
|
|
174
178
|
const nativeModules: Record<string, NativeModuleResolution> = {}
|
|
175
179
|
const nativeViews: Record<string, NativeViewResolution> = {}
|
|
180
|
+
const nativeHybridObjects: Record<string, HybridObjectAnswer> = {}
|
|
176
181
|
const applied: AppliedStubs[] = []
|
|
177
182
|
for (const source of sources) {
|
|
178
|
-
const { modules, views } = expandStubs(appDir, source)
|
|
183
|
+
const { modules, views, hybridObjects } = expandStubs(appDir, source)
|
|
184
|
+
assertRegisteredHybridObjects(appDir, source, hybridObjects)
|
|
185
|
+
for (const [name, answer] of Object.entries(hybridObjects))
|
|
186
|
+
nativeHybridObjects[name] =
|
|
187
|
+
answer === 'unsupported' ? answer : { file: resolve(source.baseDir, answer) }
|
|
179
188
|
for (const [name, stub] of Object.entries(modules))
|
|
180
189
|
nativeModules[name] = lowerStub(stub, source.baseDir)
|
|
181
190
|
for (const [name, stub] of Object.entries(views))
|
|
@@ -202,7 +211,12 @@ export function resolveAppStubs(
|
|
|
202
211
|
}
|
|
203
212
|
const stubs = { applied, skipped }
|
|
204
213
|
if (!config && applied.length === 0) return { config, stubs }
|
|
205
|
-
const lowered: PeachConfig = {
|
|
214
|
+
const lowered: PeachConfig = {
|
|
215
|
+
...config,
|
|
216
|
+
nativeModules,
|
|
217
|
+
nativeViews,
|
|
218
|
+
nativeHybridObjects,
|
|
219
|
+
}
|
|
206
220
|
delete lowered.packages
|
|
207
221
|
return { config: lowered, stubs }
|
|
208
222
|
}
|
|
@@ -214,9 +228,14 @@ function expandStubs(
|
|
|
214
228
|
): {
|
|
215
229
|
modules: Record<string, NativeStub>
|
|
216
230
|
views: Record<string, NativeStub | NativeViewSource>
|
|
231
|
+
hybridObjects: Record<string, string>
|
|
217
232
|
} {
|
|
218
233
|
if (source.stubs !== 'noop')
|
|
219
|
-
return {
|
|
234
|
+
return {
|
|
235
|
+
modules: source.stubs.modules ?? {},
|
|
236
|
+
views: source.stubs.views ?? {},
|
|
237
|
+
hybridObjects: source.stubs.hybridObjects ?? {},
|
|
238
|
+
}
|
|
220
239
|
const dir = installedPackageDir(appDir, source.target)
|
|
221
240
|
if (!dir)
|
|
222
241
|
throw new Error(
|
|
@@ -228,7 +247,25 @@ function expandStubs(
|
|
|
228
247
|
if (request.kind === 'module') modules[request.name] = 'noop'
|
|
229
248
|
else views[request.name] = 'noop'
|
|
230
249
|
}
|
|
231
|
-
return { modules, views }
|
|
250
|
+
return { modules, views, hybridObjects: {} }
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// a declared name must be one the package registers for iOS, so a misspelling
|
|
254
|
+
// or another package's name cannot silently leave a constructor registered
|
|
255
|
+
function assertRegisteredHybridObjects(
|
|
256
|
+
appDir: string,
|
|
257
|
+
source: StubSource,
|
|
258
|
+
hybridObjects: Record<string, string>,
|
|
259
|
+
): void {
|
|
260
|
+
const declared = Object.keys(hybridObjects)
|
|
261
|
+
if (declared.length === 0) return
|
|
262
|
+
const dir = installedPackageDir(appDir, source.target)
|
|
263
|
+
const registered = (dir && nitroRegisteredNames(dir)?.names) || []
|
|
264
|
+
for (const name of declared)
|
|
265
|
+
if (!registered.includes(name))
|
|
266
|
+
throw new Error(
|
|
267
|
+
`packages[${JSON.stringify(source.target)}].hybridObjects: ${source.target} does not register the Nitro HybridObject ${JSON.stringify(name)} for iOS (registered: ${registered.join(', ') || 'none'})`,
|
|
268
|
+
)
|
|
232
269
|
}
|
|
233
270
|
|
|
234
271
|
function lowerStub(stub: NativeStub, baseDir: string): 'noop' | { file: string } {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// call-agnostic: just bridge-facing helpers that any subcommand can use.
|
|
6
6
|
|
|
7
7
|
import { sleep } from '../../../src/sleep'
|
|
8
|
+
import { redactConfigurationForDiagnostics } from '../../output-redaction'
|
|
8
9
|
import {
|
|
9
10
|
callInBridge,
|
|
10
11
|
callInBridgeWrite,
|
|
@@ -34,11 +35,13 @@ export function wantsJson(args: string[]): boolean {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
// emit a stable JSON document on stdout. no trailing prose, no ANSI,
|
|
37
|
-
// no colors. the 2-space indent matches the rest of the CLI and is
|
|
38
|
+
// no colors. peach configuration is redacted before printing. the 2-space indent matches the rest of the CLI and is
|
|
38
39
|
// cheap enough that pretty-printing by default is fine for bisect
|
|
39
40
|
// scripts — consumers who care pipe through `jq -c`.
|
|
40
41
|
export function printJson(payload: unknown): void {
|
|
41
|
-
process.stdout.write(
|
|
42
|
+
process.stdout.write(
|
|
43
|
+
`${redactConfigurationForDiagnostics(JSON.stringify(payload ?? null, null, 2))}\n`,
|
|
44
|
+
)
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
// warnings, hints, "screen transition still active" messages — anything
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// `peach get url` — prints the current page URL the bridge is attached to.
|
|
2
2
|
|
|
3
|
+
import { redactConfigurationForDiagnostics } from '../../output-redaction'
|
|
3
4
|
import { inspectUrl } from './core'
|
|
4
5
|
import { printJson, wantsJson } from './shared'
|
|
5
6
|
import type { WsBridge } from '../../ws-bridge'
|
|
@@ -13,5 +14,5 @@ export async function runUrlSubcommand(
|
|
|
13
14
|
printJson(result)
|
|
14
15
|
return
|
|
15
16
|
}
|
|
16
|
-
console.log(result.url)
|
|
17
|
+
console.log(redactConfigurationForDiagnostics(result.url))
|
|
17
18
|
}
|
|
@@ -225,11 +225,11 @@ async function captureViaBridge(
|
|
|
225
225
|
phaseStart = now
|
|
226
226
|
}
|
|
227
227
|
// 45s, not 10s: a first-paint capture on a headless CI runner with software
|
|
228
|
-
// GL (SwiftShader) is
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
-
//
|
|
232
|
-
//
|
|
228
|
+
// GL (SwiftShader) is slow. forceRenderAll runs two passes that each wait on
|
|
229
|
+
// the compositor's publication fence, whose own deadline (60s) only catches a
|
|
230
|
+
// lost worker, so this ceiling is what bounds a stuck capture. the readback
|
|
231
|
+
// and PNG encode of a full ~3.2M-px device frame add several seconds under
|
|
232
|
+
// build contention (metro serving a 24MB bundle, asset capture alongside).
|
|
233
233
|
// the prior 10s ceiling fired mid-capture, so every branch build landed with
|
|
234
234
|
// a null screenshotKey (no org-grid thumbnail). runtime proof: 3pc Contrast
|
|
235
235
|
// build 27864867412 logged `screenshot failed: command timed out after 10s`.
|
package/cli/commands/state.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { printBridgeFailureDiagnostics } from '../bridge-diagnostics'
|
|
2
|
+
import { redactConfigurationForDiagnostics as safe } from '../output-redaction'
|
|
2
3
|
import {
|
|
3
4
|
type BridgeTransportOption,
|
|
4
5
|
createBridgeFromParsed,
|
|
@@ -57,21 +58,21 @@ export async function runState(
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
if (args.includes('--json')) {
|
|
60
|
-
console.log(JSON.stringify(value))
|
|
61
|
+
console.log(safe(JSON.stringify(value)))
|
|
61
62
|
return 0
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
const route = value.route
|
|
65
|
-
console.log(` route: ${route?.screen ?? route?.url ?? '(unknown)'}`)
|
|
66
|
-
if (route?.stack?.length) console.log(` stack: ${route.stack.join(' > ')}`)
|
|
66
|
+
console.log(` route: ${safe(route?.screen ?? route?.url ?? '(unknown)')}`)
|
|
67
|
+
if (route?.stack?.length) console.log(` stack: ${safe(route.stack.join(' > '))}`)
|
|
67
68
|
console.log(` keyboard: ${value.keyboard?.visible ? 'visible' : 'hidden'}`)
|
|
68
69
|
console.log('')
|
|
69
|
-
console.log(value.tree ? formatSemanticTree(value.tree) : '')
|
|
70
|
+
console.log(value.tree ? safe(formatSemanticTree(value.tree)) : '')
|
|
70
71
|
console.log('')
|
|
71
72
|
if (value.recentErrors?.length) {
|
|
72
73
|
console.log(` recent errors (${value.recentErrors.length}):`)
|
|
73
74
|
for (const error of value.recentErrors) {
|
|
74
|
-
console.log(` [${error.level}] ${error.text}`)
|
|
75
|
+
console.log(` [${error.level}] ${safe(error.text)}`)
|
|
75
76
|
}
|
|
76
77
|
} else {
|
|
77
78
|
console.log(' recent errors: none')
|
|
@@ -85,7 +86,9 @@ export async function runState(
|
|
|
85
86
|
)
|
|
86
87
|
return 0
|
|
87
88
|
} catch (error) {
|
|
88
|
-
console.error(
|
|
89
|
+
console.error(
|
|
90
|
+
` state failed: ${safe(error instanceof Error ? error.message : String(error))}`,
|
|
91
|
+
)
|
|
89
92
|
await printBridgeFailureDiagnostics(bridge)
|
|
90
93
|
return 1
|
|
91
94
|
} finally {
|
|
@@ -865,7 +865,15 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
|
|
|
865
865
|
},
|
|
866
866
|
'packages/peachsim/src/host/fetch-proxy-handler.ts :: transport.request :: { hostname: normalizeHostname(targetUrl.hostname), port, path: targetUrl.pathname + targetUrl.search, method, headers: targetHeaders, agent: fetchProxyAgentFor(targetUrl), ...loopbackTlsOptions(targetUrl), }':
|
|
867
867
|
{ category: 'guest_app_network', count: 1 },
|
|
868
|
-
'packages/peachsim/src/
|
|
868
|
+
'packages/peachsim/src/vite-plugin-one.ts :: http.request :: options': {
|
|
869
|
+
category: 'local_development',
|
|
870
|
+
count: 1,
|
|
871
|
+
},
|
|
872
|
+
'packages/peachsim/src/vite-plugin-one.ts :: https.request :: options': {
|
|
873
|
+
category: 'local_development',
|
|
874
|
+
count: 1,
|
|
875
|
+
},
|
|
876
|
+
'packages/peachsim/src/kotlin-toolchain.ts :: fetch :: download.url': {
|
|
869
877
|
category: 'kotlin_toolchain_download',
|
|
870
878
|
count: 1,
|
|
871
879
|
},
|
package/cli/output-redaction.ts
CHANGED
|
@@ -138,7 +138,56 @@ function redactEncoded(value: string, configurationOnly: boolean): string {
|
|
|
138
138
|
return redacted === decoded ? value : encodeURIComponent(redacted)
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
// the end of the object or array starting at `start`, skipping quoted strings;
|
|
142
|
+
// text.length when it never closes, so an unterminated value is masked whole.
|
|
143
|
+
function closingIndex(text: string, start: number): number {
|
|
144
|
+
let depth = 0
|
|
145
|
+
let quote = ''
|
|
146
|
+
for (let i = start; i < text.length; i++) {
|
|
147
|
+
const char = text[i]
|
|
148
|
+
if (quote) {
|
|
149
|
+
if (char === '\\') i++
|
|
150
|
+
else if (char === quote) quote = ''
|
|
151
|
+
} else if (char === '"' || char === "'") quote = char
|
|
152
|
+
else if (char === '{' || char === '[') depth++
|
|
153
|
+
else if (char === '}' || char === ']') {
|
|
154
|
+
if (--depth === 0) return i + 1
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return text.length
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// the configuration key holding an object or array: the pair rule only sees
|
|
161
|
+
// strings and numbers, so the whole value is replaced here.
|
|
162
|
+
const CONFIG_CONTAINER = new RegExp(
|
|
163
|
+
String.raw`((?:"${PEACH_CONFIG_QUERY_PARAM}"|\b${PEACH_CONFIG_QUERY_PARAM})\s*:\s*)[{[]`,
|
|
164
|
+
'g',
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
function redactConfigContainers(text: string): string {
|
|
168
|
+
let out = ''
|
|
169
|
+
let from = 0
|
|
170
|
+
// a match inside a double-quoted string is prose or an escaped document;
|
|
171
|
+
// redactString decodes that string and reaches the match at its own level.
|
|
172
|
+
let inString = false
|
|
173
|
+
let scanned = 0
|
|
174
|
+
for (const match of text.matchAll(CONFIG_CONTAINER)) {
|
|
175
|
+
if (match.index < from) continue
|
|
176
|
+
for (; scanned < match.index; scanned++) {
|
|
177
|
+
if (text[scanned] === '\\') scanned++
|
|
178
|
+
else if (text[scanned] === '"') inString = !inString
|
|
179
|
+
}
|
|
180
|
+
if (inString) continue
|
|
181
|
+
const open = match.index + match[1].length
|
|
182
|
+
out += `${text.slice(from, match.index)}${match[1]}"[redacted]"`
|
|
183
|
+
from = closingIndex(text, open)
|
|
184
|
+
scanned = from
|
|
185
|
+
}
|
|
186
|
+
return out + text.slice(from)
|
|
187
|
+
}
|
|
188
|
+
|
|
141
189
|
function redactText(text: string, configurationOnly: boolean): string {
|
|
190
|
+
text = redactConfigContainers(text)
|
|
142
191
|
if (!configurationOnly) {
|
|
143
192
|
text = text
|
|
144
193
|
.replace(JWT, mask)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1659 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|