[package]
name = "splice"
version = "2.6.7"
edition = "2021"
description = "Span-safe refactoring kernel for 7 languages with Magellan code graph integration"
license = "GPL-3.0"
repository = "https://github.com/oldnordic/splice"
documentation = "https://github.com/oldnordic/splice/blob/main/README.md"
readme = "README.md"
keywords = ["refactoring", "cli", "code-analysis", "ast", "tree-sitter"]
categories = ["command-line-utilities", "development-tools", "development-tools::build-utils"]
exclude = [
    ".planning/",
    ".splice/",
    "CLAUDE.md",
    "AGENTS.md",
    "QUICKSTART.md",
]

[lib]
name = "splice"
path = "src/lib.rs"

[features]
# Platform feature model - explicit opt-in required
default = ["unix", "sqlite"]
unix = ["libc"]
windows = []

# Backend selection - SQLite is default
sqlite = ["magellan/sqlite-backend", "sqlitegraph/sqlite-backend"]
# Geometric backend for spatial indexing and CFG analysis
geometric = ["magellan/geometric-backend"]

# Migration testing feature for SQLite-only migration checks
migration = ["magellan/sqlite-backend", "sqlitegraph/sqlite-backend"]

[dependencies]
# Platform-specific APIs
libc = { version = "0.2", optional = true }

# Magellan for code indexing and label queries
magellan = { version = "3.3.7", default-features = false, optional = true }
# SQLiteGraph re-exported from Magellan, also keep for direct access
sqlitegraph = { version = "2.2.4", default-features = false }

# AST parsing (kept for patch validation)
tree-sitter = "0.22"
tree-sitter-rust = "0.21"
tree-sitter-python = "0.21"
tree-sitter-c = "0.21"
tree-sitter-cpp = "0.21"
tree-sitter-javascript = "0.21"
tree-sitter-typescript = "0.21"
tree-sitter-java = "0.21"

# Safe byte-level text editing
ropey = "1.6"

# Error handling
thiserror = "1.0"
anyhow = "1.0"

# JSON serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"

# CSV serialization for export command
csv = "1.3"

# File hashing for validation
sha2 = "0.10"
blake3 = "1.5"

# CLI parsing
clap = { version = "4.5", features = ["derive"] }

# Logging
log = "0.4"
env_logger = "0.11"
which = "6"
tempfile = "3.10"

# Regex for compiler error parsing
regex = "1.10"

# UUID generation and time handling
uuid = { version = "1.10", features = ["v4"] }
chrono = { version = "0.4", default-features = false, features = ["std", "clock"] }

# Direct SQLite access for execution log (same version as Magellan)
rusqlite = { version = "0.31", features = ["bundled"] }

# Glob pattern matching
glob = "0.3"

# Diff output
similar = "2.6"        # Unified diff generation using TextDiff::unified_diff()
nu-ansi-term = "0.50"  # Terminal colors (red for deletions, green for additions)
is-terminal = "0.4"    # Cross-platform TTY detection

# String similarity for "did you mean" suggestions
strsim = "0.11"

[dev-dependencies]
# Criterion benchmarking harness
criterion = "0.5"

[[bench]]
name = "graph_benchmarks"
harness = false
