Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

Release flow (#374)

Aleksei Savin196e362363d4
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 2e8b6aa8f..f15fc5ea5 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,3 +1,6 @@
+[alias]
+tools = "run --quiet -p cli-tools --"
+
[env]
RUST_TEST_THREADS = "1"
diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml
index e2f33440f..43ca666b8 100644
--- a/.github/actions/setup/action.yml
+++ b/.github/actions/setup/action.yml
@@ -22,16 +22,8 @@ inputs:
description: "Additional Rust target to install"
required: false
default: ''
- bindings-napi:
- description: "Install requirements for bindings-napi"
- required: false
- default: 'false'
- bindings-uniffi:
- description: "Install requirements for bindings-uniffi"
- required: false
- default: 'false'
- bindings-pyo3:
- description: "Install requirements for bindings-pyo3"
+ bindings:
+ description: "Install bindings requirements"
required: false
default: 'false'
@@ -74,7 +66,7 @@ runs:
- if: inputs.nextest == 'true'
uses: taiki-e/install-action@nextest
- - if: inputs.test_data == 'true' || inputs.bindings-pyo3 == 'true'
+ - if: inputs.test_data == 'true' || inputs.bindings == 'true'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
@@ -94,23 +86,12 @@ runs:
uv run export tokenizers
shell: bash
- - if: inputs.bindings-napi == 'true'
+ - if: inputs.bindings == 'true'
uses: actions/setup-node@v4
with:
node-version: "20"
- - if: inputs.bindings-napi == 'true'
+ - if: inputs.bindings == 'true'
uses: pnpm/action-setup@v4
with:
- version: 10.33.0
-
- # Please make sure to use compatible versions of the cargo-swift / uniffi pair.
- # See: https://github.com/antoniusnaumann/cargo-swift?tab=readme-ov-file#installing-for-a-different-uniffi-version
- - if: inputs.bindings-uniffi == 'true'
- run: cargo install [email protected] -f
- shell: bash
-
- - if: inputs.bindings-pyo3 == 'true'
- run: |
- uv tool install maturin
- shell: bash
\ No newline at end of file
+ version: 10.33.0
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 000000000..84f424314
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,209 @@
+name: "Release"
+
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: "Release version"
+ required: true
+ type: string
+
+permissions:
+ contents: write
+
+concurrency:
+ group: release
+ cancel-in-progress: false
+
+jobs:
+ release:
+ runs-on: [self-hosted, macos, mac, arm64]
+ env:
+ VERSION: ${{ inputs.version }}
+
+ steps:
+ - uses: actions/checkout@v6
+ - uses: ./.github/actions/setup
+ with:
+ metal: true
+ bindings: true
+
+ - name: "Release: Checkout main"
+ uses: actions/checkout@v6
+ with:
+ ref: main
+ fetch-depth: 0
+ persist-credentials: true
+
+ - name: "Release: Validate version"
+ run: |
+ set -euo pipefail
+ git fetch --tags origin
+
+ # 1. Tag must not already exist (locally or on origin)
+ if git rev-parse -q --verify "refs/tags/${VERSION}" >/dev/null \
+ || git ls-remote --tags origin "refs/tags/${VERSION}" | grep -q .; then
+ echo "Tag ${VERSION} already exists"; exit 1
+ fi
+
+ # 2. New version must be greater than every existing tag (semver-aware sort)
+ latest=$(git tag --list | sort -V | tail -n1 || true)
+ if [ -n "$latest" ]; then
+ highest=$(printf '%s\n%s\n' "$latest" "${VERSION}" | sort -V | tail -n1)
+ if [ "$highest" != "${VERSION}" ] || [ "$latest" = "${VERSION}" ]; then
+ echo "Version ${VERSION} is not greater than latest tag $latest"; exit 1
+ fi
+ echo "Bumping ${latest} -> ${VERSION}"
+ else
+ echo "No previous tags; ${VERSION} is the first release"
+ fi
+
+ - name: "Release: Reset existing rustup toolchains on self-hosted runner"
+ run: |
+ if command -v rustup >/dev/null; then
+ rustup toolchain uninstall stable 2>/dev/null || true
+ rustup toolchain uninstall nightly 2>/dev/null || true
+ fi
+
+ - name: "Release: Install tools"
+ run: |
+ cargo tools setup
+ cargo tools install rust
+ cargo tools install python
+ cargo tools install swift
+ cargo tools install typescript
+
+ - name: "Release: Sync"
+ run: cargo tools sync
+
+ - name: "Release: Build artifacts"
+ run: cargo tools release "${VERSION}"
+
+ # ---------------------------------------------------------------
+ # Publish Platform
+ # ---------------------------------------------------------------
+ - name: "Publish Platform: Decode bucket credentials"
+ run: |
+ mkdir -p "$RUNNER_TEMP/gcloud"
+ echo "${{ secrets.PLATFORM_BUCKET_BASE64_CREDENTIALS }}" | base64 -d > "$RUNNER_TEMP/gcloud/platform.json"
+ echo "PLATFORM_CREDENTIALS=$RUNNER_TEMP/gcloud/platform.json" >> "$GITHUB_ENV"
+
+ - name: "Publish Platform: Authenticate to GCS"
+ uses: google-github-actions/auth@v2
+ with:
+ credentials_json_path: ${{ env.PLATFORM_CREDENTIALS }}
+
+ - name: "Publish Platform: Setup gcloud"
+ uses: google-github-actions/setup-gcloud@v2
+
+ - name: "Publish Platform: Upload snippets"
+ run: |
+ gsutil -m rsync -r -d workspace/release/platform \
+ "gs://platform-bucket-0485e11/snippets"
+
+ # ---------------------------------------------------------------
+ # Publish Swift
+ # ---------------------------------------------------------------
+ - name: "Publish Swift: Decode artifacts bucket credentials"
+ run: |
+ mkdir -p "$RUNNER_TEMP/gcloud"
+ echo "${{ secrets.ARTIFACTS_BUCKET_BASE64_CREDENTIALS }}" | base64 -d > "$RUNNER_TEMP/gcloud/artifacts.json"
+ echo "ARTIFACTS_CREDENTIALS=$RUNNER_TEMP/gcloud/artifacts.json" >> "$GITHUB_ENV"
+
+ - name: "Publish Swift: Authenticate to GCS"
+ uses: google-github-actions/auth@v2
+ with:
+ credentials_json_path: ${{ env.ARTIFACTS_CREDENTIALS }}
+
+ - name: "Publish Swift: Setup gcloud"
+ uses: google-github-actions/setup-gcloud@v2
+
+ - name: "Publish Swift: Upload xcframework"
+ run: |
+ set -euo pipefail
+ GS_URI="gs://artifacts-bucket-cd05ceb/uzu-swift/releases/${VERSION}.zip"
+ if gsutil -q stat "$GS_URI"; then
+ echo "Release zip already exists at $GS_URI"; exit 1
+ fi
+ gsutil cp "workspace/release/swift-spm/${VERSION}.zip" "$GS_URI"
+
+ # ---------------------------------------------------------------
+ # Publish TypeScript
+ # ---------------------------------------------------------------
+ - name: "Publish TypeScript"
+ working-directory: workspace/release/typescript-npm
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+ run: pnpm publish --access public
+
+ # ---------------------------------------------------------------
+ # Publish Python
+ # ---------------------------------------------------------------
+ - name: "Publish Python"
+ env:
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
+ run: |
+ uv publish workspace/release/python-pypi/*.whl
+
+ # ---------------------------------------------------------------
+ # Publish Docs
+ # ---------------------------------------------------------------
+ - name: "Publish Docs: Generate GitHub App token"
+ id: docs-token
+ uses: actions/create-github-app-token@v2
+ with:
+ app-id: ${{ secrets.GH_APP_ID }}
+ private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
+ owner: trymirai
+ repositories: docs
+
+ - name: "Publish Docs: Checkout repo"
+ uses: actions/checkout@v6
+ with:
+ repository: trymirai/docs
+ ref: main
+ token: ${{ steps.docs-token.outputs.token }}
+ path: docs-repo
+ persist-credentials: false
+
+ - name: "Publish Docs: Sync"
+ run: |
+ set -euo pipefail
+ rsync -a --delete \
+ --exclude '.git' --exclude '.git/*' \
+ workspace/release/docs/ docs-repo/snippets/generated/
+
+ - name: "Publish Docs: Commit and push changes"
+ env:
+ GH_TOKEN: ${{ steps.docs-token.outputs.token }}
+ run: |
+ set -euo pipefail
+ cd docs-repo
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+ git add -A
+ if git diff --staged --quiet; then
+ echo "No docs changes to commit"
+ else
+ git commit -m "Release ${VERSION}"
+ git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/trymirai/docs.git"
+ git push origin HEAD:main
+ fi
+
+ # ---------------------------------------------------------------
+ # Commit changes generated by sync + release, tag, push.
+ # The tag is attached to the commit this pipeline produces.
+ # ---------------------------------------------------------------
+ - name: "Release: Commit and tag"
+ run: |
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+ git add -A
+ if git diff --staged --quiet; then
+ echo "No changes to commit"
+ else
+ git commit -m "Release ${VERSION}"
+ fi
+ git tag "${VERSION}"
+ git push origin HEAD:main
+ git push origin "${VERSION}"
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 435af8458..be22f493f 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -49,6 +49,10 @@ jobs:
if: ${{ always() && steps.setup.outcome == 'success' }}
run: cargo deny check
+ - name: Check sync
+ if: ${{ always() && steps.setup.outcome == 'success' }}
+ run: cargo tools sync --check
+
tests:
name: ${{ matrix.backend }}
${{ matrix.tracing && ' (tracing)' || '' }}
@@ -111,12 +115,32 @@ jobs:
- uses: ./.github/actions/setup
with:
metal: true
- bindings-napi: true
- bindings-uniffi: true
- bindings-pyo3: true
+ bindings: true
- - name: Prepare bindings
- run: cargo run -p cli-release prepare-bindings
+ - name: "Reset existing rustup toolchains on self-hosted runner"
+ run: |
+ if command -v rustup >/dev/null; then
+ rustup toolchain uninstall stable 2>/dev/null || true
+ rustup toolchain uninstall nightly 2>/dev/null || true
+ fi
+
+ - name: "Setup"
+ run: |
+ cargo tools setup
+ cargo tools install rust
+ cargo tools install python
+ cargo tools install swift
+ cargo tools install typescript
+
+ - name: "Verify"
+ run: |
+ cargo tools verify
+
+ - name: "Test"
+ run: |
+ cargo tools test python
+ cargo tools test swift
+ cargo tools test typescript
completed:
name: completed
diff --git a/.gitignore b/.gitignore
index 49a373be5..db59cb447 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,8 @@
.claude/settings.local.json
tools/gpu_trace/*.json
+
+# Swift
+.build/
+.swiftpm/
+Package.resolved
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 624f8a6d9..494a34062 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -18,18 +18,6 @@
"command": "cargo +nightly fmt && ./scripts/clang-format.sh",
"problemMatcher": []
},
- {
- "label": "Prepare Bindings",
- "type": "shell",
- "command": "cargo run -p cli-release prepare-bindings",
- "problemMatcher": []
- },
- {
- "label": "Prepare Workspace",
- "type": "shell",
- "command": "cargo run -p cli-release prepare-workspace \"$(uv run python3 -c 'import tomllib; print(tomllib.load(open(\"Cargo.toml\", \"rb\"))[\"workspace\"][\"package\"][\"version\"])')\"",
- "problemMatcher": []
- },
{
"label": "Download Model",
"type": "shell",
diff --git a/Cargo.lock b/Cargo.lock
index 9c1c9f498..88c6360dd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1317,19 +1317,6 @@ dependencies = [
"uuid",
]
-[[package]]
-name = "cli-release"
-version = "0.1.9"
-dependencies = [
- "clap",
- "heck",
- "ignore",
- "regex",
- "serde_json",
- "syn 2.0.117",
- "thiserror 2.0.18",
-]
-
[[package]]
name = "cli-storage"
version = "0.1.9"
@@ -1346,6 +1333,25 @@ dependencies = [
"uzu",
]
+[[package]]
+name = "cli-tools"
+version = "0.1.9"
+dependencies = [
+ "anyhow",
+ "clap",
+ "colored",
+ "heck",
+ "ignore",
+ "indexmap 2.14.0",
+ "minijinja",
+ "regex",
+ "serde",
+ "serde_json",
+ "syn 2.0.117",
+ "toml 1.1.2+spec-1.1.0",
+ "toml_edit 0.25.11+spec-1.1.0",
+]
+
[[package]]
name = "cmake"
version = "0.1.58"
@@ -1378,6 +1384,15 @@ version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
+[[package]]
+name = "colored"
+version = "3.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34"
+dependencies = [
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "combine"
version = "4.6.7"
@@ -7558,6 +7573,7 @@ dependencies = [
"indexmap 2.14.0",
"toml_datetime 1.1.1+spec-1.1.0",
"toml_parser",
+ "toml_writer",
"winnow 1.0.2",
]
diff --git a/Cargo.toml b/Cargo.toml
index a85a08eeb..c4b2d9803 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,17 +15,30 @@ members = [
"crates/benchmarks",
"crates/cli",
"crates/cli-storage",
- "crates/cli-release",
+ "crates/cli-tools",
]
resolver = "3"
[workspace.package]
-version = "0.1.9"
edition = "2024"
rust-version = "1.94"
-license = "MIT"
-authors = ["Mirai Tech <https://trymirai.com>"]
+version = "0.1.9"
+authors = ["Mirai Tech Inc. <[email protected]>"]
+description = "A high-performance inference engine for AI models"
+readme = "README.md"
+homepage = "https://trymirai.com"
repository = "https://github.com/trymirai/uzu"
+license = "MIT"
+license-file = "LICENSE"
+keywords = [
+ "rust",
+ "ai",
+ "metal",
+ "high-performance",
+ "inference",
+ "llm",
+ "tts",
+]
[workspace.dependencies]
dsl = { path = "crates/dsl" }
@@ -74,7 +87,7 @@ itertools = "0.14"
schemars = { version = "1.2", features = ["derive"] }
is_close = "0.1"
serde_json5 = "0.2"
-anyhow = "1.0"
+anyhow = "1.0.102"
async-trait = "0.1"
bindgen = "0.72"
walkdir = "2.5"
@@ -174,6 +187,9 @@ keyring = { version = "3.6.3", features = [
"linux-native-sync-persistent",
"crypto-rust",
] }
+toml = "1.1.2"
+toml_edit = "0.25.11"
+colored = "3.1.1"
[workspace.metadata.dinghy]
forward-cfgs = ["metal_backend", "grammar_xgrammar"]
diff --git a/Package.swift b/Package.swift
new file mode 100644
index 000000000..e63f15f3e
--- /dev/null
+++ b/Package.swift
@@ -0,0 +1,47 @@
+// swift-tools-version: 5.9
+import PackageDescription
+
+let package = Package(
+ name: "Uzu",
+ platforms: [
+ .iOS("26.4"),
+ .macOS("26.4"),
+ ],
+ products: [
+ .library(name: "Uzu", targets: ["Uzu"]),
+ .executable(name: "examples", targets: ["Examples"]),
+ ],
+ dependencies: [
+ .package(url: "https://github.com/apple/swift-argument-parser", from: "1.6.1")
+ ],
+ targets: [
+ .binaryTarget(
+ name: "uzu",
+ path: "bindings/swift/uzu.xcframework"
+ ),
+ .target(
+ name: "Uzu",
+ path: "bindings/swift/Sources/Uzu",
+ dependencies: ["uzu"],
+ linkerSettings: [
+ .linkedLibrary("c++"),
+ .linkedFramework("SystemConfiguration"),
+ .linkedFramework("Metal"),
+ .linkedFramework("MetalPerformanceShadersGraph"),
+ ]
+ ),
+ .executableTarget(
+ name: "Examples",
+ path: "bindings/swift/Sources/Examples",
+ dependencies: [
+ "Uzu",
+ .product(name: "ArgumentParser", package: "swift-argument-parser"),
+ ]
+ ),
+ .testTarget(
+ name: "UzuTests",
+ path: "bindings/swift/Tests/UzuTests",
+ dependencies: ["Uzu"],
+ ),
+ ]
+)
diff --git a/README.md b/README.md
index ce1201937..99c5d48ae 100644
--- a/README.md
+++ b/README.md
@@ -4,141 +4,1662 @@
</picture>
</p>
-<a href="https://discord.com/invite/trymirai"><img src="https://img.shields.io/discord/1377764166764462120?label=Discord" alt="Discord"></a>
-<a href="mailto:[email protected]?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-green" alt="Contact us"></a>
-<a href="https://docs.trymirai.com/overview/uzu"><img src="https://img.shields.io/badge/Read-Docs-blue" alt="Read docs"></a>
-[![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
+<a href="https://discord.com/invite/trymirai"><img src="https://img.shields.io/discord/1377764166764462120?label=Discord&color=brightgreen" alt="Discord"></a> <a href="mailto:[email protected]?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-brightgreen" alt="Contact us"></a> <a href="https://docs.trymirai.com"><img src="https://img.shields.io/badge/Read-Docs-brightgreen" alt="Read docs"></a> [![License](https://img.shields.io/badge/License-MIT-brightgreen)](LICENSE) ![Build](https://github.com/trymirai/uzu/actions/workflows/tests.yml/badge.svg) ![Python](https://img.shields.io/badge/Python-orange) ![Package](https://img.shields.io/pypi/v/uzu?color=orange&label=Package) ![Downloads](https://img.shields.io/pypi/dm/uzu?color=orange&label=Downloads) ![Python](https://img.shields.io/pypi/pyversions/uzu?color=orange&label=Python) ![TypeScript](https://img.shields.io/badge/TypeScript-yellow) ![Package](https://img.shields.io/npm/v/@trymirai/uzu?color=yellow&label=Package) ![Downloads](https://img.shields.io/npm/dm/@trymirai/uzu?color=yellow&label=Downloads) ![Swift](https://img.shields.io/badge/Swift-blue) ![SPM](https://img.shields.io/badge/SPM-compatible-blue) ![Platforms](https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS-blue) [![Swift](https://img.shields.io/badge/Swift-5.9-blue)](https://swift.org)
# uzu
-A high-performance inference engine for AI models on Apple Silicon. Key features:
+A high-performance inference engine for AI models. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. Key features:
- Simple, high-level API
- Unified model configurations, making it easy to add support for new models
- Traceable computations to ensure correctness against the source-of-truth implementation
- Utilizes unified memory on Apple devices
+- [Broad model support](https://trymirai.com/models)
-## Overview
+## Quick Start
-For a detailed explanation of the architecture, please refer to the [documentation](https://docs.trymirai.com/overview/uzu).
-### [Models](https://trymirai.com/models)
-`uzu` uses its own model format. You can download a test model using the sample script:
+<details>
+<summary>Rust</summary>
+<br>
-```bash
-./scripts/download_test_model.sh
+Add the dependency:
+
+```toml
+[dependencies]
+uzu = { git = "https://github.com/trymirai/uzu", branch = "main", package = "uzu" }
```
-Or you can download any supported model that has already been converted using:
+Run the code below:
-```bash
-cd ./tools/
-uv run downloader list # show the list of supported models
-uv run downloader download {REPO_ID} # download a specific model using repo_id
-```
+```rust
+use uzu::{
+ engine::{Engine, EngineConfig},
+ types::session::chat::{ChatConfig, ChatMessage, ChatReplyConfig},
+};
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let engine_config = EngineConfig::default();
+ let engine = Engine::new(engine_config).await?;
-After that, you can find the downloaded model at `./workspace/models/{VERSION}/`.
+ let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
+ let downloader = engine.download(&model).await?;
+ while let Some(update) = downloader.next().await {
+ println!("Download progress: {}", update.progress());
+ }
-Alternatively, you can export a specific model yourself with [lalamo](https://github.com/trymirai/lalamo):
+ let session = engine.chat(model, ChatConfig::default()).await?;
-```bash
-git clone https://github.com/trymirai/lalamo.git
-cd lalamo
+ let messages = vec![
+ ChatMessage::system().with_text("You are a helpful assistant".to_string()),
+ ChatMessage::user().with_text("Tell me a short, funny story about a robot".to_string()),
+ ];
+
+ let replies = session.reply(messages, ChatReplyConfig::default()).await?;
+ if let Some(reply) = replies.last() {
+ println!("Reasoning: {}", reply.message.reasoning().unwrap_or_default());
+ println!("Text: {}", reply.message.text().unwrap_or_default());
+ }
+
+ Ok(())
+}
```
-After that, you can retrieve the list of supported models:
+</details>
+
+
+
+<details>
+<summary>Python</summary>
+<br>
+
+Add the dependency:
```bash
-uv run lalamo list-models
+uv add uzu==0.1.9
```
-Then, export the specific one:
+Run the code below:
-```bash
-uv run lalamo convert meta-llama/Llama-3.2-1B-Instruct
+```python
+import asyncio
+
+from uzu import ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ return
+
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ session = await engine.chat(model, ChatConfig.create())
+
+ messages = [
+ ChatMessage.system().with_text("You are a helpful assistant"),
+ ChatMessage.user().with_text("Tell me a short, funny story about a robot"),
+ ]
+
+ replies = await session.reply(messages, ChatReplyConfig.create())
+ if not replies:
+ return
+
+ message = replies[-1].message
+ print(f"Reasoning: {message.reasoning}")
+ print(f"Text: {message.text}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
```
-### Bindings
+</details>
-- [uzu-swift](https://github.com/trymirai/uzu-swift) - a prebuilt Swift framework, ready to use with SPM
-- [uzu-ts](https://github.com/trymirai/uzu-ts) - a prebuilt TypeScript framework made for Node.js ecosystem
-### CLI
-You can run `uzu` in a [CLI](https://docs.trymirai.com/overview/cli) mode:
+<details>
+<summary>Swift</summary>
+<br>
-```bash
-cargo run --release -p cli -- help
+Add the dependency:
+
+```swift
+dependencies: [
+ .package(url: "https://github.com/trymirai/uzu.git", from: "0.1.9")
+]
```
-```bash
-Usage: cli [COMMAND]
-​
-Commands:
- run Run a model with the specified path
- serve Start a server with the specified model path
- bench Run benchmarks for the specified model
- help Print this message or the help of the given subcommand(s)
+Run the code below:
+
+```swift
+import Uzu
+
+public func runQuickStart() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let session = try await engine.chat(model: model, config: .create())
+
+ let messages = [
+ ChatMessage.system().withText(text: "You are a helpful assistant"),
+ ChatMessage.user().withText(text: "Tell me a short, funny story about a robot")
+ ]
+
+ let reply = try await session.reply(input: messages, config: .create())
+ guard let message = reply.last?.message else {
+ return
+ }
+
+ print("Reasoning: \(message.reasoning() ?? "empty")")
+ print("Text: \(message.text() ?? "empty")")
+}
```
-### Compilation
+</details>
+
-For now, we only support the `Metal` backend, so to compile corresponding kernels you’ll need to install `Xcode` and run the following commands:
+
+<details>
+<summary>TypeScript</summary>
+<br>
+
+Add the dependency:
```bash
-xcodebuild -runFirstLaunch
-xcodebuild -downloadComponent MetalToolchain
+pnpm add @trymirai/[email protected]
```
-## Quick Start
+Run the code below:
-First, add the `uzu` dependency to your `Cargo.toml`:
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig } from '@trymirai/uzu';
-```toml
-[dependencies]
-uzu = { git = "https://github.com/trymirai/uzu", branch = "main", package = "uzu" }
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ let session = await engine.chat(model, ChatConfig.create());
+
+ let messages = [
+ ChatMessage.system().withText('You are a helpful assistant'),
+ ChatMessage.user().withText('Tell me a short, funny story about a robot')
+ ];
+
+ let reply = await session.reply(messages, ChatReplyConfig.create());
+ let message = reply[0]?.message;
+
+ if (message) {
+ console.log('Reasoning: ', message.reasoning);
+ console.log('Text: ', message.text);
+ }
+}
+
+main().catch((error) => {
+ console.error(error);
+});
```
-Then, create an inference `Session` with a specific model and configuration:
+</details>
+
+
+<br>
+Everything from model downloading to inference configuration is handled automatically. Refer to the [documentation](https://docs.trymirai.com) for details on how to customize each step of the process.
+
+## Examples
+
+You can run any example via `cargo tools example` \<**rust** | **python** | **swift** | **typescript**\> \<**chat** | **chat-cloud** | **chat-speculation-classification** | **chat-speculation-summarization** | **chat-structured-output** | **classification** | **quick-start** | **text-to-speech**\>:
+
+### Chat
+
+In this example, we will download a model and get a reply to a specific list of messages:
+
+<details>
+<summary>Rust</summary>
```rust
use uzu::{
engine::{Engine, EngineConfig},
+ session::chat::ChatSessionStreamChunk,
types::session::chat::{ChatConfig, ChatMessage, ChatReplyConfig},
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
- let config = EngineConfig::default();
- let engine = Engine::new(config).await?;
+ let engine_config = EngineConfig::default();
+ let engine = Engine::new(engine_config).await?;
let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
- while let Some(update) = engine.download(&model).await?.next().await {
- println!("Downloading: {}", update.progress());
+ let downloader = engine.download(&model).await?;
+ while let Some(update) = downloader.next().await {
+ println!("Download progress: {}", update.progress());
}
+ let messages = vec![
+ ChatMessage::system().with_text("You are a helpful assistant".to_string()),
+ ChatMessage::user().with_text("Tell me a short, funny story about a robot".to_string()),
+ ];
let session = engine.chat(model, ChatConfig::default()).await?;
- let outputs = session
- .reply(vec![ChatMessage::user().with_text("Tell about London".to_string())], ChatReplyConfig::default())
- .await?;
- for output in outputs {
- println!("{}", output.message.text().unwrap_or_default());
+ let stream = session.reply_with_stream(messages, ChatReplyConfig::default()).await;
+ let mut last_message: Option<ChatMessage> = None;
+ while let Some(chunk) = stream.next().await {
+ match chunk {
+ ChatSessionStreamChunk::Replies {
+ replies,
+ } => {
+ if let Some(reply) = replies.first() {
+ last_message = Some(reply.message.clone());
+ println!("Generated tokens: {}", reply.stats.tokens_count_output.unwrap_or_default());
+ }
+ },
+ ChatSessionStreamChunk::Error {
+ error,
+ } => {
+ println!("Error: {error}");
+ },
+ }
+ }
+ if let Some(message) = last_message {
+ println!("Reasoning: {}", message.reasoning().unwrap_or_default());
+ println!("Text: {}", message.text().unwrap_or_default());
}
Ok(())
}
```
-## Benchmarks
+</details>
-To run benchmarks, you can use the following command:
+<details>
+<summary>Python</summary>
-```bash
-cargo run --release -p cli -- bench ./workspace/models/{ENGINE_VERSION}/{MODEL_NAME} ./workspace/models/{ENGINE_VERSION}/{MODEL_NAME}/benchmark_task.json ./workspace/models/{ENGINE_VERSION}/{MODEL_NAME}/benchmark_result.json
+```python
+import asyncio
+
+from uzu import (
+ ChatConfig,
+ ChatMessage,
+ ChatReplyConfig,
+ ChatSessionStreamChunk,
+ Engine,
+ EngineConfig,
+)
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ messages = [
+ ChatMessage.system().with_text("You are a helpful assistant"),
+ ChatMessage.user().with_text("Tell me a short, funny story about a robot"),
+ ]
+ session = await engine.chat(model, ChatConfig.create())
+ stream = await session.reply_with_stream(messages, ChatReplyConfig.create())
+ message: ChatMessage | None = None
+ async for chunk in stream.iterator():
+ if isinstance(chunk, ChatSessionStreamChunk.Replies):
+ replies = chunk.replies
+ if replies:
+ reply = replies[0]
+ message = reply.message
+ print(f"Generated tokens: {reply.stats.tokens_count_output}")
+ elif isinstance(chunk, ChatSessionStreamChunk.Error):
+ print(f"Error: {chunk.error}")
+ if message is not None:
+ print(f"Reasoning: {message.reasoning}")
+ print(f"Text: {message.text}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+</details>
+
+<details>
+<summary>Swift</summary>
+
+```swift
+import Uzu
+
+public func runChat() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let messages = [
+ ChatMessage.system().withText(text: "You are a helpful assistant"),
+ ChatMessage.user().withText(text: "Tell me a short, funny story about a robot")
+ ]
+ let session = try await engine.chat(model: model, config: .create())
+ let stream = await session.replyWithStream(input: messages, config: .create())
+ var message: ChatMessage? = nil
+ for try await update in stream.iterator() {
+ switch update {
+ case .replies(let replies):
+ let reply = replies.last
+ message = reply?.message
+ print("Generated tokens: \(reply?.stats.tokensCountOutput ?? 0)")
+ case .error(let error):
+ print("Error: \(error)")
+ }
+ }
+ print("Reasoning: \(message?.reasoning() ?? "empty")")
+ print("Text: \(message?.text() ?? "empty")")
+}
+```
+
+</details>
+
+<details>
+<summary>TypeScript</summary>
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, ChatSessionStreamChunkError, ChatSessionStreamChunkReplies, Engine, EngineConfig } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ let messages = [
+ ChatMessage.system().withText('You are a helpful assistant'),
+ ChatMessage.user().withText('Tell me a short, funny story about a robot')
+ ];
+ let session = await engine.chat(model, ChatConfig.create());
+ let stream = await session.replyWithStream(messages, ChatReplyConfig.create());
+ let message: ChatMessage | undefined;
+ for await (const chunk of stream) {
+ if (chunk instanceof ChatSessionStreamChunkReplies) {
+ message = chunk.replies[0]?.message;
+ console.log('Generated tokens: ', chunk.replies[0]?.stats.tokensCountOutput);
+ } else if (chunk instanceof ChatSessionStreamChunkError) {
+ console.error('Error: ', chunk.error);
+ }
+ }
+ console.log('Reasoning: ', message?.reasoning);
+ console.log('Text: ', message?.text);
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+</details>
+
+
+<br>Once loaded, the same `ChatSession` can be reused for multiple requests until you drop it. Each model may consume a significant amount of RAM, so it's important to keep only one session loaded at a time. For iOS apps, we recommend adding the [Increased Memory Capability](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.kernel.increased-memory-limit) entitlement to ensure your app can allocate the required memory.
+
+### Chat with the cloud model
+
+In this example, we will get a reply to a specific list of messages from a cloud model:
+
+<details>
+<summary>Rust</summary>
+
+```rust
+use uzu::{
+ engine::{Engine, EngineConfig},
+ types::{
+ basic::ReasoningEffort,
+ session::chat::{ChatConfig, ChatMessage, ChatReplyConfig},
+ },
+};
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let engine_config = EngineConfig::default().with_openai_api_key("OPENAI_API_KEY".to_string());
+ let engine = Engine::new(engine_config).await?;
+
+ let model = engine.model("gpt-5".to_string()).await?.ok_or("Model not found")?;
+
+ let messages = vec![
+ ChatMessage::system().with_reasoning_effort(ReasoningEffort::Low),
+ ChatMessage::user().with_text("How LLMs work".to_string()),
+ ];
+
+ let session = engine.chat(model, ChatConfig::default()).await?;
+ let replies = session.reply(messages, ChatReplyConfig::default()).await?;
+ if let Some(reply) = replies.first() {
+ println!("Reasoning: {}", reply.message.reasoning().unwrap_or_default());
+ println!("Text: {}", reply.message.text().unwrap_or_default());
+ }
+
+ Ok(())
+}
+```
+
+</details>
+
+<details>
+<summary>Python</summary>
+
+```python
+import asyncio
+
+from uzu import ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig, ReasoningEffort
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create().with_openai_api_key("OPENAI_API_KEY")
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("gpt-5")
+ if model is None:
+ raise RuntimeError("Model not found")
+
+ messages = [
+ ChatMessage.system().with_reasoning_effort(ReasoningEffort.Low),
+ ChatMessage.user().with_text("How LLMs work"),
+ ]
+
+ session = await engine.chat(model, ChatConfig.create())
+ replies = await session.reply(messages, ChatReplyConfig.create())
+ if replies:
+ message = replies[0].message
+ print(f"Reasoning: {message.reasoning}")
+ print(f"Text: {message.text}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+</details>
+
+<details>
+<summary>Swift</summary>
+
+```swift
+import Uzu
+
+public func runChatCloud() async throws {
+ let engineConfig = EngineConfig.create().withOpenaiApiKey(openaiApiKey: "OPENAI_API_KEY")
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+
+ let messages = [
+ ChatMessage.system().withReasoningEffort(reasoningEffort: .low),
+ ChatMessage.user().withText(text: "How LLMs work")
+ ]
+
+ let session = try await engine.chat(model: model, config: .create())
+ let reply = try await session.reply(input: messages, config: .create())
+ guard let message = reply.last?.message else {
+ return
+ }
+
+ print("Reasoning: \(message.reasoning() ?? "empty")")
+ print("Text: \(message.text() ?? "empty")")
+}
+```
+
+</details>
+
+<details>
+<summary>TypeScript</summary>
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig, ReasoningEffort } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create().withOpenaiApiKey('OPENAI_API_KEY');
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('gpt-5');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+
+ let messages = [
+ ChatMessage.system().withReasoningEffort("Low" as ReasoningEffort),
+ ChatMessage.user().withText('How LLMs work')
+ ];
+
+ let session = await engine.chat(model, ChatConfig.create());
+ let reply = await session.reply(messages, ChatReplyConfig.create());
+ let message = reply[0]?.message;
+ if (message) {
+ console.log('Reasoning: ', message.reasoning);
+ console.log('Text: ', message.text);
+ }
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+</details>
+
+
+### Chat using speculation preset for classification
+
+In this example, we will use the `classification` speculation preset to determine the sentiment of the user's input:
+
+<details>
+<summary>Rust</summary>
+
+```rust
+use uzu::{
+ engine::{Engine, EngineConfig},
+ types::{
+ basic::{Feature, ReasoningEffort, SamplingMethod},
+ session::chat::{ChatConfig, ChatMessage, ChatReplyConfig, ChatSpeculationPreset},
+ },
+};
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let engine_config = EngineConfig::default();
+ let engine = Engine::new(engine_config).await?;
+
+ let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
+ let downloader = engine.download(&model).await?;
+ while let Some(update) = downloader.next().await {
+ println!("Download progress: {}", update.progress());
+ }
+
+ let feature = Feature {
+ name: "sentiment".to_string(),
+ values: vec![
+ "Happy".to_string(),
+ "Sad".to_string(),
+ "Angry".to_string(),
+ "Fearful".to_string(),
+ "Surprised".to_string(),
+ "Disgusted".to_string(),
+ ],
+ };
+ let chat_config = ChatConfig::default().with_speculation_preset(Some(ChatSpeculationPreset::Classification {
+ feature: feature.clone(),
+ }));
+ let session = engine.chat(model, chat_config).await?;
+
+ let text_to_detect_feature = "Today's been awesome! Everything just feels right, and I can't stop smiling.";
+ let prompt = format!(
+ "Text is: \"{text_to_detect_feature}\". Choose {} from the list: {}. Answer with one word. Don't add a dot at the end.",
+ feature.name,
+ feature.values.join(", ")
+ );
+ let messages = vec![
+ ChatMessage::system().with_reasoning_effort(ReasoningEffort::Disabled),
+ ChatMessage::user().with_text(prompt),
+ ];
+
+ let chat_reply_config =
+ ChatReplyConfig::default().with_token_limit(Some(32)).with_sampling_method(SamplingMethod::Greedy {});
+ let replies = session.reply(messages, chat_reply_config).await?;
+ if let Some(reply) = replies.first() {
+ println!("Prediction: {}", reply.message.text().unwrap_or_default());
+ println!("Generated tokens: {}", reply.stats.tokens_count_output.unwrap_or_default());
+ }
+
+ Ok(())
+}
+```
+
+</details>
+
+<details>
+<summary>Python</summary>
+
+```python
+import asyncio
+
+from uzu import (
+ ChatConfig,
+ ChatMessage,
+ ChatReplyConfig,
+ ChatSpeculationPreset,
+ Engine,
+ EngineConfig,
+ Feature,
+ ReasoningEffort,
+ SamplingMethod,
+)
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ feature = Feature(
+ "sentiment",
+ ["Happy", "Sad", "Angry", "Fearful", "Surprised", "Disgusted"],
+ )
+ chat_config = ChatConfig.create().with_speculation_preset(ChatSpeculationPreset.Classification(feature))
+ session = await engine.chat(model, chat_config)
+
+ text_to_detect_feature = "Today's been awesome! Everything just feels right, and I can't stop smiling."
+ prompt = (
+ f'Text is: "{text_to_detect_feature}". '
+ f"Choose {feature.name} from the list: {', '.join(feature.values)}. "
+ "Answer with one word. Don't add a dot at the end."
+ )
+ messages = [
+ ChatMessage.system().with_reasoning_effort(ReasoningEffort.Disabled),
+ ChatMessage.user().with_text(prompt),
+ ]
+
+ chat_reply_config = ChatReplyConfig.create().with_token_limit(32).with_sampling_method(SamplingMethod.Greedy())
+ replies = await session.reply(messages, chat_reply_config)
+ if replies:
+ reply = replies[0]
+ print(f"Prediction: {reply.message.text}")
+ print(f"Generated tokens: {reply.stats.tokens_count_output}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+</details>
+
+<details>
+<summary>Swift</summary>
+
+```swift
+import Uzu
+
+public func runChatSpeculationClassification() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let feature = Feature(name: "sentiment", values: [
+ "Happy",
+ "Sad",
+ "Angry",
+ "Fearful",
+ "Surprised",
+ "Disgusted",
+ ])
+ let chatConfig = ChatConfig.create().withSpeculationPreset(speculationPreset: .classification(feature: feature))
+ let session = try await engine.chat(model: model, config: chatConfig)
+
+ let textToDetectFeature =
+ "Today's been awesome! Everything just feels right, and I can't stop smiling."
+ let prompt = "Text is: \"\(textToDetectFeature)\". Choose \(feature.name) from the list: \(feature.values.joined(separator: ", ")). Answer with one word. Don't add a dot at the end."
+ let messages = [
+ ChatMessage.system().withReasoningEffort(reasoningEffort: .disabled),
+ ChatMessage.user().withText(text: prompt)
+ ]
+
+ let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(tokenLimit: 32).withSamplingMethod(samplingMethod: .greedy)
+ let replies = try await session.reply(input: messages, config: chatReplyConfig)
+ guard let reply = replies.last else {
+ return
+ }
+
+ print("Prediction: \(reply.message.text() ?? "empty")")
+ print("Generated tokens: \(reply.stats.tokensCountOutput ?? 0)")
+}
+```
+
+</details>
+
+<details>
+<summary>TypeScript</summary>
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, ChatSpeculationPresetClassification, Engine, EngineConfig, Feature, ReasoningEffort, SamplingMethodGreedy } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ const feature = new Feature('sentiment', [
+ 'Happy',
+ 'Sad',
+ 'Angry',
+ 'Fearful',
+ 'Surprised',
+ 'Disgusted',
+ ]);
+ let chatConfig = ChatConfig.create().withSpeculationPreset(new ChatSpeculationPresetClassification(feature));
+ let session = await engine.chat(model, chatConfig);
+
+ const textToDetectFeature =
+ "Today's been awesome! Everything just feels right, and I can't stop smiling.";
+ const prompt =
+ `Text is: "${textToDetectFeature}". Choose ${feature.name} from the list: ${feature.values.join(', ')}. ` +
+ "Answer with one word. Don't add a dot at the end.";
+ let messages = [
+ ChatMessage.system().withReasoningEffort("Disabled" as ReasoningEffort),
+ ChatMessage.user().withText(prompt)
+ ];
+
+ let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(32).withSamplingMethod(new SamplingMethodGreedy());
+ let reply = (await session.reply(messages, chatReplyConfig))[0];
+
+ if (reply) {
+ console.log('Prediction: ', reply.message.text);
+ console.log('Generated tokens: ', reply.stats.tokensCountOutput);
+ }
+}
+
+main().catch((error) => {
+ console.error(error);
+});
```
-`benchmark_task.json` will be automatically generated after the model is downloaded via `./tools/helpers/`, as described earlier.
+</details>
+
+
+<br>You can view the stats to see that the answer will be ready immediately after the prefill step, and actual generation won’t even start due to speculative decoding, which significantly improves generation speed.
+
+### Chat using speculation preset for summarization
+
+In this example, we will use the `summarization` speculation preset to generate a summary of the input text:
+
+<details>
+<summary>Rust</summary>
+
+```rust
+use uzu::{
+ engine::{Engine, EngineConfig},
+ types::{
+ basic::{ReasoningEffort, SamplingMethod},
+ session::chat::{ChatConfig, ChatMessage, ChatReplyConfig, ChatSpeculationPreset},
+ },
+};
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let engine_config = EngineConfig::default();
+ let engine = Engine::new(engine_config).await?;
+
+ let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
+ let downloader = engine.download(&model).await?;
+ while let Some(update) = downloader.next().await {
+ println!("Download progress: {}", update.progress());
+ }
+
+ let text_to_summarize = "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. \
+ It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. \
+ LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. \
+ These models have a wide range of applications, including chatbots, content creation, translation, and code generation. \
+ One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. \
+ They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. \
+ Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. \
+ As these models grow in size and sophistication, they continue to enhance human-computer interactions, \
+ making AI-powered communication more natural and effective.";
+ let prompt = format!("Text is: \"{text_to_summarize}\". Write only summary itself.");
+ let messages = vec![
+ ChatMessage::system().with_reasoning_effort(ReasoningEffort::Disabled),
+ ChatMessage::user().with_text(prompt),
+ ];
+
+ let chat_config = ChatConfig::default().with_speculation_preset(Some(ChatSpeculationPreset::Summarization {}));
+ let session = engine.chat(model, chat_config).await?;
+
+ let chat_reply_config =
+ ChatReplyConfig::default().with_token_limit(Some(256)).with_sampling_method(SamplingMethod::Greedy {});
+ let replies = session.reply(messages, chat_reply_config).await?;
+ if let Some(reply) = replies.first() {
+ println!("Summary: {}", reply.message.text().unwrap_or_default());
+ println!("Generation t/s: {}", reply.stats.generate_tokens_per_second.unwrap_or_default());
+ }
+
+ Ok(())
+}
+```
+
+</details>
+
+<details>
+<summary>Python</summary>
+
+```python
+import asyncio
+
+from uzu import (
+ ChatConfig,
+ ChatMessage,
+ ChatReplyConfig,
+ ChatSpeculationPreset,
+ Engine,
+ EngineConfig,
+ ReasoningEffort,
+ SamplingMethod,
+)
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ text_to_summarize = (
+ "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. "
+ "It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. "
+ "LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. "
+ "These models have a wide range of applications, including chatbots, content creation, translation, and code generation. "
+ "One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. "
+ "They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. "
+ "Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. "
+ "As these models grow in size and sophistication, they continue to enhance human-computer interactions, "
+ "making AI-powered communication more natural and effective."
+ )
+ prompt = f'Text is: "{text_to_summarize}". Write only summary itself.'
+ messages = [
+ ChatMessage.system().with_reasoning_effort(ReasoningEffort.Disabled),
+ ChatMessage.user().with_text(prompt),
+ ]
+
+ chat_config = ChatConfig.create().with_speculation_preset(ChatSpeculationPreset.Summarization())
+ session = await engine.chat(model, chat_config)
+
+ chat_reply_config = ChatReplyConfig.create().with_token_limit(256).with_sampling_method(SamplingMethod.Greedy())
+ replies = await session.reply(messages, chat_reply_config)
+ if replies:
+ reply = replies[0]
+ print(f"Summary: {reply.message.text}")
+ print(f"Generation t/s: {reply.stats.generate_tokens_per_second}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+</details>
+
+<details>
+<summary>Swift</summary>
+
+```swift
+import Uzu
+
+public func runChatSpeculationSummarization() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let textToSummarize = "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. These models have a wide range of applications, including chatbots, content creation, translation, and code generation. One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. As these models grow in size and sophistication, they continue to enhance human-computer interactions, making AI-powered communication more natural and effective.";
+ let prompt = "Text is: \"\(textToSummarize)\". Write only summary itself."
+ let messages = [
+ ChatMessage.system().withReasoningEffort(reasoningEffort: .disabled),
+ ChatMessage.user().withText(text: prompt)
+ ]
+
+ let chatConfig = ChatConfig.create().withSpeculationPreset(speculationPreset: .summarization)
+ let session = try await engine.chat(model: model, config: chatConfig)
+
+ let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(tokenLimit: 256).withSamplingMethod(samplingMethod: .greedy)
+ let replies = try await session.reply(input: messages, config: chatReplyConfig)
+ guard let reply = replies.last else {
+ return
+ }
+
+ print("Summary: \(reply.message.text() ?? "empty")")
+ print("Generation t\\s: \(reply.stats.generateTokensPerSecond ?? 0.0)")
+}
+```
+
+</details>
+
+<details>
+<summary>TypeScript</summary>
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, ChatSpeculationPresetSummarization, Engine, EngineConfig, ReasoningEffort, SamplingMethodGreedy } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ const textToSummarize =
+ "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. These models have a wide range of applications, including chatbots, content creation, translation, and code generation. One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. As these models grow in size and sophistication, they continue to enhance human-computer interactions, making AI-powered communication more natural and effective.";
+ const prompt = `Text is: "${textToSummarize}". Write only summary itself.`;
+ let messages = [
+ ChatMessage.system().withReasoningEffort("Disabled" as ReasoningEffort),
+ ChatMessage.user().withText(prompt)
+ ];
+
+ let chatConfig = ChatConfig.create().withSpeculationPreset(new ChatSpeculationPresetSummarization);
+ let session = await engine.chat(model, chatConfig);
+
+ let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(256).withSamplingMethod(new SamplingMethodGreedy());
+ let reply = (await session.reply(messages, chatReplyConfig))[0];
+
+ if (reply) {
+ console.log('Summary: ', reply.message.text);
+ console.log('Generation t\\s: ', reply.stats.generateTokensPerSecond);
+ }
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+</details>
+
+
+<br>You will notice that the model’s run count is lower than the actual number of generated tokens due to speculative decoding, which significantly improves generation speed.
+
+### Chat with structured output
+
+Sometimes you want the generated output to be valid JSON with predefined fields. You can use `Grammar` to manually specify a JSON schema for the response you want to receive:
+
+<details>
+<summary>Rust</summary>
+
+```rust
+use schemars::{JsonSchema, schema_for};
+use serde::{Deserialize, Serialize};
+use uzu::{
+ engine::{Engine, EngineConfig},
+ types::{
+ basic::{Grammar, ReasoningEffort},
+ session::chat::{ChatConfig, ChatMessage, ChatReplyConfig},
+ },
+};
+
+#[derive(Debug, Serialize, Deserialize, JsonSchema)]
+struct Country {
+ name: String,
+ capital: String,
+}
+
+#[derive(Debug, Serialize, Deserialize, JsonSchema)]
+struct CountryList {
+ countries: Vec<Country>,
+}
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let engine_config = EngineConfig::default();
+ let engine = Engine::new(engine_config).await?;
+
+ let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
+ let downloader = engine.download(&model).await?;
+ while let Some(update) = downloader.next().await {
+ println!("Download progress: {}", update.progress());
+ }
+
+ let schema_string = serde_json::to_string(&schema_for!(CountryList))?;
+ let messages = vec![
+ ChatMessage::system().with_reasoning_effort(ReasoningEffort::Disabled),
+ ChatMessage::user().with_text(
+ "Give me a JSON object containing a list of 3 countries, where each country has name and capital fields"
+ .to_string(),
+ ),
+ ];
+
+ let session = engine.chat(model, ChatConfig::default()).await?;
+ let chat_reply_config = ChatReplyConfig::default().with_grammar(Some(Grammar::JsonSchema {
+ schema: schema_string,
+ }));
+ let replies = session.reply(messages, chat_reply_config).await?;
+ if let Some(reply) = replies.first() {
+ if let Some(text) = reply.message.text() {
+ let parsed: CountryList = serde_json::from_str(&text)?;
+ println!("{parsed:#?}");
+ }
+ }
+
+ Ok(())
+}
+```
+
+</details>
+
+<details>
+<summary>Python</summary>
+
+```python
+import asyncio
+import json
+
+from pydantic import BaseModel
+
+from uzu import (
+ ChatConfig,
+ ChatMessage,
+ ChatReplyConfig,
+ Engine,
+ EngineConfig,
+ Grammar,
+ ReasoningEffort,
+)
+
+
+class Country(BaseModel):
+ name: str
+ capital: str
+
+
+class CountryList(BaseModel):
+ countries: list[Country]
+
+
+def structured_response(response: str | None, model_type: type[BaseModel]) -> BaseModel | None:
+ if not response:
+ return None
+ return model_type.model_validate_json(response)
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ schema_string = json.dumps(CountryList.model_json_schema())
+ messages = [
+ ChatMessage.system().with_reasoning_effort(ReasoningEffort.Disabled),
+ ChatMessage.user().with_text(
+ "Give me a JSON object containing a list of 3 countries, where each country has name and capital fields"
+ ),
+ ]
+
+ session = await engine.chat(model, ChatConfig.create())
+ replies = await session.reply(
+ messages,
+ ChatReplyConfig.create().with_grammar(Grammar.JsonSchema(schema_string)),
+ )
+ if replies:
+ countries = structured_response(replies[0].message.text, CountryList)
+ print(countries)
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+</details>
+
+<details>
+<summary>Swift</summary>
+
+```swift
+import FoundationModels
+import Uzu
+
+@Generable()
+struct Country: Codable {
+ let name: String
+ let capital: String
+}
+
+public func runChatStructuredOutput() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let messages = [
+ ChatMessage.system().withReasoningEffort(reasoningEffort: .disabled),
+ ChatMessage.user().withText(text: "Give me a JSON object containing a list of 3 countries, where each country has name and capital fields")
+ ]
+
+ let session = try await engine.chat(model: model, config: .create())
+ let reply = try await session.reply(input: messages, config: .create().withGrammar(grammar: .fromType([Country].self)))
+ guard let message = reply.last?.message else {
+ return
+ }
+ guard let countries: [Country] = message.textDecoded() else {
+ return
+ }
+ print(countries)
+}
+```
+
+</details>
+
+<details>
+<summary>TypeScript</summary>
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig, GrammarJsonSchema, ReasoningEffort } from '@trymirai/uzu';
+import * as z from "zod";
+
+const CountryType = z.object({
+ name: z.string(),
+ capital: z.string(),
+});
+const CountryListType = z.array(CountryType);
+
+function structuredResponse<T extends z.ZodType>(response: string | null | undefined, type: T): z.infer<T> | undefined {
+ if (!response) {
+ return undefined;
+ }
+ const data = JSON.parse(response);
+ const result = type.parse(data);
+ return result;
+}
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ let schema = z.toJSONSchema(CountryListType);
+ let schemaString = JSON.stringify(schema);
+ let messages = [
+ ChatMessage.system().withReasoningEffort("Disabled" as ReasoningEffort),
+ ChatMessage.user().withText('Give me a JSON object containing a list of 3 countries, where each country has name and capital fields')
+ ];
+
+ let session = await engine.chat(model, ChatConfig.create());
+ let reply = await session.reply(messages, ChatReplyConfig.create().withGrammar(new GrammarJsonSchema(schemaString)));
+ let message = reply[0]?.message;
+ let countries = structuredResponse(message?.text, CountryListType);
+ console.log(countries);
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+</details>
+
+
+### Classification
+
+In this example, we will use a classification model to determine whether the user's input is safe from a moderation perspective:
+
+<details>
+<summary>Rust</summary>
+
+```rust
+use uzu::{
+ engine::{Engine, EngineConfig},
+ types::session::classification::ClassificationMessage,
+};
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let engine_config = EngineConfig::default();
+ let engine = Engine::new(engine_config).await?;
+
+ let model = engine.model("trymirai/chat-moderation-router".to_string()).await?.ok_or("Model not found")?;
+ let downloader = engine.download(&model).await?;
+ while let Some(update) = downloader.next().await {
+ println!("Download progress: {}", update.progress());
+ }
+
+ let messages = vec![ClassificationMessage::user("Hi".to_string())];
+
+ let session = engine.classification(model).await?;
+ let output = session.classify(messages).await?;
+ println!("Output: {:?}", output.probabilities.values);
+
+ Ok(())
+}
+```
+
+</details>
+
+<details>
+<summary>Python</summary>
+
+```python
+import asyncio
+
+from uzu import ClassificationMessage, Engine, EngineConfig
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("trymirai/chat-moderation-router")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ messages = [ClassificationMessage.user("Hi")]
+
+ session = await engine.classification(model)
+ output = await session.classify(messages)
+ print(f"Output: {output.probabilities.values}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+</details>
+
+<details>
+<summary>Swift</summary>
+
+```swift
+import Uzu
+
+public func runClassification() async throws {
+ let engine = try await Engine.create(config: .create())
+
+ guard let model = try await engine.model(identifier: "trymirai/chat-moderation-router") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let messages = [
+ ClassificationMessage.user(content: "Hi")
+ ]
+
+ let session = try await engine.classification(model: model)
+ let output = try await session.classify(input: messages)
+ print("Output: \(output.probabilities.values)")
+}
+```
+
+</details>
+
+<details>
+<summary>TypeScript</summary>
+
+```ts
+import { ClassificationMessage, Engine, EngineConfig } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('trymirai/chat-moderation-router');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ let messages = [
+ ClassificationMessage.user('Hi')
+ ];
+
+ let session = await engine.classification(model);
+ let output = await session.classify(messages);
+ console.log('Output: ', output.probabilities.values);
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+</details>
+
+
+### Text to Speech
+
+In this example, we will generate audio from text:
+
+<details>
+<summary>Rust</summary>
+
+```rust
+use uzu::{
+ engine::{Engine, EngineConfig},
+ session::text_to_speech::TextToSpeechSessionStreamChunk,
+ types::basic::PcmBatch,
+};
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let engine_config = EngineConfig::default();
+ let engine = Engine::new(engine_config).await?;
+
+ let model = engine.model("fishaudio/s1-mini".to_string()).await?.ok_or("Model not found")?;
+ let downloader = engine.download(&model).await?;
+ while let Some(update) = downloader.next().await {
+ println!("Download progress: {}", update.progress());
+ }
+
+ let text = "London is the capital of United Kingdom and one of the world's most influential cities, \
+ known for its rich history, cultural diversity, and global significance in finance, politics, and the arts. \
+ Situated along the River Thames, the city blends historic landmarks like Tower of London and Buckingham Palace \
+ with modern architecture such as The Shard. London is also home to renowned institutions including the British Museum \
+ and vibrant areas like Covent Garden, offering a mix of history, entertainment, and innovation that attracts millions of visitors each year.";
+ let output_path = dirs::home_dir().ok_or("Home not found")?.join("Desktop").join("output.wav");
+
+ let session = engine.text_to_speech(model).await?;
+ let stream = session.synthesize_stream(text.to_string()).await;
+ let mut pcm_batches: Vec<PcmBatch> = Vec::new();
+ while let Some(event) = stream.next().await {
+ match event {
+ TextToSpeechSessionStreamChunk::PcmBatch {
+ batch,
+ } => {
+ pcm_batches.push(batch);
+ },
+ TextToSpeechSessionStreamChunk::Error {
+ error,
+ } => {
+ println!("Error: {error}");
+ },
+ }
+ }
+
+ let pcm_batch_first = pcm_batches.first().ok_or("No batches")?;
+ let pcm_batch_full = PcmBatch {
+ samples: pcm_batches.iter().flat_map(|batch| batch.samples.iter().copied()).collect(),
+ sample_rate: pcm_batch_first.sample_rate,
+ channels: pcm_batch_first.channels,
+ lengths: vec![pcm_batches.iter().flat_map(|batch| batch.lengths.iter().copied()).sum()],
+ };
+ pcm_batch_full.save_as_wav(output_path.to_string_lossy().to_string())?;
+ println!("Output saved to: {}", output_path.display());
+
+ Ok(())
+}
+```
+
+</details>
+
+<details>
+<summary>Python</summary>
+
+```python
+import asyncio
+from pathlib import Path
+
+from uzu import Engine, EngineConfig
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("fishaudio/s1-mini")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ text = (
+ "London is the capital of United Kingdom and one of the world's most influential cities, "
+ "known for its rich history, cultural diversity, and global significance in finance, politics, and the arts. "
+ "Situated along the River Thames, the city blends historic landmarks like Tower of London and Buckingham Palace "
+ "with modern architecture such as The Shard. London is also home to renowned institutions including the British Museum "
+ "and vibrant areas like Covent Garden, offering a mix of history, entertainment, and innovation that attracts millions of visitors each year."
+ )
+ output_path = Path.home() / "Desktop" / "output.wav"
+ session = await engine.text_to_speech(model)
+ pcm_batch = await session.synthesize(text)
+ pcm_batch.save_as_wav(str(output_path))
+ print(f"Output saved to: {output_path}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+</details>
+
+<details>
+<summary>Swift</summary>
+
+```swift
+import Foundation
+import Uzu
+
+public func runTextToSpeech() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "fishaudio/s1-mini") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let text = "London is the capital of United Kingdom and one of the world’s most influential cities, known for its rich history, cultural diversity, and global significance in finance, politics, and the arts. Situated along the River Thames, the city blends historic landmarks like Tower of London and Buckingham Palace with modern architecture such as The Shard. London is also home to renowned institutions including the British Museum and vibrant areas like Covent Garden, offering a mix of history, entertainment, and innovation that attracts millions of visitors each year."
+ let outputPath = FileManager.default.homeDirectoryForCurrentUser
+ .appendingPathComponent("Desktop")
+ .appendingPathComponent("output.wav")
+ let session = try await engine.textToSpeech(model: model)
+ let pcmBatch = try await session.synthesize(input: text)
+ try pcmBatch.saveAsWav(path: outputPath.path())
+ print("Output saved to: \(outputPath.path())")
+}
+```
+
+</details>
+
+<details>
+<summary>TypeScript</summary>
+
+```ts
+import { Engine, EngineConfig } from '@trymirai/uzu';
+import { homedir } from "os";
+import { join } from "path";
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('fishaudio/s1-mini');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ const text = "London is the capital of United Kingdom and one of the world’s most influential cities, known for its rich history, cultural diversity, and global significance in finance, politics, and the arts. Situated along the River Thames, the city blends historic landmarks like Tower of London and Buckingham Palace with modern architecture such as The Shard. London is also home to renowned institutions including the British Museum and vibrant areas like Covent Garden, offering a mix of history, entertainment, and innovation that attracts millions of visitors each year.";
+ const outputPath = join(homedir(), "Desktop", "output.wav");
+ let session = await engine.textToSpeech(model);
+ let pcmBatch = await session.synthesize(text);
+ pcmBatch.saveAsWav(outputPath);
+ console.log('Output saved to: ', outputPath);
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+</details>
+
+
+
+## Development
+
+`uzu` is a native Rust crate with bindings available for:
+
+- `Swift` via [uniffi-rs](https://github.com/mozilla/uniffi-rs)
+- `Python` via [pyo3](https://github.com/PyO3/pyo3)
+- `TypeScript` via [napi-rs](https://github.com/napi-rs/napi-rs)
+
+It supports:
+
+- Backends:
+ - `metal`
+ - `cpu`
+- Targets:
+ - `aarch64-apple-darwin`
+ - `aarch64-apple-ios`
+ - `aarch64-apple-ios-sim`
+ - `aarch64-pc-windows-msvc` _(in progress)_
+ - `aarch64-unknown-linux-gnu` _(in progress)_
+ - `wasm32-wasip1-threads` _(in progress)_
+ - `x86_64-apple-darwin`
+ - `x86_64-pc-windows-msvc` _(in progress)_
+ - `x86_64-unknown-linux-gnu` _(in progress)_
+
+<br>
+For initial setup we recommend running <code>cargo tools setup</code>, which installs all necessary dependencies (<code>rustup</code>, <code>uv</code>, <code>pnpm</code>, <code>Rust targets</code>, <code>Metal toolchain</code>, ...) if not already present.
+
+<br>
+To unify cross-language development we introduce <code>cargo tools</code>:
+
+- Install language specific dependencies: `cargo tools install typescript`
+- Build: `cargo tools build rust --targets apple`
+- Test: `cargo tools test python`
+- Run example: `cargo tools example swift chat`
+
+## Model Format
+
+`uzu` uses its own model format. You can download a test model:
+
+```bash
+./scripts/download_test_model.sh
+```
+
+Or download any supported model that has already been converted:
+
+```bash
+cd ./tools/
+uv run downloader list # show the list of supported models
+uv run downloader download {REPO} # download a specific model
+```
+
+Models downloaded for development are stored at `./workspace/models/0.1.9/`.
+
+You can also export a model yourself with [lalamo](https://github.com/trymirai/lalamo):
+
+```bash
+git clone https://github.com/trymirai/lalamo.git
+cd lalamo
+uv run lalamo list-models
+uv run lalamo convert meta-llama/Llama-3.2-1B-Instruct
+```
+
+## CLI
+
+You can run `uzu` in [CLI](https://docs.trymirai.com/overview/cli) mode:
+
+```bash
+cargo run --release -p cli -- help
+```
+
+```text
+Usage: cli [COMMAND]
+
+Commands:
+ run Run a model with the specified path
+ serve Start a server with the specified model path
+ bench Run benchmarks for the specified model
+ help Print this message or the help of the given subcommand(s)
+```
+
+## Benchmarks
+
+To run benchmarks:
+
+```bash
+cargo run --release -p cli -- bench ./workspace/models/0.1.9/{MODEL_NAME} ./workspace/models/0.1.9/{MODEL_NAME}/benchmark_task.json ./workspace/models/0.1.9/{MODEL_NAME}/benchmark_result.json
+```
+
+`benchmark_task.json` is automatically generated after the model is downloaded via `./tools/`.
+
+
+
+## Troubleshooting
+
+If you experience any problems, please contact us via [Discord](https://discord.com/invite/trymirai) or [email](mailto:[email protected]).
## License
diff --git a/apps/playground/Project.swift b/apps/playground/Project.swift
index 85cb9481f..451c961cb 100644
--- a/apps/playground/Project.swift
+++ b/apps/playground/Project.swift
@@ -18,7 +18,7 @@ let settings: Settings = .settings(
"DEVELOPMENT_TEAM": "C39GZ239GY",
"TARGETED_DEVICE_FAMILY": "1,2",
"SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD": "NO",
- "MARKETING_VERSION": "2.0.0",
+ "MARKETING_VERSION": "0.1.9",
"CURRENT_PROJECT_VERSION": "1",
],
configurations: [
@@ -69,7 +69,7 @@ let appTarget: Target = .target(
destinations: [.iPhone, .iPad, .mac],
product: .app,
bundleId: "com.mirai.tech.playground",
- deploymentTargets: .multiplatform(iOS: "26.0", macOS: "26.0"),
+ deploymentTargets: .multiplatform(iOS: "26.4", macOS: "26.4"),
infoPlist: .extendingDefault(with: [
"CFBundleShortVersionString": "$(MARKETING_VERSION)",
"CFBundleVersion": "$(CURRENT_PROJECT_VERSION)",
@@ -111,8 +111,23 @@ let appScheme: Scheme = .scheme(
preActions: [
.executionAction(
title: "Update Uzu Package",
- scriptText:
- "/bin/bash \"$PROJECT_DIR/../../scripts/prepare_bindings.sh\" swift",
+ scriptText: """
+ set -euo pipefail
+ [ -d "$HOME/.cargo/bin" ] && export PATH="$HOME/.cargo/bin:$PATH"
+ [ -d "/opt/homebrew/bin" ] && export PATH="/opt/homebrew/bin:$PATH"
+ unset SDKROOT DEVELOPER_DIR_OVERRIDE \
+ SWIFT_DEBUG_INFORMATION_FORMAT SWIFT_DEBUG_INFORMATION_VERSION \
+ DEBUG_INFORMATION_FORMAT
+ case "${PLATFORM_NAME:-macosx}" in
+ iphonesimulator) TARGET=ios-sim ;;
+ iphoneos) TARGET=ios ;;
+ *) TARGET=macos ;;
+ esac
+ CONFIGURATION_VALUE=release
+ [ "${CONFIGURATION:-Release}" = "Debug" ] && CONFIGURATION_VALUE=debug
+ cd "$PROJECT_DIR/../.."
+ cargo tools build swift "$CONFIGURATION_VALUE" --targets "$TARGET"
+ """,
target: .init(stringLiteral: projectName)
)
]
diff --git a/bindings/.gitignore b/bindings/.gitignore
deleted file mode 100644
index dd634e093..000000000
--- a/bindings/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-ts/src/napi/uzu.node
\ No newline at end of file
diff --git a/bindings/ts/LICENSE b/bindings/python/LICENSE
similarity index 99%
rename from bindings/ts/LICENSE
rename to bindings/python/LICENSE
index c869c80dd..4aac6c884 100644
--- a/bindings/ts/LICENSE
+++ b/bindings/python/LICENSE
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
+SOFTWARE.
diff --git a/bindings/python/README.md b/bindings/python/README.md
index e69de29bb..af2854df8 100644
--- a/bindings/python/README.md
+++ b/bindings/python/README.md
@@ -0,0 +1,436 @@
+<p align="center">
+ <picture>
+ <img alt="Mirai" src="https://artifacts.trymirai.com/social/github/uzu-python.jpg" style="max-width: 100%;">
+ </picture>
+</p>
+
+<a href="https://discord.com/invite/trymirai"><img src="https://img.shields.io/discord/1377764166764462120?label=Discord&color=brightgreen" alt="Discord"></a> <a href="mailto:[email protected]?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-brightgreen" alt="Contact us"></a> <a href="https://docs.trymirai.com"><img src="https://img.shields.io/badge/Read-Docs-brightgreen" alt="Read docs"></a> [![License](https://img.shields.io/badge/License-MIT-brightgreen)](LICENSE) ![Build](https://github.com/trymirai/uzu/actions/workflows/tests.yml/badge.svg) ![Python](https://img.shields.io/badge/Python-orange) ![Package](https://img.shields.io/pypi/v/uzu?color=orange&label=Package) ![Downloads](https://img.shields.io/pypi/dm/uzu?color=orange&label=Downloads) ![Python](https://img.shields.io/pypi/pyversions/uzu?color=orange&label=Python)
+
+# uzu
+
+A high-performance inference engine for AI models. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. Key features:
+
+- Simple, high-level API
+- Unified model configurations, making it easy to add support for new models
+- Traceable computations to ensure correctness against the source-of-truth implementation
+- Utilizes unified memory on Apple devices
+- [Broad model support](https://trymirai.com/models)
+
+## Quick Start
+
+
+
+Add the dependency:
+
+```bash
+uv add uzu==0.1.9
+```
+
+Run the code below:
+
+```python
+import asyncio
+
+from uzu import ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ return
+
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ session = await engine.chat(model, ChatConfig.create())
+
+ messages = [
+ ChatMessage.system().with_text("You are a helpful assistant"),
+ ChatMessage.user().with_text("Tell me a short, funny story about a robot"),
+ ]
+
+ replies = await session.reply(messages, ChatReplyConfig.create())
+ if not replies:
+ return
+
+ message = replies[-1].message
+ print(f"Reasoning: {message.reasoning}")
+ print(f"Text: {message.text}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+
+<br>
+Everything from model downloading to inference configuration is handled automatically. Refer to the [documentation](https://docs.trymirai.com) for details on how to customize each step of the process.
+
+## Examples
+
+You can run any example via `cargo tools example` \<**python**\> \<**chat** | **chat-cloud** | **chat-speculation-classification** | **chat-speculation-summarization** | **chat-structured-output** | **classification** | **quick-start** | **text-to-speech**\>:
+
+### Chat
+
+In this example, we will download a model and get a reply to a specific list of messages:
+
+```python
+import asyncio
+
+from uzu import (
+ ChatConfig,
+ ChatMessage,
+ ChatReplyConfig,
+ ChatSessionStreamChunk,
+ Engine,
+ EngineConfig,
+)
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ messages = [
+ ChatMessage.system().with_text("You are a helpful assistant"),
+ ChatMessage.user().with_text("Tell me a short, funny story about a robot"),
+ ]
+ session = await engine.chat(model, ChatConfig.create())
+ stream = await session.reply_with_stream(messages, ChatReplyConfig.create())
+ message: ChatMessage | None = None
+ async for chunk in stream.iterator():
+ if isinstance(chunk, ChatSessionStreamChunk.Replies):
+ replies = chunk.replies
+ if replies:
+ reply = replies[0]
+ message = reply.message
+ print(f"Generated tokens: {reply.stats.tokens_count_output}")
+ elif isinstance(chunk, ChatSessionStreamChunk.Error):
+ print(f"Error: {chunk.error}")
+ if message is not None:
+ print(f"Reasoning: {message.reasoning}")
+ print(f"Text: {message.text}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+<br>Once loaded, the same `ChatSession` can be reused for multiple requests until you drop it. Each model may consume a significant amount of RAM, so it's important to keep only one session loaded at a time. For iOS apps, we recommend adding the [Increased Memory Capability](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.kernel.increased-memory-limit) entitlement to ensure your app can allocate the required memory.
+
+### Chat with the cloud model
+
+In this example, we will get a reply to a specific list of messages from a cloud model:
+
+```python
+import asyncio
+
+from uzu import ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig, ReasoningEffort
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create().with_openai_api_key("OPENAI_API_KEY")
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("gpt-5")
+ if model is None:
+ raise RuntimeError("Model not found")
+
+ messages = [
+ ChatMessage.system().with_reasoning_effort(ReasoningEffort.Low),
+ ChatMessage.user().with_text("How LLMs work"),
+ ]
+
+ session = await engine.chat(model, ChatConfig.create())
+ replies = await session.reply(messages, ChatReplyConfig.create())
+ if replies:
+ message = replies[0].message
+ print(f"Reasoning: {message.reasoning}")
+ print(f"Text: {message.text}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+### Chat using speculation preset for classification
+
+In this example, we will use the `classification` speculation preset to determine the sentiment of the user's input:
+
+```python
+import asyncio
+
+from uzu import (
+ ChatConfig,
+ ChatMessage,
+ ChatReplyConfig,
+ ChatSpeculationPreset,
+ Engine,
+ EngineConfig,
+ Feature,
+ ReasoningEffort,
+ SamplingMethod,
+)
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ feature = Feature(
+ "sentiment",
+ ["Happy", "Sad", "Angry", "Fearful", "Surprised", "Disgusted"],
+ )
+ chat_config = ChatConfig.create().with_speculation_preset(ChatSpeculationPreset.Classification(feature))
+ session = await engine.chat(model, chat_config)
+
+ text_to_detect_feature = "Today's been awesome! Everything just feels right, and I can't stop smiling."
+ prompt = (
+ f'Text is: "{text_to_detect_feature}". '
+ f"Choose {feature.name} from the list: {', '.join(feature.values)}. "
+ "Answer with one word. Don't add a dot at the end."
+ )
+ messages = [
+ ChatMessage.system().with_reasoning_effort(ReasoningEffort.Disabled),
+ ChatMessage.user().with_text(prompt),
+ ]
+
+ chat_reply_config = ChatReplyConfig.create().with_token_limit(32).with_sampling_method(SamplingMethod.Greedy())
+ replies = await session.reply(messages, chat_reply_config)
+ if replies:
+ reply = replies[0]
+ print(f"Prediction: {reply.message.text}")
+ print(f"Generated tokens: {reply.stats.tokens_count_output}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+<br>You can view the stats to see that the answer will be ready immediately after the prefill step, and actual generation won’t even start due to speculative decoding, which significantly improves generation speed.
+
+### Chat using speculation preset for summarization
+
+In this example, we will use the `summarization` speculation preset to generate a summary of the input text:
+
+```python
+import asyncio
+
+from uzu import (
+ ChatConfig,
+ ChatMessage,
+ ChatReplyConfig,
+ ChatSpeculationPreset,
+ Engine,
+ EngineConfig,
+ ReasoningEffort,
+ SamplingMethod,
+)
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ text_to_summarize = (
+ "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. "
+ "It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. "
+ "LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. "
+ "These models have a wide range of applications, including chatbots, content creation, translation, and code generation. "
+ "One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. "
+ "They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. "
+ "Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. "
+ "As these models grow in size and sophistication, they continue to enhance human-computer interactions, "
+ "making AI-powered communication more natural and effective."
+ )
+ prompt = f'Text is: "{text_to_summarize}". Write only summary itself.'
+ messages = [
+ ChatMessage.system().with_reasoning_effort(ReasoningEffort.Disabled),
+ ChatMessage.user().with_text(prompt),
+ ]
+
+ chat_config = ChatConfig.create().with_speculation_preset(ChatSpeculationPreset.Summarization())
+ session = await engine.chat(model, chat_config)
+
+ chat_reply_config = ChatReplyConfig.create().with_token_limit(256).with_sampling_method(SamplingMethod.Greedy())
+ replies = await session.reply(messages, chat_reply_config)
+ if replies:
+ reply = replies[0]
+ print(f"Summary: {reply.message.text}")
+ print(f"Generation t/s: {reply.stats.generate_tokens_per_second}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+<br>You will notice that the model’s run count is lower than the actual number of generated tokens due to speculative decoding, which significantly improves generation speed.
+
+### Chat with structured output
+
+Sometimes you want the generated output to be valid JSON with predefined fields. You can use `Grammar` to manually specify a JSON schema for the response you want to receive:
+
+```python
+import asyncio
+import json
+
+from pydantic import BaseModel
+
+from uzu import (
+ ChatConfig,
+ ChatMessage,
+ ChatReplyConfig,
+ Engine,
+ EngineConfig,
+ Grammar,
+ ReasoningEffort,
+)
+
+
+class Country(BaseModel):
+ name: str
+ capital: str
+
+
+class CountryList(BaseModel):
+ countries: list[Country]
+
+
+def structured_response(response: str | None, model_type: type[BaseModel]) -> BaseModel | None:
+ if not response:
+ return None
+ return model_type.model_validate_json(response)
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ schema_string = json.dumps(CountryList.model_json_schema())
+ messages = [
+ ChatMessage.system().with_reasoning_effort(ReasoningEffort.Disabled),
+ ChatMessage.user().with_text(
+ "Give me a JSON object containing a list of 3 countries, where each country has name and capital fields"
+ ),
+ ]
+
+ session = await engine.chat(model, ChatConfig.create())
+ replies = await session.reply(
+ messages,
+ ChatReplyConfig.create().with_grammar(Grammar.JsonSchema(schema_string)),
+ )
+ if replies:
+ countries = structured_response(replies[0].message.text, CountryList)
+ print(countries)
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+### Classification
+
+In this example, we will use a classification model to determine whether the user's input is safe from a moderation perspective:
+
+```python
+import asyncio
+
+from uzu import ClassificationMessage, Engine, EngineConfig
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("trymirai/chat-moderation-router")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ messages = [ClassificationMessage.user("Hi")]
+
+ session = await engine.classification(model)
+ output = await session.classify(messages)
+ print(f"Output: {output.probabilities.values}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+### Text to Speech
+
+In this example, we will generate audio from text:
+
+```python
+import asyncio
+from pathlib import Path
+
+from uzu import Engine, EngineConfig
+
+
+async def main() -> None:
+ engine_config = EngineConfig.create()
+ engine = await Engine.create(engine_config)
+
+ model = await engine.model("fishaudio/s1-mini")
+ if model is None:
+ raise RuntimeError("Model not found")
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ text = (
+ "London is the capital of United Kingdom and one of the world's most influential cities, "
+ "known for its rich history, cultural diversity, and global significance in finance, politics, and the arts. "
+ "Situated along the River Thames, the city blends historic landmarks like Tower of London and Buckingham Palace "
+ "with modern architecture such as The Shard. London is also home to renowned institutions including the British Museum "
+ "and vibrant areas like Covent Garden, offering a mix of history, entertainment, and innovation that attracts millions of visitors each year."
+ )
+ output_path = Path.home() / "Desktop" / "output.wav"
+ session = await engine.text_to_speech(model)
+ pcm_batch = await session.synthesize(text)
+ pcm_batch.save_as_wav(str(output_path))
+ print(f"Output saved to: {output_path}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+
+
+## Troubleshooting
+
+If you experience any problems, please contact us via [Discord](https://discord.com/invite/trymirai) or [email](mailto:[email protected]).
+
+## License
+
+This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
diff --git a/bindings/python/examples/cloud.py b/bindings/python/examples/chat_cloud.py
similarity index 100%
rename from bindings/python/examples/cloud.py
rename to bindings/python/examples/chat_cloud.py
diff --git a/bindings/python/examples/chat_for_classification.py b/bindings/python/examples/chat_speculation_classification.py
similarity index 100%
rename from bindings/python/examples/chat_for_classification.py
rename to bindings/python/examples/chat_speculation_classification.py
diff --git a/bindings/python/examples/chat_for_summarization.py b/bindings/python/examples/chat_speculation_summarization.py
similarity index 100%
rename from bindings/python/examples/chat_for_summarization.py
rename to bindings/python/examples/chat_speculation_summarization.py
diff --git a/bindings/python/examples/structured_output.py b/bindings/python/examples/chat_structured_output.py
similarity index 100%
rename from bindings/python/examples/structured_output.py
rename to bindings/python/examples/chat_structured_output.py
diff --git a/bindings/python/examples/classifier.py b/bindings/python/examples/classification.py
similarity index 100%
rename from bindings/python/examples/classifier.py
rename to bindings/python/examples/classification.py
diff --git a/bindings/python/examples/snippets.py b/bindings/python/examples/snippets.py
deleted file mode 100644
index 158c74d16..000000000
--- a/bindings/python/examples/snippets.py
+++ /dev/null
@@ -1,176 +0,0 @@
-import asyncio
-
-from uzu import (
- ChatConfig,
- ChatMessage,
- ChatReplyConfig,
- ChatSpeculationPreset,
- Engine,
- EngineConfig,
- Feature,
- ReasoningEffort,
- SamplingMethod,
-)
-
-
-async def quick_start_example() -> None:
- # snippet:quick-start
- engine_config = EngineConfig.create()
- engine = await Engine.create(engine_config)
-
- model = await engine.model("Qwen/Qwen3-0.6B")
- if model is None:
- raise RuntimeError("Model not found")
- async for update in (await engine.download(model)).iterator():
- print(f"Download progress: {update.progress}")
-
- messages = [
- ChatMessage.system().with_text("You are a helpful assistant"),
- ChatMessage.user().with_text("Tell me a short, funny story about a robot"),
- ]
-
- session = await engine.chat(model, ChatConfig.create())
- replies = await session.reply(messages, ChatReplyConfig.create())
- message = replies[0].message if replies else None
- # endsnippet:quick-start
-
- if message is not None:
- print(f"Reasoning: {message.reasoning}")
- print(f"Text: {message.text}")
-
-
-async def chat_example() -> None:
- # snippet:engine-create
- engine_config = EngineConfig.create()
- engine = await Engine.create(engine_config)
- # endsnippet:engine-create
-
- # snippet:model-choose
- model = await engine.model("Qwen/Qwen3-0.6B")
- if model is None:
- raise RuntimeError("Model not found")
- # endsnippet:model-choose
-
- # snippet:model-download
- async for update in (await engine.download(model)).iterator():
- print(f"Download progress: {update.progress}")
- # endsnippet:model-download
-
- # snippet:session-create-general
- session = await engine.chat(model, ChatConfig.create())
- # endsnippet:session-create-general
-
- # snippet:session-input-general
- messages = [
- ChatMessage.system().with_text("You are a helpful assistant"),
- ChatMessage.user().with_text("Tell me a short, funny story about a robot"),
- ]
- # endsnippet:session-input-general
-
- # snippet:session-run-general
- replies = await session.reply(messages, ChatReplyConfig.create())
- message = replies[0].message if replies else None
- # endsnippet:session-run-general
-
- if message is not None:
- print(f"Reasoning: {message.reasoning}")
- print(f"Text: {message.text}")
-
-
-async def summarization_example() -> None:
- engine_config = EngineConfig.create()
- engine = await Engine.create(engine_config)
-
- model = await engine.model("Qwen/Qwen3-0.6B")
- if model is None:
- raise RuntimeError("Model not found")
- async for update in (await engine.download(model)).iterator():
- print(f"Download progress: {update.progress}")
-
- # snippet:session-input-summarization
- text_to_summarize = (
- "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. "
- "It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. "
- "LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. "
- "These models have a wide range of applications, including chatbots, content creation, translation, and code generation. "
- "One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. "
- "They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. "
- "Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. "
- "As these models grow in size and sophistication, they continue to enhance human-computer interactions, "
- "making AI-powered communication more natural and effective."
- )
- prompt = f'Text is: "{text_to_summarize}". Write only summary itself.'
- messages = [
- ChatMessage.system().with_reasoning_effort(ReasoningEffort.Disabled),
- ChatMessage.user().with_text(prompt),
- ]
- # endsnippet:session-input-summarization
-
- # snippet:session-create-summarization
- chat_config = ChatConfig.create().with_speculation_preset(ChatSpeculationPreset.Summarization())
- session = await engine.chat(model, chat_config)
- # endsnippet:session-create-summarization
-
- # snippet:session-run-summarization
- chat_reply_config = ChatReplyConfig.create().with_token_limit(256).with_sampling_method(SamplingMethod.Greedy())
- replies = await session.reply(messages, chat_reply_config)
- reply = replies[0] if replies else None
- # endsnippet:session-run-summarization
-
- if reply is not None:
- print(f"Summary: {reply.message.text}")
- print(f"Generation t/s: {reply.stats.generate_tokens_per_second}")
-
-
-async def classification_example() -> None:
- engine_config = EngineConfig.create()
- engine = await Engine.create(engine_config)
-
- model = await engine.model("Qwen/Qwen3-0.6B")
- if model is None:
- raise RuntimeError("Model not found")
- async for update in (await engine.download(model)).iterator():
- print(f"Download progress: {update.progress}")
-
- # snippet:session-create-classification
- feature = Feature(
- "sentiment",
- ["Happy", "Sad", "Angry", "Fearful", "Surprised", "Disgusted"],
- )
- chat_config = ChatConfig.create().with_speculation_preset(ChatSpeculationPreset.Classification(feature))
- session = await engine.chat(model, chat_config)
- # endsnippet:session-create-classification
-
- # snippet:session-input-classification
- text_to_detect_feature = "Today's been awesome! Everything just feels right, and I can't stop smiling."
- prompt = (
- f'Text is: "{text_to_detect_feature}". '
- f"Choose {feature.name} from the list: {', '.join(feature.values)}. "
- "Answer with one word. Don't add a dot at the end."
- )
- messages = [
- ChatMessage.system().with_reasoning_effort(ReasoningEffort.Disabled),
- ChatMessage.user().with_text(prompt),
- ]
- # endsnippet:session-input-classification
-
- # snippet:session-run-classification
- chat_reply_config = ChatReplyConfig.create().with_token_limit(32).with_sampling_method(SamplingMethod.Greedy())
- replies = await session.reply(messages, chat_reply_config)
- reply = replies[0] if replies else None
- # endsnippet:session-run-classification
-
- if reply is not None:
- print(f"Prediction: {reply.message.text}")
- print(f"Generated tokens: {reply.stats.tokens_count_output}")
-
-
-async def main() -> None:
- await quick_start_example()
- await chat_example()
- await summarization_example()
- await classification_example()
-
-
-if __name__ == "__main__":
- asyncio.run(main())
diff --git a/bindings/python/examples/ssm.py b/bindings/python/examples/ssm.py
deleted file mode 100644
index 736a5b068..000000000
--- a/bindings/python/examples/ssm.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import asyncio
-
-from uzu import ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig
-
-
-async def main() -> None:
- engine_config = EngineConfig.create()
- engine = await Engine.create(engine_config)
-
- model = await engine.model("cartesia-ai/Llamba-1B-4bit-mlx")
- if model is None:
- raise RuntimeError("Model not found")
- async for update in (await engine.download(model)).iterator():
- print(f"Download progress: {update.progress}")
-
- messages = [
- ChatMessage.user().with_text("Tell me a short, funny story about a robot"),
- ]
-
- session = await engine.chat(model, ChatConfig.create())
- replies = await session.reply(messages, ChatReplyConfig.create())
- if replies:
- message = replies[0].message
- print(f"Text: {message.text}")
-
-
-if __name__ == "__main__":
- asyncio.run(main())
diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml
index 8c850cd61..34ccb5a48 100644
--- a/bindings/python/pyproject.toml
+++ b/bindings/python/pyproject.toml
@@ -5,14 +5,20 @@ build-backend = "maturin"
[project]
name = "uzu"
description = "A high-performance inference engine for AI models"
-readme = "README.md"
+readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.12"
license = "MIT"
authors = [{ name = "Mirai Tech Inc.", email = "[email protected]" }]
-keywords = ["llm", "inference", "ai", "rust", "pyo3"]
+keywords = [
+ "rust",
+ "ai",
+ "metal",
+ "high-performance",
+ "inference",
+ "llm",
+ "tts",
+]
classifiers = [
- "License :: OSI Approved :: MIT License",
- "Operating System :: MacOS",
"Programming Language :: Rust",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
@@ -24,8 +30,8 @@ dynamic = ["version"]
[project.urls]
Homepage = "https://trymirai.com"
-Repository = "https://github.com/trymirai/uzu-python"
-Issues = "https://github.com/trymirai/uzu-python/issues"
+Repository = "https://github.com/trymirai/uzu"
+Issues = "https://github.com/trymirai/uzu/issues"
[project.optional-dependencies]
dev = ["pytest>=8.3.4", "ruff>=0.14.0"]
@@ -41,7 +47,6 @@ python-source = "."
[tool.pytest.ini_options]
testpaths = ["tests"]
-asyncio_mode = "auto"
[tool.ruff]
target-version = "py312"
diff --git a/bindings/python/tests/test_engine.py b/bindings/python/tests/test_engine.py
new file mode 100644
index 000000000..c14c2f06c
--- /dev/null
+++ b/bindings/python/tests/test_engine.py
@@ -0,0 +1,30 @@
+import asyncio
+
+from uzu import ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig
+
+
+def test_chat_reply_produces_text() -> None:
+ async def run() -> None:
+ engine = await Engine.create(EngineConfig.create())
+
+ model = await engine.model("Qwen/Qwen3-0.6B")
+ assert model is not None, "Model not found"
+
+ async for update in (await engine.download(model)).iterator():
+ print(f"Download progress: {update.progress}")
+
+ session = await engine.chat(model, ChatConfig.create())
+
+ messages = [
+ ChatMessage.system().with_text("You are a helpful assistant"),
+ ChatMessage.user().with_text("Hi"),
+ ]
+
+ replies = await session.reply(messages, ChatReplyConfig.create())
+ assert replies, "Reply has no messages"
+
+ message = replies[-1].message
+ assert message.reasoning is not None
+ assert message.text is not None
+
+ asyncio.run(run())
diff --git a/bindings/python/uzu/__init__.pyi b/bindings/python/uzu/__init__.pyi
index a57e65e15..e88e59e6c 100644
--- a/bindings/python/uzu/__init__.pyi
+++ b/bindings/python/uzu/__init__.pyi
@@ -1066,6 +1066,7 @@ class SamplingSeed:
class TextToSpeechSession:
def state(self) -> collections.abc.Awaitable[TextToSpeechSessionState]: ...
def synthesize(self, input: builtins.str) -> collections.abc.Awaitable[PcmBatch]: ...
+ def synthesize_stream(self, input: builtins.str) -> collections.abc.Awaitable[TextToSpeechSessionStream]: ...
@typing.final
class TextToSpeechSessionStream:
diff --git a/bindings/swift/.ignore b/bindings/swift/.ignore
deleted file mode 100644
index 7d4e93eea..000000000
--- a/bindings/swift/.ignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.sh
-Package.resolved
\ No newline at end of file
diff --git a/bindings/swift/LICENSE b/bindings/swift/LICENSE
index c869c80dd..4aac6c884 100644
--- a/bindings/swift/LICENSE
+++ b/bindings/swift/LICENSE
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
+SOFTWARE.
diff --git a/bindings/swift/Package.swift b/bindings/swift/Package.swift
index 27f4fcaeb..37ad3b0ca 100644
--- a/bindings/swift/Package.swift
+++ b/bindings/swift/Package.swift
@@ -4,8 +4,8 @@ import PackageDescription
let package = Package(
name: "Uzu",
platforms: [
- .iOS("26.0"),
- .macOS("26.0"),
+ .iOS("26.4"),
+ .macOS("26.4"),
],
products: [
.library(name: "Uzu", targets: ["Uzu"]),
diff --git a/bindings/swift/README.md b/bindings/swift/README.md
index 1749151c2..4e165af4f 100644
--- a/bindings/swift/README.md
+++ b/bindings/swift/README.md
@@ -4,99 +4,337 @@
</picture>
</p>
-<a href="https://discord.com/invite/trymirai"><img src="https://img.shields.io/discord/1377764166764462120?label=Discord" alt="Discord"></a>
-<a href="mailto:[email protected]?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-green" alt="Contact us"></a>
-<a href="https://docs.trymirai.com/app-integration/overview"><img src="https://img.shields.io/badge/Read-Docs-blue" alt="Read docs"></a>
-[![Swift Version](https://img.shields.io/badge/Swift-5.9-blue)](https://swift.org)
-[![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
+<a href="https://discord.com/invite/trymirai"><img src="https://img.shields.io/discord/1377764166764462120?label=Discord&color=brightgreen" alt="Discord"></a> <a href="mailto:[email protected]?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-brightgreen" alt="Contact us"></a> <a href="https://docs.trymirai.com"><img src="https://img.shields.io/badge/Read-Docs-brightgreen" alt="Read docs"></a> [![License](https://img.shields.io/badge/License-MIT-brightgreen)](LICENSE) ![Build](https://github.com/trymirai/uzu/actions/workflows/tests.yml/badge.svg) ![Swift](https://img.shields.io/badge/Swift-blue) ![SPM](https://img.shields.io/badge/SPM-compatible-blue) ![Platforms](https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS-blue) [![Swift](https://img.shields.io/badge/Swift-5.9-blue)](https://swift.org)
-# uzu-swift
+# uzu
-Swift package for [uzu](https://github.com/trymirai/uzu), a **high-performance** inference engine for AI models on Apple Silicon. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. You don’t need an ML team or weeks of setup - one developer can handle everything in minutes. Key features:
+A high-performance inference engine for AI models. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. Key features:
- Simple, high-level API
-- Specialized configurations with significant performance boosts for common use cases like classification and summarization
+- Unified model configurations, making it easy to add support for new models
+- Traceable computations to ensure correctness against the source-of-truth implementation
+- Utilizes unified memory on Apple devices
- [Broad model support](https://trymirai.com/models)
-- Observable model manager
## Quick Start
-Add the `uzu` dependency to your project:
+
+
+Add the dependency:
```swift
dependencies: [
- .package(url: "https://github.com/trymirai/uzu-swift.git", from: "{{VERSION}}")
+ .package(url: "https://github.com/trymirai/uzu.git", from: "0.1.9")
]
```
-Run the snippet below:
+Run the code below:
```swift
-// include:Sources/Examples/Snippets.swift#quick-start
+import Uzu
+
+public func runQuickStart() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let session = try await engine.chat(model: model, config: .create())
+
+ let messages = [
+ ChatMessage.system().withText(text: "You are a helpful assistant"),
+ ChatMessage.user().withText(text: "Tell me a short, funny story about a robot")
+ ]
+
+ let reply = try await session.reply(input: messages, config: .create())
+ guard let message = reply.last?.message else {
+ return
+ }
+
+ print("Reasoning: \(message.reasoning() ?? "empty")")
+ print("Text: \(message.text() ?? "empty")")
+}
```
+
+<br>
Everything from model downloading to inference configuration is handled automatically. Refer to the [documentation](https://docs.trymirai.com) for details on how to customize each step of the process.
## Examples
-Run it using one of the following commands:
-
-```bash
-swift run examples chat
-swift run examples chat-for-summarization
-swift run examples chat-for-classification
-swift run examples cloud
-swift run examples structured-output
-swift run examples classifier
-swift run examples text-to-speech
-```
+You can run any example via `cargo tools example` \<**swift**\> \<**chat** | **chat-cloud** | **chat-speculation-classification** | **chat-speculation-summarization** | **chat-structured-output** | **classification** | **quick-start** | **text-to-speech**\>:
### Chat
In this example, we will download a model and get a reply to a specific list of messages:
```swift
-// include:Sources/Examples/Chat.swift
+import Uzu
+
+public func runChat() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let messages = [
+ ChatMessage.system().withText(text: "You are a helpful assistant"),
+ ChatMessage.user().withText(text: "Tell me a short, funny story about a robot")
+ ]
+ let session = try await engine.chat(model: model, config: .create())
+ let stream = await session.replyWithStream(input: messages, config: .create())
+ var message: ChatMessage? = nil
+ for try await update in stream.iterator() {
+ switch update {
+ case .replies(let replies):
+ let reply = replies.last
+ message = reply?.message
+ print("Generated tokens: \(reply?.stats.tokensCountOutput ?? 0)")
+ case .error(let error):
+ print("Error: \(error)")
+ }
+ }
+ print("Reasoning: \(message?.reasoning() ?? "empty")")
+ print("Text: \(message?.text() ?? "empty")")
+}
```
-Once loaded, the same `ChatSession` can be reused for multiple requests until you drop it. Each model may consume a significant amount of RAM, so it's important to keep only one session loaded at a time. For iOS apps, we recommend adding the [Increased Memory Capability](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.kernel.increased-memory-limit) entitlement to ensure your app can allocate the required memory.
+<br>Once loaded, the same `ChatSession` can be reused for multiple requests until you drop it. Each model may consume a significant amount of RAM, so it's important to keep only one session loaded at a time. For iOS apps, we recommend adding the [Increased Memory Capability](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.kernel.increased-memory-limit) entitlement to ensure your app can allocate the required memory.
-### Summarization
+### Chat with the cloud model
-In this example, we will use the `summarization` preset to generate a summary of the input text:
+In this example, we will get a reply to a specific list of messages from a cloud model:
```swift
-// include:Sources/Examples/ChatForSummarization.swift
+import Uzu
+
+public func runChatCloud() async throws {
+ let engineConfig = EngineConfig.create().withOpenaiApiKey(openaiApiKey: "OPENAI_API_KEY")
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+
+ let messages = [
+ ChatMessage.system().withReasoningEffort(reasoningEffort: .low),
+ ChatMessage.user().withText(text: "How LLMs work")
+ ]
+
+ let session = try await engine.chat(model: model, config: .create())
+ let reply = try await session.reply(input: messages, config: .create())
+ guard let message = reply.last?.message else {
+ return
+ }
+
+ print("Reasoning: \(message.reasoning() ?? "empty")")
+ print("Text: \(message.text() ?? "empty")")
+}
```
-You will notice that the model’s run count is lower than the actual number of generated tokens due to speculative decoding, which significantly improves generation speed.
+### Chat using speculation preset for classification
-### Classification
+In this example, we will use the `classification` speculation preset to determine the sentiment of the user's input:
+
+```swift
+import Uzu
+
+public func runChatSpeculationClassification() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let feature = Feature(name: "sentiment", values: [
+ "Happy",
+ "Sad",
+ "Angry",
+ "Fearful",
+ "Surprised",
+ "Disgusted",
+ ])
+ let chatConfig = ChatConfig.create().withSpeculationPreset(speculationPreset: .classification(feature: feature))
+ let session = try await engine.chat(model: model, config: chatConfig)
+
+ let textToDetectFeature =
+ "Today's been awesome! Everything just feels right, and I can't stop smiling."
+ let prompt = "Text is: \"\(textToDetectFeature)\". Choose \(feature.name) from the list: \(feature.values.joined(separator: ", ")). Answer with one word. Don't add a dot at the end."
+ let messages = [
+ ChatMessage.system().withReasoningEffort(reasoningEffort: .disabled),
+ ChatMessage.user().withText(text: prompt)
+ ]
+
+ let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(tokenLimit: 32).withSamplingMethod(samplingMethod: .greedy)
+ let replies = try await session.reply(input: messages, config: chatReplyConfig)
+ guard let reply = replies.last else {
+ return
+ }
+
+ print("Prediction: \(reply.message.text() ?? "empty")")
+ print("Generated tokens: \(reply.stats.tokensCountOutput ?? 0)")
+}
+```
+
+<br>You can view the stats to see that the answer will be ready immediately after the prefill step, and actual generation won’t even start due to speculative decoding, which significantly improves generation speed.
-In this example, we will use the `classification` preset to determine the sentiment of the user's input:
+### Chat using speculation preset for summarization
+
+In this example, we will use the `summarization` speculation preset to generate a summary of the input text:
```swift
-// include:Sources/Examples/ChatForClassification.swift
+import Uzu
+
+public func runChatSpeculationSummarization() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let textToSummarize = "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. These models have a wide range of applications, including chatbots, content creation, translation, and code generation. One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. As these models grow in size and sophistication, they continue to enhance human-computer interactions, making AI-powered communication more natural and effective.";
+ let prompt = "Text is: \"\(textToSummarize)\". Write only summary itself."
+ let messages = [
+ ChatMessage.system().withReasoningEffort(reasoningEffort: .disabled),
+ ChatMessage.user().withText(text: prompt)
+ ]
+
+ let chatConfig = ChatConfig.create().withSpeculationPreset(speculationPreset: .summarization)
+ let session = try await engine.chat(model: model, config: chatConfig)
+
+ let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(tokenLimit: 256).withSamplingMethod(samplingMethod: .greedy)
+ let replies = try await session.reply(input: messages, config: chatReplyConfig)
+ guard let reply = replies.last else {
+ return
+ }
+
+ print("Summary: \(reply.message.text() ?? "empty")")
+ print("Generation t\\s: \(reply.stats.generateTokensPerSecond ?? 0.0)")
+}
```
-You can view the stats to see that the answer will be ready immediately after the prefill step, and actual generation won’t even start due to speculative decoding, which significantly improves generation speed.
+<br>You will notice that the model’s run count is lower than the actual number of generated tokens due to speculative decoding, which significantly improves generation speed.
-### Cloud
+### Chat with structured output
-Sometimes you want to create a complex pipeline where some requests are processed on-device and the more complex ones are handled in the cloud using a larger model. With `uzu`, you can do this easily: just choose the cloud model you want to use and perform all requests through the same API:
+Sometimes you want the generated output to be valid JSON with predefined fields. You can use `Grammar` to manually specify a JSON schema for the response you want to receive:
```swift
-// include:Sources/Examples/Cloud.swift
+import FoundationModels
+import Uzu
+
+@Generable()
+struct Country: Codable {
+ let name: String
+ let capital: String
+}
+
+public func runChatStructuredOutput() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let messages = [
+ ChatMessage.system().withReasoningEffort(reasoningEffort: .disabled),
+ ChatMessage.user().withText(text: "Give me a JSON object containing a list of 3 countries, where each country has name and capital fields")
+ ]
+
+ let session = try await engine.chat(model: model, config: .create())
+ let reply = try await session.reply(input: messages, config: .create().withGrammar(grammar: .fromType([Country].self)))
+ guard let message = reply.last?.message else {
+ return
+ }
+ guard let countries: [Country] = message.textDecoded() else {
+ return
+ }
+ print(countries)
+}
```
-### Structured Output
+### Classification
-Sometimes you want the generated output to be valid JSON with predefined fields. You can use `Grammar` to manually specify a JSON schema, or use a struct annotated with `@Generable` from Apple’s FoundationModels framework.
+In this example, we will use a classification model to determine whether the user's input is safe from a moderation perspective:
```swift
-// include:Sources/Examples/StructuredOutput.swift
+import Uzu
+
+public func runClassification() async throws {
+ let engine = try await Engine.create(config: .create())
+
+ guard let model = try await engine.model(identifier: "trymirai/chat-moderation-router") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let messages = [
+ ClassificationMessage.user(content: "Hi")
+ ]
+
+ let session = try await engine.classification(model: model)
+ let output = try await session.classify(input: messages)
+ print("Output: \(output.probabilities.values)")
+}
```
+### Text to Speech
+
+In this example, we will generate audio from text:
+
+```swift
+import Foundation
+import Uzu
+
+public func runTextToSpeech() async throws {
+ let engineConfig = EngineConfig.create()
+ let engine = try await Engine.create(config: engineConfig)
+
+ guard let model = try await engine.model(identifier: "fishaudio/s1-mini") else {
+ return
+ }
+ for try await update in try await engine.download(model: model).iterator() {
+ print("Download progress: \(update.progress())")
+ }
+
+ let text = "London is the capital of United Kingdom and one of the world’s most influential cities, known for its rich history, cultural diversity, and global significance in finance, politics, and the arts. Situated along the River Thames, the city blends historic landmarks like Tower of London and Buckingham Palace with modern architecture such as The Shard. London is also home to renowned institutions including the British Museum and vibrant areas like Covent Garden, offering a mix of history, entertainment, and innovation that attracts millions of visitors each year."
+ let outputPath = FileManager.default.homeDirectoryForCurrentUser
+ .appendingPathComponent("Desktop")
+ .appendingPathComponent("output.wav")
+ let session = try await engine.textToSpeech(model: model)
+ let pcmBatch = try await session.synthesize(input: text)
+ try pcmBatch.saveAsWav(path: outputPath.path())
+ print("Output saved to: \(outputPath.path())")
+}
+```
+
+
+
## Troubleshooting
If you experience any problems, please contact us via [Discord](https://discord.com/invite/trymirai) or [email](mailto:[email protected]).
diff --git a/bindings/swift/Sources/Examples/CLI.swift b/bindings/swift/Sources/Examples/CLI.swift
index 1279d0b97..63435bb8f 100644
--- a/bindings/swift/Sources/Examples/CLI.swift
+++ b/bindings/swift/Sources/Examples/CLI.swift
@@ -18,24 +18,20 @@ struct Example: AsyncParsableCommand {
mutating func run() async throws {
switch mode {
- case "chat":
- try await runChat()
- case "chat-for-summarization":
- try await runChatForSummarization()
- case "chat-for-classification":
- try await runChatForClassification()
case "quick-start":
try await runQuickStart()
- case "snippets":
- try await runSnippets()
- case "cloud":
- try await runCloud()
- case "ssm":
- try await runSSM()
- case "structured-output":
- try await runStructuredOutput()
- case "classifier":
- try await runClassifier()
+ case "chat":
+ try await runChat()
+ case "chat-cloud":
+ try await runChatCloud()
+ case "chat-structured-output":
+ try await runChatStructuredOutput()
+ case "chat-speculation-summarization":
+ try await runChatSpeculationSummarization()
+ case "chat-speculation-classification":
+ try await runChatSpeculationClassification()
+ case "classification":
+ try await runClassification()
case "text-to-speech":
try await runTextToSpeech()
default:
diff --git a/bindings/swift/Sources/Examples/Cloud.swift b/bindings/swift/Sources/Examples/ChatCloud.swift
similarity index 94%
rename from bindings/swift/Sources/Examples/Cloud.swift
rename to bindings/swift/Sources/Examples/ChatCloud.swift
index 768543f99..0dbb359f2 100644
--- a/bindings/swift/Sources/Examples/Cloud.swift
+++ b/bindings/swift/Sources/Examples/ChatCloud.swift
@@ -1,6 +1,6 @@
import Uzu
-public func runCloud() async throws {
+public func runChatCloud() async throws {
let engineConfig = EngineConfig.create().withOpenaiApiKey(openaiApiKey: "OPENAI_API_KEY")
let engine = try await Engine.create(config: engineConfig)
diff --git a/bindings/swift/Sources/Examples/ChatForClassification.swift b/bindings/swift/Sources/Examples/ChatSpeculationClassification.swift
similarity index 96%
rename from bindings/swift/Sources/Examples/ChatForClassification.swift
rename to bindings/swift/Sources/Examples/ChatSpeculationClassification.swift
index ccd219cd7..32d424545 100644
--- a/bindings/swift/Sources/Examples/ChatForClassification.swift
+++ b/bindings/swift/Sources/Examples/ChatSpeculationClassification.swift
@@ -1,6 +1,6 @@
import Uzu
-public func runChatForClassification() async throws {
+public func runChatSpeculationClassification() async throws {
let engineConfig = EngineConfig.create()
let engine = try await Engine.create(config: engineConfig)
diff --git a/bindings/swift/Sources/Examples/ChatForSummarization.swift b/bindings/swift/Sources/Examples/ChatSpeculationSummarization.swift
similarity index 97%
rename from bindings/swift/Sources/Examples/ChatForSummarization.swift
rename to bindings/swift/Sources/Examples/ChatSpeculationSummarization.swift
index 1e3bf51dd..877d8a7b8 100644
--- a/bindings/swift/Sources/Examples/ChatForSummarization.swift
+++ b/bindings/swift/Sources/Examples/ChatSpeculationSummarization.swift
@@ -1,6 +1,6 @@
import Uzu
-public func runChatForSummarization() async throws {
+public func runChatSpeculationSummarization() async throws {
let engineConfig = EngineConfig.create()
let engine = try await Engine.create(config: engineConfig)
diff --git a/bindings/swift/Sources/Examples/StructuredOutput.swift b/bindings/swift/Sources/Examples/ChatStructuredOutput.swift
similarity index 95%
rename from bindings/swift/Sources/Examples/StructuredOutput.swift
rename to bindings/swift/Sources/Examples/ChatStructuredOutput.swift
index 9ce54dc41..d7bc33546 100644
--- a/bindings/swift/Sources/Examples/StructuredOutput.swift
+++ b/bindings/swift/Sources/Examples/ChatStructuredOutput.swift
@@ -7,7 +7,7 @@ struct Country: Codable {
let capital: String
}
-public func runStructuredOutput() async throws {
+public func runChatStructuredOutput() async throws {
let engineConfig = EngineConfig.create()
let engine = try await Engine.create(config: engineConfig)
diff --git a/bindings/swift/Sources/Examples/Classifier.swift b/bindings/swift/Sources/Examples/Classification.swift
similarity index 92%
rename from bindings/swift/Sources/Examples/Classifier.swift
rename to bindings/swift/Sources/Examples/Classification.swift
index b3ff3d0af..0a0b92bb4 100644
--- a/bindings/swift/Sources/Examples/Classifier.swift
+++ b/bindings/swift/Sources/Examples/Classification.swift
@@ -1,6 +1,6 @@
import Uzu
-public func runClassifier() async throws {
+public func runClassification() async throws {
let engine = try await Engine.create(config: .create())
guard let model = try await engine.model(identifier: "trymirai/chat-moderation-router") else {
diff --git a/bindings/swift/Sources/Examples/SSM.swift b/bindings/swift/Sources/Examples/SSM.swift
deleted file mode 100644
index 75cb53052..000000000
--- a/bindings/swift/Sources/Examples/SSM.swift
+++ /dev/null
@@ -1,25 +0,0 @@
-import Uzu
-
-public func runSSM() async throws {
- let engineConfig = EngineConfig.create()
- let engine = try await Engine.create(config: engineConfig)
-
- guard let model = try await engine.model(identifier: "cartesia-ai/Llamba-1B-4bit-mlx") else {
- return
- }
- for try await update in try await engine.download(model: model).iterator() {
- print("Download progress: \(update.progress())")
- }
-
- let messages = [
- ChatMessage.user().withText(text: "Tell me a short, funny story about a robot")
- ]
-
- let session = try await engine.chat(model: model, config: .create())
- let reply = try await session.reply(input: messages, config: .create())
- guard let message = reply.last?.message else {
- return
- }
-
- print("Text: \(message.text() ?? "empty")")
-}
diff --git a/bindings/swift/Sources/Examples/Snippets.swift b/bindings/swift/Sources/Examples/Snippets.swift
deleted file mode 100644
index 05d43b26c..000000000
--- a/bindings/swift/Sources/Examples/Snippets.swift
+++ /dev/null
@@ -1,161 +0,0 @@
-import Uzu
-
-@MainActor public func exampleQuickStart() async throws {
- // snippet:quick-start
- let engineConfig = EngineConfig.create()
- let engine = try await Engine.create(config: engineConfig)
-
- guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
- return
- }
-
- for try await update in try await engine.download(model: model).iterator() {
- print("Download progress: \(update.progress())")
- }
-
- let session = try await engine.chat(model: model, config: .create())
-
- let messages = [
- ChatMessage.system().withText(text: "You are a helpful assistant"),
- ChatMessage.user().withText(text: "Tell me a short, funny story about a robot")
- ]
-
- let reply = try await session.reply(input: messages, config: .create())
- guard let message = reply.last?.message else {
- return
- }
- // endsnippet:quick-start
-
- print("Reasoning: \(message.reasoning() ?? "empty")")
- print("Text: \(message.text() ?? "empty")")
-}
-
-@MainActor public func exampleChat() async throws {
- // snippet:engine-create
- let engineConfig = EngineConfig.create()
- let engine = try await Engine.create(config: engineConfig)
- // endsnippet:engine-create
-
- // snippet:model-choose
- guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
- return
- }
- // endsnippet:model-choose
-
- // snippet:model-download
- for try await update in try await engine.download(model: model).iterator() {
- print("Download progress: \(update.progress())")
- }
- // endsnippet:model-download
-
- // snippet:session-create-general
- let session = try await engine.chat(model: model, config: .create())
- // endsnippet:session-create-general
-
- // snippet:session-input-general
- let messages = [
- ChatMessage.system().withText(text: "You are a helpful assistant"),
- ChatMessage.user().withText(text: "Tell me a short, funny story about a robot")
- ]
- // endsnippet:session-input-general
-
- // snippet:session-run-general
- let reply = try await session.reply(input: messages, config: .create())
- guard let message = reply.last?.message else {
- return
- }
- // endsnippet:session-run-general
-
- print("Reasoning: \(message.reasoning() ?? "empty")")
- print("Text: \(message.text() ?? "empty")")
-}
-
-@MainActor public func exampleSummarization() async throws {
- let engineConfig = EngineConfig.create()
- let engine = try await Engine.create(config: engineConfig)
-
- guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
- return
- }
- for try await update in try await engine.download(model: model).iterator() {
- print("Download progress: \(update.progress())")
- }
-
- // snippet:session-input-summarization
- let textToSummarize = "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. These models have a wide range of applications, including chatbots, content creation, translation, and code generation. One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. As these models grow in size and sophistication, they continue to enhance human-computer interactions, making AI-powered communication more natural and effective.";
- let prompt = "Text is: \"\(textToSummarize)\". Write only summary itself."
- let messages = [
- ChatMessage.system().withReasoningEffort(reasoningEffort: .disabled),
- ChatMessage.user().withText(text: prompt)
- ]
- // endsnippet:session-input-summarization
-
- // snippet:session-create-summarization
- let chatConfig = ChatConfig.create().withSpeculationPreset(speculationPreset: .summarization)
- let session = try await engine.chat(model: model, config: chatConfig)
- // endsnippet:session-create-summarization
-
- // snippet:session-run-summarization
- let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(tokenLimit: 256).withSamplingMethod(samplingMethod: .greedy)
- let replies = try await session.reply(input: messages, config: chatReplyConfig)
- guard let reply = replies.last else {
- return
- }
- // endsnippet:session-run-summarization
-
- print("Summary: \(reply.message.text() ?? "empty")")
- print("Generation t\\s: \(reply.stats.generateTokensPerSecond ?? 0.0)")
-}
-
-@MainActor public func exampleClassification() async throws {
- let engineConfig = EngineConfig.create()
- let engine = try await Engine.create(config: engineConfig)
-
- guard let model = try await engine.model(identifier: "Qwen/Qwen3-0.6B") else {
- return
- }
- for try await update in try await engine.download(model: model).iterator() {
- print("Download progress: \(update.progress())")
- }
-
- // snippet:session-create-classification
- let feature = Feature(name: "sentiment", values: [
- "Happy",
- "Sad",
- "Angry",
- "Fearful",
- "Surprised",
- "Disgusted",
- ])
- let chatConfig = ChatConfig.create().withSpeculationPreset(speculationPreset: .classification(feature: feature))
- let session = try await engine.chat(model: model, config: chatConfig)
- // endsnippet:session-create-classification
-
- // snippet:session-input-classification
- let textToDetectFeature =
- "Today's been awesome! Everything just feels right, and I can't stop smiling."
- let prompt = "Text is: \"\(textToDetectFeature)\". Choose \(feature.name) from the list: \(feature.values.joined(separator: ", ")). Answer with one word. Don't add a dot at the end."
- let messages = [
- ChatMessage.system().withReasoningEffort(reasoningEffort: .disabled),
- ChatMessage.user().withText(text: prompt)
- ]
- // endsnippet:session-input-classification
-
- // snippet:session-run-classification
- let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(tokenLimit: 32).withSamplingMethod(samplingMethod: .greedy)
- let replies = try await session.reply(input: messages, config: chatReplyConfig)
- guard let reply = replies.last else {
- return
- }
- // endsnippet:session-run-classification
-
- print("Prediction: \(reply.message.text() ?? "empty")")
- print("Generated tokens: \(reply.stats.tokensCountOutput ?? 0)")
-}
-
-@MainActor public func runSnippets() async throws {
- try await exampleQuickStart()
- try await exampleChat()
- try await exampleSummarization()
- try await exampleClassification()
-}
diff --git a/bindings/swift/Sources/Uzu/Generated/Extensions.swift b/bindings/swift/Sources/Uzu/Generated/Extensions.swift
index f87870465..23986bf9a 100644
--- a/bindings/swift/Sources/Uzu/Generated/Extensions.swift
+++ b/bindings/swift/Sources/Uzu/Generated/Extensions.swift
@@ -1,4 +1,4 @@
-// Auto-generated by cli-release — do not edit.
+// Auto-generated by cli-tools — do not edit.
extension CancelToken {
public static func create() -> CancelToken {
diff --git a/bindings/swift/Sources/Uzu/Generated/uzu/nagare.swift b/bindings/swift/Sources/Uzu/Generated/uzu/nagare.swift
index a3f34e5e8..e3f3a37af 100644
--- a/bindings/swift/Sources/Uzu/Generated/uzu/nagare.swift
+++ b/bindings/swift/Sources/Uzu/Generated/uzu/nagare.swift
@@ -951,6 +951,8 @@ public protocol TextToSpeechSessionProtocol: AnyObject, Sendable {
func synthesize(input: String) async throws -> PcmBatch
+ func synthesizeStream(input: String) async -> TextToSpeechSessionStream
+
}
open class TextToSpeechSession: TextToSpeechSessionProtocol, @unchecked Sendable {
fileprivate let handle: UInt64
@@ -1040,6 +1042,24 @@ open func synthesize(input: String)async throws -> PcmBatch {
)
}
+open func synthesizeStream(input: String)async -> TextToSpeechSessionStream {
+ return
+ try! await uniffiRustCallAsync(
+ rustFutureFunc: {
+ uniffi_nagare_fn_method_texttospeechsession_synthesize_stream(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(input)
+ )
+ },
+ pollFunc: ffi_nagare_rust_future_poll_u64,
+ completeFunc: ffi_nagare_rust_future_complete_u64,
+ freeFunc: ffi_nagare_rust_future_free_u64,
+ liftFunc: FfiConverterTypeTextToSpeechSessionStream_lift,
+ errorHandler: nil
+
+ )
+}
+
}
@@ -2079,6 +2099,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_nagare_checksum_method_texttospeechsession_synthesize() != 10886) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_nagare_checksum_method_texttospeechsession_synthesize_stream() != 498) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_nagare_checksum_method_texttospeechsessionstream_cancel_token() != 440) {
return InitializationResult.apiChecksumMismatch
}
diff --git a/bindings/swift/build_release_xcframework.sh b/bindings/swift/build_release_xcframework.sh
deleted file mode 100755
index 87695b279..000000000
--- a/bindings/swift/build_release_xcframework.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-
-# build_release_xcframework.sh
-# Builds the Uzu Swift package in Release configuration for macOS,
-# iOS device and iOS simulator slices and combines them into a single
-# universal `uzu.xcframework` ready for distribution (e.g. publishing
-# to a private or public SwiftPM registry).
-#
-# The script relies on `update_uzu.sh` (which itself wraps `cargo swift`)
-# for per-platform builds and on `xcodebuild -create-xcframework` to
-# merge the individual static libraries.
-
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-SOURCE_PKG_DIR="$SCRIPT_DIR" # root of Swift package (update_uzu.sh writes here)
-
-# Default destination equals the source package location but can be overridden
-DEST_PKG_DIR="$SOURCE_PKG_DIR"
-
-# Parse CLI options
-while [[ $# -gt 0 ]]; do
- case "$1" in
- --destination|-d)
- DEST_PKG_DIR="$2"; shift 2;;
- *)
- echo "Unknown option: $1" >&2; exit 1;;
- esac
-done
-
-UNIVERSAL_XCFRAMEWORK="$SOURCE_PKG_DIR/uzu.xcframework"
-
-BUILD_ROOT="$SCRIPT_DIR/.release_build"
-SLICES_DIR="$BUILD_ROOT/slices"
-
-rm -rf "$BUILD_ROOT"
-mkdir -p "$SLICES_DIR"
-
-# 1. Build each platform slice in Release mode
-# Allow overriding platforms via env var UZU_SWIFT_PLATFORMS (e.g., "macos" for local)
-PLATFORMS=${UZU_SWIFT_PLATFORMS:-"ios ios-sim macos"}
-for platform in $PLATFORMS; do
- echo "\n=== Building Uzu for $platform (Release) ==="
- bash "$SCRIPT_DIR/update_uzu.sh" --platform "$platform" --configuration Release
- # Preserve the generated xcframework for later merging
- cp -R "$UNIVERSAL_XCFRAMEWORK" "$SLICES_DIR/${platform}.xcframework"
-done
-
-# 2. Combine slices into a single universal xcframework
-echo "\n=== Creating universal xcframework ==="
-rm -rf "$UNIVERSAL_XCFRAMEWORK"
-
-LIB_ARGS=()
-for platform in $PLATFORMS; do
- SLICE="$SLICES_DIR/${platform}.xcframework"
- LIB_PATH="$(find "$SLICE" -name 'libuzu.a' | head -n 1)"
- HEADERS_PATH="$(dirname "$LIB_PATH")/Headers"
- LIB_ARGS+=("-library" "$LIB_PATH" "-headers" "$HEADERS_PATH")
-done
-
-xcodebuild -create-xcframework "${LIB_ARGS[@]}" -output "$UNIVERSAL_XCFRAMEWORK" | cat
-
-# Sign the universal xcframework
-echo "\n=== Signing universal xcframework ==="
-# Try to sign with developer certificate, fall back to ad-hoc signing
-if security find-identity -v -p codesigning | grep -q "Apple Development"; then
- SIGNING_IDENTITY=$(security find-identity -v -p codesigning | grep "Apple Development" | head -n 1 | awk '{print $2}')
- echo "Signing with identity: $SIGNING_IDENTITY"
- codesign --force --sign "$SIGNING_IDENTITY" --timestamp "$UNIVERSAL_XCFRAMEWORK"
-else
- echo "No developer certificate found, applying ad-hoc signing"
- codesign --force --sign - "$UNIVERSAL_XCFRAMEWORK"
-fi
-
-# 3. Copy the finished Swift package to destination if it differs from source
-if [[ "$DEST_PKG_DIR" != "$SOURCE_PKG_DIR" ]]; then
- echo "\n=== Copying Swift package to $DEST_PKG_DIR ==="
- rm -rf "$DEST_PKG_DIR"
- mkdir -p "$(dirname "$DEST_PKG_DIR")"
- rsync -a --delete "$SOURCE_PKG_DIR/" "$DEST_PKG_DIR/"
-fi
-
-echo "\n✅ Release Swift package ready at $DEST_PKG_DIR"
diff --git a/bindings/swift/update_uzu.sh b/bindings/swift/update_uzu.sh
deleted file mode 100755
index f5cce09d4..000000000
--- a/bindings/swift/update_uzu.sh
+++ /dev/null
@@ -1,245 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-
-# update_uzu.sh
-# Regenerates the Uzu Swift package (binary target + generated bindings)
-# for the requested Apple platform/configuration using cargo-swift.
-# This script is invoked from Xcode scheme pre-actions so it MUST stay fast:
-# Xcode passes the effective PLATFORM name (ios, iphonesimulator, macosx, …)
-# and CONFIGURATION (Debug / Release).
-#
-# Requires: `cargo swift` to be installed (`cargo install cargo-swift`).
-
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-WORKSPACE_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
-RUST_CRATE_DIR="$WORKSPACE_ROOT/crates/uzu"
-
-# Destination Swift package (checked in to the repo and referenced by Xcode)
-DEST_PKG_DIR="$SCRIPT_DIR"
-DEST_SRC_DIR="$DEST_PKG_DIR/Sources"
-
-PLATFORM="${PLATFORM:-ios}"
-CONFIGURATION="${CONFIGURATION:-Debug}"
-
-# Capture Xcode-provided deployment targets before we unset them later.
-# These come from Project.swift deploymentTargets and are the source of truth.
-XCODE_IPHONEOS_DEPLOYMENT_TARGET="${IPHONEOS_DEPLOYMENT_TARGET:-26.0}"
-XCODE_MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET:-26.0}"
-
-# Ensure Rust, Homebrew, etc. binaries are on PATH when called from Xcode (which resets PATH)
-if [ -d "/opt/homebrew/bin" ]; then
- export PATH="/opt/homebrew/bin:$PATH"
-fi
-if [ -d "/usr/local/bin" ]; then
- export PATH="/usr/local/bin:$PATH"
-fi
-if [ -d "$HOME/.cargo/bin" ]; then
- export PATH="$HOME/.cargo/bin:$PATH"
-fi
-
-while [[ $# -gt 0 ]]; do
- case "$1" in
- --platform)
- if [[ -z "${2:-}" ]]; then
- echo "Error: --platform requires a value"
- exit 1
- fi
- PLATFORM="$2"
- shift 2
- ;;
- --configuration)
- if [[ -z "${2:-}" ]]; then
- echo "Error: --configuration requires a value"
- exit 1
- fi
- CONFIGURATION="$2"
- shift 2
- ;;
- *)
- shift
- ;;
- esac
-done
-
-# Normalise PLATFORM value (xcode passes like -iphonesimulator etc.)
-PLATFORM="$(echo "$PLATFORM" | tr '[:upper:]' '[:lower:]')"
-[[ "$PLATFORM" == "iphonesimulator" ]] && PLATFORM="ios-sim"
-[[ "$PLATFORM" == "macosx" ]] && PLATFORM="macos"
-[[ "$PLATFORM" == "iphoneos" ]] && PLATFORM="ios"
-
-if [[ -z "$PLATFORM" ]]; then
- # Fallback to PLATFORM_NAME provided by Xcode (e.g. macosx, iphoneos, iphonesimulator)
- PLATFORM="$(echo "${PLATFORM_NAME:-}" | tr '[:upper:]' '[:lower:]')"
- [[ "$PLATFORM" == "macosx" ]] && PLATFORM="macos"
- [[ "$PLATFORM" == "iphoneos" ]] && PLATFORM="ios"
- [[ "$PLATFORM" == "iphonesimulator" ]] && PLATFORM="ios-sim"
-fi
-
-# Validate platform value
-case "$PLATFORM" in
- ios|ios-sim|macos) ;;
- *)
- echo "Error: Invalid platform '$PLATFORM'"
- echo "Valid platforms: ios, ios-sim, macos"
- exit 1
- ;;
-esac
-
-echo "↪︎ Rebuilding Uzu Swift package for $PLATFORM ($CONFIGURATION)"
-
-#####################################
-# 1. Generate Swift package with cargo-swift
-#####################################
-# Map platform to cargo-swift target triple list (cargo-swift supports multi-target but
-# we only build the slice we currently need to speed things up).
-case "$PLATFORM" in
- ios) CS_TARGET="aarch64-apple-ios";;
- ios-sim) CS_TARGET="aarch64-apple-ios-sim";;
- macos) CS_TARGET="aarch64-apple-darwin";;
- *) echo "Unsupported platform $PLATFORM"; exit 1;;
-esac
-
-CS_RELEASE_FLAG=""
-if [[ "$CONFIGURATION" == "Release" ]]; then
- CS_RELEASE_FLAG="--release"
-fi
-
-# Determine swift platform flag
-case "$PLATFORM" in
- ios) CS_SWIFT_PLATFORM="ios";;
- ios-sim) CS_SWIFT_PLATFORM="ios";;
- macos) CS_SWIFT_PLATFORM="macos";;
- *) CS_SWIFT_PLATFORM="ios";;
-esac
-
-# Run cargo-swift inside crate directory
-
-pushd "$RUST_CRATE_DIR" >/dev/null
-
-# Xcode exports deployment targets for ALL platforms, which can confuse C/C++ builds.
-# Unset ALL deployment targets first, then set only the one we need.
-unset MACOSX_DEPLOYMENT_TARGET
-unset IPHONEOS_DEPLOYMENT_TARGET
-unset XROS_DEPLOYMENT_TARGET
-unset TVOS_DEPLOYMENT_TARGET
-unset WATCHOS_DEPLOYMENT_TARGET
-unset DRIVERKIT_DEPLOYMENT_TARGET
-
-# Xcode sets SDKROOT to the iOS SDK during iOS builds. That confuses the host-side
-# build of procedural-macro crates (which must link against the macOS SDK).
-# For iOS builds we unset it; for macOS builds we point it explicitly to the macOS SDK
-# so Rust's linker can find system libs like libobjc.
-case "$PLATFORM" in
- ios|ios-sim)
- unset SDKROOT
- ;;
- macos)
- export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
- # Help rustc locate system libraries when using -nodefaultlibs by passing the sysroot
- export RUSTFLAGS="${RUSTFLAGS:-} -C link-arg=-isysroot -C link-arg=$SDKROOT"
- ;;
-esac
-
-unset SWIFT_DEBUG_INFORMATION_FORMAT
-unset SWIFT_DEBUG_INFORMATION_VERSION
-
-#####################################
-# Set explicit Apple deployment targets for native objects
-# Values come from Xcode (Project.swift is source of truth)
-# Must be done AFTER unsetting conflicting environment variables above
-#
-# Note: We do NOT set CFLAGS/CXXFLAGS globally as they affect host builds
-# (build scripts, proc-macros) and cause conflicts with cross-compilation.
-# cargo-swift handles target-specific flags internally.
-#####################################
-case "$PLATFORM" in
- macos)
- export MACOSX_DEPLOYMENT_TARGET="$XCODE_MACOSX_DEPLOYMENT_TARGET"
- ;;
- ios)
- export IPHONEOS_DEPLOYMENT_TARGET="$XCODE_IPHONEOS_DEPLOYMENT_TARGET"
- ;;
- ios-sim)
- export IPHONEOS_DEPLOYMENT_TARGET="$XCODE_IPHONEOS_DEPLOYMENT_TARGET"
- ;;
-esac
-
-cargo swift package \
- --name uzu \
- --xcframework-name uzu \
- --target "$CS_TARGET" \
- -p "$CS_SWIFT_PLATFORM" \
- --features "bindings-uniffi" \
- $CS_RELEASE_FLAG \
- -y >/dev/null
-
-popd >/dev/null
-
-# The generated package lives at $RUST_CRATE_DIR/uzu
-PKG_OUT_DIR="$RUST_CRATE_DIR/uzu"
-
-#####################################
-# 2. Copy artefacts into the repository's Swift package wrapper
-#####################################
-
-# Ensure wrapper package skeleton exists (Package.swift, Sources folder, etc.)
-mkdir -p "$DEST_PKG_DIR"
-mkdir -p "$DEST_SRC_DIR/Uzu"
-
-# Package.swift manifest generation has been moved to setup.sh
-
-# Copy generated FFI Swift sources
-SRC_GEN_DIR="$PKG_OUT_DIR/Sources"
-if [[ -d "$SRC_GEN_DIR" ]]; then
- echo "• Updating generated swift sources"
- rm -rf "$DEST_SRC_DIR/Uzu/Generated"
- mkdir -p "$DEST_SRC_DIR/Uzu/Generated"
- rsync -a --delete "$SRC_GEN_DIR/" "$DEST_SRC_DIR/Uzu/Generated/"
-fi
-
-# Copy xcframework
-XC_PATH="$PKG_OUT_DIR/uzu.xcframework"
-if [[ -d "$XC_PATH" ]]; then
- echo "• Copying xcframework to package root"
- rm -rf "$DEST_PKG_DIR/uzu.xcframework"
- cp -R "$XC_PATH" "$DEST_PKG_DIR/uzu.xcframework"
-
- # Flatten headers: cargo-swift nests them under Headers/<name>/ but SPM expects
- # the modulemap directly inside Headers/
- for slice_dir in "$DEST_PKG_DIR/uzu.xcframework"/*/; do
- headers_dir="${slice_dir}Headers"
- [[ -d "$headers_dir" ]] || continue
- for nested_modulemap in "$headers_dir"/*/module.modulemap; do
- [[ -f "$nested_modulemap" ]] || continue
- nested_dir="$(dirname "$nested_modulemap")"
- mv "$nested_dir"/* "$headers_dir/"
- rmdir "$nested_dir"
- done
- done
-
- # Sign the xcframework with the current development team
- # For Release builds, this ensures the framework is properly signed for distribution
- if [[ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" && "$EXPANDED_CODE_SIGN_IDENTITY" != "-" ]]; then
- echo "• Signing xcframework with identity: $EXPANDED_CODE_SIGN_IDENTITY"
- codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" \
- --timestamp \
- --preserve-metadata=identifier,entitlements,flags \
- "$DEST_PKG_DIR/uzu.xcframework" 2>/dev/null || true
- elif [[ "$CONFIGURATION" == "Release" ]]; then
- # For Release builds outside of Xcode, try to use ad-hoc signing
- echo "• Applying ad-hoc signing to xcframework"
- codesign --force --sign - "$DEST_PKG_DIR/uzu.xcframework" 2>/dev/null || true
- fi
-fi
-
-# Clean up generated Swift package directory created by cargo-swift
-if [[ -d "$PKG_OUT_DIR" ]]; then
- rm -rf "$PKG_OUT_DIR"
-fi
-
-# Also remove crate-local generated directory if present
-if [[ -d "$RUST_CRATE_DIR/generated" ]]; then
- rm -rf "$RUST_CRATE_DIR/generated"
-fi
-
-echo "✓ Uzu package refreshed"
diff --git a/bindings/ts-napi/.gitignore b/bindings/ts-napi/.gitignore
deleted file mode 100644
index 40b878db5..000000000
--- a/bindings/ts-napi/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/
\ No newline at end of file
diff --git a/bindings/ts-napi/.node-version b/bindings/ts-napi/.node-version
deleted file mode 100644
index 2edeafb09..000000000
--- a/bindings/ts-napi/.node-version
+++ /dev/null
@@ -1 +0,0 @@
-20
\ No newline at end of file
diff --git a/bindings/ts-napi/package.json b/bindings/ts-napi/package.json
deleted file mode 100644
index a3526a46a..000000000
--- a/bindings/ts-napi/package.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "@trymirai/uzu-napi",
- "version": "0.0.0",
- "private": false,
- "main": "uzu.node",
- "types": "uzu.d.ts",
- "packageManager": "[email protected]",
- "devDependencies": {
- "@napi-rs/cli": "3.1.2",
- "@types/node": "24.2.0",
- "ts-node": "10.9.2",
- "typescript": "5.9.2"
- },
- "napi": {
- "binaryName": "uzu"
- },
- "os": [
- "darwin"
- ],
- "cpu": [
- "arm64"
- ],
- "files": [
- "uzu.node",
- "uzu.d.ts",
- "package.json"
- ]
-}
\ No newline at end of file
diff --git a/bindings/ts-napi/pnpm-lock.yaml b/bindings/ts-napi/pnpm-lock.yaml
deleted file mode 100644
index 2dd0fd99b..000000000
--- a/bindings/ts-napi/pnpm-lock.yaml
+++ /dev/null
@@ -1,1400 +0,0 @@
-lockfileVersion: '9.0'
-
-settings:
- autoInstallPeers: true
- excludeLinksFromLockfile: false
-
-importers:
-
- .:
- devDependencies:
- '@napi-rs/cli':
- specifier: 3.1.2
- version: 3.1.2(@emnapi/[email protected])(@types/[email protected])
- '@types/node':
- specifier: 24.2.0
- version: 24.2.0
- ts-node:
- specifier: 10.9.2
- version: 10.9.2(@types/[email protected])([email protected])
- typescript:
- specifier: 5.9.2
- version: 5.9.2
-
-packages:
-
- '@cspotcode/[email protected]':
- resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
- engines: {node: '>=12'}
-
- '@emnapi/[email protected]':
- resolution: {integrity: sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==}
-
- '@emnapi/[email protected]':
- resolution: {integrity: sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==}
-
- '@emnapi/[email protected]':
- resolution: {integrity: sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==}
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-fdSw07FLJEU5vbpOPzXo5c6xmMGDzbZE2+niuDHX5N6mc6V0Ebso/q3xiHra4D73+PMsC8MJmcaZKuAAoaQsSA==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-5yR4IBfe0kXe59r1YCTG8WXkUbl7Z35HK87Sw+WUyGD8wNUx7JvY7laahzeytyE1oLn74bQnL7hstctQxisQ8Q==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-8xrp836RZvKkpNbVvgWUlxjT4CraKk2q+I3Ksy+seI2zkcE+y6wNs1BVhgcv8VyImFecUhdQrYLdW32pAjwBdA==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-wst31XT8DnGOSS4nNJDIklGKnf+8shuauVrWzgKegWUe28zfCftcWZ2vktGdzJgcylWSS2SrDnYUb6alZcwnCQ==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-PSqy9VmJx/VbE3CT453yOfNa+PykpKg/0SYP7odez1/NWBGuDXgPhp4AeGYYKjhLn5lUUavVS/JbeYMPdH50Mw==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-lGPVU3yO9ZNqA7vTYz26jny41lE7yoQansmqdMLBEfqaGsmdg7V3W9mK9Pvb5IL4EVZ9GnSDGMO/cJXud5dMaw==}
- engines: {node: '>=18'}
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-tVC+O1rBl0lJpoUZv4xY+WGWY8V5b0zxU1XDsMsIHYregdh7bN5X5QnIONNBAl0K765FYlAfNHS2Bhn7SSOVow==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-GcvGHkyIgfZgVnnimURdOueMk0CztycfC8NZTiIY9arIAkeOgt6zG57G+7vC59Jns3UX27LMkPKnKWAOF5xEYg==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-DJolTnNeZ00E1+1TW+8614F7rOJJCM4y4BAGQ3Gq6kQIG+OJ4zr3GLjIjVVJCbKsk2jmkmv6v2kQuN/vriHdZA==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-JHwGbQ6wjf1dxxnalDYpZwZxUEosT+6CPGD9Zh4sm9WXdtUp9XODCQD3NjSTmu+0OAyxWXNOqf0spjIymJa2Tw==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-R5qMyGJqtDdi4Ht521iAkNqyB6p2UPuZUbMifakg1sWtu24gc2Z8CJuw8rP081OckNDMgtDCuLe42Q2Kr3BolA==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-PMk1+O/WBcYJDq2H7foV0aAZSmDdkzZB9Mw2v/DmONRJopwA/128cS9M/TXWLKKdEQKZnKwBzqu2G4x/2Nqx8Q==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-Gfl/5sqOF5vS/LIrSndFgOh7jgoe0UXEizDqahFRkq5aJBLegZ6WjuMh/hVEJwlFQjyLq1z9fRtvUMkb7jM1LA==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@inquirer/[email protected]':
- resolution: {integrity: sha512-lg9Whz8onIHRthWaN1Q9EGLa/0LFJjyM8mEUbL1eTi6yMGvBf8gvyDLtxSXztQsxMvhxxNpJYrwa1YHdq+w4Jw==}
- engines: {node: '>=18'}
- peerDependencies:
- '@types/node': '>=18'
- peerDependenciesMeta:
- '@types/node':
- optional: true
-
- '@jridgewell/[email protected]':
- resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
- engines: {node: '>=6.0.0'}
-
- '@jridgewell/[email protected]':
- resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==}
-
- '@jridgewell/[email protected]':
- resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-i0HT3Ja83Bzy+OtLd2eG7MI6E83+z/iwwzrdCjJ3ZiSpT3uE/xpVrLuZPd3MT5dJ9LAxCPN+P0tAPF32pRErUg==}
- engines: {node: '>= 16'}
- hasBin: true
- peerDependencies:
- '@emnapi/runtime': ^1.1.0
- emnapi: ^1.1.0
- peerDependenciesMeta:
- '@emnapi/runtime':
- optional: true
- emnapi:
- optional: true
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-5Ha9SkZC8NjLB4Xe6C9v+3c+Oraz9FdbuN2L4d/mh1kTK8Y/zGt5geM/U+sboAP3HoK2aRWRnx4GK0eV3oPoUQ==}
- peerDependencies:
- '@napi-rs/cross-toolchain-arm64-target-aarch64': ^1.0.0
- '@napi-rs/cross-toolchain-arm64-target-armv7': ^1.0.0
- '@napi-rs/cross-toolchain-arm64-target-x86_64': ^1.0.0
- '@napi-rs/cross-toolchain-x64-target-aarch64': ^1.0.0
- '@napi-rs/cross-toolchain-x64-target-armv7': ^1.0.0
- '@napi-rs/cross-toolchain-x64-target-x86_64': ^1.0.0
- peerDependenciesMeta:
- '@napi-rs/cross-toolchain-arm64-target-aarch64':
- optional: true
- '@napi-rs/cross-toolchain-arm64-target-armv7':
- optional: true
- '@napi-rs/cross-toolchain-arm64-target-x86_64':
- optional: true
- '@napi-rs/cross-toolchain-x64-target-aarch64':
- optional: true
- '@napi-rs/cross-toolchain-x64-target-armv7':
- optional: true
- '@napi-rs/cross-toolchain-x64-target-x86_64':
- optional: true
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-smZtN41ebtYw+vxn1q3IXhns1hUzFNUcgHxknZKFQSKaybYZ4KxMiiBIw5UqJ9rw1dkaHqokcC1YeAfu8vfG2A==}
- engines: {node: '>= 10'}
- cpu: [arm]
- os: [android]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-s+h9bM3Z31FL0IPfWF4kBCebWxJBtpFvje6ikzmeUg1/jjWAP81IJC5j75zz5TEWt+Zf3Bip0uVlQhCZmqlpKA==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [android]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-aF5wxA0SFlRalxeyz7TpmFuztHlG9D0qew+1gz0tiRs4gituT3CCsR0PSBZ2LbalTY/7RqmYP4ssLQus+p8tqg==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [darwin]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-80gD9kvXPPBz6V4C7SXcPo0o7ySlneDVRpebAHN1DubIEwhdrMFuqmtaATwT5MTraZSrQ4CHF275MQuwiHtlGw==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [darwin]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-wd+jwYQRIzkGtUvInYLWSrqRtDatIvwNm/w9k43f+oABBsnP4veJkyKGGm4SQQa35Ki8IXVzYdGTa4eSTi+Org==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [freebsd]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-KiMgBugjFQfgeZTebuBVHL8ta/nZ2cfzd0Jge0e0y/WX/p7ZkVyCox/TTu9EU2H9OeBAFKTRmIDoqhHlBbkqyA==}
- engines: {node: '>= 10'}
- cpu: [arm]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-l0T2fKeDqnczeNFqFsE8W2+J7386BGaHCbD409sDGOUW3Fhn9FlHkkC4qAnWhieaLqCdnorj+LQAzYM371IXrQ==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-rm43dqf5pw5HV3EineWl4IBbzg3Iwuiucl614AyhLHmSHTf6/AJJID7rqwM8Qbhe2abM+9NT+2WI9HRM1ZtkJA==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-QzNVcCdq6j4LYOtLUDEyE9wg8tY8kmbQ6TZrqjYQUD2nebTW24lmzFhdeI3xzUzVN5rRt4js1UnL1cPCT5HrSw==}
- engines: {node: '>= 10'}
- cpu: [ppc64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-7jpyKpBX0LpklkmGBzz1cQJ/QRN+E6h1xSZVeN6KCtLBrCd6LCX3owZMRzSYmdpI6Zr30DrWo0HOUZiKMzgzBg==}
- engines: {node: '>= 10'}
- cpu: [riscv64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-ngUxVZIytn2UHY92RnijtT11VhWO32mfa1LFX03GWMWdQl50bV/IqcZR0WYRWlBCd7DZrOf16AY2IR/lwovE7A==}
- engines: {node: '>= 10'}
- cpu: [s390x]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-mUGH8hpWJU4FXhn61cD7sHTUEBiWU5JYOhh6ErCIZ0BOoBH/0kYPptfqvJA6G9EfVIcfbtYKxJYYtFC5sbf+eA==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-ysM4mYSfWGO2h8YZVn0GH7zMZX42hU0h7IomC4/oBJmAk5BIlOGnRB8XQmyz1A7neSi6aByjAlZmW4CrZlI9Uw==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-MyDIU8a6jJqhK4L1ISFrb9OeKaGlI3FptCo2JFoEWYaenWHRwEepFqkyuECeIe34xtU2jtJcpXhEtpnCxuAE1Q==}
- engines: {node: '>=14.0.0'}
- cpu: [wasm32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-GqoJu7iL7OTqkBQGLps7rXQHZ5sdcZF7tOY06rlYO03ZNkUCjhNpmkuUsPXVnGstqgoGwzMNW6TcSsO/YWotEw==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-cnExNqWKl0JkLcKlFVuqUrTuQsYP8nstWGT3fz7mPhgqHFOgGmd1l9tDFhqgul7Kt0QTddZRbKl6jlkV7DjSQw==}
- engines: {node: '>= 10'}
- cpu: [ia32]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-15SoQgMgktF73ZnLQPkzCwtxyQ+4VuD8n5Puis1H48QRjUNnXXpqTGFyWdLPdd14vcxbndgcYvJtSjOXTfNHiw==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-C53oqFQESm5XkjFKJpXtBXYm2ZiwvrQrsgM1K+/itmSXyQYa4NpB7m0W/peF8riXpxHUt6ycOeMK9rp2enTchQ==}
- engines: {node: '>= 10'}
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-oEntU16IkWykPJnSwv/VIICzIt2SwEsz45z2Ab+EXOas10EB+pu0z31AiSNI5pr1CaJcadbf1JGMI9aOtbAuRQ==}
- engines: {node: '>= 10'}
- cpu: [arm]
- os: [android]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-b2X7nQ/wH2VGzzl4KhVOR/gHqxIuqrUjMY8VKJYxAGdCrmUPRfc47kersiu6DG706kSv9T+BxeeUQvwqnXZRXQ==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [android]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-m1Ug1452/DOUbJGSuJuHRTUCBQOXY0arGqXCHuSiaQhBQQjgBhlbHWCv291gV8CytFYd5lvSyiG2gFUU26Qd7A==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [darwin]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-1RiC53g1y4pxX7P2L9sbZcqsw6dfXvGnTNwXHDjg4ATZncZa7uoPUWa7aHAGcQm8ZBO4P0ICt2SHOepstDWWTg==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [darwin]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-uLaYn+eO3ZY2ojbohdlRFcuqYP+j2alovtuLdFvCzzsArg4DSnmcJvEQ+I4l99lfyThYB1c8GA64oxSOfmn/UA==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [freebsd]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-PhGIaT45i1Fj5iY6NiWYTLPUOHb7rXiwnqKhco+IXOeIclaGcEVoAbhrLiLGQrfv9viLdyhzAxECoOr+zKnApw==}
- engines: {node: '>= 10'}
- cpu: [arm]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-syDburynsi2WxhD0hVUfNDpRowG+3Luiv2BKiYOUEwMZy6E/By1vQCn2NbLAqoPxaE9N/4Cp3xcW+Hn+CZ2EFA==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-KlrlAxNaZbWvGKgr4g4Cm5dRdwlogBaF3fvysaqR0kT8pA4ODBHtjsbx+ErhrQNDfg6QZIEfmFn3lrsTG/lqUA==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-IbB4I8RFcvKI/zGsboUQPmlKoXfXgNOMiJw7Cbe7T1OBeYzDy6n/yEUEaG4zIbocxqjRVsF4ElrW1V/0Ihlqzg==}
- engines: {node: '>= 10'}
- cpu: [ppc64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-Tl4HSo07u3TLsNQ4KEVfYKdHVNfF/k0o5KQlyGnePiO34Kb+NfaqSKMspjSkrmXKEc0PjB+u9af3BZdTUwml4Q==}
- engines: {node: '>= 10'}
- cpu: [s390x]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-Xe57Yz4MKSeG6HGECiIHuBKFwAuqs2fzwblTdMd1CoSgaaUc/K/dKTDWZwPtjC0Hh5pM86K0WZuwggbsjmFGNg==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-VA4RXspXyelNAtaFEf2ZLnTYXRILVlH20OGV0oqzuUcQzpwEwK2cJbYtYHK+yCYpxrNbEGsAwN+12LYJMW+NlA==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-yPMq3jMldKOi6rbbhKp+7zfaRsA2toIfRV7TbqSzwz64S5euiMrsZQcrq3F9oTtFu4wCSLo83IsNdgoVuiy44g==}
- engines: {node: '>=14.0.0'}
- cpu: [wasm32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-VdUjZK8jh6mvGRiurK3ms6Yt2hbBbtYjzKCn78Mnme2KGC585Kx1jXl7HShvreCgqh3r0162OSygoE7d/I0Jlw==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-8d/4iRXROPXLoe+4FEqXkpgP2KD9A45VUf76WfT6nXZwzQuoh+9WCJNRPVs5vfXV1SMnG9Z32WNc2ivCq0+HZw==}
- engines: {node: '>= 10'}
- cpu: [ia32]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-HHtL1g0niVa4xDvyfi9wQtCTDDKkhDlaOb3bmayTqWs29mk+pcVHBST3OdXaaViSaduqdG9meosU5sOj5iKQAQ==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-4sE8bFyOQFKcjWwBoBMtB+YIgKTqQFOFQZWKJP54jENpFulw8cieBaYoA3bbKCCFxXl2jCFulFKDtDErPWULTg==}
- engines: {node: '>= 10'}
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-KVlQ/jgywZpixGCKMNwxStmmbYEMyokZpCf2YuIChhfJA2uqfAKNEM8INz7zzTo55iEXfBhIIs3VqYyqzDLj8g==}
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-Ks0hplmrYatIjSi8XeTObCi0x13AOQD41IQXpBjrz+UK71gDkbxyLWO7B/ckuels3mC1DW3OCQCv+q0lPnaG/A==}
- engines: {node: '>= 10'}
- cpu: [arm]
- os: [android]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-Ppu1/YGLSC/ohkOA8R5YfDh1dCuCHWJObu/BTorAY55YDXIiWy400CoungbYwoRT53K+ixNrg8/zRHnpuqwkRg==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [android]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-EUU7NvmmKASMLecu7hUHhv9XN2Thf8j+2/zCCMuFuAAlY+eZiOVfrajbZ/RE8CZ4oyfkb0bWFg/CQcmcXAatTw==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [darwin]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-hlX21sqy0AEnmn2abarmCXV3fpyIQN+fKqeHNuawti9ZpaJCL6gZCtUGqpUxURjXNjXSI8rywInJE2YmeVQSJQ==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [darwin]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-T9SOSfIgrdEGQzzquKMOfD3PF6TxG5hL2o5voZtLUALA0yjO+GnpFyv8tAcxKYd7ngWzzK5Uwk7e1z9PcsQZMg==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [freebsd]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-qHNLY0GLTZK8M/cQOy2OAaRDfk3YOlWAwlAO4KSIAseuXHAaGya3Ay//kbmwzzs8h6TKf/eAeXDwcGxze5ecxw==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-54BWWTg5I9n77PRUKErBe3BKqkmbjm0GRpUKJgGdlcessC9Oxa/yVDy2BPtmJP1pQR3VabkXR63H+ZGaH5qKxw==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-wpRkiy0QBM/zpaGAn5I1HfddQul0vGrdlindT2UHtOYK1zvam524M6LJXBtmhBkXS5a4F2HZiZXns8Wuc7dq4w==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-Ua94ruWB18uKyIz/nj+by2ZxfBbFzbqiiD564ocBHGbrUffpR6Us74uVwxO7rImc/WvCfJqap9ezqmaTvmK7SA==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [linux]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-gWVdt1UK575VKTnFRcYTe0qMZA5bFV2w69qDAhX8hG6tajjxbVyvu4jgsYvv/bJrBrxFsNbXMlEU1d0X7iWziA==}
- engines: {node: '>=14.0.0'}
- cpu: [wasm32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-1kv+DM7z6c9OLcjMtO1/kfdxS5hwXtW1OLIHBU41dtKz5jD3quapYrCjB7AVEZh/JVM765UaLOl31huVucJjRw==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-OwcyXtU2Zi3YVHYjmomM3u7jRNPY1j+IPehqCVEqd60jOTOXRZNPGoAvOC7Lw6HX/RGzOJnIcJZbVfKrz5WN1g==}
- engines: {node: '>= 10'}
- cpu: [ia32]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-xat6gnp/G/WCe6U6HKzawotz9zpqsM5a+Dx+S0MPX4AKP7+oztC2/6tkp8KtOPT2bMRMekNntXadHKk0XqW61Q==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [win32]
-
- '@napi-rs/[email protected]':
- resolution: {integrity: sha512-GL43zmDN6AFmomd7eTJOdZkXDvocucjqJcBs/IY51ZTxHvBeb1SXTM0/rI2VJ7C3FTiyATTt2D8chonCi0UTgw==}
- engines: {node: '>= 10'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==}
- engines: {node: '>= 20'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-oNXsh2ywth5aowwIa7RKtawnkdH6LgU1ztfP9AIUCQCvzysB+WeU8o2kyyosDPwBZutPpjZDKPQGIzzrfTWweQ==}
- engines: {node: '>= 20'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-hoYicJZaqISMAI3JfaDr1qMNi48OctWuOih1m80bkYow/ayPw6Jj52tqWJ6GEoFTk1gBqfanSoI1iY99Z5+ekQ==}
- engines: {node: '>= 20'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-j1nQNU1ZxNFx2ZtKmL4sMrs4egy5h65OMDmSbVyuCzjOcwsHq6EaYjOTGXPQxgfiN8dJ4CriYHk6zF050WEULg==}
- engines: {node: '>= 20'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-q9iQGlZlxAVNRN2jDNskJW/Cafy7/XE52wjZ5TTvyhyOD904Cvx//DNyoO3J/MXJ0ve3rPoNWKEg5iZrisQSuw==}
- engines: {node: '>= 20'}
- peerDependencies:
- '@octokit/core': '>=6'
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q==}
- engines: {node: '>= 20'}
- peerDependencies:
- '@octokit/core': '>=6'
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-kJVUQk6/dx/gRNLWUnAWKFs1kVPn5O5CYZyssyEoNYaFedqZxsfYs7DwI3d67hGz4qOwaJ1dpm07hOAD1BXx6g==}
- engines: {node: '>= 20'}
- peerDependencies:
- '@octokit/core': '>=6'
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-KRA7VTGdVyJlh0cP5Tf94hTiYVVqmt2f3I6mnimmaVz4UG3gQV/k4mDJlJv3X67iX6rmN7gSHCF8ssqeMnmhZg==}
- engines: {node: '>= 20'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-V6jhKokg35vk098iBqp2FBKunk3kMTXlmq+PtbV9Gl3TfskWlebSofU9uunVKhUN7xl+0+i5vt0TGTG8/p/7HA==}
- engines: {node: '>= 20'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-z6tmTu9BTnw51jYGulxrlernpsQYXpui1RK21vmXn8yF5bp6iX16yfTtJYGK5Mh1qDkvDOmp2n8sRMcQmR8jiA==}
- engines: {node: '>= 20'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==}
-
- '@tsconfig/[email protected]':
- resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==}
-
- '@tsconfig/[email protected]':
- resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
-
- '@tsconfig/[email protected]':
- resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
-
- '@tsconfig/[email protected]':
- resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
-
- '@tybys/[email protected]':
- resolution: {integrity: sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==}
-
- '@types/[email protected]':
- resolution: {integrity: sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==}
-
- resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==}
- engines: {node: '>=0.4.0'}
-
- resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==}
- engines: {node: '>=0.4.0'}
- hasBin: true
-
- resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
-
- resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
-
- resolution: {integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==}
-
- resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==}
-
- resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==}
- engines: {node: '>= 12'}
-
- resolution: {integrity: sha512-CXkMQxU6s9GklO/1f714dkKBMu1lopS1WFF0B8o4AxPykR1hpozxSiUZ5ZUeBjfPgCWqbcNOtZVFhB8Lkfp1+Q==}
- peerDependencies:
- typanion: '*'
-
- resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
- engines: {node: '>=7.0.0'}
-
- resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
-
- resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
-
- resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
-
- resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==}
- engines: {node: '>=6.0'}
- peerDependencies:
- supports-color: '*'
- peerDependenciesMeta:
- supports-color:
- optional: true
-
- resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
- engines: {node: '>=0.3.1'}
-
- resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
-
- resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==}
-
- resolution: {integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==}
- engines: {node: '>=18'}
-
- resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
- hasBin: true
-
- resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==}
- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
-
- resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
-
- resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
-
- resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
-
- resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==}
- engines: {node: ^18.17.0 || >=20.5.0}
-
- resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==}
- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
-
- resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==}
- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
-
- resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==}
- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
-
- resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
-
- resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==}
- engines: {node: '>=10'}
- hasBin: true
-
- resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
- engines: {node: '>=14'}
-
- resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
- engines: {node: '>=0.6.0'}
-
- resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
- hasBin: true
- peerDependencies:
- '@swc/core': '>=1.2.50'
- '@swc/wasm': '>=1.2.50'
- '@types/node': '*'
- typescript: '>=2.7'
- peerDependenciesMeta:
- '@swc/core':
- optional: true
- '@swc/wasm':
- optional: true
-
- resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
-
- resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==}
-
- resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==}
- engines: {node: '>=14.17'}
- hasBin: true
-
- resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==}
-
- resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==}
- engines: {node: '>=18'}
-
- resolution: {integrity: sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==}
-
- resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
-
- resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==}
- engines: {node: '>=12.20'}
-
- resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==}
- engines: {node: '>=18'}
-
-snapshots:
-
- '@cspotcode/[email protected]':
- dependencies:
- '@jridgewell/trace-mapping': 0.3.9
-
- '@emnapi/[email protected]':
- dependencies:
- '@emnapi/wasi-threads': 1.0.4
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@emnapi/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/figures': 1.0.13
- '@inquirer/type': 3.0.8(@types/[email protected])
- ansi-escapes: 4.3.2
- yoctocolors-cjs: 2.1.2
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/type': 3.0.8(@types/[email protected])
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/figures': 1.0.13
- '@inquirer/type': 3.0.8(@types/[email protected])
- ansi-escapes: 4.3.2
- cli-width: 4.1.0
- mute-stream: 2.0.0
- signal-exit: 4.1.0
- wrap-ansi: 6.2.0
- yoctocolors-cjs: 2.1.2
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/type': 3.0.8(@types/[email protected])
- external-editor: 3.1.0
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/type': 3.0.8(@types/[email protected])
- yoctocolors-cjs: 2.1.2
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected]': {}
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/type': 3.0.8(@types/[email protected])
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/type': 3.0.8(@types/[email protected])
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/type': 3.0.8(@types/[email protected])
- ansi-escapes: 4.3.2
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/checkbox': 4.2.0(@types/[email protected])
- '@inquirer/confirm': 5.1.14(@types/[email protected])
- '@inquirer/editor': 4.2.15(@types/[email protected])
- '@inquirer/expand': 4.0.17(@types/[email protected])
- '@inquirer/input': 4.2.1(@types/[email protected])
- '@inquirer/number': 3.0.17(@types/[email protected])
- '@inquirer/password': 4.0.17(@types/[email protected])
- '@inquirer/rawlist': 4.1.5(@types/[email protected])
- '@inquirer/search': 3.1.0(@types/[email protected])
- '@inquirer/select': 4.3.1(@types/[email protected])
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/type': 3.0.8(@types/[email protected])
- yoctocolors-cjs: 2.1.2
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/figures': 1.0.13
- '@inquirer/type': 3.0.8(@types/[email protected])
- yoctocolors-cjs: 2.1.2
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- dependencies:
- '@inquirer/core': 10.1.15(@types/[email protected])
- '@inquirer/figures': 1.0.13
- '@inquirer/type': 3.0.8(@types/[email protected])
- ansi-escapes: 4.3.2
- yoctocolors-cjs: 2.1.2
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@inquirer/[email protected](@types/[email protected])':
- optionalDependencies:
- '@types/node': 24.2.0
-
- '@jridgewell/[email protected]': {}
-
- '@jridgewell/[email protected]': {}
-
- '@jridgewell/[email protected]':
- dependencies:
- '@jridgewell/resolve-uri': 3.1.2
- '@jridgewell/sourcemap-codec': 1.5.4
-
- dependencies:
- '@inquirer/prompts': 7.8.0(@types/[email protected])
- '@napi-rs/cross-toolchain': 1.0.0
- '@napi-rs/wasm-tools': 1.0.0
- '@octokit/rest': 22.0.0
- clipanion: 4.0.0-rc.4([email protected])
- colorette: 2.0.20
- debug: 4.4.1
- find-up: 7.0.0
- js-yaml: 4.1.0
- lodash-es: 4.17.21
- semver: 7.7.2
- typanion: 3.14.0
- optionalDependencies:
- '@emnapi/runtime': 1.4.5
- transitivePeerDependencies:
- - '@napi-rs/cross-toolchain-arm64-target-aarch64'
- - '@napi-rs/cross-toolchain-arm64-target-armv7'
- - '@napi-rs/cross-toolchain-arm64-target-x86_64'
- - '@napi-rs/cross-toolchain-x64-target-aarch64'
- - '@napi-rs/cross-toolchain-x64-target-armv7'
- - '@napi-rs/cross-toolchain-x64-target-x86_64'
- - '@types/node'
- - supports-color
-
- '@napi-rs/[email protected]':
- dependencies:
- '@napi-rs/lzma': 1.4.4
- '@napi-rs/tar': 1.0.0
- debug: 4.4.1
- transitivePeerDependencies:
- - supports-color
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- dependencies:
- '@napi-rs/wasm-runtime': 1.0.1
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optionalDependencies:
- '@napi-rs/lzma-android-arm-eabi': 1.4.4
- '@napi-rs/lzma-android-arm64': 1.4.4
- '@napi-rs/lzma-darwin-arm64': 1.4.4
- '@napi-rs/lzma-darwin-x64': 1.4.4
- '@napi-rs/lzma-freebsd-x64': 1.4.4
- '@napi-rs/lzma-linux-arm-gnueabihf': 1.4.4
- '@napi-rs/lzma-linux-arm64-gnu': 1.4.4
- '@napi-rs/lzma-linux-arm64-musl': 1.4.4
- '@napi-rs/lzma-linux-ppc64-gnu': 1.4.4
- '@napi-rs/lzma-linux-riscv64-gnu': 1.4.4
- '@napi-rs/lzma-linux-s390x-gnu': 1.4.4
- '@napi-rs/lzma-linux-x64-gnu': 1.4.4
- '@napi-rs/lzma-linux-x64-musl': 1.4.4
- '@napi-rs/lzma-wasm32-wasi': 1.4.4
- '@napi-rs/lzma-win32-arm64-msvc': 1.4.4
- '@napi-rs/lzma-win32-ia32-msvc': 1.4.4
- '@napi-rs/lzma-win32-x64-msvc': 1.4.4
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- dependencies:
- '@napi-rs/wasm-runtime': 1.0.1
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optionalDependencies:
- '@napi-rs/tar-android-arm-eabi': 1.0.0
- '@napi-rs/tar-android-arm64': 1.0.0
- '@napi-rs/tar-darwin-arm64': 1.0.0
- '@napi-rs/tar-darwin-x64': 1.0.0
- '@napi-rs/tar-freebsd-x64': 1.0.0
- '@napi-rs/tar-linux-arm-gnueabihf': 1.0.0
- '@napi-rs/tar-linux-arm64-gnu': 1.0.0
- '@napi-rs/tar-linux-arm64-musl': 1.0.0
- '@napi-rs/tar-linux-ppc64-gnu': 1.0.0
- '@napi-rs/tar-linux-s390x-gnu': 1.0.0
- '@napi-rs/tar-linux-x64-gnu': 1.0.0
- '@napi-rs/tar-linux-x64-musl': 1.0.0
- '@napi-rs/tar-wasm32-wasi': 1.0.0
- '@napi-rs/tar-win32-arm64-msvc': 1.0.0
- '@napi-rs/tar-win32-ia32-msvc': 1.0.0
- '@napi-rs/tar-win32-x64-msvc': 1.0.0
-
- '@napi-rs/[email protected]':
- dependencies:
- '@emnapi/core': 1.4.5
- '@emnapi/runtime': 1.4.5
- '@tybys/wasm-util': 0.10.0
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- dependencies:
- '@napi-rs/wasm-runtime': 1.0.1
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optional: true
-
- '@napi-rs/[email protected]':
- optionalDependencies:
- '@napi-rs/wasm-tools-android-arm-eabi': 1.0.0
- '@napi-rs/wasm-tools-android-arm64': 1.0.0
- '@napi-rs/wasm-tools-darwin-arm64': 1.0.0
- '@napi-rs/wasm-tools-darwin-x64': 1.0.0
- '@napi-rs/wasm-tools-freebsd-x64': 1.0.0
- '@napi-rs/wasm-tools-linux-arm64-gnu': 1.0.0
- '@napi-rs/wasm-tools-linux-arm64-musl': 1.0.0
- '@napi-rs/wasm-tools-linux-x64-gnu': 1.0.0
- '@napi-rs/wasm-tools-linux-x64-musl': 1.0.0
- '@napi-rs/wasm-tools-wasm32-wasi': 1.0.0
- '@napi-rs/wasm-tools-win32-arm64-msvc': 1.0.0
- '@napi-rs/wasm-tools-win32-ia32-msvc': 1.0.0
- '@napi-rs/wasm-tools-win32-x64-msvc': 1.0.0
-
- '@octokit/[email protected]': {}
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/auth-token': 6.0.0
- '@octokit/graphql': 9.0.1
- '@octokit/request': 10.0.3
- '@octokit/request-error': 7.0.0
- '@octokit/types': 14.1.0
- before-after-hook: 4.0.0
- universal-user-agent: 7.0.3
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/types': 14.1.0
- universal-user-agent: 7.0.3
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/request': 10.0.3
- '@octokit/types': 14.1.0
- universal-user-agent: 7.0.3
-
- '@octokit/[email protected]': {}
-
- '@octokit/[email protected](@octokit/[email protected])':
- dependencies:
- '@octokit/core': 7.0.3
- '@octokit/types': 14.1.0
-
- '@octokit/[email protected](@octokit/[email protected])':
- dependencies:
- '@octokit/core': 7.0.3
-
- '@octokit/[email protected](@octokit/[email protected])':
- dependencies:
- '@octokit/core': 7.0.3
- '@octokit/types': 14.1.0
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/types': 14.1.0
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/endpoint': 11.0.0
- '@octokit/request-error': 7.0.0
- '@octokit/types': 14.1.0
- fast-content-type-parse: 3.0.0
- universal-user-agent: 7.0.3
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/core': 7.0.3
- '@octokit/plugin-paginate-rest': 13.1.1(@octokit/[email protected])
- '@octokit/plugin-request-log': 6.0.0(@octokit/[email protected])
- '@octokit/plugin-rest-endpoint-methods': 16.0.0(@octokit/[email protected])
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/openapi-types': 25.1.0
-
- '@tsconfig/[email protected]': {}
-
- '@tsconfig/[email protected]': {}
-
- '@tsconfig/[email protected]': {}
-
- '@tsconfig/[email protected]': {}
-
- '@tybys/[email protected]':
- dependencies:
- tslib: 2.8.1
- optional: true
-
- '@types/[email protected]':
- dependencies:
- undici-types: 7.10.0
-
- dependencies:
- acorn: 8.15.0
-
-
- dependencies:
- type-fest: 0.21.3
-
-
- dependencies:
- color-convert: 2.0.1
-
-
-
-
-
-
- dependencies:
- typanion: 3.14.0
-
- dependencies:
- color-name: 1.1.4
-
-
-
-
- dependencies:
- ms: 2.1.3
-
-
-
- dependencies:
- chardet: 0.7.0
- iconv-lite: 0.4.24
- tmp: 0.0.33
-
-
- dependencies:
- locate-path: 7.2.0
- path-exists: 5.0.0
- unicorn-magic: 0.1.0
-
- dependencies:
- safer-buffer: 2.1.2
-
-
- dependencies:
- argparse: 2.0.1
-
- dependencies:
- p-locate: 6.0.0
-
-
-
-
-
-
- dependencies:
- yocto-queue: 1.2.1
-
- dependencies:
- p-limit: 4.0.0
-
-
-
-
-
- dependencies:
- emoji-regex: 8.0.0
- is-fullwidth-code-point: 3.0.0
- strip-ansi: 6.0.1
-
- dependencies:
- ansi-regex: 5.0.1
-
- dependencies:
- os-tmpdir: 1.0.2
-
- dependencies:
- '@cspotcode/source-map-support': 0.8.1
- '@tsconfig/node10': 1.0.11
- '@tsconfig/node12': 1.0.11
- '@tsconfig/node14': 1.0.3
- '@tsconfig/node16': 1.0.4
- '@types/node': 24.2.0
- acorn: 8.15.0
- acorn-walk: 8.3.4
- arg: 4.1.3
- create-require: 1.1.1
- diff: 4.0.2
- make-error: 1.3.6
- typescript: 5.9.2
- v8-compile-cache-lib: 3.0.1
- yn: 3.1.1
-
- optional: true
-
-
-
-
-
-
-
-
- dependencies:
- ansi-styles: 4.3.0
- string-width: 4.2.3
- strip-ansi: 6.0.1
-
-
-
diff --git a/bindings/ts-napi/tsconfig.json b/bindings/ts-napi/tsconfig.json
deleted file mode 100644
index e2fd5a394..000000000
--- a/bindings/ts-napi/tsconfig.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "compilerOptions": {
- "target": "es2020",
- "module": "commonjs",
- "moduleResolution": "node",
- "strict": true,
- "esModuleInterop": true,
- "outDir": "dist",
- "types": [
- "node"
- ]
- }
-}
\ No newline at end of file
diff --git a/bindings/ts/README.md b/bindings/ts/README.md
deleted file mode 100644
index 42ad72483..000000000
--- a/bindings/ts/README.md
+++ /dev/null
@@ -1,109 +0,0 @@
-<p align="center">
- <picture>
- <img alt="Mirai" src="https://artifacts.trymirai.com/social/github/uzu-typescript.jpg" style="max-width: 100%;">
- </picture>
-</p>
-
-<a href="https://discord.com/invite/trymirai"><img src="https://img.shields.io/discord/1377764166764462120?label=Discord" alt="Discord"></a>
-<a href="mailto:[email protected]?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-green" alt="Contact us"></a>
-<a href="https://docs.trymirai.com/app-integration/overview"><img src="https://img.shields.io/badge/Read-Docs-blue" alt="Read docs"></a>
-[![npm (scoped)](https://img.shields.io/npm/v/%40trymirai%2Fuzu)](https://www.npmjs.com/package/@trymirai/uzu)
-[![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
-
-# uzu-ts
-
-Node package for [uzu](https://github.com/trymirai/uzu), a **high-performance** inference engine for AI models on Apple Silicon. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. You don’t need an ML team or weeks of setup - one developer can handle everything in minutes. Key features:
-
-- Simple, high-level API
-- Specialized configurations with significant performance boosts for common use cases like classification and summarization
-- [Broad model support](https://trymirai.com/models)
-
-## Quick Start
-
-Add the `uzu` dependency to your project's `package.json`:
-
-```json
-"dependencies": {
- "@trymirai/uzu": "{{VERSION}}"
-}
-```
-
-Run the snippet below:
-
-```ts
-// include:examples/snippets.ts#quick-start
-```
-
-Everything from model downloading to inference configuration is handled automatically. Refer to the [documentation](https://docs.trymirai.com) for details on how to customize each step of the process.
-
-## Examples
-
-Install dependencies:
-
-```bash
-pnpm i
-```
-
-Run it using one of the following commands:
-
-```bash
-pnpm run tsn examples/chat.ts
-pnpm run tsn examples/chatForSummarization.ts
-pnpm run tsn examples/chatForClassification.ts
-pnpm run tsn examples/cloud.ts
-pnpm run tsn examples/structuredOutput.ts
-pnpm run tsn examples/classifier.ts
-pnpm run tsn examples/textToSpeech.ts
-```
-
-### Chat
-
-In this example, we will download a model and get a reply to a specific list of messages:
-
-```ts
-// include:examples/chat.ts
-```
-
-### Summarization
-
-In this example, we will use the `summarization` preset to generate a summary of the input text:
-
-```ts
-// include:examples/chatForSummarization.ts
-```
-
-You will notice that the model’s run count is lower than the actual number of generated tokens due to speculative decoding, which significantly improves generation speed.
-
-### Classification
-
-In this example, we will use the `classification` preset to determine the sentiment of the user's input:
-
-```ts
-// include:examples/chatForClassification.ts
-```
-
-You can view the stats to see that the answer will be ready immediately after the prefill step, and actual generation won’t even start due to speculative decoding, which significantly improves generation speed.
-
-### Cloud
-
-Sometimes you want to create a complex pipeline where some requests are processed on-device and the more complex ones are handled in the cloud using a larger model. With `uzu`, you can do this easily: just choose the cloud model you want to use and perform all requests through the same API:
-
-```ts
-// include:examples/cloud.ts
-```
-
-### Structured Output
-
-Sometimes you want the generated output to be valid JSON with predefined fields. You can use `Grammar` to manually specify a JSON schema, or define the schema using [Zod](https://github.com/colinhacks/zod).
-
-```ts
-// include:examples/structuredOutput.ts
-```
-
-## Troubleshooting
-
-If you experience any problems, please contact us via [Discord](https://discord.com/invite/trymirai) or [email](mailto:[email protected]).
-
-## License
-
-This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
diff --git a/bindings/ts/examples/snippets.ts b/bindings/ts/examples/snippets.ts
deleted file mode 100644
index e9d497bfc..000000000
--- a/bindings/ts/examples/snippets.ts
+++ /dev/null
@@ -1,168 +0,0 @@
-import { ChatConfig, ChatMessage, ChatReplyConfig, ChatSpeculationPresetClassification, ChatSpeculationPresetSummarization, Engine, EngineConfig, Feature, ReasoningEffort, SamplingMethodGreedy } from '@trymirai/uzu';
-
-async function quickStartExample() {
- // snippet:quick-start
- let engineConfig = EngineConfig.create();
- let engine = await Engine.create(engineConfig);
-
- let model = await engine.model('Qwen/Qwen3-0.6B');
- if (!model) {
- throw new Error('Model not found');
- }
- for await (const update of await engine.download(model)) {
- console.log('Download progress:', update.progress);
- }
-
- let messages = [
- ChatMessage.system().withText('You are a helpful assistant'),
- ChatMessage.user().withText('Tell me a short, funny story about a robot')
- ];
-
- let session = await engine.chat(model, ChatConfig.create());
- let reply = await session.reply(messages, ChatReplyConfig.create());
- let message = reply[0]?.message;
- // endsnippet:quick-start
-
- if (message) {
- console.log('Reasoning: ', message.reasoning);
- console.log('Text: ', message.text);
- }
-}
-
-async function generalExample() {
- // snippet:engine-create
- let engineConfig = EngineConfig.create();
- let engine = await Engine.create(engineConfig);
- // endsnippet:engine-create
-
- // snippet:model-choose
- let model = await engine.model('Qwen/Qwen3-0.6B');
- if (!model) {
- throw new Error('Model not found');
- }
- // endsnippet:model-choose
-
- // snippet:model-download
- for await (const update of await engine.download(model)) {
- console.log('Download progress:', update.progress);
- }
- // endsnippet:model-download
-
- // snippet:session-create-general
- let session = await engine.chat(model, ChatConfig.create());
- // endsnippet:session-create-general
-
- // snippet:session-input-general
- let messages = [
- ChatMessage.system().withText('You are a helpful assistant'),
- ChatMessage.user().withText('Tell me a short, funny story about a robot')
- ];
- // endsnippet:session-input-general
-
- // snippet:session-run-general
- let reply = await session.reply(messages, ChatReplyConfig.create());
- let message = reply[0]?.message;
- // endsnippet:session-run-general
-
- if (message) {
- console.log('Reasoning: ', message.reasoning);
- console.log('Text: ', message.text);
- }
-}
-
-async function summarizationExample() {
- let engineConfig = EngineConfig.create();
- let engine = await Engine.create(engineConfig);
-
- let model = await engine.model('Qwen/Qwen3-0.6B');
- if (!model) {
- throw new Error('Model not found');
- }
- for await (const update of await engine.download(model)) {
- console.log('Download progress:', update.progress);
- }
-
- // snippet:session-input-summarization
- const textToSummarize =
- "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. These models have a wide range of applications, including chatbots, content creation, translation, and code generation. One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. As these models grow in size and sophistication, they continue to enhance human-computer interactions, making AI-powered communication more natural and effective.";
- const prompt = `Text is: "${textToSummarize}". Write only summary itself.`;
- let messages = [
- ChatMessage.system().withReasoningEffort("Disabled" as ReasoningEffort),
- ChatMessage.user().withText(prompt)
- ];
- // endsnippet:session-input-summarization
-
- // snippet:session-create-summarization
- let chatConfig = ChatConfig.create().withSpeculationPreset(new ChatSpeculationPresetSummarization);
- let session = await engine.chat(model, chatConfig);
- // endsnippet:session-create-summarization
-
- // snippet:session-run-summarization
- let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(256).withSamplingMethod(new SamplingMethodGreedy());
- let reply = (await session.reply(messages, chatReplyConfig))[0];
- // endsnippet:session-run-summarization
-
- if (reply) {
- console.log('Summary: ', reply.message.text);
- console.log('Generation t\\s: ', reply.stats.generateTokensPerSecond);
- }
-}
-
-async function classificationExample() {
- let engineConfig = EngineConfig.create();
- let engine = await Engine.create(engineConfig);
-
- let model = await engine.model('Qwen/Qwen3-0.6B');
- if (!model) {
- throw new Error('Model not found');
- }
- for await (const update of await engine.download(model)) {
- console.log('Download progress:', update.progress);
- }
-
- // snippet:session-create-classification
- const feature = new Feature('sentiment', [
- 'Happy',
- 'Sad',
- 'Angry',
- 'Fearful',
- 'Surprised',
- 'Disgusted',
- ]);
- let chatConfig = ChatConfig.create().withSpeculationPreset(new ChatSpeculationPresetClassification(feature));
- let session = await engine.chat(model, chatConfig);
- // endsnippet:session-create-classification
-
- // snippet:session-input-classification
- const textToDetectFeature =
- "Today's been awesome! Everything just feels right, and I can't stop smiling.";
- const prompt =
- `Text is: "${textToDetectFeature}". Choose ${feature.name} from the list: ${feature.values.join(', ')}. ` +
- "Answer with one word. Don't add a dot at the end.";
- let messages = [
- ChatMessage.system().withReasoningEffort("Disabled" as ReasoningEffort),
- ChatMessage.user().withText(prompt)
- ];
- // endsnippet:session-input-classification
-
- // snippet:session-run-classification
- let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(32).withSamplingMethod(new SamplingMethodGreedy());
- let reply = (await session.reply(messages, chatReplyConfig))[0];
- // endsnippet:session-run-classification
-
- if (reply) {
- console.log('Prediction: ', reply.message.text);
- console.log('Generated tokens: ', reply.stats.tokensCountOutput);
- }
-}
-
-async function main() {
- await quickStartExample();
- await generalExample();
- await summarizationExample();
- await classificationExample();
-}
-
-main().catch((error) => {
- console.error(error);
-});
diff --git a/bindings/ts/examples/ssm.ts b/bindings/ts/examples/ssm.ts
deleted file mode 100644
index ce623c276..000000000
--- a/bindings/ts/examples/ssm.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig } from '@trymirai/uzu';
-
-async function main() {
- let engineConfig = EngineConfig.create();
- let engine = await Engine.create(engineConfig);
-
- let model = await engine.model('cartesia-ai/Llamba-1B-4bit-mlx');
- if (!model) {
- throw new Error('Model not found');
- }
- for await (const update of await engine.download(model)) {
- console.log('Download progress:', update.progress);
- }
-
- let messages = [
- ChatMessage.user().withText('Tell me a short, funny story about a robot')
- ];
-
- let session = await engine.chat(model, ChatConfig.create());
- let reply = await session.reply(messages, ChatReplyConfig.create());
- let message = reply[0]?.message;
- if (message) {
- console.log('Text: ', message.text);
- }
-}
-
-main().catch((error) => {
- console.error(error);
-});
diff --git a/bindings/ts/src/index.ts b/bindings/ts/src/index.ts
deleted file mode 100644
index 99f59e1c5..000000000
--- a/bindings/ts/src/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './napi/uzu';
diff --git a/bindings/ts/src/napi/uzu.js b/bindings/ts/src/napi/uzu.js
deleted file mode 100644
index 6ead57beb..000000000
--- a/bindings/ts/src/napi/uzu.js
+++ /dev/null
@@ -1,317 +0,0 @@
-// Auto-generated NAPI wrapper for uzu native module
-// Currently supports only Apple Silicon (arm64) on macOS
-// Other platforms may be added in future releases
-
-const { createRequire } = require('module');
-
-const require_ = createRequire(__filename);
-
-// Check for Apple Silicon support only
-if (process.platform !== 'darwin' || process.arch !== 'arm64') {
- throw new Error(`This package only supports Apple Silicon (arm64) on macOS. Current platform: ${process.platform}-${process.arch}`);
-}
-
-let nativeBinding = null;
-
-try {
- nativeBinding = require_('./uzu.node');
-} catch (e) {
- throw new Error(`Failed to load native binding: ${e.message}`);
-}
-
-// Re-export all runtime exports
-const {
- ChatSession,
- ChatSessionStream,
- ChatSessionStreamChunkError,
- ChatSessionStreamChunkReplies,
- ClassificationSession,
- TextToSpeechSession,
- TextToSpeechSessionStream,
- TextToSpeechSessionStreamChunkError,
- TextToSpeechSessionStreamChunkPcmBatch,
- CancelToken,
- ChatConfig,
- ChatContentBlockAudio,
- ChatContentBlockBuiltinTools,
- ChatContentBlockConversationStartDate,
- ChatContentBlockCustom,
- ChatContentBlockFile,
- ChatContentBlockIdentity,
- ChatContentBlockImage,
- ChatContentBlockKnowledgeCutoff,
- ChatContentBlockReasoning,
- ChatContentBlockReasoningEffort,
- ChatContentBlockText,
- ChatContentBlockToolCall,
- ChatContentBlockToolCallCandidate,
- ChatContentBlockToolCallResult,
- ChatContentBlockTools,
- ChatContentBlockTranslation,
- ChatContentBlockVideo,
- ChatMessage,
- ChatModelCapabilities,
- ChatReply,
- ChatReplyConfig,
- ChatReplyStats,
- ChatRoleAssistant,
- ChatRoleCustom,
- ChatRoleDeveloper,
- ChatRoleSystem,
- ChatRoleTool,
- ChatRoleUser,
- ChatSpeculationPresetClassification,
- ChatSpeculationPresetGeneralChat,
- ChatSpeculationPresetSummarization,
- ClassificationLabel,
- ClassificationMessage,
- ClassificationOutput,
- ClassificationStats,
- ContextLengthCustom,
- ContextLengthDefault,
- ContextLengthMaximal,
- Feature,
- File,
- GrammarJsonAny,
- GrammarJsonSchema,
- GrammarRegex,
- Hash,
- Image,
- Metadata,
- Model,
- ModelAccessibilityLocal,
- ModelAccessibilityRemote,
- ModelBackend,
- ModelFamily,
- ModelProperties,
- ModelQuantization,
- ModelReferenceHuggingFace,
- ModelReferenceLocal,
- ModelReferenceMirai,
- ModelRegistry,
- ModelSpecializationChat,
- ModelSpecializationClassification,
- ModelSpecializationSpeculation,
- ModelSpecializationTextToSpeech,
- ModelSpecializationTranslation,
- ModelVendor,
- PcmBatch,
- Repository,
- SamplingMethodGreedy,
- SamplingMethodStochastic,
- SamplingPolicyCustom,
- SamplingPolicyDefault,
- SamplingSeedCustom,
- SamplingSeedDefault,
- TextToSpeechStats,
- Token,
- ToolCall,
- ToolDescriptionFunction,
- ToolFunction,
- ToolNamespace,
- TranslationPayloadImage,
- TranslationPayloadText,
- Value,
- Device,
- Downloader,
- DownloaderStream,
- DownloaderStreamUpdate,
- DownloadPhaseDownloaded,
- DownloadPhaseDownloading,
- DownloadPhaseError,
- DownloadPhaseLocked,
- DownloadPhaseNotDownloaded,
- DownloadPhasePaused,
- DownloadState,
- Engine,
- EngineCallback,
- EngineConfig,
- Keyring,
- ChatSessionState,
- ClassificationSessionState,
- TextToSpeechSessionState,
- ChatContentBlockType,
- ChatReplyFinishReason,
- ClassificationRole,
- HashMethod,
- ImageFormat,
- ImageTheme,
- ReasoningEffort,
- ChatMessageMetadata,
- ClassificationOutputProbabilities,
- ChatSessionError,
- ChatSessionStreamChunk,
- ClassificationSessionError,
- TextToSpeechSessionError,
- TextToSpeechSessionStreamChunk,
- ChatContentBlock,
- ChatRole,
- ChatSpeculationPreset,
- ContextLength,
- Grammar,
- ModelAccessibility,
- ModelReference,
- ModelSpecialization,
- PcmBatchError,
- SamplingMethod,
- SamplingPolicy,
- SamplingSeed,
- TokenId,
- TokenValue,
- ToolDescription,
- TranslationPayload,
- DeviceError,
- DownloadPhase,
- EngineError,
- KeyringError,
- RegistryError,
- StorageError
-} = nativeBinding;
-
-module.exports = {
- ChatSession,
- ChatSessionStream,
- ChatSessionStreamChunkError,
- ChatSessionStreamChunkReplies,
- ClassificationSession,
- TextToSpeechSession,
- TextToSpeechSessionStream,
- TextToSpeechSessionStreamChunkError,
- TextToSpeechSessionStreamChunkPcmBatch,
- CancelToken,
- ChatConfig,
- ChatContentBlockAudio,
- ChatContentBlockBuiltinTools,
- ChatContentBlockConversationStartDate,
- ChatContentBlockCustom,
- ChatContentBlockFile,
- ChatContentBlockIdentity,
- ChatContentBlockImage,
- ChatContentBlockKnowledgeCutoff,
- ChatContentBlockReasoning,
- ChatContentBlockReasoningEffort,
- ChatContentBlockText,
- ChatContentBlockToolCall,
- ChatContentBlockToolCallCandidate,
- ChatContentBlockToolCallResult,
- ChatContentBlockTools,
- ChatContentBlockTranslation,
- ChatContentBlockVideo,
- ChatMessage,
- ChatModelCapabilities,
- ChatReply,
- ChatReplyConfig,
- ChatReplyStats,
- ChatRoleAssistant,
- ChatRoleCustom,
- ChatRoleDeveloper,
- ChatRoleSystem,
- ChatRoleTool,
- ChatRoleUser,
- ChatSpeculationPresetClassification,
- ChatSpeculationPresetGeneralChat,
- ChatSpeculationPresetSummarization,
- ClassificationLabel,
- ClassificationMessage,
- ClassificationOutput,
- ClassificationStats,
- ContextLengthCustom,
- ContextLengthDefault,
- ContextLengthMaximal,
- Feature,
- File,
- GrammarJsonAny,
- GrammarJsonSchema,
- GrammarRegex,
- Hash,
- Image,
- Metadata,
- Model,
- ModelAccessibilityLocal,
- ModelAccessibilityRemote,
- ModelBackend,
- ModelFamily,
- ModelProperties,
- ModelQuantization,
- ModelReferenceHuggingFace,
- ModelReferenceLocal,
- ModelReferenceMirai,
- ModelRegistry,
- ModelSpecializationChat,
- ModelSpecializationClassification,
- ModelSpecializationSpeculation,
- ModelSpecializationTextToSpeech,
- ModelSpecializationTranslation,
- ModelVendor,
- PcmBatch,
- Repository,
- SamplingMethodGreedy,
- SamplingMethodStochastic,
- SamplingPolicyCustom,
- SamplingPolicyDefault,
- SamplingSeedCustom,
- SamplingSeedDefault,
- TextToSpeechStats,
- Token,
- ToolCall,
- ToolDescriptionFunction,
- ToolFunction,
- ToolNamespace,
- TranslationPayloadImage,
- TranslationPayloadText,
- Value,
- Device,
- Downloader,
- DownloaderStream,
- DownloaderStreamUpdate,
- DownloadPhaseDownloaded,
- DownloadPhaseDownloading,
- DownloadPhaseError,
- DownloadPhaseLocked,
- DownloadPhaseNotDownloaded,
- DownloadPhasePaused,
- DownloadState,
- Engine,
- EngineCallback,
- EngineConfig,
- Keyring,
- ChatSessionState,
- ClassificationSessionState,
- TextToSpeechSessionState,
- ChatContentBlockType,
- ChatReplyFinishReason,
- ClassificationRole,
- HashMethod,
- ImageFormat,
- ImageTheme,
- ReasoningEffort,
- ChatMessageMetadata,
- ClassificationOutputProbabilities,
- ChatSessionError,
- ChatSessionStreamChunk,
- ClassificationSessionError,
- TextToSpeechSessionError,
- TextToSpeechSessionStreamChunk,
- ChatContentBlock,
- ChatRole,
- ChatSpeculationPreset,
- ContextLength,
- Grammar,
- ModelAccessibility,
- ModelReference,
- ModelSpecialization,
- PcmBatchError,
- SamplingMethod,
- SamplingPolicy,
- SamplingSeed,
- TokenId,
- TokenValue,
- ToolDescription,
- TranslationPayload,
- DeviceError,
- DownloadPhase,
- EngineError,
- KeyringError,
- RegistryError,
- StorageError
-};
\ No newline at end of file
diff --git a/bindings/ts/src/napi/uzu.mjs b/bindings/ts/src/napi/uzu.mjs
deleted file mode 100644
index fc67c2f03..000000000
--- a/bindings/ts/src/napi/uzu.mjs
+++ /dev/null
@@ -1,172 +0,0 @@
-// Auto-generated NAPI wrapper for uzu native module
-// Currently supports only Apple Silicon (arm64) on macOS
-// Other platforms may be added in future releases
-
-import { createRequire } from 'module';
-
-const require = createRequire(import.meta.url);
-
-// Check for Apple Silicon support only
-if (process.platform !== 'darwin' || process.arch !== 'arm64') {
- throw new Error(`This package only supports Apple Silicon (arm64) on macOS. Current platform: ${process.platform}-${process.arch}`);
-}
-
-let nativeBinding = null;
-
-try {
- nativeBinding = require('./uzu.node');
-} catch (e) {
- throw new Error(`Failed to load native binding: ${e.message}`);
-}
-
-// Re-export all runtime exports as named exports
-export const {
- ChatSession,
- ChatSessionStream,
- ChatSessionStreamChunkError,
- ChatSessionStreamChunkReplies,
- ClassificationSession,
- TextToSpeechSession,
- TextToSpeechSessionStream,
- TextToSpeechSessionStreamChunkError,
- TextToSpeechSessionStreamChunkPcmBatch,
- CancelToken,
- ChatConfig,
- ChatContentBlockAudio,
- ChatContentBlockBuiltinTools,
- ChatContentBlockConversationStartDate,
- ChatContentBlockCustom,
- ChatContentBlockFile,
- ChatContentBlockIdentity,
- ChatContentBlockImage,
- ChatContentBlockKnowledgeCutoff,
- ChatContentBlockReasoning,
- ChatContentBlockReasoningEffort,
- ChatContentBlockText,
- ChatContentBlockToolCall,
- ChatContentBlockToolCallCandidate,
- ChatContentBlockToolCallResult,
- ChatContentBlockTools,
- ChatContentBlockTranslation,
- ChatContentBlockVideo,
- ChatMessage,
- ChatModelCapabilities,
- ChatReply,
- ChatReplyConfig,
- ChatReplyStats,
- ChatRoleAssistant,
- ChatRoleCustom,
- ChatRoleDeveloper,
- ChatRoleSystem,
- ChatRoleTool,
- ChatRoleUser,
- ChatSpeculationPresetClassification,
- ChatSpeculationPresetGeneralChat,
- ChatSpeculationPresetSummarization,
- ClassificationLabel,
- ClassificationMessage,
- ClassificationOutput,
- ClassificationStats,
- ContextLengthCustom,
- ContextLengthDefault,
- ContextLengthMaximal,
- Feature,
- File,
- GrammarJsonAny,
- GrammarJsonSchema,
- GrammarRegex,
- Hash,
- Image,
- Metadata,
- Model,
- ModelAccessibilityLocal,
- ModelAccessibilityRemote,
- ModelBackend,
- ModelFamily,
- ModelProperties,
- ModelQuantization,
- ModelReferenceHuggingFace,
- ModelReferenceLocal,
- ModelReferenceMirai,
- ModelRegistry,
- ModelSpecializationChat,
- ModelSpecializationClassification,
- ModelSpecializationSpeculation,
- ModelSpecializationTextToSpeech,
- ModelSpecializationTranslation,
- ModelVendor,
- PcmBatch,
- Repository,
- SamplingMethodGreedy,
- SamplingMethodStochastic,
- SamplingPolicyCustom,
- SamplingPolicyDefault,
- SamplingSeedCustom,
- SamplingSeedDefault,
- TextToSpeechStats,
- Token,
- ToolCall,
- ToolDescriptionFunction,
- ToolFunction,
- ToolNamespace,
- TranslationPayloadImage,
- TranslationPayloadText,
- Value,
- Device,
- Downloader,
- DownloaderStream,
- DownloaderStreamUpdate,
- DownloadPhaseDownloaded,
- DownloadPhaseDownloading,
- DownloadPhaseError,
- DownloadPhaseLocked,
- DownloadPhaseNotDownloaded,
- DownloadPhasePaused,
- DownloadState,
- Engine,
- EngineCallback,
- EngineConfig,
- Keyring,
- ChatSessionState,
- ClassificationSessionState,
- TextToSpeechSessionState,
- ChatContentBlockType,
- ChatReplyFinishReason,
- ClassificationRole,
- HashMethod,
- ImageFormat,
- ImageTheme,
- ReasoningEffort,
- ChatMessageMetadata,
- ClassificationOutputProbabilities,
- ChatSessionError,
- ChatSessionStreamChunk,
- ClassificationSessionError,
- TextToSpeechSessionError,
- TextToSpeechSessionStreamChunk,
- ChatContentBlock,
- ChatRole,
- ChatSpeculationPreset,
- ContextLength,
- Grammar,
- ModelAccessibility,
- ModelReference,
- ModelSpecialization,
- PcmBatchError,
- SamplingMethod,
- SamplingPolicy,
- SamplingSeed,
- TokenId,
- TokenValue,
- ToolDescription,
- TranslationPayload,
- DeviceError,
- DownloadPhase,
- EngineError,
- KeyringError,
- RegistryError,
- StorageError
-} = nativeBinding;
-
-// Also provide default export
-export default nativeBinding;
\ No newline at end of file
diff --git a/bindings/ts/src/version.ts b/bindings/ts/src/version.ts
deleted file mode 100644
index 0c18d5d94..000000000
--- a/bindings/ts/src/version.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const VERSION = '0.0.0';
diff --git a/bindings/ts/.gitattributes b/bindings/typescript/.gitattributes
similarity index 100%
rename from bindings/ts/.gitattributes
rename to bindings/typescript/.gitattributes
diff --git a/bindings/ts/.gitignore b/bindings/typescript/.gitignore
similarity index 86%
rename from bindings/ts/.gitignore
rename to bindings/typescript/.gitignore
index cf23cccfc..931011906 100644
--- a/bindings/ts/.gitignore
+++ b/bindings/typescript/.gitignore
@@ -8,4 +8,5 @@ tmp
.pack
.dev.vars
.eslintcache
-.claude/
\ No newline at end of file
+.claude/
+*.node
\ No newline at end of file
diff --git a/bindings/ts/.prettierignore b/bindings/typescript/.prettierignore
similarity index 100%
rename from bindings/ts/.prettierignore
rename to bindings/typescript/.prettierignore
diff --git a/bindings/ts/.prettierrc.json b/bindings/typescript/.prettierrc.json
similarity index 100%
rename from bindings/ts/.prettierrc.json
rename to bindings/typescript/.prettierrc.json
diff --git a/bindings/typescript/LICENSE b/bindings/typescript/LICENSE
new file mode 100644
index 000000000..4aac6c884
--- /dev/null
+++ b/bindings/typescript/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 Mirai Tech Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/bindings/typescript/README.md b/bindings/typescript/README.md
new file mode 100644
index 000000000..07fcb3cec
--- /dev/null
+++ b/bindings/typescript/README.md
@@ -0,0 +1,387 @@
+<p align="center">
+ <picture>
+ <img alt="Mirai" src="https://artifacts.trymirai.com/social/github/uzu-typescript.jpg" style="max-width: 100%;">
+ </picture>
+</p>
+
+<a href="https://discord.com/invite/trymirai"><img src="https://img.shields.io/discord/1377764166764462120?label=Discord&color=brightgreen" alt="Discord"></a> <a href="mailto:[email protected]?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-brightgreen" alt="Contact us"></a> <a href="https://docs.trymirai.com"><img src="https://img.shields.io/badge/Read-Docs-brightgreen" alt="Read docs"></a> [![License](https://img.shields.io/badge/License-MIT-brightgreen)](LICENSE) ![Build](https://github.com/trymirai/uzu/actions/workflows/tests.yml/badge.svg) ![TypeScript](https://img.shields.io/badge/TypeScript-yellow) ![Package](https://img.shields.io/npm/v/@trymirai/uzu?color=yellow&label=Package) ![Downloads](https://img.shields.io/npm/dm/@trymirai/uzu?color=yellow&label=Downloads)
+
+# uzu
+
+A high-performance inference engine for AI models. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. Key features:
+
+- Simple, high-level API
+- Unified model configurations, making it easy to add support for new models
+- Traceable computations to ensure correctness against the source-of-truth implementation
+- Utilizes unified memory on Apple devices
+- [Broad model support](https://trymirai.com/models)
+
+## Quick Start
+
+
+
+Add the dependency:
+
+```bash
+pnpm add @trymirai/[email protected]
+```
+
+Run the code below:
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ let session = await engine.chat(model, ChatConfig.create());
+
+ let messages = [
+ ChatMessage.system().withText('You are a helpful assistant'),
+ ChatMessage.user().withText('Tell me a short, funny story about a robot')
+ ];
+
+ let reply = await session.reply(messages, ChatReplyConfig.create());
+ let message = reply[0]?.message;
+
+ if (message) {
+ console.log('Reasoning: ', message.reasoning);
+ console.log('Text: ', message.text);
+ }
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+
+<br>
+Everything from model downloading to inference configuration is handled automatically. Refer to the [documentation](https://docs.trymirai.com) for details on how to customize each step of the process.
+
+## Examples
+
+You can run any example via `cargo tools example` \<**typescript**\> \<**chat** | **chat-cloud** | **chat-speculation-classification** | **chat-speculation-summarization** | **chat-structured-output** | **classification** | **quick-start** | **text-to-speech**\>:
+
+### Chat
+
+In this example, we will download a model and get a reply to a specific list of messages:
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, ChatSessionStreamChunkError, ChatSessionStreamChunkReplies, Engine, EngineConfig } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ let messages = [
+ ChatMessage.system().withText('You are a helpful assistant'),
+ ChatMessage.user().withText('Tell me a short, funny story about a robot')
+ ];
+ let session = await engine.chat(model, ChatConfig.create());
+ let stream = await session.replyWithStream(messages, ChatReplyConfig.create());
+ let message: ChatMessage | undefined;
+ for await (const chunk of stream) {
+ if (chunk instanceof ChatSessionStreamChunkReplies) {
+ message = chunk.replies[0]?.message;
+ console.log('Generated tokens: ', chunk.replies[0]?.stats.tokensCountOutput);
+ } else if (chunk instanceof ChatSessionStreamChunkError) {
+ console.error('Error: ', chunk.error);
+ }
+ }
+ console.log('Reasoning: ', message?.reasoning);
+ console.log('Text: ', message?.text);
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+<br>Once loaded, the same `ChatSession` can be reused for multiple requests until you drop it. Each model may consume a significant amount of RAM, so it's important to keep only one session loaded at a time. For iOS apps, we recommend adding the [Increased Memory Capability](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.kernel.increased-memory-limit) entitlement to ensure your app can allocate the required memory.
+
+### Chat with the cloud model
+
+In this example, we will get a reply to a specific list of messages from a cloud model:
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig, ReasoningEffort } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create().withOpenaiApiKey('OPENAI_API_KEY');
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('gpt-5');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+
+ let messages = [
+ ChatMessage.system().withReasoningEffort("Low" as ReasoningEffort),
+ ChatMessage.user().withText('How LLMs work')
+ ];
+
+ let session = await engine.chat(model, ChatConfig.create());
+ let reply = await session.reply(messages, ChatReplyConfig.create());
+ let message = reply[0]?.message;
+ if (message) {
+ console.log('Reasoning: ', message.reasoning);
+ console.log('Text: ', message.text);
+ }
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+### Chat using speculation preset for classification
+
+In this example, we will use the `classification` speculation preset to determine the sentiment of the user's input:
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, ChatSpeculationPresetClassification, Engine, EngineConfig, Feature, ReasoningEffort, SamplingMethodGreedy } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ const feature = new Feature('sentiment', [
+ 'Happy',
+ 'Sad',
+ 'Angry',
+ 'Fearful',
+ 'Surprised',
+ 'Disgusted',
+ ]);
+ let chatConfig = ChatConfig.create().withSpeculationPreset(new ChatSpeculationPresetClassification(feature));
+ let session = await engine.chat(model, chatConfig);
+
+ const textToDetectFeature =
+ "Today's been awesome! Everything just feels right, and I can't stop smiling.";
+ const prompt =
+ `Text is: "${textToDetectFeature}". Choose ${feature.name} from the list: ${feature.values.join(', ')}. ` +
+ "Answer with one word. Don't add a dot at the end.";
+ let messages = [
+ ChatMessage.system().withReasoningEffort("Disabled" as ReasoningEffort),
+ ChatMessage.user().withText(prompt)
+ ];
+
+ let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(32).withSamplingMethod(new SamplingMethodGreedy());
+ let reply = (await session.reply(messages, chatReplyConfig))[0];
+
+ if (reply) {
+ console.log('Prediction: ', reply.message.text);
+ console.log('Generated tokens: ', reply.stats.tokensCountOutput);
+ }
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+<br>You can view the stats to see that the answer will be ready immediately after the prefill step, and actual generation won’t even start due to speculative decoding, which significantly improves generation speed.
+
+### Chat using speculation preset for summarization
+
+In this example, we will use the `summarization` speculation preset to generate a summary of the input text:
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, ChatSpeculationPresetSummarization, Engine, EngineConfig, ReasoningEffort, SamplingMethodGreedy } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ const textToSummarize =
+ "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. These models have a wide range of applications, including chatbots, content creation, translation, and code generation. One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. As these models grow in size and sophistication, they continue to enhance human-computer interactions, making AI-powered communication more natural and effective.";
+ const prompt = `Text is: "${textToSummarize}". Write only summary itself.`;
+ let messages = [
+ ChatMessage.system().withReasoningEffort("Disabled" as ReasoningEffort),
+ ChatMessage.user().withText(prompt)
+ ];
+
+ let chatConfig = ChatConfig.create().withSpeculationPreset(new ChatSpeculationPresetSummarization);
+ let session = await engine.chat(model, chatConfig);
+
+ let chatReplyConfig = ChatReplyConfig.create().withTokenLimit(256).withSamplingMethod(new SamplingMethodGreedy());
+ let reply = (await session.reply(messages, chatReplyConfig))[0];
+
+ if (reply) {
+ console.log('Summary: ', reply.message.text);
+ console.log('Generation t\\s: ', reply.stats.generateTokensPerSecond);
+ }
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+<br>You will notice that the model’s run count is lower than the actual number of generated tokens due to speculative decoding, which significantly improves generation speed.
+
+### Chat with structured output
+
+Sometimes you want the generated output to be valid JSON with predefined fields. You can use `Grammar` to manually specify a JSON schema for the response you want to receive:
+
+```ts
+import { ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig, GrammarJsonSchema, ReasoningEffort } from '@trymirai/uzu';
+import * as z from "zod";
+
+const CountryType = z.object({
+ name: z.string(),
+ capital: z.string(),
+});
+const CountryListType = z.array(CountryType);
+
+function structuredResponse<T extends z.ZodType>(response: string | null | undefined, type: T): z.infer<T> | undefined {
+ if (!response) {
+ return undefined;
+ }
+ const data = JSON.parse(response);
+ const result = type.parse(data);
+ return result;
+}
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('Qwen/Qwen3-0.6B');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ let schema = z.toJSONSchema(CountryListType);
+ let schemaString = JSON.stringify(schema);
+ let messages = [
+ ChatMessage.system().withReasoningEffort("Disabled" as ReasoningEffort),
+ ChatMessage.user().withText('Give me a JSON object containing a list of 3 countries, where each country has name and capital fields')
+ ];
+
+ let session = await engine.chat(model, ChatConfig.create());
+ let reply = await session.reply(messages, ChatReplyConfig.create().withGrammar(new GrammarJsonSchema(schemaString)));
+ let message = reply[0]?.message;
+ let countries = structuredResponse(message?.text, CountryListType);
+ console.log(countries);
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+### Classification
+
+In this example, we will use a classification model to determine whether the user's input is safe from a moderation perspective:
+
+```ts
+import { ClassificationMessage, Engine, EngineConfig } from '@trymirai/uzu';
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('trymirai/chat-moderation-router');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ let messages = [
+ ClassificationMessage.user('Hi')
+ ];
+
+ let session = await engine.classification(model);
+ let output = await session.classify(messages);
+ console.log('Output: ', output.probabilities.values);
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+### Text to Speech
+
+In this example, we will generate audio from text:
+
+```ts
+import { Engine, EngineConfig } from '@trymirai/uzu';
+import { homedir } from "os";
+import { join } from "path";
+
+async function main() {
+ let engineConfig = EngineConfig.create();
+ let engine = await Engine.create(engineConfig);
+
+ let model = await engine.model('fishaudio/s1-mini');
+ if (!model) {
+ throw new Error('Model not found');
+ }
+ for await (const update of await engine.download(model)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ const text = "London is the capital of United Kingdom and one of the world’s most influential cities, known for its rich history, cultural diversity, and global significance in finance, politics, and the arts. Situated along the River Thames, the city blends historic landmarks like Tower of London and Buckingham Palace with modern architecture such as The Shard. London is also home to renowned institutions including the British Museum and vibrant areas like Covent Garden, offering a mix of history, entertainment, and innovation that attracts millions of visitors each year.";
+ const outputPath = join(homedir(), "Desktop", "output.wav");
+ let session = await engine.textToSpeech(model);
+ let pcmBatch = await session.synthesize(text);
+ pcmBatch.saveAsWav(outputPath);
+ console.log('Output saved to: ', outputPath);
+}
+
+main().catch((error) => {
+ console.error(error);
+});
+```
+
+
+
+## Troubleshooting
+
+If you experience any problems, please contact us via [Discord](https://discord.com/invite/trymirai) or [email](mailto:[email protected]).
+
+## License
+
+This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
diff --git a/bindings/ts/eslint.config.mjs b/bindings/typescript/eslint.config.mjs
similarity index 100%
rename from bindings/ts/eslint.config.mjs
rename to bindings/typescript/eslint.config.mjs
diff --git a/bindings/ts/examples/chat.ts b/bindings/typescript/examples/chat.ts
similarity index 100%
rename from bindings/ts/examples/chat.ts
rename to bindings/typescript/examples/chat.ts
diff --git a/bindings/ts/examples/cloud.ts b/bindings/typescript/examples/chatCloud.ts
similarity index 100%
rename from bindings/ts/examples/cloud.ts
rename to bindings/typescript/examples/chatCloud.ts
diff --git a/bindings/ts/examples/chatForClassification.ts b/bindings/typescript/examples/chatSpeculationClassification.ts
similarity index 100%
rename from bindings/ts/examples/chatForClassification.ts
rename to bindings/typescript/examples/chatSpeculationClassification.ts
diff --git a/bindings/ts/examples/chatForSummarization.ts b/bindings/typescript/examples/chatSpeculationSummarization.ts
similarity index 100%
rename from bindings/ts/examples/chatForSummarization.ts
rename to bindings/typescript/examples/chatSpeculationSummarization.ts
diff --git a/bindings/ts/examples/structuredOutput.ts b/bindings/typescript/examples/chatStructuredOutput.ts
similarity index 100%
rename from bindings/ts/examples/structuredOutput.ts
rename to bindings/typescript/examples/chatStructuredOutput.ts
diff --git a/bindings/ts/examples/classifier.ts b/bindings/typescript/examples/classification.ts
similarity index 100%
rename from bindings/ts/examples/classifier.ts
rename to bindings/typescript/examples/classification.ts
diff --git a/bindings/ts/examples/quickStart.ts b/bindings/typescript/examples/quickStart.ts
similarity index 100%
rename from bindings/ts/examples/quickStart.ts
rename to bindings/typescript/examples/quickStart.ts
diff --git a/bindings/ts/examples/textToSpeech.ts b/bindings/typescript/examples/textToSpeech.ts
similarity index 100%
rename from bindings/ts/examples/textToSpeech.ts
rename to bindings/typescript/examples/textToSpeech.ts
diff --git a/bindings/ts/jest.config.ts b/bindings/typescript/jest.config.ts
similarity index 100%
rename from bindings/ts/jest.config.ts
rename to bindings/typescript/jest.config.ts
diff --git a/bindings/ts/jsr.json b/bindings/typescript/jsr.json
similarity index 84%
rename from bindings/ts/jsr.json
rename to bindings/typescript/jsr.json
index c9a228144..d016f8830 100644
--- a/bindings/ts/jsr.json
+++ b/bindings/typescript/jsr.json
@@ -1,6 +1,6 @@
{
"name": "@trymirai/uzu",
- "version": "0.0.0",
+ "version": "0.1.9",
"exports": {
".": "./index.ts"
},
diff --git a/bindings/ts/jsr.json.orig b/bindings/typescript/jsr.json.orig
similarity index 84%
rename from bindings/ts/jsr.json.orig
rename to bindings/typescript/jsr.json.orig
index c9a228144..d016f8830 100644
--- a/bindings/ts/jsr.json.orig
+++ b/bindings/typescript/jsr.json.orig
@@ -1,6 +1,6 @@
{
"name": "@trymirai/uzu",
- "version": "0.0.0",
+ "version": "0.1.9",
"exports": {
".": "./index.ts"
},
diff --git a/bindings/ts/package.json b/bindings/typescript/package.json
similarity index 91%
rename from bindings/ts/package.json
rename to bindings/typescript/package.json
index 6317ed855..929b7bc8e 100644
--- a/bindings/ts/package.json
+++ b/bindings/typescript/package.json
@@ -1,20 +1,24 @@
{
"name": "@trymirai/uzu",
- "version": "0.0.0",
+ "version": "0.1.9",
"description": "A high-performance inference engine for AI models",
"author": "Mirai Tech Inc. <[email protected]>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
- "repository": "github:trymirai/uzu-ts",
+ "repository": "https://github.com/trymirai/uzu",
"license": "MIT",
"packageManager": "[email protected]",
"os": [
"darwin"
],
"cpu": [
- "arm64"
+ "arm64",
+ "x64"
],
+ "napi": {
+ "binaryName": "uzu"
+ },
"files": [
"**/*"
],
@@ -34,6 +38,7 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.0",
+ "@napi-rs/cli": "3.1.2",
"@swc/core": "^1.3.102",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.4.0",
diff --git a/bindings/ts/pnpm-lock.yaml b/bindings/typescript/pnpm-lock.yaml
similarity index 78%
rename from bindings/ts/pnpm-lock.yaml
rename to bindings/typescript/pnpm-lock.yaml
index abcdb7e8a..0925b8977 100644
--- a/bindings/ts/pnpm-lock.yaml
+++ b/bindings/typescript/pnpm-lock.yaml
@@ -14,6 +14,9 @@ importers:
'@arethetypeswrong/cli':
specifier: ^0.17.0
version: 0.17.4
+ '@napi-rs/cli':
+ specifier: 3.1.2
+ version: 3.1.2(@emnapi/[email protected])(@emnapi/[email protected])(@types/[email protected])
'@swc/core':
specifier: ^1.3.102
version: 1.13.5
@@ -387,6 +390,24 @@ packages:
}
engines: { node: '>=12' }
+ '@emnapi/[email protected]':
+ resolution:
+ {
+ integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==,
+ }
+
+ '@emnapi/[email protected]':
+ resolution:
+ {
+ integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==,
+ }
+
+ '@emnapi/[email protected]':
+ resolution:
+ {
+ integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==,
+ }
+
'@eslint-community/[email protected]':
resolution:
{
@@ -448,251 +469,1016 @@ packages:
'@eslint/[email protected]':
resolution:
{
- integrity: sha512-sB5uyeq+dwCWyPi31B2gQlVlo+j5brPlWx4yZBrEaRo/nhdDE8Xke1gsGgtiBdaBTxuTkceLVuVt/pclrasb0A==,
+ integrity: sha512-sB5uyeq+dwCWyPi31B2gQlVlo+j5brPlWx4yZBrEaRo/nhdDE8Xke1gsGgtiBdaBTxuTkceLVuVt/pclrasb0A==,
+ }
+ engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 }
+
+ '@humanfs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==,
+ }
+ engines: { node: '>=18.18.0' }
+
+ '@humanfs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==,
+ }
+ engines: { node: '>=18.18.0' }
+
+ '@humanwhocodes/[email protected]':
+ resolution:
+ {
+ integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==,
+ }
+ engines: { node: '>=12.22' }
+
+ '@humanwhocodes/[email protected]':
+ resolution:
+ {
+ integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==,
+ }
+ engines: { node: '>=18.18' }
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==,
+ }
+ engines: { node: '>=18' }
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-VXukHf0RR1doGe6Sm4F0Em7SWYLTHSsbGfJdS9Ja2bX5/D5uwVOEjr07cncLROdBvmnvCATYEWlHqYmXv2IlQA==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-aLSROkEwirotxZ1pBaP8tugXRFCxW94gwrQLxXfrZsKkfjOYC1aRvAZuhpJOb5cu4IBTJdsCigUlf2iCOu4ZDQ==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-nRzdOyFYnpeYTTR2qFwEVmIWypzdAx/sIkCMeTNTcflFOovfqUk+HcFhQQVBftAh9gmGrpFj6QcGEqrDMDOiew==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==,
+ }
+ engines: { node: '>=18' }
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-kN0pAM4yPrLjJ1XJBjDxyfDduXOuQHrBB8aLDMueuwUGn+vNpF7Gq7TvyVxx8u4SHlFFj4trmj+a2cbpG4Jn1g==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-5Smv0OK7K0KUzUfYUXDXQc9jrf8OHo4ktlEayFlelCjwMXz0299Y8OrI+lj7i4gCBY15UObk76q0QtxjzFcFcg==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-zREJHjhT5vJBMZX/IUbyI9zVtVfOLiTO66MrF/3GFZYZ7T4YILW5MSkEYHceSii/KtRk+4i3RE7E1CUXA2jHcA==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-Dx/y9bCQcXLI5ooQ5KyvA4FTgeo2jYj/7plWfV5Ak5wDPKQZgudKez2ixyfz7tKXzcJciTxqLeK7R9HItwiByg==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-+LLQB8XGr3I5LZN/GuAHo+GpDJegQwuPARLChlMICNdwW7OwV2izlCSCxN6cqpL0sMXmbKbFcItJgdQq5EBXTw==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-p2bvRfENXCZdWF/U2BXvnSI9h+tuA8iNqtUKb9UWbmLYCRQxd8WkvwWvYn+3NgYaNwdUkHytJMGG4MMLucI1kA==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-l4xMuJo55MAe+N7Qr4rX90vypFwCajSakx59qe/tMaC1aEHWLyw68wF4o0A4SLAY4E0nd+Vt+EyskeDIqu1M6w==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@inquirer/[email protected]':
+ resolution:
+ {
+ integrity: sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==,
+ }
+ engines: { node: '>=18' }
+ peerDependencies:
+ '@types/node': '>=18'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@istanbuljs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==,
+ }
+ engines: { node: '>=8' }
+
+ '@istanbuljs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==,
+ }
+ engines: { node: '>=8' }
+
+ resolution:
+ {
+ integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ peerDependencies:
+ node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
+ peerDependenciesMeta:
+ node-notifier:
+ optional: true
+
+ resolution:
+ {
+ integrity: sha512-44F4l4Enf+MirJN8X/NhdGkl71k5rBYiwdVlo4HxOwbu0sHV8QKrGEedb1VUU4K3W7fBKE0HGfbn7eZm0Ti3zg==,
+ }
+ engines: { node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==,
+ }
+ engines: { node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ peerDependencies:
+ node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
+ peerDependenciesMeta:
+ node-notifier:
+ optional: true
+
+ resolution:
+ {
+ integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==,
+ }
+ engines: { node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==,
+ }
+ engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-H9xg1/sfVvyfU7o3zMfBEjQ1gcsdeTMgqHoYdN79tuLqfTtuu7WckRA1R5whDwOzxaZAeMKTYWqP+WCAi0CHsg==,
+ }
+ engines: { node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0 }
+
+ '@jridgewell/[email protected]':
+ resolution:
+ {
+ integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==,
+ }
+
+ '@jridgewell/[email protected]':
+ resolution:
+ {
+ integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==,
+ }
+
+ '@jridgewell/[email protected]':
+ resolution:
+ {
+ integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==,
+ }
+ engines: { node: '>=6.0.0' }
+
+ '@jridgewell/[email protected]':
+ resolution:
+ {
+ integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==,
+ }
+
+ '@jridgewell/[email protected]':
+ resolution:
+ {
+ integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==,
+ }
+
+ '@jridgewell/[email protected]':
+ resolution:
+ {
+ integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==,
+ }
+
+ '@loaderkit/[email protected]':
+ resolution:
+ {
+ integrity: sha512-rJzYKVcV4dxJv+vW6jlvagF8zvGxHJ2+HTr1e2qOejfmGhAApgJHl8Aog4mMszxceTRiKTTbnpgmTO1bEZHV/A==,
+ }
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-i0HT3Ja83Bzy+OtLd2eG7MI6E83+z/iwwzrdCjJ3ZiSpT3uE/xpVrLuZPd3MT5dJ9LAxCPN+P0tAPF32pRErUg==,
+ }
+ engines: { node: '>= 16' }
+ hasBin: true
+ peerDependencies:
+ '@emnapi/runtime': ^1.1.0
+ emnapi: ^1.1.0
+ peerDependenciesMeta:
+ '@emnapi/runtime':
+ optional: true
+ emnapi:
+ optional: true
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-ENPfLe4937bsKVTDA6zdABx4pq9w0tHqRrJHyaGxgaPq03a2Bd1unD5XSKjXJjebsABJ+MjAv1A2OvCgK9yehg==,
+ }
+ peerDependencies:
+ '@napi-rs/cross-toolchain-arm64-target-aarch64': ^1.0.3
+ '@napi-rs/cross-toolchain-arm64-target-armv7': ^1.0.3
+ '@napi-rs/cross-toolchain-arm64-target-ppc64le': ^1.0.3
+ '@napi-rs/cross-toolchain-arm64-target-s390x': ^1.0.3
+ '@napi-rs/cross-toolchain-arm64-target-x86_64': ^1.0.3
+ '@napi-rs/cross-toolchain-x64-target-aarch64': ^1.0.3
+ '@napi-rs/cross-toolchain-x64-target-armv7': ^1.0.3
+ '@napi-rs/cross-toolchain-x64-target-ppc64le': ^1.0.3
+ '@napi-rs/cross-toolchain-x64-target-s390x': ^1.0.3
+ '@napi-rs/cross-toolchain-x64-target-x86_64': ^1.0.3
+ peerDependenciesMeta:
+ '@napi-rs/cross-toolchain-arm64-target-aarch64':
+ optional: true
+ '@napi-rs/cross-toolchain-arm64-target-armv7':
+ optional: true
+ '@napi-rs/cross-toolchain-arm64-target-ppc64le':
+ optional: true
+ '@napi-rs/cross-toolchain-arm64-target-s390x':
+ optional: true
+ '@napi-rs/cross-toolchain-arm64-target-x86_64':
+ optional: true
+ '@napi-rs/cross-toolchain-x64-target-aarch64':
+ optional: true
+ '@napi-rs/cross-toolchain-x64-target-armv7':
+ optional: true
+ '@napi-rs/cross-toolchain-x64-target-ppc64le':
+ optional: true
+ '@napi-rs/cross-toolchain-x64-target-s390x':
+ optional: true
+ '@napi-rs/cross-toolchain-x64-target-x86_64':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-Up4gpyw2SacmyKWWEib06GhiDdF+H+CCU0LAV8pnM4aJIDqKKd5LHSlBht83Jut6frkB0vwEPmAkv4NjQ5u//Q==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm]
+ os: [android]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-uwa8sLlWEzkAM0MWyoZJg0JTD3BkPknvejAFG2acUA1raXM8jLrqujWCdOStisXhqQjZ2nDMp3FV6cs//zjfuQ==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [android]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-0Y0TQLQ2xAjVabrMDem1NhIssOZzF/y/dqetc6OT8mD3xMTDtF8u5BqZoX3MyPc9FzpsZw4ksol+w7DsxHrpMA==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [darwin]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-vR2IUyJY3En+V1wJkwmbGWcYiT8pHloTAWdW4pG24+51GIq+intst6Uf6D/r46citObGZrlX0QvMarOkQeHWpw==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [darwin]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-XpnYQC5SVovO35tF0xGkbHYjsS6kqyNCjuaLQ2dbEblFRr5cAZVvsJ/9h7zj/5FluJPJRDojVNxGyRhTp4z2lw==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [freebsd]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-ic1ZZMoRfRMwtSwxkyw4zIlbDZGC6davC9r+2oX6x9QiF247BRqqT94qGeL5ZP4Vtz0Hyy7TEViWhx5j6Bpzvw==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-asEp7FPd7C1Yi6DQb45a3KPHKOFBSfGuJWXcAd4/bL2Fjetb2n/KK2z14yfW8YC/Fv6x3rBM0VAZKmJuz4tysg==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-yWjcPDgJ2nIL3KNvi4536dlT/CcCWO0DUyEOlBs/SacG7BeD6IjGh6yYzd3/X1Y3JItCbZoDoLUH8iB1lTXo3w==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-0XRhKuIU/9ZjT4WDIG/qnX7Xz7mSQHYZo9Gb3MP2gcvBgr6BA4zywQ9k3gmQaPn9ECE+CZg2V7DV7kT+x2pUMQ==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [ppc64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-QrqDIPEUUB23GCpyQj/QFyMlr8SGxxyExeZz9OWFnHfb70kXdTLWrHS/hEI1Ru+lSbQ/6xRqeoGyQ4Aqdg+/RA==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [riscv64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-k8RVM5aMhW86E9H0QXdquwojew4H3SwPxbRVbl49/COJQWCUjGi79X6mYruMnMPEznZinUiT1jgKbFo2A00NdA==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [s390x]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-6rMtBgnIq2Wcl1rQdZsnM+rtCcVCbws1nF8S2NzaUsVaZv8bjrPiAa0lwg4Eqnn1d9lgwqT+cZgm5m+//K08Kw==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-eiadGBKi7Vd0bCArBUOO/qqRYPHt/VQVvGyYvDFt6C2ZSIjlD+HuOl+2oS1sjf4CFjK4eDIog6EdXnL0NE6iyQ==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-+VyHHlr68dvey6fXc2hehw9gHVFIW3TtGF1XkcbAu65qVXsA9D/T+uuoRVqhE+JCyFHFrO0ixRbZDRK1XJt1sA==,
+ }
+ engines: { node: '>=14.0.0' }
+ cpu: [wasm32]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-eewnqvIyyhHi3KaZtBOJXohLvwwN27gfS2G/YDWdfHlbz1jrmfeHAmzMsP5qv8vGB+T80TMHNkro4kYjeh6Deg==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [win32]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-OeacFVRCJOKNU/a0ephUfYZ2Yt+NvaHze/4TgOwJ0J0P4P7X1mHzN+ig9Iyd74aQDXYqc7kaCXA2dpAOcH87Cg==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [ia32]
+ os: [win32]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-T4I1SamdSmtyZgDXGAGP+y5LEK5vxHUFwe8mz6D4R7Sa5/WCxTcCIgPJ9BD7RkpO17lzhlaM2vmVvMy96Lvk9Q==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [win32]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-zS5LuN1OBPAyZpda2ZZgYOEDC+xecUdAGnrvbYzjnLXkrq/OBC3B9qcRvlxbDR3k5H/gVfvef1/jyUqPknqjbg==,
+ }
+ engines: { node: '>= 10' }
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-h2Ryndraj/YiKgMV/r5by1cDusluYIRT0CaE0/PekQ4u+Wpy2iUVqvzVU98ZPnhXaNeYxEvVJHNGafpOfaD0TA==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm]
+ os: [android]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-DJFyQHr1ZxNZorm/gzc1qBNLF/FcKzcH0V0Vwan5P+o0aE2keQIGEjJ09FudkF9v6uOuJjHCVDdK6S6uHtShAw==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [android]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-Zz2sXRzjIX4e532zD6xm2SjXEym6MkvfCvL2RMpG2+UwNVDVscHNcz3d47Pf3sysP2e2af7fBB3TIoK2f6trPw==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [darwin]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-EI+CptIMNweT0ms9S3mkP/q+J6FNZ1Q6pvpJOEcWglRfyfQpLqjlC0O+dptruTPE8VamKYuqdjxfqD8hifZDOA==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [darwin]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-J0PIqX+pl6lBIAckL/c87gpodLbjZB1OtIK+RDscKC9NLdpVv6VGOxzUV/fYev/hctcE8EfkLbgFOfpmVQPg2g==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [freebsd]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-SLgIQo3f3EjkZ82ZwvrEgFvMdDAhsxCYjyoSuWfHCz0U16qx3SuGCp8+FYOPYCECHN3ZlGjXnoAIt9ERd0dEUg==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-d014cdle52EGaH6GpYTQOP9Py7glMO1zz/+ynJPjjzYFSxvdYx0byrjumZk2UQdIyGZiJO2MEFpCkEEKFSgPYA==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-L/y1/26q9L/uBqiW/JdOb/Dc94egFvNALUZV2WCGKQXc6UByPBMgdiEyW2dtoYxYYYYc+AKD+jr+wQPcvX2vrQ==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-EPE1K/80RQvPbLRJDJs1QmCIcH+7WRi0F73+oTe1582y9RtfGRuzAkzeBuAGRXAQEjRQw/RjtNqr6UTJ+8UuWQ==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [ppc64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-B2jhWiB1ffw1nQBqLUP1h4+J1ovAxBOoe5N2IqDMOc63fsPZKNqF1PvO/dIem8z7LL4U4bsfmhy3gBfu547oNQ==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [s390x]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-tbZDHnb9617lTnsDMGo/eAMZxnsQFnaRe+MszRqHguKfMwkisc9CCJnks/r1o84u5fECI+J/HOrKXgczq/3Oww==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-dV6cODlzbO8u6Anmv2N/ilQHq/AWz0xyltuXoLU3yUyXbZcnWYZuB2rL8OBGPmqNcD+x9NdScBNXh7vWN0naSQ==,
+ }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution:
+ {
+ integrity: sha512-jIa9nb2HzOrfH0F8QQ9g3WE4aMH5vSI5/1NYVNm9ysCmNjCCtMXCAhlI3WKCdm/DwHf0zLqdrrtDFXODcNaqMw==,
}
- engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 }
+ engines: { node: '>=14.0.0' }
+ cpu: [wasm32]
- '@humanfs/[email protected]':
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==,
+ integrity: sha512-vfpG71OB0ijtjemp3WTdmBKJm9R70KM8vsSExMsIQtV0lVzP07oM1CW6JbNRPXNLhRoue9ofYLiUDk8bE0Hckg==,
}
- engines: { node: '>=18.18.0' }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [win32]
- '@humanfs/[email protected]':
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==,
+ integrity: sha512-hGPyPW60YSpOSgzfy68DLBHgi6HxkAM+L59ZZZPMQ0TOXjQg+p2EW87+TjZfJOkSpbYiEkULwa/f4a2hcVjsqQ==,
}
- engines: { node: '>=18.18.0' }
+ engines: { node: '>= 10' }
+ cpu: [ia32]
+ os: [win32]
- '@humanwhocodes/[email protected]':
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==,
+ integrity: sha512-L6Ed1DxXK9YSCMyvpR8MiNAyKNkQLjsHsHK9E0qnHa8NzLFqzDKhvs5LfnWxM2kJ+F7m/e5n9zPm24kHb3LsVw==,
}
- engines: { node: '>=12.22' }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [win32]
- '@humanwhocodes/[email protected]':
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==,
+ integrity: sha512-7cmzIu+Vbupriudo7UudoMRH2OA3cTw67vva8MxeoAe5S7vPFI7z0vp0pMXiA25S8IUJefImQ90FeJjl8fjEaQ==,
}
- engines: { node: '>=18.18' }
+ engines: { node: '>= 10' }
- '@istanbuljs/[email protected]':
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==,
+ integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==,
}
- engines: { node: '>=8' }
+ peerDependencies:
+ '@emnapi/core': ^1.7.1
+ '@emnapi/runtime': ^1.7.1
- '@istanbuljs/[email protected]':
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==,
+ integrity: sha512-lr07E/l571Gft5v4aA1dI8koJEmF1F0UigBbsqg9OWNzg80H3lDPO+auv85y3T/NHE3GirDk7x/D3sLO57vayw==,
}
- engines: { node: '>=8' }
+ engines: { node: '>= 10' }
+ cpu: [arm]
+ os: [android]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==,
+ integrity: sha512-WDR7S+aRLV6LtBJAg5fmjKkTZIdrEnnQxgdsb7Cf8pYiMWBHLU+LC49OUVppQ2YSPY0+GeYm9yuZWW3kLjJ7Bg==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [android]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==,
+ integrity: sha512-qWTI+EEkiN0oIn/N2gQo7+TVYil+AJ20jjuzD2vATS6uIjVz+Updeqmszi7zq7rdFTLp6Ea3/z4kDKIfZwmR9g==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
- peerDependencies:
- node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
- peerDependenciesMeta:
- node-notifier:
- optional: true
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [darwin]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-44F4l4Enf+MirJN8X/NhdGkl71k5rBYiwdVlo4HxOwbu0sHV8QKrGEedb1VUU4K3W7fBKE0HGfbn7eZm0Ti3zg==,
+ integrity: sha512-bA6hubqtHROR5UI3tToAF/c6TDmaAgF0SWgo4rADHtQ4wdn0JeogvOk50gs2TYVhKPE2ZD2+qqt7oBKB+sxW3A==,
}
- engines: { node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [darwin]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==,
+ integrity: sha512-90+KLBkD9hZEjPQW1MDfwSt5J1L46EUKacpCZWyRuL6iIEO5CgWU0V/JnEgFsDOGyyYtiTvHc5bUdUTWd4I9Vg==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [freebsd]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==,
+ integrity: sha512-rG0QlS65x9K/u3HrKafDf8cFKj5wV2JHGfl8abWgKew0GVPyp6vfsDweOwHbWAjcHtp2LHi6JHoW80/MTHm52Q==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [linux]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==,
+ integrity: sha512-jAasbIvjZXCgX0TCuEFQr+4D6Lla/3AAVx2LmDuMjgG4xoIXzjKWl7c4chuaD+TI+prWT0X6LJcdzFT+ROKGHQ==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [linux]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==,
+ integrity: sha512-Plgk5rPqqK2nocBGajkMVbGm010Z7dnUgq0wtnYRZbzWWxwWcXfZMPa8EYxrK4eE8SzpI7VlZP1tdVsdjgGwMw==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [linux]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==,
+ integrity: sha512-GW7AzGuWxtQkyHknHWYFdR0CHmW6is8rG2Rf4V6GNmMpmwtXt/ItWYWtBe4zqJWycMNazpfZKSw/BpT7/MVCXQ==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [linux]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==,
+ integrity: sha512-/nQVSTrqSsn7YdAc2R7Ips/tnw5SPUcl3D7QrXCNGPqjbatIspnaexvaOYNyKMU6xPu+pc0BTnKVmqhlJJCPLA==,
}
- engines: { node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0 }
+ engines: { node: '>=14.0.0' }
+ cpu: [wasm32]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==,
+ integrity: sha512-PFi7oJIBu5w7Qzh3dwFea3sHRO3pojMsaEnUIy22QvsW+UJfNQwJCryVrpoUt8m4QyZXI+saEq/0r4GwdoHYFQ==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
- peerDependencies:
- node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
- peerDependenciesMeta:
- node-notifier:
- optional: true
+ engines: { node: '>= 10' }
+ cpu: [arm64]
+ os: [win32]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==,
+ integrity: sha512-gXkuYzxQsgkj05Zaq+KQTkHIN83dFAwMcTKa2aQcpYPRImFm2AQzEyLtpXmyCWzJ0F9ZYAOmbSyrNew8/us6bw==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [ia32]
+ os: [win32]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==,
+ integrity: sha512-rEAf05nol3e3eei2sRButmgXP+6ATgm0/38MKhz9Isne82T4rPIMYsCIFj0kOisaGeVwoi2fnm7O9oWp5YVnYQ==,
}
- engines: { node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0 }
+ engines: { node: '>= 10' }
+ cpu: [x64]
+ os: [win32]
+ '@napi-rs/[email protected]':
resolution:
{
- integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==,
+ integrity: sha512-enkZYyuCdo+9jneCPE/0fjIta4wWnvVN9hBo2HuiMpRF0q3lzv1J6b/cl7i0mxZUKhBrV3aCKDBQnCOhwKbPmQ==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 10' }
+ '@nodelib/[email protected]':
resolution:
{
- integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==,
+ integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 8' }
+ '@nodelib/[email protected]':
resolution:
{
- integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==,
+ integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 8' }
+ '@nodelib/[email protected]':
resolution:
{
- integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==,
+ integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 8' }
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==,
+ integrity: sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==,
}
- engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ engines: { node: '>= 20' }
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-H9xg1/sfVvyfU7o3zMfBEjQ1gcsdeTMgqHoYdN79tuLqfTtuu7WckRA1R5whDwOzxaZAeMKTYWqP+WCAi0CHsg==,
+ integrity: sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==,
}
- engines: { node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0 }
+ engines: { node: '>= 20' }
- '@jridgewell/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==,
+ integrity: sha512-FWFlNxghg4HrXkD3ifYbS/IdL/mDHjh9QcsNyhQjN8dplUoZbejsdpmuqdA76nxj2xoWPs7p8uX2SNr9rYu0Ag==,
}
+ engines: { node: '>= 20' }
- '@jridgewell/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==,
+ integrity: sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==,
}
+ engines: { node: '>= 20' }
- '@jridgewell/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==,
+ integrity: sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==,
}
- engines: { node: '>=6.0.0' }
- '@jridgewell/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==,
+ integrity: sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==,
}
+ engines: { node: '>= 20' }
+ peerDependencies:
+ '@octokit/core': '>=6'
- '@jridgewell/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==,
+ integrity: sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q==,
}
+ engines: { node: '>= 20' }
+ peerDependencies:
+ '@octokit/core': '>=6'
- '@jridgewell/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==,
+ integrity: sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw==,
}
+ engines: { node: '>= 20' }
+ peerDependencies:
+ '@octokit/core': '>=6'
- '@loaderkit/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-rJzYKVcV4dxJv+vW6jlvagF8zvGxHJ2+HTr1e2qOejfmGhAApgJHl8Aog4mMszxceTRiKTTbnpgmTO1bEZHV/A==,
+ integrity: sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==,
}
+ engines: { node: '>= 20' }
- '@nodelib/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==,
+ integrity: sha512-SJZNwY9pur9Agf7l87ywFi14W+Hd9Jg6Ifivsd33+/bGUQIjNujdFiXII2/qSlN2ybqUHfp5xpekMEjIBTjlSw==,
}
- engines: { node: '>= 8' }
+ engines: { node: '>= 20' }
- '@nodelib/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==,
+ integrity: sha512-Jzbhzl3CEexhnivb1iQ0KJ7s5vvjMWcmRtq5aUsKmKDrRW6z3r84ngmiFKFvpZjpiU/9/S6ITPFRpn5s/3uQJw==,
}
- engines: { node: '>= 8' }
+ engines: { node: '>= 20' }
- '@nodelib/[email protected]':
+ '@octokit/[email protected]':
resolution:
{
- integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==,
+ integrity: sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==,
}
- engines: { node: '>= 8' }
resolution:
@@ -879,6 +1665,12 @@ packages:
integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==,
}
+ '@tybys/[email protected]':
+ resolution:
+ {
+ integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==,
+ }
+
resolution:
{
@@ -1243,6 +2035,12 @@ packages:
}
hasBin: true
+ resolution:
+ {
+ integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==,
+ }
+
resolution:
{
@@ -1337,6 +2135,12 @@ packages:
}
engines: { node: '>=10' }
+ resolution:
+ {
+ integrity: sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==,
+ }
+
resolution:
{
@@ -1372,6 +2176,21 @@ packages:
}
engines: { node: 10.* || >= 12.* }
+ resolution:
+ {
+ integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==,
+ }
+ engines: { node: '>= 12' }
+
+ resolution:
+ {
+ integrity: sha512-CXkMQxU6s9GklO/1f714dkKBMu1lopS1WFF0B8o4AxPykR1hpozxSiUZ5ZUeBjfPgCWqbcNOtZVFhB8Lkfp1+Q==,
+ }
+ peerDependencies:
+ typanion: '*'
+
resolution:
{
@@ -1411,6 +2230,12 @@ packages:
integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==,
}
+ resolution:
+ {
+ integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==,
+ }
+
resolution:
{
@@ -1694,6 +2519,12 @@ packages:
}
engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 }
+ resolution:
+ {
+ integrity: sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==,
+ }
+
resolution:
{
@@ -1771,6 +2602,13 @@ packages:
}
engines: { node: '>=10' }
+ resolution:
+ {
+ integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==,
+ }
+ engines: { node: '>=18' }
+
resolution:
{
@@ -1928,6 +2766,13 @@ packages:
}
engines: { node: '>=10.17.0' }
+ resolution:
+ {
+ integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==,
+ }
+ engines: { node: '>=0.10.0' }
+
resolution:
{
@@ -2353,6 +3198,12 @@ packages:
integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==,
}
+ resolution:
+ {
+ integrity: sha512-eq/4KP6K34kwa7TcFdtvnftvHCD9KvHOGGICWwMFc4dOOKF5t4iYqnfLK8otCRCRv06FXOzGGyqE8h8ElMvvdw==,
+ }
+
resolution:
{
@@ -2414,6 +3265,19 @@ packages:
}
engines: { node: '>=10' }
+ resolution:
+ {
+ integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==,
+ }
+ engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+
+ resolution:
+ {
+ integrity: sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==,
+ }
+
resolution:
{
@@ -2540,6 +3404,13 @@ packages:
integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==,
}
+ resolution:
+ {
+ integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==,
+ }
+ engines: { node: ^18.17.0 || >=20.5.0 }
+
resolution:
{
@@ -2661,6 +3532,13 @@ packages:
}
engines: { node: '>=10' }
+ resolution:
+ {
+ integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==,
+ }
+ engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+
resolution:
{
@@ -2675,6 +3553,13 @@ packages:
}
engines: { node: '>=10' }
+ resolution:
+ {
+ integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==,
+ }
+ engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+
resolution:
{
@@ -2728,6 +3613,13 @@ packages:
}
engines: { node: '>=8' }
+ resolution:
+ {
+ integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==,
+ }
+ engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
+
resolution:
{
@@ -2920,6 +3812,12 @@ packages:
integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==,
}
+ resolution:
+ {
+ integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==,
+ }
+
resolution:
{
@@ -2955,6 +3853,13 @@ packages:
integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==,
}
+ resolution:
+ {
+ integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==,
+ }
+ engines: { node: '>=14' }
+
resolution:
{
@@ -3215,6 +4120,12 @@ packages:
integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==,
}
+ resolution:
+ {
+ integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==,
+ }
+
resolution:
{
@@ -3290,6 +4201,19 @@ packages:
}
engines: { node: '>=4' }
+ resolution:
+ {
+ integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==,
+ }
+ engines: { node: '>=18' }
+
+ resolution:
+ {
+ integrity: sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==,
+ }
+
resolution:
{
@@ -3358,6 +4282,13 @@ packages:
integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==,
}
+ resolution:
+ {
+ integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==,
+ }
+ engines: { node: '>=8' }
+
resolution:
{
@@ -3424,14 +4355,28 @@ packages:
{
integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==,
}
- engines: { node: '>=6' }
+ engines: { node: '>=6' }
+
+ resolution:
+ {
+ integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==,
+ }
+ engines: { node: '>=10' }
+
+ resolution:
+ {
+ integrity: sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==,
+ }
+ engines: { node: '>=12.20' }
resolution:
{
- integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==,
+ integrity: sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==,
}
- engines: { node: '>=10' }
+ engines: { node: '>=18' }
resolution:
@@ -3661,6 +4606,22 @@ snapshots:
dependencies:
'@jridgewell/trace-mapping': 0.3.9
+ '@emnapi/[email protected]':
+ dependencies:
+ '@emnapi/wasi-threads': 1.2.1
+ tslib: 2.8.1
+ optional: true
+
+ '@emnapi/[email protected]':
+ dependencies:
+ tslib: 2.8.1
+ optional: true
+
+ '@emnapi/[email protected]':
+ dependencies:
+ tslib: 2.8.1
+ optional: true
+
'@eslint-community/[email protected]([email protected])':
dependencies:
eslint: 9.37.0
@@ -3718,6 +4679,131 @@ snapshots:
'@humanwhocodes/[email protected]': {}
+ '@inquirer/[email protected]': {}
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/ansi': 1.0.2
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/figures': 1.0.15
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ yoctocolors-cjs: 2.1.3
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/ansi': 1.0.2
+ '@inquirer/figures': 1.0.15
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ cli-width: 4.1.0
+ mute-stream: 2.0.0
+ signal-exit: 4.1.0
+ wrap-ansi: 6.2.0
+ yoctocolors-cjs: 2.1.3
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/external-editor': 1.0.3(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ yoctocolors-cjs: 2.1.3
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ chardet: 2.1.1
+ iconv-lite: 0.7.2
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected]': {}
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/ansi': 1.0.2
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/checkbox': 4.3.2(@types/[email protected])
+ '@inquirer/confirm': 5.1.21(@types/[email protected])
+ '@inquirer/editor': 4.2.23(@types/[email protected])
+ '@inquirer/expand': 4.0.23(@types/[email protected])
+ '@inquirer/input': 4.3.1(@types/[email protected])
+ '@inquirer/number': 3.0.23(@types/[email protected])
+ '@inquirer/password': 4.0.23(@types/[email protected])
+ '@inquirer/rawlist': 4.1.11(@types/[email protected])
+ '@inquirer/search': 3.2.2(@types/[email protected])
+ '@inquirer/select': 4.4.2(@types/[email protected])
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ yoctocolors-cjs: 2.1.3
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/figures': 1.0.15
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ yoctocolors-cjs: 2.1.3
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/ansi': 1.0.2
+ '@inquirer/core': 10.3.2(@types/[email protected])
+ '@inquirer/figures': 1.0.15
+ '@inquirer/type': 3.0.10(@types/[email protected])
+ yoctocolors-cjs: 2.1.3
+ optionalDependencies:
+ '@types/node': 20.19.19
+
+ '@inquirer/[email protected](@types/[email protected])':
+ optionalDependencies:
+ '@types/node': 20.19.19
+
'@istanbuljs/[email protected]':
dependencies:
camelcase: 5.3.1
@@ -3941,6 +5027,271 @@ snapshots:
dependencies:
'@braidai/lang': 1.1.2
+ dependencies:
+ '@inquirer/prompts': 7.10.1(@types/[email protected])
+ '@napi-rs/cross-toolchain': 1.0.3(@emnapi/[email protected])(@emnapi/[email protected])
+ '@napi-rs/wasm-tools': 1.0.1(@emnapi/[email protected])(@emnapi/[email protected])
+ '@octokit/rest': 22.0.1
+ clipanion: 4.0.0-rc.4([email protected])
+ colorette: 2.0.20
+ debug: 4.4.3
+ find-up: 7.0.0
+ js-yaml: 4.1.0
+ lodash-es: 4.18.1
+ semver: 7.7.3
+ typanion: 3.14.0
+ optionalDependencies:
+ '@emnapi/runtime': 1.10.0
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@napi-rs/cross-toolchain-arm64-target-aarch64'
+ - '@napi-rs/cross-toolchain-arm64-target-armv7'
+ - '@napi-rs/cross-toolchain-arm64-target-ppc64le'
+ - '@napi-rs/cross-toolchain-arm64-target-s390x'
+ - '@napi-rs/cross-toolchain-arm64-target-x86_64'
+ - '@napi-rs/cross-toolchain-x64-target-aarch64'
+ - '@napi-rs/cross-toolchain-x64-target-armv7'
+ - '@napi-rs/cross-toolchain-x64-target-ppc64le'
+ - '@napi-rs/cross-toolchain-x64-target-s390x'
+ - '@napi-rs/cross-toolchain-x64-target-x86_64'
+ - '@types/node'
+ - supports-color
+
+ dependencies:
+ '@napi-rs/lzma': 1.4.5(@emnapi/[email protected])(@emnapi/[email protected])
+ '@napi-rs/tar': 1.1.0(@emnapi/[email protected])(@emnapi/[email protected])
+ debug: 4.4.3
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+ - supports-color
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ dependencies:
+ '@napi-rs/wasm-runtime': 1.1.4(@emnapi/[email protected])(@emnapi/[email protected])
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ optionalDependencies:
+ '@napi-rs/lzma-android-arm-eabi': 1.4.5
+ '@napi-rs/lzma-android-arm64': 1.4.5
+ '@napi-rs/lzma-darwin-arm64': 1.4.5
+ '@napi-rs/lzma-darwin-x64': 1.4.5
+ '@napi-rs/lzma-freebsd-x64': 1.4.5
+ '@napi-rs/lzma-linux-arm-gnueabihf': 1.4.5
+ '@napi-rs/lzma-linux-arm64-gnu': 1.4.5
+ '@napi-rs/lzma-linux-arm64-musl': 1.4.5
+ '@napi-rs/lzma-linux-ppc64-gnu': 1.4.5
+ '@napi-rs/lzma-linux-riscv64-gnu': 1.4.5
+ '@napi-rs/lzma-linux-s390x-gnu': 1.4.5
+ '@napi-rs/lzma-linux-x64-gnu': 1.4.5
+ '@napi-rs/lzma-linux-x64-musl': 1.4.5
+ '@napi-rs/lzma-wasm32-wasi': 1.4.5(@emnapi/[email protected])(@emnapi/[email protected])
+ '@napi-rs/lzma-win32-arm64-msvc': 1.4.5
+ '@napi-rs/lzma-win32-ia32-msvc': 1.4.5
+ '@napi-rs/lzma-win32-x64-msvc': 1.4.5
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ dependencies:
+ '@napi-rs/wasm-runtime': 1.1.4(@emnapi/[email protected])(@emnapi/[email protected])
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ optionalDependencies:
+ '@napi-rs/tar-android-arm-eabi': 1.1.0
+ '@napi-rs/tar-android-arm64': 1.1.0
+ '@napi-rs/tar-darwin-arm64': 1.1.0
+ '@napi-rs/tar-darwin-x64': 1.1.0
+ '@napi-rs/tar-freebsd-x64': 1.1.0
+ '@napi-rs/tar-linux-arm-gnueabihf': 1.1.0
+ '@napi-rs/tar-linux-arm64-gnu': 1.1.0
+ '@napi-rs/tar-linux-arm64-musl': 1.1.0
+ '@napi-rs/tar-linux-ppc64-gnu': 1.1.0
+ '@napi-rs/tar-linux-s390x-gnu': 1.1.0
+ '@napi-rs/tar-linux-x64-gnu': 1.1.0
+ '@napi-rs/tar-linux-x64-musl': 1.1.0
+ '@napi-rs/tar-wasm32-wasi': 1.1.0(@emnapi/[email protected])(@emnapi/[email protected])
+ '@napi-rs/tar-win32-arm64-msvc': 1.1.0
+ '@napi-rs/tar-win32-ia32-msvc': 1.1.0
+ '@napi-rs/tar-win32-x64-msvc': 1.1.0
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+
+ dependencies:
+ '@emnapi/core': 1.10.0
+ '@emnapi/runtime': 1.10.0
+ '@tybys/wasm-util': 0.10.1
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ dependencies:
+ '@napi-rs/wasm-runtime': 1.1.4(@emnapi/[email protected])(@emnapi/[email protected])
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ optionalDependencies:
+ '@napi-rs/wasm-tools-android-arm-eabi': 1.0.1
+ '@napi-rs/wasm-tools-android-arm64': 1.0.1
+ '@napi-rs/wasm-tools-darwin-arm64': 1.0.1
+ '@napi-rs/wasm-tools-darwin-x64': 1.0.1
+ '@napi-rs/wasm-tools-freebsd-x64': 1.0.1
+ '@napi-rs/wasm-tools-linux-arm64-gnu': 1.0.1
+ '@napi-rs/wasm-tools-linux-arm64-musl': 1.0.1
+ '@napi-rs/wasm-tools-linux-x64-gnu': 1.0.1
+ '@napi-rs/wasm-tools-linux-x64-musl': 1.0.1
+ '@napi-rs/wasm-tools-wasm32-wasi': 1.0.1(@emnapi/[email protected])(@emnapi/[email protected])
+ '@napi-rs/wasm-tools-win32-arm64-msvc': 1.0.1
+ '@napi-rs/wasm-tools-win32-ia32-msvc': 1.0.1
+ '@napi-rs/wasm-tools-win32-x64-msvc': 1.0.1
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+
'@nodelib/[email protected]':
dependencies:
'@nodelib/fs.stat': 2.0.5
@@ -3953,6 +5304,69 @@ snapshots:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.19.1
+ '@octokit/[email protected]': {}
+
+ '@octokit/[email protected]':
+ dependencies:
+ '@octokit/auth-token': 6.0.0
+ '@octokit/graphql': 9.0.3
+ '@octokit/request': 10.0.8
+ '@octokit/request-error': 7.1.0
+ '@octokit/types': 16.0.0
+ before-after-hook: 4.0.0
+ universal-user-agent: 7.0.3
+
+ '@octokit/[email protected]':
+ dependencies:
+ '@octokit/types': 16.0.0
+ universal-user-agent: 7.0.3
+
+ '@octokit/[email protected]':
+ dependencies:
+ '@octokit/request': 10.0.8
+ '@octokit/types': 16.0.0
+ universal-user-agent: 7.0.3
+
+ '@octokit/[email protected]': {}
+
+ '@octokit/[email protected](@octokit/[email protected])':
+ dependencies:
+ '@octokit/core': 7.0.6
+ '@octokit/types': 16.0.0
+
+ '@octokit/[email protected](@octokit/[email protected])':
+ dependencies:
+ '@octokit/core': 7.0.6
+
+ '@octokit/[email protected](@octokit/[email protected])':
+ dependencies:
+ '@octokit/core': 7.0.6
+ '@octokit/types': 16.0.0
+
+ '@octokit/[email protected]':
+ dependencies:
+ '@octokit/types': 16.0.0
+
+ '@octokit/[email protected]':
+ dependencies:
+ '@octokit/endpoint': 11.0.3
+ '@octokit/request-error': 7.1.0
+ '@octokit/types': 16.0.0
+ fast-content-type-parse: 3.0.0
+ json-with-bigint: 3.5.8
+ universal-user-agent: 7.0.3
+
+ '@octokit/[email protected]':
+ dependencies:
+ '@octokit/core': 7.0.6
+ '@octokit/plugin-paginate-rest': 14.0.0(@octokit/[email protected])
+ '@octokit/plugin-request-log': 6.0.0(@octokit/[email protected])
+ '@octokit/plugin-rest-endpoint-methods': 17.0.0(@octokit/[email protected])
+
+ '@octokit/[email protected]':
+ dependencies:
+ '@octokit/openapi-types': 27.0.0
+
'@pkgr/[email protected]': {}
'@sinclair/[email protected]': {}
@@ -4036,6 +5450,11 @@ snapshots:
'@tsconfig/[email protected]': {}
+ '@tybys/[email protected]':
+ dependencies:
+ tslib: 2.8.1
+ optional: true
+
dependencies:
'@babel/parser': 7.28.4
@@ -4319,6 +5738,8 @@ snapshots:
+
dependencies:
balanced-match: 1.0.2
@@ -4367,6 +5788,8 @@ snapshots:
+
@@ -4388,6 +5811,12 @@ snapshots:
optionalDependencies:
'@colors/colors': 1.5.0
+
+ dependencies:
+ typanion: 3.14.0
+
dependencies:
string-width: 4.2.3
@@ -4410,6 +5839,8 @@ snapshots:
+
@@ -4579,6 +6010,8 @@ snapshots:
jest-message-util: 29.7.0
jest-util: 29.7.0
+
@@ -4623,6 +6056,12 @@ snapshots:
locate-path: 6.0.0
path-exists: 4.0.0
+ dependencies:
+ locate-path: 7.2.0
+ path-exists: 5.0.0
+ unicorn-magic: 0.1.0
+
dependencies:
flatted: 3.3.3
@@ -4699,6 +6138,10 @@ snapshots:
+ dependencies:
+ safer-buffer: 2.1.2
+
dependencies:
minimatch: 5.1.6
@@ -5121,6 +6564,8 @@ snapshots:
+
@@ -5148,6 +6593,12 @@ snapshots:
dependencies:
p-locate: 5.0.0
+ dependencies:
+ p-locate: 6.0.0
+
+
@@ -5210,6 +6661,8 @@ snapshots:
+
dependencies:
any-promise: 1.3.0
@@ -5281,6 +6734,10 @@ snapshots:
dependencies:
yocto-queue: 0.1.0
+ dependencies:
+ yocto-queue: 1.2.2
+
dependencies:
p-limit: 2.3.0
@@ -5289,6 +6746,10 @@ snapshots:
dependencies:
p-limit: 3.1.0
+ dependencies:
+ p-limit: 4.0.0
+
dependencies:
aggregate-error: 3.1.0
@@ -5316,6 +6777,8 @@ snapshots:
+
@@ -5401,6 +6864,8 @@ snapshots:
+
@@ -5413,6 +6878,8 @@ snapshots:
+
@@ -5574,6 +7041,8 @@ snapshots:
+
dependencies:
prelude-ls: 1.2.1
@@ -5605,6 +7074,10 @@ snapshots:
+
+
dependencies:
browserslist: 4.26.3
@@ -5639,6 +7112,12 @@ snapshots:
+ dependencies:
+ ansi-styles: 4.3.0
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+
dependencies:
ansi-styles: 4.3.0
@@ -5684,4 +7163,8 @@ snapshots:
+
+
diff --git a/bindings/ts/scripts/build b/bindings/typescript/scripts/build
similarity index 97%
rename from bindings/ts/scripts/build
rename to bindings/typescript/scripts/build
index ab57ba085..7098415fa 100755
--- a/bindings/ts/scripts/build
+++ b/bindings/typescript/scripts/build
@@ -7,7 +7,7 @@ cd "$(dirname "$0")/.."
node scripts/utils/check-version.cjs
# Generate NAPI wrappers automatically from TypeScript definitions
-node scripts/utils/generate-napi-wrappers.cjs
+# node scripts/utils/generate-napi-wrappers.cjs
# Build into dist and will publish the package from there,
# so that src/resources/foo.ts becomes <package root>/resources/foo.js
diff --git a/bindings/ts/scripts/build-deno b/bindings/typescript/scripts/build-deno
similarity index 100%
rename from bindings/ts/scripts/build-deno
rename to bindings/typescript/scripts/build-deno
diff --git a/bindings/ts/scripts/format b/bindings/typescript/scripts/format
similarity index 100%
rename from bindings/ts/scripts/format
rename to bindings/typescript/scripts/format
diff --git a/bindings/ts/scripts/lint b/bindings/typescript/scripts/lint
similarity index 100%
rename from bindings/ts/scripts/lint
rename to bindings/typescript/scripts/lint
diff --git a/bindings/ts/scripts/utils/attw-report.cjs b/bindings/typescript/scripts/utils/attw-report.cjs
similarity index 100%
rename from bindings/ts/scripts/utils/attw-report.cjs
rename to bindings/typescript/scripts/utils/attw-report.cjs
diff --git a/bindings/ts/scripts/utils/check-version.cjs b/bindings/typescript/scripts/utils/check-version.cjs
similarity index 100%
rename from bindings/ts/scripts/utils/check-version.cjs
rename to bindings/typescript/scripts/utils/check-version.cjs
diff --git a/bindings/ts/scripts/utils/convert-jsr-readme.cjs b/bindings/typescript/scripts/utils/convert-jsr-readme.cjs
similarity index 100%
rename from bindings/ts/scripts/utils/convert-jsr-readme.cjs
rename to bindings/typescript/scripts/utils/convert-jsr-readme.cjs
diff --git a/bindings/ts/scripts/utils/fix-index-exports.cjs b/bindings/typescript/scripts/utils/fix-index-exports.cjs
similarity index 100%
rename from bindings/ts/scripts/utils/fix-index-exports.cjs
rename to bindings/typescript/scripts/utils/fix-index-exports.cjs
diff --git a/bindings/ts/scripts/utils/generate-napi-wrappers.cjs b/bindings/typescript/scripts/utils/generate-napi-wrappers.cjs
similarity index 100%
rename from bindings/ts/scripts/utils/generate-napi-wrappers.cjs
rename to bindings/typescript/scripts/utils/generate-napi-wrappers.cjs
diff --git a/bindings/ts/scripts/utils/make-dist-package-json.cjs b/bindings/typescript/scripts/utils/make-dist-package-json.cjs
similarity index 100%
rename from bindings/ts/scripts/utils/make-dist-package-json.cjs
rename to bindings/typescript/scripts/utils/make-dist-package-json.cjs
diff --git a/bindings/ts/scripts/utils/postprocess-files.cjs b/bindings/typescript/scripts/utils/postprocess-files.cjs
similarity index 100%
rename from bindings/ts/scripts/utils/postprocess-files.cjs
rename to bindings/typescript/scripts/utils/postprocess-files.cjs
diff --git a/bindings/typescript/src/index.ts b/bindings/typescript/src/index.ts
new file mode 100644
index 000000000..aa9a87e51
--- /dev/null
+++ b/bindings/typescript/src/index.ts
@@ -0,0 +1 @@
+export * from './napi/index';
diff --git a/bindings/ts/src/napi/uzu.d.ts b/bindings/typescript/src/napi/index.d.ts
similarity index 99%
rename from bindings/ts/src/napi/uzu.d.ts
rename to bindings/typescript/src/napi/index.d.ts
index a30dec38c..0fac50401 100644
--- a/bindings/ts/src/napi/uzu.d.ts
+++ b/bindings/typescript/src/napi/index.d.ts
@@ -38,6 +38,7 @@ export declare class ClassificationSession {
export declare class TextToSpeechSession {
get state(): Promise<TextToSpeechSessionState>
synthesize(input: string): Promise<PcmBatch>
+ synthesizeStream(input: string): Promise<TextToSpeechSessionStream>
}
/**
diff --git a/bindings/typescript/src/napi/index.js b/bindings/typescript/src/napi/index.js
new file mode 100644
index 000000000..88d035b5a
--- /dev/null
+++ b/bindings/typescript/src/napi/index.js
@@ -0,0 +1,626 @@
+// prettier-ignore
+/* eslint-disable */
+// @ts-nocheck
+/* auto-generated by NAPI-RS */
+
+const { createRequire } = require('node:module')
+require = createRequire(__filename)
+
+const { readFileSync } = require('node:fs')
+let nativeBinding = null
+const loadErrors = []
+
+const isMusl = () => {
+ let musl = false
+ if (process.platform === 'linux') {
+ musl = isMuslFromFilesystem()
+ if (musl === null) {
+ musl = isMuslFromReport()
+ }
+ if (musl === null) {
+ musl = isMuslFromChildProcess()
+ }
+ }
+ return musl
+}
+
+const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
+
+const isMuslFromFilesystem = () => {
+ try {
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
+ } catch {
+ return null
+ }
+}
+
+const isMuslFromReport = () => {
+ let report = null
+ if (typeof process.report?.getReport === 'function') {
+ process.report.excludeNetwork = true
+ report = process.report.getReport()
+ }
+ if (!report) {
+ return null
+ }
+ if (report.header && report.header.glibcVersionRuntime) {
+ return false
+ }
+ if (Array.isArray(report.sharedObjects)) {
+ if (report.sharedObjects.some(isFileMusl)) {
+ return true
+ }
+ }
+ return false
+}
+
+const isMuslFromChildProcess = () => {
+ try {
+ return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
+ } catch (e) {
+ // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
+ return false
+ }
+}
+
+function requireNative() {
+ if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
+ try {
+ nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
+ } catch (err) {
+ loadErrors.push(err)
+ }
+ } else if (process.platform === 'android') {
+ if (process.arch === 'arm64') {
+ try {
+ return require('./uzu.android-arm64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-android-arm64')
+ const bindingPackageVersion = require('@trymirai/uzu-android-arm64/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else if (process.arch === 'arm') {
+ try {
+ return require('./uzu.android-arm-eabi.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-android-arm-eabi')
+ const bindingPackageVersion = require('@trymirai/uzu-android-arm-eabi/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
+ }
+ } else if (process.platform === 'win32') {
+ if (process.arch === 'x64') {
+ try {
+ return require('./uzu.win32-x64-msvc.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-win32-x64-msvc')
+ const bindingPackageVersion = require('@trymirai/uzu-win32-x64-msvc/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else if (process.arch === 'ia32') {
+ try {
+ return require('./uzu.win32-ia32-msvc.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-win32-ia32-msvc')
+ const bindingPackageVersion = require('@trymirai/uzu-win32-ia32-msvc/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else if (process.arch === 'arm64') {
+ try {
+ return require('./uzu.win32-arm64-msvc.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-win32-arm64-msvc')
+ const bindingPackageVersion = require('@trymirai/uzu-win32-arm64-msvc/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
+ }
+ } else if (process.platform === 'darwin') {
+ try {
+ return require('./uzu.darwin-universal.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-darwin-universal')
+ const bindingPackageVersion = require('@trymirai/uzu-darwin-universal/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ if (process.arch === 'x64') {
+ try {
+ return require('./uzu.darwin-x64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-darwin-x64')
+ const bindingPackageVersion = require('@trymirai/uzu-darwin-x64/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else if (process.arch === 'arm64') {
+ try {
+ return require('./uzu.darwin-arm64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-darwin-arm64')
+ const bindingPackageVersion = require('@trymirai/uzu-darwin-arm64/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
+ }
+ } else if (process.platform === 'freebsd') {
+ if (process.arch === 'x64') {
+ try {
+ return require('./uzu.freebsd-x64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-freebsd-x64')
+ const bindingPackageVersion = require('@trymirai/uzu-freebsd-x64/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else if (process.arch === 'arm64') {
+ try {
+ return require('./uzu.freebsd-arm64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-freebsd-arm64')
+ const bindingPackageVersion = require('@trymirai/uzu-freebsd-arm64/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
+ }
+ } else if (process.platform === 'linux') {
+ if (process.arch === 'x64') {
+ if (isMusl()) {
+ try {
+ return require('./uzu.linux-x64-musl.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-x64-musl')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-x64-musl/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ try {
+ return require('./uzu.linux-x64-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-x64-gnu')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-x64-gnu/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ }
+ } else if (process.arch === 'arm64') {
+ if (isMusl()) {
+ try {
+ return require('./uzu.linux-arm64-musl.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-arm64-musl')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-arm64-musl/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ try {
+ return require('./uzu.linux-arm64-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-arm64-gnu')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-arm64-gnu/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ }
+ } else if (process.arch === 'arm') {
+ if (isMusl()) {
+ try {
+ return require('./uzu.linux-arm-musleabihf.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-arm-musleabihf')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-arm-musleabihf/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ try {
+ return require('./uzu.linux-arm-gnueabihf.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-arm-gnueabihf')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-arm-gnueabihf/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ }
+ } else if (process.arch === 'riscv64') {
+ if (isMusl()) {
+ try {
+ return require('./uzu.linux-riscv64-musl.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-riscv64-musl')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-riscv64-musl/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ try {
+ return require('./uzu.linux-riscv64-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-riscv64-gnu')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-riscv64-gnu/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ }
+ } else if (process.arch === 'ppc64') {
+ try {
+ return require('./uzu.linux-ppc64-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-ppc64-gnu')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-ppc64-gnu/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else if (process.arch === 's390x') {
+ try {
+ return require('./uzu.linux-s390x-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-linux-s390x-gnu')
+ const bindingPackageVersion = require('@trymirai/uzu-linux-s390x-gnu/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
+ }
+ } else if (process.platform === 'openharmony') {
+ if (process.arch === 'arm64') {
+ try {
+ return require('./uzu.openharmony-arm64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-openharmony-arm64')
+ const bindingPackageVersion = require('@trymirai/uzu-openharmony-arm64/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else if (process.arch === 'x64') {
+ try {
+ return require('./uzu.openharmony-x64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-openharmony-x64')
+ const bindingPackageVersion = require('@trymirai/uzu-openharmony-x64/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else if (process.arch === 'arm') {
+ try {
+ return require('./uzu.openharmony-arm.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ const binding = require('@trymirai/uzu-openharmony-arm')
+ const bindingPackageVersion = require('@trymirai/uzu-openharmony-arm/package.json').version
+ if (bindingPackageVersion !== '0.1.9' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
+ throw new Error(`Native binding package version mismatch, expected 0.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
+ }
+ return binding
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
+ }
+ } else {
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
+ }
+}
+
+nativeBinding = requireNative()
+
+if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
+ try {
+ nativeBinding = require('./uzu.wasi.cjs')
+ } catch (err) {
+ if (process.env.NAPI_RS_FORCE_WASI) {
+ loadErrors.push(err)
+ }
+ }
+ if (!nativeBinding) {
+ try {
+ nativeBinding = require('@trymirai/uzu-wasm32-wasi')
+ } catch (err) {
+ if (process.env.NAPI_RS_FORCE_WASI) {
+ loadErrors.push(err)
+ }
+ }
+ }
+}
+
+if (!nativeBinding) {
+ if (loadErrors.length > 0) {
+ throw new Error(
+ `Cannot find native binding. ` +
+ `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
+ 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
+ { cause: loadErrors }
+ )
+ }
+ throw new Error(`Failed to load native binding`)
+}
+
+module.exports = nativeBinding
+module.exports.ChatSession = nativeBinding.ChatSession
+module.exports.ChatSessionStream = nativeBinding.ChatSessionStream
+module.exports.ChatSessionStreamChunkError = nativeBinding.ChatSessionStreamChunkError
+module.exports.ChatSessionStreamChunkReplies = nativeBinding.ChatSessionStreamChunkReplies
+module.exports.ClassificationSession = nativeBinding.ClassificationSession
+module.exports.TextToSpeechSession = nativeBinding.TextToSpeechSession
+module.exports.TextToSpeechSessionStream = nativeBinding.TextToSpeechSessionStream
+module.exports.TextToSpeechSessionStreamChunkError = nativeBinding.TextToSpeechSessionStreamChunkError
+module.exports.TextToSpeechSessionStreamChunkPcmBatch = nativeBinding.TextToSpeechSessionStreamChunkPcmBatch
+module.exports.ChatSessionState = nativeBinding.ChatSessionState
+module.exports.ClassificationSessionState = nativeBinding.ClassificationSessionState
+module.exports.TextToSpeechSessionState = nativeBinding.TextToSpeechSessionState
+module.exports.CancelToken = nativeBinding.CancelToken
+module.exports.ChatConfig = nativeBinding.ChatConfig
+module.exports.ChatContentBlockAudio = nativeBinding.ChatContentBlockAudio
+module.exports.ChatContentBlockBuiltinTools = nativeBinding.ChatContentBlockBuiltinTools
+module.exports.ChatContentBlockConversationStartDate = nativeBinding.ChatContentBlockConversationStartDate
+module.exports.ChatContentBlockCustom = nativeBinding.ChatContentBlockCustom
+module.exports.ChatContentBlockFile = nativeBinding.ChatContentBlockFile
+module.exports.ChatContentBlockIdentity = nativeBinding.ChatContentBlockIdentity
+module.exports.ChatContentBlockImage = nativeBinding.ChatContentBlockImage
+module.exports.ChatContentBlockKnowledgeCutoff = nativeBinding.ChatContentBlockKnowledgeCutoff
+module.exports.ChatContentBlockReasoning = nativeBinding.ChatContentBlockReasoning
+module.exports.ChatContentBlockReasoningEffort = nativeBinding.ChatContentBlockReasoningEffort
+module.exports.ChatContentBlockText = nativeBinding.ChatContentBlockText
+module.exports.ChatContentBlockToolCall = nativeBinding.ChatContentBlockToolCall
+module.exports.ChatContentBlockToolCallCandidate = nativeBinding.ChatContentBlockToolCallCandidate
+module.exports.ChatContentBlockToolCallResult = nativeBinding.ChatContentBlockToolCallResult
+module.exports.ChatContentBlockTools = nativeBinding.ChatContentBlockTools
+module.exports.ChatContentBlockTranslation = nativeBinding.ChatContentBlockTranslation
+module.exports.ChatContentBlockVideo = nativeBinding.ChatContentBlockVideo
+module.exports.ChatMessage = nativeBinding.ChatMessage
+module.exports.ChatModelCapabilities = nativeBinding.ChatModelCapabilities
+module.exports.ChatReply = nativeBinding.ChatReply
+module.exports.ChatReplyConfig = nativeBinding.ChatReplyConfig
+module.exports.ChatReplyStats = nativeBinding.ChatReplyStats
+module.exports.ChatRoleAssistant = nativeBinding.ChatRoleAssistant
+module.exports.ChatRoleCustom = nativeBinding.ChatRoleCustom
+module.exports.ChatRoleDeveloper = nativeBinding.ChatRoleDeveloper
+module.exports.ChatRoleSystem = nativeBinding.ChatRoleSystem
+module.exports.ChatRoleTool = nativeBinding.ChatRoleTool
+module.exports.ChatRoleUser = nativeBinding.ChatRoleUser
+module.exports.ChatSpeculationPresetClassification = nativeBinding.ChatSpeculationPresetClassification
+module.exports.ChatSpeculationPresetGeneralChat = nativeBinding.ChatSpeculationPresetGeneralChat
+module.exports.ChatSpeculationPresetSummarization = nativeBinding.ChatSpeculationPresetSummarization
+module.exports.ClassificationLabel = nativeBinding.ClassificationLabel
+module.exports.ClassificationMessage = nativeBinding.ClassificationMessage
+module.exports.ClassificationOutput = nativeBinding.ClassificationOutput
+module.exports.ClassificationStats = nativeBinding.ClassificationStats
+module.exports.ContextLengthCustom = nativeBinding.ContextLengthCustom
+module.exports.ContextLengthDefault = nativeBinding.ContextLengthDefault
+module.exports.ContextLengthMaximal = nativeBinding.ContextLengthMaximal
+module.exports.Feature = nativeBinding.Feature
+module.exports.File = nativeBinding.File
+module.exports.GrammarJsonAny = nativeBinding.GrammarJsonAny
+module.exports.GrammarJsonSchema = nativeBinding.GrammarJsonSchema
+module.exports.GrammarRegex = nativeBinding.GrammarRegex
+module.exports.Hash = nativeBinding.Hash
+module.exports.Image = nativeBinding.Image
+module.exports.Metadata = nativeBinding.Metadata
+module.exports.Model = nativeBinding.Model
+module.exports.ModelAccessibilityLocal = nativeBinding.ModelAccessibilityLocal
+module.exports.ModelAccessibilityRemote = nativeBinding.ModelAccessibilityRemote
+module.exports.ModelBackend = nativeBinding.ModelBackend
+module.exports.ModelFamily = nativeBinding.ModelFamily
+module.exports.ModelProperties = nativeBinding.ModelProperties
+module.exports.ModelQuantization = nativeBinding.ModelQuantization
+module.exports.ModelReferenceHuggingFace = nativeBinding.ModelReferenceHuggingFace
+module.exports.ModelReferenceLocal = nativeBinding.ModelReferenceLocal
+module.exports.ModelReferenceMirai = nativeBinding.ModelReferenceMirai
+module.exports.ModelRegistry = nativeBinding.ModelRegistry
+module.exports.ModelSpecializationChat = nativeBinding.ModelSpecializationChat
+module.exports.ModelSpecializationClassification = nativeBinding.ModelSpecializationClassification
+module.exports.ModelSpecializationSpeculation = nativeBinding.ModelSpecializationSpeculation
+module.exports.ModelSpecializationTextToSpeech = nativeBinding.ModelSpecializationTextToSpeech
+module.exports.ModelSpecializationTranslation = nativeBinding.ModelSpecializationTranslation
+module.exports.ModelVendor = nativeBinding.ModelVendor
+module.exports.PcmBatch = nativeBinding.PcmBatch
+module.exports.Repository = nativeBinding.Repository
+module.exports.SamplingMethodGreedy = nativeBinding.SamplingMethodGreedy
+module.exports.SamplingMethodStochastic = nativeBinding.SamplingMethodStochastic
+module.exports.SamplingPolicyCustom = nativeBinding.SamplingPolicyCustom
+module.exports.SamplingPolicyDefault = nativeBinding.SamplingPolicyDefault
+module.exports.SamplingSeedCustom = nativeBinding.SamplingSeedCustom
+module.exports.SamplingSeedDefault = nativeBinding.SamplingSeedDefault
+module.exports.TextToSpeechStats = nativeBinding.TextToSpeechStats
+module.exports.Token = nativeBinding.Token
+module.exports.ToolCall = nativeBinding.ToolCall
+module.exports.ToolDescriptionFunction = nativeBinding.ToolDescriptionFunction
+module.exports.ToolFunction = nativeBinding.ToolFunction
+module.exports.ToolNamespace = nativeBinding.ToolNamespace
+module.exports.TranslationPayloadImage = nativeBinding.TranslationPayloadImage
+module.exports.TranslationPayloadText = nativeBinding.TranslationPayloadText
+module.exports.Value = nativeBinding.Value
+module.exports.ChatContentBlockType = nativeBinding.ChatContentBlockType
+module.exports.ChatReplyFinishReason = nativeBinding.ChatReplyFinishReason
+module.exports.ClassificationRole = nativeBinding.ClassificationRole
+module.exports.HashMethod = nativeBinding.HashMethod
+module.exports.ImageFormat = nativeBinding.ImageFormat
+module.exports.ImageTheme = nativeBinding.ImageTheme
+module.exports.ReasoningEffort = nativeBinding.ReasoningEffort
+module.exports.Device = nativeBinding.Device
+module.exports.Downloader = nativeBinding.Downloader
+module.exports.DownloaderStream = nativeBinding.DownloaderStream
+module.exports.DownloaderStreamUpdate = nativeBinding.DownloaderStreamUpdate
+module.exports.DownloadPhaseDownloaded = nativeBinding.DownloadPhaseDownloaded
+module.exports.DownloadPhaseDownloading = nativeBinding.DownloadPhaseDownloading
+module.exports.DownloadPhaseError = nativeBinding.DownloadPhaseError
+module.exports.DownloadPhaseLocked = nativeBinding.DownloadPhaseLocked
+module.exports.DownloadPhaseNotDownloaded = nativeBinding.DownloadPhaseNotDownloaded
+module.exports.DownloadPhasePaused = nativeBinding.DownloadPhasePaused
+module.exports.DownloadState = nativeBinding.DownloadState
+module.exports.Engine = nativeBinding.Engine
+module.exports.EngineCallback = nativeBinding.EngineCallback
+module.exports.EngineConfig = nativeBinding.EngineConfig
+module.exports.Keyring = nativeBinding.Keyring
diff --git a/bindings/typescript/src/napi/index.mjs b/bindings/typescript/src/napi/index.mjs
new file mode 100644
index 000000000..701b9395c
--- /dev/null
+++ b/bindings/typescript/src/napi/index.mjs
@@ -0,0 +1,3 @@
+import cjs from './index.js';
+
+export default cjs;
diff --git a/bindings/typescript/src/version.ts b/bindings/typescript/src/version.ts
new file mode 100644
index 000000000..130d762b8
--- /dev/null
+++ b/bindings/typescript/src/version.ts
@@ -0,0 +1 @@
+export const VERSION = '0.1.9';
diff --git a/bindings/typescript/tests/engine.test.ts b/bindings/typescript/tests/engine.test.ts
new file mode 100644
index 000000000..010b11972
--- /dev/null
+++ b/bindings/typescript/tests/engine.test.ts
@@ -0,0 +1,28 @@
+import { ChatConfig, ChatMessage, ChatReplyConfig, Engine, EngineConfig } from '@trymirai/uzu';
+
+jest.setTimeout(600_000);
+
+test('chat reply produces text', async () => {
+ const engine = await Engine.create(EngineConfig.create());
+
+ const model = await engine.model('Qwen/Qwen3-0.6B');
+ expect(model).toBeTruthy();
+
+ for await (const update of await engine.download(model!)) {
+ console.log('Download progress:', update.progress);
+ }
+
+ const session = await engine.chat(model!, ChatConfig.create());
+
+ const messages = [
+ ChatMessage.system().withText('You are a helpful assistant'),
+ ChatMessage.user().withText('Hi'),
+ ];
+
+ const reply = await session.reply(messages, ChatReplyConfig.create());
+ const message = reply[reply.length - 1]?.message;
+
+ expect(message).toBeDefined();
+ expect(message!.reasoning).not.toBeNull();
+ expect(message!.text).not.toBeNull();
+});
diff --git a/bindings/ts/tsc-multi.json b/bindings/typescript/tsc-multi.json
similarity index 100%
rename from bindings/ts/tsc-multi.json
rename to bindings/typescript/tsc-multi.json
diff --git a/bindings/ts/tsconfig.build.json b/bindings/typescript/tsconfig.build.json
similarity index 100%
rename from bindings/ts/tsconfig.build.json
rename to bindings/typescript/tsconfig.build.json
diff --git a/bindings/ts/tsconfig.deno.json b/bindings/typescript/tsconfig.deno.json
similarity index 100%
rename from bindings/ts/tsconfig.deno.json
rename to bindings/typescript/tsconfig.deno.json
diff --git a/bindings/ts/tsconfig.dist-src.json b/bindings/typescript/tsconfig.dist-src.json
similarity index 100%
rename from bindings/ts/tsconfig.dist-src.json
rename to bindings/typescript/tsconfig.dist-src.json
diff --git a/bindings/ts/tsconfig.json b/bindings/typescript/tsconfig.json
similarity index 100%
rename from bindings/ts/tsconfig.json
rename to bindings/typescript/tsconfig.json
diff --git a/crates/backend-remote/Cargo.toml b/crates/backend-remote/Cargo.toml
index c35ff571b..1196a0c33 100644
--- a/crates/backend-remote/Cargo.toml
+++ b/crates/backend-remote/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "backend-remote"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[dependencies]
shoji.workspace = true
diff --git a/crates/backend-uzu/Cargo.toml b/crates/backend-uzu/Cargo.toml
index 9f61bf8f1..d31f5fbe6 100644
--- a/crates/backend-uzu/Cargo.toml
+++ b/crates/backend-uzu/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "backend-uzu"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
build = "build/main.rs"
[dependencies]
diff --git a/crates/benchmarks/Cargo.toml b/crates/benchmarks/Cargo.toml
index 17193d91f..d758505c7 100644
--- a/crates/benchmarks/Cargo.toml
+++ b/crates/benchmarks/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "benchmarks"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[dependencies]
backend-uzu.workspace = true
diff --git a/crates/bindings-types/Cargo.toml b/crates/bindings-types/Cargo.toml
index 42c81f766..acc7ac3e6 100644
--- a/crates/bindings-types/Cargo.toml
+++ b/crates/bindings-types/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "bindings-types"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[lib]
crate-type = ["lib", "cdylib", "staticlib"]
diff --git a/crates/bindings/Cargo.toml b/crates/bindings/Cargo.toml
index 1409b2a86..2d596aa2f 100644
--- a/crates/bindings/Cargo.toml
+++ b/crates/bindings/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "bindings"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[lib]
proc-macro = true
diff --git a/crates/cli-release/scripts/sync_into_repo.sh b/crates/cli-release/scripts/sync_into_repo.sh
deleted file mode 100755
index a043430ed..000000000
--- a/crates/cli-release/scripts/sync_into_repo.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env bash
-# sync-into-repo.sh
-# Usage:
-# sync-into-repo.sh /path/to/repo RELATIVE/PATH/INSIDE/REPO /path/to/external/folder
-
-set -euo pipefail
-
-if [[ $# -ne 3 ]]; then
- echo "Usage: $0 <repository_path> <relative_target_path_inside_repo_or_.> <external_source_folder>" >&2
- exit 1
-fi
-
-repository_path="$1"
-relative_target_path="$2"
-external_source_folder="$3"
-
-# Validate repository path
-if [[ ! -d "$repository_path" ]]; then
- echo "Error: repository path not found: $repository_path" >&2
- exit 1
-fi
-repository_absolute_path="$(cd "$repository_path" && pwd)"
-
-# Validate source folder
-if [[ ! -d "$external_source_folder" ]]; then
- echo "Error: external source folder not found: $external_source_folder" >&2
- exit 1
-fi
-external_source_absolute_path="$(cd "$external_source_folder" && pwd)"
-
-# Verify it's a Git repository
-if [[ ! -d "$repository_absolute_path/.git" ]]; then
- echo "Error: $repository_absolute_path is not a Git repository (missing .git directory)." >&2
- exit 1
-fi
-
-# Ensure the target path exists inside the repository
-mkdir -p "$repository_absolute_path/$relative_target_path"
-target_absolute_path="$(cd "$repository_absolute_path/$relative_target_path" && pwd)"
-
-# Confirm that the target is inside the repository
-case "$target_absolute_path" in
- "$repository_absolute_path" | "$repository_absolute_path"/*) ;; # OK
- *)
- echo "Error: target path escapes the repository: $target_absolute_path" >&2
- exit 1
- ;;
-esac
-
-# Rsync all contents (including hidden files), deleting removed ones,
-# but never touching any .git directory anywhere.
-rsync -a --delete \
- --exclude '.git' --exclude '.git/*' --exclude '**/.git' --exclude '**/.git/*' \
- "$external_source_absolute_path"/ "$target_absolute_path"/
-
-# Stage all resulting changes (entire repo) for commit
-git -C "$repository_absolute_path" add -A
-
-echo "✅ Synced $external_source_absolute_path → $target_absolute_path and staged all changes in $repository_absolute_path."
\ No newline at end of file
diff --git a/crates/cli-release/scripts/ts_build.sh b/crates/cli-release/scripts/ts_build.sh
deleted file mode 100755
index 99a579c30..000000000
--- a/crates/cli-release/scripts/ts_build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-
-TS_PATH="$1"
-
-cd $TS_PATH
-pnpm i --no-frozen-lockfile
-pnpm run fix
-pnpm run build
\ No newline at end of file
diff --git a/crates/cli-release/scripts/ts_napi_build.sh b/crates/cli-release/scripts/ts_napi_build.sh
deleted file mode 100755
index 4e1f2e3a9..000000000
--- a/crates/cli-release/scripts/ts_napi_build.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-
-TS_NAPI_PATH="$1"
-MANIFEST_PATH="$2"
-OUTPUT_PATH="$3"
-
-cd $TS_NAPI_PATH
-pnpm i --no-frozen-lockfile
-pnpm exec napi build --release --features bindings-napi --manifest-path $MANIFEST_PATH --output-dir $OUTPUT_PATH
\ No newline at end of file
diff --git a/crates/cli-release/scripts/zip_xcframework.sh b/crates/cli-release/scripts/zip_xcframework.sh
deleted file mode 100644
index eec71dd9f..000000000
--- a/crates/cli-release/scripts/zip_xcframework.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-
-FRAMEWORK_PATH="$1"
-DESTINATION_PATH="$2"
-VERSION="$3"
-
-ZIP_NAME="${VERSION}.zip"
-
-cd $DESTINATION_PATH
-mkdir $VERSION
-rsync -a "$FRAMEWORK_PATH" "$VERSION/"
-zip -r "$ZIP_NAME" "$VERSION"
-rm -rf "$VERSION"
-
-CHECKSUM=$(swift package compute-checksum "$ZIP_NAME")
-echo $CHECKSUM
\ No newline at end of file
diff --git a/crates/cli-release/src/handlers/mod.rs b/crates/cli-release/src/handlers/mod.rs
deleted file mode 100644
index 425e948e4..000000000
--- a/crates/cli-release/src/handlers/mod.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-mod generate_swift_extensions;
-mod prepare_bindings_python;
-mod prepare_bindings_swift;
-mod prepare_bindings_ts;
-mod prepare_docs;
-mod prepare_platform;
-mod prepare_workspace_swift;
-mod prepare_workspace_swift_spm;
-mod prepare_workspace_ts;
-mod prepare_workspace_ts_napi;
-mod sync_into_repo;
-
-pub use generate_swift_extensions::generate_swift_extensions;
-pub use prepare_bindings_python::prepare_bindings_python;
-pub use prepare_bindings_swift::prepare_bindings_swift;
-pub use prepare_bindings_ts::prepare_bindings_ts;
-pub use prepare_docs::prepare_docs;
-pub use prepare_platform::prepare_platform;
-pub use prepare_workspace_swift::prepare_workspace_swift;
-pub use prepare_workspace_swift_spm::prepare_workspace_swift_spm;
-pub use prepare_workspace_ts::prepare_workspace_ts;
-pub use prepare_workspace_ts_napi::prepare_workspace_ts_napi;
-pub use sync_into_repo::{SyncSource, sync_into_repo};
diff --git a/crates/cli-release/src/handlers/prepare_bindings_python.rs b/crates/cli-release/src/handlers/prepare_bindings_python.rs
deleted file mode 100644
index 0fcd031e0..000000000
--- a/crates/cli-release/src/handlers/prepare_bindings_python.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-use std::process::{Command, Stdio};
-
-use crate::types::{Environment, Error};
-
-pub fn prepare_bindings_python(environment: &Environment) -> Result<(), Error> {
- let bindings_python_path = environment.bindings().python_path();
- if !bindings_python_path.exists() {
- return Err(Error::PathNotFound {
- path: bindings_python_path,
- });
- }
-
- let manifest_path = environment.package_uzu().root_path.join("Cargo.toml");
- if !manifest_path.exists() {
- return Err(Error::PathNotFound {
- path: manifest_path,
- });
- }
-
- let build_status = Command::new("maturin")
- .args(["build", "--release", "--features", "bindings-pyo3", "--strip", "--manifest-path"])
- .arg(&manifest_path)
- .current_dir(&bindings_python_path)
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .status()
- .map_err(|_| Error::UnableToPrepareBindingsPython)?;
- if !build_status.success() {
- return Err(Error::UnableToPrepareBindingsPython);
- }
-
- let sync_status = Command::new("uv")
- .args(["sync", "--reinstall-package", "uzu"])
- .current_dir(&bindings_python_path)
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .status()
- .map_err(|_| Error::UnableToPrepareBindingsPython)?;
- if !sync_status.success() {
- return Err(Error::UnableToPrepareBindingsPython);
- }
-
- let annotate_status = Command::new("uv")
- .arg("run")
- .arg("--directory")
- .arg(&bindings_python_path)
- .args(["python", "-c", "import uzu; uzu.generate_annotations()"])
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .status()
- .map_err(|_| Error::UnableToPrepareBindingsPython)?;
- if !annotate_status.success() {
- return Err(Error::UnableToPrepareBindingsPython);
- }
-
- Ok(())
-}
diff --git a/crates/cli-release/src/handlers/prepare_bindings_swift.rs b/crates/cli-release/src/handlers/prepare_bindings_swift.rs
deleted file mode 100644
index b60ed0750..000000000
--- a/crates/cli-release/src/handlers/prepare_bindings_swift.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-use std::process::{Command, Stdio};
-
-use crate::{
- handlers::generate_swift_extensions,
- types::{Environment, Error},
-};
-
-pub fn prepare_bindings_swift(environment: &Environment) -> Result<(), Error> {
- let scripts_build_path = environment.bindings().swift_build_script_path();
- if !scripts_build_path.exists() {
- return Err(Error::PathNotFound {
- path: scripts_build_path,
- });
- }
-
- let output = Command::new("bash")
- .arg(scripts_build_path.clone())
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .output()
- .map_err(|_| Error::UnableToPrepareBindingsSwift)?;
-
- let status = output.status;
- if !status.success() {
- return Err(Error::UnableToPrepareBindingsSwift);
- }
-
- generate_swift_extensions(environment)?;
-
- Ok(())
-}
diff --git a/crates/cli-release/src/handlers/prepare_bindings_ts.rs b/crates/cli-release/src/handlers/prepare_bindings_ts.rs
deleted file mode 100644
index 4fdc4accb..000000000
--- a/crates/cli-release/src/handlers/prepare_bindings_ts.rs
+++ /dev/null
@@ -1,49 +0,0 @@
-use std::process::{Command, Stdio};
-
-use crate::{
- types::{Environment, Error},
- utilities::clone_dir_with_ignore_respect,
-};
-
-pub fn prepare_bindings_ts(environment: &Environment) -> Result<(), Error> {
- let scripts_build_path = environment.scripts().ts_build();
- if !scripts_build_path.exists() {
- return Err(Error::PathNotFound {
- path: scripts_build_path,
- });
- }
-
- let workspace_ts_napi_path = environment.workspace().ts_napi_path();
- if !workspace_ts_napi_path.exists() {
- return Err(Error::PathNotFound {
- path: workspace_ts_napi_path,
- });
- }
-
- let bindings_ts_path = environment.bindings().ts_path();
- let bindings_ts_src_path = bindings_ts_path.join("src");
- if !bindings_ts_src_path.exists() {
- return Err(Error::PathNotFound {
- path: bindings_ts_src_path,
- });
- }
-
- let bindings_ts_src_napi_path = bindings_ts_src_path.join("napi");
- clone_dir_with_ignore_respect(&workspace_ts_napi_path, &bindings_ts_src_napi_path)
- .map_err(|_| Error::UnableToPrepareBindingsTS)?;
-
- let output = Command::new("bash")
- .arg(scripts_build_path.clone())
- .arg(bindings_ts_path.clone())
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .output()
- .map_err(|_| Error::UnableToPrepareBindingsTS)?;
-
- let status = output.status;
- if !status.success() {
- return Err(Error::UnableToPrepareBindingsTS);
- }
-
- Ok(())
-}
diff --git a/crates/cli-release/src/handlers/prepare_docs.rs b/crates/cli-release/src/handlers/prepare_docs.rs
deleted file mode 100644
index 10518c4e3..000000000
--- a/crates/cli-release/src/handlers/prepare_docs.rs
+++ /dev/null
@@ -1,68 +0,0 @@
-use std::{fs, path::PathBuf};
-
-use crate::types::{Environment, Error, Example, Language, Snippet};
-
-pub fn prepare_docs(
- environment: &Environment,
- version: String,
- language: Language,
- snippets: Vec<Snippet>,
- examples: Vec<Example>,
-) -> Result<(), Error> {
- let snippets = [snippets, vec![dependency_snippet(language.clone(), version.clone())]].concat();
-
- let docs_snippets_path = environment.workspace().docs_snippets_path().join(language.clone().to_string());
- if docs_snippets_path.exists() {
- fs::remove_dir_all(docs_snippets_path.clone()).map_err(|_| Error::UnableToPrepareDocs)?;
- }
- fs::create_dir_all(docs_snippets_path.clone()).map_err(|_| Error::UnableToPrepareDocs)?;
-
- for snippet in snippets {
- let snippet_path = docs_snippets_path.join(format!("{}.mdx", snippet.name));
- fs::write(snippet_path, md_content(language.clone(), snippet.content))
- .map_err(|_| Error::UnableToPrepareDocs)?;
- }
-
- let docs_examples_path = environment.workspace().docs_examples_path().join(language.clone().to_string());
- if docs_examples_path.exists() {
- fs::remove_dir_all(docs_examples_path.clone()).map_err(|_| Error::UnableToPrepareDocs)?;
- }
- fs::create_dir_all(docs_examples_path.clone()).map_err(|_| Error::UnableToPrepareDocs)?;
-
- for example in examples {
- if !example.exportable {
- continue;
- }
- let example_path = docs_examples_path.join(format!("{}.mdx", example.name));
- fs::write(example_path, md_content(language.clone(), example.content))
- .map_err(|_| Error::UnableToPrepareDocs)?;
- }
-
- Ok(())
-}
-
-fn md_content(
- language: Language,
- content: String,
-) -> String {
- format!("```{}\n{}\n```", language.to_string(), content)
-}
-
-fn dependency_snippet(
- language: Language,
- version: String,
-) -> Snippet {
- let content = match language {
- Language::Swift => format!(
- "dependencies: [\n .package(url: \"https://github.com/trymirai/uzu-swift.git\", from: \"{}\")\n]",
- version
- )
- .to_string(),
- Language::TS => format!("\"dependencies\": {{\n \"@trymirai/uzu\": \"{}\"\n}}", version).to_string(),
- };
- Snippet {
- name: "dependency".to_string(),
- content,
- source_path: PathBuf::new(),
- }
-}
diff --git a/crates/cli-release/src/handlers/prepare_platform.rs b/crates/cli-release/src/handlers/prepare_platform.rs
deleted file mode 100644
index 362792c1f..000000000
--- a/crates/cli-release/src/handlers/prepare_platform.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-use std::fs;
-
-use crate::types::{Environment, Error, Example, Language};
-
-pub fn prepare_platform(
- environment: &Environment,
- language: Language,
- examples: Vec<Example>,
-) -> Result<(), Error> {
- let platform_examples_path = environment.workspace().platform_path().join(language.clone().to_string());
- if platform_examples_path.exists() {
- fs::remove_dir_all(platform_examples_path.clone()).map_err(|_| Error::UnableToPreparePlatform)?;
- }
- fs::create_dir_all(platform_examples_path.clone()).map_err(|_| Error::UnableToPreparePlatform)?;
-
- for example in examples {
- if !example.exportable {
- continue;
- }
- let example_path = platform_examples_path.join(format!("{}.txt", example.name));
- fs::write(example_path, example.content).map_err(|_| Error::UnableToPreparePlatform)?;
- }
-
- Ok(())
-}
diff --git a/crates/cli-release/src/handlers/prepare_workspace_swift.rs b/crates/cli-release/src/handlers/prepare_workspace_swift.rs
deleted file mode 100644
index 3ca3fcaee..000000000
--- a/crates/cli-release/src/handlers/prepare_workspace_swift.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-use std::fs;
-
-use crate::{
- handlers::{prepare_docs, prepare_platform},
- types::{Environment, Error, Language},
- utilities::{
- clone_dir_with_ignore_respect, extract_examples, extract_snippets, update_package_swift, update_readme,
- },
-};
-
-pub fn prepare_workspace_swift(
- environment: &Environment,
- version: String,
- checksum: String,
-) -> Result<(), Error> {
- let workspace = environment.workspace();
- let workspace_swift_path = workspace.swift_path();
- if workspace_swift_path.exists() {
- fs::remove_dir_all(workspace_swift_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceSwift)?;
- }
- fs::create_dir_all(workspace_swift_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceSwift)?;
-
- let bindings_swift_path = environment.bindings().swift_path();
- if !bindings_swift_path.exists() {
- return Err(Error::PathNotFound {
- path: bindings_swift_path,
- });
- }
-
- clone_dir_with_ignore_respect(&bindings_swift_path, &workspace_swift_path)?;
-
- let package_swift_path = workspace_swift_path.join("Package.swift");
- update_package_swift(package_swift_path.clone(), version.clone(), checksum.clone())?;
-
- let examples_path = workspace_swift_path.join("Sources").join("Examples");
- let snippets = extract_snippets(examples_path.clone())?;
- let examples = extract_examples(examples_path.clone(), workspace_swift_path.clone())?;
-
- let readme_path = workspace_swift_path.join("README.md");
- update_readme(readme_path.clone(), snippets.clone(), examples.clone(), version.clone())?;
-
- prepare_docs(environment, version.clone(), Language::Swift, snippets.clone(), examples.clone())?;
-
- prepare_platform(environment, Language::Swift, examples.clone())?;
-
- Ok(())
-}
diff --git a/crates/cli-release/src/handlers/prepare_workspace_swift_spm.rs b/crates/cli-release/src/handlers/prepare_workspace_swift_spm.rs
deleted file mode 100644
index 03514178c..000000000
--- a/crates/cli-release/src/handlers/prepare_workspace_swift_spm.rs
+++ /dev/null
@@ -1,52 +0,0 @@
-use std::{
- fs,
- process::{Command, Stdio},
-};
-
-use crate::types::{Environment, Error};
-
-pub fn prepare_workspace_swift_spm(
- environment: &Environment,
- version: String,
-) -> Result<String, Error> {
- let scripts_build_path = environment.scripts().zip_xcframework();
- if !scripts_build_path.exists() {
- return Err(Error::PathNotFound {
- path: scripts_build_path,
- });
- }
-
- let framework_path = environment.bindings().swift_framework_path();
- if !framework_path.exists() {
- return Err(Error::PathNotFound {
- path: framework_path,
- });
- }
-
- let workspace = environment.workspace();
- let workspace_swift_spm_path = workspace.swift_spm_path();
- if workspace_swift_spm_path.exists() {
- fs::remove_dir_all(workspace_swift_spm_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceSwiftSPM)?;
- }
- fs::create_dir_all(workspace_swift_spm_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceSwiftSPM)?;
-
- let output = Command::new("bash")
- .arg(scripts_build_path.clone())
- .arg(framework_path.clone())
- .arg(workspace_swift_spm_path.clone())
- .arg(version.clone())
- .stderr(Stdio::inherit())
- .output()
- .map_err(|_| Error::UnableToPrepareWorkspaceSwiftSPM)?;
-
- let status = output.status;
- if !status.success() {
- return Err(Error::UnableToPrepareWorkspaceSwiftSPM);
- }
-
- let result = String::from_utf8_lossy(&output.stdout);
- let checksum =
- result.lines().filter(|line| !line.trim().is_empty()).last().ok_or(Error::UnableToPrepareWorkspaceSwiftSPM)?;
-
- Ok(checksum.to_string())
-}
diff --git a/crates/cli-release/src/handlers/prepare_workspace_ts.rs b/crates/cli-release/src/handlers/prepare_workspace_ts.rs
deleted file mode 100644
index be4dad989..000000000
--- a/crates/cli-release/src/handlers/prepare_workspace_ts.rs
+++ /dev/null
@@ -1,86 +0,0 @@
-use std::{
- fs,
- process::{Command, Stdio},
-};
-
-use crate::{
- handlers::{prepare_docs, prepare_platform},
- types::{Environment, Error, Language},
- utilities::{
- clone_dir_with_ignore_respect, extract_examples, extract_snippets, remove_ignored_entities_from_directory,
- update_json_field, update_readme,
- },
-};
-
-pub fn prepare_workspace_ts(
- environment: &Environment,
- version: String,
-) -> Result<(), Error> {
- let scripts_build_path = environment.scripts().ts_build();
- if !scripts_build_path.exists() {
- return Err(Error::PathNotFound {
- path: scripts_build_path,
- });
- }
-
- let workspace = environment.workspace();
- let workspace_ts_path = workspace.ts_path();
- if workspace_ts_path.exists() {
- fs::remove_dir_all(workspace_ts_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceTS)?;
- }
- fs::create_dir_all(workspace_ts_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceTS)?;
-
- let bindings_ts_path = environment.bindings().ts_path();
- if !bindings_ts_path.exists() {
- return Err(Error::PathNotFound {
- path: bindings_ts_path,
- });
- }
-
- clone_dir_with_ignore_respect(&bindings_ts_path, &workspace_ts_path)?;
-
- update_json_field(workspace_ts_path.join("package.json"), "version".to_string(), version.clone())?;
-
- update_json_field(workspace_ts_path.join("jsr.json"), "version".to_string(), version.clone())?;
-
- let examples_path = workspace_ts_path.join("examples");
- let snippets = extract_snippets(examples_path.clone())?;
- let examples = extract_examples(examples_path.clone(), workspace_ts_path.clone())?;
-
- let readme_path = workspace_ts_path.join("README.md");
- update_readme(readme_path.clone(), snippets.clone(), examples.clone(), version.clone())?;
-
- let output = Command::new("bash")
- .arg(scripts_build_path.clone())
- .arg(workspace_ts_path.clone())
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .output()
- .map_err(|_| Error::UnableToPrepareWorkspaceTS)?;
- let status = output.status;
- if !status.success() {
- return Err(Error::UnableToPrepareWorkspaceTS);
- }
-
- let workspace_ts_npm_path = workspace.ts_npm_path();
- if workspace_ts_npm_path.exists() {
- fs::remove_dir_all(workspace_ts_npm_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceTSNPM)?;
- }
- fs::create_dir_all(workspace_ts_npm_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceTSNPM)?;
-
- let dist_path = workspace_ts_path.join("dist");
- if !dist_path.exists() {
- return Err(Error::PathNotFound {
- path: dist_path,
- });
- }
- clone_dir_with_ignore_respect(&dist_path, &workspace_ts_npm_path)?;
-
- remove_ignored_entities_from_directory(workspace_ts_path.clone())?;
-
- prepare_docs(environment, version.clone(), Language::TS, snippets.clone(), examples.clone())?;
-
- prepare_platform(environment, Language::TS, examples.clone())?;
-
- Ok(())
-}
diff --git a/crates/cli-release/src/handlers/prepare_workspace_ts_napi.rs b/crates/cli-release/src/handlers/prepare_workspace_ts_napi.rs
deleted file mode 100644
index af7873b6a..000000000
--- a/crates/cli-release/src/handlers/prepare_workspace_ts_napi.rs
+++ /dev/null
@@ -1,65 +0,0 @@
-use std::{
- fs,
- process::{Command, Stdio},
-};
-
-use crate::types::{Environment, Error};
-
-pub fn prepare_workspace_ts_napi(environment: &Environment) -> Result<(), Error> {
- let scripts_build_path = environment.scripts().ts_napi_build();
- if !scripts_build_path.exists() {
- return Err(Error::PathNotFound {
- path: scripts_build_path,
- });
- }
-
- let bindings_ts_napi_path = environment.bindings().ts_napi_path();
- if !bindings_ts_napi_path.exists() {
- return Err(Error::PathNotFound {
- path: bindings_ts_napi_path,
- });
- }
-
- let crates_uzu_manifest_path = environment.package_uzu().manifest_path();
- if !crates_uzu_manifest_path.exists() {
- return Err(Error::PathNotFound {
- path: crates_uzu_manifest_path,
- });
- }
-
- let workspace = environment.workspace();
- let workspace_ts_napi_path = workspace.ts_napi_path();
- if workspace_ts_napi_path.exists() {
- fs::remove_dir_all(workspace_ts_napi_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceTSNAPI)?;
- }
- fs::create_dir_all(workspace_ts_napi_path.clone()).map_err(|_| Error::UnableToPrepareWorkspaceTSNAPI)?;
-
- let output = Command::new("bash")
- .arg(scripts_build_path.clone())
- .arg(bindings_ts_napi_path.clone())
- .arg(crates_uzu_manifest_path.clone())
- .arg(workspace_ts_napi_path.clone())
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .output()
- .map_err(|_| Error::UnableToPrepareWorkspaceTSNAPI)?;
-
- let status = output.status;
- if !status.success() {
- return Err(Error::UnableToPrepareWorkspaceTSNAPI);
- }
-
- let expected_paths = vec![workspace.ts_napi_index_d_ts(), workspace.ts_napi_uzu_node()];
- for path in expected_paths {
- if !path.exists() {
- return Err(Error::PathNotFound {
- path: path,
- });
- }
- }
-
- fs::rename(workspace.ts_napi_index_d_ts(), workspace.ts_napi_uzu_d_ts())
- .map_err(|_| Error::UnableToPrepareWorkspaceTSNAPI)?;
-
- Ok(())
-}
diff --git a/crates/cli-release/src/handlers/sync_into_repo.rs b/crates/cli-release/src/handlers/sync_into_repo.rs
deleted file mode 100644
index eb2a6c9b8..000000000
--- a/crates/cli-release/src/handlers/sync_into_repo.rs
+++ /dev/null
@@ -1,78 +0,0 @@
-use std::{
- path::PathBuf,
- process::{Command, Stdio},
-};
-
-use clap::ValueEnum;
-
-use crate::types::{Environment, Error};
-
-#[derive(Debug, Clone, PartialEq, Eq, ValueEnum)]
-pub enum SyncSource {
- Swift,
- TS,
- Docs,
-}
-
-impl SyncSource {
- pub fn relative_path(&self) -> String {
- match self {
- SyncSource::Swift => "./".to_string(),
- SyncSource::TS => "./".to_string(),
- SyncSource::Docs => "./snippets/generated".to_string(),
- }
- }
-
- pub fn source_path(
- &self,
- environment: &Environment,
- ) -> PathBuf {
- match self {
- SyncSource::Swift => environment.workspace().swift_path(),
- SyncSource::TS => environment.workspace().ts_path(),
- SyncSource::Docs => environment.workspace().docs_path(),
- }
- }
-}
-
-pub fn sync_into_repo(
- environment: &Environment,
- source: SyncSource,
- repo_path: PathBuf,
-) -> Result<(), Error> {
- let scripts_path = environment.scripts().sync_into_repo();
- if !scripts_path.exists() {
- return Err(Error::PathNotFound {
- path: scripts_path,
- });
- }
-
- let source_path = source.source_path(environment);
- if !source_path.exists() {
- return Err(Error::PathNotFound {
- path: source_path,
- });
- }
-
- if !repo_path.exists() {
- return Err(Error::PathNotFound {
- path: repo_path,
- });
- }
-
- let output = Command::new("bash")
- .arg(scripts_path.clone())
- .arg(repo_path.clone())
- .arg(source.relative_path())
- .arg(source_path.clone())
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .output()
- .map_err(|_| Error::UnableToSyncIntoRepo)?;
- let status = output.status;
- if !status.success() {
- return Err(Error::UnableToSyncIntoRepo);
- }
-
- Ok(())
-}
diff --git a/crates/cli-release/src/lib.rs b/crates/cli-release/src/lib.rs
deleted file mode 100644
index c724138b3..000000000
--- a/crates/cli-release/src/lib.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-pub mod handlers;
-pub mod types;
-pub mod utilities;
diff --git a/crates/cli-release/src/main.rs b/crates/cli-release/src/main.rs
deleted file mode 100644
index 47c5087e4..000000000
--- a/crates/cli-release/src/main.rs
+++ /dev/null
@@ -1,107 +0,0 @@
-use std::path::PathBuf;
-
-use clap::{CommandFactory, Parser, Subcommand, ValueEnum};
-use cli_release::{
- handlers::{
- SyncSource, prepare_bindings_python, prepare_bindings_swift, prepare_bindings_ts, prepare_workspace_swift,
- prepare_workspace_swift_spm, prepare_workspace_ts, prepare_workspace_ts_napi, sync_into_repo,
- },
- types::{Environment, Error},
-};
-
-#[derive(Parser)]
-struct Cli {
- #[command(subcommand)]
- command: Option<Commands>,
-}
-
-#[derive(Subcommand)]
-enum Commands {
- /// Prepare bindings
- PrepareBindings {
- /// Optional language filter (prepare only that language)
- #[arg(value_enum)]
- language: Option<BindingLanguage>,
- },
- /// Prepare workspace
- PrepareWorkspace {
- /// Package version
- version: String,
- },
- /// Sync into repo
- SyncIntoRepo {
- /// Source
- source: SyncSource,
- /// Repository path
- repo_path: PathBuf,
- },
-}
-
-#[derive(ValueEnum, Clone, Copy)]
-enum BindingLanguage {
- Swift,
- Ts,
- Python,
-}
-
-fn prepare_bindings(
- environment: &Environment,
- language: Option<BindingLanguage>,
-) -> Result<(), Error> {
- match language {
- Some(BindingLanguage::Swift) => prepare_bindings_swift(environment)?,
- Some(BindingLanguage::Ts) => {
- prepare_workspace_ts_napi(environment)?;
- prepare_bindings_ts(environment)?;
- },
- Some(BindingLanguage::Python) => prepare_bindings_python(environment)?,
- None => {
- prepare_workspace_ts_napi(environment)?;
- prepare_bindings_ts(environment)?;
- prepare_bindings_swift(environment)?;
- prepare_bindings_python(environment)?;
- },
- }
- Ok(())
-}
-
-fn prepare_workspace(
- environment: &Environment,
- version: String,
-) -> Result<(), Error> {
- prepare_bindings(&environment, None)?;
- prepare_workspace_ts(environment, version.clone())?;
- let swift_spm_checksum = prepare_workspace_swift_spm(environment, version.clone())?;
- prepare_workspace_swift(environment, version.clone(), swift_spm_checksum)?;
- Ok(())
-}
-
-fn main() -> Result<(), Error> {
- let cli = Cli::parse();
- let environment = Environment::new()?;
-
- match cli.command {
- Some(Commands::PrepareBindings {
- language,
- }) => {
- prepare_bindings(&environment, language)?;
- },
- Some(Commands::PrepareWorkspace {
- version,
- }) => {
- prepare_workspace(&environment, version)?;
- },
- Some(Commands::SyncIntoRepo {
- source,
- repo_path,
- }) => {
- sync_into_repo(&environment, source, repo_path)?;
- },
- None => {
- let mut cmd = Cli::command();
- cmd.print_help().unwrap();
- },
- }
-
- Ok(())
-}
diff --git a/crates/cli-release/src/types/bindings.rs b/crates/cli-release/src/types/bindings.rs
deleted file mode 100644
index 50eb7eef5..000000000
--- a/crates/cli-release/src/types/bindings.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-use std::path::PathBuf;
-
-#[derive(Debug)]
-pub struct Bindings {
- pub root_path: PathBuf,
-}
-
-impl Bindings {
- pub fn new(root_path: PathBuf) -> Self {
- Self {
- root_path,
- }
- }
-}
-
-impl Bindings {
- pub fn ts_napi_path(&self) -> PathBuf {
- self.root_path.join("ts-napi")
- }
-
- pub fn ts_path(&self) -> PathBuf {
- self.root_path.join("ts")
- }
-}
-
-impl Bindings {
- pub fn swift_path(&self) -> PathBuf {
- self.root_path.join("swift")
- }
-
- pub fn swift_build_script_path(&self) -> PathBuf {
- self.swift_path().join("build_release_xcframework.sh")
- }
-
- pub fn swift_framework_path(&self) -> PathBuf {
- self.swift_path().join("uzu.xcframework")
- }
-}
-
-impl Bindings {
- pub fn python_path(&self) -> PathBuf {
- self.root_path.join("python")
- }
-}
diff --git a/crates/cli-release/src/types/environment.rs b/crates/cli-release/src/types/environment.rs
deleted file mode 100644
index 14e55321e..000000000
--- a/crates/cli-release/src/types/environment.rs
+++ /dev/null
@@ -1,63 +0,0 @@
-use std::path::{Path, PathBuf};
-
-use crate::types::{Bindings, Error, Package, Scripts, Workspace};
-
-#[derive(Debug)]
-pub struct Environment {
- pub root_path: PathBuf,
-}
-
-impl Environment {
- pub fn new() -> Result<Self, Error> {
- let crate_manifest_path = Path::new(env!("CARGO_MANIFEST_DIR")).to_path_buf();
-
- let crates_path = crate_manifest_path.parent().ok_or(Error::RootPathNotFound)?.to_path_buf();
-
- let root_path = crates_path.parent().ok_or(Error::RootPathNotFound)?.to_path_buf();
-
- let root_manifest_path = root_path.join("Cargo.toml");
- if !root_manifest_path.exists() {
- return Err(Error::RootPathNotFound);
- }
-
- Ok(Self {
- root_path: root_path,
- })
- }
-}
-
-impl Environment {
- pub fn crates_path(&self) -> PathBuf {
- self.root_path.join("crates")
- }
-
- pub fn bindings_path(&self) -> PathBuf {
- self.root_path.join("bindings")
- }
-
- pub fn workspace_path(&self) -> PathBuf {
- self.root_path.join("workspace").join("release")
- }
-}
-
-impl Environment {
- pub fn package_uzu(&self) -> Package {
- Package::new(self.crates_path().join("uzu"))
- }
-
- pub fn package_release_cli(&self) -> Package {
- Package::new(self.crates_path().join("cli-release"))
- }
-
- pub fn scripts(&self) -> Scripts {
- Scripts::new(self.package_release_cli().root_path.join("scripts"))
- }
-
- pub fn bindings(&self) -> Bindings {
- Bindings::new(self.bindings_path())
- }
-
- pub fn workspace(&self) -> Workspace {
- Workspace::new(self.workspace_path())
- }
-}
diff --git a/crates/cli-release/src/types/error.rs b/crates/cli-release/src/types/error.rs
deleted file mode 100644
index 1ce64ea47..000000000
--- a/crates/cli-release/src/types/error.rs
+++ /dev/null
@@ -1,49 +0,0 @@
-use std::path::PathBuf;
-
-#[derive(Debug, thiserror::Error)]
-pub enum Error {
- #[error("Root path not found")]
- RootPathNotFound,
- #[error("Path not found: {path}")]
- PathNotFound {
- path: PathBuf,
- },
- #[error("Unable to clone directory")]
- UnableToCloneDirectory,
- #[error("Unable to remove ignored entities")]
- UnableToRemoveIgnoredEntities,
- #[error("Unable to update JSON")]
- UnableToUpdateJSON,
- #[error("Unable to extract snippets")]
- UnableToExtractSnippets,
- #[error("Unable to extract examples")]
- UnableToExtractExamples,
- #[error("Unable to update README")]
- UnableToUpdateREADME,
- #[error("Unable to update Package.swift")]
- UnableToUpdatePackageSwift,
- #[error("Unable to prepare workspace")]
- UnableToPrepareWorkspace,
- #[error("Unable to prepare workspace/ts-napi")]
- UnableToPrepareWorkspaceTSNAPI,
- #[error("Unable to prepare bindings/swift")]
- UnableToPrepareBindingsSwift,
- #[error("Unable to prepare bindings/ts")]
- UnableToPrepareBindingsTS,
- #[error("Unable to prepare bindings/python")]
- UnableToPrepareBindingsPython,
- #[error("Unable to prepare workspace/ts")]
- UnableToPrepareWorkspaceTS,
- #[error("Unable to prepare workspace/ts-npm")]
- UnableToPrepareWorkspaceTSNPM,
- #[error("Unable to prepare workspace/swift")]
- UnableToPrepareWorkspaceSwift,
- #[error("Unable to prepare workspace/swift-spm")]
- UnableToPrepareWorkspaceSwiftSPM,
- #[error("Unable to prepare docs")]
- UnableToPrepareDocs,
- #[error("Unable to prepare platform")]
- UnableToPreparePlatform,
- #[error("Unable to sync into repo")]
- UnableToSyncIntoRepo,
-}
diff --git a/crates/cli-release/src/types/example.rs b/crates/cli-release/src/types/example.rs
deleted file mode 100644
index b3be2668e..000000000
--- a/crates/cli-release/src/types/example.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-use std::path::PathBuf;
-
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub struct Example {
- pub name: String,
- pub relative_path: PathBuf,
- pub full_path: PathBuf,
- pub content: String,
- pub exportable: bool,
-}
-
-impl Example {
- pub fn new(
- name: String,
- relative_path: PathBuf,
- full_path: PathBuf,
- content: String,
- exportable: bool,
- ) -> Self {
- Self {
- name,
- relative_path,
- full_path,
- content: content.trim().to_string(),
- exportable,
- }
- }
-}
diff --git a/crates/cli-release/src/types/language.rs b/crates/cli-release/src/types/language.rs
deleted file mode 100644
index 2db97f8ed..000000000
--- a/crates/cli-release/src/types/language.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub enum Language {
- Swift,
- TS,
-}
-
-impl Language {
- pub fn to_string(&self) -> String {
- match self {
- Language::Swift => "swift".to_string(),
- Language::TS => "ts".to_string(),
- }
- }
-}
diff --git a/crates/cli-release/src/types/mod.rs b/crates/cli-release/src/types/mod.rs
deleted file mode 100644
index 4e31877f7..000000000
--- a/crates/cli-release/src/types/mod.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-mod bindings;
-mod environment;
-mod error;
-mod example;
-mod language;
-mod package;
-mod scripts;
-mod snippet;
-mod workspace;
-
-pub use bindings::Bindings;
-pub use environment::Environment;
-pub use error::Error;
-pub use example::Example;
-pub use language::Language;
-pub use package::Package;
-pub use scripts::Scripts;
-pub use snippet::Snippet;
-pub use workspace::Workspace;
diff --git a/crates/cli-release/src/types/package.rs b/crates/cli-release/src/types/package.rs
deleted file mode 100644
index e74dc8ac1..000000000
--- a/crates/cli-release/src/types/package.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-use std::path::PathBuf;
-
-#[derive(Debug)]
-pub struct Package {
- pub root_path: PathBuf,
-}
-
-impl Package {
- pub fn new(root_path: PathBuf) -> Self {
- Self {
- root_path,
- }
- }
-}
-
-impl Package {
- pub fn manifest_path(&self) -> PathBuf {
- self.root_path.join("Cargo.toml")
- }
-}
diff --git a/crates/cli-release/src/types/scripts.rs b/crates/cli-release/src/types/scripts.rs
deleted file mode 100644
index 7bb010590..000000000
--- a/crates/cli-release/src/types/scripts.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-use std::path::PathBuf;
-
-#[derive(Debug)]
-pub struct Scripts {
- pub root_path: PathBuf,
-}
-
-impl Scripts {
- pub fn new(root_path: PathBuf) -> Self {
- Self {
- root_path,
- }
- }
-}
-
-impl Scripts {
- pub fn ts_napi_build(&self) -> PathBuf {
- self.root_path.join("ts_napi_build.sh")
- }
-
- pub fn ts_build(&self) -> PathBuf {
- self.root_path.join("ts_build.sh")
- }
-
- pub fn sync_into_repo(&self) -> PathBuf {
- self.root_path.join("sync_into_repo.sh")
- }
-
- pub fn zip_xcframework(&self) -> PathBuf {
- self.root_path.join("zip_xcframework.sh")
- }
-}
diff --git a/crates/cli-release/src/types/snippet.rs b/crates/cli-release/src/types/snippet.rs
deleted file mode 100644
index 239fc8e6d..000000000
--- a/crates/cli-release/src/types/snippet.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-use std::path::PathBuf;
-
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub struct Snippet {
- pub name: String,
- pub content: String,
- pub source_path: PathBuf,
-}
-
-impl Snippet {
- pub fn new(
- name: String,
- content: String,
- source_path: PathBuf,
- ) -> Self {
- Self {
- name,
- content: content.trim().to_string(),
- source_path,
- }
- }
-}
diff --git a/crates/cli-release/src/types/workspace.rs b/crates/cli-release/src/types/workspace.rs
deleted file mode 100644
index 6d221d789..000000000
--- a/crates/cli-release/src/types/workspace.rs
+++ /dev/null
@@ -1,68 +0,0 @@
-use std::path::PathBuf;
-
-#[derive(Debug)]
-pub struct Workspace {
- pub root_path: PathBuf,
-}
-
-impl Workspace {
- pub fn new(root_path: PathBuf) -> Self {
- Self {
- root_path,
- }
- }
-}
-
-impl Workspace {
- pub fn ts_path(&self) -> PathBuf {
- self.root_path.join("ts")
- }
-
- pub fn ts_npm_path(&self) -> PathBuf {
- self.root_path.join("ts-npm")
- }
-
- pub fn swift_path(&self) -> PathBuf {
- self.root_path.join("swift")
- }
-
- pub fn swift_spm_path(&self) -> PathBuf {
- self.root_path.join("swift-spm")
- }
-
- pub fn platform_path(&self) -> PathBuf {
- self.root_path.join("platform")
- }
-}
-
-impl Workspace {
- pub fn docs_path(&self) -> PathBuf {
- self.root_path.join("docs")
- }
-
- pub fn docs_snippets_path(&self) -> PathBuf {
- self.docs_path().join("snippets")
- }
-
- pub fn docs_examples_path(&self) -> PathBuf {
- self.docs_path().join("examples")
- }
-}
-
-impl Workspace {
- pub fn ts_napi_path(&self) -> PathBuf {
- self.root_path.join("ts-napi")
- }
-
- pub fn ts_napi_index_d_ts(&self) -> PathBuf {
- self.ts_napi_path().join("index.d.ts")
- }
-
- pub fn ts_napi_uzu_d_ts(&self) -> PathBuf {
- self.ts_napi_path().join("uzu.d.ts")
- }
-
- pub fn ts_napi_uzu_node(&self) -> PathBuf {
- self.ts_napi_path().join("uzu.node")
- }
-}
diff --git a/crates/cli-release/src/utilities/examples.rs b/crates/cli-release/src/utilities/examples.rs
deleted file mode 100644
index 9fc1c7321..000000000
--- a/crates/cli-release/src/utilities/examples.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-use std::{fs, path::PathBuf};
-
-use crate::{
- types::{Error, Example},
- utilities::{kebab_filename, relative_path},
-};
-
-const EXPORTED_EXAMPLE_NAMES: [&str; 9] = [
- "quick-start",
- "chat",
- "summarization",
- "classification",
- "cloud",
- "ssm",
- "structured-output",
- "classifier",
- "text-to-speech",
-];
-
-pub fn extract_examples(
- examples_path: PathBuf,
- root_path: PathBuf,
-) -> Result<Vec<Example>, Error> {
- let mut examples = Vec::new();
- for entry in fs::read_dir(examples_path).map_err(|_| Error::UnableToExtractExamples)? {
- let entry = entry.map_err(|_| Error::UnableToExtractExamples)?;
- let entry_path = entry.path();
- let content = fs::read_to_string(entry_path.clone()).map_err(|_| Error::UnableToExtractExamples)?;
- let relative_path =
- relative_path(entry_path.clone(), root_path.clone()).ok_or(Error::UnableToExtractExamples)?;
- let name = kebab_filename(&entry_path).ok_or(Error::UnableToExtractExamples)?;
- examples.push(Example::new(
- name.clone(),
- relative_path,
- entry_path.clone(),
- content,
- EXPORTED_EXAMPLE_NAMES.contains(&name.clone().as_str()),
- ));
- }
- Ok(examples)
-}
diff --git a/crates/cli-release/src/utilities/file_system.rs b/crates/cli-release/src/utilities/file_system.rs
deleted file mode 100644
index 7c9201608..000000000
--- a/crates/cli-release/src/utilities/file_system.rs
+++ /dev/null
@@ -1,133 +0,0 @@
-use std::{
- collections::HashSet,
- fs,
- path::{Path, PathBuf},
-};
-
-use heck::ToKebabCase;
-use ignore::WalkBuilder;
-
-use crate::types::Error;
-
-pub fn clone_dir_with_ignore_respect(
- src: &Path,
- dst: &Path,
-) -> Result<(), Error> {
- fs::create_dir_all(dst).map_err(|_| Error::UnableToCloneDirectory)?;
-
- let walker = WalkBuilder::new(src).standard_filters(true).parents(false).hidden(false).build();
-
- for result in walker {
- let entry = result.map_err(|_| Error::UnableToCloneDirectory)?;
- let path = entry.path();
-
- if path == src {
- continue;
- }
-
- let relative = path.strip_prefix(src).map_err(|_| Error::UnableToCloneDirectory)?;
- let dst_path = dst.join(relative);
-
- if path.is_dir() {
- fs::create_dir_all(&dst_path).map_err(|_| Error::UnableToCloneDirectory)?;
- } else if path.is_file() {
- if let Some(parent) = dst_path.parent() {
- fs::create_dir_all(parent).map_err(|_| Error::UnableToCloneDirectory)?;
- }
- fs::copy(path, &dst_path).map_err(|_| Error::UnableToCloneDirectory)?;
- }
- }
-
- let ignore_path: PathBuf = dst.join(".ignore");
- if ignore_path.exists() {
- fs::remove_file(&ignore_path).map_err(|_| Error::UnableToCloneDirectory)?;
- }
-
- Ok(())
-}
-
-pub fn remove_ignored_entities_from_directory(directory_path: PathBuf) -> Result<(), Error> {
- // Build a walker that respects ignore rules – these are the entries we KEEP
- let respected_walker =
- WalkBuilder::new(&directory_path).standard_filters(true).hidden(false).follow_links(false).build();
-
- let mut kept_paths: HashSet<PathBuf> = HashSet::new();
- for result in respected_walker {
- let directory_entry = result.map_err(|_| Error::UnableToRemoveIgnoredEntities)?;
- let entry_path = directory_entry.path();
-
- // Keep the root directory, but don't store it in the set to avoid accidental deletion logic
- if entry_path == directory_path {
- continue;
- }
- kept_paths.insert(entry_path.to_path_buf());
- }
-
- // Build a walker that does NOT respect ignore rules – this sees EVERYTHING
- let all_walker =
- WalkBuilder::new(&directory_path).standard_filters(false).hidden(false).follow_links(false).build();
-
- // Partition items to remove into files and directories.
- // We remove files first, then directories deepest-first to avoid ENOTEMPTY.
- let mut files_to_remove: Vec<PathBuf> = Vec::new();
- let mut directories_to_remove: Vec<PathBuf> = Vec::new();
-
- for result in all_walker {
- let directory_entry = result.map_err(|_| Error::UnableToRemoveIgnoredEntities)?;
- let entry_path = directory_entry.path();
-
- if entry_path == directory_path {
- continue; // never remove the root
- }
-
- // If not in kept set, it’s ignored -> schedule for removal
- if !kept_paths.contains(entry_path) {
- if entry_path.is_file() {
- files_to_remove.push(entry_path.to_path_buf());
- } else if entry_path.is_dir() {
- directories_to_remove.push(entry_path.to_path_buf());
- }
- }
- }
-
- // Remove files first
- for file_path in files_to_remove {
- fs::remove_file(&file_path).map_err(|_| Error::UnableToRemoveIgnoredEntities)?;
- }
-
- // Then remove directories, deepest-first
- directories_to_remove.sort_by_key(|p| std::cmp::Reverse(p.components().count()));
- for directory_to_remove in directories_to_remove {
- fs::remove_dir_all(&directory_to_remove).map_err(|_| Error::UnableToRemoveIgnoredEntities)?;
- }
-
- Ok(())
-}
-
-pub fn relative_path(
- target: PathBuf,
- base: PathBuf,
-) -> Option<PathBuf> {
- let target_iter = target.components();
- let base_iter = base.components();
-
- let target_components: Vec<_> = target_iter.collect();
- let base_components: Vec<_> = base_iter.collect();
-
- let common_len = target_components.iter().zip(&base_components).take_while(|(a, b)| a == b).count();
-
- let mut result = PathBuf::new();
- for _ in base_components.iter().skip(common_len) {
- result.push("..");
- }
-
- for comp in target_components.iter().skip(common_len) {
- result.push(comp.as_os_str());
- }
-
- Some(result)
-}
-
-pub fn kebab_filename(path: &PathBuf) -> Option<String> {
- path.file_stem().and_then(|stem| stem.to_str()).map(|stem| stem.to_kebab_case())
-}
diff --git a/crates/cli-release/src/utilities/json.rs b/crates/cli-release/src/utilities/json.rs
deleted file mode 100644
index 2d7983b99..000000000
--- a/crates/cli-release/src/utilities/json.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-use std::{fs, path::PathBuf};
-
-use serde_json::Value;
-
-use crate::types::Error;
-
-pub fn update_json_field(
- path: PathBuf,
- key: String,
- value: String,
-) -> Result<(), Error> {
- let json = fs::read_to_string(path.clone()).map_err(|_| Error::UnableToUpdateJSON)?;
- let mut json: Value = serde_json::from_str(&json).map_err(|_| Error::UnableToUpdateJSON)?;
- json[key] = Value::String(value);
- fs::write(path.clone(), serde_json::to_string(&json).map_err(|_| Error::UnableToUpdateJSON)?)
- .map_err(|_| Error::UnableToUpdateJSON)?;
-
- Ok(())
-}
diff --git a/crates/cli-release/src/utilities/mod.rs b/crates/cli-release/src/utilities/mod.rs
deleted file mode 100644
index 790a380a0..000000000
--- a/crates/cli-release/src/utilities/mod.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-mod examples;
-mod file_system;
-mod json;
-mod package_swift;
-mod readme;
-mod snippets;
-
-pub use examples::extract_examples;
-pub use file_system::{
- clone_dir_with_ignore_respect, kebab_filename, relative_path, remove_ignored_entities_from_directory,
-};
-pub use json::update_json_field;
-pub use package_swift::update_package_swift;
-pub use readme::update_readme;
-pub use snippets::extract_snippets;
diff --git a/crates/cli-release/src/utilities/package_swift.rs b/crates/cli-release/src/utilities/package_swift.rs
deleted file mode 100644
index 4defd290a..000000000
--- a/crates/cli-release/src/utilities/package_swift.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-use std::{fs, path::PathBuf};
-
-use crate::types::Error;
-
-pub fn update_package_swift(
- package_swift_path: PathBuf,
- version: String,
- checksum: String,
-) -> Result<(), Error> {
- let original_content = fs::read_to_string(&package_swift_path).map_err(|_| Error::UnableToUpdatePackageSwift)?;
-
- let framework_url = format!("https://artifacts.trymirai.com/uzu-swift/releases/{}.zip", version);
-
- let dependency_snippet = format!("url: \"{}\",\n checksum: \"{}\"", framework_url, checksum);
-
- let updated_content = original_content.replace("path: \"uzu.xcframework\"", dependency_snippet.as_str());
-
- fs::write(&package_swift_path, updated_content).map_err(|_| Error::UnableToUpdatePackageSwift)?;
- Ok(())
-}
diff --git a/crates/cli-release/src/utilities/readme.rs b/crates/cli-release/src/utilities/readme.rs
deleted file mode 100644
index 00076c84b..000000000
--- a/crates/cli-release/src/utilities/readme.rs
+++ /dev/null
@@ -1,87 +0,0 @@
-use std::{
- collections::HashMap,
- fs,
- path::{Path, PathBuf},
-};
-
-use regex::Regex;
-
-use crate::types::{Error, Example, Snippet};
-
-pub fn update_readme(
- readme_path: PathBuf,
- snippets: Vec<Snippet>,
- examples: Vec<Example>,
- version: String,
-) -> Result<(), Error> {
- let original_content = fs::read_to_string(&readme_path).map_err(|_| Error::UnableToUpdateREADME)?;
-
- let include_pattern = Regex::new(r#"(?m)^\s*//\s*include:(?P<path>[^\s#]+)(?:#(?P<snippet>[^\s]+))?\s*$"#)
- .map_err(|_| Error::UnableToUpdateREADME)?;
-
- // Index examples by normalized relative path
- let mut examples_by_relative_path: HashMap<String, &Example> = HashMap::new();
- for example in &examples {
- examples_by_relative_path.insert(normalize_slashes(&example.relative_path), example);
- }
-
- // Index snippets for quick lookup
- let mut snippets_by_name_and_source_path: HashMap<(String, String), &Snippet> = HashMap::new();
- let mut snippets_by_name: HashMap<String, Vec<&Snippet>> = HashMap::new();
-
- for snippet in &snippets {
- snippets_by_name_and_source_path
- .insert((snippet.name.clone(), normalize_slashes(&snippet.source_path)), snippet);
- snippets_by_name.entry(snippet.name.clone()).or_default().push(snippet);
- }
-
- let mut updated_content = String::with_capacity(original_content.len());
- let mut last_position = 0;
-
- for capture in include_pattern.captures_iter(&original_content) {
- let full_match = capture.get(0).ok_or(Error::UnableToUpdateREADME)?;
- updated_content.push_str(&original_content[last_position..full_match.start()]);
-
- let include_path = capture.name("path").ok_or(Error::UnableToUpdateREADME)?.as_str();
- let snippet_name = capture.name("snippet").map(|m| m.as_str());
- let normalized_include_path = normalize_slashes_str(include_path);
-
- // Find the matching example (by relative path)
- let example = *examples_by_relative_path.get(&normalized_include_path).ok_or(Error::UnableToUpdateREADME)?;
-
- // Choose replacement content (no indentation modification)
- let replacement_content = if let Some(snippet_name) = snippet_name {
- let exact_key = (snippet_name.to_string(), normalize_slashes(&example.full_path));
-
- if let Some(snippet) = snippets_by_name_and_source_path.get(&exact_key) {
- snippet.content.clone()
- } else {
- snippets_by_name
- .get(snippet_name)
- .and_then(|list| list.first().map(|snippet| snippet.content.clone()))
- .ok_or(Error::UnableToUpdateREADME)?
- }
- } else {
- example.content.clone()
- };
-
- updated_content.push_str(&replacement_content);
- last_position = full_match.end();
- }
-
- updated_content.push_str(&original_content[last_position..]);
-
- // Replace all {{VERSION}} placeholders
- let final_content = updated_content.replace("{{VERSION}}", version.as_str());
-
- fs::write(&readme_path, final_content).map_err(|_| Error::UnableToUpdateREADME)?;
- Ok(())
-}
-
-fn normalize_slashes(path: &Path) -> String {
- normalize_slashes_str(&path.to_string_lossy())
-}
-
-fn normalize_slashes_str<S: AsRef<str>>(text: S) -> String {
- text.as_ref().replace('\\', "/")
-}
diff --git a/crates/cli-release/src/utilities/snippets.rs b/crates/cli-release/src/utilities/snippets.rs
deleted file mode 100644
index aca1d1adb..000000000
--- a/crates/cli-release/src/utilities/snippets.rs
+++ /dev/null
@@ -1,73 +0,0 @@
-use std::{fs, path::PathBuf};
-
-use regex::Regex;
-
-use crate::types::{Error, Snippet};
-
-pub fn extract_snippets(path: PathBuf) -> Result<Vec<Snippet>, Error> {
- let start_re = Regex::new(r"(?m)^\s*//\s*snippet:([^\s]+)\s*$").map_err(|_| Error::UnableToExtractSnippets)?;
- let mut results = Vec::new();
-
- let files = fs::read_dir(path).map_err(|_| Error::UnableToExtractSnippets)?;
- for file in files {
- let file = file.map_err(|_| Error::UnableToExtractSnippets)?;
- let path = file.path();
- let contents = fs::read_to_string(path.clone()).map_err(|_| Error::UnableToExtractSnippets)?;
-
- for start_cap in start_re.captures_iter(&contents) {
- let name = start_cap.get(1).ok_or_else(|| Error::UnableToExtractSnippets)?.as_str().to_string();
- let body_start = start_cap.get(0).ok_or_else(|| Error::UnableToExtractSnippets)?.end();
-
- let end_re = Regex::new(&format!(r"(?m)^\s*//\s*endsnippet:{}\s*$", regex::escape(&name)))
- .map_err(|_| Error::UnableToExtractSnippets)?;
-
- let end_match = end_re.find_at(&contents, body_start).ok_or_else(|| Error::UnableToExtractSnippets)?;
-
- let mut content = &contents[body_start..end_match.start()];
- if let Some(stripped) = content.strip_prefix('\n') {
- content = stripped;
- }
- let content = content.trim_end().to_string();
- let content = align_to_first_line_indent(&content).to_string();
-
- let snippet = Snippet::new(name, content, path.clone());
- results.push(snippet);
- }
- }
-
- Ok(results)
-}
-
-fn align_to_first_line_indent(body: &str) -> String {
- // Trim leading/trailing blank lines first
- let mut lines: Vec<&str> = body.lines().collect();
-
- // leading blanks
- while lines.first().is_some_and(|l| l.trim().is_empty()) {
- lines.remove(0);
- }
- // trailing blanks
- while lines.last().is_some_and(|l| l.trim().is_empty()) {
- lines.pop();
- }
-
- if lines.is_empty() {
- return String::new();
- }
-
- // Determine the exact whitespace prefix (spaces/tabs) of the first non-empty line
- let first_non_empty_idx = lines.iter().position(|l| !l.trim().is_empty()).unwrap_or(0);
- let first = lines[first_non_empty_idx];
- let indent_prefix: String = first.chars().take_while(|c| *c == ' ' || *c == '\t').collect();
-
- // Strip exactly that prefix from every line when present; leave others untouched
- let mut out = String::new();
- for (i, line) in lines.iter().enumerate() {
- let dedented = line.strip_prefix(&indent_prefix).unwrap_or(line);
- if i > 0 {
- out.push('\n');
- }
- out.push_str(dedented);
- }
- out
-}
diff --git a/crates/cli-storage/Cargo.toml b/crates/cli-storage/Cargo.toml
index e682bef33..c802e2b61 100644
--- a/crates/cli-storage/Cargo.toml
+++ b/crates/cli-storage/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "cli-storage"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[[bin]]
name = "cli-storage"
diff --git a/crates/cli-release/Cargo.toml b/crates/cli-tools/Cargo.toml
similarity index 59%
rename from crates/cli-release/Cargo.toml
rename to crates/cli-tools/Cargo.toml
index 523dbe17f..e0f5589c9 100644
--- a/crates/cli-release/Cargo.toml
+++ b/crates/cli-tools/Cargo.toml
@@ -1,21 +1,28 @@
[package]
-name = "cli-release"
-version.workspace = true
+name = "cli-tools"
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[[bin]]
-name = "cli-release"
+name = "cli-tools"
path = "src/main.rs"
[dependencies]
clap.workspace = true
-thiserror.workspace = true
ignore.workspace = true
-serde_json.workspace = true
-regex.workspace = true
heck.workspace = true
syn.workspace = true
+serde.workspace = true
+toml.workspace = true
+toml_edit.workspace = true
+regex.workspace = true
+serde_json.workspace = true
+minijinja.workspace = true
+anyhow.workspace = true
+indexmap.workspace = true
+colored.workspace = true
diff --git a/crates/cli-tools/src/configs/language.rs b/crates/cli-tools/src/configs/language.rs
new file mode 100644
index 000000000..a16c09e9d
--- /dev/null
+++ b/crates/cli-tools/src/configs/language.rs
@@ -0,0 +1,20 @@
+use serde::{Deserialize, Serialize};
+
+use crate::types::Bindings;
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub struct LanguageMetadata {
+ pub image_url: String,
+ pub badges: Vec<String>,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub struct LanguageConfig {
+ pub targets: Vec<String>,
+ pub tools: Vec<String>,
+ pub bindings: Vec<Bindings>,
+ pub examples_path: String,
+ pub metadata: LanguageMetadata,
+}
diff --git a/crates/cli-tools/src/configs/mod.rs b/crates/cli-tools/src/configs/mod.rs
new file mode 100644
index 000000000..131f52800
--- /dev/null
+++ b/crates/cli-tools/src/configs/mod.rs
@@ -0,0 +1,13 @@
+mod language;
+mod paths;
+mod platforms;
+mod target;
+mod tool;
+mod workspace;
+
+pub use language::{LanguageConfig, LanguageMetadata};
+pub use paths::Paths;
+pub use platforms::{ALL_TARGET, ExampleConfig, HOST_TARGET, PlatformsConfig};
+pub use target::TargetConfig;
+pub use tool::{ToolConfig, ToolProvider};
+pub use workspace::{WorkspaceConfig, WorkspaceManifest, WorkspacePackage};
diff --git a/crates/cli-tools/src/configs/paths.rs b/crates/cli-tools/src/configs/paths.rs
new file mode 100644
index 000000000..f011ccb48
--- /dev/null
+++ b/crates/cli-tools/src/configs/paths.rs
@@ -0,0 +1,127 @@
+use std::path::PathBuf;
+
+use anyhow::{Context, Result};
+
+use crate::types::Language;
+
+pub struct Paths {
+ pub root_path: PathBuf,
+ pub main_crate: String,
+}
+
+impl Paths {
+ pub fn new() -> Result<Self> {
+ let error_message = "ROOT_PATH not found";
+ let root_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
+ .parent()
+ .context(error_message)?
+ .parent()
+ .context(error_message)?
+ .to_path_buf();
+ Ok(Self {
+ root_path,
+ main_crate: "uzu".to_string(),
+ })
+ }
+
+ pub fn target_path(&self) -> PathBuf {
+ self.root_path.join("target")
+ }
+
+ pub fn target_wheels_path(&self) -> PathBuf {
+ self.target_path().join("wheels")
+ }
+
+ pub fn artifacts_path(&self) -> PathBuf {
+ self.target_path().join("cli-tools")
+ }
+
+ pub fn platforms_toml(&self) -> PathBuf {
+ self.root_path.join("platforms.toml")
+ }
+
+ pub fn readme_template_path(&self) -> PathBuf {
+ self.root_path.join("workspace").join("readme").join("template.md")
+ }
+
+ pub fn readme_fragments_path(&self) -> PathBuf {
+ self.root_path.join("workspace").join("readme").join("fragments")
+ }
+
+ pub fn workspace_manifest_path(&self) -> PathBuf {
+ self.root_path.join("Cargo.toml")
+ }
+
+ pub fn bindings_path(&self) -> PathBuf {
+ self.root_path.join("bindings")
+ }
+
+ pub fn bindings_for_language_path(
+ &self,
+ language: Language,
+ ) -> PathBuf {
+ self.bindings_path().join(language.name())
+ }
+
+ pub fn crates_path(&self) -> PathBuf {
+ self.root_path.join("crates")
+ }
+
+ pub fn crate_path(
+ &self,
+ name: &str,
+ ) -> PathBuf {
+ self.crates_path().join(name)
+ }
+
+ pub fn crate_manifest_path(
+ &self,
+ name: &str,
+ ) -> PathBuf {
+ self.crate_path(name).join("Cargo.toml")
+ }
+
+ pub fn napi_output_path(&self) -> PathBuf {
+ self.bindings_for_language_path(Language::TypeScript).join("src").join("napi")
+ }
+
+ pub fn swift_xcframework_path(&self) -> PathBuf {
+ self.bindings_for_language_path(Language::Swift).join(format!("{}.xcframework", self.main_crate))
+ }
+
+ pub fn swift_generated_sources_path(&self) -> PathBuf {
+ self.bindings_for_language_path(Language::Swift).join("Sources").join("Uzu").join("Generated")
+ }
+
+ pub fn swift_slices_path(&self) -> PathBuf {
+ self.artifacts_path().join("swift").join("slices")
+ }
+
+ pub fn release_workspace_path(&self) -> PathBuf {
+ self.root_path.join("workspace").join("release")
+ }
+
+ pub fn release_platform_path(&self) -> PathBuf {
+ self.release_workspace_path().join("platform")
+ }
+
+ pub fn release_docs_path(&self) -> PathBuf {
+ self.release_workspace_path().join("docs")
+ }
+
+ pub fn release_swift_spm_path(&self) -> PathBuf {
+ self.release_workspace_path().join("swift-spm")
+ }
+
+ pub fn release_typescript_npm_path(&self) -> PathBuf {
+ self.release_workspace_path().join("typescript-npm")
+ }
+
+ pub fn release_python_pypi_path(&self) -> PathBuf {
+ self.release_workspace_path().join("python-pypi")
+ }
+
+ pub fn root_package_swift_path(&self) -> PathBuf {
+ self.root_path.join("Package.swift")
+ }
+}
diff --git a/crates/cli-tools/src/configs/platforms.rs b/crates/cli-tools/src/configs/platforms.rs
new file mode 100644
index 000000000..1efc8719e
--- /dev/null
+++ b/crates/cli-tools/src/configs/platforms.rs
@@ -0,0 +1,156 @@
+use std::{fs, path::PathBuf};
+
+use anyhow::{Context, Ok, Result, anyhow};
+use indexmap::IndexMap;
+use serde::{Deserialize, Serialize};
+
+use crate::{
+ configs::{LanguageConfig, Paths, TargetConfig, ToolConfig},
+ types::{Backend, Bindings, Capability, Language, Tool},
+};
+
+pub const HOST_TARGET: &str = "host";
+pub const ALL_TARGET: &str = "all";
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub struct ExampleConfig {
+ pub title: String,
+ pub description: String,
+ pub explanation: Option<String>,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub struct PlatformsConfig {
+ pub envs: IndexMap<String, String>,
+ pub badges: IndexMap<String, String>,
+ pub examples: IndexMap<String, ExampleConfig>,
+ pub tools: IndexMap<String, ToolConfig>,
+ pub targets: IndexMap<String, TargetConfig>,
+ pub languages: IndexMap<Language, LanguageConfig>,
+}
+
+impl PlatformsConfig {
+ pub fn load() -> Result<Self> {
+ let path = Paths::new()?.platforms_toml();
+ let body = fs::read_to_string(&path)?;
+ Ok(toml::from_str(&body)?)
+ }
+
+ pub fn tools_for_language(
+ &self,
+ language: Language,
+ ) -> Result<Vec<Tool>> {
+ let tool_names = self.languages.get(&language).context("Language not found")?.tools.clone();
+ let tools: Vec<_> = tool_names
+ .iter()
+ .map(|name| {
+ self.tools.get(name).context("Tool not found").map(|config| Tool {
+ name: name.clone(),
+ provider: config.provider.clone(),
+ version: config.version.clone(),
+ })
+ })
+ .collect::<Result<_, _>>()?;
+ Ok(tools)
+ }
+
+ pub fn host_target(&self) -> Result<String> {
+ let arch = std::env::consts::ARCH;
+ let os = std::env::consts::OS;
+ let name = match os {
+ "macos" => format!("{arch}-apple-darwin"),
+ "linux" => format!("{arch}-unknown-linux-gnu"),
+ "windows" => format!("{arch}-pc-windows-msvc"),
+ _ => return Err(anyhow!("Unsupported host OS: {os}")),
+ };
+ Ok(name)
+ }
+
+ pub fn targets_for_language(
+ &self,
+ language: Language,
+ requested_targets: Vec<String>,
+ ) -> Result<Vec<String>> {
+ let host_target = self.host_target()?;
+ let target_configs = self.targets.iter().collect::<Vec<_>>();
+ let requested_targets = target_configs
+ .iter()
+ .filter(|(name, config)| {
+ requested_targets.contains(name)
+ || config.aliases.iter().any(|alias| requested_targets.contains(alias))
+ || (requested_targets.contains(&HOST_TARGET.to_string()) && (*name == &host_target))
+ || requested_targets.contains(&ALL_TARGET.to_string())
+ })
+ .map(|(name, _)| (*name).clone())
+ .collect::<Vec<_>>();
+
+ let language_config = self.languages.get(&language).context("Language not found")?;
+ let language_targets = language_config.targets.clone();
+
+ let resolved_targets = language_targets
+ .iter()
+ .filter(|target| requested_targets.contains(target))
+ .map(|target| target.clone())
+ .collect::<Vec<_>>();
+ Ok(resolved_targets)
+ }
+
+ pub fn backend_for_target(
+ &self,
+ target: String,
+ ) -> Result<Backend> {
+ let target_config = self.targets.get(&target).context("Target not found")?;
+ Ok(target_config.backend.clone())
+ }
+
+ pub fn capabilities_for_target(
+ &self,
+ target: String,
+ requested_capabilities: Vec<Capability>,
+ ) -> Result<Vec<Capability>> {
+ let target_config = self.targets.get(&target).context("Target not found")?;
+
+ let default_capabilities = target_config.capabilities_default.clone();
+ if requested_capabilities.is_empty() {
+ return Ok(default_capabilities);
+ }
+
+ let supported_capabilities = target_config.capabilities_supported.clone();
+ Ok(requested_capabilities
+ .iter()
+ .filter(|capability| supported_capabilities.contains(capability))
+ .map(|capability| capability.clone())
+ .collect::<Vec<_>>())
+ }
+
+ pub fn bindings_for_language(
+ &self,
+ language: Language,
+ ) -> Result<Vec<Bindings>> {
+ let language_config = self.languages.get(&language).context("Language not found")?;
+ Ok(language_config.bindings.clone())
+ }
+
+ pub fn examples_path_for_language(
+ &self,
+ language: Language,
+ ) -> Result<PathBuf> {
+ let language_config = self.languages.get(&language).context("Language not found")?;
+ Ok(Paths::new()?.root_path.join(&language_config.examples_path))
+ }
+
+ pub fn required_envs_for_target(
+ &self,
+ target: String,
+ ) -> Result<IndexMap<String, String>> {
+ let target_config = self.targets.get(&target).context("Target not found")?;
+ let required_envs = target_config.required_envs.clone();
+ let mut envs = IndexMap::new();
+ for env in required_envs {
+ envs.insert(env.clone(), self.envs.get(&env).context("Environment variable not found")?.clone());
+ }
+ Ok(envs)
+ }
+}
diff --git a/crates/cli-tools/src/configs/target.rs b/crates/cli-tools/src/configs/target.rs
new file mode 100644
index 000000000..4e7157cc3
--- /dev/null
+++ b/crates/cli-tools/src/configs/target.rs
@@ -0,0 +1,14 @@
+use serde::{Deserialize, Serialize};
+
+use crate::types::{Backend, Capability};
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub struct TargetConfig {
+ pub backend: Backend,
+ pub aliases: Vec<String>,
+ pub capabilities_supported: Vec<Capability>,
+ pub capabilities_default: Vec<Capability>,
+ #[serde(default)]
+ pub required_envs: Vec<String>,
+}
diff --git a/crates/cli-tools/src/configs/tool.rs b/crates/cli-tools/src/configs/tool.rs
new file mode 100644
index 000000000..d39f88216
--- /dev/null
+++ b/crates/cli-tools/src/configs/tool.rs
@@ -0,0 +1,15 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum ToolProvider {
+ Cargo,
+ Uv,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub struct ToolConfig {
+ pub provider: ToolProvider,
+ pub version: String,
+}
diff --git a/crates/cli-tools/src/configs/workspace.rs b/crates/cli-tools/src/configs/workspace.rs
new file mode 100644
index 000000000..ffa8cd34a
--- /dev/null
+++ b/crates/cli-tools/src/configs/workspace.rs
@@ -0,0 +1,38 @@
+use std::fs;
+
+use anyhow::{Context, Result};
+use serde::{Deserialize, Serialize};
+
+use crate::configs::Paths;
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+pub struct WorkspacePackage {
+ pub version: String,
+ pub description: String,
+ pub authors: Vec<String>,
+ pub homepage: String,
+ pub repository: String,
+ pub license: String,
+ pub readme: String,
+ #[serde(default)]
+ pub keywords: Vec<String>,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+pub struct WorkspaceConfig {
+ pub package: WorkspacePackage,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+pub struct WorkspaceManifest {
+ pub workspace: WorkspaceConfig,
+}
+
+impl WorkspaceManifest {
+ pub fn load() -> Result<Self> {
+ let path = Paths::new()?.workspace_manifest_path();
+ let body = fs::read_to_string(&path).with_context(|| format!("Failed to read {}", path.display()))?;
+ let manifest: WorkspaceManifest = toml::from_str(&body)?;
+ Ok(manifest)
+ }
+}
diff --git a/crates/cli-tools/src/languages/mod.rs b/crates/cli-tools/src/languages/mod.rs
new file mode 100644
index 000000000..a2372f959
--- /dev/null
+++ b/crates/cli-tools/src/languages/mod.rs
@@ -0,0 +1,190 @@
+mod python;
+mod rust;
+mod swift;
+mod swift_extensions;
+mod typescript;
+
+use anyhow::{Result, anyhow};
+use colored::Colorize;
+pub use python::PythonLanguageBackend;
+pub use rust::RustLanguageBackend;
+pub use swift::SwiftLanguageBackend;
+pub use swift_extensions::generate_swift_extensions;
+pub use typescript::TypeScriptLanguageBackend;
+
+use crate::{
+ configs::PlatformsConfig,
+ types::{Capability, Configuration, Language},
+};
+
+#[derive(Clone)]
+pub struct LanguageBackendTarget {
+ pub name: String,
+ pub features: Vec<String>,
+}
+
+impl LanguageBackendTarget {
+ pub fn new(
+ name: String,
+ features: Vec<String>,
+ ) -> Self {
+ Self {
+ name,
+ features,
+ }
+ }
+}
+
+pub trait LanguageBackend {
+ fn config(&self) -> PlatformsConfig;
+
+ fn language(&self) -> Language;
+
+ fn expects_prebuild_for_run(&self) -> bool {
+ return true;
+ }
+
+ fn install(&self) -> Result<()> {
+ let language = self.language();
+ let tools = self.config().tools_for_language(language)?;
+ for tool in tools {
+ let command = tool.command();
+ command.run()?;
+ }
+ Ok(())
+ }
+
+ fn build(
+ &self,
+ configuration: Configuration,
+ targets: Vec<String>,
+ capabilities: Vec<Capability>,
+ ) -> Result<()> {
+ let targets = self.resolve_targets("build".to_string(), configuration, targets, capabilities)?;
+ self.build_targets(configuration, targets)?;
+ Ok(())
+ }
+
+ fn build_targets(
+ &self,
+ _configuration: Configuration,
+ _targets: Vec<LanguageBackendTarget>,
+ ) -> Result<()> {
+ Ok(())
+ }
+
+ fn test(
+ &self,
+ configuration: Configuration,
+ target: String,
+ capabilities: Vec<Capability>,
+ ) -> Result<()> {
+ let targets = self.resolve_targets("test".to_string(), configuration, vec![target], capabilities)?;
+ if targets.len() != 1 {
+ return Err(anyhow!("Expected 1 target for test, got {}", targets.len()));
+ }
+ let target = targets.first().cloned().ok_or(anyhow!("Target not found"))?;
+ self.test_target(configuration, target)?;
+ Ok(())
+ }
+
+ fn test_target(
+ &self,
+ _configuration: Configuration,
+ _target: LanguageBackendTarget,
+ ) -> Result<()> {
+ Ok(())
+ }
+
+ fn example(
+ &self,
+ name: &str,
+ configuration: Configuration,
+ target: String,
+ capabilities: Vec<Capability>,
+ ) -> Result<()> {
+ let targets = self.resolve_targets("example".to_string(), configuration, vec![target], capabilities)?;
+ if targets.len() != 1 {
+ return Err(anyhow!("Expected 1 target for example, got {}", targets.len()));
+ }
+ let target = targets.first().cloned().ok_or(anyhow!("Target not found"))?;
+ self.example_target(name, configuration, target)?;
+ Ok(())
+ }
+
+ fn example_target(
+ &self,
+ _name: &str,
+ _configuration: Configuration,
+ _target: LanguageBackendTarget,
+ ) -> Result<()> {
+ Ok(())
+ }
+
+ fn release(
+ &self,
+ _version: &str,
+ ) -> Result<()> {
+ Ok(())
+ }
+
+ fn resolve_targets(
+ &self,
+ name: String,
+ configuration: Configuration,
+ targets: Vec<String>,
+ capabilities: Vec<Capability>,
+ ) -> Result<Vec<LanguageBackendTarget>> {
+ let separator = "--------------------------------------------------".green();
+ let language = self.language();
+ let bindings = self.config().bindings_for_language(language)?;
+ let resolved_targets = self.config().targets_for_language(language, targets.clone())?;
+ if resolved_targets.is_empty() {
+ return Err(anyhow!("None of the provided targets are supported for language: {language:?}"));
+ }
+ println!("{separator}");
+ println!(
+ "Running {} of {} ({}) for targets: {} (resolved from: {})",
+ name.green(),
+ format!("{:?}", language).green(),
+ format!("{:?}", configuration).green(),
+ format!("{:?}", resolved_targets).green(),
+ format!("{:?}", targets).yellow()
+ );
+ println!("{separator}");
+
+ let targets = resolved_targets
+ .iter()
+ .map(|target| {
+ println!("Resolving target: {}", target.green());
+
+ let backend = self.config().backend_for_target(target.clone())?;
+ let resolved_capabilities =
+ self.config().capabilities_for_target(target.clone(), capabilities.clone())?;
+ let features = vec![
+ vec![backend.feature()],
+ resolved_capabilities.iter().map(|capability| capability.feature()).collect::<Vec<_>>(),
+ bindings.iter().map(|binding| binding.feature()).collect::<Vec<_>>(),
+ ]
+ .iter()
+ .flatten()
+ .map(|feature| feature.clone())
+ .collect::<Vec<_>>();
+
+ println!("Backend: {}", format!("{:?}", backend).green());
+ println!(
+ "Capabilities: {} (resolved from: {})",
+ format!("{:?}", resolved_capabilities).green(),
+ format!("{:?}", capabilities).yellow()
+ );
+ println!("Features: {}", format!("{:?}", features).green());
+ println!("{separator}");
+
+ Ok(LanguageBackendTarget::new(target.clone(), features.clone()))
+ })
+ .collect::<Vec<Result<LanguageBackendTarget>>>()
+ .into_iter()
+ .collect::<Result<Vec<_>>>()?;
+ Ok(targets)
+ }
+}
diff --git a/crates/cli-tools/src/languages/python.rs b/crates/cli-tools/src/languages/python.rs
new file mode 100644
index 000000000..7af03911b
--- /dev/null
+++ b/crates/cli-tools/src/languages/python.rs
@@ -0,0 +1,141 @@
+use std::{fs, path::PathBuf};
+
+use anyhow::{Context, Result};
+
+use crate::{
+ configs::{ALL_TARGET, Paths, PlatformsConfig},
+ languages::{LanguageBackend, LanguageBackendTarget},
+ types::{Capability, Command, Configuration, Language},
+};
+
+pub struct PythonLanguageBackend {
+ config: PlatformsConfig,
+}
+
+impl PythonLanguageBackend {
+ pub fn new(config: PlatformsConfig) -> Self {
+ Self {
+ config,
+ }
+ }
+}
+
+impl LanguageBackend for PythonLanguageBackend {
+ fn config(&self) -> PlatformsConfig {
+ self.config.clone()
+ }
+
+ fn language(&self) -> Language {
+ Language::Python
+ }
+
+ fn build_targets(
+ &self,
+ configuration: Configuration,
+ targets: Vec<LanguageBackendTarget>,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let bindings_path = paths.bindings_for_language_path(self.language());
+ let (zig_path, _) = Command::which("python-zig".to_string()).output()?;
+
+ let host_target = self.config.host_target()?;
+ for target in targets {
+ let (_, stderr) = Command::maturin_build(target.name.clone(), target.features.clone(), configuration)
+ .with_current_path(&bindings_path)
+ .with_env("CARGO_ZIGBUILD_ZIG_PATH", &zig_path)
+ .with_envs(self.config.required_envs_for_target(target.name.clone())?)
+ .output()?;
+ let wheel_path = parse_wheel_path(&stderr)?;
+ if target.name == host_target {
+ let envs = self.config.required_envs_for_target(target.name.clone())?;
+ if !bindings_path.join(".venv").exists() {
+ Command::uv_venv().with_current_path(&bindings_path).run()?;
+ }
+ Command::uv_pip_install_wheel(wheel_path.clone())
+ .with_current_path(&bindings_path)
+ .with_envs(envs.clone())
+ .run()?;
+ Command::new("unzip")
+ .with_argument("-o")
+ .with_argument(&wheel_path.to_string_lossy())
+ .with_argument(&format!("{}/uzu.abi3.so", paths.main_crate))
+ .with_argument("-d")
+ .with_argument(&bindings_path.to_string_lossy())
+ .run()?;
+ Command::uv_python("import uzu; uzu.generate_annotations()")
+ .with_current_path(&bindings_path)
+ .with_envs(envs)
+ .run()?;
+ }
+ }
+ Ok(())
+ }
+
+ fn test_target(
+ &self,
+ _configuration: Configuration,
+ _target: LanguageBackendTarget,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let bindings_path = paths.bindings_for_language_path(self.language());
+ Command::uv_pytest().with_current_path(&bindings_path).run()
+ }
+
+ fn example_target(
+ &self,
+ name: &str,
+ _configuration: Configuration,
+ _target: LanguageBackendTarget,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let bindings_path = paths.bindings_for_language_path(self.language());
+ let examples_path = self.config.examples_path_for_language(self.language())?;
+ let name = self.language().convert_file_name(name);
+ let file_path = examples_path.join(format!("{name}.py"));
+ Command::uv_python_file(file_path).with_current_path(&bindings_path).run()
+ }
+
+ fn release(
+ &self,
+ _version: &str,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let wheels_root = paths.target_wheels_path();
+ if wheels_root.exists() {
+ fs::remove_dir_all(&wheels_root)?;
+ }
+
+ self.build(Configuration::Release, vec![ALL_TARGET.to_string()], Vec::<Capability>::new())?;
+
+ let destination = paths.release_python_pypi_path();
+ if destination.exists() {
+ fs::remove_dir_all(&destination)?;
+ }
+ fs::create_dir_all(&destination)?;
+
+ if !wheels_root.exists() {
+ anyhow::bail!("No wheels at {}", wheels_root.display());
+ }
+
+ let mut copied = 0;
+ for entry in fs::read_dir(&wheels_root)? {
+ let entry = entry?;
+ let path = entry.path();
+ if path.extension().and_then(|extension| extension.to_str()) == Some("whl") {
+ fs::copy(&path, destination.join(entry.file_name()))?;
+ copied += 1;
+ }
+ }
+ if copied == 0 {
+ anyhow::bail!("No `.whl` files found in {}", wheels_root.display());
+ }
+ Ok(())
+ }
+}
+
+fn parse_wheel_path(stdout: &str) -> Result<PathBuf> {
+ let line =
+ stdout.lines().find(|line| line.contains("Built wheel")).context("maturin did not report a built wheel")?;
+ let (_, path) = line.rsplit_once(" to ").context("Could not parse wheel path from maturin output")?;
+ Ok(PathBuf::from(path.trim()))
+}
diff --git a/crates/cli-tools/src/languages/rust.rs b/crates/cli-tools/src/languages/rust.rs
new file mode 100644
index 000000000..65c4c0402
--- /dev/null
+++ b/crates/cli-tools/src/languages/rust.rs
@@ -0,0 +1,73 @@
+use anyhow::Result;
+
+use crate::{
+ configs::{Paths, PlatformsConfig},
+ languages::{LanguageBackend, LanguageBackendTarget},
+ types::{Command, Configuration, Language},
+};
+
+pub struct RustLanguageBackend {
+ config: PlatformsConfig,
+}
+
+impl RustLanguageBackend {
+ pub fn new(config: PlatformsConfig) -> Self {
+ Self {
+ config,
+ }
+ }
+}
+
+impl LanguageBackend for RustLanguageBackend {
+ fn config(&self) -> PlatformsConfig {
+ self.config.clone()
+ }
+
+ fn language(&self) -> Language {
+ Language::Rust
+ }
+
+ fn expects_prebuild_for_run(&self) -> bool {
+ return false;
+ }
+
+ fn build_targets(
+ &self,
+ configuration: Configuration,
+ targets: Vec<LanguageBackendTarget>,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ for target in targets {
+ Command::cargo_build(paths.main_crate.clone(), target.name.clone(), target.features.clone(), configuration)
+ .with_envs(self.config.required_envs_for_target(target.name.clone())?)
+ .run()?;
+ }
+ Ok(())
+ }
+
+ fn test_target(
+ &self,
+ configuration: Configuration,
+ target: LanguageBackendTarget,
+ ) -> Result<()> {
+ Command::cargo_test(target.name.clone(), target.features.clone(), configuration).run()
+ }
+
+ fn example_target(
+ &self,
+ name: &str,
+ configuration: Configuration,
+ target: LanguageBackendTarget,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let name = self.language().convert_command_name(name);
+ Command::cargo_run_example(
+ paths.main_crate.clone(),
+ name,
+ target.name.clone(),
+ target.features.clone(),
+ configuration,
+ )
+ .run()
+ }
+}
diff --git a/crates/cli-tools/src/languages/swift.rs b/crates/cli-tools/src/languages/swift.rs
new file mode 100644
index 000000000..a40b6a746
--- /dev/null
+++ b/crates/cli-tools/src/languages/swift.rs
@@ -0,0 +1,239 @@
+use std::{
+ fs,
+ path::{Path, PathBuf},
+};
+
+use anyhow::{Context, Result, anyhow};
+
+use crate::{
+ configs::{ALL_TARGET, Paths, PlatformsConfig},
+ languages::{LanguageBackend, LanguageBackendTarget, generate_swift_extensions},
+ types::{Capability, Command, Configuration, Language},
+ utilities::fs::copy_directory,
+};
+
+const FRAMEWORK_URL_TEMPLATE: &str = "https://artifacts.trymirai.com/uzu-swift/releases/{version}.zip";
+
+pub struct SwiftLanguageBackend {
+ config: PlatformsConfig,
+}
+
+impl SwiftLanguageBackend {
+ pub fn new(config: PlatformsConfig) -> Self {
+ Self {
+ config,
+ }
+ }
+}
+
+impl LanguageBackend for SwiftLanguageBackend {
+ fn config(&self) -> PlatformsConfig {
+ self.config.clone()
+ }
+
+ fn language(&self) -> Language {
+ Language::Swift
+ }
+
+ fn build_targets(
+ &self,
+ configuration: Configuration,
+ targets: Vec<LanguageBackendTarget>,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let crate_path = paths.crate_path(&paths.main_crate);
+ let xcframework_path = paths.swift_xcframework_path();
+ let generated_sources_path = paths.swift_generated_sources_path();
+ let extensions_path = generated_sources_path.join("Extensions.swift");
+
+ let slices_path = paths.swift_slices_path();
+ let output_path = crate_path.join(&paths.main_crate);
+
+ if slices_path.exists() {
+ fs::remove_dir_all(&slices_path)?;
+ }
+ fs::create_dir_all(&slices_path)?;
+
+ for target in targets.iter() {
+ if output_path.exists() {
+ fs::remove_dir_all(&output_path)?;
+ }
+
+ Command::cargo_swift_package(
+ paths.main_crate.clone(),
+ target.name.clone(),
+ target.features.clone(),
+ configuration,
+ )
+ .with_current_path(&crate_path)
+ .with_envs(self.config.required_envs_for_target(target.name.clone())?)
+ .run()?;
+
+ let slice_dir = slices_path.join(&target.name);
+ fs::rename(&output_path, &slice_dir).context("Moving cargo-swift output to slice dir")?;
+ }
+
+ if xcframework_path.exists() {
+ fs::remove_dir_all(&xcframework_path)?;
+ }
+ let slice_libs_with_headers = collect_slice_libs_with_headers(&paths.main_crate, &slices_path)?;
+ Command::xcodebuild_create_xcframework(slice_libs_with_headers, xcframework_path.clone()).run()?;
+ Command::codesign_adhoc(xcframework_path).run()?;
+
+ if generated_sources_path.exists() {
+ fs::remove_dir_all(&generated_sources_path)?;
+ }
+ let any_slice_path = fs::read_dir(&slices_path)?.next().context("No slices produced")??;
+ let sources_path = any_slice_path.path().join("Sources");
+ fs::create_dir_all(&generated_sources_path)?;
+ copy_directory(&sources_path, &generated_sources_path)?;
+ generate_swift_extensions(paths.crates_path(), extensions_path.clone())?;
+
+ Ok(())
+ }
+
+ fn test_target(
+ &self,
+ _configuration: Configuration,
+ _target: LanguageBackendTarget,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let bindings_path = paths.bindings_for_language_path(self.language());
+ Command::swift_test().with_current_path(&bindings_path).run()
+ }
+
+ fn example_target(
+ &self,
+ name: &str,
+ _configuration: Configuration,
+ _target: LanguageBackendTarget,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let bindings_path = paths.bindings_for_language_path(self.language());
+ let name = self.language().convert_command_name(name);
+ Command::swift_run_example(name).with_current_path(&bindings_path).run()
+ }
+
+ fn release(
+ &self,
+ version: &str,
+ ) -> Result<()> {
+ self.build(Configuration::Release, vec![ALL_TARGET.to_string()], Vec::<Capability>::new())?;
+
+ let paths = Paths::new()?;
+ let xcframework_path = paths.swift_xcframework_path();
+ if !xcframework_path.exists() {
+ anyhow::bail!("Missing xcframework at {}", xcframework_path.display());
+ }
+
+ let spm_root = paths.release_swift_spm_path();
+ if spm_root.exists() {
+ fs::remove_dir_all(&spm_root)?;
+ }
+ fs::create_dir_all(&spm_root)?;
+
+ let zip_path = spm_root.join(format!("{version}.zip"));
+ let xcframework_parent = xcframework_path.parent().context("xcframework path has no parent")?.to_path_buf();
+ let xcframework_name =
+ xcframework_path.file_name().context("xcframework path has no file name")?.to_string_lossy().to_string();
+ Command::zip_directory(xcframework_name.into(), zip_path.clone())
+ .with_current_path(&xcframework_parent)
+ .run()?;
+
+ let (checksum, _) = Command::swift_compute_checksum(zip_path.clone()).output()?;
+ let checksum = checksum
+ .lines()
+ .filter(|line| !line.trim().is_empty())
+ .last()
+ .context("Empty checksum output")?
+ .to_string();
+
+ let source_package_swift = paths.bindings_for_language_path(Language::Swift).join("Package.swift");
+ let body = fs::read_to_string(&source_package_swift)
+ .with_context(|| format!("Failed to read {}", source_package_swift.display()))?;
+ let url = FRAMEWORK_URL_TEMPLATE.replace("{version}", version);
+ let replacement = format!("url: \"{url}\",\n checksum: \"{checksum}\"");
+ let body = body.replace("path: \"uzu.xcframework\"", &replacement);
+
+ let target_paths = [
+ (".target(", "\"Uzu\"", "bindings/swift/Sources/Uzu"),
+ (".executableTarget(", "\"Examples\"", "bindings/swift/Sources/Examples"),
+ (".testTarget(", "\"UzuTests\"", "bindings/swift/Tests/UzuTests"),
+ ];
+ let mut body = body;
+ for (target_kind, name_literal, source_path) in target_paths {
+ let needle = format!("{target_kind}\n name: {name_literal},");
+ let replacement = format!("{needle}\n path: \"{source_path}\",");
+ let updated = body.replace(&needle, &replacement);
+ if updated == body {
+ anyhow::bail!("Failed to inject path for {target_kind} {name_literal}");
+ }
+ body = updated;
+ }
+
+ fs::write(paths.root_package_swift_path(), body)?;
+
+ Ok(())
+ }
+}
+
+fn collect_slice_libs_with_headers(
+ name: &str,
+ slices_path: &Path,
+) -> Result<Vec<(PathBuf, PathBuf)>> {
+ let mut results = Vec::new();
+ for entry in fs::read_dir(slices_path)? {
+ let entry = entry?;
+ let xcframework_path = entry.path().join(format!("{}.xcframework", name));
+ if !xcframework_path.exists() {
+ continue;
+ }
+ for entry in fs::read_dir(&xcframework_path)? {
+ let entry = entry?;
+ let path = entry.path();
+ if !path.is_dir() {
+ continue;
+ }
+ let static_lib_path = find_static_lib(&path)?;
+ let headers_path = find_modulemap_directory(&path.join("Headers"))?;
+ results.push((static_lib_path, headers_path));
+ }
+ }
+ if results.is_empty() {
+ return Err(anyhow!("No slices produced"));
+ }
+ Ok(results)
+}
+
+fn find_modulemap_directory(headers_path: &Path) -> Result<PathBuf> {
+ if headers_path.join("module.modulemap").exists() {
+ return Ok(headers_path.to_path_buf());
+ }
+ for entry in fs::read_dir(headers_path)? {
+ let entry = entry?;
+ let path = entry.path();
+ if path.is_dir() && path.join("module.modulemap").exists() {
+ return Ok(path);
+ }
+ }
+ Err(anyhow!("module.modulemap not found in {}", headers_path.display()))
+}
+
+fn find_static_lib(slice_path: &Path) -> Result<PathBuf> {
+ fn walk(path: &Path) -> Option<PathBuf> {
+ let entries = fs::read_dir(path).ok()?;
+ for entry in entries.flatten() {
+ let path = entry.path();
+ if path.is_file() && path.extension().and_then(|extension| extension.to_str()) == Some("a") {
+ return Some(path);
+ }
+ if path.is_dir() {
+ if let Some(found) = walk(&path) {
+ return Some(found);
+ }
+ }
+ }
+ None
+ }
+ walk(slice_path).context("Static lib (.a) not found in the slice")
+}
diff --git a/crates/cli-release/src/handlers/generate_swift_extensions.rs b/crates/cli-tools/src/languages/swift_extensions.rs
similarity index 96%
rename from crates/cli-release/src/handlers/generate_swift_extensions.rs
rename to crates/cli-tools/src/languages/swift_extensions.rs
index efc3bbd16..65c469416 100644
--- a/crates/cli-release/src/handlers/generate_swift_extensions.rs
+++ b/crates/cli-tools/src/languages/swift_extensions.rs
@@ -1,22 +1,19 @@
-use std::{fs, path::Path};
+use std::{
+ fs,
+ path::{Path, PathBuf},
+};
+use anyhow::Result;
use heck::{AsLowerCamelCase, AsSnakeCase};
use ignore::WalkBuilder;
-use crate::types::{Environment, Error};
-
-pub fn generate_swift_extensions(environment: &Environment) -> Result<(), Error> {
- let (factories, callback_factories, stream_bridges) = collect_all(&environment.crates_path())?;
+pub fn generate_swift_extensions(
+ crates_path: PathBuf,
+ destination_path: PathBuf,
+) -> Result<()> {
+ let (factories, callback_factories, stream_bridges) = collect_all(&crates_path)?;
let swift_source = render_extensions_file(&factories, &callback_factories, &stream_bridges);
-
- let destination =
- environment.bindings().swift_path().join("Sources").join("Uzu").join("Generated").join("Extensions.swift");
-
- if let Some(parent) = destination.parent() {
- fs::create_dir_all(parent).map_err(|_| Error::UnableToPrepareBindingsSwift)?;
- }
- fs::write(&destination, swift_source).map_err(|_| Error::UnableToPrepareBindingsSwift)?;
-
+ fs::write(&destination_path, swift_source)?;
Ok(())
}
@@ -51,7 +48,7 @@ struct StreamBridge {
cancel_getter_name: Option<String>,
}
-fn collect_all(crates_path: &Path) -> Result<(Vec<Factory>, Vec<CallbackFactory>, Vec<StreamBridge>), Error> {
+fn collect_all(crates_path: &Path) -> Result<(Vec<Factory>, Vec<CallbackFactory>, Vec<StreamBridge>)> {
let mut factories: Vec<Factory> = Vec::new();
let mut callback_factories: Vec<CallbackFactory> = Vec::new();
let mut stream_bridges: Vec<StreamBridge> = Vec::new();
@@ -403,7 +400,7 @@ fn render_extensions_file(
stream_bridges: &[StreamBridge],
) -> String {
let mut output = String::new();
- output.push_str("// Auto-generated by cli-release — do not edit.\n\n");
+ output.push_str("// Auto-generated by cli-tools — do not edit.\n\n");
for factory in factories {
output.push_str(&render_factory(factory));
output.push('\n');
diff --git a/crates/cli-tools/src/languages/typescript.rs b/crates/cli-tools/src/languages/typescript.rs
new file mode 100644
index 000000000..1a7b372ba
--- /dev/null
+++ b/crates/cli-tools/src/languages/typescript.rs
@@ -0,0 +1,111 @@
+use std::fs;
+
+use anyhow::Result;
+
+use crate::{
+ configs::{ALL_TARGET, Paths, PlatformsConfig},
+ languages::{LanguageBackend, LanguageBackendTarget},
+ types::{Capability, Command, Configuration, Language},
+ utilities::fs::copy_directory,
+};
+
+pub struct TypeScriptLanguageBackend {
+ config: PlatformsConfig,
+}
+
+impl TypeScriptLanguageBackend {
+ pub fn new(config: PlatformsConfig) -> Self {
+ Self {
+ config,
+ }
+ }
+}
+
+impl LanguageBackend for TypeScriptLanguageBackend {
+ fn config(&self) -> PlatformsConfig {
+ self.config.clone()
+ }
+
+ fn language(&self) -> Language {
+ Language::TypeScript
+ }
+
+ fn build_targets(
+ &self,
+ configuration: Configuration,
+ targets: Vec<LanguageBackendTarget>,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let manifest_path = paths.crate_manifest_path(&paths.main_crate);
+ let bindings_path = paths.bindings_for_language_path(self.language());
+ let output_path = paths.napi_output_path();
+ let (zig_path, _) = Command::which("python-zig".to_string()).output()?;
+ let host_target = self.config.host_target()?;
+
+ Command::pnpm_install().with_current_path(&bindings_path).run()?;
+
+ for target in targets.iter() {
+ Command::napi_build(
+ manifest_path.clone(),
+ target.name.clone(),
+ target.features.clone(),
+ configuration,
+ output_path.clone(),
+ )
+ .with_current_path(&bindings_path)
+ .with_env("CARGO_ZIGBUILD_ZIG_PATH", &zig_path)
+ .with_envs(self.config.required_envs_for_target(target.name.clone())?)
+ .run()?;
+ if target.name == host_target {
+ Command::pnpm_run("fix").with_current_path(&bindings_path).run()?;
+ Command::pnpm_run("build").with_current_path(&bindings_path).run()?;
+ }
+ }
+
+ Ok(())
+ }
+
+ fn test_target(
+ &self,
+ _configuration: Configuration,
+ _target: LanguageBackendTarget,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let bindings_path = paths.bindings_for_language_path(self.language());
+ Command::pnpm_jest().with_current_path(&bindings_path).run()
+ }
+
+ fn example_target(
+ &self,
+ name: &str,
+ _configuration: Configuration,
+ _target: LanguageBackendTarget,
+ ) -> Result<()> {
+ let paths = Paths::new()?;
+ let bindings_path = paths.bindings_for_language_path(self.language());
+ let examples_path = self.config.examples_path_for_language(self.language())?;
+ let name = self.language().convert_file_name(name);
+ let file_path = examples_path.join(format!("{name}.ts"));
+ Command::pnpm_tsn(file_path).with_current_path(&bindings_path).run()
+ }
+
+ fn release(
+ &self,
+ _version: &str,
+ ) -> Result<()> {
+ self.build(Configuration::Release, vec![ALL_TARGET.to_string()], Vec::<Capability>::new())?;
+
+ let paths = Paths::new()?;
+ let source = paths.bindings_for_language_path(self.language()).join("dist");
+ if !source.exists() {
+ anyhow::bail!("Missing dist folder at {}", source.display());
+ }
+
+ let destination = paths.release_typescript_npm_path();
+ if destination.exists() {
+ fs::remove_dir_all(&destination)?;
+ }
+ copy_directory(&source, &destination)?;
+ Ok(())
+ }
+}
diff --git a/crates/cli-tools/src/lib.rs b/crates/cli-tools/src/lib.rs
new file mode 100644
index 000000000..64a68bcaa
--- /dev/null
+++ b/crates/cli-tools/src/lib.rs
@@ -0,0 +1,6 @@
+pub mod configs;
+pub mod languages;
+pub mod release;
+pub mod sync;
+pub mod types;
+pub mod utilities;
diff --git a/crates/cli-tools/src/main.rs b/crates/cli-tools/src/main.rs
new file mode 100644
index 000000000..ba4912871
--- /dev/null
+++ b/crates/cli-tools/src/main.rs
@@ -0,0 +1,164 @@
+use anyhow::{Result, anyhow};
+use clap::{CommandFactory, Parser, Subcommand};
+use cli_tools::{
+ configs::{HOST_TARGET, PlatformsConfig},
+ languages::{
+ LanguageBackend, PythonLanguageBackend, RustLanguageBackend, SwiftLanguageBackend, TypeScriptLanguageBackend,
+ },
+ release::run_release,
+ sync::run_sync,
+ types::{Capability, Command, Configuration, Language},
+};
+
+#[derive(Parser)]
+#[command(name = "uzu-tools", bin_name = "uzu-tools")]
+struct Cli {
+ #[command(subcommand)]
+ command: Option<Commands>,
+}
+
+#[derive(Subcommand)]
+enum Commands {
+ /// Install rustup / uv / pnpm and required targets
+ Setup {
+ #[arg(long)]
+ include_platform_specific: bool,
+ },
+ /// Install tools for a specific language
+ Install {
+ #[arg(value_enum)]
+ language: Language,
+ },
+ /// Build for a specific language
+ Build {
+ #[arg(value_enum, default_value = "rust")]
+ language: Language,
+ #[arg(value_enum, default_value = "release")]
+ configuration: Configuration,
+ #[arg(long, value_delimiter = ',', default_value = HOST_TARGET)]
+ targets: Vec<String>,
+ #[arg(long, value_enum, value_delimiter = ',')]
+ capabilities: Vec<Capability>,
+ },
+ /// Run tests for a specific language
+ Test {
+ #[arg(value_enum)]
+ language: Language,
+ },
+ /// Run an example for a specific language
+ Example {
+ #[arg(value_enum)]
+ language: Language,
+ name: String,
+ },
+ /// Synchronize project files with platform.toml
+ Sync {
+ #[arg(long)]
+ check: bool,
+ },
+ /// Verify that the working tree has no uncommitted changes after building each language
+ Verify,
+ /// Bump version, sync, build all languages, and stage release artifacts
+ Release {
+ version: String,
+ },
+}
+
+fn run_setup(include_platform_specific: bool) -> Result<()> {
+ if include_platform_specific {
+ if cfg!(target_vendor = "apple") {
+ Command::xcodebuild_first_launch().run()?;
+ Command::xcodebuild_download_metal_toolchain().run()?;
+ }
+ }
+
+ Command::rustup_setup().run()?;
+ Command::rustup_update().run()?;
+ Command::rustup_show().run()?;
+ Command::uv_setup().run()?;
+ Command::pnpm_setup().run()?;
+
+ Ok(())
+}
+
+fn run_verify(config: &PlatformsConfig) -> Result<()> {
+ for language in config.languages.keys() {
+ let backend = language_backend(language.clone(), config.clone())?;
+ backend.build(Configuration::Release, vec![config.host_target()?], vec![])?;
+ }
+ let (output, _) = Command::git_status_porcelain().output()?;
+ if !output.is_empty() {
+ eprintln!("{output}");
+ return Err(anyhow!("The repository has uncommitted changes after building all languages"));
+ }
+ Ok(())
+}
+
+fn language_backend(
+ language: Language,
+ config: PlatformsConfig,
+) -> Result<Box<dyn LanguageBackend>> {
+ match language {
+ Language::Rust => Ok(Box::new(RustLanguageBackend::new(config))),
+ Language::Python => Ok(Box::new(PythonLanguageBackend::new(config))),
+ Language::Swift => Ok(Box::new(SwiftLanguageBackend::new(config))),
+ Language::TypeScript => Ok(Box::new(TypeScriptLanguageBackend::new(config))),
+ }
+}
+
+fn main() -> Result<()> {
+ let cli = Cli::parse();
+ let config = PlatformsConfig::load()?;
+ let host_target = config.host_target()?;
+
+ match cli.command {
+ Some(Commands::Setup {
+ include_platform_specific,
+ }) => run_setup(include_platform_specific)?,
+ Some(Commands::Install {
+ language,
+ }) => language_backend(language, config)?.install()?,
+ Some(Commands::Build {
+ language,
+ configuration,
+ targets,
+ capabilities,
+ }) => language_backend(language, config)?.build(configuration, targets, capabilities)?,
+ Some(Commands::Test {
+ language,
+ }) => {
+ let configuration = Configuration::Release;
+ let capabilities = vec![];
+ let backend = language_backend(language, config.clone())?;
+ if backend.expects_prebuild_for_run() {
+ backend.build(configuration, vec![host_target.clone()], capabilities.clone())?;
+ }
+ backend.test(configuration, host_target.clone(), capabilities.clone())?
+ },
+ Some(Commands::Example {
+ language,
+ name,
+ }) => {
+ let configuration = Configuration::Release;
+ let capabilities = vec![];
+ let backend = language_backend(language, config.clone())?;
+ if backend.expects_prebuild_for_run() {
+ backend.build(configuration, vec![host_target.clone()], capabilities.clone())?;
+ }
+ backend.example(&name, configuration, host_target.clone(), capabilities.clone())?
+ },
+ Some(Commands::Sync {
+ check,
+ }) => run_sync(check)?,
+ Some(Commands::Verify) => run_verify(&config)?,
+ Some(Commands::Release {
+ version,
+ }) => run_release(&version)?,
+ None => {
+ let mut cmd = Cli::command();
+ cmd.print_help()?;
+ },
+ }
+
+ Ok(())
+}
diff --git a/crates/cli-tools/src/release/docs.rs b/crates/cli-tools/src/release/docs.rs
new file mode 100644
index 000000000..348cab65f
--- /dev/null
+++ b/crates/cli-tools/src/release/docs.rs
@@ -0,0 +1,31 @@
+use std::fs;
+
+use anyhow::Result;
+
+use crate::configs::{Paths, PlatformsConfig};
+
+pub fn stage_docs(
+ paths: &Paths,
+ platforms: &PlatformsConfig,
+) -> Result<()> {
+ let examples_root = paths.release_docs_path().join("examples");
+ if examples_root.exists() {
+ fs::remove_dir_all(&examples_root)?;
+ }
+
+ for (language, language_config) in &platforms.languages {
+ let language_dir = examples_root.join(language.name());
+ fs::create_dir_all(&language_dir)?;
+
+ let source_root = paths.root_path.join(&language_config.examples_path);
+ for example_name in platforms.examples.keys() {
+ let converted_name = language.convert_file_name(example_name);
+ let source_path = source_root.join(format!("{converted_name}.{}", language.file_extension()));
+ let body = fs::read_to_string(&source_path)?;
+ let mdx = format!("```{}\n{}\n```\n", language.code_fence(), body.trim_end());
+ fs::write(language_dir.join(format!("{example_name}.mdx")), mdx)?;
+ }
+ }
+
+ Ok(())
+}
diff --git a/crates/cli-tools/src/release/mod.rs b/crates/cli-tools/src/release/mod.rs
new file mode 100644
index 000000000..a50180a73
--- /dev/null
+++ b/crates/cli-tools/src/release/mod.rs
@@ -0,0 +1,58 @@
+mod docs;
+mod platform;
+mod version;
+
+use std::fs;
+
+use anyhow::{Result, anyhow};
+pub use version::bump_workspace_version;
+
+use crate::{
+ configs::{Paths, PlatformsConfig, WorkspaceManifest},
+ languages::{
+ LanguageBackend, PythonLanguageBackend, RustLanguageBackend, SwiftLanguageBackend, TypeScriptLanguageBackend,
+ },
+ sync::run_sync,
+ types::Language,
+};
+
+pub fn run_release(version: &str) -> Result<()> {
+ let paths = Paths::new()?;
+
+ bump_workspace_version(version)?;
+ run_sync(false)?;
+
+ let platforms = PlatformsConfig::load()?;
+ let workspace = WorkspaceManifest::load()?;
+ if workspace.workspace.package.version != version {
+ return Err(anyhow!("Workspace version mismatch after sync"));
+ }
+
+ let release_path = paths.release_workspace_path();
+ if release_path.exists() {
+ fs::remove_dir_all(&release_path)?;
+ }
+ fs::create_dir_all(&release_path)?;
+
+ platform::stage_platform(&paths, &platforms)?;
+ docs::stage_docs(&paths, &platforms)?;
+
+ for language in platforms.languages.keys() {
+ let backend = backend_for_language(*language, platforms.clone());
+ backend.release(version)?;
+ }
+
+ Ok(())
+}
+
+fn backend_for_language(
+ language: Language,
+ config: PlatformsConfig,
+) -> Box<dyn LanguageBackend> {
+ match language {
+ Language::Rust => Box::new(RustLanguageBackend::new(config)),
+ Language::Python => Box::new(PythonLanguageBackend::new(config)),
+ Language::Swift => Box::new(SwiftLanguageBackend::new(config)),
+ Language::TypeScript => Box::new(TypeScriptLanguageBackend::new(config)),
+ }
+}
diff --git a/crates/cli-tools/src/release/platform.rs b/crates/cli-tools/src/release/platform.rs
new file mode 100644
index 000000000..eecf57432
--- /dev/null
+++ b/crates/cli-tools/src/release/platform.rs
@@ -0,0 +1,30 @@
+use std::fs;
+
+use anyhow::Result;
+
+use crate::configs::{Paths, PlatformsConfig};
+
+pub fn stage_platform(
+ paths: &Paths,
+ platforms: &PlatformsConfig,
+) -> Result<()> {
+ let root = paths.release_platform_path();
+ if root.exists() {
+ fs::remove_dir_all(&root)?;
+ }
+
+ for (language, language_config) in &platforms.languages {
+ let language_dir = root.join(language.name());
+ fs::create_dir_all(&language_dir)?;
+
+ let examples_root = paths.root_path.join(&language_config.examples_path);
+ for example_name in platforms.examples.keys() {
+ let converted_name = language.convert_file_name(example_name);
+ let source_path = examples_root.join(format!("{converted_name}.{}", language.file_extension()));
+ let body = fs::read_to_string(&source_path)?;
+ fs::write(language_dir.join(format!("{example_name}.txt")), body)?;
+ }
+ }
+
+ Ok(())
+}
diff --git a/crates/cli-tools/src/release/version.rs b/crates/cli-tools/src/release/version.rs
new file mode 100644
index 000000000..5c1dd29d5
--- /dev/null
+++ b/crates/cli-tools/src/release/version.rs
@@ -0,0 +1,15 @@
+use std::fs;
+
+use anyhow::{Context, Result};
+use toml_edit::{DocumentMut, value};
+
+use crate::configs::Paths;
+
+pub fn bump_workspace_version(version: &str) -> Result<()> {
+ let path = Paths::new()?.workspace_manifest_path();
+ let body = fs::read_to_string(&path).with_context(|| format!("Failed to read {}", path.display()))?;
+ let mut document: DocumentMut = body.parse()?;
+ document["workspace"]["package"]["version"] = value(version);
+ fs::write(&path, document.to_string())?;
+ Ok(())
+}
diff --git a/crates/cli-tools/src/sync/jsr.rs b/crates/cli-tools/src/sync/jsr.rs
new file mode 100644
index 000000000..bae1e9dda
--- /dev/null
+++ b/crates/cli-tools/src/sync/jsr.rs
@@ -0,0 +1,24 @@
+use anyhow::Result;
+use regex::Regex;
+
+use crate::{
+ configs::{PlatformsConfig, WorkspaceManifest},
+ sync::SyncTask,
+};
+
+pub struct JsrSyncTask;
+
+impl SyncTask for JsrSyncTask {
+ fn process(
+ &self,
+ _platforms: &PlatformsConfig,
+ workspace: &WorkspaceManifest,
+ input: &str,
+ ) -> Result<String> {
+ let package = &workspace.workspace.package;
+ let regex = Regex::new(r#"("version"\s*:\s*)"[^"]*""#)?;
+ let literal = serde_json::to_string(&package.version)?;
+ let replacement = format!("$1{literal}");
+ Ok(regex.replace(input, replacement.as_str()).into_owned())
+ }
+}
diff --git a/crates/cli-tools/src/sync/license.rs b/crates/cli-tools/src/sync/license.rs
new file mode 100644
index 000000000..dd8dd4422
--- /dev/null
+++ b/crates/cli-tools/src/sync/license.rs
@@ -0,0 +1,23 @@
+use std::fs;
+
+use anyhow::Result;
+
+use crate::{
+ configs::{Paths, PlatformsConfig, WorkspaceManifest},
+ sync::SyncTask,
+};
+
+pub struct LicenseSyncTask;
+
+impl SyncTask for LicenseSyncTask {
+ fn process(
+ &self,
+ _platforms: &PlatformsConfig,
+ _workspace: &WorkspaceManifest,
+ _input: &str,
+ ) -> Result<String> {
+ let path = Paths::new()?.root_path.join("LICENSE");
+ let body = fs::read_to_string(&path)?;
+ Ok(body)
+ }
+}
diff --git a/crates/cli-tools/src/sync/mod.rs b/crates/cli-tools/src/sync/mod.rs
new file mode 100644
index 000000000..f6fb96cf5
--- /dev/null
+++ b/crates/cli-tools/src/sync/mod.rs
@@ -0,0 +1,100 @@
+use std::path::Path;
+
+mod jsr;
+mod license;
+mod package_json;
+mod playground;
+mod pyproject;
+mod readme;
+mod swift_package;
+mod toolchains;
+
+use anyhow::{Ok, Result, anyhow};
+pub use jsr::JsrSyncTask;
+pub use license::LicenseSyncTask;
+pub use package_json::PackageJsonSyncTask;
+pub use playground::PlaygroundSyncTask;
+pub use pyproject::PyprojectSyncTask;
+pub use readme::ReadmeSyncTask;
+pub use swift_package::SwiftPackageSyncTask;
+pub use toolchains::ToolchainsSyncTask;
+
+use crate::configs::{Paths, PlatformsConfig, WorkspaceManifest};
+
+pub trait SyncTask {
+ fn process(
+ &self,
+ platforms: &PlatformsConfig,
+ workspace: &WorkspaceManifest,
+ input: &str,
+ ) -> Result<String>;
+
+ fn run(
+ &self,
+ platforms: &PlatformsConfig,
+ workspace: &WorkspaceManifest,
+ input_path: &Path,
+ check: bool,
+ ) -> Result<()> {
+ let input = std::fs::read_to_string(input_path).unwrap_or_default();
+ let output = self.process(platforms, workspace, &input)?;
+ if check {
+ if input != output {
+ return Err(anyhow!("The file is out of sync: {}", input_path.display()));
+ }
+ } else {
+ std::fs::write(input_path, output)?;
+ }
+ Ok(())
+ }
+}
+
+pub fn run_sync(check: bool) -> Result<()> {
+ use crate::types::Language;
+
+ let paths = Paths::new()?;
+ let platforms = PlatformsConfig::load()?;
+ let workspace = WorkspaceManifest::load()?;
+ let root_path = &paths.root_path;
+
+ ToolchainsSyncTask.run(&platforms, &workspace, &root_path.join("rust-toolchain.toml"), check)?;
+ ReadmeSyncTask::new(vec![Language::Rust, Language::Python, Language::Swift, Language::TypeScript]).run(
+ &platforms,
+ &workspace,
+ &root_path.join("README.md"),
+ check,
+ )?;
+
+ PyprojectSyncTask.run(&platforms, &workspace, &root_path.join("bindings/python/pyproject.toml"), check)?;
+ LicenseSyncTask.run(&platforms, &workspace, &root_path.join("bindings/python/LICENSE"), check)?;
+ ReadmeSyncTask::new(vec![Language::Python]).run(
+ &platforms,
+ &workspace,
+ &root_path.join("bindings/python/README.md"),
+ check,
+ )?;
+
+ SwiftPackageSyncTask.run(&platforms, &workspace, &root_path.join("bindings/swift/Package.swift"), check)?;
+ LicenseSyncTask.run(&platforms, &workspace, &root_path.join("bindings/swift/LICENSE"), check)?;
+ ReadmeSyncTask::new(vec![Language::Swift]).run(
+ &platforms,
+ &workspace,
+ &root_path.join("bindings/swift/README.md"),
+ check,
+ )?;
+
+ PackageJsonSyncTask.run(&platforms, &workspace, &root_path.join("bindings/typescript/package.json"), check)?;
+ JsrSyncTask.run(&platforms, &workspace, &root_path.join("bindings/typescript/jsr.json"), check)?;
+ JsrSyncTask.run(&platforms, &workspace, &root_path.join("bindings/typescript/jsr.json.orig"), check)?;
+ LicenseSyncTask.run(&platforms, &workspace, &root_path.join("bindings/typescript/LICENSE"), check)?;
+ ReadmeSyncTask::new(vec![Language::TypeScript]).run(
+ &platforms,
+ &workspace,
+ &root_path.join("bindings/typescript/README.md"),
+ check,
+ )?;
+
+ PlaygroundSyncTask.run(&platforms, &workspace, &root_path.join("apps/playground/Project.swift"), check)?;
+
+ Ok(())
+}
diff --git a/crates/cli-tools/src/sync/package_json.rs b/crates/cli-tools/src/sync/package_json.rs
new file mode 100644
index 000000000..5c8b050b4
--- /dev/null
+++ b/crates/cli-tools/src/sync/package_json.rs
@@ -0,0 +1,95 @@
+use std::collections::BTreeSet;
+
+use anyhow::{Context, Result};
+use regex::Regex;
+
+use crate::{
+ configs::{PlatformsConfig, WorkspaceManifest},
+ sync::SyncTask,
+ types::Language,
+};
+
+pub struct PackageJsonSyncTask;
+
+impl SyncTask for PackageJsonSyncTask {
+ fn process(
+ &self,
+ platforms: &PlatformsConfig,
+ workspace: &WorkspaceManifest,
+ input: &str,
+ ) -> Result<String> {
+ let package = &workspace.workspace.package;
+
+ let mut output = input.to_string();
+ output = replace_string_field(&output, "version", &package.version)?;
+ output = replace_string_field(&output, "description", &package.description)?;
+ output = replace_string_field(&output, "author", &package.authors.join(", "))?;
+ output = replace_string_field(&output, "repository", &package.repository)?;
+ output = replace_string_field(&output, "license", &package.license)?;
+
+ let typescript_targets = platforms
+ .languages
+ .get(&Language::TypeScript)
+ .context("Missing [languages.typescript] in platforms.toml")?
+ .targets
+ .clone();
+
+ let cpu = unique(typescript_targets.iter().map(|target| target_cpu(target)).collect::<Result<Vec<_>>>()?);
+ let os = unique(typescript_targets.iter().map(|target| target_os(target)).collect::<Result<Vec<_>>>()?);
+
+ output = replace_string_array_field(&output, "cpu", cpu)?;
+ output = replace_string_array_field(&output, "os", os)?;
+
+ Ok(output)
+ }
+}
+
+fn target_cpu(target: &str) -> Result<String> {
+ if target.starts_with("aarch64-") {
+ Ok("arm64".to_string())
+ } else if target.starts_with("x86_64-") {
+ Ok("x64".to_string())
+ } else {
+ Err(anyhow::anyhow!("Unsupported target arch: {target}"))
+ }
+}
+
+fn target_os(target: &str) -> Result<String> {
+ if target.contains("-apple-darwin") {
+ Ok("darwin".to_string())
+ } else if target.contains("-unknown-linux") {
+ Ok("linux".to_string())
+ } else if target.contains("-pc-windows") {
+ Ok("win32".to_string())
+ } else {
+ Err(anyhow::anyhow!("Unsupported target os: {target}"))
+ }
+}
+
+fn unique(values: Vec<String>) -> Vec<String> {
+ BTreeSet::from_iter(values).into_iter().collect()
+}
+
+fn replace_string_field(
+ input: &str,
+ key: &str,
+ value: &str,
+) -> Result<String> {
+ let pattern = format!(r#"("{key}"\s*:\s*)"[^"]*""#);
+ let regex = Regex::new(&pattern)?;
+ let literal = serde_json::to_string(value)?;
+ let replacement = format!("$1{literal}");
+ Ok(regex.replace(input, replacement.as_str()).into_owned())
+}
+
+fn replace_string_array_field(
+ input: &str,
+ key: &str,
+ values: Vec<String>,
+) -> Result<String> {
+ let pattern = format!(r#"("{key}"\s*:\s*)\[[^\]]*\]"#);
+ let regex = Regex::new(&pattern)?;
+ let items = values.iter().map(|value| serde_json::to_string(value)).collect::<Result<Vec<_>, _>>()?;
+ let replacement = format!("$1[\n {}\n ]", items.join(",\n "));
+ Ok(regex.replace(input, replacement.as_str()).into_owned())
+}
diff --git a/crates/cli-tools/src/sync/playground.rs b/crates/cli-tools/src/sync/playground.rs
new file mode 100644
index 000000000..b7405dc3a
--- /dev/null
+++ b/crates/cli-tools/src/sync/playground.rs
@@ -0,0 +1,44 @@
+use anyhow::{Context, Result};
+use regex::Regex;
+
+use crate::{
+ configs::{PlatformsConfig, WorkspaceManifest},
+ sync::SyncTask,
+};
+
+pub struct PlaygroundSyncTask;
+
+impl SyncTask for PlaygroundSyncTask {
+ fn process(
+ &self,
+ platforms: &PlatformsConfig,
+ workspace: &WorkspaceManifest,
+ input: &str,
+ ) -> Result<String> {
+ let package = &workspace.workspace.package;
+ let ios_deployment_target = platforms
+ .envs
+ .get("IPHONEOS_DEPLOYMENT_TARGET")
+ .context("Missing IPHONEOS_DEPLOYMENT_TARGET in platforms.toml [envs]")?;
+ let macos_deployment_target = platforms
+ .envs
+ .get("MACOSX_DEPLOYMENT_TARGET")
+ .context("Missing MACOSX_DEPLOYMENT_TARGET in platforms.toml [envs]")?;
+
+ let mut output = input.to_string();
+
+ let marketing_version = Regex::new(r#"("MARKETING_VERSION"\s*:\s*)"[^"]*""#)?;
+ output = marketing_version.replace(&output, format!(r#"$1"{}""#, package.version).as_str()).into_owned();
+
+ let multiplatform = Regex::new(r#"\.multiplatform\(\s*iOS:\s*"[^"]*"\s*,\s*macOS:\s*"[^"]*"\s*\)"#)?;
+ output = multiplatform
+ .replace(
+ &output,
+ format!(r#".multiplatform(iOS: "{ios_deployment_target}", macOS: "{macos_deployment_target}")"#)
+ .as_str(),
+ )
+ .into_owned();
+
+ Ok(output)
+ }
+}
diff --git a/crates/cli-tools/src/sync/pyproject.rs b/crates/cli-tools/src/sync/pyproject.rs
new file mode 100644
index 000000000..b9fb432ed
--- /dev/null
+++ b/crates/cli-tools/src/sync/pyproject.rs
@@ -0,0 +1,71 @@
+use anyhow::{Context, Result};
+use toml_edit::{Array, DocumentMut, InlineTable, Item, Value};
+
+use crate::{
+ configs::{PlatformsConfig, WorkspaceManifest},
+ sync::SyncTask,
+};
+
+pub struct PyprojectSyncTask;
+
+impl SyncTask for PyprojectSyncTask {
+ fn process(
+ &self,
+ _platforms: &PlatformsConfig,
+ workspace: &WorkspaceManifest,
+ input: &str,
+ ) -> Result<String> {
+ let package = &workspace.workspace.package;
+
+ let mut document: DocumentMut = input.parse()?;
+
+ let project = document
+ .get_mut("project")
+ .and_then(Item::as_table_mut)
+ .context("Missing [project] table in pyproject.toml")?;
+ project.insert("description", Item::Value(Value::from(package.description.as_str())));
+ let mut readme = InlineTable::new();
+ readme.insert("file", Value::from(package.readme.as_str()));
+ readme.insert("content-type", Value::from("text/markdown"));
+ project.insert("readme", Item::Value(Value::InlineTable(readme)));
+ project.insert("license", Item::Value(Value::from(package.license.as_str())));
+
+ let mut authors = Array::new();
+ for author in &package.authors {
+ authors.push(Value::InlineTable(parse_author(author)?));
+ }
+ project.insert("authors", Item::Value(Value::Array(authors)));
+
+ let mut keywords = Array::new();
+ for keyword in &package.keywords {
+ let mut value = Value::from(keyword.as_str());
+ value.decor_mut().set_prefix("\n ");
+ keywords.push_formatted(value);
+ }
+ keywords.set_trailing("\n");
+ keywords.set_trailing_comma(true);
+ project.insert("keywords", Item::Value(Value::Array(keywords)));
+
+ let urls = document
+ .get_mut("project")
+ .and_then(Item::as_table_mut)
+ .and_then(|table| table.get_mut("urls"))
+ .and_then(Item::as_table_like_mut)
+ .context("Missing [project.urls] table in pyproject.toml")?;
+ urls.insert("Homepage", Item::Value(Value::from(package.homepage.as_str())));
+ urls.insert("Repository", Item::Value(Value::from(package.repository.as_str())));
+ urls.insert("Issues", Item::Value(Value::from(format!("{}/issues", package.repository))));
+
+ Ok(document.to_string())
+ }
+}
+
+fn parse_author(value: &str) -> Result<InlineTable> {
+ let (name, rest) =
+ value.rsplit_once('<').with_context(|| format!("Author '{value}' must be in 'Name <email>' format"))?;
+ let email = rest.trim_end_matches('>').trim();
+ let mut table = InlineTable::new();
+ table.insert("name", Value::from(name.trim()));
+ table.insert("email", Value::from(email));
+ Ok(table)
+}
diff --git a/crates/cli-tools/src/sync/readme.rs b/crates/cli-tools/src/sync/readme.rs
new file mode 100644
index 000000000..150666bbf
--- /dev/null
+++ b/crates/cli-tools/src/sync/readme.rs
@@ -0,0 +1,223 @@
+use std::{collections::BTreeMap, fs, path::Path};
+
+use anyhow::{Context, Result, anyhow};
+use minijinja::{Environment, context};
+use serde::Serialize;
+
+use crate::{
+ configs::{Paths, PlatformsConfig, WorkspaceManifest},
+ sync::SyncTask,
+ types::Language,
+};
+
+pub struct ReadmeSyncTask {
+ languages: Vec<Language>,
+}
+
+impl ReadmeSyncTask {
+ pub fn new(languages: Vec<Language>) -> Self {
+ Self {
+ languages,
+ }
+ }
+}
+
+#[derive(Serialize)]
+struct LanguageContext {
+ name: String,
+ display: String,
+ code_fence: String,
+ dependency: String,
+ quick_start: String,
+ examples: BTreeMap<String, String>,
+}
+
+#[derive(Serialize)]
+struct ExampleEntry {
+ name: String,
+ title: String,
+ description: String,
+ explanation: Option<String>,
+}
+
+#[derive(Serialize)]
+struct TargetEntry {
+ name: String,
+ in_progress: bool,
+}
+
+impl SyncTask for ReadmeSyncTask {
+ fn process(
+ &self,
+ platforms: &PlatformsConfig,
+ workspace: &WorkspaceManifest,
+ _input: &str,
+ ) -> Result<String> {
+ validate_examples(platforms)?;
+
+ let paths = Paths::new()?;
+
+ let primary_language = self.languages.first().copied().context("Languages list is empty")?;
+ let metadata = platforms
+ .languages
+ .get(&primary_language)
+ .with_context(|| format!("Missing [languages.{}]", primary_language.name()))?
+ .metadata
+ .clone();
+ let badges = resolve_badges(platforms, &metadata.badges)?;
+
+ let template_body = fs::read_to_string(paths.readme_template_path())?;
+ let mut environment = Environment::new();
+ environment.add_template("readme", &template_body)?;
+ let template = environment.get_template("readme")?;
+
+ let mut language_contexts = Vec::new();
+ for language in &self.languages {
+ language_contexts.push(language_context(*language, platforms, workspace, &paths)?);
+ }
+
+ let intro = fs::read_to_string(paths.readme_fragments_path().join("intro.md"))?.trim().to_string();
+
+ let example_entries: Vec<ExampleEntry> = platforms
+ .examples
+ .iter()
+ .map(|(name, config)| ExampleEntry {
+ name: name.clone(),
+ title: config.title.clone(),
+ description: config.description.clone(),
+ explanation: config.explanation.clone(),
+ })
+ .collect();
+
+ let mut binding_targets: std::collections::BTreeSet<String> = std::collections::BTreeSet::new();
+ for language_config in platforms.languages.values() {
+ if !language_config.bindings.is_empty() {
+ binding_targets.extend(language_config.targets.iter().cloned());
+ }
+ }
+ let targets: Vec<TargetEntry> = platforms
+ .targets
+ .keys()
+ .map(|name| TargetEntry {
+ name: name.clone(),
+ in_progress: !binding_targets.contains(name),
+ })
+ .collect();
+
+ let mut backends: Vec<String> = Vec::new();
+ for target_config in platforms.targets.values() {
+ let name = target_config.backend.name();
+ if !backends.contains(&name) {
+ backends.push(name);
+ }
+ }
+
+ let rendered = template.render(context! {
+ title => "uzu",
+ version => workspace.workspace.package.version,
+ image_url => metadata.image_url,
+ badges => badges,
+ has_multiple_languages => self.languages.len() > 1,
+ intro => intro,
+ languages => language_contexts,
+ examples => example_entries,
+ targets => targets,
+ backends => backends,
+ })?;
+
+ Ok(format!("{}\n", rendered.trim_end()))
+ }
+}
+
+fn resolve_badges(
+ platforms: &PlatformsConfig,
+ badge_ids: &[String],
+) -> Result<Vec<String>> {
+ badge_ids
+ .iter()
+ .map(|id| {
+ platforms
+ .badges
+ .get(id)
+ .cloned()
+ .with_context(|| format!("Unknown badge id '{id}' in platforms.toml [badges]"))
+ })
+ .collect()
+}
+
+fn language_context(
+ language: Language,
+ platforms: &PlatformsConfig,
+ workspace: &WorkspaceManifest,
+ paths: &Paths,
+) -> Result<LanguageContext> {
+ let language_config =
+ platforms.languages.get(&language).with_context(|| format!("Missing [languages.{}]", language.name()))?;
+ let fragments_root = paths.readme_fragments_path().join(language.name());
+
+ let dependency = render_fragment(&fragments_root.join("dependency.md"), &workspace.workspace.package.version)?;
+
+ let examples_root = paths.root_path.join(&language_config.examples_path);
+ let mut examples = BTreeMap::new();
+ for name in platforms.examples.keys() {
+ examples.insert(name.clone(), read_example(&examples_root, language, name)?);
+ }
+ let quick_start = examples
+ .get("quick-start")
+ .cloned()
+ .with_context(|| format!("Missing 'quick-start' example for {}", language.name()))?;
+
+ Ok(LanguageContext {
+ name: language.name(),
+ display: language.display(),
+ code_fence: language.code_fence().to_string(),
+ dependency,
+ quick_start,
+ examples,
+ })
+}
+
+fn render_fragment(
+ path: &Path,
+ version: &str,
+) -> Result<String> {
+ let body = fs::read_to_string(path).with_context(|| format!("Failed to read {}", path.display()))?;
+ let mut environment = Environment::new();
+ environment.add_template("fragment", &body)?;
+ let rendered = environment.get_template("fragment")?.render(context! {
+ version => version,
+ })?;
+ Ok(rendered.trim_end().to_string())
+}
+
+fn read_example(
+ examples_root: &Path,
+ language: Language,
+ canonical_name: &str,
+) -> Result<String> {
+ let converted_name = language.convert_file_name(canonical_name);
+ let path = examples_root.join(format!("{converted_name}.{}", language.file_extension()));
+ fs::read_to_string(&path)
+ .with_context(|| format!("Missing example '{canonical_name}' for {} at {}", language.name(), path.display()))
+ .map(|body| body.trim_end().to_string())
+}
+
+fn validate_examples(platforms: &PlatformsConfig) -> Result<()> {
+ let paths = Paths::new()?;
+ for (language, language_config) in &platforms.languages {
+ let examples_root = paths.root_path.join(&language_config.examples_path);
+ for name in platforms.examples.keys() {
+ let converted_name = language.convert_file_name(name);
+ let path = examples_root.join(format!("{converted_name}.{}", language.file_extension()));
+ if !path.exists() {
+ return Err(anyhow!(
+ "Example '{}' missing for {} (expected at {})",
+ name,
+ language.name(),
+ path.display()
+ ));
+ }
+ }
+ }
+ Ok(())
+}
diff --git a/crates/cli-tools/src/sync/swift_package.rs b/crates/cli-tools/src/sync/swift_package.rs
new file mode 100644
index 000000000..de04c4843
--- /dev/null
+++ b/crates/cli-tools/src/sync/swift_package.rs
@@ -0,0 +1,34 @@
+use anyhow::{Context, Result};
+use regex::Regex;
+
+use crate::{
+ configs::{PlatformsConfig, WorkspaceManifest},
+ sync::SyncTask,
+};
+
+pub struct SwiftPackageSyncTask;
+
+impl SyncTask for SwiftPackageSyncTask {
+ fn process(
+ &self,
+ platforms: &PlatformsConfig,
+ _workspace: &WorkspaceManifest,
+ input: &str,
+ ) -> Result<String> {
+ let ios = platforms
+ .envs
+ .get("IPHONEOS_DEPLOYMENT_TARGET")
+ .context("Missing IPHONEOS_DEPLOYMENT_TARGET in platforms.toml [envs]")?;
+ let macos = platforms
+ .envs
+ .get("MACOSX_DEPLOYMENT_TARGET")
+ .context("Missing MACOSX_DEPLOYMENT_TARGET in platforms.toml [envs]")?;
+
+ let mut output = input.to_string();
+ output = Regex::new(r#"\.iOS\("[^"]*"\)"#)?.replace(&output, format!(r#".iOS("{ios}")"#).as_str()).into_owned();
+ output = Regex::new(r#"\.macOS\("[^"]*"\)"#)?
+ .replace(&output, format!(r#".macOS("{macos}")"#).as_str())
+ .into_owned();
+ Ok(output)
+ }
+}
diff --git a/crates/cli-tools/src/sync/toolchains.rs b/crates/cli-tools/src/sync/toolchains.rs
new file mode 100644
index 000000000..609868a71
--- /dev/null
+++ b/crates/cli-tools/src/sync/toolchains.rs
@@ -0,0 +1,37 @@
+use anyhow::{Context, Result};
+use toml_edit::{DocumentMut, Item, Value};
+
+use crate::{
+ configs::{PlatformsConfig, WorkspaceManifest},
+ sync::SyncTask,
+};
+
+pub struct ToolchainsSyncTask;
+
+impl SyncTask for ToolchainsSyncTask {
+ fn process(
+ &self,
+ platforms: &PlatformsConfig,
+ _workspace: &WorkspaceManifest,
+ input: &str,
+ ) -> Result<String> {
+ let mut document: DocumentMut = input.parse()?;
+ let targets = document
+ .get_mut("toolchain")
+ .and_then(Item::as_table_mut)
+ .and_then(|table| table.get_mut("targets"))
+ .and_then(Item::as_array_mut)
+ .context("Missing toolchain.targets in rust-toolchain.toml")?;
+
+ targets.clear();
+ for name in platforms.targets.keys() {
+ let mut value = Value::from(name.as_str());
+ value.decor_mut().set_prefix("\n ");
+ targets.push_formatted(value);
+ }
+ targets.set_trailing("\n");
+ targets.set_trailing_comma(true);
+
+ Ok(document.to_string())
+ }
+}
diff --git a/crates/cli-tools/src/types/backend.rs b/crates/cli-tools/src/types/backend.rs
new file mode 100644
index 000000000..e2e868a0f
--- /dev/null
+++ b/crates/cli-tools/src/types/backend.rs
@@ -0,0 +1,24 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "lowercase")]
+pub enum Backend {
+ Metal,
+ Cpu,
+}
+
+impl Backend {
+ pub fn name(self) -> String {
+ match self {
+ Backend::Metal => "metal".to_string(),
+ Backend::Cpu => "cpu".to_string(),
+ }
+ }
+
+ pub fn feature(self) -> String {
+ match self {
+ Backend::Metal => "backend-metal".to_string(),
+ Backend::Cpu => "backend-cpu".to_string(),
+ }
+ }
+}
diff --git a/crates/cli-tools/src/types/bindings.rs b/crates/cli-tools/src/types/bindings.rs
new file mode 100644
index 000000000..2704fe4bc
--- /dev/null
+++ b/crates/cli-tools/src/types/bindings.rs
@@ -0,0 +1,21 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub enum Bindings {
+ Uniffi,
+ Napi,
+ Pyo3,
+ Wasm,
+}
+
+impl Bindings {
+ pub fn feature(self) -> String {
+ match self {
+ Bindings::Uniffi => "bindings-uniffi".to_string(),
+ Bindings::Napi => "bindings-napi".to_string(),
+ Bindings::Pyo3 => "bindings-pyo3".to_string(),
+ Bindings::Wasm => "bindings-wasm".to_string(),
+ }
+ }
+}
diff --git a/crates/cli-tools/src/types/capability.rs b/crates/cli-tools/src/types/capability.rs
new file mode 100644
index 000000000..ee23657db
--- /dev/null
+++ b/crates/cli-tools/src/types/capability.rs
@@ -0,0 +1,18 @@
+use clap::ValueEnum;
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, ValueEnum)]
+#[serde(rename_all = "snake_case")]
+pub enum Capability {
+ Grammar,
+ Tracing,
+}
+
+impl Capability {
+ pub fn feature(&self) -> String {
+ match self {
+ Capability::Grammar => "capability-grammar".to_string(),
+ Capability::Tracing => "capability-tracing".to_string(),
+ }
+ }
+}
diff --git a/crates/cli-tools/src/types/command.rs b/crates/cli-tools/src/types/command.rs
new file mode 100644
index 000000000..1672f3c47
--- /dev/null
+++ b/crates/cli-tools/src/types/command.rs
@@ -0,0 +1,466 @@
+use std::{
+ io::{BufRead, BufReader},
+ path::PathBuf,
+ process::{Command as StdCommand, Stdio},
+ thread,
+};
+
+use anyhow::{Result, anyhow};
+use indexmap::IndexMap;
+
+use crate::types::Configuration;
+
+#[derive(Debug, Clone)]
+pub struct Command {
+ current_path: Option<PathBuf>,
+ name: String,
+ arguments: Vec<String>,
+ envs: IndexMap<String, String>,
+}
+
+impl Command {
+ pub fn new(name: &str) -> Self {
+ Self {
+ current_path: None,
+ name: name.to_string(),
+ arguments: vec![],
+ envs: IndexMap::new(),
+ }
+ }
+
+ pub fn with_current_path(
+ &self,
+ path: &PathBuf,
+ ) -> Self {
+ Self {
+ current_path: Some(path.clone()),
+ ..self.clone()
+ }
+ }
+
+ pub fn with_argument(
+ &self,
+ argument: &str,
+ ) -> Self {
+ let mut current_arguments = self.arguments.clone();
+ current_arguments.push(argument.to_string());
+
+ Self {
+ arguments: current_arguments,
+ ..self.clone()
+ }
+ }
+
+ pub fn with_arguments(
+ &self,
+ arguments: Vec<String>,
+ ) -> Self {
+ let mut current_arguments = self.arguments.clone();
+ current_arguments.extend(arguments);
+
+ Self {
+ arguments: current_arguments,
+ ..self.clone()
+ }
+ }
+
+ pub fn with_env(
+ &self,
+ key: &str,
+ value: &str,
+ ) -> Self {
+ let mut current_envs = self.envs.clone();
+ current_envs.insert(key.to_string(), value.to_string());
+
+ Self {
+ envs: current_envs,
+ ..self.clone()
+ }
+ }
+
+ pub fn with_envs(
+ &self,
+ envs: IndexMap<String, String>,
+ ) -> Self {
+ let mut current_envs = self.envs.clone();
+ current_envs.extend(envs);
+
+ Self {
+ envs: current_envs,
+ ..self.clone()
+ }
+ }
+
+ pub fn run(self) -> Result<()> {
+ let mut command = self.std_command();
+ command.stdout(Stdio::inherit());
+ command.stderr(Stdio::inherit());
+ let status = command.status()?;
+ if !status.success() {
+ return Err(anyhow!("Command failed"));
+ }
+ Ok(())
+ }
+
+ pub fn output(self) -> Result<(String, String)> {
+ let mut command = self.std_command();
+ command.stdout(Stdio::piped());
+ command.stderr(Stdio::piped());
+
+ let mut child = command.spawn()?;
+ let stdout = child.stdout.take().ok_or_else(|| anyhow!("Missing stdout"))?;
+ let stderr = child.stderr.take().ok_or_else(|| anyhow!("Missing stderr"))?;
+
+ let stdout_thread = thread::spawn(move || -> Result<String> {
+ let mut buffer = String::new();
+ for line in BufReader::new(stdout).lines() {
+ let line = line?;
+ println!("{line}");
+ buffer.push_str(&line);
+ buffer.push('\n');
+ }
+ Ok(buffer)
+ });
+ let stderr_thread = thread::spawn(move || -> Result<String> {
+ let mut buffer = String::new();
+ for line in BufReader::new(stderr).lines() {
+ let line = line?;
+ eprintln!("{line}");
+ buffer.push_str(&line);
+ buffer.push('\n');
+ }
+ Ok(buffer)
+ });
+
+ let stdout = stdout_thread.join().map_err(|_| anyhow!("stdout thread panicked"))??;
+ let stderr = stderr_thread.join().map_err(|_| anyhow!("stderr thread panicked"))??;
+ let status = child.wait()?;
+ if !status.success() {
+ return Err(anyhow!("Command failed"));
+ }
+ Ok((stdout.trim().to_string(), stderr.trim().to_string()))
+ }
+
+ fn std_command(&self) -> StdCommand {
+ let mut command = StdCommand::new(&self.name);
+ if let Some(current_path) = &self.current_path {
+ command.current_dir(current_path);
+ }
+ command.args(&self.arguments);
+ for (key, value) in &self.envs {
+ command.env(key, value);
+ }
+ command
+ }
+}
+impl Command {
+ pub fn rustup_setup() -> Self {
+ Self::new("sh")
+ .with_argument("-c")
+ .with_argument("rustup --version >/dev/null 2>&1 || curl https://sh.rustup.rs -sSf | sh")
+ }
+
+ pub fn rustup_update() -> Self {
+ Self::new("rustup").with_argument("update")
+ }
+
+ pub fn rustup_show() -> Self {
+ Self::new("rustup").with_argument("show")
+ }
+
+ pub fn cargo_install(
+ name: &str,
+ version: &str,
+ ) -> Self {
+ Self::new("cargo")
+ .with_argument("install")
+ .with_argument("--locked")
+ .with_argument(&format!("cargo-{name}@{}", version))
+ }
+
+ pub fn cargo_build(
+ package: String,
+ target: String,
+ features: Vec<String>,
+ configuration: Configuration,
+ ) -> Self {
+ let mut command = Self::new("cargo")
+ .with_argument("build")
+ .with_argument("-p")
+ .with_argument(&package)
+ .with_arguments(vec!["--target".to_string(), target])
+ .with_argument("--no-default-features")
+ .with_arguments(vec!["--features".to_string(), features.join(",")]);
+ command = match configuration {
+ Configuration::Debug => command,
+ Configuration::Release => command.with_argument("--release"),
+ };
+ command
+ }
+
+ pub fn cargo_test(
+ target: String,
+ features: Vec<String>,
+ configuration: Configuration,
+ ) -> Self {
+ let mut command = Self::new("cargo")
+ .with_argument("test")
+ .with_arguments(vec!["--target".to_string(), target])
+ .with_argument("--no-default-features")
+ .with_arguments(vec!["--features".to_string(), features.join(",")]);
+ command = match configuration {
+ Configuration::Debug => command,
+ Configuration::Release => command.with_argument("--release"),
+ };
+ command
+ }
+
+ pub fn cargo_run_example(
+ package: String,
+ name: String,
+ target: String,
+ features: Vec<String>,
+ configuration: Configuration,
+ ) -> Self {
+ let mut command = Self::new("cargo")
+ .with_argument("run")
+ .with_argument("-p")
+ .with_argument(&package)
+ .with_arguments(vec!["--example".to_string(), name])
+ .with_arguments(vec!["--target".to_string(), target])
+ .with_argument("--no-default-features")
+ .with_arguments(vec!["--features".to_string(), features.join(",")]);
+ command = match configuration {
+ Configuration::Debug => command,
+ Configuration::Release => command.with_argument("--release"),
+ };
+ command
+ }
+}
+
+impl Command {
+ pub fn uv_setup() -> Self {
+ Self::new("sh")
+ .with_argument("-c")
+ .with_argument("uv --version >/dev/null 2>&1 || curl -LsSf https://astral.sh/uv/install.sh | sh")
+ }
+
+ pub fn uv_install(
+ name: &str,
+ version: &str,
+ ) -> Self {
+ Self::new("uv")
+ .with_argument("tool")
+ .with_argument("install")
+ .with_argument("--force")
+ .with_argument(&format!("{name}=={}", version))
+ }
+
+ pub fn uv_sync() -> Self {
+ Self::new("uv").with_argument("sync").with_argument("--reinstall")
+ }
+
+ pub fn uv_venv() -> Self {
+ Self::new("uv").with_argument("venv")
+ }
+
+ pub fn uv_pip_install_wheel(path: PathBuf) -> Self {
+ Self::new("uv")
+ .with_argument("pip")
+ .with_argument("install")
+ .with_argument("--force-reinstall")
+ .with_argument("--no-deps")
+ .with_argument(&path.to_string_lossy())
+ }
+
+ pub fn uv_python(code: &str) -> Self {
+ Self::new("uv")
+ .with_argument("run")
+ .with_argument("--no-sync")
+ .with_argument("python")
+ .with_argument("-c")
+ .with_argument(code)
+ }
+
+ pub fn uv_pytest() -> Self {
+ Self::new("uv")
+ .with_argument("run")
+ .with_arguments(vec!["--extra".to_string(), "dev".to_string()])
+ .with_argument("pytest")
+ }
+
+ pub fn uv_python_file(path: PathBuf) -> Self {
+ Self::new("uv")
+ .with_argument("run")
+ .with_arguments(vec!["--extra".to_string(), "examples".to_string()])
+ .with_argument("python")
+ .with_argument(&path.to_string_lossy())
+ }
+
+ pub fn maturin_build(
+ target: String,
+ features: Vec<String>,
+ configuration: Configuration,
+ ) -> Self {
+ let mut command = Self::new("maturin")
+ .with_argument("build")
+ .with_arguments(vec!["--target".to_string(), target])
+ .with_argument("--no-default-features")
+ .with_arguments(vec!["--features".to_string(), features.join(",")])
+ .with_argument("--strip");
+ command = match configuration {
+ Configuration::Debug => command,
+ Configuration::Release => command.with_argument("--release"),
+ };
+ command
+ }
+}
+
+impl Command {
+ pub fn pnpm_setup() -> Self {
+ Self::new("sh")
+ .with_argument("-c")
+ .with_argument("pnpm --version >/dev/null 2>&1 || curl -fsSL https://get.pnpm.io/install.sh | sh")
+ }
+
+ pub fn pnpm_install() -> Self {
+ Self::new("pnpm").with_argument("install")
+ }
+
+ pub fn pnpm_run(script: &str) -> Self {
+ Self::new("pnpm").with_argument("run").with_argument(script)
+ }
+
+ pub fn pnpm_exec() -> Self {
+ Self::new("pnpm").with_argument("exec")
+ }
+
+ pub fn pnpm_jest() -> Self {
+ Self::pnpm_exec().with_argument("jest")
+ }
+
+ pub fn pnpm_tsn(path: PathBuf) -> Self {
+ Self::pnpm_run("tsn").with_argument(&path.to_string_lossy())
+ }
+
+ pub fn napi_build(
+ manifest_path: PathBuf,
+ target: String,
+ features: Vec<String>,
+ configuration: Configuration,
+ output_path: PathBuf,
+ ) -> Self {
+ let cross_flag = if target.contains("linux-gnu") {
+ "--use-napi-cross"
+ } else {
+ "-x"
+ };
+ let mut command = Self::pnpm_exec()
+ .with_argument("napi")
+ .with_argument("build")
+ .with_arguments(vec!["--manifest-path".to_string(), manifest_path.to_string_lossy().to_string()])
+ .with_arguments(vec!["--target".to_string(), target])
+ .with_argument("--no-default-features")
+ .with_arguments(vec!["--features".to_string(), features.join(",")])
+ .with_argument("--platform")
+ .with_argument("--output-dir")
+ .with_argument(&output_path.to_string_lossy())
+ .with_argument(cross_flag);
+ command = match configuration {
+ Configuration::Debug => command,
+ Configuration::Release => command.with_argument("--release"),
+ };
+ command
+ }
+}
+
+impl Command {
+ pub fn cargo_swift_package(
+ name: String,
+ target: String,
+ features: Vec<String>,
+ configuration: Configuration,
+ ) -> Self {
+ let mut command = Self::new("cargo")
+ .with_argument("swift")
+ .with_argument("package")
+ .with_arguments(vec!["--name".to_string(), name.clone()])
+ .with_arguments(vec!["--xcframework-name".to_string(), name.clone()])
+ .with_arguments(vec!["--target".to_string(), target])
+ .with_argument("--no-default-features")
+ .with_arguments(vec!["--features".to_string(), features.join(",")])
+ .with_argument("-y");
+ command = match configuration {
+ Configuration::Debug => command,
+ Configuration::Release => command.with_argument("--release"),
+ };
+ command
+ }
+
+ pub fn xcodebuild() -> Self {
+ Self::new("xcodebuild")
+ }
+
+ pub fn xcodebuild_first_launch() -> Self {
+ Self::xcodebuild().with_argument("-runFirstLaunch")
+ }
+
+ pub fn xcodebuild_download_metal_toolchain() -> Self {
+ Self::xcodebuild().with_arguments(vec!["-downloadComponent".to_string(), "MetalToolchain".to_string()])
+ }
+
+ pub fn xcodebuild_create_xcframework(
+ slice_libraries_with_headers_paths: Vec<(PathBuf, PathBuf)>,
+ output_path: PathBuf,
+ ) -> Self {
+ let mut command = Self::xcodebuild().with_argument("-create-xcframework");
+ for (library_path, headers_path) in slice_libraries_with_headers_paths {
+ command = command.with_arguments(vec!["-library".to_string(), library_path.to_string_lossy().to_string()]);
+ command = command.with_arguments(vec!["-headers".to_string(), headers_path.to_string_lossy().to_string()]);
+ }
+ command.with_arguments(vec!["-output".to_string(), output_path.to_string_lossy().to_string()])
+ }
+
+ pub fn swift_test() -> Self {
+ Self::new("swift").with_argument("test")
+ }
+
+ pub fn swift_compute_checksum(path: PathBuf) -> Self {
+ Self::new("swift")
+ .with_argument("package")
+ .with_argument("compute-checksum")
+ .with_argument(&path.to_string_lossy())
+ }
+
+ pub fn swift_run_example(name: String) -> Self {
+ Self::new("swift").with_argument("run").with_argument("examples").with_argument(&name)
+ }
+
+ pub fn codesign_adhoc(path: PathBuf) -> Self {
+ Self::new("codesign")
+ .with_argument("--force")
+ .with_argument("--sign")
+ .with_argument("-")
+ .with_argument(&path.to_string_lossy())
+ }
+}
+
+impl Command {
+ pub fn which(name: String) -> Self {
+ Self::new("which").with_argument(&name)
+ }
+
+ pub fn git_status_porcelain() -> Self {
+ Self::new("git").with_argument("status").with_argument("--porcelain")
+ }
+
+ pub fn zip_directory(
+ source: PathBuf,
+ output: PathBuf,
+ ) -> Self {
+ Self::new("zip")
+ .with_argument("-r")
+ .with_argument(&output.to_string_lossy())
+ .with_argument(&source.to_string_lossy())
+ }
+}
diff --git a/crates/cli-tools/src/types/configuration.rs b/crates/cli-tools/src/types/configuration.rs
new file mode 100644
index 000000000..4dccf8b12
--- /dev/null
+++ b/crates/cli-tools/src/types/configuration.rs
@@ -0,0 +1,18 @@
+use clap::ValueEnum;
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, ValueEnum)]
+#[serde(rename_all = "snake_case")]
+pub enum Configuration {
+ Debug,
+ Release,
+}
+
+impl Configuration {
+ pub fn name(&self) -> String {
+ match self {
+ Configuration::Debug => "debug".to_string(),
+ Configuration::Release => "release".to_string(),
+ }
+ }
+}
diff --git a/crates/cli-tools/src/types/language.rs b/crates/cli-tools/src/types/language.rs
new file mode 100644
index 000000000..72239ab61
--- /dev/null
+++ b/crates/cli-tools/src/types/language.rs
@@ -0,0 +1,101 @@
+use clap::ValueEnum;
+use heck::{ToLowerCamelCase, ToSnakeCase, ToUpperCamelCase};
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, ValueEnum)]
+#[serde(rename_all = "snake_case")]
+pub enum Language {
+ Rust,
+ Python,
+ Swift,
+ #[serde(rename = "typescript")]
+ #[value(name = "typescript")]
+ TypeScript,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum Case {
+ Snake,
+ LowerCamel,
+ UpperCamel,
+ Kebab,
+}
+
+impl Language {
+ pub fn name(&self) -> String {
+ match self {
+ Language::Rust => "rust".to_string(),
+ Language::Python => "python".to_string(),
+ Language::Swift => "swift".to_string(),
+ Language::TypeScript => "typescript".to_string(),
+ }
+ }
+
+ pub fn display(&self) -> String {
+ match self {
+ Language::Rust => "Rust".to_string(),
+ Language::Python => "Python".to_string(),
+ Language::Swift => "Swift".to_string(),
+ Language::TypeScript => "TypeScript".to_string(),
+ }
+ }
+
+ pub fn code_fence(&self) -> &'static str {
+ match self {
+ Language::Rust => "rust",
+ Language::Python => "python",
+ Language::Swift => "swift",
+ Language::TypeScript => "ts",
+ }
+ }
+
+ pub fn command_argument_case(&self) -> Case {
+ match self {
+ Language::Rust | Language::Python => Case::Snake,
+ Language::TypeScript => Case::LowerCamel,
+ Language::Swift => Case::Kebab,
+ }
+ }
+
+ pub fn file_case(&self) -> Case {
+ match self {
+ Language::Swift => Case::UpperCamel,
+ _ => self.command_argument_case(),
+ }
+ }
+
+ pub fn file_extension(&self) -> &'static str {
+ match self {
+ Language::Rust => "rs",
+ Language::Python => "py",
+ Language::Swift => "swift",
+ Language::TypeScript => "ts",
+ }
+ }
+
+ pub fn convert_command_name(
+ &self,
+ name: &str,
+ ) -> String {
+ format(name, self.command_argument_case())
+ }
+
+ pub fn convert_file_name(
+ &self,
+ name: &str,
+ ) -> String {
+ format(name, self.file_case())
+ }
+}
+
+fn format(
+ name: &str,
+ case: Case,
+) -> String {
+ match case {
+ Case::Snake => name.to_snake_case(),
+ Case::LowerCamel => name.to_lower_camel_case(),
+ Case::UpperCamel => name.to_upper_camel_case(),
+ Case::Kebab => name.to_string(),
+ }
+}
diff --git a/crates/cli-tools/src/types/mod.rs b/crates/cli-tools/src/types/mod.rs
new file mode 100644
index 000000000..18083e131
--- /dev/null
+++ b/crates/cli-tools/src/types/mod.rs
@@ -0,0 +1,15 @@
+mod backend;
+mod bindings;
+mod capability;
+mod command;
+mod configuration;
+mod language;
+mod tool;
+
+pub use backend::Backend;
+pub use bindings::Bindings;
+pub use capability::Capability;
+pub use command::Command;
+pub use configuration::Configuration;
+pub use language::Language;
+pub use tool::Tool;
diff --git a/crates/cli-tools/src/types/tool.rs b/crates/cli-tools/src/types/tool.rs
new file mode 100644
index 000000000..fe362b60b
--- /dev/null
+++ b/crates/cli-tools/src/types/tool.rs
@@ -0,0 +1,20 @@
+use serde::{Deserialize, Serialize};
+
+use crate::{configs::ToolProvider, types::Command};
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "snake_case")]
+pub struct Tool {
+ pub name: String,
+ pub provider: ToolProvider,
+ pub version: String,
+}
+
+impl Tool {
+ pub fn command(&self) -> Command {
+ match self.provider {
+ ToolProvider::Cargo => Command::cargo_install(&self.name, &self.version),
+ ToolProvider::Uv => Command::uv_install(&self.name, &self.version),
+ }
+ }
+}
diff --git a/crates/cli-tools/src/utilities/fs.rs b/crates/cli-tools/src/utilities/fs.rs
new file mode 100644
index 000000000..a1efbd48d
--- /dev/null
+++ b/crates/cli-tools/src/utilities/fs.rs
@@ -0,0 +1,21 @@
+use std::{fs, path::Path};
+
+use anyhow::Result;
+
+pub fn copy_directory(
+ source: &Path,
+ destination: &Path,
+) -> Result<()> {
+ fs::create_dir_all(destination)?;
+ for entry in fs::read_dir(source)? {
+ let entry = entry?;
+ let path = entry.path();
+ let target = destination.join(entry.file_name());
+ if path.is_dir() {
+ copy_directory(&path, &target)?;
+ } else {
+ fs::copy(&path, &target)?;
+ }
+ }
+ Ok(())
+}
diff --git a/crates/cli-tools/src/utilities/mod.rs b/crates/cli-tools/src/utilities/mod.rs
new file mode 100644
index 000000000..d521fbd77
--- /dev/null
+++ b/crates/cli-tools/src/utilities/mod.rs
@@ -0,0 +1 @@
+pub mod fs;
diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml
index d09beadd8..e98e86e57 100644
--- a/crates/cli/Cargo.toml
+++ b/crates/cli/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "cli"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[[bin]]
name = "cli"
diff --git a/crates/download-manager/Cargo.toml b/crates/download-manager/Cargo.toml
index 3e646939f..7b149a0b2 100644
--- a/crates/download-manager/Cargo.toml
+++ b/crates/download-manager/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "download-manager"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[dependencies]
tokio.workspace = true
diff --git a/crates/dsl/Cargo.toml b/crates/dsl/Cargo.toml
index 7255c8b01..2e20071b6 100644
--- a/crates/dsl/Cargo.toml
+++ b/crates/dsl/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "dsl"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[lib]
proc-macro = true
diff --git a/crates/hanashi/Cargo.toml b/crates/hanashi/Cargo.toml
index 4b68bb1bc..104fa50c4 100644
--- a/crates/hanashi/Cargo.toml
+++ b/crates/hanashi/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "hanashi"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[dependencies]
shoji.workspace = true
diff --git a/crates/json-transform/Cargo.toml b/crates/json-transform/Cargo.toml
index d327c0894..be352f4ab 100644
--- a/crates/json-transform/Cargo.toml
+++ b/crates/json-transform/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "json-transform"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[dependencies]
serde.workspace = true
diff --git a/crates/nagare/Cargo.toml b/crates/nagare/Cargo.toml
index 5f6103647..4f7b202c1 100644
--- a/crates/nagare/Cargo.toml
+++ b/crates/nagare/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "nagare"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[lib]
crate-type = ["lib", "cdylib", "staticlib"]
diff --git a/crates/shoji/Cargo.toml b/crates/shoji/Cargo.toml
index f237c9fe4..3d837b4d0 100644
--- a/crates/shoji/Cargo.toml
+++ b/crates/shoji/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "shoji"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[lib]
crate-type = ["lib", "cdylib", "staticlib"]
diff --git a/crates/token-stream-parser/Cargo.toml b/crates/token-stream-parser/Cargo.toml
index 611796325..515dc075e 100644
--- a/crates/token-stream-parser/Cargo.toml
+++ b/crates/token-stream-parser/Cargo.toml
@@ -1,11 +1,12 @@
[package]
name = "token-stream-parser"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[dependencies]
json-transform.workspace = true
diff --git a/crates/uzu/Cargo.toml b/crates/uzu/Cargo.toml
index 844088cb8..e2d7c52f6 100644
--- a/crates/uzu/Cargo.toml
+++ b/crates/uzu/Cargo.toml
@@ -1,20 +1,22 @@
[package]
name = "uzu"
-version.workspace = true
edition.workspace = true
rust-version.workspace = true
-license.workspace = true
+version.workspace = true
authors.workspace = true
+homepage.workspace = true
repository.workspace = true
+license.workspace = true
[lib]
crate-type = ["lib", "cdylib", "staticlib"]
[features]
-default = ["metal", "grammar"]
-metal = ["backend-uzu/metal"]
-grammar = ["backend-uzu/grammar"]
-tracing = ["backend-uzu/tracing"]
+default = ["backend-metal", "capability-grammar"]
+backend-cpu = []
+backend-metal = ["backend-uzu/metal"]
+capability-grammar = ["backend-uzu/grammar"]
+capability-tracing = ["backend-uzu/tracing"]
bindings = [
"bindings-uniffi",
"bindings-napi",
diff --git a/crates/uzu/examples/cloud.rs b/crates/uzu/examples/chat_cloud.rs
similarity index 100%
rename from crates/uzu/examples/cloud.rs
rename to crates/uzu/examples/chat_cloud.rs
diff --git a/crates/uzu/examples/chat_for_classification.rs b/crates/uzu/examples/chat_speculation_classification.rs
similarity index 100%
rename from crates/uzu/examples/chat_for_classification.rs
rename to crates/uzu/examples/chat_speculation_classification.rs
diff --git a/crates/uzu/examples/chat_for_summarization.rs b/crates/uzu/examples/chat_speculation_summarization.rs
similarity index 100%
rename from crates/uzu/examples/chat_for_summarization.rs
rename to crates/uzu/examples/chat_speculation_summarization.rs
diff --git a/crates/uzu/examples/structured_output.rs b/crates/uzu/examples/chat_structured_output.rs
similarity index 100%
rename from crates/uzu/examples/structured_output.rs
rename to crates/uzu/examples/chat_structured_output.rs
diff --git a/crates/uzu/examples/classifier.rs b/crates/uzu/examples/classification.rs
similarity index 100%
rename from crates/uzu/examples/classifier.rs
rename to crates/uzu/examples/classification.rs
diff --git a/crates/uzu/examples/snippets.rs b/crates/uzu/examples/snippets.rs
deleted file mode 100644
index 76afec628..000000000
--- a/crates/uzu/examples/snippets.rs
+++ /dev/null
@@ -1,189 +0,0 @@
-use uzu::{
- engine::{Engine, EngineConfig},
- types::{
- basic::{Feature, ReasoningEffort, SamplingMethod},
- session::chat::{ChatConfig, ChatMessage, ChatReplyConfig, ChatSpeculationPreset},
- },
-};
-
-async fn quick_start_example() -> Result<(), Box<dyn std::error::Error>> {
- // snippet:quick-start
- let engine_config = EngineConfig::default();
- let engine = Engine::new(engine_config).await?;
-
- let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
- let downloader = engine.download(&model).await?;
- while let Some(update) = downloader.next().await {
- println!("Download progress: {}", update.progress());
- }
-
- let messages = vec![
- ChatMessage::system().with_text("You are a helpful assistant".to_string()),
- ChatMessage::user().with_text("Tell me a short, funny story about a robot".to_string()),
- ];
-
- let session = engine.chat(model, ChatConfig::default()).await?;
- let replies = session.reply(messages, ChatReplyConfig::default()).await?;
- let message = replies.first().map(|reply| reply.message.clone());
- // endsnippet:quick-start
-
- if let Some(message) = message {
- println!("Reasoning: {}", message.reasoning().unwrap_or_default());
- println!("Text: {}", message.text().unwrap_or_default());
- }
-
- Ok(())
-}
-
-async fn chat_example() -> Result<(), Box<dyn std::error::Error>> {
- // snippet:engine-create
- let engine_config = EngineConfig::default();
- let engine = Engine::new(engine_config).await?;
- // endsnippet:engine-create
-
- // snippet:model-choose
- let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
- // endsnippet:model-choose
-
- // snippet:model-download
- let downloader = engine.download(&model).await?;
- while let Some(update) = downloader.next().await {
- println!("Download progress: {}", update.progress());
- }
- // endsnippet:model-download
-
- // snippet:session-create-general
- let session = engine.chat(model, ChatConfig::default()).await?;
- // endsnippet:session-create-general
-
- // snippet:session-input-general
- let messages = vec![
- ChatMessage::system().with_text("You are a helpful assistant".to_string()),
- ChatMessage::user().with_text("Tell me a short, funny story about a robot".to_string()),
- ];
- // endsnippet:session-input-general
-
- // snippet:session-run-general
- let replies = session.reply(messages, ChatReplyConfig::default()).await?;
- let message = replies.first().map(|reply| reply.message.clone());
- // endsnippet:session-run-general
-
- if let Some(message) = message {
- println!("Reasoning: {}", message.reasoning().unwrap_or_default());
- println!("Text: {}", message.text().unwrap_or_default());
- }
-
- Ok(())
-}
-
-async fn summarization_example() -> Result<(), Box<dyn std::error::Error>> {
- let engine_config = EngineConfig::default();
- let engine = Engine::new(engine_config).await?;
-
- let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
- let downloader = engine.download(&model).await?;
- while let Some(update) = downloader.next().await {
- println!("Download progress: {}", update.progress());
- }
-
- // snippet:session-input-summarization
- let text_to_summarize = "A Large Language Model (LLM) is a type of artificial intelligence that processes and generates human-like text. \
- It is trained on vast datasets containing books, articles, and web content, allowing it to understand and predict language patterns. \
- LLMs use deep learning, particularly transformer-based architectures, to analyze text, recognize context, and generate coherent responses. \
- These models have a wide range of applications, including chatbots, content creation, translation, and code generation. \
- One of the key strengths of LLMs is their ability to generate contextually relevant text based on prompts. \
- They utilize self-attention mechanisms to weigh the importance of words within a sentence, improving accuracy and fluency. \
- Examples of popular LLMs include OpenAI's GPT series, Google's BERT, and Meta's LLaMA. \
- As these models grow in size and sophistication, they continue to enhance human-computer interactions, \
- making AI-powered communication more natural and effective.";
- let prompt = format!("Text is: \"{text_to_summarize}\". Write only summary itself.");
- let messages = vec![
- ChatMessage::system().with_reasoning_effort(ReasoningEffort::Disabled),
- ChatMessage::user().with_text(prompt),
- ];
- // endsnippet:session-input-summarization
-
- // snippet:session-create-summarization
- let chat_config = ChatConfig::default().with_speculation_preset(Some(ChatSpeculationPreset::Summarization {}));
- let session = engine.chat(model, chat_config).await?;
- // endsnippet:session-create-summarization
-
- // snippet:session-run-summarization
- let chat_reply_config =
- ChatReplyConfig::default().with_token_limit(Some(256)).with_sampling_method(SamplingMethod::Greedy {});
- let replies = session.reply(messages, chat_reply_config).await?;
- let reply = replies.first().cloned();
- // endsnippet:session-run-summarization
-
- if let Some(reply) = reply {
- println!("Summary: {}", reply.message.text().unwrap_or_default());
- println!("Generation t/s: {}", reply.stats.generate_tokens_per_second.unwrap_or_default());
- }
-
- Ok(())
-}
-
-async fn classification_example() -> Result<(), Box<dyn std::error::Error>> {
- let engine_config = EngineConfig::default();
- let engine = Engine::new(engine_config).await?;
-
- let model = engine.model("Qwen/Qwen3-0.6B".to_string()).await?.ok_or("Model not found")?;
- let downloader = engine.download(&model).await?;
- while let Some(update) = downloader.next().await {
- println!("Download progress: {}", update.progress());
- }
-
- // snippet:session-create-classification
- let feature = Feature {
- name: "sentiment".to_string(),
- values: vec![
- "Happy".to_string(),
- "Sad".to_string(),
- "Angry".to_string(),
- "Fearful".to_string(),
- "Surprised".to_string(),
- "Disgusted".to_string(),
- ],
- };
- let chat_config = ChatConfig::default().with_speculation_preset(Some(ChatSpeculationPreset::Classification {
- feature: feature.clone(),
- }));
- let session = engine.chat(model, chat_config).await?;
- // endsnippet:session-create-classification
-
- // snippet:session-input-classification
- let text_to_detect_feature = "Today's been awesome! Everything just feels right, and I can't stop smiling.";
- let prompt = format!(
- "Text is: \"{text_to_detect_feature}\". Choose {} from the list: {}. Answer with one word. Don't add a dot at the end.",
- feature.name,
- feature.values.join(", ")
- );
- let messages = vec![
- ChatMessage::system().with_reasoning_effort(ReasoningEffort::Disabled),
- ChatMessage::user().with_text(prompt),
- ];
- // endsnippet:session-input-classification
-
- // snippet:session-run-classification
- let chat_reply_config =
- ChatReplyConfig::default().with_token_limit(Some(32)).with_sampling_method(SamplingMethod::Greedy {});
- let replies = session.reply(messages, chat_reply_config).await?;
- let reply = replies.first().cloned();
- // endsnippet:session-run-classification
-
- if let Some(reply) = reply {
- println!("Prediction: {}", reply.message.text().unwrap_or_default());
- println!("Generated tokens: {}", reply.stats.tokens_count_output.unwrap_or_default());
- }
-
- Ok(())
-}
-
-#[tokio::main]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
- quick_start_example().await?;
- chat_example().await?;
- summarization_example().await?;
- classification_example().await?;
- Ok(())
-}
diff --git a/crates/uzu/examples/ssm.rs b/crates/uzu/examples/ssm.rs
deleted file mode 100644
index 90e26fae0..000000000
--- a/crates/uzu/examples/ssm.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-use uzu::{
- engine::{Engine, EngineConfig},
- types::session::chat::{ChatConfig, ChatMessage, ChatReplyConfig},
-};
-
-#[tokio::main]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
- let engine_config = EngineConfig::default();
- let engine = Engine::new(engine_config).await?;
-
- let model = engine.model("cartesia-ai/Llamba-1B-4bit-mlx".to_string()).await?.ok_or("Model not found")?;
- let downloader = engine.download(&model).await?;
- while let Some(update) = downloader.next().await {
- println!("Download progress: {}", update.progress());
- }
-
- let messages = vec![ChatMessage::user().with_text("Tell me a short, funny story about a robot".to_string())];
-
- let session = engine.chat(model, ChatConfig::default()).await?;
- let replies = session.reply(messages, ChatReplyConfig::default()).await?;
- if let Some(reply) = replies.first() {
- println!("Text: {}", reply.message.text().unwrap_or_default());
- }
-
- Ok(())
-}
diff --git a/crates/uzu/examples/text_to_speech.rs b/crates/uzu/examples/text_to_speech.rs
index e8ecd4078..b521f4671 100644
--- a/crates/uzu/examples/text_to_speech.rs
+++ b/crates/uzu/examples/text_to_speech.rs
@@ -1,4 +1,8 @@
-use uzu::engine::{Engine, EngineConfig};
+use uzu::{
+ engine::{Engine, EngineConfig},
+ session::text_to_speech::TextToSpeechSessionStreamChunk,
+ types::basic::PcmBatch,
+};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -17,9 +21,33 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
with modern architecture such as The Shard. London is also home to renowned institutions including the British Museum \
and vibrant areas like Covent Garden, offering a mix of history, entertainment, and innovation that attracts millions of visitors each year.";
let output_path = dirs::home_dir().ok_or("Home not found")?.join("Desktop").join("output.wav");
+
let session = engine.text_to_speech(model).await?;
- let pcm_batch = session.synthesize(text.to_string()).await?;
- pcm_batch.save_as_wav(output_path.to_string_lossy().to_string())?;
+ let stream = session.synthesize_stream(text.to_string()).await;
+ let mut pcm_batches: Vec<PcmBatch> = Vec::new();
+ while let Some(event) = stream.next().await {
+ match event {
+ TextToSpeechSessionStreamChunk::PcmBatch {
+ batch,
+ } => {
+ pcm_batches.push(batch);
+ },
+ TextToSpeechSessionStreamChunk::Error {
+ error,
+ } => {
+ println!("Error: {error}");
+ },
+ }
+ }
+
+ let pcm_batch_first = pcm_batches.first().ok_or("No batches")?;
+ let pcm_batch_full = PcmBatch {
+ samples: pcm_batches.iter().flat_map(|batch| batch.samples.iter().copied()).collect(),
+ sample_rate: pcm_batch_first.sample_rate,
+ channels: pcm_batch_first.channels,
+ lengths: vec![pcm_batches.iter().flat_map(|batch| batch.lengths.iter().copied()).sum()],
+ };
+ pcm_batch_full.save_as_wav(output_path.to_string_lossy().to_string())?;
println!("Output saved to: {}", output_path.display());
Ok(())
diff --git a/platforms.toml b/platforms.toml
new file mode 100644
index 000000000..8fa8e440f
--- /dev/null
+++ b/platforms.toml
@@ -0,0 +1,181 @@
+[envs]
+MACOSX_DEPLOYMENT_TARGET = "26.4"
+IPHONEOS_DEPLOYMENT_TARGET = "26.4"
+XROS_DEPLOYMENT_TARGET = "26.4"
+TVOS_DEPLOYMENT_TARGET = "26.4"
+WATCHOS_DEPLOYMENT_TARGET = "26.4"
+
+[tools]
+# Please make sure to use compatible versions of the cargo-swift / uniffi pair.
+# See: https://github.com/antoniusnaumann/cargo-swift?tab=readme-ov-file#installing-for-a-different-uniffi-version
+swift = { provider = "cargo", version = "0.11.0" }
+zigbuild = { provider = "cargo", version = "0.22.3" }
+xwin = { provider = "cargo", version = "0.22.0" }
+ziglang = { provider = "uv", version = "0.16.0" }
+maturin = { provider = "uv", version = "1.13.1" }
+
+[targets."aarch64-apple-darwin"]
+backend = "metal"
+aliases = ["apple", "macos"]
+capabilities_supported = ["grammar", "tracing"]
+capabilities_default = ["grammar"]
+required_envs = ["MACOSX_DEPLOYMENT_TARGET"]
+
+[targets."x86_64-apple-darwin"]
+backend = "cpu"
+aliases = ["apple", "macos-intel"]
+capabilities_supported = ["grammar"]
+capabilities_default = ["grammar"]
+required_envs = ["MACOSX_DEPLOYMENT_TARGET"]
+
+[targets."aarch64-apple-ios"]
+backend = "metal"
+aliases = ["apple", "ios"]
+capabilities_supported = ["grammar", "tracing"]
+capabilities_default = ["grammar"]
+required_envs = ["IPHONEOS_DEPLOYMENT_TARGET"]
+
+[targets."aarch64-apple-ios-sim"]
+backend = "metal"
+aliases = ["apple", "ios-sim", "ios-simulator"]
+capabilities_supported = ["grammar", "tracing"]
+capabilities_default = ["grammar"]
+required_envs = ["IPHONEOS_DEPLOYMENT_TARGET"]
+
+[targets."aarch64-unknown-linux-gnu"]
+backend = "cpu"
+aliases = ["linux"]
+capabilities_supported = ["grammar"]
+capabilities_default = ["grammar"]
+
+[targets."x86_64-unknown-linux-gnu"]
+backend = "cpu"
+aliases = ["linux"]
+capabilities_supported = ["grammar"]
+capabilities_default = ["grammar"]
+
+[targets."aarch64-pc-windows-msvc"]
+backend = "cpu"
+aliases = ["windows"]
+capabilities_supported = ["grammar"]
+capabilities_default = ["grammar"]
+
+[targets."x86_64-pc-windows-msvc"]
+backend = "cpu"
+aliases = ["windows"]
+capabilities_supported = ["grammar"]
+capabilities_default = ["grammar"]
+
+[targets."wasm32-wasip1-threads"]
+backend = "cpu"
+aliases = ["wasm"]
+capabilities_supported = []
+capabilities_default = []
+
+[languages.rust]
+targets = [
+ "aarch64-apple-darwin",
+ "x86_64-apple-darwin",
+ "aarch64-apple-ios",
+ "aarch64-apple-ios-sim",
+ "wasm32-wasip1-threads",
+]
+tools = ["ziglang", "zigbuild", "xwin"]
+bindings = []
+examples_path = "crates/uzu/examples"
+metadata = { image_url = "https://artifacts.trymirai.com/social/github/uzu-header.jpg", badges = [
+ "discord",
+ "email",
+ "docs",
+ "license",
+ "build",
+ "python",
+ "python_package",
+ "python_downloads",
+ "python_version",
+ "typescript",
+ "typescript_package",
+ "typescript_downloads",
+ "swift",
+ "swift_spm",
+ "swift_platforms",
+ "swift_version",
+] }
+
+[languages.python]
+targets = ["aarch64-apple-darwin", "x86_64-apple-darwin"]
+tools = ["ziglang", "zigbuild", "xwin", "maturin"]
+bindings = ["pyo3"]
+examples_path = "bindings/python/examples"
+metadata = { image_url = "https://artifacts.trymirai.com/social/github/uzu-python.jpg", badges = [
+ "discord",
+ "email",
+ "docs",
+ "license",
+ "build",
+ "python",
+ "python_package",
+ "python_downloads",
+ "python_version",
+] }
+
+[languages.swift]
+targets = ["aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-apple-ios-sim"]
+tools = ["swift"]
+bindings = ["uniffi"]
+examples_path = "bindings/swift/Sources/Examples"
+metadata = { image_url = "https://artifacts.trymirai.com/social/github/uzu-swift-header.jpg", badges = [
+ "discord",
+ "email",
+ "docs",
+ "license",
+ "build",
+ "swift",
+ "swift_spm",
+ "swift_platforms",
+ "swift_version",
+] }
+
+[languages.typescript]
+targets = ["aarch64-apple-darwin", "x86_64-apple-darwin"]
+tools = ["ziglang", "zigbuild", "xwin"]
+bindings = ["napi"]
+examples_path = "bindings/typescript/examples"
+metadata = { image_url = "https://artifacts.trymirai.com/social/github/uzu-typescript.jpg", badges = [
+ "discord",
+ "email",
+ "docs",
+ "license",
+ "build",
+ "typescript",
+ "typescript_package",
+ "typescript_downloads",
+] }
+
+[badges]
+discord = '<a href="https://discord.com/invite/trymirai"><img src="https://img.shields.io/discord/1377764166764462120?label=Discord&color=brightgreen" alt="Discord"></a>'
+email = '<a href="mailto:[email protected]?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-brightgreen" alt="Contact us"></a>'
+docs = '<a href="https://docs.trymirai.com"><img src="https://img.shields.io/badge/Read-Docs-brightgreen" alt="Read docs"></a>'
+license = '[![License](https://img.shields.io/badge/License-MIT-brightgreen)](LICENSE)'
+build = '![Build](https://github.com/trymirai/uzu/actions/workflows/tests.yml/badge.svg)'
+python = '![Python](https://img.shields.io/badge/Python-orange)'
+python_package = '![Package](https://img.shields.io/pypi/v/uzu?color=orange&label=Package)'
+python_downloads = '![Downloads](https://img.shields.io/pypi/dm/uzu?color=orange&label=Downloads)'
+python_version = '![Python](https://img.shields.io/pypi/pyversions/uzu?color=orange&label=Python)'
+typescript = '![TypeScript](https://img.shields.io/badge/TypeScript-yellow)'
+typescript_package = '![Package](https://img.shields.io/npm/v/@trymirai/uzu?color=yellow&label=Package)'
+typescript_downloads = '![Downloads](https://img.shields.io/npm/dm/@trymirai/uzu?color=yellow&label=Downloads)'
+swift = '![Swift](https://img.shields.io/badge/Swift-blue)'
+swift_platforms = '![Platforms](https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS-blue)'
+swift_spm = '![SPM](https://img.shields.io/badge/SPM-compatible-blue)'
+swift_version = '[![Swift](https://img.shields.io/badge/Swift-5.9-blue)](https://swift.org)'
+
+[examples]
+quick-start = { title = "Quick Start", description = "Minimal snippet that downloads a model and generates a single reply" }
+chat = { title = "Chat", description = "In this example, we will download a model and get a reply to a specific list of messages:", explanation = "Once loaded, the same `ChatSession` can be reused for multiple requests until you drop it. Each model may consume a significant amount of RAM, so it's important to keep only one session loaded at a time. For iOS apps, we recommend adding the [Increased Memory Capability](https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.kernel.increased-memory-limit) entitlement to ensure your app can allocate the required memory." }
+chat-cloud = { title = "Chat with the cloud model", description = "In this example, we will get a reply to a specific list of messages from a cloud model:" }
+chat-speculation-summarization = { title = "Chat using speculation preset for summarization", description = "In this example, we will use the `summarization` speculation preset to generate a summary of the input text:", explanation = "You will notice that the model’s run count is lower than the actual number of generated tokens due to speculative decoding, which significantly improves generation speed." }
+chat-speculation-classification = { title = "Chat using speculation preset for classification", description = "In this example, we will use the `classification` speculation preset to determine the sentiment of the user's input:", explanation = "You can view the stats to see that the answer will be ready immediately after the prefill step, and actual generation won’t even start due to speculative decoding, which significantly improves generation speed." }
+chat-structured-output = { title = "Chat with structured output", description = "Sometimes you want the generated output to be valid JSON with predefined fields. You can use `Grammar` to manually specify a JSON schema for the response you want to receive:" }
+classification = { title = "Classification", description = "In this example, we will use a classification model to determine whether the user's input is safe from a moderation perspective:" }
+text-to-speech = { title = "Text to Speech", description = "In this example, we will generate audio from text:" }
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index cff150a3d..613a86781 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -6,8 +6,10 @@ targets = [
"aarch64-apple-darwin",
"aarch64-apple-ios",
"aarch64-apple-ios-sim",
- "aarch64-linux-android",
+ "aarch64-pc-windows-msvc",
"aarch64-unknown-linux-gnu",
"wasm32-wasip1-threads",
- "x86_64-unknown-linux-gnu"
+ "x86_64-apple-darwin",
+ "x86_64-pc-windows-msvc",
+ "x86_64-unknown-linux-gnu",
]
diff --git a/scripts/prepare_bindings.sh b/scripts/prepare_bindings.sh
deleted file mode 100755
index 1b3421730..000000000
--- a/scripts/prepare_bindings.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-ROOT_PATH="$(cd "$(dirname "$0")/.." && pwd)"
-
-if [ -d "$HOME/.cargo/bin" ]; then
- export PATH="$HOME/.cargo/bin:$PATH"
-fi
-if [ -d "/opt/homebrew/bin" ]; then
- export PATH="/opt/homebrew/bin:$PATH"
-fi
-
-cd "$ROOT_PATH"
-cargo run -p cli-release prepare-bindings "$@"
diff --git a/workspace/readme/fragments/intro.md b/workspace/readme/fragments/intro.md
new file mode 100644
index 000000000..a1ca675ee
--- /dev/null
+++ b/workspace/readme/fragments/intro.md
@@ -0,0 +1,7 @@
+A high-performance inference engine for AI models. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. Key features:
+
+- Simple, high-level API
+- Unified model configurations, making it easy to add support for new models
+- Traceable computations to ensure correctness against the source-of-truth implementation
+- Utilizes unified memory on Apple devices
+- [Broad model support](https://trymirai.com/models)
\ No newline at end of file
diff --git a/workspace/readme/fragments/python/dependency.md b/workspace/readme/fragments/python/dependency.md
new file mode 100644
index 000000000..fb4000d30
--- /dev/null
+++ b/workspace/readme/fragments/python/dependency.md
@@ -0,0 +1,3 @@
+```bash
+uv add uzu=={{ version }}
+```
diff --git a/workspace/readme/fragments/rust/dependency.md b/workspace/readme/fragments/rust/dependency.md
new file mode 100644
index 000000000..b09c036d8
--- /dev/null
+++ b/workspace/readme/fragments/rust/dependency.md
@@ -0,0 +1,4 @@
+```toml
+[dependencies]
+uzu = { git = "https://github.com/trymirai/uzu", branch = "main", package = "uzu" }
+```
diff --git a/workspace/readme/fragments/swift/dependency.md b/workspace/readme/fragments/swift/dependency.md
new file mode 100644
index 000000000..3fd7d1366
--- /dev/null
+++ b/workspace/readme/fragments/swift/dependency.md
@@ -0,0 +1,5 @@
+```swift
+dependencies: [
+ .package(url: "https://github.com/trymirai/uzu.git", from: "{{ version }}")
+]
+```
diff --git a/workspace/readme/fragments/typescript/dependency.md b/workspace/readme/fragments/typescript/dependency.md
new file mode 100644
index 000000000..f2ad5d78f
--- /dev/null
+++ b/workspace/readme/fragments/typescript/dependency.md
@@ -0,0 +1,3 @@
+```bash
+pnpm add @trymirai/uzu@{{ version }}
+```
diff --git a/workspace/readme/template.md b/workspace/readme/template.md
new file mode 100644
index 000000000..f7c9b4469
--- /dev/null
+++ b/workspace/readme/template.md
@@ -0,0 +1,147 @@
+<p align="center">
+ <picture>
+ <img alt="Mirai" src="{{ image_url }}" style="max-width: 100%;">
+ </picture>
+</p>
+
+{% for badge in badges %}{{ badge }} {% endfor %}
+
+# {{ title }}
+
+{{ intro }}
+
+## Quick Start
+
+{% for language in languages %}
+{% if has_multiple_languages %}
+<details>
+<summary>{{ language.display }}</summary>
+<br>
+{% endif %}
+Add the dependency:
+
+{{ language.dependency }}
+
+Run the code below:
+
+```{{ language.code_fence }}
+{{ language.quick_start }}
+```
+{% if has_multiple_languages %}
+</details>
+{% endif %}
+{% endfor %}
+<br>
+Everything from model downloading to inference configuration is handled automatically. Refer to the [documentation](https://docs.trymirai.com) for details on how to customize each step of the process.
+
+## Examples
+
+You can run any example via `cargo tools example` \<{% for language in languages %}**{{ language.name }}**{% if not loop.last %} | {% endif %}{% endfor %}\> \<{% for example in examples %}**{{ example.name }}**{% if not loop.last %} | {% endif %}{% endfor %}\>:
+
+{% for example in examples %}{% if example.name != "quick-start" %}### {{ example.title }}
+
+{{ example.description }}
+
+{% for language in languages %}{% if has_multiple_languages %}<details>
+<summary>{{ language.display }}</summary>
+
+{% endif %}```{{ language.code_fence }}
+{{ language.examples[example.name] }}
+```
+{% if has_multiple_languages %}
+</details>
+
+{% endif %}{% endfor %}
+{% if example.explanation %}<br>{{ example.explanation }}
+
+{% endif %}{% endif %}{% endfor %}{% if has_multiple_languages %}
+## Development
+
+`uzu` is a native Rust crate with bindings available for:
+
+- `Swift` via [uniffi-rs](https://github.com/mozilla/uniffi-rs)
+- `Python` via [pyo3](https://github.com/PyO3/pyo3)
+- `TypeScript` via [napi-rs](https://github.com/napi-rs/napi-rs)
+
+It supports:
+
+- Backends:
+{% for backend in backends %} - `{{ backend }}`
+{% endfor %}- Targets:
+{% for target in targets %} - `{{ target.name }}`{% if target.in_progress %} _(in progress)_{% endif %}
+{% endfor %}
+<br>
+For initial setup we recommend running <code>cargo tools setup</code>, which installs all necessary dependencies (<code>rustup</code>, <code>uv</code>, <code>pnpm</code>, <code>Rust targets</code>, <code>Metal toolchain</code>, ...) if not already present.
+
+<br>
+To unify cross-language development we introduce <code>cargo tools</code>:
+
+- Install language specific dependencies: `cargo tools install typescript`
+- Build: `cargo tools build rust --targets apple`
+- Test: `cargo tools test python`
+- Run example: `cargo tools example swift chat`
+
+## Model Format
+
+`uzu` uses its own model format. You can download a test model:
+
+```bash
+./scripts/download_test_model.sh
+```
+
+Or download any supported model that has already been converted:
+
+```bash
+cd ./tools/
+uv run downloader list # show the list of supported models
+uv run downloader download {REPO} # download a specific model
+```
+
+Models downloaded for development are stored at `./workspace/models/{{ version }}/`.
+
+You can also export a model yourself with [lalamo](https://github.com/trymirai/lalamo):
+
+```bash
+git clone https://github.com/trymirai/lalamo.git
+cd lalamo
+uv run lalamo list-models
+uv run lalamo convert meta-llama/Llama-3.2-1B-Instruct
+```
+
+## CLI
+
+You can run `uzu` in [CLI](https://docs.trymirai.com/overview/cli) mode:
+
+```bash
+cargo run --release -p cli -- help
+```
+
+```text
+Usage: cli [COMMAND]
+
+Commands:
+ run Run a model with the specified path
+ serve Start a server with the specified model path
+ bench Run benchmarks for the specified model
+ help Print this message or the help of the given subcommand(s)
+```
+
+## Benchmarks
+
+To run benchmarks:
+
+```bash
+cargo run --release -p cli -- bench ./workspace/models/{{ version }}/{MODEL_NAME} ./workspace/models/{{ version }}/{MODEL_NAME}/benchmark_task.json ./workspace/models/{{ version }}/{MODEL_NAME}/benchmark_result.json
+```
+
+`benchmark_task.json` is automatically generated after the model is downloaded via `./tools/`.
+
+{% endif %}
+
+## Troubleshooting
+
+If you experience any problems, please contact us via [Discord](https://discord.com/invite/trymirai) or [email](mailto:[email protected]).
+
+## License
+
+This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.