Skip to content

Integrate RunAnywhere RN SDK 0.20.9 - #3

Merged
sanchitmonga22 merged 4 commits into
mainfrom
chore/integrate-0.20.9
Jul 13, 2026
Merged

sanchitmonga22 merged 4 commits into
mainfrom
chore/integrate-0.20.9

Conversation

@sanchitmonga22

Copy link
Copy Markdown
Contributor

Summary

  • Verifies the RN starter app against the published, live npm packages @runanywhere/{core,llamacpp,onnx}@0.20.9 (not a local-pack port) plus react-native-nitro-modules@^0.33.9. @runanywhere/mlx remains intentionally unpublished/unused.
  • Fixes two real issues surfaced by installing from the real registry instead of local tarballs:
    • @runanywhere/proto-ts (a dependency of core/llamacpp/onnx) was getting nested under each package's own node_modules instead of hoisted, so src/**/*.tsx imports of @runanywhere/proto-ts/* subpaths failed to resolve. Declared it as an explicit direct dependency at 0.20.9 (matching the reference RN example app) so npm hoists it to the top level.
    • pod install failed to resolve RunAnywhereONNX because 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 to 17.5 to match the reference app and the SDK's actual minimum.
  • Committed package-lock.json from a clean npm install --legacy-peer-deps against the live registry (the react-native-screens vs RN 0.83.1 peer conflict needs --legacy-peer-deps, as expected).
  • PrivacyInfo.xcprivacy picked up aggregated privacy manifest entries from the bundled XCFrameworks during pod install; now byte-identical to the reference app's.

Test plan

  • npm install --legacy-peer-deps succeeds against the live npm registry (853→859 packages, 0 vulnerabilities beyond pre-existing deprecation warnings)
  • @runanywhere/{core,llamacpp,onnx} resolve to 0.20.9 in node_modules; @runanywhere/mlx correctly absent (404 on registry)
  • npx tsc --noEmit is clean (0 errors) — the authoritative gate
  • cd ios && pod install succeeds: 88 dependencies from the Podfile, 87 pods installed; RunAnywhereCore/RunAnywhereLlama/RunAnywhereONNX all resolve at 0.20.9, native XCFrameworks download from the GitHub release correctly
  • Runtime smoke test on simulator/device (intentionally not run here — handled separately)

https://claude.ai/code/session_01T8PFRCwpmNzKLyMwFPGzCd

sanchitmonga22 and others added 4 commits July 13, 2026 00:42
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
@sanchitmonga22
sanchitmonga22 merged commit 5c6d610 into main Jul 13, 2026
1 check passed
@sanchitmonga22
sanchitmonga22 deleted the chore/integrate-0.20.9 branch July 13, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant