Skip to content

Commit 4866e6a

Browse files
Merge main into smonga/wispr_flow_clone
Resolved 7 merge conflicts: - Package.swift: Keep WhisperKit product + ragProducts() + split ONNX binaries - RunAnywhereAIApp.swift: Keep both WhisperKit + RAG embedding models - CMakeLists.txt: Add RAG backend build + combined backend summary - build-ios.sh: Keep library format xcframeworks + macOS slices - tests/CMakeLists.txt: Combine integration tests + RAG GoogleTests - AudioCaptureManager.swift: Keep Bluetooth workaround + ceil() fix - RunAnywhere+ModelManagement.swift: Keep framework param for STT loading Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 parents 24247ba + 4d1ff04 commit 4866e6a

389 files changed

Lines changed: 58006 additions & 11499 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-all-test.yml

Lines changed: 406 additions & 27 deletions
Large diffs are not rendered by default.

.github/workflows/secret-scan.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Secret Scanning
2+
3+
# =============================================================================
4+
# Gitleaks Secret Scanning Workflow
5+
#
6+
# Scans every push to main and every pull request for leaked secrets,
7+
# API keys, tokens, and internal URLs. Uses the project-level
8+
# .gitleaks.toml for RunAnywhere-specific patterns on top of gitleaks'
9+
# built-in detectors.
10+
# =============================================================================
11+
12+
on:
13+
push:
14+
branches: [main]
15+
pull_request:
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
secret-scan:
22+
name: Gitleaks Secret Scan
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Run Gitleaks
32+
uses: gitleaks/gitleaks-action@v2
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
GITLEAKS_CONFIG: .gitleaks.toml

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ lint/reports/
192192
*.rar
193193
hs_err_pid*
194194

195+
# Node.js / NPM / Yarn
196+
node_modules/
197+
.npm
198+
.yarn/cache
199+
.yarn/install-state.gz
200+
195201
# Flutter/Dart
196202
.dart_tool/
197203
.flutter-plugins
@@ -378,6 +384,8 @@ sdk/runanywhere-flutter/android/*.aar
378384

379385
# React Native - Pre-built xcframeworks (build artifacts)
380386
sdk/runanywhere-react-native/packages/*/ios/xcframeworks/
387+
tools/
388+
sdk/runanywhere-react-native/packages/rag/ios/.testlocal
381389

382390

383391
# Node

.gitleaks.toml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# =============================================================================
2+
# Gitleaks Configuration — RunAnywhere SDK Monorepo
3+
#
4+
# Custom rules supplement gitleaks' built-in detectors (AWS keys, JWTs, etc.).
5+
# These catch RunAnywhere-specific secrets and internal infrastructure URLs.
6+
# =============================================================================
7+
8+
title = "RunAnywhere Secret Scanning"
9+
10+
# -----------------------------------------------------------------------------
11+
# Custom Rules
12+
# -----------------------------------------------------------------------------
13+
14+
[[rules]]
15+
id = "runanywhere-api-key"
16+
description = "RunAnywhere API key (runa_prod_*, runa_dev_*, runa_staging_*)"
17+
regex = '''runa_(prod|dev|staging)_[A-Za-z0-9_\-]{10,}'''
18+
keywords = ["runa_prod", "runa_dev", "runa_staging"]
19+
20+
[[rules]]
21+
id = "railway-app-url"
22+
description = "Railway production/staging app URL"
23+
regex = '''https?://[a-zA-Z0-9\-]+\.up\.railway\.app'''
24+
keywords = ["railway.app"]
25+
26+
[[rules]]
27+
id = "supabase-url"
28+
description = "Supabase project URL (non-placeholder)"
29+
regex = '''https://[a-z0-9]+\.supabase\.co'''
30+
keywords = ["supabase.co"]
31+
32+
[[rules]]
33+
id = "supabase-anon-key"
34+
description = "Supabase anon/service key"
35+
regex = '''eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\.[A-Za-z0-9_\-]{20,}\.[A-Za-z0-9_\-]{20,}'''
36+
keywords = ["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"]
37+
38+
# -----------------------------------------------------------------------------
39+
# Allowlists — paths and patterns that are safe to ignore
40+
# -----------------------------------------------------------------------------
41+
42+
[allowlist]
43+
description = "Global allowlist"
44+
45+
paths = [
46+
'''\.gitleaks\.toml$''',
47+
'''CLAUDE\.md$''',
48+
'''\.cursor/plans/.*\.plan\.md$''',
49+
'''thoughts/.*\.md$''',
50+
]
51+
52+
regexTarget = "line"
53+
regexes = [
54+
'''YOUR_PRODUCTION_API_KEY''',
55+
'''YOUR_PRODUCTION_BASE_URL''',
56+
'''YOUR_''',
57+
'''placeholder''',
58+
'''https://placeholder\.supabase\.co''',
59+
]

.idea/vcs.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.npmrc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# pnpm configuration for RunAnywhere monorepo
2+
3+
# Use node-modules linker for better React Native compatibility
4+
node-linker=node-modules
5+
6+
# Hoist all dependencies to root node_modules for consistency
7+
shamefully-hoist=true
8+
9+
# Don't fail on missing peer dependencies
10+
strict-peer-dependencies=false
11+
12+
# Use all available cores for faster installation
13+
prefer-offline=false
14+
15+
# Verify package integrity
16+
verify-store-integrity=true
17+
18+
# Use lockfile for reproducible installs
19+
lockfile=true
20+
21+
# Depth for module hoisting
22+
hoist-pattern[]=*
23+
hoist-pattern[]=*/**
24+
25+
# Store location (default is fine)
26+
# store-dir=.pnpm-store
27+
28+
# For CI/CD environments
29+
# ci-mode=true
30+
31+
# For development - allow same version installs
32+
# save-exact=false

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
# See https://pre-commit.com for more information
33

44
repos:
5+
# Secret scanning (blocks commits containing API keys, tokens, URLs)
6+
- repo: https://github.com/gitleaks/gitleaks
7+
rev: v8.30.0
8+
hooks:
9+
- id: gitleaks
10+
511
# General hooks
612
- repo: https://github.com/pre-commit/pre-commit-hooks
713
rev: v4.5.0
@@ -73,6 +79,7 @@ default_language_version:
7379
# Skip these hooks during CI (they run in dedicated CI jobs)
7480
ci:
7581
skip:
82+
- gitleaks
7683
- android-sdk-lint
7784
- android-app-lint
7885
- ios-sdk-swiftlint-fix

.yarnrc.yml

Whitespace-only changes.

Package.swift

Lines changed: 85 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ import Foundation
3737
// ./scripts/build-swift.sh --set-remote (sets useLocalBinaries = false)
3838
//
3939
// =============================================================================
40-
let useLocalBinaries = false // Toggle: true for local dev, false for release
40+
let useLocalBinaries = true // Toggle: true for local dev, false for release
4141

4242
// Version for remote XCFrameworks (used when testLocal = false)
4343
// Updated automatically by CI/CD during releases
4444
let sdkVersion = "0.19.5"
4545

46+
// RAG binary is only available in local dev mode until the release artifact is published.
47+
// In remote mode, the RAG xcframework zip + checksum don't exist yet, so including the
48+
// binary target would block ALL SPM package resolution (not just RAG).
49+
// Set to true once RABackendRAG-v<version>.zip is published to GitHub releases.
50+
let ragRemoteBinaryAvailable = false
51+
4652
let package = Package(
4753
name: "runanywhere-sdks",
4854
platforms: [
@@ -81,7 +87,7 @@ let package = Package(
8187
name: "RunAnywhereWhisperKit",
8288
targets: ["WhisperKitRuntime"]
8389
),
84-
],
90+
] + ragProducts(),
8591
dependencies: [
8692
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
8793
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.9.0"),
@@ -145,7 +151,8 @@ let package = Package(
145151
.product(name: "Sentry", package: "sentry-cocoa"),
146152
.product(name: "StableDiffusion", package: "ml-stable-diffusion"),
147153
"CRACommons",
148-
],
154+
"RACommonsBinary",
155+
] + ragCoreDependencies(),
149156
path: "sdk/runanywhere-swift/Sources/RunAnywhere",
150157
exclude: ["CRACommons"],
151158
swiftSettings: [
@@ -164,6 +171,8 @@ let package = Package(
164171
dependencies: [
165172
"RunAnywhere",
166173
"ONNXBackend",
174+
"RABackendONNXBinary",
175+
"ONNXRuntimeBinary",
167176
],
168177
path: "sdk/runanywhere-swift/Sources/ONNXRuntime",
169178
exclude: ["include"],
@@ -184,6 +193,7 @@ let package = Package(
184193
dependencies: [
185194
"RunAnywhere",
186195
"LlamaCPPBackend",
196+
"RABackendLlamaCPPBinary",
187197
],
188198
path: "sdk/runanywhere-swift/Sources/LlamaCPPRuntime",
189199
exclude: ["include"],
@@ -220,9 +230,61 @@ let package = Package(
220230
path: "sdk/runanywhere-swift/Tests/RunAnywhereTests"
221231
),
222232

223-
] + binaryTargets()
233+
] + ragTargets() + binaryTargets()
224234
)
225235

236+
// =============================================================================
237+
// RAG TARGET HELPERS
238+
// =============================================================================
239+
// RAG targets are gated because the remote binary artifact doesn't exist yet.
240+
// Including a binary target with a placeholder checksum blocks ALL SPM resolution.
241+
242+
/// RAG product (library) — only included when the binary is available
243+
func ragProducts() -> [Product] {
244+
guard useLocalBinaries || ragRemoteBinaryAvailable else { return [] }
245+
return [
246+
.library(
247+
name: "RunAnywhereRAG",
248+
targets: ["RAGRuntime"]
249+
),
250+
]
251+
}
252+
253+
/// RAG dependency for the RunAnywhere core target
254+
func ragCoreDependencies() -> [Target.Dependency] {
255+
guard useLocalBinaries || ragRemoteBinaryAvailable else { return [] }
256+
return [
257+
"RAGBackend",
258+
]
259+
}
260+
261+
/// RAG-related targets (C bridge + Swift runtime)
262+
func ragTargets() -> [Target] {
263+
guard useLocalBinaries || ragRemoteBinaryAvailable else { return [] }
264+
return [
265+
// C Bridge Module - RAG Backend Headers
266+
.target(
267+
name: "RAGBackend",
268+
dependencies: ["RABackendRAGBinary"],
269+
path: "sdk/runanywhere-swift/Sources/RAGRuntime/include",
270+
publicHeadersPath: "."
271+
),
272+
// RAG Runtime Backend
273+
.target(
274+
name: "RAGRuntime",
275+
dependencies: [
276+
"RunAnywhere",
277+
"RAGBackend",
278+
],
279+
path: "sdk/runanywhere-swift/Sources/RAGRuntime",
280+
exclude: ["include"],
281+
linkerSettings: [
282+
.linkedLibrary("c++"),
283+
]
284+
),
285+
]
286+
}
287+
226288
// =============================================================================
227289
// BINARY TARGET SELECTION
228290
// =============================================================================
@@ -250,6 +312,10 @@ func binaryTargets() -> [Target] {
250312
name: "RABackendONNXBinary",
251313
path: "sdk/runanywhere-swift/Binaries/RABackendONNX.xcframework"
252314
),
315+
.binaryTarget(
316+
name: "RABackendRAGBinary",
317+
path: "sdk/runanywhere-swift/Binaries/RABackendRAG.xcframework"
318+
),
253319
]
254320

255321
// ONNX Runtime xcframeworks - split by platform
@@ -273,7 +339,7 @@ func binaryTargets() -> [Target] {
273339
// Download XCFrameworks from GitHub releases
274340
// All xcframeworks include iOS + macOS slices (v0.19.0+)
275341
// =====================================================================
276-
return [
342+
var targets: [Target] = [
277343
.binaryTarget(
278344
name: "RACommonsBinary",
279345
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/RACommons-v\(sdkVersion).zip",
@@ -300,5 +366,18 @@ func binaryTargets() -> [Target] {
300366
checksum: "f73db9dc09012325b35fd3da74de794a75f4e9971d9b923af0805d6ab1dfc243"
301367
),
302368
]
369+
370+
// Only include RAG binary when the release artifact is available
371+
if ragRemoteBinaryAvailable {
372+
targets.append(
373+
.binaryTarget(
374+
name: "RABackendRAGBinary",
375+
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/RABackendRAG-v\(sdkVersion).zip",
376+
checksum: "0000000000000000000000000000000000000000000000000000000000000000" // Replace with actual checksum
377+
)
378+
)
379+
}
380+
381+
return targets
303382
}
304-
}
383+
}

0 commit comments

Comments
 (0)