diff --git a/.ai/local/agents.md b/.ai/local/agents.md index 4859f43a..eaa9dba9 100644 --- a/.ai/local/agents.md +++ b/.ai/local/agents.md @@ -2,6 +2,8 @@ This is a Bun-first TypeScript monorepo for text anonymization. The library handles sensitive text, so privacy, deterministic behavior, and clear data boundaries matter. +> Cargo build artifacts go to `E:\cargo-target\anonymize` (configured in `.cargo/config.toml`). + ### Commands - `bun install` diff --git a/.cargo/config.toml b/.cargo/config.toml index 20687cf9..56858b81 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,7 +2,11 @@ [registries.crates-io] protocol = "sparse" +# Build artifacts: set CARGO_TARGET_DIR env var to customize location +# Defaults to local target/ if not set (works on all platforms) +# Example: export CARGO_TARGET_DIR=E:/cargo-target/anonymize + [alias] ci-fmt = "fmt --all -- --check" ci-clippy = "clippy --workspace --all-targets --all-features --locked -- -D warnings" -ci-test = "test --workspace --all-features --locked" +ci-test = "test --workspace --all-features --locked" \ No newline at end of file diff --git a/.claude/skills/gitnexus/gitnexus-cli/SKILL.md b/.claude/skills/gitnexus/gitnexus-cli/SKILL.md new file mode 100644 index 00000000..c9e0af34 --- /dev/null +++ b/.claude/skills/gitnexus/gitnexus-cli/SKILL.md @@ -0,0 +1,82 @@ +--- +name: gitnexus-cli +description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\"" +--- + +# GitNexus CLI Commands + +All commands work via `npx` — no global install required. + +## Commands + +### analyze — Build or refresh the index + +```bash +npx gitnexus analyze +``` + +Run from the project root. This parses all source files, builds the knowledge graph, writes it to `.gitnexus/`, and generates CLAUDE.md / AGENTS.md context files. + +| Flag | Effect | +| -------------- | ---------------------------------------------------------------- | +| `--force` | Force full re-index even if up to date | +| `--embeddings` | Enable embedding generation for semantic search (off by default) | + +**When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale. In Claude Code, a PostToolUse hook runs `analyze` automatically after `git commit` and `git merge`, preserving embeddings if previously generated. + +### status — Check index freshness + +```bash +npx gitnexus status +``` + +Shows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed. + +### clean — Delete the index + +```bash +npx gitnexus clean +``` + +Deletes the `.gitnexus/` directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project. + +| Flag | Effect | +| --------- | ------------------------------------------------- | +| `--force` | Skip confirmation prompt | +| `--all` | Clean all indexed repos, not just the current one | + +### wiki — Generate documentation from the graph + +```bash +npx gitnexus wiki +``` + +Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to `~/.gitnexus/config.json` on first use). + +| Flag | Effect | +| ------------------- | ----------------------------------------- | +| `--force` | Force full regeneration | +| `--model ` | LLM model (default: minimax/minimax-m2.5) | +| `--base-url ` | LLM API base URL | +| `--api-key ` | LLM API key | +| `--concurrency ` | Parallel LLM calls (default: 3) | +| `--gist` | Publish wiki as a public GitHub Gist | + +### list — Show all indexed repos + +```bash +npx gitnexus list +``` + +Lists all repositories registered in `~/.gitnexus/registry.json`. The MCP `list_repos` tool provides the same information. + +## After Indexing + +1. **Read `gitnexus://repo/{name}/context`** to verify the index loaded +2. Use the other GitNexus skills (`exploring`, `debugging`, `impact-analysis`, `refactoring`) for your task + +## Troubleshooting + +- **"Not inside a git repository"**: Run from a directory inside a git repo +- **Index is stale after re-analyzing**: Restart Claude Code to reload the MCP server +- **Embeddings slow**: Omit `--embeddings` (it's off by default) or set `OPENAI_API_KEY` for faster API-based embedding diff --git a/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md b/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md new file mode 100644 index 00000000..9510b97a --- /dev/null +++ b/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md @@ -0,0 +1,89 @@ +--- +name: gitnexus-debugging +description: "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this bug\"" +--- + +# Debugging with GitNexus + +## When to Use + +- "Why is this function failing?" +- "Trace where this error comes from" +- "Who calls this method?" +- "This endpoint returns 500" +- Investigating bugs, errors, or unexpected behavior + +## Workflow + +``` +1. gitnexus_query({query: ""}) → Find related execution flows +2. gitnexus_context({name: ""}) → See callers/callees/processes +3. READ gitnexus://repo/{name}/process/{name} → Trace execution flow +4. gitnexus_cypher({query: "MATCH path..."}) → Custom traces if needed +``` + +> If "Index is stale" → run `npx gitnexus analyze` in terminal. + +## Checklist + +``` +- [ ] Understand the symptom (error message, unexpected behavior) +- [ ] gitnexus_query for error text or related code +- [ ] Identify the suspect function from returned processes +- [ ] gitnexus_context to see callers and callees +- [ ] Trace execution flow via process resource if applicable +- [ ] gitnexus_cypher for custom call chain traces if needed +- [ ] Read source files to confirm root cause +``` + +## Debugging Patterns + +| Symptom | GitNexus Approach | +| -------------------- | ---------------------------------------------------------- | +| Error message | `gitnexus_query` for error text → `context` on throw sites | +| Wrong return value | `context` on the function → trace callees for data flow | +| Intermittent failure | `context` → look for external calls, async deps | +| Performance issue | `context` → find symbols with many callers (hot paths) | +| Recent regression | `detect_changes` to see what your changes affect | + +## Tools + +**gitnexus_query** — find code related to error: + +``` +gitnexus_query({query: "payment validation error"}) +→ Processes: CheckoutFlow, ErrorHandling +→ Symbols: validatePayment, handlePaymentError, PaymentException +``` + +**gitnexus_context** — full context for a suspect: + +``` +gitnexus_context({name: "validatePayment"}) +→ Incoming calls: processCheckout, webhookHandler +→ Outgoing calls: verifyCard, fetchRates (external API!) +→ Processes: CheckoutFlow (step 3/7) +``` + +**gitnexus_cypher** — custom call chain traces: + +```cypher +MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"}) +RETURN [n IN nodes(path) | n.name] AS chain +``` + +## Example: "Payment endpoint returns 500 intermittently" + +``` +1. gitnexus_query({query: "payment error handling"}) + → Processes: CheckoutFlow, ErrorHandling + → Symbols: validatePayment, handlePaymentError + +2. gitnexus_context({name: "validatePayment"}) + → Outgoing calls: verifyCard, fetchRates (external API!) + +3. READ gitnexus://repo/my-app/process/CheckoutFlow + → Step 3: validatePayment → calls fetchRates (external) + +4. Root cause: fetchRates calls external API without proper timeout +``` diff --git a/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md b/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md new file mode 100644 index 00000000..927a4e4b --- /dev/null +++ b/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md @@ -0,0 +1,78 @@ +--- +name: gitnexus-exploring +description: "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\"" +--- + +# Exploring Codebases with GitNexus + +## When to Use + +- "How does authentication work?" +- "What's the project structure?" +- "Show me the main components" +- "Where is the database logic?" +- Understanding code you haven't seen before + +## Workflow + +``` +1. READ gitnexus://repos → Discover indexed repos +2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness +3. gitnexus_query({query: ""}) → Find related execution flows +4. gitnexus_context({name: ""}) → Deep dive on specific symbol +5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow +``` + +> If step 2 says "Index is stale" → run `npx gitnexus analyze` in terminal. + +## Checklist + +``` +- [ ] READ gitnexus://repo/{name}/context +- [ ] gitnexus_query for the concept you want to understand +- [ ] Review returned processes (execution flows) +- [ ] gitnexus_context on key symbols for callers/callees +- [ ] READ process resource for full execution traces +- [ ] Read source files for implementation details +``` + +## Resources + +| Resource | What you get | +| --------------------------------------- | ------------------------------------------------------- | +| `gitnexus://repo/{name}/context` | Stats, staleness warning (~150 tokens) | +| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores (~300 tokens) | +| `gitnexus://repo/{name}/cluster/{name}` | Area members with file paths (~500 tokens) | +| `gitnexus://repo/{name}/process/{name}` | Step-by-step execution trace (~200 tokens) | + +## Tools + +**gitnexus_query** — find execution flows related to a concept: + +``` +gitnexus_query({query: "payment processing"}) +→ Processes: CheckoutFlow, RefundFlow, WebhookHandler +→ Symbols grouped by flow with file locations +``` + +**gitnexus_context** — 360-degree view of a symbol: + +``` +gitnexus_context({name: "validateUser"}) +→ Incoming calls: loginHandler, apiMiddleware +→ Outgoing calls: checkToken, getUserById +→ Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3) +``` + +## Example: "How does payment processing work?" + +``` +1. READ gitnexus://repo/my-app/context → 918 symbols, 45 processes +2. gitnexus_query({query: "payment processing"}) + → CheckoutFlow: processPayment → validateCard → chargeStripe + → RefundFlow: initiateRefund → calculateRefund → processRefund +3. gitnexus_context({name: "processPayment"}) + → Incoming: checkoutHandler, webhookHandler + → Outgoing: validateCard, chargeStripe, saveTransaction +4. Read src/payments/processor.ts for implementation details +``` diff --git a/.claude/skills/gitnexus/gitnexus-guide/SKILL.md b/.claude/skills/gitnexus/gitnexus-guide/SKILL.md new file mode 100644 index 00000000..937ac73d --- /dev/null +++ b/.claude/skills/gitnexus/gitnexus-guide/SKILL.md @@ -0,0 +1,64 @@ +--- +name: gitnexus-guide +description: "Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: \"What GitNexus tools are available?\", \"How do I use GitNexus?\"" +--- + +# GitNexus Guide + +Quick reference for all GitNexus MCP tools, resources, and the knowledge graph schema. + +## Always Start Here + +For any task involving code understanding, debugging, impact analysis, or refactoring: + +1. **Read `gitnexus://repo/{name}/context`** — codebase overview + check index freshness +2. **Match your task to a skill below** and **read that skill file** +3. **Follow the skill's workflow and checklist** + +> If step 1 warns the index is stale, run `npx gitnexus analyze` in the terminal first. + +## Skills + +| Task | Skill to read | +| -------------------------------------------- | ------------------- | +| Understand architecture / "How does X work?" | `gitnexus-exploring` | +| Blast radius / "What breaks if I change X?" | `gitnexus-impact-analysis` | +| Trace bugs / "Why is X failing?" | `gitnexus-debugging` | +| Rename / extract / split / refactor | `gitnexus-refactoring` | +| Tools, resources, schema reference | `gitnexus-guide` (this file) | +| Index, status, clean, wiki CLI commands | `gitnexus-cli` | + +## Tools Reference + +| Tool | What it gives you | +| ---------------- | ------------------------------------------------------------------------ | +| `query` | Process-grouped code intelligence — execution flows related to a concept | +| `context` | 360-degree symbol view — categorized refs, processes it participates in | +| `impact` | Symbol blast radius — what breaks at depth 1/2/3 with confidence | +| `detect_changes` | Git-diff impact — what do your current changes affect | +| `rename` | Multi-file coordinated rename with confidence-tagged edits | +| `cypher` | Raw graph queries (read `gitnexus://repo/{name}/schema` first) | +| `list_repos` | Discover indexed repos | + +## Resources Reference + +Lightweight reads (~100-500 tokens) for navigation: + +| Resource | Content | +| ---------------------------------------------- | ----------------------------------------- | +| `gitnexus://repo/{name}/context` | Stats, staleness check | +| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores | +| `gitnexus://repo/{name}/cluster/{clusterName}` | Area members | +| `gitnexus://repo/{name}/processes` | All execution flows | +| `gitnexus://repo/{name}/process/{processName}` | Step-by-step trace | +| `gitnexus://repo/{name}/schema` | Graph schema for Cypher | + +## Graph Schema + +**Nodes:** File, Function, Class, Interface, Method, Community, Process +**Edges (via CodeRelation.type):** CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS + +```cypher +MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"}) +RETURN caller.name, caller.filePath +``` diff --git a/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md b/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md new file mode 100644 index 00000000..e19af280 --- /dev/null +++ b/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md @@ -0,0 +1,97 @@ +--- +name: gitnexus-impact-analysis +description: "Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: \"Is it safe to change X?\", \"What depends on this?\", \"What will break?\"" +--- + +# Impact Analysis with GitNexus + +## When to Use + +- "Is it safe to change this function?" +- "What will break if I modify X?" +- "Show me the blast radius" +- "Who uses this code?" +- Before making non-trivial code changes +- Before committing — to understand what your changes affect + +## Workflow + +``` +1. gitnexus_impact({target: "X", direction: "upstream"}) → What depends on this +2. READ gitnexus://repo/{name}/processes → Check affected execution flows +3. gitnexus_detect_changes() → Map current git changes to affected flows +4. Assess risk and report to user +``` + +> If "Index is stale" → run `npx gitnexus analyze` in terminal. + +## Checklist + +``` +- [ ] gitnexus_impact({target, direction: "upstream"}) to find dependents +- [ ] Review d=1 items first (these WILL BREAK) +- [ ] Check high-confidence (>0.8) dependencies +- [ ] READ processes to check affected execution flows +- [ ] gitnexus_detect_changes() for pre-commit check +- [ ] Assess risk level and report to user +``` + +## Understanding Output + +| Depth | Risk Level | Meaning | +| ----- | ---------------- | ------------------------ | +| d=1 | **WILL BREAK** | Direct callers/importers | +| d=2 | LIKELY AFFECTED | Indirect dependencies | +| d=3 | MAY NEED TESTING | Transitive effects | + +## Risk Assessment + +| Affected | Risk | +| ------------------------------ | -------- | +| <5 symbols, few processes | LOW | +| 5-15 symbols, 2-5 processes | MEDIUM | +| >15 symbols or many processes | HIGH | +| Critical path (auth, payments) | CRITICAL | + +## Tools + +**gitnexus_impact** — the primary tool for symbol blast radius: + +``` +gitnexus_impact({ + target: "validateUser", + direction: "upstream", + minConfidence: 0.8, + maxDepth: 3 +}) + +→ d=1 (WILL BREAK): + - loginHandler (src/auth/login.ts:42) [CALLS, 100%] + - apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%] + +→ d=2 (LIKELY AFFECTED): + - authRouter (src/routes/auth.ts:22) [CALLS, 95%] +``` + +**gitnexus_detect_changes** — git-diff based impact analysis: + +``` +gitnexus_detect_changes({scope: "staged"}) + +→ Changed: 5 symbols in 3 files +→ Affected: LoginFlow, TokenRefresh, APIMiddlewarePipeline +→ Risk: MEDIUM +``` + +## Example: "What breaks if I change validateUser?" + +``` +1. gitnexus_impact({target: "validateUser", direction: "upstream"}) + → d=1: loginHandler, apiMiddleware (WILL BREAK) + → d=2: authRouter, sessionManager (LIKELY AFFECTED) + +2. READ gitnexus://repo/my-app/processes + → LoginFlow and TokenRefresh touch validateUser + +3. Risk: 2 direct callers, 2 processes = MEDIUM +``` diff --git a/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md b/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md new file mode 100644 index 00000000..f48cc01b --- /dev/null +++ b/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md @@ -0,0 +1,121 @@ +--- +name: gitnexus-refactoring +description: "Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: \"Rename this function\", \"Extract this into a module\", \"Refactor this class\", \"Move this to a separate file\"" +--- + +# Refactoring with GitNexus + +## When to Use + +- "Rename this function safely" +- "Extract this into a module" +- "Split this service" +- "Move this to a new file" +- Any task involving renaming, extracting, splitting, or restructuring code + +## Workflow + +``` +1. gitnexus_impact({target: "X", direction: "upstream"}) → Map all dependents +2. gitnexus_query({query: "X"}) → Find execution flows involving X +3. gitnexus_context({name: "X"}) → See all incoming/outgoing refs +4. Plan update order: interfaces → implementations → callers → tests +``` + +> If "Index is stale" → run `npx gitnexus analyze` in terminal. + +## Checklists + +### Rename Symbol + +``` +- [ ] gitnexus_rename({symbol_name: "oldName", new_name: "newName", dry_run: true}) — preview all edits +- [ ] Review graph edits (high confidence) and ast_search edits (review carefully) +- [ ] If satisfied: gitnexus_rename({..., dry_run: false}) — apply edits +- [ ] gitnexus_detect_changes() — verify only expected files changed +- [ ] Run tests for affected processes +``` + +### Extract Module + +``` +- [ ] gitnexus_context({name: target}) — see all incoming/outgoing refs +- [ ] gitnexus_impact({target, direction: "upstream"}) — find all external callers +- [ ] Define new module interface +- [ ] Extract code, update imports +- [ ] gitnexus_detect_changes() — verify affected scope +- [ ] Run tests for affected processes +``` + +### Split Function/Service + +``` +- [ ] gitnexus_context({name: target}) — understand all callees +- [ ] Group callees by responsibility +- [ ] gitnexus_impact({target, direction: "upstream"}) — map callers to update +- [ ] Create new functions/services +- [ ] Update callers +- [ ] gitnexus_detect_changes() — verify affected scope +- [ ] Run tests for affected processes +``` + +## Tools + +**gitnexus_rename** — automated multi-file rename: + +``` +gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: true}) +→ 12 edits across 8 files +→ 10 graph edits (high confidence), 2 ast_search edits (review) +→ Changes: [{file_path, edits: [{line, old_text, new_text, confidence}]}] +``` + +**gitnexus_impact** — map all dependents first: + +``` +gitnexus_impact({target: "validateUser", direction: "upstream"}) +→ d=1: loginHandler, apiMiddleware, testUtils +→ Affected Processes: LoginFlow, TokenRefresh +``` + +**gitnexus_detect_changes** — verify your changes after refactoring: + +``` +gitnexus_detect_changes({scope: "all"}) +→ Changed: 8 files, 12 symbols +→ Affected processes: LoginFlow, TokenRefresh +→ Risk: MEDIUM +``` + +**gitnexus_cypher** — custom reference queries: + +```cypher +MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "validateUser"}) +RETURN caller.name, caller.filePath ORDER BY caller.filePath +``` + +## Risk Rules + +| Risk Factor | Mitigation | +| ------------------- | ----------------------------------------- | +| Many callers (>5) | Use gitnexus_rename for automated updates | +| Cross-area refs | Use detect_changes after to verify scope | +| String/dynamic refs | gitnexus_query to find them | +| External/public API | Version and deprecate properly | + +## Example: Rename `validateUser` to `authenticateUser` + +``` +1. gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: true}) + → 12 edits: 10 graph (safe), 2 ast_search (review) + → Files: validator.ts, login.ts, middleware.ts, config.json... + +2. Review ast_search edits (config.json: dynamic reference!) + +3. gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: false}) + → Applied 12 edits across 8 files + +4. gitnexus_detect_changes({scope: "all"}) + → Affected: LoginFlow, TokenRefresh + → Risk: MEDIUM — run tests for these flows +``` diff --git a/.gitignore b/.gitignore index a7d4bb93..0cb039ee 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ package-lock.json # Local-only scratch workspace. packages/anonymize/hunt/ +.gitnexus diff --git a/AGENTS.md b/AGENTS.md index 27edb423..5f341713 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -141,6 +141,8 @@ oxlint (ultracite preset) + oxfmt. To suppress a rule: This is a Bun-first TypeScript monorepo for text anonymization. The library handles sensitive text, so privacy, deterministic behavior, and clear data boundaries matter. +> Cargo build artifacts go to `E:\cargo-target\anonymize` (configured in `.cargo/config.toml`). + ### Commands - `bun install` diff --git a/Cargo.lock b/Cargo.lock index 8d1f4569..7a89f5c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "aho-corasick" version = "1.1.4" @@ -11,6 +17,62 @@ dependencies = [ "memchr", ] +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" + [[package]] name = "arrayref" version = "0.3.9" @@ -23,12 +85,88 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f02882884d3e1bc524fb12c79f107f6ad0e1cfd498c536ffb494301740995dfe" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + [[package]] name = "bincode" version = "2.0.1" @@ -93,6 +231,24 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" + [[package]] name = "cc" version = "1.2.65" @@ -111,6 +267,77 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width", + "windows-sys 0.59.0", +] + +[[package]] +name = "console" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width", + "windows-sys 0.61.2", +] + [[package]] name = "const-oid" version = "0.10.2" @@ -132,6 +359,61 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "cookie_store" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206" +dependencies = [ + "cookie", + "document-features", + "idna", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "time", + "url", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "cpufeatures" version = "0.3.0" @@ -141,6 +423,46 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + [[package]] name = "crypto-common" version = "0.2.2" @@ -163,108 +485,124 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99251f238b74cd219a86fe6ea9328308ebb223fcbb5b8eb5aa400b847a41dded" [[package]] -name = "digest" -version = "0.11.3" +name = "darling" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", + "darling_core", + "darling_macro", ] [[package]] -name = "errno" -version = "0.3.14" +name = "darling_core" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ - "libc", - "windows-sys", + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", ] [[package]] -name = "fancy-regex" -version = "0.18.0" +name = "darling_macro" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e1dacd0d2082dfcf1351c4bdd566bbe89a2b263235a2b50058f1e130a47277" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", + "darling_core", + "quote", + "syn", ] [[package]] -name = "fastrand" -version = "2.4.1" +name = "der" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" +checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b" +dependencies = [ + "pem-rfc7468", + "zeroize", +] [[package]] -name = "find-msvc-tools" -version = "0.1.9" +name = "deranged" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" [[package]] -name = "fnv" -version = "1.0.7" +name = "derive_builder" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] [[package]] -name = "futures" -version = "0.3.32" +name = "derive_builder_core" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", + "darling", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "futures-channel" -version = "0.3.32" +name = "derive_builder_macro" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ - "futures-core", - "futures-sink", + "derive_builder_core", + "syn", ] [[package]] -name = "futures-core" -version = "0.3.32" +name = "digest" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", +] [[package]] -name = "futures-executor" -version = "0.3.32" +name = "dirs" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" dependencies = [ - "futures-core", - "futures-task", - "futures-util", + "dirs-sys", ] [[package]] -name = "futures-io" -version = "0.3.32" +name = "dirs-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] [[package]] -name = "futures-macro" -version = "0.3.32" +name = "displaydoc" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", @@ -272,20 +610,197 @@ dependencies = [ ] [[package]] -name = "futures-sink" -version = "0.3.32" +name = "document-features" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] [[package]] -name = "futures-task" -version = "0.3.32" +name = "either" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] -name = "futures-util" -version = "0.3.32" +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "esaxx-rs" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d817e038c30374a4bcb22f94d0a8a0e216958d4c3dcde369b1439fec4bdda6e6" +dependencies = [ + "cc", +] + +[[package]] +name = "fancy-regex" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e1dacd0d2082dfcf1351c4bdd566bbe89a2b263235a2b50058f1e130a47277" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ @@ -300,6 +815,17 @@ dependencies = [ "slab", ] +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "getrandom" version = "0.3.4" @@ -313,721 +839,2665 @@ dependencies = [ ] [[package]] -name = "heck" -version = "0.5.0" +name = "gliner2-server" +version = "1.5.0" +dependencies = [ + "anyhow", + "axum", + "clap", + "gliner2_inference", + "ort", + "serde", + "serde_json", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "gliner2_inference" +version = "0.5.1" +source = "git+https://github.com/SemplificaAI/gliner2-rs?tag=v0.5.1#38c8a50a90e67e8d42e86de400cdc10c89d8b33e" +dependencies = [ + "anyhow", + "half", + "hf-hub", + "ndarray", + "ort", + "regex", + "serde", + "serde_json", + "tokenizers", +] + +[[package]] +name = "h2" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] [[package]] -name = "hybrid-array" -version = "0.4.12" +name = "half" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9155a582abd142abc056962c29e3ce5ff2ad5469f4246b537ed42c5deba857da" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" dependencies = [ - "typenum", + "cfg-if", + "crunchy", + "zerocopy", ] [[package]] -name = "itoa" -version = "1.0.18" +name = "hashbrown" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" [[package]] -name = "jobserver" -version = "0.1.34" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hf-hub" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef3982638978efa195ff11b305f51f1f22f4f0a6cabee7af79b383ebee6a213" dependencies = [ - "getrandom", + "dirs", + "futures", + "http", + "indicatif 0.18.4", "libc", + "log", + "native-tls", + "num_cpus", + "rand 0.9.4", + "reqwest", + "serde", + "serde_json", + "thiserror 2.0.18", + "tokio", + "ureq", + "windows-sys 0.61.2", ] [[package]] -name = "keccak" -version = "0.2.0" +name = "http" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e24a010dd405bd7ed803e5253182815b41bf2e6a80cc3bfc066658e03a198aa" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" dependencies = [ - "cfg-if", - "cpufeatures", + "bytes", + "itoa", ] [[package]] -name = "libc" -version = "0.2.186" +name = "http-body" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] [[package]] -name = "libloading" -version = "0.9.0" +name = "http-body-util" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ - "cfg-if", - "windows-link", + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", ] [[package]] -name = "linux-raw-sys" -version = "0.12.1" +name = "httparse" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] -name = "memchr" -version = "2.8.2" +name = "httpdate" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] -name = "napi" -version = "3.9.4" +name = "hybrid-array" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41bda2ac390efb5e8d22025d925ccc3f3807d8c1bea6d19b36127247c4b8f83" +checksum = "9155a582abd142abc056962c29e3ce5ff2ad5469f4246b537ed42c5deba857da" dependencies = [ - "bitflags", - "ctor", - "futures", - "napi-build", - "napi-sys", - "nohash-hasher", - "rustc-hash", - "serde", - "serde_json", + "typenum", ] [[package]] -name = "napi-build" -version = "2.3.2" +name = "hyper" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9c366d2c8c60b86fa632df75f745509b52f9128f91a6bad4c796e44abb505e1" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "indicatif" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +dependencies = [ + "console 0.15.11", + "number_prefix", + "portable-atomic", + "unicode-width", + "web-time", +] + +[[package]] +name = "indicatif" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25470f23803092da7d239834776d653104d551bc4d7eacaf31e6837854b8e9eb" +dependencies = [ + "console 0.16.3", + "portable-atomic", + "unicode-width", + "unit-prefix", + "web-time", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e24a010dd405bd7ed803e5253182815b41bf2e6a80cc3bfc066658e03a198aa" +dependencies = [ + "cfg-if", + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "libloading" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "libredox" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" +dependencies = [ + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "macro_rules_attribute" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65049d7923698040cd0b1ddcced9b0eb14dd22c5f86ae59c3740eab64a676520" +dependencies = [ + "macro_rules_attribute-proc_macro", + "paste", +] + +[[package]] +name = "macro_rules_attribute-proc_macro" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "matrixmultiply" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "monostate" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3341a273f6c9d5bef1908f17b7267bbab0e95c9bf69a0d4dcf8e9e1b2c76ef67" +dependencies = [ + "monostate-impl", + "serde", + "serde_core", +] + +[[package]] +name = "monostate-impl" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4db6d5580af57bf992f59068d4ea26fd518574ff48d7639b255a36f9de6e7e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "napi" +version = "3.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41bda2ac390efb5e8d22025d925ccc3f3807d8c1bea6d19b36127247c4b8f83" +dependencies = [ + "bitflags", + "ctor", + "futures", + "napi-build", + "napi-sys", + "nohash-hasher", + "rustc-hash", + "serde", + "serde_json", +] + +[[package]] +name = "napi-build" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9c366d2c8c60b86fa632df75f745509b52f9128f91a6bad4c796e44abb505e1" + +[[package]] +name = "napi-derive" +version = "3.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61d66f70256ad5aef58659966064471d0ad90e2897bc36a5a5e0389c85aabc1e" +dependencies = [ + "convert_case", + "ctor", + "napi-derive-backend", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "napi-derive-backend" +version = "5.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b4b08f15eed7a2a20c3f4c6314013fc3ac890a3afa9892b594485299ebdb2d" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "semver", + "syn", +] + +[[package]] +name = "napi-sys" +version = "3.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f5bcdf71abd3a50d00b49c1c2c75251cb3c913777d6139cd37dabc093a5e400" +dependencies = [ + "libloading 0.9.0", +] + +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndarray" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "portable-atomic", + "portable-atomic-util", + "rawpointer", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "onig" +version = "6.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc3cbf698f9438986c11a880c90a6d04b9de27575afd28bbf45b154b6c709e2" +dependencies = [ + "bitflags", + "libc", + "once_cell", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e68317604e77e53b85896388e1a803c1d21b74c899ec9e5e1112db90735edd7" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "openssl" +version = "0.10.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ort" +version = "2.0.0-rc.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52afb44b6b0cffa9bf45e4d37e5a4935b0334a51570658e279e9e3e6cf324aa5" +dependencies = [ + "half", + "libloading 0.8.9", + "ndarray", + "ort-sys", + "tracing", +] + +[[package]] +name = "ort-sys" +version = "2.0.0-rc.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41d7757331aef2d04b9cb09b45583a59217628beaf91895b7e76187b6e8c088" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pem-rfc7468" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portable-atomic-util" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "num-traits", + "rand 0.9.4", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "pyo3" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c" +dependencies = [ + "libc", + "once_cell", + "portable-atomic", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", +] + +[[package]] +name = "pyo3-build-config" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078" +dependencies = [ + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.5", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-cond" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "059f538b55efd2309c9794130bc149c6a553db90e9d99c2030785c82f0bd7df9" +dependencies = [ + "either", + "itertools 0.11.0", + "rayon", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 2.0.18", +] + +[[package]] +name = "regex" +version = "1.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9bad02c26382724b2d2692c6f179285e4b54eeecd7968f52a50059c3c11759" +dependencies = [ + "digest", + "keccak", + "sponge-cursor", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + +[[package]] +name = "socket2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "socks" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b" +dependencies = [ + "byteorder", + "libc", + "winapi", +] + +[[package]] +name = "spm_precompiled" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5851699c4033c63636f7ea4cf7b7c1f1bf06d0cc03cfb42e711de5a5c46cf326" +dependencies = [ + "base64 0.13.1", + "nom", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "sponge-cursor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a0219bd7d979d58245a4f41f695e1ac9f8befdffadd7f61f1bae9e39abc6620" + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "stella-aho-corasick-core" +version = "1.0.4" +source = "git+https://github.com/stella/aho-corasick?rev=38bdcbf11bfbe389c8f2b7b40eb03ac50371e1e1#38bdcbf11bfbe389c8f2b7b40eb03ac50371e1e1" +dependencies = [ + "daachorse", + "unicode-case-mapping", +] + +[[package]] +name = "stella-anonymize-adapter-contract" +version = "1.5.0" +dependencies = [ + "bincode", + "blake3", + "serde", + "serde_json", + "stella-anonymize-core", + "zstd", +] + +[[package]] +name = "stella-anonymize-core" +version = "1.5.0" +dependencies = [ + "fancy-regex", + "proptest", + "regex", + "serde", + "stella-stdnum-core", + "stella-text-search-core", +] + +[[package]] +name = "stella-anonymize-napi" +version = "1.5.0" +dependencies = [ + "blake3", + "napi", + "napi-build", + "napi-derive", + "serde_json", + "stella-anonymize-adapter-contract", + "stella-anonymize-core", +] + +[[package]] +name = "stella-anonymize-py" +version = "1.5.0" +dependencies = [ + "pyo3", + "pyo3-build-config", + "serde_json", + "stella-anonymize-adapter-contract", + "stella-anonymize-core", +] + +[[package]] +name = "stella-fuzzy-search-core" +version = "1.1.3" +source = "git+https://github.com/stella/fuzzy-search?rev=0743b9c6710a84bb7e6863fdcda9a9cc1dce4fa2#0743b9c6710a84bb7e6863fdcda9a9cc1dce4fa2" +dependencies = [ + "unicode-case-mapping", + "unicode-normalization", + "unicode-segmentation", +] + +[[package]] +name = "stella-regex-set-core" +version = "1.0.5" +source = "git+https://github.com/stella/regex-set?rev=8b80241a5a54cef8fdc6b6b34119981db0c6f597#8b80241a5a54cef8fdc6b6b34119981db0c6f597" +dependencies = [ + "fancy-regex", + "regex", + "regex-automata", + "regex-syntax", + "unicode-segmentation", +] + +[[package]] +name = "stella-stdnum-core" +version = "2.1.1" +source = "git+https://github.com/stella/stdnum?rev=2f3c3f107e3976ac059cc438d77916a592595d59#2f3c3f107e3976ac059cc438d77916a592595d59" +dependencies = [ + "sha2", + "sha3", +] + +[[package]] +name = "stella-text-search-core" +version = "1.0.6" +source = "git+https://github.com/stella/text-search?rev=8b0e074ea2d4fdb7d21ad02d36f949dbf1e23c77#8b0e074ea2d4fdb7d21ad02d36f949dbf1e23c77" +dependencies = [ + "stella-aho-corasick-core", + "stella-fuzzy-search-core", + "stella-regex-set-core", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "target-lexicon" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c17d80feb7334b40c484e45ed1a5273dfd8bfda537c3be2e74a06a6686f327" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcef1a61bdb119096e153208ec5cbec23944ce8bca13be5c7f60c634f7403935" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokenizers" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e500fad1dd3af3d626327e6a3fe5050e664a6eaa4708b8ca92f1794aaf73e6fd" +dependencies = [ + "aho-corasick", + "derive_builder", + "esaxx-rs", + "getrandom 0.2.17", + "indicatif 0.17.11", + "itertools 0.12.1", + "lazy_static", + "log", + "macro_rules_attribute", + "monostate", + "onig", + "paste", + "rand 0.8.6", + "rayon", + "rayon-cond", + "regex", + "regex-syntax", + "serde", + "serde_json", + "spm_precompiled", + "thiserror 1.0.69", + "unicode-normalization-alignments", + "unicode-segmentation", + "unicode_categories", +] [[package]] -name = "napi-derive" -version = "3.5.7" +name = "tokio" +version = "1.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61d66f70256ad5aef58659966064471d0ad90e2897bc36a5a5e0389c85aabc1e" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" dependencies = [ - "convert_case", - "ctor", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", ] [[package]] -name = "napi-derive-backend" -version = "5.0.5" +name = "tokio-macros" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b4b08f15eed7a2a20c3f4c6314013fc3ac890a3afa9892b594485299ebdb2d" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ - "convert_case", "proc-macro2", "quote", - "semver", "syn", ] [[package]] -name = "napi-sys" -version = "3.2.2" +name = "tokio-native-tls" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f5bcdf71abd3a50d00b49c1c2c75251cb3c913777d6139cd37dabc093a5e400" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ - "libloading", + "native-tls", + "tokio", ] [[package]] -name = "nohash-hasher" -version = "0.2.0" +name = "tokio-rustls" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] [[package]] -name = "num-traits" -version = "0.2.19" +name = "tokio-util" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ - "autocfg", + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] -name = "once_cell" -version = "1.21.4" +name = "tower" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] [[package]] -name = "pin-project-lite" -version = "0.2.17" +name = "tower-http" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] [[package]] -name = "pkg-config" -version = "0.3.33" +name = "tower-layer" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] -name = "portable-atomic" -version = "1.13.1" +name = "tower-service" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] -name = "ppv-lite86" -version = "0.2.21" +name = "tracing" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ - "zerocopy", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", ] [[package]] -name = "proc-macro2" -version = "1.0.106" +name = "tracing-attributes" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ - "unicode-ident", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "proptest" -version = "1.11.0" +name = "tracing-core" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ - "bit-set", - "bit-vec", - "bitflags", - "num-traits", - "rand", - "rand_chacha", - "rand_xorshift", - "regex-syntax", - "rusty-fork", - "tempfile", - "unarray", + "once_cell", + "valuable", ] [[package]] -name = "pyo3" -version = "0.29.0" +name = "tracing-log" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "libc", + "log", "once_cell", - "portable-atomic", - "pyo3-build-config", - "pyo3-ffi", - "pyo3-macros", + "tracing-core", ] [[package]] -name = "pyo3-build-config" -version = "0.29.0" +name = "tracing-subscriber" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" dependencies = [ - "target-lexicon", + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] -name = "pyo3-ffi" -version = "0.29.0" +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b" -dependencies = [ - "libc", - "pyo3-build-config", -] +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] -name = "pyo3-macros" -version = "0.29.0" +name = "typenum" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-case-mapping" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9026503b74f3207a4c04e6bf4ea735daa8edf6c0bbfa044cae597bb947a9db" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" dependencies = [ - "proc-macro2", - "pyo3-macros-backend", - "quote", - "syn", + "tinyvec", ] [[package]] -name = "pyo3-macros-backend" -version = "0.29.0" +name = "unicode-normalization-alignments" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362" +checksum = "43f613e4fa046e69818dd287fdc4bc78175ff20331479dab6e1b0f98d57062de" dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", + "smallvec", ] [[package]] -name = "quick-error" -version = "1.2.3" +name = "unicode-segmentation" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] -name = "quote" -version = "1.0.46" +name = "unicode-width" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" -dependencies = [ - "proc-macro2", -] +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] -name = "r-efi" -version = "5.3.0" +name = "unicode_categories" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] -name = "rand" -version = "0.9.4" +name = "unit-prefix" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" -dependencies = [ - "rand_chacha", - "rand_core", -] +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" [[package]] -name = "rand_chacha" +name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "rand_core" -version = "0.9.5" +name = "unty" +version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom", -] +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" [[package]] -name = "rand_xorshift" -version = "0.4.0" +name = "ureq" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0" dependencies = [ - "rand_core", + "base64 0.22.1", + "cookie_store", + "der", + "flate2", + "log", + "native-tls", + "percent-encoding", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "socks", + "ureq-proto", + "utf8-zero", + "webpki-root-certs", + "webpki-roots", ] [[package]] -name = "regex" -version = "1.12.4" +name = "ureq-proto" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" +checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "base64 0.22.1", + "http", + "httparse", + "log", ] [[package]] -name = "regex-automata" -version = "0.4.14" +name = "url" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "form_urlencoded", + "idna", + "percent-encoding", + "serde", ] [[package]] -name = "regex-syntax" -version = "0.8.11" +name = "utf8-zero" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" [[package]] -name = "rustc-hash" -version = "2.1.2" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "rustix" -version = "1.1.4" +name = "utf8parse" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "virtue" +version = "0.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" dependencies = [ - "bitflags", - "errno", "libc", - "linux-raw-sys", - "windows-sys", ] [[package]] -name = "rusty-fork" +name = "want" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", + "try-lock", ] [[package]] -name = "semver" -version = "1.0.28" +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] [[package]] -name = "serde" -version = "1.0.228" +name = "wasm-bindgen-futures" +version = "0.4.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" dependencies = [ - "serde_core", - "serde_derive", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "serde_core" -version = "1.0.228" +name = "wasm-bindgen-macro" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ - "serde_derive", + "quote", + "wasm-bindgen-macro-support", ] [[package]] -name = "serde_derive" -version = "1.0.228" +name = "wasm-bindgen-macro-support" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn", + "wasm-bindgen-shared", ] [[package]] -name = "serde_json" -version = "1.0.150" +name = "wasm-bindgen-shared" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", + "unicode-ident", ] [[package]] -name = "sha2" -version = "0.11.0" +name = "wasm-streams" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ - "cfg-if", - "cpufeatures", - "digest", + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", ] [[package]] -name = "sha3" -version = "0.12.0" +name = "web-sys" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9bad02c26382724b2d2692c6f179285e4b54eeecd7968f52a50059c3c11759" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" dependencies = [ - "digest", - "keccak", - "sponge-cursor", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "shlex" -version = "2.0.1" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] -name = "slab" -version = "0.4.12" +name = "webpki-root-certs" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267" +dependencies = [ + "rustls-pki-types", +] [[package]] -name = "sponge-cursor" -version = "0.1.0" +name = "webpki-roots" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a0219bd7d979d58245a4f41f695e1ac9f8befdffadd7f61f1bae9e39abc6620" - -[[package]] -name = "stella-aho-corasick-core" -version = "1.0.4" -source = "git+https://github.com/stella/aho-corasick?rev=38bdcbf11bfbe389c8f2b7b40eb03ac50371e1e1#38bdcbf11bfbe389c8f2b7b40eb03ac50371e1e1" +checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" dependencies = [ - "daachorse", - "unicode-case-mapping", + "rustls-pki-types", ] [[package]] -name = "stella-anonymize-adapter-contract" -version = "1.5.0" +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "bincode", - "blake3", - "serde", - "serde_json", - "stella-anonymize-core", - "zstd", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] -name = "stella-anonymize-core" -version = "1.5.0" -dependencies = [ - "fancy-regex", - "proptest", - "regex", - "serde", - "stella-stdnum-core", - "stella-text-search-core", -] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] -name = "stella-anonymize-napi" -version = "1.5.0" +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "blake3", - "napi", - "napi-build", - "napi-derive", - "serde_json", - "stella-anonymize-adapter-contract", - "stella-anonymize-core", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] -name = "stella-anonymize-py" -version = "1.5.0" +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "pyo3", - "pyo3-build-config", - "serde_json", - "stella-anonymize-adapter-contract", - "stella-anonymize-core", + "windows-link", ] [[package]] -name = "stella-fuzzy-search-core" -version = "1.1.3" -source = "git+https://github.com/stella/fuzzy-search?rev=0743b9c6710a84bb7e6863fdcda9a9cc1dce4fa2#0743b9c6710a84bb7e6863fdcda9a9cc1dce4fa2" +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "unicode-case-mapping", - "unicode-normalization", - "unicode-segmentation", + "windows-link", ] [[package]] -name = "stella-regex-set-core" -version = "1.0.5" -source = "git+https://github.com/stella/regex-set?rev=8b80241a5a54cef8fdc6b6b34119981db0c6f597#8b80241a5a54cef8fdc6b6b34119981db0c6f597" +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "fancy-regex", - "regex", - "regex-automata", - "regex-syntax", - "unicode-segmentation", + "windows-targets", ] [[package]] -name = "stella-stdnum-core" -version = "2.1.1" -source = "git+https://github.com/stella/stdnum?rev=2f3c3f107e3976ac059cc438d77916a592595d59#2f3c3f107e3976ac059cc438d77916a592595d59" +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "sha2", - "sha3", + "windows-targets", ] [[package]] -name = "stella-text-search-core" -version = "1.0.6" -source = "git+https://github.com/stella/text-search?rev=8b0e074ea2d4fdb7d21ad02d36f949dbf1e23c77#8b0e074ea2d4fdb7d21ad02d36f949dbf1e23c77" +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "stella-aho-corasick-core", - "stella-fuzzy-search-core", - "stella-regex-set-core", + "windows-link", ] [[package]] -name = "syn" -version = "2.0.118" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "target-lexicon" -version = "0.13.5" +name = "windows_aarch64_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] -name = "tempfile" -version = "3.27.0" +name = "windows_aarch64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" -dependencies = [ - "fastrand", - "getrandom", - "once_cell", - "rustix", - "windows-sys", -] +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] -name = "tinyvec" -version = "1.11.0" +name = "windows_i686_gnu" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" -dependencies = [ - "tinyvec_macros", -] +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] -name = "tinyvec_macros" -version = "0.1.1" +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] -name = "typenum" -version = "1.20.1" +name = "windows_i686_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] -name = "unarray" -version = "0.1.4" +name = "windows_x86_64_gnu" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] -name = "unicode-case-mapping" -version = "1.0.0" +name = "windows_x86_64_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9026503b74f3207a4c04e6bf4ea735daa8edf6c0bbfa044cae597bb947a9db" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "unicode-ident" -version = "1.0.24" +name = "windows_x86_64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "unicode-normalization" -version = "0.1.25" +name = "wit-bindgen" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" -dependencies = [ - "tinyvec", -] +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] -name = "unicode-segmentation" -version = "1.13.3" +name = "writeable" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] -name = "unty" -version = "0.0.4" +name = "yoke" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] [[package]] -name = "virtue" -version = "0.0.18" +name = "yoke-derive" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] [[package]] -name = "wait-timeout" -version = "0.2.1" +name = "zerocopy" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f" dependencies = [ - "libc", + "zerocopy-derive", ] [[package]] -name = "wasip2" -version = "1.0.4+wasi-0.2.12" +name = "zerocopy-derive" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930" dependencies = [ - "wit-bindgen", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "windows-link" -version = "0.2.1" +name = "zerofrom" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows-sys" -version = "0.61.2" +name = "zerofrom-derive" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ - "windows-link", + "proc-macro2", + "quote", + "syn", + "synstructure", ] [[package]] -name = "wit-bindgen" -version = "0.57.1" +name = "zeroize" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" [[package]] -name = "zerocopy" -version = "0.8.52" +name = "zerotrie" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ - "zerocopy-derive", + "displaydoc", + "yoke", + "zerofrom", ] [[package]] -name = "zerocopy-derive" -version = "0.8.52" +name = "zerovec" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 233582b2..294305dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ members = [ "crates/anonymize-core", "crates/anonymize-napi", "crates/anonymize-py", + "crates/gliner2-server", ] resolver = "3" diff --git a/crates/gliner2-inference/Cargo.toml b/crates/gliner2-inference/Cargo.toml new file mode 100644 index 00000000..e8d12e1c --- /dev/null +++ b/crates/gliner2-inference/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "gliner2_inference" +version = "0.5.0" +edition = "2021" +description = "Vendored GLiNER2 ONNX inference engine (SemplificaAI/gliner2-rs v0.5.0)" +license = "Apache-2.0" +repository = "https://github.com/SemplificaAI/gliner2-rs" + +[dependencies] +ndarray = "0.16" +ort = { version = "=2.0.0-rc.9", default-features = false, features = ["load-dynamic", "qnn", "cuda", "rocm", "coreml", "openvino", "directml", "tensorrt", "xnnpack", "half"] } +tokenizers = "0.19" +anyhow = "1" +half = "2.4" +serde = { version = "1", features = ["derive"] } +serde_json = "1" +regex = "1" +hf-hub = "0.5" diff --git a/crates/gliner2-inference/src/error.rs b/crates/gliner2-inference/src/error.rs new file mode 100644 index 00000000..8bd96f36 --- /dev/null +++ b/crates/gliner2-inference/src/error.rs @@ -0,0 +1,32 @@ +use std::fmt; + +#[derive(Debug)] +pub enum GlinerError { + OomDeviceBinding(String), + OomDeviceStandard(String), + OomHostRam(String), + BindingNotSupported(String), + TensorShapeMismatch(String), + Other(anyhow::Error), +} + +impl fmt::Display for GlinerError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::OomDeviceBinding(m) => write!(f, "[E_GLI_001] OOM_DEVICE_BINDING: {}", m), + Self::OomDeviceStandard(m) => write!(f, "[E_GLI_002] OOM_DEVICE_STANDARD: {}", m), + Self::OomHostRam(m) => write!(f, "[E_GLI_003] OOM_HOST_RAM: {}", m), + Self::BindingNotSupported(m) => write!(f, "[E_GLI_004] BINDING_NOT_SUPPORTED: {}", m), + Self::TensorShapeMismatch(m) => write!(f, "[E_GLI_005] TENSOR_SHAPE_MISMATCH: {}", m), + Self::Other(err) => write!(f, "{}", err), + } + } +} + +impl std::error::Error for GlinerError {} + +impl From for GlinerError { + fn from(err: anyhow::Error) -> Self { + GlinerError::Other(err) + } +} diff --git a/crates/gliner2-inference/src/processor.rs b/crates/gliner2-inference/src/processor.rs new file mode 100644 index 00000000..60adc876 --- /dev/null +++ b/crates/gliner2-inference/src/processor.rs @@ -0,0 +1,246 @@ +use tokenizers::Tokenizer; +use anyhow::{anyhow, Result}; +use std::collections::HashMap; +use regex::Regex; + +pub const SEP_STRUCT: &str = "[SEP_STRUCT]"; +pub const SEP_TEXT: &str = "[SEP_TEXT]"; +pub const P_TOKEN: &str = "[P]"; +pub const C_TOKEN: &str = "[C]"; +pub const E_TOKEN: &str = "[E]"; +pub const R_TOKEN: &str = "[R]"; +pub const L_TOKEN: &str = "[L]"; +pub const EXAMPLE_TOKEN: &str = "[EXAMPLE]"; +pub const OUTPUT_TOKEN: &str = "[OUTPUT]"; +pub const DESC_TOKEN: &str = "[DESCRIPTION]"; + +#[derive(Debug, Clone)] +pub enum SchemaTask { + Entities(Vec), + Relations(String, Vec), + Classifications(String, Vec), +} + +#[derive(Debug, Clone)] +pub struct TaskMapping { + pub task_name: String, + pub task_type: String, + pub labels: Vec, + pub prompt_tok_idx: usize, + pub field_tok_indices: Vec, +} + +#[derive(Debug, Clone)] +pub struct ProcessedRecord { + pub input_ids: Vec, + pub attention_mask: Vec, + pub tasks: Vec, + pub text_start: usize, + pub text_end: usize, + pub word_to_token_maps: Vec<(usize, usize)>, + pub word_to_char_maps: Vec<(usize, usize)>, +} + +#[derive(Clone, Debug)] +pub struct WhitespaceTokenSplitter { + re: Regex, +} + +impl WhitespaceTokenSplitter { + pub fn new() -> Result { + let re = Regex::new( + r"(?xi) + (?:https?://[^\s]+|www\.[^\s]+) + |[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,} + |@[a-z0-9_]+ + |\w+(?:[-_]\w+)* + |\S + ", + )?; + Ok(Self { re }) + } + + pub fn split_with_offsets<'a>(&self, text: &'a str) -> Vec<(&'a str, usize, usize)> { + self.re + .find_iter(text) + .map(|m| (m.as_str(), m.start(), m.end())) + .collect() + } +} + +pub struct SchemaTransformer { + tokenizer: Tokenizer, + word_splitter: WhitespaceTokenSplitter, +} + +impl SchemaTransformer { + pub fn new(tokenizer: Tokenizer) -> Self { + Self { + tokenizer, + word_splitter: WhitespaceTokenSplitter::new().unwrap(), + } + } + + pub fn transform(&self, text: &str, schema_tasks: &[SchemaTask]) -> Result { + let words_with_offsets = self.word_splitter.split_with_offsets(text); + + let mut combined_tokens = Vec::new(); + let mut task_mappings_temp = Vec::new(); + + for (i, task) in schema_tasks.iter().enumerate() { + let mut field_indices = Vec::new(); + let mut labels = Vec::new(); + + match task { + SchemaTask::Entities(entity_labels) => { + combined_tokens.push("("); + let prompt_idx = combined_tokens.len(); + combined_tokens.push(P_TOKEN); + combined_tokens.push("entities"); + combined_tokens.push("("); + + for label in entity_labels { + combined_tokens.push(E_TOKEN); + field_indices.push(combined_tokens.len()); + combined_tokens.push(label.as_str()); + labels.push(label.clone()); + } + combined_tokens.push(")"); + combined_tokens.push(")"); + + task_mappings_temp.push(( + "entities".to_string(), + "entities".to_string(), + labels, + prompt_idx, + field_indices, + )); + } + SchemaTask::Relations(rel_name, fields) => { + combined_tokens.push("("); + let prompt_idx = combined_tokens.len(); + combined_tokens.push(P_TOKEN); + combined_tokens.push(rel_name.as_str()); + combined_tokens.push("("); + + for field in fields { + combined_tokens.push(R_TOKEN); + field_indices.push(combined_tokens.len()); + combined_tokens.push(field.as_str()); + labels.push(field.clone()); + } + combined_tokens.push(")"); + combined_tokens.push(")"); + + task_mappings_temp.push(( + rel_name.clone(), + "relations".to_string(), + labels, + prompt_idx, + field_indices, + )); + } + SchemaTask::Classifications(task_name, cls_labels) => { + combined_tokens.push("("); + let prompt_idx = combined_tokens.len(); + combined_tokens.push(P_TOKEN); + combined_tokens.push(task_name.as_str()); + combined_tokens.push("("); + + for label in cls_labels { + combined_tokens.push(L_TOKEN); + field_indices.push(combined_tokens.len()); + combined_tokens.push(label.as_str()); + labels.push(label.clone()); + } + combined_tokens.push(")"); + combined_tokens.push(")"); + + task_mappings_temp.push(( + task_name.clone(), + "classifications".to_string(), + labels, + prompt_idx, + field_indices, + )); + } + } + + if i < schema_tasks.len() - 1 { + combined_tokens.push(SEP_STRUCT); + } + } + + combined_tokens.push(SEP_TEXT); + let text_start_idx = combined_tokens.len(); + + let mut word_to_char_maps = Vec::new(); + for (w, start_char, end_char) in &words_with_offsets { + combined_tokens.push(*w); + word_to_char_maps.push((*start_char, *end_char)); + } + let text_end_idx = combined_tokens.len(); + + let mut final_input_ids = Vec::new(); + let mut final_attention_mask = Vec::new(); + let mut word_to_token_maps = Vec::new(); + + let mut combined_to_final_map = HashMap::new(); + + let cls_id = self.tokenizer.encode("[CLS]", false).unwrap().get_ids()[0] as i64; + final_input_ids.push(cls_id); + final_attention_mask.push(1); + let mut current_subword_idx = 1; + + for (i, token) in combined_tokens.iter().enumerate() { + combined_to_final_map.insert(i, current_subword_idx); + + let encoding = self.tokenizer.encode(*token, false) + .map_err(|e| anyhow!("Tokenization failed for {}: {}", token, e))?; + + let ids = encoding.get_ids(); + for &id in ids { + final_input_ids.push(id as i64); + final_attention_mask.push(1); + current_subword_idx += 1; + } + + if i >= text_start_idx && i < text_end_idx { + word_to_token_maps.push(( + current_subword_idx - ids.len(), + current_subword_idx, + )); + } + } + + let sep_id = self.tokenizer.encode("[SEP]", false).unwrap().get_ids()[0] as i64; + final_input_ids.push(sep_id); + final_attention_mask.push(1); + + let mut tasks = Vec::new(); + for (task_name, task_type, labels, prompt_idx, field_indices) in task_mappings_temp { + let real_prompt_idx = *combined_to_final_map.get(&prompt_idx).unwrap(); + let real_field_indices: Vec = field_indices.iter() + .map(|idx| *combined_to_final_map.get(idx).unwrap()) + .collect(); + + tasks.push(TaskMapping { + task_name, + task_type, + labels, + prompt_tok_idx: real_prompt_idx, + field_tok_indices: real_field_indices, + }); + } + + Ok(ProcessedRecord { + input_ids: final_input_ids, + attention_mask: final_attention_mask, + tasks, + text_start: word_to_token_maps.first().map(|v| v.0).unwrap_or(0), + text_end: word_to_token_maps.last().map(|v| v.1).unwrap_or(0), + word_to_token_maps, + word_to_char_maps, + }) + } +} diff --git a/crates/gliner2-server/Cargo.toml b/crates/gliner2-server/Cargo.toml new file mode 100644 index 00000000..36b2764a --- /dev/null +++ b/crates/gliner2-server/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "gliner2-server" +version.workspace = true +edition.workspace = true +description = "HTTP sidecar for GLiNER2 PII inference" +license.workspace = true +publish.workspace = true +repository.workspace = true + +[dependencies] +anyhow = "1" +axum = "0.8" +clap = { version = "4", features = ["derive"] } +gliner2_inference = { git = "https://github.com/SemplificaAI/gliner2-rs", tag = "v0.5.1" } +ort = { version = "=2.0.0-rc.9", default-features = false, features = ["load-dynamic", "ndarray", "half"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +tokio = { version = "1", features = ["full"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } + +[lints] +workspace = true diff --git a/crates/gliner2-server/src/engine.rs b/crates/gliner2-server/src/engine.rs new file mode 100644 index 00000000..fe74d733 --- /dev/null +++ b/crates/gliner2-server/src/engine.rs @@ -0,0 +1,32 @@ +use gliner2_inference::{Gliner2Engine, ModelType}; +use std::sync::Arc; +use tokio::sync::OnceCell; + +static ENGINE: OnceCell> = OnceCell::const_new(); + +pub(crate) async fn get_or_init( + model_id: &str, + variant: Option<&str>, +) -> anyhow::Result> { + let model_id = model_id.to_string(); + let variant = variant.map(|s| s.to_string()); + ENGINE + .get_or_try_init(|| async move { + tokio::task::spawn_blocking(move || { + ort::init().with_name("GLiNER2_Engine").commit()?; + let engine = Gliner2Engine::from_pretrained( + &model_id, + variant.as_deref(), + ModelType::HuggingFace, + )?; + Ok::<_, anyhow::Error>(Arc::new(engine)) + }) + .await? + }) + .await + .map(Arc::clone) +} + +pub(crate) fn is_initialized() -> bool { + ENGINE.initialized() +} \ No newline at end of file diff --git a/crates/gliner2-server/src/health.rs b/crates/gliner2-server/src/health.rs new file mode 100644 index 00000000..d9eb9504 --- /dev/null +++ b/crates/gliner2-server/src/health.rs @@ -0,0 +1,24 @@ +use axum::{Json, extract::State}; +use serde::Serialize; +use std::sync::Arc; + +use crate::engine; +use crate::infer::AppState; + +#[derive(Serialize)] +pub(crate) struct HealthResponse { + pub(crate) status: String, + pub(crate) model_loaded: bool, + pub(crate) version: String, +} + +pub(crate) async fn health_handler( + State(_): State>, +) -> Json { + let model_loaded = engine::is_initialized(); + Json(HealthResponse { + status: "ok".into(), + model_loaded, + version: env!("CARGO_PKG_VERSION").into(), + }) +} \ No newline at end of file diff --git a/crates/gliner2-server/src/infer.rs b/crates/gliner2-server/src/infer.rs new file mode 100644 index 00000000..9e5b6b52 --- /dev/null +++ b/crates/gliner2-server/src/infer.rs @@ -0,0 +1,62 @@ +use axum::{Json, extract::State, http::StatusCode}; +use gliner2_inference::{InferenceParams, SchemaTask}; +use std::sync::Arc; + +use crate::engine; +use crate::types::{EntityOutput, InferRequest, InferResponse}; + +pub(crate) struct AppState { + pub model_id: String, + pub variant: Option, +} + +pub(crate) async fn infer_handler( + State(state): State>, + Json(req): Json, +) -> Result, (StatusCode, String)> { + let engine = engine::get_or_init(&state.model_id, state.variant.as_deref()) + .await + .map_err(|e| { + ( + StatusCode::SERVICE_UNAVAILABLE, + format!("model not ready: {e}"), + ) + })?; + + let tasks = vec![SchemaTask::Entities(req.labels)]; + let params = InferenceParams { + threshold: req.threshold.unwrap_or(0.5), + flat_ner: true, + }; + + let text = req.text; + let (entities, _, _) = tokio::task::spawn_blocking(move || { + engine.extract(&text, &tasks, Some(params)) + }) + .await + .map_err(|e| { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("inference task join error: {e}"), + ) + })? + .map_err(|e| { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("inference failed: {e}"), + ) + })?; + + let output: Vec = entities + .into_iter() + .map(|e| EntityOutput { + text: e.text, + start: e.start_char, + end: e.end_char, + label: e.label, + score: e.score, + }) + .collect(); + + Ok(Json(InferResponse { entities: output })) +} \ No newline at end of file diff --git a/crates/gliner2-server/src/main.rs b/crates/gliner2-server/src/main.rs new file mode 100644 index 00000000..a4f4400c --- /dev/null +++ b/crates/gliner2-server/src/main.rs @@ -0,0 +1,79 @@ +#![allow(clippy::print_stdout)] + +use axum::{Router, serve}; +use clap::Parser; +use std::io::{stdout, Write}; +use std::net::SocketAddr; +use std::sync::Arc; +use tokio::net::TcpListener; +use tracing_subscriber::EnvFilter; + +mod engine; +mod health; +mod infer; +mod types; + +#[derive(Parser, Debug)] +#[command(name = "gliner2-server")] +struct Cli { + #[arg(short, long, default_value = "0")] + port: u16, + #[arg(short = 'H', long, default_value = "127.0.0.1")] + host: String, + #[arg( + short, + long, + default_value = "SemplificaAI/gliner2-privacy-filter-PII-multi" + )] + model: String, + #[arg(short, long)] + variant: Option, +} + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + tracing_subscriber::fmt() + .with_env_filter( + EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()), + ) + .init(); + + let cli = Cli::parse(); + let max_attempts = 3; + + for attempt in 0..max_attempts { + let port = if attempt == 0 { cli.port } else { 0 }; + let addr: SocketAddr = format!("{}:{}", cli.host, port).parse()?; + + match TcpListener::bind(addr).await { + Ok(listener) => { + let local = listener.local_addr()?; + let startup = serde_json::json!({"event":"listening","host":format!("{}", local.ip()),"port":local.port()}); + writeln!(stdout(), "{startup}")?; + stdout().flush()?; + let state = Arc::new(infer::AppState { + model_id: cli.model.clone(), + variant: cli.variant.clone(), + }); + + let app = Router::new() + .route("/v1/health", axum::routing::get(health::health_handler)) + .route("/v1/infer", axum::routing::post(infer::infer_handler)) + .with_state(state); + serve(listener, app).await?; + return Ok(()); + } + Err(e) if attempt + 1 < max_attempts => { + tracing::warn!( + "port {port} failed (attempt {}): {e}; retrying with random port", + attempt + 1 + ); + } + Err(e) => { + anyhow::bail!("failed to bind after {max_attempts} attempts: {e}"); + } + } + } + + Ok(()) +} \ No newline at end of file diff --git a/crates/gliner2-server/src/types.rs b/crates/gliner2-server/src/types.rs new file mode 100644 index 00000000..858af5b8 --- /dev/null +++ b/crates/gliner2-server/src/types.rs @@ -0,0 +1,22 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Deserialize)] +pub(crate) struct InferRequest { + pub(crate) text: String, + pub(crate) labels: Vec, + pub(crate) threshold: Option, +} + +#[derive(Debug, Serialize)] +pub(crate) struct EntityOutput { + pub(crate) text: String, + pub(crate) start: usize, + pub(crate) end: usize, + pub(crate) label: String, + pub(crate) score: f32, +} + +#[derive(Debug, Serialize)] +pub(crate) struct InferResponse { + pub(crate) entities: Vec, +} diff --git a/docs/superpowers/plans/2026-06-26-gliner2-pii-rust-implementation.md b/docs/superpowers/plans/2026-06-26-gliner2-pii-rust-implementation.md new file mode 100644 index 00000000..ea99f586 --- /dev/null +++ b/docs/superpowers/plans/2026-06-26-gliner2-pii-rust-implementation.md @@ -0,0 +1,993 @@ +# GLiNER2 PII — Rust Sidecar Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Build a Rust HTTP sidecar binary that loads `SemplificaAI/gliner2-privacy-filter-PII-multi` (fragmented ONNX V2, 42 PII labels) and serves inference, plus a TS client that integrates it into the anonymize pipeline via `NerInferenceFn`. + +**Architecture:** Rust binary (`crates/gliner2-server/`) runs an axum HTTP server wrapping `gliner2-inference` crate. TS `Gliner2Client` spawns the binary, sends POST requests, maps labels on both sides. Pipeline integration via `buildGliner2Inference()` factory — zero changes to `pipeline.ts`. The crate lives in `crates/` (matching existing Rust workspace convention) and is registered in the root `Cargo.toml` as a workspace member. + +**Tech Stack:** Rust (axum, gliner2-inference 0.5, ort, hf-hub), TypeScript (Bun, anonymize pipeline), GitHub Actions (cross-compilation) + +**Spec:** `docs/superpowers/specs/2026-06-26-gliner2-pii-integration-rust-design.md` + +--- + +## Prerequisite: Register crate in workspace + +- [ ] **Step 0 (before Task 1, committed with Task 1's Step 7)** + +Add `"crates/gliner2-server"` to `members` in root `Cargo.toml`: +```toml +members = [ + "crates/anonymize-adapter-contract", + "crates/anonymize-core", + "crates/anonymize-napi", + "crates/anonymize-py", + "crates/gliner2-server", +] +``` + +This ensures CI's `cargo clippy --workspace` and `cargo test --workspace` include the new crate. + +### Task 1: Rust project scaffold + health endpoint + +**Files:** +- Create: `crates/gliner2-server/Cargo.toml` +- Modify: `Cargo.toml` (workspace members) +- Create: `crates/gliner2-server/src/main.rs` +- Create: `crates/gliner2-server/src/types.rs` +- Create: `crates/gliner2-server/src/health.rs` + +- [ ] **Step 1: Create Cargo.toml with dependencies** + +```toml +[package] +name = "gliner2-server" +version.workspace = true +edition.workspace = true +description = "HTTP sidecar for GLiNER2 PII inference" +license.workspace = true +publish.workspace = true +repository.workspace = true + +[dependencies] +axum = "0.8" +tokio = { version = "1", features = ["full"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +clap = { version = "4", features = ["derive"] } + +[lints] +workspace = true +``` + +- [ ] **Step 2: Create main.rs with axum server + CLI parsing** + +Workspace lints deny `print_stdout`, `unwrap_used`, `expect_used`, `panic`, `exit`. The startup JSON must go to stdout (protocol requirement for the TS client) — allow it with a crate-level attribute. + +```rust +#![allow(clippy::print_stdout)] + +use axum::{Router, serve}; +use clap::Parser; +use std::io::Write; +use std::net::SocketAddr; +use tokio::net::TcpListener; +use tracing_subscriber::EnvFilter; + +mod health; +mod types; + +#[derive(Parser, Debug)] +#[command(name = "gliner2-server")] +struct Cli { + #[arg(short, long, default_value = "0")] + port: u16, + #[arg(short = 'H', long, default_value = "127.0.0.1")] + host: String, + #[arg(short, long, default_value = "SemplificaAI/gliner2-privacy-filter-PII-multi")] + model: String, + #[arg(short, long)] + variant: Option, +} + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into())) + .init(); + + let cli = Cli::parse(); + let max_attempts = 3; + + for attempt in 0..max_attempts { + let port = if attempt == 0 { cli.port } else { 0 }; + let addr: SocketAddr = format!("{}:{}", cli.host, port).parse()?; + + match TcpListener::bind(addr).await { + Ok(listener) => { + let local = listener.local_addr()?; + let startup = serde_json::json!({"event":"listening","host":format!("{}", local.ip()),"port":local.port()}); + writeln!(std::io::stdout(), "{startup}")?; + + let app = Router::new() + .route("/v1/health", axum::routing::get(health::health_handler)); + + serve(listener, app).await?; + return Ok(()); + } + Err(e) if attempt + 1 < max_attempts => { + tracing::warn!("port {port} failed (attempt {}): {e}; retrying with random port", attempt + 1); + } + Err(e) => { + anyhow::bail!("failed to bind after {max_attempts} attempts: {e}"); + } + } + } + + Ok(()) +} +``` + +- [ ] **Step 3: Create health.rs** + +```rust +use axum::Json; +use serde::Serialize; + +#[derive(Serialize)] +pub struct HealthResponse { + pub status: String, + pub model_loaded: bool, + pub version: String, +} + +pub async fn health_handler() -> Json { + Json(HealthResponse { + status: "ok".into(), + model_loaded: false, + version: "0.1.0".into(), + }) +} +``` + +- [ ] **Step 4: Create types.rs** + +```rust +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Deserialize)] +pub struct InferRequest { + pub text: String, + pub labels: Vec, + pub threshold: Option, +} + +#[derive(Debug, Serialize)] +pub struct EntityOutput { + pub text: String, + pub start: usize, + pub end: usize, + pub label: String, + pub score: f32, +} + +#[derive(Debug, Serialize)] +pub struct InferResponse { + pub entities: Vec, +} +``` + +- [ ] **Step 5: Build and verify the scaffold compiles** + +Run: `cd crates/gliner2-server && cargo build` +Expected: Build succeeds (dependencies may take time to download) + +- [ ] **Step 6: Verify health endpoint works** + +Run: `cd crates/gliner2-server && cargo run -- --port 18765` +In another terminal: `curl http://127.0.0.1:18765/v1/health` +Expected: `{"status":"ok","model_loaded":false,"version":"0.1.0"}` + +- [ ] **Step 7: Commit (includes Step 0 workspace registration)** + +```bash +git add Cargo.toml crates/gliner2-server/ +git commit -m "feat: add gliner2-server Rust scaffold with health endpoint" +``` + +--- + +### Task 2: Rust inference endpoint with Gliner2Engine + +**Files:** +- Modify: `crates/gliner2-server/Cargo.toml` +- Create: `crates/gliner2-server/src/engine.rs` +- Create: `crates/gliner2-server/src/infer.rs` +- Modify: `crates/gliner2-server/src/main.rs` + +- [ ] **Step 1: Add gliner2-inference and ort to Cargo.toml** + +Add under `[dependencies]`: +```toml +gliner2-inference = "0.5" +ort = { version = "=2.0.0-rc.9", features = ["load-dynamic"] } +anyhow = "1" +``` + +- [ ] **Step 2: Create engine.rs — Gliner2Engine lazy singleton** + +```rust +use gliner2_inference::{Gliner2Engine, ModelType}; +use std::sync::Arc; +use tokio::sync::OnceCell; + +static ENGINE: OnceCell> = OnceCell::const_new(); + +pub async fn get_or_init( + model_id: &str, + variant: Option<&str>, +) -> anyhow::Result> { + let model_id = model_id.to_string(); + let variant = variant.map(|s| s.to_string()); + ENGINE + .get_or_try_init(|| async move { + ort::init().with_name("GLiNER2_Engine").commit()?; + let engine = Gliner2Engine::from_pretrained( + &model_id, + variant.as_deref(), + ModelType::HuggingFace, + )?; + Ok(Arc::new(engine)) + }) + .await + .map(Arc::clone) +} + +pub fn is_initialized() -> bool { + ENGINE.initialized() +} +``` + +- [ ] **Step 3: Create infer.rs — POST /v1/infer handler** + +```rust +use axum::{Json, extract::State, http::StatusCode}; +use crate::engine; +use crate::types::{EntityOutput, InferRequest, InferResponse}; +use gliner2_inference::{InferenceParams, SchemaTask}; +use std::sync::Arc; + +pub struct AppState { + pub model_id: String, + pub variant: Option, +} + +pub async fn infer_handler( + State(state): State>, + Json(req): Json, +) -> Result, (StatusCode, String)> { + let engine = engine::get_or_init(&state.model_id, state.variant.as_deref()) + .await + .map_err(|e| { + ( + StatusCode::SERVICE_UNAVAILABLE, + format!("model not ready: {e}"), + ) + })?; + + let tasks = vec![SchemaTask::Entities(req.labels)]; + let params = InferenceParams { + threshold: req.threshold.unwrap_or(0.5), + flat_ner: true, + }; + + let (entities, _, _) = engine + .extract(&req.text, &tasks, Some(¶ms)) + .map_err(|e| { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("inference failed: {e}"), + ) + })?; + + let output: Vec = entities + .into_iter() + .map(|e| EntityOutput { + text: e.text, + start: e.start, + end: e.end, + label: e.label, + score: e.score, + }) + .collect(); + + Ok(Json(InferResponse { entities: output })) +} +``` + +Note: `extract()` signature may differ slightly — adapt to the actual gliner2-inference 0.5 API (e.g., `InferenceParams` struct fields). Verify against `gliner2-rs` docs and adjust. + +- [ ] **Step 4: Wire infer route + state into main.rs** + +Add `mod engine; mod infer;` and `use infer::AppState;`. Replace the `Router::new()` block in main.rs with: + +```rust +use std::sync::Arc; + +mod engine; +mod infer; + +// Replace the Router::new() block in main(): +let state = Arc::new(infer::AppState { + model_id: cli.model.clone(), + variant: cli.variant.clone(), +}); + +let app = Router::new() + .route("/v1/health", axum::routing::get(health::health_handler)) + .route("/v1/infer", axum::routing::post(infer::infer_handler)) + .with_state(state); +``` + +- [ ] **Step 5: Update health handler to report model_loaded** + +```rust +use axum::{Json, extract::State}; +use serde::Serialize; +use std::sync::Arc; +use crate::engine; +use crate::infer::AppState; + +#[derive(Serialize)] +pub struct HealthResponse { + pub status: String, + pub model_loaded: bool, + pub version: String, +} + +pub async fn health_handler( + State(state): State>, +) -> Json { + let model_loaded = engine::is_initialized(); + Json(HealthResponse { + status: "ok".into(), + model_loaded, + version: "0.1.0".into(), + }) +} +``` + +- [ ] **Step 6: Build and verify** + +Run: `cd crates/gliner2-server && cargo build` +Expected: Build succeeds + +- [ ] **Step 7: Test inference end-to-end with a real text** + +Run: `cd crates/gliner2-server && cargo run -- --port 18765` +Wait for startup JSON line, then: +```bash +curl -X POST http://127.0.0.1:18765/v1/infer \ + -H "Content-Type: application/json" \ + -d '{"text":"Contact Maria Jensen at maria@example.com.","labels":["person","email"],"threshold":0.5}' +``` +Expected: JSON response with entities array. First request will block for model download (~530MB, ~2s on fast connection). + +- [ ] **Step 8: Commit** + +```bash +git add crates/gliner2-server/ +git commit -m "feat: add GLiNER2 inference endpoint with Gliner2Engine" +``` + +--- + +### Task 3: TS client types + label mapping + +**Files:** +- Create: `packages/anonymize/src/gliner2/types.ts` +- Create: `packages/anonymize/src/gliner2/label-map.ts` +- Create: `packages/anonymize/src/gliner2/__test__/label-map.test.ts` + +- [ ] **Step 1: Create types.ts** + +```typescript +export type InferRequest = { + text: string; + labels: string[]; + threshold: number; +}; + +export type EntityOutput = { + text: string; + start: number; + end: number; + label: string; + score: number; +}; + +export type InferResponse = { + entities: EntityOutput[]; +}; + +export type HealthResponse = { + status: string; + model_loaded: boolean; + version: string; +}; +``` + +- [ ] **Step 2: Create label-map.ts** + +```typescript +// Pipeline canonical label → model label(s) (1:N) +export const PIPELINE_TO_MODEL: Record = { + person: ["person", "full_name", "first_name", "middle_name", "last_name"], + "phone number": ["phone_number"], + address: ["address", "street_address"], + "email address": ["email"], + "date of birth": ["date_of_birth"], + "bank account number": ["bank_account", "account_number"], + iban: ["iban"], + "tax identification number": ["tax_id", "tax_number"], + "identity card number": ["government_id", "national_id_number"], + "birth number": ["national_id_number"], + "national identification number": ["national_id_number"], + "social security number": ["national_id_number"], + "credit card number": ["payment_card", "card_number"], + "passport number": ["passport_number"], + date: ["sensitive_date", "document_date", "expiration_date"], +}; + +// Model label → pipeline canonical label (N:1, with disambiguation) +// When multiple pipeline labels map to the same model label, the +// reverse lookup prefers the first match, then the caller's +// original requested label overrides. +const MODEL_TO_PIPELINE: Record = {}; +for (const [pipeline, models] of Object.entries(PIPELINE_TO_MODEL)) { + for (const model of models) { + // First registration wins (earliest pipeline label takes priority) + if (!(model in MODEL_TO_PIPELINE)) { + MODEL_TO_PIPELINE[model] = pipeline; + } + } +} + +// Map pipeline labels to expanded list of model labels for the request +export const expandLabels = (pipelineLabels: readonly string[]): string[] => { + const seen = new Set(); + const result: string[] = []; + for (const label of pipelineLabels) { + const modelLabels = PIPELINE_TO_MODEL[label]; + if (!modelLabels) continue; // skip labels not supported by model + for (const ml of modelLabels) { + if (!seen.has(ml)) { + seen.add(ml); + result.push(ml); + } + } + } + return result; +}; + +// Map a model label back to pipeline canonical label. +// `requestedPipelineLabels` is the original set from the caller, used +// to disambiguate collisions (e.g., national_id_number → prefer the +// pipeline label the caller actually asked for). +export const collapseLabel = ( + modelLabel: string, + requestedPipelineLabels: ReadonlySet, +): string => { + // The reverse map gives us the default pipeline label + const defaultLabel = MODEL_TO_PIPELINE[modelLabel]; + if (!defaultLabel) return modelLabel; // unknown label, pass through + + // If the caller asked for this specific pipeline label, use it + // (handles the case where multiple pipeline labels map to one model label) + if (requestedPipelineLabels.has(defaultLabel)) return defaultLabel; + + // If the default doesn't match, check if any other pipeline label + // that maps to this model label was requested + for (const [pipeline, models] of Object.entries(PIPELINE_TO_MODEL)) { + if (models.includes(modelLabel) && requestedPipelineLabels.has(pipeline)) { + return pipeline; + } + } + + return defaultLabel; +}; +``` + +- [ ] **Step 3: Write label-map test** + +```typescript +import { describe, it, expect } from "bun:test"; +import { expandLabels, collapseLabel, PIPELINE_TO_MODEL } from "../label-map"; + +describe("label-map", () => { + it("expands person to 5 model labels", () => { + const expanded = expandLabels(["person"]); + expect(expanded).toEqual([ + "person", "full_name", "first_name", "middle_name", "last_name", + ]); + }); + + it("skips labels not in model", () => { + const expanded = expandLabels(["organization", "person"]); + expect(expanded).not.toContain("organization"); + expect(expanded).toContain("person"); + }); + + it("deduplicates when multiple pipeline labels share model labels", () => { + const expanded = expandLabels([ + "social security number", + "birth number", + "person", + ]); + const nins = expanded.filter((l) => l === "national_id_number"); + expect(nins).toHaveLength(1); + }); + + it("collapses model label preferring requested pipeline label", () => { + const result = collapseLabel("national_id_number", new Set(["social security number"])); + expect(result).toBe("social security number"); + }); + + it("falls back to reverse map default when no collision", () => { + const result = collapseLabel("email", new Set(["person"])); + expect(result).toBe("email address"); + }); + + it("passes through unknown labels", () => { + const result = collapseLabel("unknown_label", new Set()); + expect(result).toBe("unknown_label"); + }); +}); +``` + +- [ ] **Step 4: Run tests** + +Run: `cd packages/anonymize && bun test src/gliner2/__test__/label-map.test.ts` +Expected: All tests pass + +- [ ] **Step 5: Commit** + +```bash +git add packages/anonymize/src/gliner2/ +git commit -m "feat: add GLiNER2 client types and label mapping" +``` + +--- + +### Task 4: TS Gliner2Client — lifecycle + HTTP transport + +**Files:** +- Create: `packages/anonymize/src/gliner2/client.ts` +- Create: `packages/anonymize/src/gliner2/__test__/client.test.ts` + +- [ ] **Step 1: Create client.ts** + +```typescript +import type { InferRequest, InferResponse, HealthResponse } from "./types"; + +export type Gliner2ClientOptions = { + /** Override binary path. Default: auto-detect. */ + binaryPath?: string; + /** Port for the sidecar. Default: 0 (random). */ + port?: number; + /** HuggingFace model repo. Default: SemplificaAI/gliner2-privacy-filter-PII-multi */ + modelId?: string; + /** ONNX variant (e.g., "fp16_v2"). Default: auto. */ + variant?: string; + /** Timeout in ms for model load. Default: 120_000. */ + modelLoadTimeout?: number; +}; + +export class Gliner2Client { + private process: ChildProcess | null = null; + private port: number | null = null; + private baseUrl: string | null = null; + private opts: Required; + + constructor(opts: Gliner2ClientOptions = {}) { + this.opts = { + binaryPath: opts.binaryPath ?? "", + port: opts.port ?? 0, + modelId: opts.modelId ?? "SemplificaAI/gliner2-privacy-filter-PII-multi", + variant: opts.variant ?? "", + modelLoadTimeout: opts.modelLoadTimeout ?? 120_000, + }; + } + + get isRunning(): boolean { + return this.process !== null && this.port !== null; + } + + async start(): Promise { + if (this.isRunning) return; + // Resolve binary path + const binPath = await this.resolveBinary(); + // Spawn the process + const args = ["--port", String(this.opts.port), "--host", "127.0.0.1"]; + if (this.opts.variant) args.push("--variant", this.opts.variant); + args.push("--model", this.opts.modelId); + + this.process = Bun.spawn([binPath, ...args], { + stdout: "pipe", + stderr: "inherit", + }); + + // Read port from stdout JSON line + const reader = this.process.stdout.getReader(); + const decoder = new TextDecoder(); + let buffer = ""; + while (true) { + const { done, value } = await reader.read(); + if (done) break; + buffer += decoder.decode(value, { stream: true }); + const lines = buffer.split("\n"); + for (const line of lines) { + if (!line) continue; + try { + const parsed = JSON.parse(line); + if (parsed.event === "listening") { + this.port = parsed.port as number; + this.baseUrl = `http://127.0.0.1:${this.port}`; + break; + } + } catch { /* not JSON yet, keep buffering */ } + } + if (this.baseUrl) break; + // Keep remainder in buffer for next chunk + buffer = lines[lines.length - 1] ?? ""; + } + + if (!this.baseUrl) throw new Error("Failed to start gliner2-server: no listening event"); + + // Wait for model to be ready (poll health) + await this.waitForModel(); + } + + private async waitForModel(): Promise { + const deadline = Date.now() + this.opts.modelLoadTimeout; + while (Date.now() < deadline) { + try { + const res = await fetch(`${this.baseUrl}/v1/health`); + const health = (await res.json()) as HealthResponse; + if (health.model_loaded) return; + } catch { /* server not ready yet */ } + await new Promise((r) => setTimeout(r, 500)); + } + throw new Error("Model load timeout — check network and HuggingFace access"); + } + + async infer( + text: string, + labels: string[], + threshold: number, + signal?: AbortSignal, + ): Promise { + if (!this.isRunning) await this.start(); + const body: InferRequest = { text, labels, threshold }; + const res = await fetch(`${this.baseUrl}/v1/infer`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(body), + signal, + }); + if (!res.ok) { + const errText = await res.text(); + throw new Error(`Inference failed (${res.status}): ${errText}`); + } + return res.json() as Promise; + } + + async stop(): Promise { + if (!this.process) return; + this.process.kill("SIGTERM"); + // Wait up to 5s for graceful exit + const exited = Bun.sleep(5000).then(() => { + this.process?.kill("SIGKILL"); + }); + await Promise.race([this.process.exited, exited]); + this.process = null; + this.port = null; + this.baseUrl = null; + } + + dispose(): void { + this.stop().catch(() => {}); + } + + private async resolveBinary(): Promise { + const envPath = process.env.ANONYMIZE_GLINER2_SERVER_PATH; + if (envPath) return envPath; + // TODO: check bundled binary in node_modules, fallback to download + throw new Error( + "gliner2-server binary not found. " + + "Set ANONYMIZE_GLINER2_SERVER_PATH or use a bundled installation." + ); + } +} +``` + +- [ ] **Step 2: Write client test with a mock server** + +```typescript +import { describe, it, expect, beforeAll, afterAll } from "bun:test"; +import { Gliner2Client } from "../client"; + +// These tests require a running gliner2-server binary. +// Skip if not available. +const hasBinary = process.env.ANONYMIZE_GLINER2_SERVER_PATH !== undefined; + +describe.skipIf(!hasBinary)("Gliner2Client", () => { + let client: Gliner2Client; + + beforeAll(async () => { + client = new Gliner2Client({ + port: 0, + modelLoadTimeout: 180_000, + }); + await client.start(); + }, 200_000); + + afterAll(async () => { + await client.stop(); + }); + + it("detects model as loaded", async () => { + // Inferred from successful infer — no direct health access from client + expect(client.isRunning).toBe(true); + }); + + it("returns entities for person + email", async () => { + const result = await client.infer( + "Contact Maria Jensen at maria@example.com.", + ["person", "email"], + 0.5, + ); + expect(result.entities.length).toBeGreaterThan(0); + const labels = result.entities.map((e) => e.label); + expect(labels).toContain("person"); + expect(labels).toContain("email"); + }, 60_000); + + it("returns empty for unmapped labels", async () => { + const result = await client.infer("No PII here.", ["organization"], 0.5); + // organization is not in the model's 42-label set + expect(Array.isArray(result.entities)).toBe(true); + }, 30_000); +}); +``` + +- [ ] **Step 3: Commit** + +```bash +git add packages/anonymize/src/gliner2/ +git commit -m "feat: add Gliner2Client with lifecycle and HTTP transport" +``` + +--- + +### Task 5: TS inference factory and pipeline integration + +**Files:** +- Create: `packages/anonymize/src/gliner2/inference.ts` +- Modify: `packages/anonymize/src/index-shared.ts` +- Create: `packages/anonymize/src/gliner2/__test__/inference.test.ts` + +- [ ] **Step 1: Create inference.ts** + +```typescript +import type { NerInferenceFn } from "../pipeline"; +import type { Entity } from "../types"; +import { Gliner2Client, type Gliner2ClientOptions } from "./client"; +import { expandLabels, collapseLabel } from "./label-map"; + +export const buildGliner2Inference = ( + options: Gliner2ClientOptions = {}, +): NerInferenceFn => { + const client = new Gliner2Client(options); + + return async (fullText, labels, threshold, signal) => { + const modelLabels = expandLabels(labels); + if (modelLabels.length === 0) return []; + + const pipelineLabelSet = new Set(labels); + const response = await client.infer(fullText, modelLabels, threshold, signal); + + return response.entities.map( + (e): Entity => ({ + text: e.text, + start: e.start, + end: e.end, + label: collapseLabel(e.label, pipelineLabelSet), + score: e.score, + source: "ner" as const, + }), + ); + }; +}; +``` + +- [ ] **Step 2: Export from shared index** + +In `packages/anonymize/src/index-shared.ts`, add to the GLiNER section: +```typescript +// ── GLiNER2 Sidecar ────────────────────────────── +export { buildGliner2Inference } from "./gliner2/inference"; +export { Gliner2Client } from "./gliner2/client"; +``` + +- [ ] **Step 3: Commit** + +```bash +git add packages/anonymize/src/gliner2/inference.ts packages/anonymize/src/index-shared.ts +git commit -m "feat: add buildGliner2Inference factory and export" +``` + +--- + +### Task 6: Pipeline integration test + +**Files:** +- Create: `packages/anonymize/src/__test__/slow/gliner2-pipeline.test.ts` + +- [ ] **Step 1: Write pipeline integration test** + +```typescript +import { describe, it, expect, beforeAll, afterAll } from "bun:test"; +import { runPipeline, type NerInferenceFn } from "../../pipeline"; +import { buildGliner2Inference } from "../../gliner2/inference"; +import type { PipelineConfig, Entity } from "../../types"; +import { DEFAULT_ENTITY_LABELS } from "../../constants"; + +const hasBinary = process.env.ANONYMIZE_GLINER2_SERVER_PATH !== undefined; + +describe.skipIf(!hasBinary)("GLiNER2 pipeline integration", () => { + let nerInference: NerInferenceFn; + + beforeAll(async () => { + nerInference = buildGliner2Inference({ + modelLoadTimeout: 180_000, + }); + // Warm up — triggers model download + server start + await nerInference("Warm up.", ["person"], 0.5); + }, 200_000); + + afterAll(() => { + // Cleanup handled by GC / process exit for the client + }); + + const baseConfig: PipelineConfig = { + threshold: 0.5, + enableTriggerPhrases: false, + enableRegex: false, + enableLegalForms: false, + enableNameCorpus: false, + enableDenyList: false, + enableGazetteer: false, + enableCountries: false, + enableNer: true, + enableConfidenceBoost: false, + enableCoreference: false, + labels: [...DEFAULT_ENTITY_LABELS], + workspaceId: "test", + }; + + it("detects person via NER in pipeline output", async () => { + const text = "Maria Jensen called yesterday."; + const entities = await runPipeline({ + fullText: text, + config: baseConfig, + gazetteerEntries: [], + nerInference, + }); + const people = entities.filter((e) => e.label === "person"); + expect(people.length).toBeGreaterThan(0); + expect(people.some((p) => p.text.includes("Maria"))).toBe(true); + }, 60_000); + + it("NER entities have source='ner'", async () => { + const text = "Email john@test.com for info."; + const entities = await runPipeline({ + fullText: text, + config: { ...baseConfig, labels: ["email address"] }, + gazetteerEntries: [], + nerInference, + }); + for (const e of entities) { + expect(e.source).toBe("ner"); + } + }, 30_000); +}); +``` + +- [ ] **Step 2: Run the slow tests** + +Run directly with `bun test` (the `bun run test` script has a 15s default timeout): +```bash +cd packages/anonymize && bun test src/__test__/slow/gliner2-pipeline.test.ts --timeout 300000 +``` +Expected: Tests pass (may take 2-3 minutes for model download + server start) + +- [ ] **Step 3: Commit** + +```bash +git add packages/anonymize/src/__test__/slow/gliner2-pipeline.test.ts +git commit -m "test: add GLiNER2 pipeline integration test" +``` + +--- + +### Task 7: Binary download and distribution (future / separate PR) + +**Files:** +- Create: `.github/workflows/gliner2-server.yml` +- Create: `packages/anonymize/scripts/download-gliner2-server.ts` + +This task is scoped as a future step — the initial implementation requires the binary to be pre-built or available via `ANONYMIZE_GLINER2_SERVER_PATH`. CI cross-compilation and auto-download can be added in a follow-up. + +- [ ] **Step 1: Create GitHub Actions workflow for cross-compilation** + +```yaml +# .github/workflows/gliner2-server.yml +name: Build gliner2-server + +on: + release: + types: [published] + +jobs: + build: + strategy: + matrix: + target: + - x86_64-unknown-linux-gnu + - x86_64-apple-darwin + - aarch64-apple-darwin + - x86_64-pc-windows-msvc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + targets: ${{ matrix.target }} + - run: | + cd crates/gliner2-server + cargo build --release --target ${{ matrix.target }} + - name: Upload release asset + uses: softprops/action-gh-release@v2 + with: + files: crates/gliner2-server/target/${{ matrix.target }}/release/gliner2-server${{ runner.os == 'Windows' && '.exe' || '' }} + name: gliner2-server-${{ matrix.target }} +``` + +- [ ] **Step 2: Commit (separate PR)** + +Skipped for initial implementation. + +--- + +## Plan Review + +After all tasks are implemented, run these checks (in order, stop on first failure): + +```bash +# Rust — workspace-wide (new crate must compile) +cd crates/gliner2-server && cargo check +cd ../.. && cargo ci-clippy && cargo ci-test + +# TypeScript — test files use separate tsconfig +cd packages/anonymize && tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json + +# Lint + format +cd packages/anonymize && bun run lint && bun run format:check + +# Fast tests (slow tests require binary) +bun test +``` diff --git a/packages/anonymize/src/__test__/slow/gliner2-pipeline.test.ts b/packages/anonymize/src/__test__/slow/gliner2-pipeline.test.ts new file mode 100644 index 00000000..74afd4ee --- /dev/null +++ b/packages/anonymize/src/__test__/slow/gliner2-pipeline.test.ts @@ -0,0 +1,65 @@ +import { describe, it, expect, beforeAll, afterAll } from "bun:test"; +import { runPipeline, type NerInferenceFn } from "../../pipeline"; +import { buildGliner2Inference } from "../../gliner2/inference"; +import type { PipelineConfig } from "../../types"; +import { DEFAULT_ENTITY_LABELS } from "../../constants"; + +const hasBinary = process.env["ANONYMIZE_GLINER2_SERVER_PATH"] !== undefined; + +describe.skipIf(!hasBinary)("GLiNER2 pipeline integration", () => { + let nerInference: NerInferenceFn; + + beforeAll(async () => { + nerInference = buildGliner2Inference({ + modelLoadTimeout: 180_000, + }); + // Warm up — triggers model download + server start + await nerInference("Warm up.", ["person"], 0.5); + }, 200_000); + + afterAll(() => { + // Cleanup handled by GC / process exit for the client + }); + + const baseConfig: PipelineConfig = { + threshold: 0.5, + enableTriggerPhrases: false, + enableRegex: false, + enableLegalForms: false, + enableNameCorpus: false, + enableDenyList: false, + enableGazetteer: false, + enableCountries: false, + enableNer: true, + enableConfidenceBoost: false, + enableCoreference: false, + labels: [...DEFAULT_ENTITY_LABELS], + workspaceId: "test", + }; + + it("detects person via NER in pipeline output", async () => { + const text = "Maria Jensen called yesterday."; + const entities = await runPipeline({ + fullText: text, + config: baseConfig, + gazetteerEntries: [], + nerInference, + }); + const people = entities.filter((e) => e.label === "person"); + expect(people.length).toBeGreaterThan(0); + expect(people.some((p) => p.text.includes("Maria"))).toBe(true); + }, 60_000); + + it("NER entities have source='ner'", async () => { + const text = "Email john@test.com for info."; + const entities = await runPipeline({ + fullText: text, + config: { ...baseConfig, labels: ["email address"] }, + gazetteerEntries: [], + nerInference, + }); + for (const e of entities) { + expect(e.source).toBe("ner"); + } + }, 30_000); +}); \ No newline at end of file diff --git a/packages/anonymize/src/gliner2/__test__/label-map.test.ts b/packages/anonymize/src/gliner2/__test__/label-map.test.ts new file mode 100644 index 00000000..ae5b36dc --- /dev/null +++ b/packages/anonymize/src/gliner2/__test__/label-map.test.ts @@ -0,0 +1,75 @@ +import { describe, it, expect } from "bun:test"; +import { expandLabels, collapseLabel, PIPELINE_TO_MODEL } from "../label-map"; + +describe("expandLabels", () => { + it("expands person to 5 model labels", () => { + const expanded = expandLabels(["person"]); + expect(expanded).toEqual([ + "person", + "full_name", + "first_name", + "middle_name", + "last_name", + ]); + }); + + it("skips labels not in the model map", () => { + const expanded = expandLabels(["organization", "person"]); + expect(expanded).not.toContain("organization"); + expect(expanded).toContain("person"); + }); + + it("deduplicates when multiple pipeline labels share a model label", () => { + const expanded = expandLabels([ + "social security number", + "birth number", + "person", + ]); + const nins = expanded.filter((l) => l === "national_id_number"); + expect(nins).toHaveLength(1); + }); +}); + +describe("collapseLabel", () => { + it("prefers requested pipeline label on collision", () => { + const result = collapseLabel("national_id_number", new Set(["social security number"])); + expect(result).toBe("social security number"); + }); + + it("falls back to reverse map default when no collision", () => { + const result = collapseLabel("email", new Set(["person"])); + expect(result).toBe("email address"); + }); + + it("passes through unknown model labels", () => { + const result = collapseLabel("unknown_label", new Set()); + expect(result).toBe("unknown_label"); + }); +}); + +describe("invariant: round-trip all mapped labels", () => { + it("round-trips every mapped label into one of the requested pipeline labels", () => { + for (const [pipelineLabel, modelLabels] of Object.entries(PIPELINE_TO_MODEL)) { + for (const modelLabel of modelLabels) { + expect( + collapseLabel(modelLabel, new Set([pipelineLabel])), + ).toBe(pipelineLabel); + } + } + }); + + it("prefers first requested label in collision case", () => { + // national_id_number maps to multiple pipeline labels + const requested = new Set(["social security number", "birth number"]); + const result = collapseLabel("national_id_number", requested); + // Should prefer the one that appears first in PIPELINE_TO_MODEL + expect(result).toBe("birth number"); + }); + + it("uses caller order when multiple requested labels map to same model label", () => { + const requested = new Set(["birth number", "social security number"]); + const result = collapseLabel("national_id_number", requested); + // Should prefer the one that appears first in PIPELINE_TO_MODEL + expect(result).toBe("birth number"); + }); +}); \ No newline at end of file diff --git a/packages/anonymize/src/gliner2/client.ts b/packages/anonymize/src/gliner2/client.ts new file mode 100644 index 00000000..c2057680 --- /dev/null +++ b/packages/anonymize/src/gliner2/client.ts @@ -0,0 +1,206 @@ +import type { InferRequest, InferResponse, HealthResponse } from "./types"; +import { spawn, type ChildProcess } from "node:child_process"; + +export type Gliner2ClientOptions = { + binaryPath?: string; + port?: number; + modelId?: string; + variant?: string; + modelLoadTimeout?: number; + inferenceTimeout?: number; +}; + +export class Gliner2Client { + private process: ChildProcess | null = null; + private port: number | null = null; + private baseUrl: string | null = null; + private opts: Required; + + constructor(opts: Gliner2ClientOptions = {}) { + this.opts = { + binaryPath: opts.binaryPath ?? "", + port: opts.port ?? 0, + modelId: opts.modelId ?? "SemplificaAI/gliner2-privacy-filter-PII-multi", + variant: opts.variant ?? "", + modelLoadTimeout: opts.modelLoadTimeout ?? 120_000, + inferenceTimeout: opts.inferenceTimeout ?? 30_000, + }; + } + + get isRunning(): boolean { + if (!this.process || this.port == null) { + return false; + } + const { exitCode, killed } = this.process; + if (exitCode !== null || killed) { + return false; + } + return true; + } + + private clearProcessState(): void { + this.process = null; + this.port = null; + this.baseUrl = null; + } + + async start(): Promise { + if (this.isRunning) return; + + const binPath = await this.resolveBinary(); + const args = ["--port", String(this.opts.port), "--host", "127.0.0.1"]; + if (this.opts.variant) args.push("--variant", this.opts.variant); + args.push("--model", this.opts.modelId); + + this.process = spawn(binPath, args, { + stdio: ["ignore", "pipe", "inherit"], + }); + + this.process.on("exit", () => this.clearProcessState()); + this.process.on("error", () => this.clearProcessState()); + + const stdout = this.process.stdout; + if (!stdout) { + this.clearProcessState(); + throw new Error("Failed to start gliner2-server: no stdout"); + } + + const decoder = new TextDecoder(); + let buffer = ""; + let listeningEventReceived = false; + + for await (const chunk of stdout) { + buffer += decoder.decode(chunk, { stream: true }); + const lines = buffer.split("\n"); + + for (const line of lines) { + if (!line) continue; + try { + const parsed = JSON.parse(line); + if (parsed.event === "listening") { + this.port = parsed.port as number; + this.baseUrl = `http://127.0.0.1:${this.port}`; + listeningEventReceived = true; + break; + } + } catch { + continue; + } + } + + if (this.baseUrl) break; + buffer = lines.at(-1) ?? ""; + } + + if (!listeningEventReceived) { + const exitCode = this.process.exitCode; + this.clearProcessState(); + throw new Error( + `Failed to start gliner2-server: sidecar exited prematurely${ + exitCode !== null ? ` (exit code ${exitCode})` : "" + }`, + ); + } + + await this.waitForModel(); + } + + private async waitForModel(): Promise { + const deadline = Date.now() + this.opts.modelLoadTimeout; + + while (Date.now() < deadline) { + try { + const res = await fetch(`${this.baseUrl}/v1/health`); + const health = (await res.json()) as HealthResponse; + if (health.model_loaded) return; + } catch { + // Server not ready yet + } + await new Promise((resolve) => setTimeout(resolve, 500)); + } + + throw new Error( + "Model load timeout — check network and HuggingFace access", + ); + } + + async infer( + text: string, + labels: string[], + threshold: number, + signal?: AbortSignal, + ): Promise { + if (!this.isRunning) await this.start(); + + const body: InferRequest = { text, labels, threshold }; + const fetchOptions: RequestInit = { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(body), + }; + + // Compose caller signal with internal timeout + const controller = new AbortController(); + const timeoutId = setTimeout(() => controller.abort(), this.opts.inferenceTimeout); + + if (signal) { + signal.addEventListener("abort", () => controller.abort()); + } + + fetchOptions.signal = controller.signal; + + try { + const res = await fetch(`${this.baseUrl}/v1/infer`, fetchOptions); + clearTimeout(timeoutId); + + if (!res.ok) { + const errText = await res.text(); + throw new Error(`Inference failed (${res.status}): ${errText}`); + } + + return res.json() as Promise; + } catch (e) { + clearTimeout(timeoutId); + throw e; + } + } + + async stop(): Promise { + if (!this.process) return; + + const proc = this.process; + + proc.kill("SIGTERM"); + + const exited = new Promise((resolve) => { + const timeout = setTimeout(() => { + proc.kill("SIGKILL"); + resolve(); + }, 5000); + + proc.once("exit", () => { + clearTimeout(timeout); + resolve(); + }); + }); + + await exited; + + this.clearProcessState(); + } + + dispose(): void { + this.stop().catch(() => {}); + } + + private async resolveBinary(): Promise { + if (this.opts.binaryPath) return this.opts.binaryPath; + const envPath = process.env["ANONYMIZE_GLINER2_SERVER_PATH"]; + if (envPath) return envPath; + + throw new Error( + "gliner2-server binary not found. " + + "Provide binaryPath option or set ANONYMIZE_GLINER2_SERVER_PATH.", + ); + } +} \ No newline at end of file diff --git a/packages/anonymize/src/gliner2/inference.ts b/packages/anonymize/src/gliner2/inference.ts new file mode 100644 index 00000000..3528b147 --- /dev/null +++ b/packages/anonymize/src/gliner2/inference.ts @@ -0,0 +1,35 @@ +import type { NerInferenceFn } from "../pipeline"; +import type { Entity } from "../types"; +import { Gliner2Client, type Gliner2ClientOptions } from "./client"; +import { expandLabels, collapseLabel } from "./label-map"; +import { DETECTION_SOURCES } from "../constants"; + +export const buildGliner2Inference = ( + options: Gliner2ClientOptions = {}, +): NerInferenceFn => { + const client = new Gliner2Client(options); + + return async (fullText, labels, threshold, signal): Promise => { + const modelLabels = expandLabels(labels); + if (modelLabels.length === 0) return []; + + const pipelineLabelSet = new Set(labels); + const response = await client.infer( + fullText, + modelLabels, + threshold, + signal, + ); + + return response.entities.map( + (e): Entity => ({ + text: e.text, + start: e.start, + end: e.end, + label: collapseLabel(e.label, pipelineLabelSet), + score: e.score, + source: DETECTION_SOURCES.NER, + }), + ); + }; +}; diff --git a/packages/anonymize/src/gliner2/label-map.ts b/packages/anonymize/src/gliner2/label-map.ts new file mode 100644 index 00000000..5bad43a2 --- /dev/null +++ b/packages/anonymize/src/gliner2/label-map.ts @@ -0,0 +1,60 @@ +export const PIPELINE_TO_MODEL: Record = { + person: ["person", "full_name", "first_name", "middle_name", "last_name"], + "phone number": ["phone_number"], + address: ["address", "street_address"], + "email address": ["email"], + "date of birth": ["date_of_birth"], + "bank account number": ["bank_account", "account_number"], + iban: ["iban"], + "tax identification number": ["tax_id", "tax_number"], + "identity card number": ["government_id", "national_id_number"], + "birth number": ["national_id_number"], + "national identification number": ["national_id_number"], + "social security number": ["national_id_number"], + "credit card number": ["payment_card", "card_number"], + "passport number": ["passport_number"], + date: ["sensitive_date", "document_date", "expiration_date"], +}; + +// Build reverse map: model label -> array of pipeline labels (in PIPELINE_TO_MODEL order) +const MODEL_TO_PIPELINE_MAP: Record = {}; +for (const [pipeline, models] of Object.entries(PIPELINE_TO_MODEL)) { + for (const model of models) { + if (!MODEL_TO_PIPELINE_MAP[model]) { + MODEL_TO_PIPELINE_MAP[model] = []; + } + MODEL_TO_PIPELINE_MAP[model].push(pipeline); + } +} + +export const expandLabels = (pipelineLabels: readonly string[]): string[] => { + const seen = new Set(); + const result: string[] = []; + for (const label of pipelineLabels) { + const modelLabels = PIPELINE_TO_MODEL[label]; + if (!modelLabels) continue; + for (const ml of modelLabels) { + if (!seen.has(ml)) { + seen.add(ml); + result.push(ml); + } + } + } + return result; +}; + +export const collapseLabel = ( + modelLabel: string, + requestedPipelineLabels: ReadonlySet, +): string => { + const candidates = MODEL_TO_PIPELINE_MAP[modelLabel]; + if (!candidates) return modelLabel; + + // Find the first candidate that was in the original requested labels (preserves caller order) + for (const candidate of candidates) { + if (requestedPipelineLabels.has(candidate)) return candidate; + } + + // Fall back to the first pipeline label in our map + return candidates[0] ?? modelLabel; +}; \ No newline at end of file diff --git a/packages/anonymize/src/gliner2/types.ts b/packages/anonymize/src/gliner2/types.ts new file mode 100644 index 00000000..18642680 --- /dev/null +++ b/packages/anonymize/src/gliner2/types.ts @@ -0,0 +1,23 @@ +export type InferRequest = { + text: string; + labels: string[]; + threshold: number; +}; + +export type EntityOutput = { + text: string; + start: number; + end: number; + label: string; + score: number; +}; + +export type InferResponse = { + entities: EntityOutput[]; +}; + +export type HealthResponse = { + status: string; + model_loaded: boolean; + version: string; +}; diff --git a/packages/anonymize/src/index-shared.ts b/packages/anonymize/src/index-shared.ts index f12d97c6..790a1f8e 100644 --- a/packages/anonymize/src/index-shared.ts +++ b/packages/anonymize/src/index-shared.ts @@ -191,6 +191,17 @@ export { decodeTokenSpans } from "./gliner/token-decoder"; export { prepareBatch, tokenizeText } from "./gliner/processor"; export type { EntityResult, RawInferenceResult } from "./gliner/types"; +// ── GLiNER2 Sidecar ────────────────────────────── +export { buildGliner2Inference } from "./gliner2/inference"; +export { Gliner2Client } from "./gliner2/client"; +export type { Gliner2ClientOptions } from "./gliner2/client"; +export type { + InferRequest, + InferResponse, + EntityOutput, + HealthResponse, +} from "./gliner2/types"; + // ── Utilities ───────────────────────────────────── export { chunkText,