# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
build-*/
# scripts/build/ holds tracked native-build scripts (not CMake output) — keep it tracked
!scripts/build/
DerivedData/
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
compile_commands.json
a.out.*

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
.build/
.build-*/
.swiftpm/

# Local Ambient / on-device experiment caches (models, fixtures, run artifacts)
.ambient-*/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
.bundle/
vendor/bundle/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# macOS
.DS_Store

# PR-local verification artifacts belong outside the repo.
verification/

# IDE - IntelliJ IDEA / Android Studio
# User-specific stuff
.idea/workspace.xml
.idea/tasks.xml
.idea/usage.statistics.xml
.idea/dictionaries
.idea/shelf
.idea/ChatHistory*.xml
.idea/discord.xml
.idea/editor.xml
.idea/deviceManager.xml

# Generated files
.idea/caches/
.idea/libraries/
.idea/artifacts/
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
*.ipr

# Gradle and JDK specific (contain machine-specific paths)
.idea/gradle.xml
.idea/misc.xml

# Keep shared configurations
!.idea/runConfigurations/
!.idea/vcs.xml

# Android Studio specific
.idea/.gitignore
.idea/markdown.xml
.idea/AndroidProjectSystem.xml
.idea/appInsightsSettings.xml
.idea/deploymentTargetSelector.xml
.idea/kotlinc.xml
.idea/migrations.xml
.idea/inspectionProfiles/
.idea/runConfigurations.xml

# Local gradle properties (machine-specific)
gradle.properties

# But keep project-level gradle properties if needed
!gradle.properties.example
!bindings/flutter/example/android/gradle.properties
# The in-repo minimal Kotlin harness is a CI gate; a clean clone must build it.
!bindings/kotlin/example/gradle.properties

# Also ignore .idea folders in subdirectories
bindings/kotlin/.idea/

# Other IDE files
.vscode/
*.swp
*.swo
*~

# Claude. Local session state stays ignored. The handoff README/scripts, the
# shared slash commands, and the skill tree ARE tracked; plans, memory, local
# permission overrides (`settings.local.json`) and worktrees are not.
# Uses `.claude/*` rather than `.claude/` because git will not descend into
# an excluded directory, which would make the negations below unreachable.
.claude/*
!.claude/handoff/
.claude/handoff/plans/
.claude/handoff/memory/
!.claude/commands/
!.claude/skills/

# Agents. `.agents/skills/` is a generated mirror of `.claude/skills/` for non-Claude
# tooling (see scripts/setup/sync-skills.sh). Both trees are tracked and CI
# (.github/workflows/agent-skills-gate.yml) fails if the mirror drifts or if either
# tree grows a private hostname/credential. Everything else under .agents/ is local.
.agents/*
!.agents/skills/

# Playwright MCP
.playwright-mcp/

# Project-specific excludes
.no_push_backup.json
SHARED_TASK_NOTES.md

# Temporary files
*.tmp
*.temp

# Android
*.apk
*.aar
*.ap_
*.aab
*.dex
*.class
bin/
gen/
out/
.gradle/
gradle-app.setting
!gradle-wrapper.jar
.gradletasknamecache
local.properties
proguard/
*.log
.navigation/
captures/
*.jks
*.keystore
.externalNativeBuild
.cxx/
google-services.json
freeline.py
freeline/
freeline_project_description.json
*.hprof
# vcs.xml moved to .idea section above
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
lint/reports/
.kotlin/
*.jar
!**/gradle/wrapper/gradle-wrapper.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
hs_err_pid*

# Node.js / NPM / Yarn
node_modules/
.npm
# Root-anchored: bindings/react-native/.yarn/plugins must stay committable
/.yarn/
.vite/

# Flutter/Dart
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
pubspec.lock
.metadata

# Flutter iOS generated files
**/ios/Flutter/
**/ios/.symlinks/
**/ios/Pods/
**/ios/Podfile
**/ios/Podfile.lock
**/ios/Runner.xcworkspace/

# Flutter plugin platform-specific generated code
bindings/flutter/android/
bindings/flutter/ios/

thoughts/shared/plans/
thoughts
local/
# Web SDK build artifacts (source is tracked)
bindings/web/node_modules/
bindings/web/packages/core/dist/
bindings/web/packages/llamacpp/dist/
bindings/web/packages/onnx/dist/
bindings/web/wasm/build/
bindings/web/packages/core/wasm/
bindings/web/packages/onnx/wasm/
bindings/web/packages/*/wasm/*.wasm
bindings/web/packages/*/wasm/*.wasm.map
bindings/web/packages/*/wasm/*.data
bindings/web/emsdk/

# External repositories and distribution
EXTERNAL/
dist/
# (bindings/proto-ts/dist/ used to be force-tracked here. It is tsc output from
#  generated sources and is now regenerated by every packaging path — see the
#  "IDL-generated code" section at the end of this file.)

# Configuration files with real values
bindings/swift/Configuration/RunAnywhereConfig.staging.json
bindings/swift/Configuration/RunAnywhereConfig.prod.json
bindings/swift/Configuration/*.private.json
bindings/swift/Configuration/Private/

# Development mode configuration (generated during releases)
# Contains: Supabase URL, anon key, and build token
# Real values are ONLY in release tags for SPM distribution
bindings/swift/Sources/RunAnywhere/Foundation/Constants/DevelopmentConfig.swift

# Release secrets file (contains Supabase URL and anon key)
# This file is required for running release_ios_sdk.sh
# For CI, set SUPABASE_URL and SUPABASE_ANON_KEY environment variables
scripts/.release-secrets

# Keep example files
!bindings/swift/Configuration/RunAnywhereConfig.example.json

# Kotlin SDK Configuration files with real values
bindings/kotlin/config/dev.json
bindings/kotlin/config/staging.json
bindings/kotlin/config/prod.json
bindings/kotlin/config/*.private.json
bindings/kotlin/build/generated/config/

# Keep example and template files
!bindings/kotlin/config/*.example.json
!bindings/kotlin/config/template.json
!bindings/kotlin/config/README.md

# llama.cpp is a submodule - tracked in .gitmodules
# Build artifacts from llama.cpp
*.o
*.so
*.dylib
*.dll
*.a

# =============================================================================
# REACT NATIVE SDK - Native Binaries (npm publish workflow)
# =============================================================================
#
# IMPORTANT: Binaries are IGNORED by git but INCLUDED in npm packages.
#
# =============================================================================
# NPM PUBLISH WORKFLOW (follow these steps for each release):
# =============================================================================
#
#
# 2. REBUILD NATIVE BINARIES with credentials baked in:
#    cd core
#    ./scripts/build-android.sh all arm64-v8a    # Android
#    ./scripts/build-ios.sh --skip-backends       # iOS (RACommons only)
#
# 3. COPY BINARIES to React Native packages:
#    # Android
#    cp build/android/unified/arm64-v8a/librac_commons.so \
#       ../bindings/react-native/packages/core/android/src/main/jniLibs/arm64-v8a/
#
#    # iOS
#    rm -rf ../bindings/react-native/packages/core/ios/Frameworks/RACommons.xcframework
#    cp -R dist/RACommons.xcframework \
#       ../bindings/react-native/packages/core/ios/Frameworks/
#
# 4. VERIFY credentials are baked in:
#    strings bindings/react-native/packages/core/android/src/main/jniLibs/arm64-v8a/librac_commons.so | grep supabase
#    # Should show your Supabase URL, NOT "YOUR_SUPABASE_PROJECT_URL"
#
# 5. PUBLISH to npm (binaries will be included in tarball):
#    cd bindings/react-native/packages/core
#    npm version patch && npm publish
#    # Repeat for llamacpp and onnx packages
#
# 6. BINARIES stay git-ignored (never commit to GitHub)
#    The .so and .xcframework files only live in:
#    - Your local machine (for building)
#    - npm registry (published packages)
#
# =============================================================================

# React Native native binaries (git-ignored, npm-included)
bindings/react-native/packages/*/android/src/main/jniLibs/
bindings/react-native/packages/*/ios/Frameworks/*.xcframework

# Backup directories
comments/

# Flutter iOS ephemeral build dir
**/ios/Flutter/ephemeral/

# Flutter auto-generated files (contain developer-specific local paths)
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/flutter_export_environment.sh
bindings/swift/Sources/RunAnywhere/Data/Network/DevelopmentConfig.swift

# Secrets files (API keys, tokens, etc.)
**/Secrets.swift
**/Secrets.xcconfig

# =============================================================================
# Local Testing Artifacts (generated by build-backends.sh --setup-sdk)
# =============================================================================

# Swift SDK - Local XCFrameworks
bindings/swift/Binaries/*.xcframework

# Swift SDK - local-natives opt-in marker (must NOT be committed: when present
# it flips Package.swift to path-based local Binaries, which breaks every remote
# SPM consumer since the fetched package has no Binaries/).
.runanywhere-local-natives

# Swift SDK - Vendor directory (locally built xcframeworks)
bindings/swift/vendor/

# Kotlin SDK - Local JNI libs
bindings/kotlin/src/main/jniLibs/

# Commons - Build artifacts and third-party dependencies
core/build/
core/build_audit/
core/dist/
core/third_party/

# clangd index/cache
.cache/clangd/
**/.cache/clangd/

# React Native - Local builds
bindings/react-native/packages/*/prebuilt/

# Flutter - Local builds
bindings/flutter/ios/*.xcframework
bindings/flutter/packages/*/ios/Frameworks/*.xcframework
bindings/flutter/packages/*/ios/Frameworks/*.xcframework.zip
bindings/flutter/android/*.aar

# React Native - Pre-built xcframeworks (build artifacts)
bindings/react-native/packages/*/ios/xcframeworks/
tools/

# Python virtual environments
.venv*/
venv*/
__pycache__/
*.pyc

# Python SDK build artifacts (native module + wheels are local/CI-built, never committed).
# The compiled _core (.pyd/.so/.dylib) + sidecar libs land in runanywhere/_native/ but the
# committed runanywhere/_native/__init__.py loader and _core.pyi stubs are kept tracked.
*.pyd
*.egg-info/
bindings/python/wheelhouse/
bindings/python/runanywhere/_native/_core*.so
bindings/python/runanywhere/_native/_core*.dylib
bindings/python/runanywhere/_native/onnxruntime*.dll
bindings/python/runanywhere/_native/*onnxruntime*.so*
bindings/python/runanywhere/_native/*onnxruntime*.dylib
bindings/python/runanywhere/_native/*sherpa-onnx*
bindings/python/runanywhere/_native/cudart64_*.dll
bindings/python/runanywhere/_native/cublas*64_*.dll

*.trace

# Local detailed validation runs and MCP evidence
test_workflows/
gaps/

# External starter-app clones for local reference (release.yml clones them fresh)
external_examples/

# PR-noise blocklist: planning/status docs are archived outside the repo.
docs/release/
docs/research/
docs/rfcs/
docs/API_PARITY_MATRIX.md
docs/engine_plugin_authoring.md
docs/graph_primitives.md
docs/migrations/
docs/plugins/
docs/sdks/web-sdk.md
idl/README.md
core/docs/RUNTIME_VTABLE_DESIGN.md
core/examples/solutions/README.md
tests/streaming/README.md
tests/streaming/cancel_parity/README.md
tests/streaming/perf_bench/README.md

# QHexRT — PRIVATE prebuilt engine archive (never commit; staged via QHEXRT_ROOT)
engines/qhexrt/prebuilt/
/.idea/noctule.xml

# =============================================================================
# IDL-generated code — regenerate with ./idl/codegen/generate_all.sh
# =============================================================================
# Machine output from idl/*.proto. Not tracked: it is 100% reproducible from the
# schemas (proven by wiping every tree and regenerating — only the eight
# hand-written files re-included below did not come back), and tracking it made
# every schema edit a 600-file diff nobody could review.
#
# The tracked proof that codegen ran is idl/SCHEMA_LOCK, refreshed by
# generate_all.sh. Every publish path calls idl/codegen/ensure_generated.sh
# first; idl/codegen/check_generated_trees.sh asserts the output is really there.
#
# NOTHING generated is tracked any more, including the C/C++ and Kotlin trees
# that used to be. They stayed on the argument that ~29 native CI runners plus
# every Gradle host would each need protoc 35.1 exactly, which no package
# manager ships. That was true of package managers and false of protobuf, which
# publishes an immutable prebuilt archive per platform on every release:
# idl/codegen/bootstrap_protoc.sh downloads and checksum-verifies the pinned one
# into a per-user cache, and its siblings do the same for wire-compiler and the
# Python protobuf runtime. core/CMakeLists.txt then generates the C/C++ output
# at configure time when it is absent, and bindings/kotlin/build.gradle.kts
# generates the Kotlin tree from `preBuild`, so no CI job, packaging script or
# fresh clone has to know any of this happened.
#
# The negations below keep hand-written files inside these trees tracked. Each
# parent directory is re-included explicitly before its contents are ignored,
# because git cannot re-include a file whose parent directory is excluded.

# --- Swift (bindings/swift/Sources/RunAnywhere/Generated) --------------------
/bindings/swift/Sources/RunAnywhere/Generated/*
!/bindings/swift/Sources/RunAnywhere/Generated/Versions.swift

# --- Shared TypeScript proto package (bindings/proto-ts) ---------------------
# src/ is ts-proto + convenience + streams + defaults-pool output; dist/ is the
# tsc build of it and the only thing the npm package ships.
/bindings/proto-ts/src/*
!/bindings/proto-ts/src/index.ts
!/bindings/proto-ts/src/lifecycle_service.ts
!/bindings/proto-ts/src/convenience/
/bindings/proto-ts/src/convenience/*
!/bindings/proto-ts/src/convenience/_errors.ts
!/bindings/proto-ts/src/convenience/errors_category.ts
!/bindings/proto-ts/src/events/
/bindings/proto-ts/src/events/*
!/bindings/proto-ts/src/events/public_events.ts
!/bindings/proto-ts/src/streams/
/bindings/proto-ts/src/streams/*
!/bindings/proto-ts/src/streams/_streamFactory.ts
!/bindings/proto-ts/src/streams/push.ts
/bindings/proto-ts/dist/

# --- Flutter -----------------------------------------------------------------
/bindings/flutter/packages/runanywhere/lib/generated/
/bindings/flutter/packages/runanywhere/android/src/main/kotlin/com/runanywhere/sdk/generated/

# --- React Native ------------------------------------------------------------
/bindings/react-native/packages/core/android/src/main/java/com/runanywhere/sdk/generated/

# --- Python ------------------------------------------------------------------
/bindings/python/runanywhere/_proto/
/bindings/python/runanywhere/_generated_errors.py
/bindings/python/runanywhere/_generated_defaults.py

# CMake's file(LOCK) guard that serializes two concurrent configures of the
# same checkout through idl/codegen (core/CMakeLists.txt), and generate_all.sh's
# own mkdir-based mutex, which additionally covers the Gradle preBuild hook and
# a developer running the script by hand (flock(1) is Linux-only).
/idl/codegen/.codegen.lock
/idl/codegen/.codegen.lock.d/

# --- C/C++ (protoc --cpp_out + the rac_default macro header) -----------------
# Generated at CMake configure time when absent — see the
# "Generate the C/C++ IDL output if it is not there yet" block in
# core/CMakeLists.txt. rac_defaults_generated.h is a SHIPPED public header
# (install(DIRECTORY include/) -> XCFramework Headers/, Linux/Windows dist), so
# it must exist before packaging; the configure-time hook is what guarantees
# that on every host that produces an artifact.
/core/src/generated/proto/
/core/include/rac/rac_defaults_generated.h

# --- Kotlin (Square Wire + the two Python-generated helpers) -----------------
# Generated by the `generateIdlKotlinBindings` Gradle task, wired into preBuild.
# Compiled into the AAR; never shipped as source.
/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/generated/
