Switchyard lets LLM applications route traffic across models and providers while preserving native OpenAI and Anthropic API compatibility - enabling flexible model selection, benchmarking, and cost/performance optimization.
Rust
feat: TypeScript bindings and Pi virtual model example (#953)
Graham Kingef8c2cc8cd41
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 508d1a3dd..f5dd62e40 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -125,6 +125,32 @@ jobs:- name: cargo test (prefill-router)run: cargo test -p switchyard-runner --features prefill-router --locked+ node:+ name: TypeScript bindings and Pi example+ needs: changes+ if: needs.changes.outputs.full_ci == 'true'+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: '22.23.3'+ cache: npm+ cache-dependency-path: |+ bindings/typescript/package-lock.json+ examples/pi/package-lock.json+ - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4+ with:+ cache-bin: false+ save-if: ${{ github.ref == 'refs/heads/main' }}+ - run: npm --prefix bindings/typescript ci+ - run: npm --prefix bindings/typescript run build+ - run: npm --prefix bindings/typescript run typecheck+ - run: npm --prefix bindings/typescript test+ - run: npm --prefix examples/pi ci+ - run: npm --prefix examples/pi run typecheck+ - run: npm --prefix examples/pi test+typecheck:name: Typecheck (mypy)needs: changes@@ -252,7 +278,7 @@ jobs:ci-success:name: CI Successif: always()- needs: [changes, lint, spdx-headers, rust, typecheck, test, litellm, slim-install-smoke]+ needs: [changes, lint, spdx-headers, rust, node, typecheck, test, litellm, slim-install-smoke]runs-on: ubuntu-lateststeps:- name: Verify all jobs succeededdiff --git a/.gitignore b/.gitignoreindex ec5473806..bc9410dc7 100644--- a/.gitignore+++ b/.gitignore@@ -6,6 +6,12 @@ __pycache__/# C extensions*.so+# Node.js bindings+node_modules/+*.node+/bindings/typescript/LICENSE+/bindings/typescript/NOTICE+# Distribution / packagingleaderboard/report/diff --git a/Cargo.lock b/Cargo.lockindex fa09b78d7..c1664fc83 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -496,6 +496,15 @@ dependencies = ["memchr",]+[[package]]+name = "convert_case"+version = "0.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1af709f1f33454bf52eadfc8c78b3b9ef9cb26fb54d16dc9cd9a7299f899fd1b"+dependencies = [+ "unicode-segmentation",+]+[[package]]name = "core-foundation"version = "0.10.1"@@ -545,6 +554,12 @@ version = "0.8.23"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"+[[package]]+name = "ctor"+version = "1.0.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d"+[[package]]name = "data-encoding"version = "2.11.1"@@ -1615,7 +1630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf"dependencies = ["gtk-sys",- "libloading",+ "libloading 0.7.4","once_cell",]@@ -1635,6 +1650,16 @@ dependencies = ["winapi",]+[[package]]+name = "libloading"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60"+dependencies = [+ "cfg-if",+ "windows-link",+]+[[package]]name = "libredox"version = "0.1.25"@@ -1790,6 +1815,65 @@ dependencies = ["windows-sys 0.61.2",]+[[package]]+name = "napi"+version = "3.14.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a4e2cf85c02d9b057898c485b824c3c416b65193689e2b7f517efc94b86ed24c"+dependencies = [+ "bitflags",+ "ctor",+ "futures",+ "libc",+ "napi-build",+ "napi-sys",+ "nohash-hasher",+ "rustc-hash",+ "tokio",+]++[[package]]+name = "napi-build"+version = "2.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b899b545d3aa6dca985939059f258c5488d34e4ecf39c274e20009748f4b846d"++[[package]]+name = "napi-derive"+version = "3.6.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92cec6048ac04041ac8055bdce1ec4f353416cd443ba9222bf73af790c3d4495"+dependencies = [+ "convert_case",+ "ctor",+ "napi-derive-backend",+ "proc-macro2",+ "quote",+ "syn 3.0.3",+]++[[package]]+name = "napi-derive-backend"+version = "6.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fae2444f4ba7333754bb73414ff8059dec2cb23b83a95bd1a0bf08169eed1be0"+dependencies = [+ "convert_case",+ "proc-macro2",+ "quote",+ "semver",+ "syn 3.0.3",+]++[[package]]+name = "napi-sys"+version = "3.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e22a4f25c16a5c5411d987cd6fbd48313522ae1789ade2d6dd3efdc6d40a0fc8"+dependencies = [+ "libloading 0.9.0",+]+[[package]]name = "nemo-relay-plugin"version = "0.10.0"@@ -1818,6 +1902,12 @@ dependencies = ["uuid",]+[[package]]+name = "nohash-hasher"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"+[[package]]name = "nu-ansi-term"version = "0.50.3"@@ -3275,6 +3365,20 @@ dependencies = ["wiremock",]+[[package]]+name = "switchyard-node"+version = "0.3.0"+dependencies = [+ "napi",+ "napi-build",+ "napi-derive",+ "serde_json",+ "switchyard-protocol",+ "switchyard-runner",+ "tokio",+ "tokio-util",+]+[[package]]name = "switchyard-preproc"version = "0.1.0"@@ -3974,6 +4078,12 @@ version = "1.0.24"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"+[[package]]+name = "unicode-segmentation"+version = "1.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"+[[package]]name = "untrusted"version = "0.9.0"diff --git a/Cargo.toml b/Cargo.tomlindex b2f12bc3d..2c788b727 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -9,6 +9,7 @@ members = ["crates/libsy-llm-client","crates/prefill-router","crates/switchyard-py",+ "crates/switchyard-node","crates/protocol","crates/switchyard-nemo-relay-plugin","crates/switchyard-runner",diff --git a/bindings/typescript/README.md b/bindings/typescript/README.mdnew file mode 100644index 000000000..1f9dfebdd--- /dev/null+++ b/bindings/typescript/README.md@@ -0,0 +1,110 @@+# Switchyard runner for Node.js++Local TypeScript bindings for choosing a model with Switchyard. The caller sends+the selected model's completion request and owns session state.++Requires Node.js 22.19 or newer and the repository's Rust toolchain. The package+is private. Its native addon is built for the local host. Linux is covered in CI.++## Build++From the repository root:++```bash+npm --prefix bindings/typescript ci+npm --prefix bindings/typescript run build+npm --prefix bindings/typescript run typecheck+npm --prefix bindings/typescript test+```++The build uses Cargo's development profile. It copies the addon and license files+into the package. Rebuild after changing Rust code. Three loopback tests cover+model selection, safe errors, and cancellation. The Pi tests also exercise auto+routing with tool history.++Install the built package in a local Node project:++```bash+npm install /absolute/path/to/Switchyard/bindings/typescript+```++## API++```ts+import { readFileSync } from "node:fs";+import { Runner } from "@switchyard/runner";++const runner = Runner.fromToml(readFileSync("deployment.toml", "utf8"));+const controller = new AbortController();+const decision = await runner.decide("switchyard/auto", "Explain this bug", {+ signal: controller.signal,+});+// decision: { target: "luna", model: "gpt-5.6-luna" }+```++`fromToml` synchronously loads and validates a version-1 runner deployment. Reuse+that runner for later decisions. `decide` takes a configured route **ID** and either+one user text prompt or an array of `RoutingMessage` values. It returns the selected+target name and configured model ID. Concurrent decisions can share a runner.++Use conversation messages for algorithms such as `auto` that inspect tool history.+The exported `RoutingMessage` and `RoutingContent` types cover text, tool calls,+and tool results in Switchyard's format:++```ts+const decision = await runner.decide("switchyard/auto", [+ { role: "user", content: [{ type: "text", text: "Fix the tests" }] },+ { role: "assistant", content: [{+ type: "tool_call", id: "call-1", name: "bash", arguments: { command: "pytest" },+ }] },+ { role: "tool", content: [{+ type: "tool_result", tool_call_id: "call-1", is_error: true,+ content: [{ type: "text", text: "out of memory" }],+ }] },+]);+```++Routing state is fresh for each call. Supply the current branch's conversation on+each decision. The API leaves session identity unset, so recovery signals come+from the transcript rather than cross-request capable holds.++`AbortSignal` cancels the Rust routing future, including pending classifier HTTP+work and retry waits. Cancellation rejects with `name: "AbortError"` and+`code: "ABORT_ERR"`. Other errors have one of these codes:++| Code | Meaning |+| --- | --- |+| `ERR_CONFIG` | Invalid or unsupported configuration, including missing classifier credentials |+| `ERR_UNKNOWN_ROUTE` | The requested route ID is absent |+| `ERR_INVALID_REQUEST` | Routing messages have an invalid shape |+| `ERR_ROUTING` | The algorithm or classifier call failed |+| `ERR_UNSUPPORTED_OUTCOME` | The outcome cannot be represented by a model choice |++Configuration errors preserve the runner's diagnostic message. TOML parse errors+include a line and column when available, with document excerpts kept in Rust.+Provider failures use safe summaries.++## Supported routes++Use `auto`, `passthrough` with its subagent policy unset, or `llm_classifier` in+capability mode. Auto uses local tool signals with an efficient-first default.+Capability mode supports both LLM judges and System One decision judges.+Use `classify_trigger = "every_request"` and `message_hash_fallback = false`+(their defaults). The host persists any chosen model or phase.++The host owns completion prompts, reasoning, and request options. Completion+targets must leave `system_prompt`, `reasoning_effort`, `extra_body`, and+`omit_body_fields` unset. Classifier targets can use their own settings. Clients+must leave `forward_auth` disabled.++Classifier API keys come from the existing `api_key_env` settings. The binding+requires no completion-provider credentials when those clients omit+`api_key_env`. The runner still constructs their clients during loading, so they+need valid HTTP(S) base URLs. For host-owned dispatch, use a credential-free+placeholder such as `http://127.0.0.1:1/v1`.++Use the returned **target name** to look up the host's provider and model. Model+IDs alone can overlap across providers. The binding returns the selected target;+the host owns completion retries and fallback policy.++See [`examples/pi`](../../examples/pi/README.md) for a virtual-model extension.diff --git a/bindings/typescript/package-lock.json b/bindings/typescript/package-lock.jsonnew file mode 100644index 000000000..d010a986d--- /dev/null+++ b/bindings/typescript/package-lock.json@@ -0,0 +1,51 @@+{+ "name": "@switchyard/runner",+ "version": "0.3.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "@switchyard/runner",+ "version": "0.3.0",+ "license": "Apache-2.0",+ "devDependencies": {+ "@types/node": "22.19.19",+ "typescript": "5.9.3"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@types/node": {+ "version": "22.19.19",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.19.tgz",+ "integrity": "sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~6.21.0"+ }+ },+ "node_modules/typescript": {+ "version": "5.9.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "dev": true,+ "license": "MIT"+ }+ }+}diff --git a/bindings/typescript/package.json b/bindings/typescript/package.jsonnew file mode 100644index 000000000..416fc75fd--- /dev/null+++ b/bindings/typescript/package.json@@ -0,0 +1,20 @@+{+ "name": "@switchyard/runner",+ "version": "0.3.0",+ "private": true,+ "description": "Model-selection bindings for Switchyard",+ "license": "Apache-2.0",+ "type": "module",+ "engines": { "node": ">=22.19.0" },+ "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } },+ "files": ["dist", "LICENSE", "NOTICE", "README.md"],+ "scripts": {+ "build": "node scripts/build.mjs && tsc",+ "typecheck": "tsc --noEmit",+ "test": "node --test test/*.test.mjs"+ },+ "devDependencies": {+ "@types/node": "22.19.19",+ "typescript": "5.9.3"+ }+}diff --git a/bindings/typescript/scripts/build.mjs b/bindings/typescript/scripts/build.mjsnew file mode 100644index 000000000..105b2422b--- /dev/null+++ b/bindings/typescript/scripts/build.mjs@@ -0,0 +1,17 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++import { execFileSync } from "node:child_process";+import { copyFileSync, mkdirSync } from "node:fs";+import { fileURLToPath } from "node:url";+import { join } from "node:path";++const root = fileURLToPath(new URL("../../../", import.meta.url));+const pkg = fileURLToPath(new URL("../", import.meta.url));+execFileSync("cargo", ["build", "-p", "switchyard-node", "--locked"], { cwd: root, stdio: "inherit" });+const metadata = JSON.parse(execFileSync("cargo", ["metadata", "--no-deps", "--format-version", "1", "--locked"], { cwd: root }));+const library = process.platform === "win32" ? "switchyard_node.dll"+ : process.platform === "darwin" ? "libswitchyard_node.dylib" : "libswitchyard_node.so";+mkdirSync(join(pkg, "dist"), { recursive: true });+copyFileSync(join(metadata.target_directory, "debug", library), join(pkg, "dist", "switchyard.node"));+for (const file of ["LICENSE", "NOTICE"]) copyFileSync(join(root, file), join(pkg, file));diff --git a/bindings/typescript/src/index.ts b/bindings/typescript/src/index.tsnew file mode 100644index 000000000..42a59284f--- /dev/null+++ b/bindings/typescript/src/index.ts@@ -0,0 +1,87 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++import { createRequire } from "node:module";++export interface Decision {+ target: string;+ model: string;+}++/** Text and tool activity used for routing, in Switchyard's message format. */+export type RoutingContent =+ | { type: "text"; text: string }+ | { type: "tool_call"; id: string; name: string; arguments: Record<string, unknown> }+ | { type: "tool_result"; tool_call_id: string; content: readonly RoutingContent[]; is_error: boolean };++export interface RoutingMessage {+ role: "system" | "developer" | "user" | "assistant" | "tool";+ content: readonly RoutingContent[];+}++interface Cancellation {+ cancel(): void;+}++interface NativeRunner {+ decide(routeId: string, messages: string, cancellation: Cancellation): Promise<Decision>;+}++const native: {+ NativeRunner: new (source: string) => NativeRunner;+ Cancellation: new () => Cancellation;+} = createRequire(import.meta.url)("./switchyard.node");++function abortError(): Error {+ return Object.assign(new Error("Routing cancelled"), { name: "AbortError", code: "ABORT_ERR" });+}++function publicError(cause: unknown): Error {+ const message = cause instanceof Error ? cause.message : String(cause);+ const match = /^(ERR_CONFIG|ERR_UNKNOWN_ROUTE|ERR_INVALID_REQUEST|ERR_ROUTING|ERR_UNSUPPORTED_OUTCOME|ABORT_ERR): (.*)$/s.exec(message);+ if (match?.[1] === "ABORT_ERR") return abortError();+ return Object.assign(new Error(match?.[2] ?? "Routing failed"), {+ code: match?.[1] ?? "ERR_ROUTING",+ });+}++/** A reusable model selector. The caller owns completion dispatch and session state. */+export class Runner {+ readonly #native: NativeRunner;++ private constructor(source: string) {+ this.#native = new native.NativeRunner(source);+ }++ /** Loads a model-selection deployment. Classifier credentials come from its environment settings. */+ static fromToml(source: string): Runner {+ try {+ return new Runner(source);+ } catch (error) {+ throw publicError(error);+ }+ }++ /** Selects a target from a conversation or a single user prompt. */+ async decide(routeId: string, input: string | readonly RoutingMessage[], options: { signal?: AbortSignal } = {}): Promise<Decision> {+ const signal = options.signal;+ if (signal?.aborted) throw abortError();+ const cancellation = new native.Cancellation();+ const onAbort = () => cancellation.cancel();+ signal?.addEventListener("abort", onAbort, { once: true });+ try {+ if (signal?.aborted) throw abortError();+ const messages: readonly RoutingMessage[] = typeof input === "string"+ ? [{ role: "user", content: [{ type: "text", text: input }] }]+ : input;+ const result = await this.#native.decide(routeId, JSON.stringify(messages), cancellation);+ if (signal?.aborted) throw abortError();+ return result;+ } catch (error) {+ if (signal?.aborted) throw abortError();+ throw publicError(error);+ } finally {+ signal?.removeEventListener("abort", onAbort);+ }+ }+}diff --git a/bindings/typescript/test/classifier.toml b/bindings/typescript/test/classifier.tomlnew file mode 100644index 000000000..97cb97f05--- /dev/null+++ b/bindings/typescript/test/classifier.toml@@ -0,0 +1,42 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0++schema_version = 1++[decision_clients.classifier]+format = "system_one"+endpoint = "http://127.0.0.1:1/classify"+api_key_env = "SWITCHYARD_TEST_KEY"+timeout_ms = 10000++[decision_targets.judge]+id = "jev-latest"+decision_client = "classifier"++# The caller owns completion dispatch.+[llm_clients.pi]+format = "openai_chat"+base_url = "http://127.0.0.1:1/v1"++[targets.complex]+id = "gpt-5.6-sol"+llm_client = "pi"++[targets.standard]+id = "gpt-5.6-terra"+llm_client = "pi"++[routes.planner]+id = "switchyard/planner"+type = "llm_classifier"+mode = "capability"+classifier_target = "judge"+strong_target = "complex"+weak_target = "standard"+classify_trigger = "every_request"+fail_open = false++[routes.planner.decision]+cutoff = 0.5+candidates = { a = "complex", b = "standard" }+evidence = { candidates = { a = "More capable software engineering model for difficult design and debugging", b = "Lower-cost planning model for ordinary software engineering tasks" } }diff --git a/bindings/typescript/test/runner.test.mjs b/bindings/typescript/test/runner.test.mjsnew file mode 100644index 000000000..9c00f2390--- /dev/null+++ b/bindings/typescript/test/runner.test.mjs@@ -0,0 +1,91 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++import assert from "node:assert/strict";+import { getEventListeners, once } from "node:events";+import { readFileSync } from "node:fs";+import { createServer } from "node:http";+import { test } from "node:test";+import { Runner } from "../dist/index.js";++const config = readFileSync(new URL("./classifier.toml", import.meta.url), "utf8");++async function setup(t, handler) {+ const calls = [];+ const http = createServer(async (req, res) => {+ let body = "";+ for await (const chunk of req) body += chunk;+ calls.push({ url: req.url, body: JSON.parse(body) });+ handler(res);+ });+ http.listen(0, "127.0.0.1");+ await once(http, "listening");+ t.after(() => {+ http.closeAllConnections();+ return new Promise((resolve) => http.close(resolve));+ });+ const previous = process.env.SWITCHYARD_TEST_KEY;+ process.env.SWITCHYARD_TEST_KEY = "secret-sentinel";+ t.after(() => {+ if (previous === undefined) delete process.env.SWITCHYARD_TEST_KEY;+ else process.env.SWITCHYARD_TEST_KEY = previous;+ });+ const source = config.replace("http://127.0.0.1:1/classify", `http://127.0.0.1:${http.address().port}/classify`);+ return { runner: Runner.fromToml(source), calls };+}++test("selects the configured target through the classifier", async (t) => {+ const { runner, calls } = await setup(t, (res) => {+ res.setHeader("content-type", "application/json");+ res.end(JSON.stringify({ answers: { route: {+ type: "choice", choice: "advantage", probabilities: { advantage: 0.9, no_advantage: 0.1 },+ } } }));+ });+ assert.equal(calls.length, 0);+ assert.deepEqual(await runner.decide("switchyard/planner", "hard task"), {+ target: "complex", model: "gpt-5.6-sol",+ });+ assert.equal(calls.length, 1);+ assert.equal(calls[0].url, "/classify");+ assert.deepEqual(calls[0].body.state.task[0].content, [{ type: "text", text: "hard task" }]);+});++test("reports safe configuration, route, and classifier errors", async (t) => {+ assert.throws(() => Runner.fromToml("secret-sentinel = ["), (error) => {+ assert.equal(error.code, "ERR_CONFIG");+ assert.match(error.message, /failed to parse TOML at line 1, column \d+/);+ assert.doesNotMatch(error.message, /secret-sentinel/);+ return true;+ });+ assert.throws(+ () => Runner.fromToml(config.replace('classify_trigger = "every_request"', 'classify_trigger = "new_session"')),+ { code: "ERR_CONFIG", message: /route planner:.*every_request/ },+ );+ const { runner } = await setup(t, (res) => { res.writeHead(401); res.end("secret-sentinel"); });+ await assert.rejects(runner.decide("unknown", "hello"), { code: "ERR_UNKNOWN_ROUTE" });+ await assert.rejects(runner.decide("switchyard/planner", [{ role: "invalid", content: [] }]), { code: "ERR_INVALID_REQUEST" });+ await assert.rejects(runner.decide("switchyard/planner", "hello"), (error) => {+ assert.equal(error.code, "ERR_ROUTING");+ assert.doesNotMatch(error.message, /secret-sentinel/);+ return true;+ });+});++test("abort cancels the native HTTP request and releases its listener", { timeout: 5000 }, async (t) => {+ const received = Promise.withResolvers();+ const closed = Promise.withResolvers();+ const { runner } = await setup(t, (res) => {+ res.on("close", closed.resolve);+ received.resolve();+ });+ const controller = new AbortController();+ const rejected = assert.rejects(+ runner.decide("switchyard/planner", "hello", { signal: controller.signal }),+ { name: "AbortError", code: "ABORT_ERR" },+ );+ await received.promise;+ controller.abort();+ await rejected;+ await closed.promise;+ assert.equal(getEventListeners(controller.signal, "abort").length, 0);+});diff --git a/bindings/typescript/tsconfig.json b/bindings/typescript/tsconfig.jsonnew file mode 100644index 000000000..4fc5b0c9c--- /dev/null+++ b/bindings/typescript/tsconfig.json@@ -0,0 +1,13 @@+{+ "compilerOptions": {+ "target": "ES2023",+ "module": "NodeNext",+ "moduleResolution": "NodeNext",+ "strict": true,+ "declaration": true,+ "outDir": "dist",+ "rootDir": "src",+ "skipLibCheck": true+ },+ "include": ["src/**/*.ts"]+}diff --git a/crates/switchyard-node/Cargo.toml b/crates/switchyard-node/Cargo.tomlnew file mode 100644index 000000000..d8990a6e2--- /dev/null+++ b/crates/switchyard-node/Cargo.toml@@ -0,0 +1,28 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0++[package]+name = "switchyard-node"+version.workspace = true+edition.workspace = true+rust-version.workspace = true+license.workspace = true+authors.workspace = true+repository.workspace = true+description = "Node.js model-selection bindings for Switchyard"+publish = false++[lib]+crate-type = ["cdylib"]++[dependencies]+napi = { version = "3", default-features = false, features = ["napi8", "tokio_rt", "dyn-symbols"] }+napi-derive = "3"+serde_json.workspace = true+switchyard-runner.workspace = true+switchyard-protocol.workspace = true+tokio.workspace = true+tokio-util = { version = "0.7", features = ["rt"] }++[build-dependencies]+napi-build = "2"diff --git a/crates/switchyard-node/build.rs b/crates/switchyard-node/build.rsnew file mode 100644index 000000000..1838bba57--- /dev/null+++ b/crates/switchyard-node/build.rs@@ -0,0 +1,6 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++fn main() {+ napi_build::setup();+}diff --git a/crates/switchyard-node/src/lib.rs b/crates/switchyard-node/src/lib.rsnew file mode 100644index 000000000..a49a15a33--- /dev/null+++ b/crates/switchyard-node/src/lib.rs@@ -0,0 +1,114 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++//! Node.js bindings for caller-owned completion dispatch and routing state.++use napi_derive::napi;+use switchyard_protocol::{LlmRequest, ModelId, Request};+use switchyard_runner::{Runner, RunnerError};+use tokio_util::sync::CancellationToken;++// The JS wrapper turns these fixed prefixes into public Error codes.+fn error(code: &str, message: &str) -> napi::Error {+ napi::Error::from_reason(format!("{code}: {message}"))+}++#[napi]+#[derive(Default)]+pub struct Cancellation {+ token: CancellationToken,+}++#[napi]+impl Cancellation {+ #[napi(constructor)]+ pub fn new() -> Self {+ Self::default()+ }++ #[napi]+ pub fn cancel(&self) {+ self.token.cancel();+ }+}++#[napi(object)]+pub struct Decision {+ pub target: String,+ pub model: String,+}++#[napi]+pub struct NativeRunner {+ runner: Runner,+}++#[napi]+impl NativeRunner {+ #[napi(constructor)]+ pub fn new(source: String) -> napi::Result<Self> {+ let runner = Runner::from_toml_for_model_selection(&source).map_err(|err| match err {+ RunnerError::Configuration { message, .. } => error("ERR_CONFIG", &message),+ _ => error("ERR_CONFIG", "Invalid model-selection configuration"),+ })?;+ Ok(Self { runner })+ }++ #[napi]+ pub async fn decide(+ &self,+ route_id: String,+ messages: String,+ cancellation: &Cancellation,+ ) -> napi::Result<Decision> {+ // napi-rs retains both JS objects while this async method borrows them.+ tokio::select! {+ biased;+ _ = cancellation.token.cancelled() => Err(error("ABORT_ERR", "Routing cancelled")),+ result = select_model(&self.runner, route_id, messages) => result,+ }+ }+}++async fn select_model(+ runner: &Runner,+ route_id: String,+ messages: String,+) -> napi::Result<Decision> {+ let route = runner+ .route(&route_id)+ .ok_or_else(|| error("ERR_UNKNOWN_ROUTE", "Unknown route ID"))?;+ let request = Request {+ llm_request: LlmRequest {+ model: Some(route_id.clone()),+ messages: serde_json::from_str(&messages)+ .map_err(|_| error("ERR_INVALID_REQUEST", "Invalid routing messages"))?,+ ..Default::default()+ },+ ..Default::default()+ };+ let mut expected = request.llm_request.clone();+ let outcome = route+ .decide(request)+ .await+ .map_err(|err| error("ERR_ROUTING", err.execution_error_summary().kind.as_str()))?;+ expected.model = outcome.request.llm_request.model.clone();+ if outcome.response.is_some() || outcome.request.llm_request != expected {+ return Err(error(+ "ERR_UNSUPPORTED_OUTCOME",+ "Routing changed the completion request or produced an answer",+ ));+ }+ let decision = runner+ .describe_decision(&ModelId::from(route_id), &outcome)+ .ok_or_else(|| {+ error(+ "ERR_UNSUPPORTED_OUTCOME",+ "Routing selected an unresolved target",+ )+ })?;+ Ok(Decision {+ target: decision.selected.target,+ model: decision.selected.model.to_string(),+ })+}diff --git a/crates/switchyard-runner/src/algorithm.rs b/crates/switchyard-runner/src/algorithm.rsindex 1c0f1dff9..38310642c 100644--- a/crates/switchyard-runner/src/algorithm.rs+++ b/crates/switchyard-runner/src/algorithm.rs@@ -565,6 +565,21 @@ impl StageClassifierConfig {}impl AlgorithmSpec {+ /// Whether this configuration only selects a model, with state owned by the caller.+ pub(crate) fn supports_model_selection(&self) -> bool {+ match self {+ Self::Passthrough {+ subagents: None, ..+ }+ | Self::Auto { .. } => true,+ Self::LlmClassifier { config } => {+ matches!(config.classifier_mode(), ClassifierMode::Capability)+ && config.classify_trigger == ClassifyTrigger::EveryRequest+ }+ _ => false,+ }+ }+pub(crate) fn decision_judge(&self) -> Option<(&str, &DecisionJudgeRouteConfig)> {match self {Self::LlmClassifier { config, .. } => configdiff --git a/crates/switchyard-runner/src/config.rs b/crates/switchyard-runner/src/config.rsindex f3bfcdf37..43edc3ae3 100644--- a/crates/switchyard-runner/src/config.rs+++ b/crates/switchyard-runner/src/config.rs@@ -52,6 +52,27 @@ pub(crate) fn runner_from_toml(source: &str) -> RunnerResult<Runner> {config.build()}+pub(crate) fn model_selection_from_toml(source: &str) -> RunnerResult<Runner> {+ let config: DeploymentConfig = toml::from_str(source).map_err(|error: toml::de::Error| {+ // Report the location while keeping document excerpts in the source error.+ let mut message = "failed to parse TOML".to_string();+ if let Some(prefix) = error.span().and_then(|span| source.get(..span.start)) {+ let line = prefix.bytes().filter(|byte| *byte == b'\n').count() + 1;+ let column = prefix+ .rsplit('\n')+ .next()+ .unwrap_or_default()+ .chars()+ .count()+ + 1;+ message = format!("{message} at line {line}, column {column}");+ }+ RunnerError::configuration_source(message, error)+ })?;+ config.validate_model_selection()?;+ config.build()+}+#[derive(Debug, Deserialize)]#[serde(deny_unknown_fields)]pub(crate) struct DeploymentConfig {@@ -146,6 +167,36 @@ impl RouteConfig {}impl DeploymentConfig {+ fn validate_model_selection(&self) -> RunnerResult<()> {+ for (name, client) in &self.llm_clients {+ if client.forward_auth {+ return Err(RunnerError::configuration(format!(+ "llm client {name}: model selection requires configured classifier credentials"+ )));+ }+ }+ for (name, route) in &self.routes {+ if !route.algorithm.supports_model_selection() {+ return Err(RunnerError::configuration(format!(+ "route {name}: model selection requires auto, passthrough, or capability llm_classifier with every_request"+ )));+ }+ for target_name in route.routing_target_names() {+ if let Some(target) = self.targets.get(target_name)+ && (target.system_prompt.is_some()+ || target.reasoning_effort.is_some()+ || !target.extra_body.is_empty()+ || !target.omit_body_fields.is_empty())+ {+ return Err(RunnerError::configuration(format!(+ "target {target_name}: model selection requires completion settings to be owned by the caller"+ )));+ }+ }+ }+ Ok(())+ }+fn decision_target(&self, name: &str) -> Option<DecisionTarget> {let target = self.targets.get(name)?;let client = self.llm_clients.get(&target.llm_client)?;diff --git a/crates/switchyard-runner/src/runner.rs b/crates/switchyard-runner/src/runner.rsindex 249e31271..ffba5120f 100644--- a/crates/switchyard-runner/src/runner.rs+++ b/crates/switchyard-runner/src/runner.rs@@ -56,6 +56,15 @@ impl Runner {config::runner_from_toml(source)}+ /// Loads routes whose only completion-side effect is model selection.+ ///+ /// Accepts auto, passthrough, and capability classifiers with per-request decisions.+ /// Completion request overrides and forwarded authentication are rejected;+ /// the caller owns completion dispatch and session state.+ pub fn from_toml_for_model_selection(source: &str) -> Result<Self, RunnerError> {+ config::model_selection_from_toml(source)+ }+/// Builds a runner from named routes in caller-provided order./// Pre-condition: There must be at least one route.pub fn new(routes: Vec<(ModelId, Route)>) -> Self {diff --git a/crates/switchyard-runner/tests/model_selection.rs b/crates/switchyard-runner/tests/model_selection.rsnew file mode 100644index 000000000..e2a9066c9--- /dev/null+++ b/crates/switchyard-runner/tests/model_selection.rs@@ -0,0 +1,61 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++use switchyard_runner::Runner;++const CONFIG: &str = r#"+schema_version = 1+[llm_clients.local]+format = "openai_chat"+base_url = "http://127.0.0.1:1/v1"+[targets.fast]+id = "fast-model"+llm_client = "local"+[targets.strong]+id = "strong-model"+llm_client = "local"+[routes.test]+id = "route-id"+type = "llm_classifier"+classifier_target = "strong"+strong_target = "strong"+weak_target = "fast"+base_threshold = 0.5+"#;++#[test]+fn accepts_per_request_classification_and_rejects_session_state() {+ assert!(Runner::from_toml_for_model_selection(CONFIG).is_ok());+ let stateful = format!("{CONFIG}\nclassify_trigger = 'new_session'");+ assert!(Runner::from_toml(&stateful).is_ok());+ assert!(Runner::from_toml_for_model_selection(&stateful).is_err());++ let invalid = format!("{CONFIG}\nmessage_hash_fallback = true");+ assert!(Runner::from_toml(&invalid).is_err());+ assert!(Runner::from_toml_for_model_selection(&invalid).is_err());+}++#[test]+fn rejects_answer_producing_algorithms() {+ let config = CONFIG.replace(+ "type = \"llm_classifier\"\nclassifier_target = \"strong\"\nstrong_target = \"strong\"\nweak_target = \"fast\"\nbase_threshold = 0.5",+ "type = 'advisor'\nexecutor_target = 'fast'\nadvisor_target = 'strong'",+ );+ assert!(Runner::from_toml(&config).is_ok());+ assert!(Runner::from_toml_for_model_selection(&config).is_err());+}++#[test]+fn rejects_completion_overrides_and_forwarded_auth() {+ for (table, setting) in [+ ("targets.fast", "system_prompt = 'override'"),+ ("llm_clients.local", "forward_auth = true"),+ ] {+ let config = CONFIG.replace(&format!("[{table}]"), &format!("[{table}]\n{setting}"));+ assert!(Runner::from_toml(&config).is_ok(), "{setting}");+ assert!(+ Runner::from_toml_for_model_selection(&config).is_err(),+ "{setting}"+ );+ }+}diff --git a/examples/pi/README.md b/examples/pi/README.mdnew file mode 100644index 000000000..59f0d9f8b--- /dev/null+++ b/examples/pi/README.md@@ -0,0 +1,80 @@+# Pi virtual model using Switchyard auto++This example registers `switchyard/auto` and asks Switchyard to select a model on+every request:++- **Efficient:** Luna (`openai-codex/gpt-6-luna`).+- **Capable:** Sol (`openai-codex/gpt-6.1-sol`).+- **Thinking:** always `medium`.++`auto` currently uses Switchyard's stage router with an efficient-first default+and a confidence threshold of 0.5. It reads tool activity and results to choose a+model. It can escalate to Sol during recovery and return to Luna as work proceeds.+The same routing applies to user requests, continuations, retries, and direct+requests such as compaction summaries.++## Configuration++`switchyard.toml` contains just the algorithm settings:++```toml+type = "auto"+efficient_target = "openai-codex/gpt-6-luna"+capable_target = "openai-codex/gpt-6.1-sol"+```++Set either target to a `provider/model` reference available in Pi's catalog, such+as `openai-codex/gpt-6-astra`. The first slash separates the provider from the model+ID; `openrouter/vendor/model` keeps `vendor/model` as the ID. Both providers and+models come from this file. Thinking remains `medium`.++The extension generates the runner's target entries, route ID, and credential-free+placeholder client. Pi uses the selected model's catalog limits. Set+`SWITCHYARD_CONFIG` to use another algorithm-settings file, and reload the+extension after changing its configuration.++## Local setup++Requires Node.js 22.19 or newer, the repository's Rust toolchain, and Pi with the+virtual-model API. Development checks use Pi 1.0.4.++From the repository root:++```bash+npm --prefix bindings/typescript ci+npm --prefix bindings/typescript run build+npm --prefix examples/pi ci+npm --prefix examples/pi run typecheck+npm --prefix examples/pi test+```++The tests exercise the actual auto algorithm locally, check message conversion,+and load the extension through Pi's public resource loader.++Sign in to the configured providers through Pi's `/login` and confirm the models+are in your catalog. Then:++```bash+pi -e ./examples/pi/switchyard-router.ts --model switchyard/auto+```++Completion calls can incur provider charges. The auto routing decision runs+locally; Pi owns completion credentials and connections.++## Conversation handling++The extension passes visible text, tool-call arguments, paired tool results, and+failure flags to Switchyard. Pi keeps the original images and reasoning for the+chosen completion model. Each decision uses the current branch's transcript,+including the history available after compaction or resume.++The binding uses fresh routing state for each request. Auto's cross-request+capable hold requires session identity; this extension relies on the recent tool+history for recovery signals instead. It keeps its routing decisions independent+across branches.++Routing errors and cancellation propagate to Pi. The extension checks target+identities and resolves the selected model through Pi's catalog.++For the binding's API and configuration restrictions, see+[`bindings/typescript`](../../bindings/typescript/README.md).diff --git a/examples/pi/package-lock.json b/examples/pi/package-lock.jsonnew file mode 100644index 000000000..764516730--- /dev/null+++ b/examples/pi/package-lock.json@@ -0,0 +1,2162 @@+{+ "name": "switchyard-pi-example",+ "version": "0.3.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "switchyard-pi-example",+ "version": "0.3.0",+ "license": "Apache-2.0",+ "dependencies": {+ "@switchyard/runner": "file:../../bindings/typescript",+ "smol-toml": "1.9.0"+ },+ "devDependencies": {+ "@earendil-works/pi-ai": "1.0.4",+ "@earendil-works/pi-coding-agent": "1.0.4",+ "@types/node": "22.19.19",+ "typescript": "5.9.3"+ },+ "engines": {+ "node": ">=22.19.0"+ },+ "peerDependencies": {+ "@earendil-works/pi-ai": "*",+ "@earendil-works/pi-coding-agent": "*"+ }+ },+ "../../bindings/typescript": {+ "name": "@switchyard/runner",+ "version": "0.3.0",+ "license": "Apache-2.0",+ "devDependencies": {+ "@types/node": "22.19.19",+ "typescript": "5.9.3"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@anthropic-ai/sdk": {+ "version": "0.129.0",+ "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.129.0.tgz",+ "integrity": "sha512-MH7LB20kNpGLUpPTe2OG5XvL/KhX8HUO9XyBaFjgFk6TLS4Xjt0VPIuMKywe7POKKPslX+QxSlVok9e+8kG5Nw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "json-schema-to-ts": "^3.1.1",+ "standardwebhooks": "^1.0.0"+ },+ "bin": {+ "anthropic-ai-sdk": "bin/cli"+ },+ "peerDependencies": {+ "zod": "^3.25.0 || ^4.0.0"+ },+ "peerDependenciesMeta": {+ "zod": {+ "optional": true+ }+ }+ },+ "node_modules/@aws-sdk/client-bedrock-runtime": {+ "version": "3.1127.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.1127.0.tgz",+ "integrity": "sha512-IDl/lrPb90aH+pZFHGNDmgH9nAUQj5PlZH1sJ3w7RikctyjHSnY3oNjZhrLoaBoQn/rNK0zsP6OHEqEhj2tdLA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.977.9",+ "@aws-sdk/credential-provider-node": "^3.972.82",+ "@aws-sdk/eventstream-handler-node": "^3.972.34",+ "@aws-sdk/middleware-eventstream": "^3.972.29",+ "@aws-sdk/middleware-websocket": "^3.972.52",+ "@aws-sdk/token-providers": "3.1127.0",+ "@aws-sdk/types": "^3.974.5",+ "@smithy/core": "^3.33.3",+ "@smithy/fetch-http-handler": "^5.7.2",+ "@smithy/node-http-handler": "^4.11.3",+ "@smithy/types": "^4.17.2",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/core": {+ "version": "3.978.1",+ "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.978.1.tgz",+ "integrity": "sha512-LbY9aGsEiznDWmUc30Nwv3aIX/+dbwTx8KfS0yOC3NPYMO+O91e6jkT1azf34FwjOndq8/Q+RcVVZz5xnerwdg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.974.6",+ "@aws-sdk/xml-builder": "^3.972.41",+ "@aws/lambda-invoke-store": "^0.3.0",+ "@smithy/core": "^3.35.0",+ "@smithy/signature-v4": "^5.7.3",+ "@smithy/types": "^4.19.0",+ "bowser": "^2.11.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-env": {+ "version": "3.972.72",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.72.tgz",+ "integrity": "sha512-xTKO/FWJPozTIXbozVnVGoNBhaGba8TBcx+KyUjRVeOlXE+dUc7GTR1cLvu0uTdIdmemzaFbqqCshXeZA1fZew==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-http": {+ "version": "3.972.74",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.74.tgz",+ "integrity": "sha512-u91E/hT8f4d1xy0Jl7VG4nVKJ3lxbrZkoBTeSVoJdWBiSEUMwMS/9+e0H/aJVQV//Lt5wuzP+E69v4aRSsNTmw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/fetch-http-handler": "^5.8.0",+ "@smithy/node-http-handler": "^4.12.1",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-ini": {+ "version": "3.973.17",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.973.17.tgz",+ "integrity": "sha512-ged4KXdBkvIC81bLvNHHuQKdKak/VXhQTR1NWYTTqW0474nlmsxy9O/vlgTIohDDWH3xpBdtVMZRyjb+DnocDA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/credential-provider-env": "^3.972.72",+ "@aws-sdk/credential-provider-http": "^3.972.74",+ "@aws-sdk/credential-provider-login": "^3.972.79",+ "@aws-sdk/credential-provider-process": "^3.972.72",+ "@aws-sdk/credential-provider-sso": "^3.973.16",+ "@aws-sdk/credential-provider-web-identity": "^3.972.78",+ "@aws-sdk/nested-clients": "^3.997.46",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/credential-provider-imds": "^4.5.2",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-login": {+ "version": "3.972.79",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.79.tgz",+ "integrity": "sha512-L+Z85anONJd8MaiuraO4wRxATCdEejBZ3K3eymzWI5JPXa9sOS9CkIm72PBKqXKX+Z9p9NGMX5AIMXm0LEflgw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/nested-clients": "^3.997.46",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-node": {+ "version": "3.972.84",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.84.tgz",+ "integrity": "sha512-oHt854odINVwzwsh+c5x69j0ajm4DbqqqVJ+O1ECsCIZeMDAbzFpXItaqP7UZstJj/ATdTk/KFSH0LaNAgV+kA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/credential-provider-env": "^3.972.72",+ "@aws-sdk/credential-provider-http": "^3.972.74",+ "@aws-sdk/credential-provider-ini": "^3.973.17",+ "@aws-sdk/credential-provider-process": "^3.972.72",+ "@aws-sdk/credential-provider-sso": "^3.973.16",+ "@aws-sdk/credential-provider-web-identity": "^3.972.78",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/credential-provider-imds": "^4.5.2",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-process": {+ "version": "3.972.72",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.72.tgz",+ "integrity": "sha512-rLIp2xbMjX/k9/od7APpqq1ZgXXnV0pOL1Th3ZsL8Wu0TRtBsDTVS8iPqcfRFcHakFxPvR04OSTv2ka2qOb/2A==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-sso": {+ "version": "3.973.16",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.973.16.tgz",+ "integrity": "sha512-IGihaJfFZYacJJr/odqILCoK7W/mvrZ7cuK7ECn3sAu4vLC6u0V8bS7mCGbdugJ8Aum2tnvqmx0F2MRFp2rn9g==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/nested-clients": "^3.997.46",+ "@aws-sdk/token-providers": "3.1138.0",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers": {+ "version": "3.1138.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1138.0.tgz",+ "integrity": "sha512-GpyAr0DD63YOEmYFM6Df+gJuIgC92MMTiBK4FTKfxii5MJ9ge20epR7LyroulscYlG89J+ZB2ivFDPjvfQhzdw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/nested-clients": "^3.997.46",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-web-identity": {+ "version": "3.972.78",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.78.tgz",+ "integrity": "sha512-/y9WvNtlcPBGLR0qc1a+9J/xtYZfVczvLUOuXaVWylzttH7ewsxwHtjmiJSolNrVSDorIxHGHMU61CbonRkmwA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/nested-clients": "^3.997.46",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/eventstream-handler-node": {+ "version": "3.972.35",+ "resolved": "https://registry.npmjs.org/@aws-sdk/eventstream-handler-node/-/eventstream-handler-node-3.972.35.tgz",+ "integrity": "sha512-a8xilRoRaalvSPZdfrs0VY3/BPc0uYhXW56Z/k6nmZ5Vk430LHeowf9APIPq8utM3tMJSNGSSuJMlB9YrPsN+A==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-eventstream": {+ "version": "3.972.30",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-eventstream/-/middleware-eventstream-3.972.30.tgz",+ "integrity": "sha512-B6gvZlcnRBNWraKgyEjKsbhv+VjtbyHmpU7hmtTHzXpDSxHPpCJnYLpglEOOsF+SFne20DbZC5IVC1aNr2Pb4A==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-websocket": {+ "version": "3.972.54",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-websocket/-/middleware-websocket-3.972.54.tgz",+ "integrity": "sha512-bhESdru8u8KosziH8jcVta/NM/dNreeRz2+2aU86si5bfBYOiJ6IiqD+9U4URUcU5WJO3Yw+jO3GLDIHlscXMQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/fetch-http-handler": "^5.8.0",+ "@smithy/signature-v4": "^5.7.3",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">= 14.0.0"+ }+ },+ "node_modules/@aws-sdk/nested-clients": {+ "version": "3.997.46",+ "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.997.46.tgz",+ "integrity": "sha512-oRxtBcka/JGHGs9l9p9IVajGoTP8vTPmoAzdHGy4Qcy9P5vPnDf6nhIeM/COQNY9k/OahImTRaLkHftoXvfcmQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.978.1",+ "@aws-sdk/signature-v4-multi-region": "^3.996.47",+ "@aws-sdk/types": "^3.974.6",+ "@smithy/core": "^3.35.0",+ "@smithy/fetch-http-handler": "^5.8.0",+ "@smithy/node-http-handler": "^4.12.1",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/signature-v4-multi-region": {+ "version": "3.996.47",+ "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.996.47.tgz",+ "integrity": "sha512-Zk08macMvQTHzQJCLJVkOlviVoqwYMrpXv4lmLN7b7sAbiMoOK7Go0NYdR5UeF+MW8LIbRmwrNy9u/5VvX1U5g==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.974.6",+ "@smithy/signature-v4": "^5.7.3",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/token-providers": {+ "version": "3.1127.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1127.0.tgz",+ "integrity": "sha512-Dv2TMWBshJ+tF6ahs2Sy5bh4Iabsd4GAQqVvE9XZmYmnoaVbpS2QKIKE/HRacc7bTtbjEEvP+laGzHvHlf1CiQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.977.9",+ "@aws-sdk/nested-clients": "^3.997.44",+ "@aws-sdk/types": "^3.974.5",+ "@smithy/core": "^3.33.3",+ "@smithy/types": "^4.17.2",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/types": {+ "version": "3.974.6",+ "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.974.6.tgz",+ "integrity": "sha512-v/clNZzZnDxGyvpHMOGpJKVXFAExJzUNAAjaWGdcx8QAcXLGwTaOkw33p5SHAi0YAioK32xB3hWwOekRVfmfKg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/xml-builder": {+ "version": "3.972.41",+ "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.41.tgz",+ "integrity": "sha512-ctjVSyCMegrWfXlx6VqzSBFI6UqmQ5ZlnfMhdLIiWmhoH8UAQxSCP5N3OpG7X3k4LnS7ou74C4mt20+bfTW2aQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws/lambda-invoke-store": {+ "version": "0.3.0",+ "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.3.0.tgz",+ "integrity": "sha512-sl4Bm6yiMNYrZKkqqDFWN0UfnWhlS8ivKxrYl+6t0gCLrqr8y3B2IqZZbFRkfaVVp7C/baApyh71P+LeE1A2sQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@babel/runtime": {+ "version": "7.29.10",+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.10.tgz",+ "integrity": "sha512-NpugTzbKgGrNe45Ui32cN8vCFFMxVtP/9rtfwv0nP5FRDAjvYBxJcLVpYA9mr1jxP6cnIT7x9LUzuDTbWYYNRA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@earendil-works/chord": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@earendil-works/chord/-/chord-1.0.4.tgz",+ "integrity": "sha512-d2JZw2utoa/reoSmL07O71wsXiMDhIlnnxTb4LCNV+Oq8Evj2rGLvjVuYrlXZGbXUr0IDNfvd1RT/utCY1UhkQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "esbuild": "0.28.2"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@earendil-works/pi-agent-core": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-1.0.4.tgz",+ "integrity": "sha512-/xGICE+N/+G9N7KfYFSxlE8G8fQcBlLHKiY+j1Ehz9vvb1zhvGneWosFK56d2qmA5oteafeG7yKr2nqU4ed9ig==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@earendil-works/pi-ai": "^1.0.4",+ "typebox": "1.3.27"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@earendil-works/pi-ai": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-1.0.4.tgz",+ "integrity": "sha512-/Eu5R0gfor6wcmRcVyOmulUiZmsHJ0bKu5wXXnpCoSHF3y4FnW4fgnjRlLjNza8NJWXdvW5Uew90Zukx7Sh2rw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@anthropic-ai/sdk": "0.129.0",+ "@aws-sdk/client-bedrock-runtime": "3.1127.0",+ "@earendil-works/pi-telemetry": "^1.0.4",+ "@google/genai": "2.21.0",+ "@smithy/node-http-handler": "4.12.1",+ "http-proxy-agent": "9.1.0",+ "https-proxy-agent": "9.1.0",+ "openai": "7.19.0",+ "partial-json": "0.1.7",+ "typebox": "1.3.27"+ },+ "bin": {+ "pi-ai": "dist/cli.js"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@earendil-works/pi-codemode": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-codemode/-/pi-codemode-1.0.4.tgz",+ "integrity": "sha512-e198pjBsdEQJ/RCjJ9ZeYIjRaQYWUgtoZbPCmJ57auuOsiRsBXeSZ1aiWtTah0/7gx97WIOD1XqHvgRU0gOXtg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "quickjs-wasi": "3.6.2"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@earendil-works/pi-coding-agent": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-coding-agent/-/pi-coding-agent-1.0.4.tgz",+ "integrity": "sha512-+956nfMFHr5lDUVY/2Q4k+YzojzBuCaBXFgj0eSlXVGr7QVliVddKdc1Pz6yVg1dOlJQmb67doOVrlMsIcIdaw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@earendil-works/chord": "^1.0.4",+ "@earendil-works/pi-agent-core": "^1.0.4",+ "@earendil-works/pi-ai": "^1.0.4",+ "@earendil-works/pi-codemode": "^1.0.4",+ "@earendil-works/pi-mcp": "^1.0.4",+ "@earendil-works/pi-tui": "^1.0.4",+ "@silvia-odwyer/photon-node": "0.3.4",+ "brace-expansion": "5.0.12",+ "chalk": "6.0.0",+ "cross-spawn": "7.0.6",+ "diff": "8.0.4",+ "grok-mermaid": "0.2.3",+ "highlight.js": "10.7.3",+ "hosted-git-info": "9.0.3",+ "ignore": "7.0.8",+ "jiti": "2.7.0",+ "minimatch": "10.2.6",+ "proper-lockfile": "4.1.2",+ "quickjs-wasi": "3.6.2",+ "semver": "7.8.5",+ "typebox": "1.3.27",+ "undici": "8.10.2",+ "yaml": "2.9.0"+ },+ "bin": {+ "pi": "dist/bundle/cli.js"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@earendil-works/pi-mcp": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-mcp/-/pi-mcp-1.0.4.tgz",+ "integrity": "sha512-I6SqOqrKED+XrjkkFIXY7Ze38QtXtjojPJlQsJ2v5soCPV4QI1bNxXDwQaqzZ2a+6pNN8meWrRw1qkSMbPy9QQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cross-spawn": "7.0.6"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@earendil-works/pi-telemetry": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-telemetry/-/pi-telemetry-1.0.4.tgz",+ "integrity": "sha512-DL2eXXtnL5/VQkuQd97fL57GXTG1/zKHtMmDsrv8tGeJ5EgYYTWvzy44dqbYL0lD0Z22v/NOwqU3PHO75HVrqA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@earendil-works/pi-tui": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-1.0.4.tgz",+ "integrity": "sha512-TgvDJohtxvG3XWQID5w6bwEyBocywdG0F9yHZtP+Ywvtiq9RgeSMbeB8quUobk7/4ko6IvFOQo45AqIqNVr8Rg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "get-east-asian-width": "1.6.0",+ "marked": "18.0.11"+ },+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",+ "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz",+ "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",+ "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz",+ "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",+ "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",+ "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",+ "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",+ "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",+ "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",+ "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",+ "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",+ "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",+ "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",+ "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",+ "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",+ "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz",+ "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",+ "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",+ "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",+ "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",+ "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openharmony-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",+ "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",+ "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",+ "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",+ "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",+ "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@google/genai": {+ "version": "2.21.0",+ "resolved": "https://registry.npmjs.org/@google/genai/-/genai-2.21.0.tgz",+ "integrity": "sha512-+PDtco2/Z0ONdzCGekCoCT+O1VJS9xJQNN4XzQpXG/t3El/SWWMkCWlFRO1KmivOHPa4Q0VjUYu1HBKCZ/v33Q==",+ "dev": true,+ "hasInstallScript": true,+ "license": "Apache-2.0",+ "dependencies": {+ "google-auth-library": "^10.3.0",+ "p-retry": "^4.6.2",+ "protobufjs": "^7.5.4",+ "ws": "^8.18.0"+ },+ "engines": {+ "node": ">=20.0.0"+ },+ "peerDependencies": {+ "@modelcontextprotocol/sdk": "^1.25.2"+ },+ "peerDependenciesMeta": {+ "@modelcontextprotocol/sdk": {+ "optional": true+ }+ }+ },+ "node_modules/@protobufjs/aspromise": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/base64": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/codegen": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz",+ "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/eventemitter": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",+ "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/fetch": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",+ "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.1"+ }+ },+ "node_modules/@protobufjs/float": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/path": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/pool": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/utf8": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.2.tgz",+ "integrity": "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@silvia-odwyer/photon-node": {+ "version": "0.3.4",+ "resolved": "https://registry.npmjs.org/@silvia-odwyer/photon-node/-/photon-node-0.3.4.tgz",+ "integrity": "sha512-bnly4BKB3KDTFxrUIcgCLbaeVVS8lrAkri1pEzskpmxu9MdfGQTy8b8EgcD83ywD3RPMsIulY8xJH5Awa+t9fA==",+ "dev": true,+ "license": "Apache-2.0"+ },+ "node_modules/@smithy/core": {+ "version": "3.35.1",+ "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.35.1.tgz",+ "integrity": "sha512-i4YPS4B6ts7bjn7UwLnGjiZdprOvHvgGobFZsYK3GIY3E5hIqtj0rReU69BcTpGp+fvtraSNXeG1l+jtJvF55w==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/credential-provider-imds": {+ "version": "4.5.2",+ "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.5.2.tgz",+ "integrity": "sha512-A9uSdn72ozbRUSit0eib0TW7nXuNPlaeM0zcGkJ+nE6tFcSDbnmtwoxbTCFBukVQcszDAyvsd7+rTduPTXpygg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/core": "^3.33.2",+ "@smithy/types": "^4.17.2",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/fetch-http-handler": {+ "version": "5.8.0",+ "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.8.0.tgz",+ "integrity": "sha512-ycSJu3tFAQ4v04CBB0agqFMVsSQ1iG3yw+SpgxRqKfaURpQD4CZ8Wn0zPMmSnOuTpTh65Vz+EA0rMrw089wvkA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/core": "^3.33.3",+ "@smithy/types": "^4.18.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/node-http-handler": {+ "version": "4.12.1",+ "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.12.1.tgz",+ "integrity": "sha512-ThMkboGeONWXAelq9FvGsuJC4rOi+qyC4/zhUF58xYpxUg5sQKx2VXZYJmtNjr4dSuBJ1HeJXETQILCz3wOHvw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/core": "^3.33.3",+ "@smithy/types": "^4.18.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/signature-v4": {+ "version": "5.7.4",+ "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.7.4.tgz",+ "integrity": "sha512-tHy0K0VtqNd5Y7Y41h0a0Lhh0L1GzC08dTWg0F7vRJWFtTENg7IZikf3wQkanYIRdb7ngoIPMTmqgUi401fEeQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/core": "^3.35.0",+ "@smithy/types": "^4.19.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/types": {+ "version": "4.19.0",+ "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.19.0.tgz",+ "integrity": "sha512-r7jh49VJxGerfAcTQA6gXcKc+98zOp/tqRwzYjgOE+iSQsP6cEU1hq2QzbuipmP68QtYdY9wKEhiCQZIzHgZ4Q==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@stablelib/base64": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@stablelib/base64/-/base64-1.0.1.tgz",+ "integrity": "sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@switchyard/runner": {+ "resolved": "../../bindings/typescript",+ "link": true+ },+ "node_modules/@types/node": {+ "version": "22.19.19",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.19.tgz",+ "integrity": "sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~6.21.0"+ }+ },+ "node_modules/@types/retry": {+ "version": "0.12.0",+ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz",+ "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/agent-base": {+ "version": "9.0.0",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-9.0.0.tgz",+ "integrity": "sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/balanced-match": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "18 || 20 || >=22"+ }+ },+ "node_modules/base64-js": {+ "version": "1.5.1",+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/bignumber.js": {+ "version": "9.3.1",+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",+ "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "*"+ }+ },+ "node_modules/bowser": {+ "version": "2.14.1",+ "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.14.1.tgz",+ "integrity": "sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/brace-expansion": {+ "version": "5.0.12",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",+ "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^4.0.2"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },+ "node_modules/buffer-equal-constant-time": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",+ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/chalk": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-6.0.0.tgz",+ "integrity": "sha512-2uNTXIuTTxk7ciZgAU1BQcgnchcG0xXnrs6jzkQfj9SsRa9M2s5zE8WT96hS6KmG4MzWHSrvH43DF1m4XRkrFg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=22"+ },+ "funding": {+ "url": "https://github.com/chalk/chalk?sponsor=1"+ }+ },+ "node_modules/cross-spawn": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.1.0",+ "shebang-command": "^2.0.0",+ "which": "^2.0.1"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/data-uri-to-buffer": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",+ "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 12"+ }+ },+ "node_modules/debug": {+ "version": "4.4.3",+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ms": "^2.1.3"+ },+ "engines": {+ "node": ">=6.0"+ },+ "peerDependenciesMeta": {+ "supports-color": {+ "optional": true+ }+ }+ },+ "node_modules/diff": {+ "version": "8.0.4",+ "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz",+ "integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.3.1"+ }+ },+ "node_modules/ecdsa-sig-formatter": {+ "version": "1.0.11",+ "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",+ "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "safe-buffer": "^5.0.1"+ }+ },+ "node_modules/esbuild": {+ "version": "0.28.2",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",+ "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.28.2",+ "@esbuild/android-arm": "0.28.2",+ "@esbuild/android-arm64": "0.28.2",+ "@esbuild/android-x64": "0.28.2",+ "@esbuild/darwin-arm64": "0.28.2",+ "@esbuild/darwin-x64": "0.28.2",+ "@esbuild/freebsd-arm64": "0.28.2",+ "@esbuild/freebsd-x64": "0.28.2",+ "@esbuild/linux-arm": "0.28.2",+ "@esbuild/linux-arm64": "0.28.2",+ "@esbuild/linux-ia32": "0.28.2",+ "@esbuild/linux-loong64": "0.28.2",+ "@esbuild/linux-mips64el": "0.28.2",+ "@esbuild/linux-ppc64": "0.28.2",+ "@esbuild/linux-riscv64": "0.28.2",+ "@esbuild/linux-s390x": "0.28.2",+ "@esbuild/linux-x64": "0.28.2",+ "@esbuild/netbsd-arm64": "0.28.2",+ "@esbuild/netbsd-x64": "0.28.2",+ "@esbuild/openbsd-arm64": "0.28.2",+ "@esbuild/openbsd-x64": "0.28.2",+ "@esbuild/openharmony-arm64": "0.28.2",+ "@esbuild/sunos-x64": "0.28.2",+ "@esbuild/win32-arm64": "0.28.2",+ "@esbuild/win32-ia32": "0.28.2",+ "@esbuild/win32-x64": "0.28.2"+ }+ },+ "node_modules/extend": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/fast-sha256": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/fast-sha256/-/fast-sha256-1.3.0.tgz",+ "integrity": "sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ==",+ "dev": true,+ "license": "Unlicense"+ },+ "node_modules/fetch-blob": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",+ "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/jimmywarting"+ },+ {+ "type": "paypal",+ "url": "https://paypal.me/jimmywarting"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "node-domexception": "^1.0.0",+ "web-streams-polyfill": "^3.0.3"+ },+ "engines": {+ "node": "^12.20 || >= 14.13"+ }+ },+ "node_modules/formdata-polyfill": {+ "version": "4.0.10",+ "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",+ "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fetch-blob": "^3.1.2"+ },+ "engines": {+ "node": ">=12.20.0"+ }+ },+ "node_modules/gaxios": {+ "version": "7.3.1",+ "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.3.1.tgz",+ "integrity": "sha512-kB3rzJV7d9juLZh8/56QTXCwQfxyhdOMdyYk1HdQKFtF8TJTDTZQJtixWIwXdE9Jji91mC41DUNpjleo4L4eAQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "extend": "^3.0.2",+ "https-proxy-agent": "^7.0.1",+ "node-fetch": "^3.3.2"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/gaxios/node_modules/agent-base": {+ "version": "7.1.4",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/gaxios/node_modules/https-proxy-agent": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.2",+ "debug": "4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/gcp-metadata": {+ "version": "8.1.2",+ "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.2.tgz",+ "integrity": "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "gaxios": "^7.0.0",+ "google-logging-utils": "^1.0.0",+ "json-bigint": "^1.0.0"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/get-east-asian-width": {+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz",+ "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/google-auth-library": {+ "version": "10.9.1",+ "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.9.1.tgz",+ "integrity": "sha512-i1ydyHrqcIxXkWh/uBmVkzCvIuq5yiK2ATndIe5XxKholrG/MTYP9xGYka4sQhrbIAgGjL2B6NOE7rFaiF3fXw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "base64-js": "^1.3.0",+ "ecdsa-sig-formatter": "^1.0.11",+ "gaxios": "^7.1.4",+ "gcp-metadata": "8.1.2",+ "google-logging-utils": "1.1.3",+ "jws": "^4.0.0"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/google-logging-utils": {+ "version": "1.1.3",+ "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.3.tgz",+ "integrity": "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=14"+ }+ },+ "node_modules/graceful-fs": {+ "version": "4.2.11",+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/grok-mermaid": {+ "version": "0.2.3",+ "resolved": "https://registry.npmjs.org/grok-mermaid/-/grok-mermaid-0.2.3.tgz",+ "integrity": "sha512-/4KopAbsjvuRP9MdPtlDjOHUmUVEohOX73JNcsWpzAtFxh+bq5+Dhb6gzvRieLDwIPQIR3/vy8V1NNTuz4Zsmg==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/highlight.js": {+ "version": "10.7.3",+ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",+ "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": "*"+ }+ },+ "node_modules/hosted-git-info": {+ "version": "9.0.3",+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-9.0.3.tgz",+ "integrity": "sha512-Hc+ghLoSt6QaYZUv0WBiIvmMDZuZZ7oaDvdH8MbfOO4lOsxdXLEvuC6ePoGs9H1X9oCLyq6+NVN0MKqD+ydxyg==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "lru-cache": "^11.1.0"+ },+ "engines": {+ "node": "^20.17.0 || >=22.9.0"+ }+ },+ "node_modules/http-proxy-agent": {+ "version": "9.1.0",+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-9.1.0.tgz",+ "integrity": "sha512-2NxoveTT58mjYT4n3RPTEfCZGLMbidoO8XEieXfpSYxu+PQJ1qpx4ypwH6N+uF9twBPIvRRgvkvW5HUTYWENig==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "agent-base": "9.0.0",+ "debug": "^4.3.4",+ "proxy-agent-negotiate": "1.1.0"+ },+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/https-proxy-agent": {+ "version": "9.1.0",+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-9.1.0.tgz",+ "integrity": "sha512-ag87y7cJJ9/3+GxFr8Oy4O5faDsGRGnBGsJj/YjOSsSx/5eadKLYTMPlzuR6obgoCDDm0abAAZitXXQkMOPSpA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "agent-base": "9.0.0",+ "debug": "^4.3.4",+ "proxy-agent-negotiate": "1.1.0"+ },+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/ignore": {+ "version": "7.0.8",+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.8.tgz",+ "integrity": "sha512-YYNsSlXBjMk92SKnkwvB5LOVSa6OznlFUGcsvrFgNJbJCd0M1XKeFVRc8ZByeCqz32FivYNHJVooLmdqrmvp/Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/isexe": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/jiti": {+ "version": "2.7.0",+ "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",+ "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "jiti": "lib/jiti-cli.mjs"+ }+ },+ "node_modules/json-bigint": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",+ "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "bignumber.js": "^9.0.0"+ }+ },+ "node_modules/json-schema-to-ts": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/json-schema-to-ts/-/json-schema-to-ts-3.1.1.tgz",+ "integrity": "sha512-+DWg8jCJG2TEnpy7kOm/7/AxaYoaRbjVB4LFZLySZlWn8exGs3A4OLJR966cVvU26N7X9TWxl+Jsw7dzAqKT6g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/runtime": "^7.18.3",+ "ts-algebra": "^2.0.0"+ },+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/jwa": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz",+ "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "buffer-equal-constant-time": "^1.0.1",+ "ecdsa-sig-formatter": "1.0.11",+ "safe-buffer": "^5.0.1"+ }+ },+ "node_modules/jws": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",+ "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "jwa": "^2.0.1",+ "safe-buffer": "^5.0.1"+ }+ },+ "node_modules/long": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",+ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",+ "dev": true,+ "license": "Apache-2.0"+ },+ "node_modules/lru-cache": {+ "version": "11.5.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",+ "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": "20 || >=22"+ }+ },+ "node_modules/marked": {+ "version": "18.0.11",+ "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.11.tgz",+ "integrity": "sha512-HnslJfsZkRPBDJRHvVtAaWlZHEpSu7u8LgQuJCELjRKuWR+hpq4A7sLq3p8HaI9ypVoXDXxV34CsQJEe1+J5Aw==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "marked": "bin/marked.js"+ },+ "engines": {+ "node": ">= 20"+ }+ },+ "node_modules/minimatch": {+ "version": "10.2.6",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "brace-expansion": "^5.0.8"+ },+ "engines": {+ "node": "18 || 20 || >=22"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/ms": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/node-domexception": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",+ "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",+ "deprecated": "Use your platform's native DOMException instead",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/jimmywarting"+ },+ {+ "type": "github",+ "url": "https://paypal.me/jimmywarting"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=10.5.0"+ }+ },+ "node_modules/node-fetch": {+ "version": "3.3.2",+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "data-uri-to-buffer": "^4.0.0",+ "fetch-blob": "^3.1.4",+ "formdata-polyfill": "^4.0.10"+ },+ "engines": {+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/node-fetch"+ }+ },+ "node_modules/openai": {+ "version": "7.19.0",+ "resolved": "https://registry.npmjs.org/openai/-/openai-7.19.0.tgz",+ "integrity": "sha512-MX2s3u2L5racTO0CC/SWpCOasJQBCJrqLKXK+l82cAhdeF8mPMBEe/gxMm0ZFa2xpKpOFLRjxv5afYEZbBXmbQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=22.0.0"+ },+ "peerDependencies": {+ "@aws-sdk/credential-provider-node": ">=3.972.0 <4",+ "@smithy/hash-node": ">=4.3.0 <5",+ "@smithy/signature-v4": ">=5.4.0 <6",+ "undici": ">=5 <9",+ "ws": "^8.21.0",+ "zod": "^3.25 || ^4.0"+ },+ "peerDependenciesMeta": {+ "@aws-sdk/credential-provider-node": {+ "optional": true+ },+ "@smithy/hash-node": {+ "optional": true+ },+ "@smithy/signature-v4": {+ "optional": true+ },+ "undici": {+ "optional": true+ },+ "ws": {+ "optional": true+ },+ "zod": {+ "optional": true+ }+ }+ },+ "node_modules/p-retry": {+ "version": "4.6.2",+ "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz",+ "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/retry": "0.12.0",+ "retry": "^0.13.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/partial-json": {+ "version": "0.1.7",+ "resolved": "https://registry.npmjs.org/partial-json/-/partial-json-0.1.7.tgz",+ "integrity": "sha512-Njv/59hHaokb/hRUjce3Hdv12wd60MtM9Z5Olmn+nehe0QDAsRtRbJPvJ0Z91TusF0SuZRIvnM+S4l6EIP8leA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/path-key": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/proper-lockfile": {+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz",+ "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "graceful-fs": "^4.2.4",+ "retry": "^0.12.0",+ "signal-exit": "^3.0.2"+ }+ },+ "node_modules/proper-lockfile/node_modules/retry": {+ "version": "0.12.0",+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",+ "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/protobufjs": {+ "version": "7.6.6",+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.6.tgz",+ "integrity": "sha512-dYDWdjSl5RNb7SgPxGQcRU+GtvP7s2fpkrY0r432PcOIaZ0/rBcxEZnQN67iJhFuQiVw754JDoPruPCNdGsbjg==",+ "dev": true,+ "hasInstallScript": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.2",+ "@protobufjs/base64": "^1.1.2",+ "@protobufjs/codegen": "^2.0.5",+ "@protobufjs/eventemitter": "^1.1.1",+ "@protobufjs/fetch": "^1.1.1",+ "@protobufjs/float": "^1.0.2",+ "@protobufjs/path": "^1.1.2",+ "@protobufjs/pool": "^1.1.0",+ "@protobufjs/utf8": "^1.1.1",+ "@types/node": ">=13.7.0",+ "long": "^5.3.2"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/proxy-agent-negotiate": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/proxy-agent-negotiate/-/proxy-agent-negotiate-1.1.0.tgz",+ "integrity": "sha512-N8IBcM3UgCVzz2L2Lqv8DVntDnnC8/hiV4nEDUPkqq72TPUgYWjQc+bdZlBPZK9LzPAvOY//gAt0S0DApoOXWQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 20"+ },+ "peerDependencies": {+ "kerberos": "^2.0.0"+ },+ "peerDependenciesMeta": {+ "kerberos": {+ "optional": true+ }+ }+ },+ "node_modules/quickjs-wasi": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/quickjs-wasi/-/quickjs-wasi-3.6.2.tgz",+ "integrity": "sha512-FCqGtGOrMgzUiIrMNMA2YnsOxCNwo31dzqXvclXUC6xeT35NJLKXQJsvbeCTjvoFAwZgEAPg8U6+KAPDGXn8Mg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/retry": {+ "version": "0.13.1",+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz",+ "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/safe-buffer": {+ "version": "5.2.1",+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/semver": {+ "version": "7.8.5",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/shebang-command": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "shebang-regex": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/shebang-regex": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/signal-exit": {+ "version": "3.0.7",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/smol-toml": {+ "version": "1.9.0",+ "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.0.tgz",+ "integrity": "sha512-hpd+HLON7HdZXqYchMM/+LaTTbdK0AU3NngIJ4KVyWbY9bfQqdL9cD+4yf6dUoU2Ap4VsU0JkQi6FxAI1B2mXQ==",+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">= 18"+ },+ "funding": {+ "url": "https://github.com/sponsors/cyyynthia"+ }+ },+ "node_modules/standardwebhooks": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/standardwebhooks/-/standardwebhooks-1.1.1.tgz",+ "integrity": "sha512-bCbX9ZEyFkWPsRz7Bl3NuQUJohmwGSev/yhr7vhaGPlc4AfIrspIRa6cPTBuI1ItmrTDJ4d/S2hCsfe4+vQGnQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@stablelib/base64": "^1.0.0",+ "fast-sha256": "^1.3.0"+ }+ },+ "node_modules/ts-algebra": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/ts-algebra/-/ts-algebra-2.0.0.tgz",+ "integrity": "sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/tslib": {+ "version": "2.8.1",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",+ "dev": true,+ "license": "0BSD"+ },+ "node_modules/typebox": {+ "version": "1.3.27",+ "resolved": "https://registry.npmjs.org/typebox/-/typebox-1.3.27.tgz",+ "integrity": "sha512-zu+jc1pcy4UiNThxikUr36f0Rybk9PEeCg/NE6adeWr/SKsdNO4EzZHYRDlv2YCVAfj3Odq3dESSo/jNyoBXzA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/typescript": {+ "version": "5.9.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/undici": {+ "version": "8.10.2",+ "resolved": "https://registry.npmjs.org/undici/-/undici-8.10.2.tgz",+ "integrity": "sha512-/y4/bH9YNU5hi9NIrpOuvGXFcxrj3CMrV+/AYpowAYTpHn8gX/XPFjNy766FPoYY0miQhdW977JFWKGNhBdwyQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=22.19.0"+ }+ },+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/web-streams-polyfill": {+ "version": "3.3.3",+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",+ "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/which": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "isexe": "^2.0.0"+ },+ "bin": {+ "node-which": "bin/node-which"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/ws": {+ "version": "8.22.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz",+ "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ },+ "peerDependencies": {+ "bufferutil": "^4.0.1",+ "utf-8-validate": ">=5.0.2"+ },+ "peerDependenciesMeta": {+ "bufferutil": {+ "optional": true+ },+ "utf-8-validate": {+ "optional": true+ }+ }+ },+ "node_modules/yaml": {+ "version": "2.9.0",+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",+ "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "yaml": "bin.mjs"+ },+ "engines": {+ "node": ">= 14.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/eemeli"+ }+ }+ }+}diff --git a/examples/pi/package.json b/examples/pi/package.jsonnew file mode 100644index 000000000..4fe7483ed--- /dev/null+++ b/examples/pi/package.json@@ -0,0 +1,28 @@+{+ "name": "switchyard-pi",+ "version": "0.3.0",+ "private": true,+ "type": "module",+ "license": "Apache-2.0",+ "engines": { "node": ">=22.19.0" },+ "pi": { "extensions": ["./switchyard-router.ts"] },+ "keywords": ["pi-package"],+ "scripts": {+ "typecheck": "tsc --noEmit",+ "test": "node --experimental-strip-types --test test/*.test.mjs"+ },+ "dependencies": {+ "@switchyard/runner": "file:../../bindings/typescript",+ "smol-toml": "1.9.0"+ },+ "peerDependencies": {+ "@earendil-works/pi-ai": "*",+ "@earendil-works/pi-coding-agent": "*"+ },+ "devDependencies": {+ "@earendil-works/pi-ai": "1.0.4",+ "@earendil-works/pi-coding-agent": "1.0.4",+ "@types/node": "22.19.19",+ "typescript": "5.9.3"+ }+}diff --git a/examples/pi/switchyard-router.ts b/examples/pi/switchyard-router.tsnew file mode 100644index 000000000..b9a0caeec--- /dev/null+++ b/examples/pi/switchyard-router.ts@@ -0,0 +1,75 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++import { readFileSync } from "node:fs";+import { parse, stringify } from "smol-toml";+import { Runner, type RoutingContent, type RoutingMessage } from "@switchyard/runner";+import type { Message } from "@earendil-works/pi-ai";+import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";++function modelIdentity(reference: unknown) {+ if (typeof reference !== "string") throw new Error("Expected a model in provider/model form");+ // Model IDs may themselves contain slashes, as on OpenRouter.+ const slash = reference.indexOf("/");+ if (slash <= 0 || slash === reference.length - 1) throw new Error("Expected a model in provider/model form");+ return { reference, provider: reference.slice(0, slash), id: reference.slice(slash + 1) };+}++function loadRunner(): Runner {+ const algorithm = parse(readFileSync(process.env.SWITCHYARD_CONFIG ?? new URL("./switchyard.toml", import.meta.url), "utf8"));+ const targets = Object.fromEntries([algorithm.efficient_target, algorithm.capable_target].map((value) => {+ const { reference } = modelIdentity(value);+ return [reference, { id: reference, llm_client: "pi" }];+ }));+ // Keep the provider in the routing identity so equal model IDs on different providers stay distinct.+ return Runner.fromToml(stringify({+ schema_version: 1,+ llm_clients: { pi: { format: "openai_chat", base_url: "http://127.0.0.1:1/v1" } },+ targets,+ routes: { auto: { ...algorithm, id: "switchyard/auto" } },+ }));+}++function routingMessages(messages: readonly Message[]): RoutingMessage[] {+ return messages.map((message) => {+ const blocks = typeof message.content === "string"+ ? [{ type: "text" as const, text: message.content }] : message.content;+ // Route on visible text and tool activity; Pi retains the original media and reasoning.+ const content = blocks.flatMap<RoutingContent>((block) => {+ if (block.type === "text") return [{ type: "text", text: block.text }];+ if (block.type === "toolCall") {+ return [{ type: "tool_call", id: block.id, name: block.name, arguments: block.arguments }];+ }+ return [];+ });+ if (message.role === "toolResult") {+ return { role: "tool", content: [{+ type: "tool_result", tool_call_id: message.toolCallId, content, is_error: message.isError,+ }] };+ }+ if (message.role === "system") {+ for (const text of Object.values(message.sections ?? {})) {+ if (text) content.push({ type: "text", text });+ }+ }+ return { role: message.role, content };+ });+}++export default function (pi: ExtensionAPI) {+ let runner: Runner | undefined;+ pi.registerVirtualModel({+ provider: "switchyard",+ id: "auto",+ name: "Auto (Switchyard)",+ thinkingLevels: ["medium"],+ async route(request, ctx) {+ runner ??= loadRunner();+ const decision = await runner.decide("switchyard/auto", routingMessages(request.messages), { signal: request.signal });+ const identity = modelIdentity(decision.model);+ const model = ctx.modelRegistry.find(identity.provider, identity.id);+ if (!model) throw new Error(`Model ${identity.reference} is not in the catalog`);+ return { model, thinkingLevel: "medium" };+ },+ });+}diff --git a/examples/pi/switchyard.toml b/examples/pi/switchyard.tomlnew file mode 100644index 000000000..7fbd91dc6--- /dev/null+++ b/examples/pi/switchyard.toml@@ -0,0 +1,6 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0++type = "auto"+efficient_target = "openai-codex/gpt-6-luna"+capable_target = "openai-codex/gpt-6.1-sol"diff --git a/examples/pi/test/loader.test.mjs b/examples/pi/test/loader.test.mjsnew file mode 100644index 000000000..af50d43dc--- /dev/null+++ b/examples/pi/test/loader.test.mjs@@ -0,0 +1,27 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++import assert from "node:assert/strict";+import { mkdtemp, rm } from "node:fs/promises";+import { tmpdir } from "node:os";+import { join } from "node:path";+import { fileURLToPath } from "node:url";+import { test } from "node:test";+import { DefaultResourceLoader, SettingsManager } from "@earendil-works/pi-coding-agent";++test("Pi loads the extension through its public resource loader", async (t) => {+ const dir = await mkdtemp(join(tmpdir(), "switchyard-pi-"));+ t.after(() => rm(dir, { recursive: true, force: true }));+ const extensionPath = fileURLToPath(new URL("../switchyard-router.ts", import.meta.url));+ const loader = new DefaultResourceLoader({+ cwd: dir,+ agentDir: join(dir, "agent"),+ settingsManager: SettingsManager.inMemory(),+ additionalExtensionPaths: [extensionPath],+ noSkills: true, noPromptTemplates: true, noThemes: true, noContextFiles: true,+ });+ await loader.reload();+ const { extensions, errors } = loader.getExtensions();+ assert.deepEqual(errors, []);+ assert.deepEqual(extensions.map((extension) => extension.path), [extensionPath]);+});diff --git a/examples/pi/test/router.test.mjs b/examples/pi/test/router.test.mjsnew file mode 100644index 000000000..77ca88a9a--- /dev/null+++ b/examples/pi/test/router.test.mjs@@ -0,0 +1,61 @@+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+// SPDX-License-Identifier: Apache-2.0++import assert from "node:assert/strict";+import { test } from "node:test";+import { Runner } from "@switchyard/runner";+import extension from "../switchyard-router.ts";++const context = { modelRegistry: { find: (provider, id) => ({ provider, id }) } };+const request = (fields = {}) => ({+ reason: "user", messages: [{ role: "user", content: "task" }],+ thinkingLevel: "high", signal: new AbortController().signal, ...fields,+});++function setup() {+ let definition;+ extension({ registerVirtualModel: (value) => { definition = value; } });+ return { definition, route: (req) => definition.route(req, context) };+}++function tool(id, name, args, text, isError = false) {+ return [+ { role: "assistant", content: [{ type: "toolCall", id, name, arguments: args }] },+ { role: "toolResult", toolCallId: id, toolName: name, content: [{ type: "text", text }], isError },+ ];+}++test("auto uses Luna, escalates to Sol on tool failure, and returns to Luna on recovery", async () => {+ const { route, definition } = setup();+ assert.deepEqual(definition.thinkingLevels, ["medium"]);+ const messages = request().messages;+ const initial = await route(request({ messages }));+ assert.equal(initial.model.id, "gpt-6-luna");+ assert.equal(initial.thinkingLevel, "medium");+ messages.push(...tool("failed", "bash", { command: "pytest" }, "out of memory", true));+ const escalated = await route(request({ reason: "continuation", messages }));+ assert.equal(escalated.model.id, "gpt-6.1-sol");+ for (let i = 0; i < 3; i++) messages.push(...tool(`write-${i}`, "write", { path: `file-${i}` }, "wrote file"));+ const recovered = await route(request({ reason: "retry", messages }));+ assert.equal(recovered.model.id, "gpt-6-luna");+});++test("passes text, tool arguments, results, and failure flags to Switchyard", async (t) => {+ const decide = t.mock.fn(async () => ({ target: "openrouter/vendor/model", model: "openrouter/vendor/model" }));+ t.mock.method(Runner, "fromToml", () => ({ decide }));+ const { route } = setup();+ const req = request({ messages: [+ { role: "system", content: "rules", sections: { extra: "more rules" } },+ { role: "user", content: [{ type: "text", text: "task" }, { type: "image", data: "image" }] },+ ...tool("call", "bash", { command: "pytest" }, "out of memory", true),+ { role: "assistant", content: [{ type: "thinking", thinking: "private" }] },+ ] });+ assert.deepEqual((await route(req)).model, { provider: "openrouter", id: "vendor/model" });+ assert.deepEqual(decide.mock.calls[0].arguments, ["switchyard/auto", [+ { role: "system", content: [{ type: "text", text: "rules" }, { type: "text", text: "more rules" }] },+ { role: "user", content: [{ type: "text", text: "task" }] },+ { role: "assistant", content: [{ type: "tool_call", id: "call", name: "bash", arguments: { command: "pytest" } }] },+ { role: "tool", content: [{ type: "tool_result", tool_call_id: "call", content: [{ type: "text", text: "out of memory" }], is_error: true }] },+ { role: "assistant", content: [] },+ ], { signal: req.signal }]);+});diff --git a/examples/pi/tsconfig.json b/examples/pi/tsconfig.jsonnew file mode 100644index 000000000..dfe4fb50d--- /dev/null+++ b/examples/pi/tsconfig.json@@ -0,0 +1,11 @@+{+ "compilerOptions": {+ "target": "ES2023",+ "module": "NodeNext",+ "moduleResolution": "NodeNext",+ "strict": true,+ "noEmit": true,+ "skipLibCheck": true+ },+ "include": ["switchyard-router.ts"]+}