Repository navigation
Integrate RunAnywhere RN SDK 0.20.9 - #3
Merged
Merged
Conversation
Ports the starter from the 0.18.1 flat/mock API surface to the 0.20.9
proto-canonical surface, following the monorepo's react-native example
app (examples/react-native/RunAnywhereAI) as the reference for correct
API usage.
- package.json: bump @runanywhere/{core,llamacpp,onnx} to 0.20.9 and
react-native-nitro-modules to ^0.33.9 (required peer for 0.20.9);
drop package-lock.json (0.18.1 integrity entries no longer apply).
- tsconfig.json: moduleResolution -> "bundler" (0.20.9 uses proto-ts
deep subpath exports the legacy "node" resolver can't see), extends
the base config via its "." export instead of an unmapped deep path
(@react-native/typescript-config's package.json only exports "."),
lib -> "es2022" (0.20.9 needs AsyncIterable/AsyncIterator/
Symbol.asyncIterator), and types -> ["jest", "node"] (@types/node
supplies the full WHATWG URL/atob/btoa ambient globals the SDK's
network/audio helpers use; RN's own globals.d.ts only declares a
partial URL). Added @types/jest + @types/node dev deps accordingly.
- ModelService.tsx: unified loadModel/unloadModel/registerModel
(getModel/downloadModel/loadModel/unloadModel proto requests;
RunAnywhere.registerModel with InferenceFramework/ModelCategory/
ModelArtifactType instead of LlamaCPP.addModel/ONNX.addModel).
- ChatScreen: generateStream + RunAnywhere.aggregateStream with a
manual iterator loop under the hood (never `for await` a Nitro
async iterable on Hermes); cancel via RunAnywhere.cancelGeneration().
- ToolCallingScreen: proto ToolDefinition/ToolCall/ToolResult shapes
(name/argumentsJson/resultJson); ported the example app's real demo
tools (wttr.in weather, safe recursive-descent calculator, current
time) in place of the old random-number/Function() eval mocks;
dropped the removed parseToolCall demo.
- SpeechToTextScreen: transcribe() takes raw WAV bytes + STTLanguage/
AudioFormat enums, not base64 + {language: 'en'}; STT-loaded check
via modelInfoForCategory.
- TextToSpeechScreen: replaced the manual synthesize+WAV+native-player
pipeline with RunAnywhere.speak()/stopSpeaking() (SDK now owns
synthesis + playback end to end).
- VoicePipelineScreen: structural rewrite around
RunAnywhere.initializeVoiceAgentWithLoadedModels() +
VoiceAgentMicDriver (capture -> segment -> processVoiceTurn -> play,
all internal to the SDK) + RunAnywhere.cleanupVoiceAgent(), replacing
the removed startVoiceSession/VoiceSessionHandle/VoiceSessionEvent
API and the app's own WAV encoding/native audio playback.
Verified via local 0.20.9 tarballs (npm pack + workspace-protocol
rewrite of the 3 monorepo packages, matching the sdk's own
package-sdk.sh release recipe) installed with --legacy-peer-deps:
`npx tsc --noEmit` is clean. Not yet pod-installed or run on
simulator/device — pending the real registry publish.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T8PFRCwpmNzKLyMwFPGzCd
- Add @runanywhere/proto-ts (0.20.9) as an explicit direct dependency. @runanywhere/core/llamacpp/onnx each depend on it but npm nests it under each package's own node_modules instead of hoisting, so src/**/*.tsx imports of @runanywhere/proto-ts/* subpaths failed to resolve. Declaring it directly (matching the reference RN example app) hoists it to top-level node_modules. - Bump iOS deployment target to 17.5 in ios/Podfile (was min_ios_version_supported, RN's lower default) and in RunAnywhereStarter.xcodeproj (was 15.1) to match the RunAnywhereCore/ Llama/ONNX podspecs, which all require iOS 17.5+. Without this, pod install failed to resolve RunAnywhereONNX. - Commit package-lock.json from a clean install against the live npm registry. - PrivacyInfo.xcprivacy picked up aggregated privacy manifest entries from the bundled XCFrameworks during pod install; now byte-identical to the reference app's. Verified: npm install --legacy-peer-deps + npx tsc --noEmit clean, pod install succeeds (88 deps / 87 pods, RunAnywhereCore/Llama/ONNX all resolved at 0.20.9). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T8PFRCwpmNzKLyMwFPGzCd
Registers @runanywhere/mlx and @runanywhere/qhexrt at SDK init alongside the existing LlamaCPP/ONNX backends. MLX.register() and QHexRT.register() are additive and resolve to false on unsupported platforms/devices, so no new UI or platform branching is required.
react-native-screens resolved transitively to 4.26.0, which requires react-native >=0.84.0; the starter is on 0.83.1. Pin to 4.25.2 (peer >=0.82.0). tsc --noEmit clean against published @runanywhere/* 0.20.9. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T8PFRCwpmNzKLyMwFPGzCd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@runanywhere/{core,llamacpp,onnx}@0.20.9(not a local-pack port) plusreact-native-nitro-modules@^0.33.9.@runanywhere/mlxremains intentionally unpublished/unused.@runanywhere/proto-ts(a dependency of core/llamacpp/onnx) was getting nested under each package's ownnode_modulesinstead of hoisted, sosrc/**/*.tsximports of@runanywhere/proto-ts/*subpaths failed to resolve. Declared it as an explicit direct dependency at0.20.9(matching the reference RN example app) so npm hoists it to the top level.pod installfailed to resolveRunAnywhereONNXbecause the Podfile/Xcode project were pinned below iOS 17.5 (min_ios_version_supported/15.1), while the RunAnywhereCore/Llama/ONNX podspecs all require iOS 17.5+. Bumped both to17.5to match the reference app and the SDK's actual minimum.package-lock.jsonfrom a cleannpm install --legacy-peer-depsagainst the live registry (thereact-native-screensvs RN 0.83.1 peer conflict needs--legacy-peer-deps, as expected).PrivacyInfo.xcprivacypicked up aggregated privacy manifest entries from the bundled XCFrameworks duringpod install; now byte-identical to the reference app's.Test plan
npm install --legacy-peer-depssucceeds against the live npm registry (853→859 packages, 0 vulnerabilities beyond pre-existing deprecation warnings)@runanywhere/{core,llamacpp,onnx}resolve to0.20.9innode_modules;@runanywhere/mlxcorrectly absent (404 on registry)npx tsc --noEmitis clean (0 errors) — the authoritative gatecd ios && pod installsucceeds: 88 dependencies from the Podfile, 87 pods installed;RunAnywhereCore/RunAnywhereLlama/RunAnywhereONNXall resolve at0.20.9, native XCFrameworks download from the GitHub release correctlyhttps://claude.ai/code/session_01T8PFRCwpmNzKLyMwFPGzCd