@xberg-io/liter-llm-wasm 1.9.3 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  <div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0">
11
11
  <!-- Built with -->
12
12
  <a href="https://github.com/xberg-io/alef">
13
- <img src="https://img.shields.io/badge/Bindings-alef%20%D7%90-007ec6" alt="Bindings" />
13
+ <img src="https://img.shields.io/badge/built%20with-alef%20%D7%90-007ec6" alt="Built with alef" />
14
14
  </a>
15
15
  <!-- Language Bindings -->
16
16
  <a href="https://crates.io/crates/liter-llm">
@@ -79,7 +79,7 @@
79
79
  </a>
80
80
  </div>
81
81
 
82
- Universal LLM API client for browsers and WebAssembly runtimes. Access 143 LLM providers with portable deployment across browsers, Deno, and Cloudflare Workers.
82
+ Universal LLM API client for browsers and WebAssembly runtimes. Access 163 LLM providers with portable deployment across browsers, Deno, and Cloudflare Workers.
83
83
 
84
84
  ## What This Package Provides
85
85
 
@@ -175,7 +175,7 @@ console.log();
175
175
 
176
176
  ## Features
177
177
 
178
- ### Supported Providers (143)
178
+ ### Supported Providers (163)
179
179
 
180
180
  Route to any provider using the `provider/model` prefix convention:
181
181
 
@@ -195,7 +195,7 @@ Route to any provider using the `provider/model` prefix convention:
195
195
 
196
196
  ### Key Capabilities
197
197
 
198
- - **Provider Routing** -- Single client for 143 LLM providers via `provider/model` prefix
198
+ - **Provider Routing** -- Single client for 163 LLM providers via `provider/model` prefix
199
199
  - **Local LLMs** — Connect to locally-hosted models via Ollama, LM Studio, vLLM, llama.cpp, and other local inference servers
200
200
  - **Unified API** -- Consistent `chat`, `chat_stream`, `embeddings`, `list_models` interface
201
201
  - **Streaming** -- Real-time token streaming via `chat_stream`
@@ -216,7 +216,7 @@ Built on a compiled Rust core for speed and safety:
216
216
 
217
217
  ## Provider Routing
218
218
 
219
- Route to 143 providers using the `provider/model` prefix convention:
219
+ Route to 163 providers using the `provider/model` prefix convention:
220
220
 
221
221
  ```text
222
222
  openai/gpt-4o
@@ -251,7 +251,7 @@ To use the MCP server inside a coding agent, install the **liter-llm plugin** fr
251
251
 
252
252
  - **[Documentation](https://docs.liter-llm.xberg.io)** -- Full docs and API reference
253
253
  - **[GitHub Repository](https://github.com/xberg-io/liter-llm)** -- Source, issues, and discussions
254
- - **[Provider Registry](https://github.com/xberg-io/liter-llm/blob/main/schemas/providers.json)** -- 143 supported providers
254
+ - **[Provider Registry](https://github.com/xberg-io/liter-llm/blob/main/schemas/providers.json)** -- 163 supported providers
255
255
 
256
256
  ## Part of Xberg.io
257
257
 
@@ -259,7 +259,7 @@ To use the MCP server inside a coding agent, install the **liter-llm plugin** fr
259
259
  - [Xberg Enterprise](https://github.com/xberg-io/xberg-enterprise) — managed extraction API with SDKs, dashboards, and observability.
260
260
  - [crawlberg](https://github.com/xberg-io/crawlberg) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
261
261
  - [html-to-markdown](https://github.com/xberg-io/html-to-markdown) — fast, lossless HTML→Markdown engine.
262
- - [liter-llm](https://github.com/xberg-io/liter-llm) — universal LLM API client with native bindings for 14 languages and 143 providers.
262
+ - [liter-llm](https://github.com/xberg-io/liter-llm) — universal LLM API client with native bindings for 14 languages and 163 providers.
263
263
  - [tree-sitter-language-pack](https://github.com/xberg-io/tree-sitter-language-pack) — tree-sitter grammars and code-intelligence primitives.
264
264
  - [alef](https://github.com/xberg-io/alef) — the polyglot binding generator that produces every per-language binding across the 5 polyglot repos.
265
265
  - [Discord](https://discord.gg/xt9WY3GnKR) — community, roadmap, announcements.
@@ -256,6 +256,24 @@ export enum WasmBatchStatus {
256
256
  Cancelled = 7,
257
257
  }
258
258
 
259
+ /**
260
+ * Plain-data configuration for `refresh_catalog`.
261
+ *
262
+ * Deliberately FFI/binding-friendly: no `Duration` or `PathBuf`, just
263
+ * primitives that translate directly across language boundaries.
264
+ */
265
+ export class WasmCatalogRefreshConfig {
266
+ free(): void;
267
+ [Symbol.dispose](): void;
268
+ static default(): WasmCatalogRefreshConfig;
269
+ constructor(enabled?: boolean | null, sourceUrl?: string | null, ttlSeconds?: bigint | null, cachePath?: string | null);
270
+ get cachePath(): string | undefined;
271
+ set cachePath(value: string | null | undefined);
272
+ enabled: boolean;
273
+ sourceUrl: string;
274
+ ttlSeconds: bigint;
275
+ }
276
+
259
277
  /**
260
278
  * A streamed chunk of a chat completion response.
261
279
  */
@@ -541,7 +559,7 @@ export class WasmDecodedDataUrl {
541
559
  /**
542
560
  * Default client implementation backed by `reqwest`.
543
561
  *
544
- * Sends requests to 143 LLM providers with automatic provider detection
562
+ * Sends requests to 163 LLM providers with automatic provider detection
545
563
  * and per-request routing. The provider is resolved at construction time
546
564
  * from `model_hint` (or defaults to OpenAI), but individual requests can
547
565
  * override the provider via model name prefix (e.g. `"anthropic/claude-3-5-sonnet"`
@@ -926,6 +944,56 @@ export enum WasmModality {
926
944
  Image = 2,
927
945
  }
928
946
 
947
+ /**
948
+ * Public, FFI-friendly snapshot of a model's pricing and capability
949
+ * metadata, projected from `ModelPricing`.
950
+ *
951
+ * Unlike `ModelPricing` (which is excluded from binding generation),
952
+ * `ModelInfo` is an owned plain-data DTO safe to hand across the FFI
953
+ * boundary — see `model_info`.
954
+ */
955
+ export class WasmModelInfo {
956
+ free(): void;
957
+ [Symbol.dispose](): void;
958
+ static default(): WasmModelInfo;
959
+ constructor(inputCostPerToken?: number | null, outputCostPerToken?: number | null, tiers?: WasmModelTier[] | null, cacheReadInputTokenCost?: number | null, cacheCreationInputTokenCost?: number | null, inputCostPerAudioToken?: number | null, outputCostPerAudioToken?: number | null, outputCostPerReasoningToken?: number | null, maxTokens?: bigint | null, maxInputTokens?: bigint | null, maxOutputTokens?: bigint | null, mode?: string | null, supportsVision?: boolean | null, supportsFunctionCalling?: boolean | null, supportsReasoning?: boolean | null, supportsStructuredOutput?: boolean | null, supportsAudioInput?: boolean | null, supportsAudioOutput?: boolean | null, supportsPromptCaching?: boolean | null);
960
+ get cacheCreationInputTokenCost(): number | undefined;
961
+ set cacheCreationInputTokenCost(value: number | null | undefined);
962
+ get cacheReadInputTokenCost(): number | undefined;
963
+ set cacheReadInputTokenCost(value: number | null | undefined);
964
+ get inputCostPerAudioToken(): number | undefined;
965
+ set inputCostPerAudioToken(value: number | null | undefined);
966
+ inputCostPerToken: number;
967
+ get maxInputTokens(): bigint | undefined;
968
+ set maxInputTokens(value: bigint | null | undefined);
969
+ get maxOutputTokens(): bigint | undefined;
970
+ set maxOutputTokens(value: bigint | null | undefined);
971
+ get maxTokens(): bigint | undefined;
972
+ set maxTokens(value: bigint | null | undefined);
973
+ get mode(): string | undefined;
974
+ set mode(value: string | null | undefined);
975
+ get outputCostPerAudioToken(): number | undefined;
976
+ set outputCostPerAudioToken(value: number | null | undefined);
977
+ get outputCostPerReasoningToken(): number | undefined;
978
+ set outputCostPerReasoningToken(value: number | null | undefined);
979
+ outputCostPerToken: number;
980
+ get supportsAudioInput(): boolean | undefined;
981
+ set supportsAudioInput(value: boolean | null | undefined);
982
+ get supportsAudioOutput(): boolean | undefined;
983
+ set supportsAudioOutput(value: boolean | null | undefined);
984
+ get supportsFunctionCalling(): boolean | undefined;
985
+ set supportsFunctionCalling(value: boolean | null | undefined);
986
+ get supportsPromptCaching(): boolean | undefined;
987
+ set supportsPromptCaching(value: boolean | null | undefined);
988
+ get supportsReasoning(): boolean | undefined;
989
+ set supportsReasoning(value: boolean | null | undefined);
990
+ get supportsStructuredOutput(): boolean | undefined;
991
+ set supportsStructuredOutput(value: boolean | null | undefined);
992
+ get supportsVision(): boolean | undefined;
993
+ set supportsVision(value: boolean | null | undefined);
994
+ tiers: WasmModelTier[];
995
+ }
996
+
929
997
  /**
930
998
  * A model available from the API.
931
999
  */
@@ -940,6 +1008,30 @@ export class WasmModelObject {
940
1008
  ownedBy: string;
941
1009
  }
942
1010
 
1011
+ /**
1012
+ * Public, FFI-friendly snapshot of a single context-window pricing tier,
1013
+ * projected from `PricingTier`.
1014
+ */
1015
+ export class WasmModelTier {
1016
+ free(): void;
1017
+ [Symbol.dispose](): void;
1018
+ static default(): WasmModelTier;
1019
+ constructor(minContextTokens?: bigint | null, inputCostPerToken?: number | null, outputCostPerToken?: number | null, cacheReadInputTokenCost?: number | null, cacheCreationInputTokenCost?: number | null, inputCostPerAudioToken?: number | null, outputCostPerAudioToken?: number | null, outputCostPerReasoningToken?: number | null);
1020
+ get cacheCreationInputTokenCost(): number | undefined;
1021
+ set cacheCreationInputTokenCost(value: number | null | undefined);
1022
+ get cacheReadInputTokenCost(): number | undefined;
1023
+ set cacheReadInputTokenCost(value: number | null | undefined);
1024
+ get inputCostPerAudioToken(): number | undefined;
1025
+ set inputCostPerAudioToken(value: number | null | undefined);
1026
+ inputCostPerToken: number;
1027
+ minContextTokens: bigint;
1028
+ get outputCostPerAudioToken(): number | undefined;
1029
+ set outputCostPerAudioToken(value: number | null | undefined);
1030
+ get outputCostPerReasoningToken(): number | undefined;
1031
+ set outputCostPerReasoningToken(value: number | null | undefined);
1032
+ outputCostPerToken: number;
1033
+ }
1034
+
943
1035
  /**
944
1036
  * Response listing available models.
945
1037
  */
@@ -1209,6 +1301,15 @@ export enum WasmReasoningEffort {
1209
1301
  High = 2,
1210
1302
  }
1211
1303
 
1304
+ /**
1305
+ * Result of a `refresh_catalog` call.
1306
+ */
1307
+ export enum WasmRefreshOutcome {
1308
+ Disabled = 0,
1309
+ FromCache = 1,
1310
+ Fetched = 2,
1311
+ }
1312
+
1212
1313
  /**
1213
1314
  * A document to be reranked — either a plain string or an object with a text field.
1214
1315
  */
@@ -1696,7 +1797,7 @@ export function allProviders(): WasmProviderConfig[];
1696
1797
  /**
1697
1798
  * Return the capability flags for a named provider.
1698
1799
  *
1699
- * Performs an O(n) linear scan over the embedded registry (143 entries).
1800
+ * Performs an O(n) linear scan over the embedded registry (163 entries).
1700
1801
  * Returns an owned value so bindings can pass capability data without
1701
1802
  * borrowing registry internals.
1702
1803
  *
@@ -1727,6 +1828,16 @@ export function checkBound(context: string, current_len: number, incoming: numbe
1727
1828
  */
1728
1829
  export function clear(): void;
1729
1830
 
1831
+ /**
1832
+ * Clear the overlay registry, reverting `completion_cost`,
1833
+ * `completion_cost_with_cache`, and `model_info` to the
1834
+ * embedded catalog.
1835
+ *
1836
+ * Primarily a test seam (see `install_catalog_overlay_from_str`); also
1837
+ * usable by long-running processes that want to abandon a runtime refresh.
1838
+ */
1839
+ export function clearCatalogOverlay(): void;
1840
+
1730
1841
  /**
1731
1842
  * Calculate the estimated cost of a completion given a model name and token
1732
1843
  * counts.
@@ -1755,6 +1866,12 @@ export function completionCost(model: string, prompt_tokens: bigint, completion_
1755
1866
  *
1756
1867
  * Returns `None` if the model is not present in the embedded pricing
1757
1868
  * registry, mirroring `completion_cost`.
1869
+ *
1870
+ * When the model has `ModelPricing.tiers`, the tier whose
1871
+ * `min_context_tokens` is the highest value `<= prompt_tokens` supplies the
1872
+ * input/output/cache rates for the whole call; models without tiers (or
1873
+ * when `prompt_tokens` is below every tier threshold) use the base rates
1874
+ * unchanged, matching the original flat-rate behaviour.
1758
1875
  */
1759
1876
  export function completionCostWithCache(model: string, prompt_tokens: bigint, cached_tokens: bigint, completion_tokens: bigint): number | undefined;
1760
1877
 
@@ -1818,6 +1935,62 @@ export function decodeDataUrl(url: string): WasmDecodedDataUrl | undefined;
1818
1935
  */
1819
1936
  export function encodeDataUrl(bytes: Uint8Array, mime?: string | null): string;
1820
1937
 
1938
+ /**
1939
+ * Install the overlay registry from a raw catalog JSON string, bypassing
1940
+ * the network and disk cache entirely.
1941
+ *
1942
+ * Parses and flattens `catalog_json` with the same
1943
+ * `registry_from_catalog_str` logic used for the embedded catalog and the
1944
+ * network refresh path, then atomically swaps it in as the active overlay.
1945
+ * A parse failure returns `CatalogRefreshError.Parse` and leaves any
1946
+ * existing overlay untouched.
1947
+ *
1948
+ * This is primarily a testable seam: it lets tests exercise overlay
1949
+ * installation and the embedded/overlay fallback behavior in
1950
+ * `completion_cost` / `model_info` without a real network
1951
+ * call.
1952
+ */
1953
+ export function installCatalogOverlayFromStr(catalog_json: string): void;
1954
+
1955
+ /**
1956
+ * Look up FFI-friendly pricing and capability metadata for a model.
1957
+ *
1958
+ * Returns `None` if the model is not present in the active pricing
1959
+ * registry. Uses the same exact-match-then-prefix-fallback resolution as
1960
+ * `model_pricing`; unlike `model_pricing`, the result is an owned
1961
+ * `ModelInfo` value safe to hand across the FFI boundary.
1962
+ *
1963
+ * When a runtime catalog refresh has succeeded, this reflects the refreshed
1964
+ * (overlay) catalog; otherwise it reflects the embedded catalog. See
1965
+ * `model_pricing` for the embedded-only alternative.
1966
+ */
1967
+ export function modelInfo(model: string): WasmModelInfo | undefined;
1968
+
1969
+ /**
1970
+ * Refresh the runtime catalog overlay per `config`.
1971
+ *
1972
+ * - `config.enabled == false`: returns `Ok(``RefreshOutcome.Disabled``)`
1973
+ * immediately. No network, filesystem, or overlay activity.
1974
+ * - A fresh on-disk cache (age < `config.ttl_seconds`) exists at the
1975
+ * resolved cache path (`config.cache_path`, or a default under
1976
+ * `std.env.temp_dir()`): read + flatten it and install the overlay,
1977
+ * returning `Ok(``RefreshOutcome.FromCache``)`. No network request is
1978
+ * made.
1979
+ * - Otherwise: validate `config.source_url` uses `https`
1980
+ * (`CatalogRefreshError.InsecureUrl` otherwise), fetch it, flatten it,
1981
+ * install the overlay, best-effort write the raw JSON to the cache path
1982
+ * (a cache write failure does not fail the refresh), and return
1983
+ * `Ok(``RefreshOutcome.Fetched``)`.
1984
+ *
1985
+ * On any error return, the overlay is left untouched: the previously
1986
+ * active registry (a prior successful overlay, or the embedded catalog if
1987
+ * none was ever installed) remains in effect. This is what makes the
1988
+ * feature air-gap-safe — an unreachable or invalid `source_url` never
1989
+ * degrades `completion_cost` / `model_info` below embedded-catalog
1990
+ * availability.
1991
+ */
1992
+ export function refreshCatalog(config: any): Promise<WasmRefreshOutcome>;
1993
+
1821
1994
  /**
1822
1995
  * Register a custom provider in the global runtime registry.
1823
1996
  *
@@ -1856,6 +2029,7 @@ export interface InitOutput {
1856
2029
  readonly __wbg_wasmbatchlistresponse_free: (a: number, b: number) => void;
1857
2030
  readonly __wbg_wasmbatchobject_free: (a: number, b: number) => void;
1858
2031
  readonly __wbg_wasmbatchrequestcounts_free: (a: number, b: number) => void;
2032
+ readonly __wbg_wasmcatalogrefreshconfig_free: (a: number, b: number) => void;
1859
2033
  readonly __wbg_wasmchatcompletionchunk_free: (a: number, b: number) => void;
1860
2034
  readonly __wbg_wasmchatcompletionrequest_free: (a: number, b: number) => void;
1861
2035
  readonly __wbg_wasmchatcompletionresponse_free: (a: number, b: number) => void;
@@ -1889,8 +2063,10 @@ export interface InitOutput {
1889
2063
  readonly __wbg_wasmjsonschemaformat_free: (a: number, b: number) => void;
1890
2064
  readonly __wbg_wasmliterllmerror_free: (a: number, b: number) => void;
1891
2065
  readonly __wbg_wasmmessage_free: (a: number, b: number) => void;
2066
+ readonly __wbg_wasmmodelinfo_free: (a: number, b: number) => void;
1892
2067
  readonly __wbg_wasmmodelobject_free: (a: number, b: number) => void;
1893
2068
  readonly __wbg_wasmmodelslistresponse_free: (a: number, b: number) => void;
2069
+ readonly __wbg_wasmmodeltier_free: (a: number, b: number) => void;
1894
2070
  readonly __wbg_wasmmoderationcategories_free: (a: number, b: number) => void;
1895
2071
  readonly __wbg_wasmmoderationcategoryscores_free: (a: number, b: number) => void;
1896
2072
  readonly __wbg_wasmmoderationrequest_free: (a: number, b: number) => void;
@@ -1937,6 +2113,7 @@ export interface InitOutput {
1937
2113
  readonly chatstreamiterator_next: (a: number) => any;
1938
2114
  readonly checkBound: (a: number, b: number, c: number, d: number, e: number) => [number, number];
1939
2115
  readonly clear: () => void;
2116
+ readonly clearCatalogOverlay: () => void;
1940
2117
  readonly completionCost: (a: number, b: number, c: bigint, d: bigint) => [number, number];
1941
2118
  readonly completionCostWithCache: (a: number, b: number, c: bigint, d: bigint, e: bigint) => [number, number];
1942
2119
  readonly complexProviderNames: () => [number, number, number, number];
@@ -1944,6 +2121,9 @@ export interface InitOutput {
1944
2121
  readonly createClientFromJson: (a: number, b: number) => [number, number, number];
1945
2122
  readonly decodeDataUrl: (a: number, b: number) => number;
1946
2123
  readonly encodeDataUrl: (a: number, b: number, c: number, d: number) => [number, number];
2124
+ readonly installCatalogOverlayFromStr: (a: number, b: number) => [number, number];
2125
+ readonly modelInfo: (a: number, b: number) => number;
2126
+ readonly refreshCatalog: (a: any) => any;
1947
2127
  readonly registerCustomProvider: (a: number) => [number, number];
1948
2128
  readonly unregisterCustomProvider: (a: number, b: number) => [number, number, number];
1949
2129
  readonly wasmassistantmessage_content: (a: number) => [number, number];
@@ -2041,6 +2221,14 @@ export interface InitOutput {
2041
2221
  readonly wasmbatchrequestcounts_set_failed: (a: number, b: bigint) => void;
2042
2222
  readonly wasmbatchrequestcounts_set_total: (a: number, b: bigint) => void;
2043
2223
  readonly wasmbatchrequestcounts_total: (a: number) => bigint;
2224
+ readonly wasmcatalogrefreshconfig_cachePath: (a: number) => [number, number];
2225
+ readonly wasmcatalogrefreshconfig_default: () => number;
2226
+ readonly wasmcatalogrefreshconfig_enabled: (a: number) => number;
2227
+ readonly wasmcatalogrefreshconfig_new: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number) => number;
2228
+ readonly wasmcatalogrefreshconfig_set_cachePath: (a: number, b: number, c: number) => void;
2229
+ readonly wasmcatalogrefreshconfig_set_enabled: (a: number, b: number) => void;
2230
+ readonly wasmcatalogrefreshconfig_set_sourceUrl: (a: number, b: number, c: number) => void;
2231
+ readonly wasmcatalogrefreshconfig_sourceUrl: (a: number) => [number, number];
2044
2232
  readonly wasmchatcompletionchunk_choices: (a: number) => [number, number];
2045
2233
  readonly wasmchatcompletionchunk_created: (a: number) => bigint;
2046
2234
  readonly wasmchatcompletionchunk_default: () => number;
@@ -2375,6 +2563,36 @@ export interface InitOutput {
2375
2563
  readonly wasmmessage_role: (a: number) => [number, number];
2376
2564
  readonly wasmmessage_set_0: (a: number, b: number) => void;
2377
2565
  readonly wasmmessage_set_role: (a: number, b: number, c: number) => void;
2566
+ readonly wasmmodelinfo_default: () => number;
2567
+ readonly wasmmodelinfo_inputCostPerAudioToken: (a: number) => [number, number];
2568
+ readonly wasmmodelinfo_inputCostPerToken: (a: number) => number;
2569
+ readonly wasmmodelinfo_maxInputTokens: (a: number) => [number, bigint];
2570
+ readonly wasmmodelinfo_maxOutputTokens: (a: number) => [number, bigint];
2571
+ readonly wasmmodelinfo_mode: (a: number) => [number, number];
2572
+ readonly wasmmodelinfo_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: bigint, s: number, t: bigint, u: number, v: bigint, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number) => number;
2573
+ readonly wasmmodelinfo_outputCostPerToken: (a: number) => number;
2574
+ readonly wasmmodelinfo_set_inputCostPerAudioToken: (a: number, b: number, c: number) => void;
2575
+ readonly wasmmodelinfo_set_inputCostPerToken: (a: number, b: number) => void;
2576
+ readonly wasmmodelinfo_set_maxInputTokens: (a: number, b: number, c: bigint) => void;
2577
+ readonly wasmmodelinfo_set_maxOutputTokens: (a: number, b: number, c: bigint) => void;
2578
+ readonly wasmmodelinfo_set_mode: (a: number, b: number, c: number) => void;
2579
+ readonly wasmmodelinfo_set_outputCostPerToken: (a: number, b: number) => void;
2580
+ readonly wasmmodelinfo_set_supportsAudioInput: (a: number, b: number) => void;
2581
+ readonly wasmmodelinfo_set_supportsAudioOutput: (a: number, b: number) => void;
2582
+ readonly wasmmodelinfo_set_supportsFunctionCalling: (a: number, b: number) => void;
2583
+ readonly wasmmodelinfo_set_supportsPromptCaching: (a: number, b: number) => void;
2584
+ readonly wasmmodelinfo_set_supportsReasoning: (a: number, b: number) => void;
2585
+ readonly wasmmodelinfo_set_supportsStructuredOutput: (a: number, b: number) => void;
2586
+ readonly wasmmodelinfo_set_supportsVision: (a: number, b: number) => void;
2587
+ readonly wasmmodelinfo_set_tiers: (a: number, b: number, c: number) => void;
2588
+ readonly wasmmodelinfo_supportsAudioInput: (a: number) => number;
2589
+ readonly wasmmodelinfo_supportsAudioOutput: (a: number) => number;
2590
+ readonly wasmmodelinfo_supportsFunctionCalling: (a: number) => number;
2591
+ readonly wasmmodelinfo_supportsPromptCaching: (a: number) => number;
2592
+ readonly wasmmodelinfo_supportsReasoning: (a: number) => number;
2593
+ readonly wasmmodelinfo_supportsStructuredOutput: (a: number) => number;
2594
+ readonly wasmmodelinfo_supportsVision: (a: number) => number;
2595
+ readonly wasmmodelinfo_tiers: (a: number) => [number, number];
2378
2596
  readonly wasmmodelobject_default: () => number;
2379
2597
  readonly wasmmodelobject_id: (a: number) => [number, number];
2380
2598
  readonly wasmmodelobject_new: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number) => number;
@@ -2389,6 +2607,14 @@ export interface InitOutput {
2389
2607
  readonly wasmmodelslistresponse_object: (a: number) => [number, number];
2390
2608
  readonly wasmmodelslistresponse_set_data: (a: number, b: number, c: number) => void;
2391
2609
  readonly wasmmodelslistresponse_set_object: (a: number, b: number, c: number) => void;
2610
+ readonly wasmmodeltier_default: () => number;
2611
+ readonly wasmmodeltier_inputCostPerToken: (a: number) => number;
2612
+ readonly wasmmodeltier_minContextTokens: (a: number) => bigint;
2613
+ readonly wasmmodeltier_new: (a: number, b: bigint, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => number;
2614
+ readonly wasmmodeltier_outputCostPerToken: (a: number) => number;
2615
+ readonly wasmmodeltier_set_inputCostPerToken: (a: number, b: number) => void;
2616
+ readonly wasmmodeltier_set_minContextTokens: (a: number, b: bigint) => void;
2617
+ readonly wasmmodeltier_set_outputCostPerToken: (a: number, b: number) => void;
2392
2618
  readonly wasmmoderationcategories_default: () => number;
2393
2619
  readonly wasmmoderationcategories_harassment: (a: number) => number;
2394
2620
  readonly wasmmoderationcategories_harassmentThreatening: (a: number) => number;
@@ -2702,15 +2928,34 @@ export interface InitOutput {
2702
2928
  readonly wasmocrrequest_includeImageBase64: (a: number) => number;
2703
2929
  readonly wasmchatcompletionrequest_set_maxTokens: (a: number, b: number, c: bigint) => void;
2704
2930
  readonly wasmcreateresponserequest_set_maxOutputTokens: (a: number, b: number, c: bigint) => void;
2931
+ readonly wasmmodelinfo_set_cacheCreationInputTokenCost: (a: number, b: number, c: number) => void;
2932
+ readonly wasmmodelinfo_set_maxTokens: (a: number, b: number, c: bigint) => void;
2933
+ readonly wasmmodelinfo_set_outputCostPerAudioToken: (a: number, b: number, c: number) => void;
2934
+ readonly wasmmodelinfo_set_outputCostPerReasoningToken: (a: number, b: number, c: number) => void;
2935
+ readonly wasmmodeltier_set_cacheCreationInputTokenCost: (a: number, b: number, c: number) => void;
2936
+ readonly wasmmodeltier_set_inputCostPerAudioToken: (a: number, b: number, c: number) => void;
2937
+ readonly wasmmodeltier_set_outputCostPerAudioToken: (a: number, b: number, c: number) => void;
2938
+ readonly wasmmodeltier_set_outputCostPerReasoningToken: (a: number, b: number, c: number) => void;
2705
2939
  readonly wasmchatcompletionrequest_maxTokens: (a: number) => [number, bigint];
2706
2940
  readonly wasmcreateresponserequest_maxOutputTokens: (a: number) => [number, bigint];
2707
2941
  readonly wasmcreateresponserequest_temperature: (a: number) => [number, number];
2708
2942
  readonly wasmcreatespeechrequest_speed: (a: number) => [number, number];
2709
2943
  readonly wasmcreatetranscriptionrequest_temperature: (a: number) => [number, number];
2944
+ readonly wasmmodelinfo_cacheCreationInputTokenCost: (a: number) => [number, number];
2945
+ readonly wasmmodelinfo_cacheReadInputTokenCost: (a: number) => [number, number];
2946
+ readonly wasmmodelinfo_maxTokens: (a: number) => [number, bigint];
2947
+ readonly wasmmodelinfo_outputCostPerAudioToken: (a: number) => [number, number];
2948
+ readonly wasmmodelinfo_outputCostPerReasoningToken: (a: number) => [number, number];
2949
+ readonly wasmmodeltier_cacheCreationInputTokenCost: (a: number) => [number, number];
2950
+ readonly wasmmodeltier_cacheReadInputTokenCost: (a: number) => [number, number];
2951
+ readonly wasmmodeltier_inputCostPerAudioToken: (a: number) => [number, number];
2952
+ readonly wasmmodeltier_outputCostPerAudioToken: (a: number) => [number, number];
2953
+ readonly wasmmodeltier_outputCostPerReasoningToken: (a: number) => [number, number];
2710
2954
  readonly wasmtranscriptionresponse_duration: (a: number) => [number, number];
2711
2955
  readonly wasmwaitforbatchconfig_timeoutSecs: (a: number) => [number, number];
2712
2956
  readonly wasmresponseusage_default: () => number;
2713
2957
  readonly wasmprovidercapabilities_set_vision: (a: number, b: number) => void;
2958
+ readonly wasmcatalogrefreshconfig_set_ttlSeconds: (a: number, b: bigint) => void;
2714
2959
  readonly wasmchatcompletionresponse_set_created: (a: number, b: bigint) => void;
2715
2960
  readonly wasmfileobject_set_bytes: (a: number, b: bigint) => void;
2716
2961
  readonly wasmfileobject_set_createdAt: (a: number, b: bigint) => void;
@@ -2735,6 +2980,7 @@ export interface InitOutput {
2735
2980
  readonly wasmfilelistquery_set_limit: (a: number, b: number) => void;
2736
2981
  readonly wasmrerankrequest_set_topN: (a: number, b: number) => void;
2737
2982
  readonly wasmsearchrequest_set_maxResults: (a: number, b: number) => void;
2983
+ readonly wasmcatalogrefreshconfig_ttlSeconds: (a: number) => bigint;
2738
2984
  readonly wasmchatcompletionresponse_created: (a: number) => bigint;
2739
2985
  readonly wasmfileobject_bytes: (a: number) => bigint;
2740
2986
  readonly wasmfileobject_createdAt: (a: number) => bigint;
@@ -2781,7 +3027,6 @@ export interface InitOutput {
2781
3027
  readonly wasmusermessage_default: () => number;
2782
3028
  readonly wasmsystemmessage_set_content: (a: number, b: number) => void;
2783
3029
  readonly wasmusermessage_set_content: (a: number, b: number) => void;
2784
- readonly wasmresponsetool_default: () => number;
2785
3030
  readonly wasmocrrequest_set_includeImageBase64: (a: number, b: number) => void;
2786
3031
  readonly wasmassistantpart_new: () => number;
2787
3032
  readonly wasmcontentpart_new: () => number;
@@ -2804,8 +3049,11 @@ export interface InitOutput {
2804
3049
  readonly wasmcreateresponserequest_set_temperature: (a: number, b: number, c: number) => void;
2805
3050
  readonly wasmcreatespeechrequest_set_speed: (a: number, b: number, c: number) => void;
2806
3051
  readonly wasmcreatetranscriptionrequest_set_temperature: (a: number, b: number, c: number) => void;
3052
+ readonly wasmmodelinfo_set_cacheReadInputTokenCost: (a: number, b: number, c: number) => void;
3053
+ readonly wasmmodeltier_set_cacheReadInputTokenCost: (a: number, b: number, c: number) => void;
2807
3054
  readonly wasmtranscriptionresponse_set_duration: (a: number, b: number, c: number) => void;
2808
3055
  readonly wasmwaitforbatchconfig_set_timeoutSecs: (a: number, b: number, c: number) => void;
3056
+ readonly wasmresponsetool_default: () => number;
2809
3057
  readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
2810
3058
  readonly intounderlyingsource_cancel: (a: number) => void;
2811
3059
  readonly intounderlyingsource_pull: (a: number, b: any) => any;
package/liter_llm_wasm.js CHANGED
@@ -1335,6 +1335,124 @@ export const WasmBatchStatus = Object.freeze({
1335
1335
  Cancelled: 7, "7": "Cancelled",
1336
1336
  });
1337
1337
 
1338
+ /**
1339
+ * Plain-data configuration for `refresh_catalog`.
1340
+ *
1341
+ * Deliberately FFI/binding-friendly: no `Duration` or `PathBuf`, just
1342
+ * primitives that translate directly across language boundaries.
1343
+ */
1344
+ export class WasmCatalogRefreshConfig {
1345
+ static __wrap(ptr) {
1346
+ const obj = Object.create(WasmCatalogRefreshConfig.prototype);
1347
+ obj.__wbg_ptr = ptr;
1348
+ WasmCatalogRefreshConfigFinalization.register(obj, obj.__wbg_ptr, obj);
1349
+ return obj;
1350
+ }
1351
+ __destroy_into_raw() {
1352
+ const ptr = this.__wbg_ptr;
1353
+ this.__wbg_ptr = 0;
1354
+ WasmCatalogRefreshConfigFinalization.unregister(this);
1355
+ return ptr;
1356
+ }
1357
+ free() {
1358
+ const ptr = this.__destroy_into_raw();
1359
+ wasm.__wbg_wasmcatalogrefreshconfig_free(ptr, 0);
1360
+ }
1361
+ /**
1362
+ * @returns {string | undefined}
1363
+ */
1364
+ get cachePath() {
1365
+ const ret = wasm.wasmcatalogrefreshconfig_cachePath(this.__wbg_ptr);
1366
+ let v1;
1367
+ if (ret[0] !== 0) {
1368
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1369
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1370
+ }
1371
+ return v1;
1372
+ }
1373
+ /**
1374
+ * @returns {WasmCatalogRefreshConfig}
1375
+ */
1376
+ static default() {
1377
+ const ret = wasm.wasmcatalogrefreshconfig_default();
1378
+ return WasmCatalogRefreshConfig.__wrap(ret);
1379
+ }
1380
+ /**
1381
+ * @returns {boolean}
1382
+ */
1383
+ get enabled() {
1384
+ const ret = wasm.wasmcatalogrefreshconfig_enabled(this.__wbg_ptr);
1385
+ return ret !== 0;
1386
+ }
1387
+ /**
1388
+ * @param {boolean | null} [enabled]
1389
+ * @param {string | null} [sourceUrl]
1390
+ * @param {bigint | null} [ttlSeconds]
1391
+ * @param {string | null} [cachePath]
1392
+ */
1393
+ constructor(enabled, sourceUrl, ttlSeconds, cachePath) {
1394
+ var ptr0 = isLikeNone(sourceUrl) ? 0 : passStringToWasm0(sourceUrl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1395
+ var len0 = WASM_VECTOR_LEN;
1396
+ var ptr1 = isLikeNone(cachePath) ? 0 : passStringToWasm0(cachePath, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1397
+ var len1 = WASM_VECTOR_LEN;
1398
+ const ret = wasm.wasmcatalogrefreshconfig_new(isLikeNone(enabled) ? 0xFFFFFF : enabled ? 1 : 0, ptr0, len0, !isLikeNone(ttlSeconds), isLikeNone(ttlSeconds) ? BigInt(0) : ttlSeconds, ptr1, len1);
1399
+ this.__wbg_ptr = ret;
1400
+ WasmCatalogRefreshConfigFinalization.register(this, this.__wbg_ptr, this);
1401
+ return this;
1402
+ }
1403
+ /**
1404
+ * @param {string | null} [value]
1405
+ */
1406
+ set cachePath(value) {
1407
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1408
+ var len0 = WASM_VECTOR_LEN;
1409
+ wasm.wasmcatalogrefreshconfig_set_cachePath(this.__wbg_ptr, ptr0, len0);
1410
+ }
1411
+ /**
1412
+ * @param {boolean} value
1413
+ */
1414
+ set enabled(value) {
1415
+ wasm.wasmcatalogrefreshconfig_set_enabled(this.__wbg_ptr, value);
1416
+ }
1417
+ /**
1418
+ * @param {string} value
1419
+ */
1420
+ set sourceUrl(value) {
1421
+ const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1422
+ const len0 = WASM_VECTOR_LEN;
1423
+ wasm.wasmcatalogrefreshconfig_set_sourceUrl(this.__wbg_ptr, ptr0, len0);
1424
+ }
1425
+ /**
1426
+ * @param {bigint} value
1427
+ */
1428
+ set ttlSeconds(value) {
1429
+ wasm.wasmcatalogrefreshconfig_set_ttlSeconds(this.__wbg_ptr, value);
1430
+ }
1431
+ /**
1432
+ * @returns {string}
1433
+ */
1434
+ get sourceUrl() {
1435
+ let deferred1_0;
1436
+ let deferred1_1;
1437
+ try {
1438
+ const ret = wasm.wasmcatalogrefreshconfig_sourceUrl(this.__wbg_ptr);
1439
+ deferred1_0 = ret[0];
1440
+ deferred1_1 = ret[1];
1441
+ return getStringFromWasm0(ret[0], ret[1]);
1442
+ } finally {
1443
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1444
+ }
1445
+ }
1446
+ /**
1447
+ * @returns {bigint}
1448
+ */
1449
+ get ttlSeconds() {
1450
+ const ret = wasm.wasmcatalogrefreshconfig_ttlSeconds(this.__wbg_ptr);
1451
+ return BigInt.asUintN(64, ret);
1452
+ }
1453
+ }
1454
+ if (Symbol.dispose) WasmCatalogRefreshConfig.prototype[Symbol.dispose] = WasmCatalogRefreshConfig.prototype.free;
1455
+
1338
1456
  /**
1339
1457
  * A streamed chunk of a chat completion response.
1340
1458
  */
@@ -3645,7 +3763,7 @@ if (Symbol.dispose) WasmDecodedDataUrl.prototype[Symbol.dispose] = WasmDecodedDa
3645
3763
  /**
3646
3764
  * Default client implementation backed by `reqwest`.
3647
3765
  *
3648
- * Sends requests to 143 LLM providers with automatic provider detection
3766
+ * Sends requests to 163 LLM providers with automatic provider detection
3649
3767
  * and per-request routing. The provider is resolved at construction time
3650
3768
  * from `model_hint` (or defaults to OpenAI), but individual requests can
3651
3769
  * override the provider via model name prefix (e.g. `"anthropic/claude-3-5-sonnet"`
@@ -5869,6 +5987,330 @@ export const WasmModality = Object.freeze({
5869
5987
  Image: 2, "2": "Image",
5870
5988
  });
5871
5989
 
5990
+ /**
5991
+ * Public, FFI-friendly snapshot of a model's pricing and capability
5992
+ * metadata, projected from `ModelPricing`.
5993
+ *
5994
+ * Unlike `ModelPricing` (which is excluded from binding generation),
5995
+ * `ModelInfo` is an owned plain-data DTO safe to hand across the FFI
5996
+ * boundary — see `model_info`.
5997
+ */
5998
+ export class WasmModelInfo {
5999
+ static __wrap(ptr) {
6000
+ const obj = Object.create(WasmModelInfo.prototype);
6001
+ obj.__wbg_ptr = ptr;
6002
+ WasmModelInfoFinalization.register(obj, obj.__wbg_ptr, obj);
6003
+ return obj;
6004
+ }
6005
+ __destroy_into_raw() {
6006
+ const ptr = this.__wbg_ptr;
6007
+ this.__wbg_ptr = 0;
6008
+ WasmModelInfoFinalization.unregister(this);
6009
+ return ptr;
6010
+ }
6011
+ free() {
6012
+ const ptr = this.__destroy_into_raw();
6013
+ wasm.__wbg_wasmmodelinfo_free(ptr, 0);
6014
+ }
6015
+ /**
6016
+ * @returns {number | undefined}
6017
+ */
6018
+ get cacheCreationInputTokenCost() {
6019
+ const ret = wasm.wasmmodelinfo_cacheCreationInputTokenCost(this.__wbg_ptr);
6020
+ return ret[0] === 0 ? undefined : ret[1];
6021
+ }
6022
+ /**
6023
+ * @returns {number | undefined}
6024
+ */
6025
+ get cacheReadInputTokenCost() {
6026
+ const ret = wasm.wasmmodelinfo_cacheReadInputTokenCost(this.__wbg_ptr);
6027
+ return ret[0] === 0 ? undefined : ret[1];
6028
+ }
6029
+ /**
6030
+ * @returns {WasmModelInfo}
6031
+ */
6032
+ static default() {
6033
+ const ret = wasm.wasmmodelinfo_default();
6034
+ return WasmModelInfo.__wrap(ret);
6035
+ }
6036
+ /**
6037
+ * @returns {number | undefined}
6038
+ */
6039
+ get inputCostPerAudioToken() {
6040
+ const ret = wasm.wasmmodelinfo_inputCostPerAudioToken(this.__wbg_ptr);
6041
+ return ret[0] === 0 ? undefined : ret[1];
6042
+ }
6043
+ /**
6044
+ * @returns {number}
6045
+ */
6046
+ get inputCostPerToken() {
6047
+ const ret = wasm.wasmmodelinfo_inputCostPerToken(this.__wbg_ptr);
6048
+ return ret;
6049
+ }
6050
+ /**
6051
+ * @returns {bigint | undefined}
6052
+ */
6053
+ get maxInputTokens() {
6054
+ const ret = wasm.wasmmodelinfo_maxInputTokens(this.__wbg_ptr);
6055
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
6056
+ }
6057
+ /**
6058
+ * @returns {bigint | undefined}
6059
+ */
6060
+ get maxOutputTokens() {
6061
+ const ret = wasm.wasmmodelinfo_maxOutputTokens(this.__wbg_ptr);
6062
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
6063
+ }
6064
+ /**
6065
+ * @returns {bigint | undefined}
6066
+ */
6067
+ get maxTokens() {
6068
+ const ret = wasm.wasmmodelinfo_maxTokens(this.__wbg_ptr);
6069
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
6070
+ }
6071
+ /**
6072
+ * @returns {string | undefined}
6073
+ */
6074
+ get mode() {
6075
+ const ret = wasm.wasmmodelinfo_mode(this.__wbg_ptr);
6076
+ let v1;
6077
+ if (ret[0] !== 0) {
6078
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
6079
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
6080
+ }
6081
+ return v1;
6082
+ }
6083
+ /**
6084
+ * @param {number | null} [inputCostPerToken]
6085
+ * @param {number | null} [outputCostPerToken]
6086
+ * @param {WasmModelTier[] | null} [tiers]
6087
+ * @param {number | null} [cacheReadInputTokenCost]
6088
+ * @param {number | null} [cacheCreationInputTokenCost]
6089
+ * @param {number | null} [inputCostPerAudioToken]
6090
+ * @param {number | null} [outputCostPerAudioToken]
6091
+ * @param {number | null} [outputCostPerReasoningToken]
6092
+ * @param {bigint | null} [maxTokens]
6093
+ * @param {bigint | null} [maxInputTokens]
6094
+ * @param {bigint | null} [maxOutputTokens]
6095
+ * @param {string | null} [mode]
6096
+ * @param {boolean | null} [supportsVision]
6097
+ * @param {boolean | null} [supportsFunctionCalling]
6098
+ * @param {boolean | null} [supportsReasoning]
6099
+ * @param {boolean | null} [supportsStructuredOutput]
6100
+ * @param {boolean | null} [supportsAudioInput]
6101
+ * @param {boolean | null} [supportsAudioOutput]
6102
+ * @param {boolean | null} [supportsPromptCaching]
6103
+ */
6104
+ constructor(inputCostPerToken, outputCostPerToken, tiers, cacheReadInputTokenCost, cacheCreationInputTokenCost, inputCostPerAudioToken, outputCostPerAudioToken, outputCostPerReasoningToken, maxTokens, maxInputTokens, maxOutputTokens, mode, supportsVision, supportsFunctionCalling, supportsReasoning, supportsStructuredOutput, supportsAudioInput, supportsAudioOutput, supportsPromptCaching) {
6105
+ var ptr0 = isLikeNone(tiers) ? 0 : passArrayJsValueToWasm0(tiers, wasm.__wbindgen_malloc);
6106
+ var len0 = WASM_VECTOR_LEN;
6107
+ var ptr1 = isLikeNone(mode) ? 0 : passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6108
+ var len1 = WASM_VECTOR_LEN;
6109
+ const ret = wasm.wasmmodelinfo_new(!isLikeNone(inputCostPerToken), isLikeNone(inputCostPerToken) ? 0 : inputCostPerToken, !isLikeNone(outputCostPerToken), isLikeNone(outputCostPerToken) ? 0 : outputCostPerToken, ptr0, len0, !isLikeNone(cacheReadInputTokenCost), isLikeNone(cacheReadInputTokenCost) ? 0 : cacheReadInputTokenCost, !isLikeNone(cacheCreationInputTokenCost), isLikeNone(cacheCreationInputTokenCost) ? 0 : cacheCreationInputTokenCost, !isLikeNone(inputCostPerAudioToken), isLikeNone(inputCostPerAudioToken) ? 0 : inputCostPerAudioToken, !isLikeNone(outputCostPerAudioToken), isLikeNone(outputCostPerAudioToken) ? 0 : outputCostPerAudioToken, !isLikeNone(outputCostPerReasoningToken), isLikeNone(outputCostPerReasoningToken) ? 0 : outputCostPerReasoningToken, !isLikeNone(maxTokens), isLikeNone(maxTokens) ? BigInt(0) : maxTokens, !isLikeNone(maxInputTokens), isLikeNone(maxInputTokens) ? BigInt(0) : maxInputTokens, !isLikeNone(maxOutputTokens), isLikeNone(maxOutputTokens) ? BigInt(0) : maxOutputTokens, ptr1, len1, isLikeNone(supportsVision) ? 0xFFFFFF : supportsVision ? 1 : 0, isLikeNone(supportsFunctionCalling) ? 0xFFFFFF : supportsFunctionCalling ? 1 : 0, isLikeNone(supportsReasoning) ? 0xFFFFFF : supportsReasoning ? 1 : 0, isLikeNone(supportsStructuredOutput) ? 0xFFFFFF : supportsStructuredOutput ? 1 : 0, isLikeNone(supportsAudioInput) ? 0xFFFFFF : supportsAudioInput ? 1 : 0, isLikeNone(supportsAudioOutput) ? 0xFFFFFF : supportsAudioOutput ? 1 : 0, isLikeNone(supportsPromptCaching) ? 0xFFFFFF : supportsPromptCaching ? 1 : 0);
6110
+ this.__wbg_ptr = ret;
6111
+ WasmModelInfoFinalization.register(this, this.__wbg_ptr, this);
6112
+ return this;
6113
+ }
6114
+ /**
6115
+ * @returns {number | undefined}
6116
+ */
6117
+ get outputCostPerAudioToken() {
6118
+ const ret = wasm.wasmmodelinfo_outputCostPerAudioToken(this.__wbg_ptr);
6119
+ return ret[0] === 0 ? undefined : ret[1];
6120
+ }
6121
+ /**
6122
+ * @returns {number | undefined}
6123
+ */
6124
+ get outputCostPerReasoningToken() {
6125
+ const ret = wasm.wasmmodelinfo_outputCostPerReasoningToken(this.__wbg_ptr);
6126
+ return ret[0] === 0 ? undefined : ret[1];
6127
+ }
6128
+ /**
6129
+ * @returns {number}
6130
+ */
6131
+ get outputCostPerToken() {
6132
+ const ret = wasm.wasmmodelinfo_outputCostPerToken(this.__wbg_ptr);
6133
+ return ret;
6134
+ }
6135
+ /**
6136
+ * @param {number | null} [value]
6137
+ */
6138
+ set cacheCreationInputTokenCost(value) {
6139
+ wasm.wasmmodelinfo_set_cacheCreationInputTokenCost(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6140
+ }
6141
+ /**
6142
+ * @param {number | null} [value]
6143
+ */
6144
+ set cacheReadInputTokenCost(value) {
6145
+ wasm.wasmmodelinfo_set_cacheReadInputTokenCost(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6146
+ }
6147
+ /**
6148
+ * @param {number | null} [value]
6149
+ */
6150
+ set inputCostPerAudioToken(value) {
6151
+ wasm.wasmmodelinfo_set_inputCostPerAudioToken(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6152
+ }
6153
+ /**
6154
+ * @param {number} value
6155
+ */
6156
+ set inputCostPerToken(value) {
6157
+ wasm.wasmmodelinfo_set_inputCostPerToken(this.__wbg_ptr, value);
6158
+ }
6159
+ /**
6160
+ * @param {bigint | null} [value]
6161
+ */
6162
+ set maxInputTokens(value) {
6163
+ wasm.wasmmodelinfo_set_maxInputTokens(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? BigInt(0) : value);
6164
+ }
6165
+ /**
6166
+ * @param {bigint | null} [value]
6167
+ */
6168
+ set maxOutputTokens(value) {
6169
+ wasm.wasmmodelinfo_set_maxOutputTokens(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? BigInt(0) : value);
6170
+ }
6171
+ /**
6172
+ * @param {bigint | null} [value]
6173
+ */
6174
+ set maxTokens(value) {
6175
+ wasm.wasmmodelinfo_set_maxTokens(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? BigInt(0) : value);
6176
+ }
6177
+ /**
6178
+ * @param {string | null} [value]
6179
+ */
6180
+ set mode(value) {
6181
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6182
+ var len0 = WASM_VECTOR_LEN;
6183
+ wasm.wasmmodelinfo_set_mode(this.__wbg_ptr, ptr0, len0);
6184
+ }
6185
+ /**
6186
+ * @param {number | null} [value]
6187
+ */
6188
+ set outputCostPerAudioToken(value) {
6189
+ wasm.wasmmodelinfo_set_outputCostPerAudioToken(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6190
+ }
6191
+ /**
6192
+ * @param {number | null} [value]
6193
+ */
6194
+ set outputCostPerReasoningToken(value) {
6195
+ wasm.wasmmodelinfo_set_outputCostPerReasoningToken(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6196
+ }
6197
+ /**
6198
+ * @param {number} value
6199
+ */
6200
+ set outputCostPerToken(value) {
6201
+ wasm.wasmmodelinfo_set_outputCostPerToken(this.__wbg_ptr, value);
6202
+ }
6203
+ /**
6204
+ * @param {boolean | null} [value]
6205
+ */
6206
+ set supportsAudioInput(value) {
6207
+ wasm.wasmmodelinfo_set_supportsAudioInput(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
6208
+ }
6209
+ /**
6210
+ * @param {boolean | null} [value]
6211
+ */
6212
+ set supportsAudioOutput(value) {
6213
+ wasm.wasmmodelinfo_set_supportsAudioOutput(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
6214
+ }
6215
+ /**
6216
+ * @param {boolean | null} [value]
6217
+ */
6218
+ set supportsFunctionCalling(value) {
6219
+ wasm.wasmmodelinfo_set_supportsFunctionCalling(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
6220
+ }
6221
+ /**
6222
+ * @param {boolean | null} [value]
6223
+ */
6224
+ set supportsPromptCaching(value) {
6225
+ wasm.wasmmodelinfo_set_supportsPromptCaching(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
6226
+ }
6227
+ /**
6228
+ * @param {boolean | null} [value]
6229
+ */
6230
+ set supportsReasoning(value) {
6231
+ wasm.wasmmodelinfo_set_supportsReasoning(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
6232
+ }
6233
+ /**
6234
+ * @param {boolean | null} [value]
6235
+ */
6236
+ set supportsStructuredOutput(value) {
6237
+ wasm.wasmmodelinfo_set_supportsStructuredOutput(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
6238
+ }
6239
+ /**
6240
+ * @param {boolean | null} [value]
6241
+ */
6242
+ set supportsVision(value) {
6243
+ wasm.wasmmodelinfo_set_supportsVision(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
6244
+ }
6245
+ /**
6246
+ * @param {WasmModelTier[]} value
6247
+ */
6248
+ set tiers(value) {
6249
+ const ptr0 = passArrayJsValueToWasm0(value, wasm.__wbindgen_malloc);
6250
+ const len0 = WASM_VECTOR_LEN;
6251
+ wasm.wasmmodelinfo_set_tiers(this.__wbg_ptr, ptr0, len0);
6252
+ }
6253
+ /**
6254
+ * @returns {boolean | undefined}
6255
+ */
6256
+ get supportsAudioInput() {
6257
+ const ret = wasm.wasmmodelinfo_supportsAudioInput(this.__wbg_ptr);
6258
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
6259
+ }
6260
+ /**
6261
+ * @returns {boolean | undefined}
6262
+ */
6263
+ get supportsAudioOutput() {
6264
+ const ret = wasm.wasmmodelinfo_supportsAudioOutput(this.__wbg_ptr);
6265
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
6266
+ }
6267
+ /**
6268
+ * @returns {boolean | undefined}
6269
+ */
6270
+ get supportsFunctionCalling() {
6271
+ const ret = wasm.wasmmodelinfo_supportsFunctionCalling(this.__wbg_ptr);
6272
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
6273
+ }
6274
+ /**
6275
+ * @returns {boolean | undefined}
6276
+ */
6277
+ get supportsPromptCaching() {
6278
+ const ret = wasm.wasmmodelinfo_supportsPromptCaching(this.__wbg_ptr);
6279
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
6280
+ }
6281
+ /**
6282
+ * @returns {boolean | undefined}
6283
+ */
6284
+ get supportsReasoning() {
6285
+ const ret = wasm.wasmmodelinfo_supportsReasoning(this.__wbg_ptr);
6286
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
6287
+ }
6288
+ /**
6289
+ * @returns {boolean | undefined}
6290
+ */
6291
+ get supportsStructuredOutput() {
6292
+ const ret = wasm.wasmmodelinfo_supportsStructuredOutput(this.__wbg_ptr);
6293
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
6294
+ }
6295
+ /**
6296
+ * @returns {boolean | undefined}
6297
+ */
6298
+ get supportsVision() {
6299
+ const ret = wasm.wasmmodelinfo_supportsVision(this.__wbg_ptr);
6300
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
6301
+ }
6302
+ /**
6303
+ * @returns {WasmModelTier[]}
6304
+ */
6305
+ get tiers() {
6306
+ const ret = wasm.wasmmodelinfo_tiers(this.__wbg_ptr);
6307
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6308
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6309
+ return v1;
6310
+ }
6311
+ }
6312
+ if (Symbol.dispose) WasmModelInfo.prototype[Symbol.dispose] = WasmModelInfo.prototype.free;
6313
+
5872
6314
  /**
5873
6315
  * A model available from the API.
5874
6316
  */
@@ -6005,6 +6447,163 @@ export class WasmModelObject {
6005
6447
  }
6006
6448
  if (Symbol.dispose) WasmModelObject.prototype[Symbol.dispose] = WasmModelObject.prototype.free;
6007
6449
 
6450
+ /**
6451
+ * Public, FFI-friendly snapshot of a single context-window pricing tier,
6452
+ * projected from `PricingTier`.
6453
+ */
6454
+ export class WasmModelTier {
6455
+ static __wrap(ptr) {
6456
+ const obj = Object.create(WasmModelTier.prototype);
6457
+ obj.__wbg_ptr = ptr;
6458
+ WasmModelTierFinalization.register(obj, obj.__wbg_ptr, obj);
6459
+ return obj;
6460
+ }
6461
+ static __unwrap(jsValue) {
6462
+ if (!(jsValue instanceof WasmModelTier)) {
6463
+ return 0;
6464
+ }
6465
+ return jsValue.__destroy_into_raw();
6466
+ }
6467
+ __destroy_into_raw() {
6468
+ const ptr = this.__wbg_ptr;
6469
+ this.__wbg_ptr = 0;
6470
+ WasmModelTierFinalization.unregister(this);
6471
+ return ptr;
6472
+ }
6473
+ free() {
6474
+ const ptr = this.__destroy_into_raw();
6475
+ wasm.__wbg_wasmmodeltier_free(ptr, 0);
6476
+ }
6477
+ /**
6478
+ * @returns {number | undefined}
6479
+ */
6480
+ get cacheCreationInputTokenCost() {
6481
+ const ret = wasm.wasmmodeltier_cacheCreationInputTokenCost(this.__wbg_ptr);
6482
+ return ret[0] === 0 ? undefined : ret[1];
6483
+ }
6484
+ /**
6485
+ * @returns {number | undefined}
6486
+ */
6487
+ get cacheReadInputTokenCost() {
6488
+ const ret = wasm.wasmmodeltier_cacheReadInputTokenCost(this.__wbg_ptr);
6489
+ return ret[0] === 0 ? undefined : ret[1];
6490
+ }
6491
+ /**
6492
+ * @returns {WasmModelTier}
6493
+ */
6494
+ static default() {
6495
+ const ret = wasm.wasmmodeltier_default();
6496
+ return WasmModelTier.__wrap(ret);
6497
+ }
6498
+ /**
6499
+ * @returns {number | undefined}
6500
+ */
6501
+ get inputCostPerAudioToken() {
6502
+ const ret = wasm.wasmmodeltier_inputCostPerAudioToken(this.__wbg_ptr);
6503
+ return ret[0] === 0 ? undefined : ret[1];
6504
+ }
6505
+ /**
6506
+ * @returns {number}
6507
+ */
6508
+ get inputCostPerToken() {
6509
+ const ret = wasm.wasmmodeltier_inputCostPerToken(this.__wbg_ptr);
6510
+ return ret;
6511
+ }
6512
+ /**
6513
+ * @returns {bigint}
6514
+ */
6515
+ get minContextTokens() {
6516
+ const ret = wasm.wasmmodeltier_minContextTokens(this.__wbg_ptr);
6517
+ return BigInt.asUintN(64, ret);
6518
+ }
6519
+ /**
6520
+ * @param {bigint | null} [minContextTokens]
6521
+ * @param {number | null} [inputCostPerToken]
6522
+ * @param {number | null} [outputCostPerToken]
6523
+ * @param {number | null} [cacheReadInputTokenCost]
6524
+ * @param {number | null} [cacheCreationInputTokenCost]
6525
+ * @param {number | null} [inputCostPerAudioToken]
6526
+ * @param {number | null} [outputCostPerAudioToken]
6527
+ * @param {number | null} [outputCostPerReasoningToken]
6528
+ */
6529
+ constructor(minContextTokens, inputCostPerToken, outputCostPerToken, cacheReadInputTokenCost, cacheCreationInputTokenCost, inputCostPerAudioToken, outputCostPerAudioToken, outputCostPerReasoningToken) {
6530
+ const ret = wasm.wasmmodeltier_new(!isLikeNone(minContextTokens), isLikeNone(minContextTokens) ? BigInt(0) : minContextTokens, !isLikeNone(inputCostPerToken), isLikeNone(inputCostPerToken) ? 0 : inputCostPerToken, !isLikeNone(outputCostPerToken), isLikeNone(outputCostPerToken) ? 0 : outputCostPerToken, !isLikeNone(cacheReadInputTokenCost), isLikeNone(cacheReadInputTokenCost) ? 0 : cacheReadInputTokenCost, !isLikeNone(cacheCreationInputTokenCost), isLikeNone(cacheCreationInputTokenCost) ? 0 : cacheCreationInputTokenCost, !isLikeNone(inputCostPerAudioToken), isLikeNone(inputCostPerAudioToken) ? 0 : inputCostPerAudioToken, !isLikeNone(outputCostPerAudioToken), isLikeNone(outputCostPerAudioToken) ? 0 : outputCostPerAudioToken, !isLikeNone(outputCostPerReasoningToken), isLikeNone(outputCostPerReasoningToken) ? 0 : outputCostPerReasoningToken);
6531
+ this.__wbg_ptr = ret;
6532
+ WasmModelTierFinalization.register(this, this.__wbg_ptr, this);
6533
+ return this;
6534
+ }
6535
+ /**
6536
+ * @returns {number | undefined}
6537
+ */
6538
+ get outputCostPerAudioToken() {
6539
+ const ret = wasm.wasmmodeltier_outputCostPerAudioToken(this.__wbg_ptr);
6540
+ return ret[0] === 0 ? undefined : ret[1];
6541
+ }
6542
+ /**
6543
+ * @returns {number | undefined}
6544
+ */
6545
+ get outputCostPerReasoningToken() {
6546
+ const ret = wasm.wasmmodeltier_outputCostPerReasoningToken(this.__wbg_ptr);
6547
+ return ret[0] === 0 ? undefined : ret[1];
6548
+ }
6549
+ /**
6550
+ * @returns {number}
6551
+ */
6552
+ get outputCostPerToken() {
6553
+ const ret = wasm.wasmmodeltier_outputCostPerToken(this.__wbg_ptr);
6554
+ return ret;
6555
+ }
6556
+ /**
6557
+ * @param {number | null} [value]
6558
+ */
6559
+ set cacheCreationInputTokenCost(value) {
6560
+ wasm.wasmmodeltier_set_cacheCreationInputTokenCost(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6561
+ }
6562
+ /**
6563
+ * @param {number | null} [value]
6564
+ */
6565
+ set cacheReadInputTokenCost(value) {
6566
+ wasm.wasmmodeltier_set_cacheReadInputTokenCost(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6567
+ }
6568
+ /**
6569
+ * @param {number | null} [value]
6570
+ */
6571
+ set inputCostPerAudioToken(value) {
6572
+ wasm.wasmmodeltier_set_inputCostPerAudioToken(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6573
+ }
6574
+ /**
6575
+ * @param {number} value
6576
+ */
6577
+ set inputCostPerToken(value) {
6578
+ wasm.wasmmodeltier_set_inputCostPerToken(this.__wbg_ptr, value);
6579
+ }
6580
+ /**
6581
+ * @param {bigint} value
6582
+ */
6583
+ set minContextTokens(value) {
6584
+ wasm.wasmmodeltier_set_minContextTokens(this.__wbg_ptr, value);
6585
+ }
6586
+ /**
6587
+ * @param {number | null} [value]
6588
+ */
6589
+ set outputCostPerAudioToken(value) {
6590
+ wasm.wasmmodeltier_set_outputCostPerAudioToken(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6591
+ }
6592
+ /**
6593
+ * @param {number | null} [value]
6594
+ */
6595
+ set outputCostPerReasoningToken(value) {
6596
+ wasm.wasmmodeltier_set_outputCostPerReasoningToken(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
6597
+ }
6598
+ /**
6599
+ * @param {number} value
6600
+ */
6601
+ set outputCostPerToken(value) {
6602
+ wasm.wasmmodeltier_set_outputCostPerToken(this.__wbg_ptr, value);
6603
+ }
6604
+ }
6605
+ if (Symbol.dispose) WasmModelTier.prototype[Symbol.dispose] = WasmModelTier.prototype.free;
6606
+
6008
6607
  /**
6009
6608
  * Response listing available models.
6010
6609
  */
@@ -7820,6 +8419,16 @@ export const WasmReasoningEffort = Object.freeze({
7820
8419
  High: 2, "2": "High",
7821
8420
  });
7822
8421
 
8422
+ /**
8423
+ * Result of a `refresh_catalog` call.
8424
+ * @enum {0 | 1 | 2}
8425
+ */
8426
+ export const WasmRefreshOutcome = Object.freeze({
8427
+ Disabled: 0, "0": "Disabled",
8428
+ FromCache: 1, "1": "FromCache",
8429
+ Fetched: 2, "2": "Fetched",
8430
+ });
8431
+
7823
8432
  /**
7824
8433
  * A document to be reranked — either a plain string or an object with a text field.
7825
8434
  * @enum {0 | 1}
@@ -10714,7 +11323,7 @@ export function allProviders() {
10714
11323
  /**
10715
11324
  * Return the capability flags for a named provider.
10716
11325
  *
10717
- * Performs an O(n) linear scan over the embedded registry (143 entries).
11326
+ * Performs an O(n) linear scan over the embedded registry (163 entries).
10718
11327
  * Returns an owned value so bindings can pass capability data without
10719
11328
  * borrowing registry internals.
10720
11329
  *
@@ -10765,6 +11374,18 @@ export function clear() {
10765
11374
  wasm.clear();
10766
11375
  }
10767
11376
 
11377
+ /**
11378
+ * Clear the overlay registry, reverting `completion_cost`,
11379
+ * `completion_cost_with_cache`, and `model_info` to the
11380
+ * embedded catalog.
11381
+ *
11382
+ * Primarily a test seam (see `install_catalog_overlay_from_str`); also
11383
+ * usable by long-running processes that want to abandon a runtime refresh.
11384
+ */
11385
+ export function clearCatalogOverlay() {
11386
+ wasm.clearCatalogOverlay();
11387
+ }
11388
+
10768
11389
  /**
10769
11390
  * Calculate the estimated cost of a completion given a model name and token
10770
11391
  * counts.
@@ -10802,6 +11423,12 @@ export function completionCost(model, prompt_tokens, completion_tokens) {
10802
11423
  *
10803
11424
  * Returns `None` if the model is not present in the embedded pricing
10804
11425
  * registry, mirroring `completion_cost`.
11426
+ *
11427
+ * When the model has `ModelPricing.tiers`, the tier whose
11428
+ * `min_context_tokens` is the highest value `<= prompt_tokens` supplies the
11429
+ * input/output/cache rates for the whole call; models without tiers (or
11430
+ * when `prompt_tokens` is below every tier threshold) use the base rates
11431
+ * unchanged, matching the original flat-rate behaviour.
10805
11432
  * @param {string} model
10806
11433
  * @param {bigint} prompt_tokens
10807
11434
  * @param {bigint} cached_tokens
@@ -10937,6 +11564,82 @@ export function encodeDataUrl(bytes, mime) {
10937
11564
  }
10938
11565
  }
10939
11566
 
11567
+ /**
11568
+ * Install the overlay registry from a raw catalog JSON string, bypassing
11569
+ * the network and disk cache entirely.
11570
+ *
11571
+ * Parses and flattens `catalog_json` with the same
11572
+ * `registry_from_catalog_str` logic used for the embedded catalog and the
11573
+ * network refresh path, then atomically swaps it in as the active overlay.
11574
+ * A parse failure returns `CatalogRefreshError.Parse` and leaves any
11575
+ * existing overlay untouched.
11576
+ *
11577
+ * This is primarily a testable seam: it lets tests exercise overlay
11578
+ * installation and the embedded/overlay fallback behavior in
11579
+ * `completion_cost` / `model_info` without a real network
11580
+ * call.
11581
+ * @param {string} catalog_json
11582
+ */
11583
+ export function installCatalogOverlayFromStr(catalog_json) {
11584
+ const ptr0 = passStringToWasm0(catalog_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11585
+ const len0 = WASM_VECTOR_LEN;
11586
+ const ret = wasm.installCatalogOverlayFromStr(ptr0, len0);
11587
+ if (ret[1]) {
11588
+ throw takeFromExternrefTable0(ret[0]);
11589
+ }
11590
+ }
11591
+
11592
+ /**
11593
+ * Look up FFI-friendly pricing and capability metadata for a model.
11594
+ *
11595
+ * Returns `None` if the model is not present in the active pricing
11596
+ * registry. Uses the same exact-match-then-prefix-fallback resolution as
11597
+ * `model_pricing`; unlike `model_pricing`, the result is an owned
11598
+ * `ModelInfo` value safe to hand across the FFI boundary.
11599
+ *
11600
+ * When a runtime catalog refresh has succeeded, this reflects the refreshed
11601
+ * (overlay) catalog; otherwise it reflects the embedded catalog. See
11602
+ * `model_pricing` for the embedded-only alternative.
11603
+ * @param {string} model
11604
+ * @returns {WasmModelInfo | undefined}
11605
+ */
11606
+ export function modelInfo(model) {
11607
+ const ptr0 = passStringToWasm0(model, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11608
+ const len0 = WASM_VECTOR_LEN;
11609
+ const ret = wasm.modelInfo(ptr0, len0);
11610
+ return ret === 0 ? undefined : WasmModelInfo.__wrap(ret);
11611
+ }
11612
+
11613
+ /**
11614
+ * Refresh the runtime catalog overlay per `config`.
11615
+ *
11616
+ * - `config.enabled == false`: returns `Ok(``RefreshOutcome.Disabled``)`
11617
+ * immediately. No network, filesystem, or overlay activity.
11618
+ * - A fresh on-disk cache (age < `config.ttl_seconds`) exists at the
11619
+ * resolved cache path (`config.cache_path`, or a default under
11620
+ * `std.env.temp_dir()`): read + flatten it and install the overlay,
11621
+ * returning `Ok(``RefreshOutcome.FromCache``)`. No network request is
11622
+ * made.
11623
+ * - Otherwise: validate `config.source_url` uses `https`
11624
+ * (`CatalogRefreshError.InsecureUrl` otherwise), fetch it, flatten it,
11625
+ * install the overlay, best-effort write the raw JSON to the cache path
11626
+ * (a cache write failure does not fail the refresh), and return
11627
+ * `Ok(``RefreshOutcome.Fetched``)`.
11628
+ *
11629
+ * On any error return, the overlay is left untouched: the previously
11630
+ * active registry (a prior successful overlay, or the embedded catalog if
11631
+ * none was ever installed) remains in effect. This is what makes the
11632
+ * feature air-gap-safe — an unreachable or invalid `source_url` never
11633
+ * degrades `completion_cost` / `model_info` below embedded-catalog
11634
+ * availability.
11635
+ * @param {any} config
11636
+ * @returns {Promise<WasmRefreshOutcome>}
11637
+ */
11638
+ export function refreshCatalog(config) {
11639
+ const ret = wasm.refreshCatalog(config);
11640
+ return ret;
11641
+ }
11642
+
10940
11643
  /**
10941
11644
  * Register a custom provider in the global runtime registry.
10942
11645
  *
@@ -10986,6 +11689,17 @@ function __wbg_get_imports() {
10986
11689
  const ret = Error(getStringFromWasm0(arg0, arg1));
10987
11690
  return ret;
10988
11691
  },
11692
+ __wbg_Number_6b506e6536831eaa: function(arg0) {
11693
+ const ret = Number(arg0);
11694
+ return ret;
11695
+ },
11696
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
11697
+ const ret = String(arg1);
11698
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11699
+ const len1 = WASM_VECTOR_LEN;
11700
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
11701
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
11702
+ },
10989
11703
  __wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: function(arg0, arg1) {
10990
11704
  const v = arg1;
10991
11705
  const ret = typeof(v) === 'bigint' ? v : undefined;
@@ -11180,6 +11894,10 @@ function __wbg_get_imports() {
11180
11894
  const ret = arg0.value;
11181
11895
  return ret;
11182
11896
  },
11897
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
11898
+ const ret = arg0[arg1];
11899
+ return ret;
11900
+ },
11183
11901
  __wbg_has_73740b27f436fed3: function() { return handleError(function (arg0, arg1) {
11184
11902
  const ret = Reflect.has(arg0, arg1);
11185
11903
  return ret;
@@ -11554,6 +12272,14 @@ function __wbg_get_imports() {
11554
12272
  const ret = WasmModelsListResponse.__wrap(arg0);
11555
12273
  return ret;
11556
12274
  },
12275
+ __wbg_wasmmodeltier_new: function(arg0) {
12276
+ const ret = WasmModelTier.__wrap(arg0);
12277
+ return ret;
12278
+ },
12279
+ __wbg_wasmmodeltier_unwrap: function(arg0) {
12280
+ const ret = WasmModelTier.__unwrap(arg0);
12281
+ return ret;
12282
+ },
11557
12283
  __wbg_wasmmoderationresponse_new: function(arg0) {
11558
12284
  const ret = WasmModerationResponse.__wrap(arg0);
11559
12285
  return ret;
@@ -11671,22 +12397,22 @@ function __wbg_get_imports() {
11671
12397
  return ret;
11672
12398
  },
11673
12399
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
11674
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 759, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
12400
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 774, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
11675
12401
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h838b8ae4822e18a5);
11676
12402
  return ret;
11677
12403
  },
11678
12404
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
11679
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 779, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
12405
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 794, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
11680
12406
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hb42333e27c827052);
11681
12407
  return ret;
11682
12408
  },
11683
12409
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
11684
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 684, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
12410
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 699, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
11685
12411
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h238043eefd9b3f4d);
11686
12412
  return ret;
11687
12413
  },
11688
12414
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
11689
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 700, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
12415
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 715, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
11690
12416
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__ha49c00e409183b38);
11691
12417
  return ret;
11692
12418
  },
@@ -11803,6 +12529,9 @@ const WasmBatchObjectFinalization = (typeof FinalizationRegistry === 'undefined'
11803
12529
  const WasmBatchRequestCountsFinalization = (typeof FinalizationRegistry === 'undefined')
11804
12530
  ? { register: () => {}, unregister: () => {} }
11805
12531
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmbatchrequestcounts_free(ptr, 1));
12532
+ const WasmCatalogRefreshConfigFinalization = (typeof FinalizationRegistry === 'undefined')
12533
+ ? { register: () => {}, unregister: () => {} }
12534
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcatalogrefreshconfig_free(ptr, 1));
11806
12535
  const WasmChatCompletionChunkFinalization = (typeof FinalizationRegistry === 'undefined')
11807
12536
  ? { register: () => {}, unregister: () => {} }
11808
12537
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmchatcompletionchunk_free(ptr, 1));
@@ -11902,9 +12631,15 @@ const WasmLiterLlmErrorFinalization = (typeof FinalizationRegistry === 'undefine
11902
12631
  const WasmMessageFinalization = (typeof FinalizationRegistry === 'undefined')
11903
12632
  ? { register: () => {}, unregister: () => {} }
11904
12633
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmmessage_free(ptr, 1));
12634
+ const WasmModelInfoFinalization = (typeof FinalizationRegistry === 'undefined')
12635
+ ? { register: () => {}, unregister: () => {} }
12636
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmodelinfo_free(ptr, 1));
11905
12637
  const WasmModelObjectFinalization = (typeof FinalizationRegistry === 'undefined')
11906
12638
  ? { register: () => {}, unregister: () => {} }
11907
12639
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmmodelobject_free(ptr, 1));
12640
+ const WasmModelTierFinalization = (typeof FinalizationRegistry === 'undefined')
12641
+ ? { register: () => {}, unregister: () => {} }
12642
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmodeltier_free(ptr, 1));
11908
12643
  const WasmModelsListResponseFinalization = (typeof FinalizationRegistry === 'undefined')
11909
12644
  ? { register: () => {}, unregister: () => {} }
11910
12645
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmmodelslistresponse_free(ptr, 1));
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@xberg-io/liter-llm-wasm",
3
3
  "type": "module",
4
4
  "description": "Universal LLM API client with Rust-powered polyglot bindings.",
5
- "version": "1.9.3",
5
+ "version": "1.10.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",