Skip to content

Commit abda61a

Browse files
Merge branch 'main' into dev
2 parents 2e45ec0 + eaf9e08 commit abda61a

312 files changed

Lines changed: 53083 additions & 11485 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/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+
]

.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

.yarnrc.yml

Whitespace-only changes.

Package.swift

Lines changed: 88 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ let useLocalBinaries = true // Toggle: true for local dev, false for release
4343
// Updated automatically by CI/CD during releases
4444
let sdkVersion = "0.19.1"
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: [
@@ -73,7 +79,8 @@ let package = Package(
7379
name: "RunAnywhereLlamaCPP",
7480
targets: ["LlamaCPPRuntime"]
7581
),
76-
],
82+
83+
] + ragProducts(),
7784
dependencies: [
7885
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
7986
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.9.0"),
@@ -111,7 +118,7 @@ let package = Package(
111118
// =================================================================
112119
.target(
113120
name: "ONNXBackend",
114-
dependencies: ["RABackendONNXBinary", "ONNXRuntimeBinary"],
121+
dependencies: ["RABackendONNXBinary"],
115122
path: "sdk/runanywhere-swift/Sources/ONNXRuntime/include",
116123
publicHeadersPath: "."
117124
),
@@ -132,7 +139,7 @@ let package = Package(
132139
.product(name: "StableDiffusion", package: "ml-stable-diffusion"),
133140
"CRACommons",
134141
"RACommonsBinary",
135-
],
142+
] + ragCoreDependencies(),
136143
path: "sdk/runanywhere-swift/Sources/RunAnywhere",
137144
exclude: ["CRACommons"],
138145
swiftSettings: [
@@ -194,9 +201,61 @@ let package = Package(
194201
path: "sdk/runanywhere-swift/Tests/RunAnywhereTests"
195202
),
196203

197-
] + binaryTargets()
204+
] + ragTargets() + binaryTargets()
198205
)
199206

207+
// =============================================================================
208+
// RAG TARGET HELPERS
209+
// =============================================================================
210+
// RAG targets are gated because the remote binary artifact doesn't exist yet.
211+
// Including a binary target with a placeholder checksum blocks ALL SPM resolution.
212+
213+
/// RAG product (library) — only included when the binary is available
214+
func ragProducts() -> [Product] {
215+
guard useLocalBinaries || ragRemoteBinaryAvailable else { return [] }
216+
return [
217+
.library(
218+
name: "RunAnywhereRAG",
219+
targets: ["RAGRuntime"]
220+
),
221+
]
222+
}
223+
224+
/// RAG dependency for the RunAnywhere core target
225+
func ragCoreDependencies() -> [Target.Dependency] {
226+
guard useLocalBinaries || ragRemoteBinaryAvailable else { return [] }
227+
return [
228+
"RAGBackend",
229+
]
230+
}
231+
232+
/// RAG-related targets (C bridge + Swift runtime)
233+
func ragTargets() -> [Target] {
234+
guard useLocalBinaries || ragRemoteBinaryAvailable else { return [] }
235+
return [
236+
// C Bridge Module - RAG Backend Headers
237+
.target(
238+
name: "RAGBackend",
239+
dependencies: ["RABackendRAGBinary"],
240+
path: "sdk/runanywhere-swift/Sources/RAGRuntime/include",
241+
publicHeadersPath: "."
242+
),
243+
// RAG Runtime Backend
244+
.target(
245+
name: "RAGRuntime",
246+
dependencies: [
247+
"RunAnywhere",
248+
"RAGBackend",
249+
],
250+
path: "sdk/runanywhere-swift/Sources/RAGRuntime",
251+
exclude: ["include"],
252+
linkerSettings: [
253+
.linkedLibrary("c++"),
254+
]
255+
),
256+
]
257+
}
258+
200259
// =============================================================================
201260
// BINARY TARGET SELECTION
202261
// =============================================================================
@@ -224,16 +283,20 @@ func binaryTargets() -> [Target] {
224283
name: "RABackendONNXBinary",
225284
path: "sdk/runanywhere-swift/Binaries/RABackendONNX.xcframework"
226285
),
286+
.binaryTarget(
287+
name: "RABackendRAGBinary",
288+
path: "sdk/runanywhere-swift/Binaries/RABackendRAG.xcframework"
289+
),
227290
]
228291

229292
// Local combined ONNX Runtime xcframework (iOS + macOS)
230293
// Created by: cd sdk/runanywhere-swift && ./scripts/create-onnxruntime-xcframework.sh
231-
targets.append(
232-
.binaryTarget(
233-
name: "ONNXRuntimeBinary",
234-
path: "sdk/runanywhere-swift/Binaries/onnxruntime.xcframework"
235-
)
236-
)
294+
// targets.append(
295+
// .binaryTarget(
296+
// name: "ONNXRuntimeBinary",
297+
// path: "sdk/runanywhere-swift/Binaries/onnxruntime.xcframework"
298+
// )
299+
// )
237300

238301
return targets
239302
} else {
@@ -242,7 +305,7 @@ func binaryTargets() -> [Target] {
242305
// Download XCFrameworks from GitHub releases
243306
// All xcframeworks include iOS + macOS slices (v0.19.0+)
244307
// =====================================================================
245-
return [
308+
var targets: [Target] = [
246309
.binaryTarget(
247310
name: "RACommonsBinary",
248311
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/RACommons-v\(sdkVersion).zip",
@@ -264,5 +327,18 @@ func binaryTargets() -> [Target] {
264327
checksum: "e0180262bd1b10fcda95aaf9aac595af5e6819bd454312b6fc8ffc3828db239f"
265328
),
266329
]
330+
331+
// Only include RAG binary when the release artifact is available
332+
if ragRemoteBinaryAvailable {
333+
targets.append(
334+
.binaryTarget(
335+
name: "RABackendRAGBinary",
336+
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/RABackendRAG-v\(sdkVersion).zip",
337+
checksum: "0000000000000000000000000000000000000000000000000000000000000000" // Replace with actual checksum
338+
)
339+
)
340+
}
341+
342+
return targets
267343
}
268-
}
344+
}

0 commit comments

Comments
 (0)