@warlock.js/ai-mistral 4.8.2 → 4.9.1

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/cjs/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  let _warlock_js_ai_openai = require("@warlock.js/ai-openai");
3
3
 
4
- //#region ../@warlock.js/ai-mistral/src/known-models.ts
4
+ //#region ../ai-mistral/src/known-models.ts
5
5
  /**
6
6
  * Model-name fragments identifying Mistral families that accept image
7
7
  * input (vision / multimodal).
@@ -153,7 +153,7 @@ const MISTRAL_DEFAULT_PRICING = {
153
153
  };
154
154
 
155
155
  //#endregion
156
- //#region ../@warlock.js/ai-mistral/src/sdk.ts
156
+ //#region ../ai-mistral/src/sdk.ts
157
157
  /** Default OpenAI-compatible base URL for the Mistral API. */
158
158
  const MISTRAL_BASE_URL = "https://api.mistral.ai/v1";
159
159
  /** Default provider label stamped onto every model this SDK produces. */
package/cjs/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["OpenAISDK"],"sources":["../../../../../../@warlock.js/ai-mistral/src/known-models.ts","../../../../../../@warlock.js/ai-mistral/src/sdk.ts"],"sourcesContent":["import type { ModelPricing } from \"@warlock.js/ai\";\n\n/**\n * Model-name fragments identifying Mistral families that accept image\n * input (vision / multimodal).\n *\n * - `pixtral` — Mistral's dedicated multimodal family\n * (`pixtral-large-latest`, `pixtral-12b`); documents, charts, and\n * natural images.\n * - `mistral-large` / `mistral-medium` — the recent frontier generations\n * (Large 3, Medium 3.5) are natively multimodal.\n * - `ministral-3` — the current small open-weight line ships with\n * best-in-class text + vision.\n *\n * Matched as a **substring** (not a strict prefix) so the date / version\n * suffixes Mistral appends (`pixtral-large-2411`, `mistral-large-2512`)\n * and the `-latest` aliases are all covered without enumerating every\n * release tag. Override per-model via\n * `mistral.model({ name, vision: true | false })` — explicit config\n * always wins over inference.\n *\n * Maintenance: append a fragment when Mistral ships a multimodal family\n * that doesn't already match.\n */\nconst VISION_CAPABLE_SUBSTRINGS = [\n \"pixtral\",\n \"mistral-large\",\n \"mistral-medium\",\n \"ministral-3\",\n] as const;\n\n/**\n * Model-name fragments identifying Mistral families that perform\n * explicit chain-of-thought reasoning.\n *\n * - `magistral` — Mistral's dedicated reasoning family\n * (`magistral-medium-latest`, `magistral-small-latest`); emits\n * tokenized thinking chunks.\n * - `mistral-small-4` / `mistral-small` — the current Small generation\n * is a hybrid model that unifies instruct + reasoning + coding.\n *\n * Matched as a **substring** so version-tagged ids\n * (`magistral-medium-2509`, `mistral-small-2603`) and `-latest` aliases\n * are covered. Override per-model via\n * `mistral.model({ name, reasoning: true | false })` — explicit config\n * always wins over inference.\n *\n * Maintenance: append a fragment when Mistral ships a reasoning family\n * that doesn't already match.\n */\nconst REASONING_CAPABLE_SUBSTRINGS = [\"magistral\", \"mistral-small\"] as const;\n\n/**\n * Infer whether a Mistral model id accepts image input (vision) based on\n * the known multimodal-family fragments. Unknown ids default to `false`\n * so passing an image attachment to a text-only model surfaces a clear,\n * agent-side capability error instead of an opaque Mistral 400.\n *\n * @example\n * inferVisionCapability(\"pixtral-large-latest\"); // → true\n * inferVisionCapability(\"mistral-large-2512\"); // → true\n * inferVisionCapability(\"magistral-medium-latest\");// → false\n * inferVisionCapability(\"mistral-embed\"); // → false\n */\nexport function inferVisionCapability(modelName: string): boolean {\n const normalized = modelName.toLowerCase();\n\n return VISION_CAPABLE_SUBSTRINGS.some((fragment) => normalized.includes(fragment));\n}\n\n/**\n * Infer whether a Mistral model id is a reasoning model (the `magistral`\n * family plus the hybrid `mistral-small` generation) based on the known\n * fragments. Unknown ids default to `false` so the adapter never forwards\n * an unsupported `reasoning_effort` param to a non-reasoning model.\n *\n * @example\n * inferReasoningCapability(\"magistral-medium-latest\"); // → true\n * inferReasoningCapability(\"mistral-small-2603\"); // → true\n * inferReasoningCapability(\"mistral-large-latest\"); // → false\n * inferReasoningCapability(\"pixtral-12b\"); // → false\n */\nexport function inferReasoningCapability(modelName: string): boolean {\n const normalized = modelName.toLowerCase();\n\n return REASONING_CAPABLE_SUBSTRINGS.some((fragment) => normalized.includes(fragment));\n}\n\n/**\n * Stable `-latest` alias ids for the headline Mistral chat / embeddings\n * models, grouped by role. Convenience constants only — `mistral.model()`\n * accepts any id string, so a version-pinned id\n * (`mistral-large-2512`, `magistral-medium-2509`) works just as well.\n * Capability inference keys off the family fragment, not this list, so a\n * newer alias is recognized the moment its name matches a fragment in\n * {@link inferVisionCapability} / {@link inferReasoningCapability}.\n */\nexport const MISTRAL_MODELS = {\n /** General-purpose multimodal flagship / mid / small chat aliases. */\n chat: [\"mistral-large-latest\", \"mistral-medium-latest\", \"mistral-small-latest\"],\n /** Dedicated multimodal (vision) aliases — the `pixtral` family. */\n vision: [\"pixtral-large-latest\", \"pixtral-12b\"],\n /** Dedicated reasoning aliases — the `magistral` family. */\n reasoning: [\"magistral-medium-latest\", \"magistral-small-latest\"],\n /** Embeddings model reachable via the OpenAI-compatible `/v1/embeddings`. */\n embedding: [\"mistral-embed\"],\n} as const;\n\n/**\n * Conservative default USD pricing registry (per 1,000,000 tokens),\n * keyed by stable `-latest` alias, surfaced onto every model unless the\n * caller overrides it via SDK-level or per-model `pricing`.\n *\n * These are sane published-list approximations for budgeting / cost-truth\n * out of the box — Mistral revises rates and ships new generations, so\n * pass an explicit `pricing` registry to `new MistralSDK({ pricing })`\n * for billing-grade numbers. Resolution at `model()` time always lets a\n * caller-supplied rate win: per-model `pricing` > SDK `pricing` > these\n * defaults > `undefined`.\n */\nexport const MISTRAL_DEFAULT_PRICING: Record<string, ModelPricing> = {\n \"mistral-large-latest\": { input: 2, output: 6 },\n \"mistral-medium-latest\": { input: 0.4, output: 2 },\n \"mistral-small-latest\": { input: 0.1, output: 0.3 },\n \"pixtral-large-latest\": { input: 2, output: 6 },\n \"pixtral-12b\": { input: 0.15, output: 0.15 },\n \"magistral-medium-latest\": { input: 2, output: 5 },\n \"magistral-small-latest\": { input: 0.5, output: 1.5 },\n \"mistral-embed\": { input: 0.1, output: 0 },\n};\n","import type {\n EmbedderConfig,\n EmbedderContract,\n ModelContract,\n ModelPricing,\n SDKAdapterContract,\n} from \"@warlock.js/ai\";\nimport { OpenAISDK } from \"@warlock.js/ai-openai\";\nimport type { MistralModelConfig, MistralSDKConfig } from \"./config.type\";\nimport {\n inferReasoningCapability,\n inferVisionCapability,\n MISTRAL_DEFAULT_PRICING,\n} from \"./known-models\";\n\n/** Default OpenAI-compatible base URL for the Mistral API. */\nconst MISTRAL_BASE_URL = \"https://api.mistral.ai/v1\";\n\n/** Default provider label stamped onto every model this SDK produces. */\nconst MISTRAL_PROVIDER = \"mistral\";\n\n/**\n * Mistral-backed implementation of `SDKAdapterContract`.\n *\n * **Role.** The package entry point for Mistral AI chat + embeddings.\n * Mistral exposes an **OpenAI-compatible** API (`/v1/chat/completions`,\n * `/v1/embeddings`), so `MistralSDK` is a *thin wrapper* over the\n * battle-tested {@link OpenAISDK} — it does NOT re-implement the wire\n * protocol, streaming loop, tool-call accumulation, structured-output\n * mapping, error wrapping, or token accounting. It constructs one\n * internal `OpenAISDK` pointed at Mistral's `baseURL` with\n * `provider: \"mistral\"`, and delegates `model()` / `embedder()` /\n * `count()` straight to it.\n *\n * **What this wrapper adds on top of the OpenAI adapter:**\n * - **Defaults.** Injects Mistral's `baseURL` + `provider` label and a\n * default {@link MISTRAL_DEFAULT_PRICING} registry so cost truth works\n * out of the box. All are overridable via config.\n * - **Provider-correct capability inference.** Mistral's model names\n * aren't OpenAI names, so the OpenAI prefix lists never match. Before\n * delegating `model()`, this wrapper infers `vision` (the `pixtral`\n * family + recent multimodal generations) and `reasoning` (the\n * `magistral` family + hybrid `mistral-small`) from *this provider's*\n * fragment lists and passes them as explicit overrides — which the\n * inner `OpenAISDK` honors verbatim. A caller-supplied explicit\n * `vision` / `reasoning` still wins.\n *\n * Construct one SDK per account and reuse it everywhere; the single\n * underlying `OpenAI` client (connection pool, auth, rate-limit state)\n * is shared by every model / embedder produced here.\n *\n * **Note — no image generation.** Mistral has no OpenAI-compatible image\n * endpoint, so `image()` is intentionally NOT exposed. The structural\n * absence of the method IS the capability guard (see\n * `SDKAdapterContract.image`): `ai.mistral.image(...)` is a compile-time\n * error rather than a runtime failure.\n *\n * @example\n * const mistral = new MistralSDK({ apiKey: process.env.MISTRAL_API_KEY! });\n * const model = mistral.model({ name: \"mistral-large-latest\", temperature: 0.7 });\n * const embedder = mistral.embedder({ name: \"mistral-embed\" });\n *\n * @example\n * // Compose into an `ai.mistral` namespace for ergonomic agent wiring.\n * const ai = { agent, tool, systemPrompt, mistral: new MistralSDK({ apiKey }) };\n * const reasoner = ai.agent({ model: ai.mistral.model({ name: \"magistral-medium-latest\" }) });\n */\nexport class MistralSDK implements SDKAdapterContract {\n /**\n * The wrapped OpenAI-compatible adapter doing all the real work. Built\n * once in the constructor with Mistral's `baseURL`, `provider` label,\n * and merged pricing registry; every public method delegates to it.\n */\n private readonly openai: OpenAISDK;\n\n public constructor(config: MistralSDKConfig) {\n const { provider, baseURL, pricing, ...clientOptions } = config;\n\n // Caller pricing wins per model id; otherwise fall back to this\n // provider's published-list defaults so cost truth works out of the box.\n const mergedPricing: Record<string, ModelPricing> = {\n ...MISTRAL_DEFAULT_PRICING,\n ...pricing,\n };\n\n this.openai = new OpenAISDK({\n ...clientOptions,\n baseURL: baseURL ?? MISTRAL_BASE_URL,\n provider: provider ?? MISTRAL_PROVIDER,\n pricing: mergedPricing,\n });\n }\n\n /**\n * Build a `ModelContract` for a Mistral chat model.\n *\n * Delegates to the inner `OpenAISDK.model()` but first injects\n * **Mistral-aware capability inference**: when the caller omits\n * `vision` / `reasoning`, they're inferred from this provider's family\n * fragments (`pixtral` → vision, `magistral` / `mistral-small` →\n * reasoning, see `known-models.ts`) and passed down as explicit\n * overrides. Without this step the wrapped OpenAI adapter would check\n * Mistral ids against OpenAI prefixes (`gpt-4o`, `o3`, …) and wrongly\n * report every Mistral model as non-vision / non-reasoning.\n *\n * A caller-supplied explicit `vision` / `reasoning` is preserved as-is\n * (explicit config always wins over inference). Pricing resolution is\n * handled downstream by `OpenAISDK` against the merged registry:\n * per-model `pricing` > SDK registry (caller + Mistral defaults) >\n * `undefined`.\n */\n public model(config: MistralModelConfig): ModelContract {\n const resolvedConfig: MistralModelConfig = {\n ...config,\n vision: config.vision ?? inferVisionCapability(config.name),\n reasoning: config.reasoning ?? inferReasoningCapability(config.name),\n };\n\n return this.openai.model(resolvedConfig);\n }\n\n /**\n * Rough offline token-count estimate. Delegates to the wrapped\n * `OpenAISDK.count()` (the shared character-heuristic from the core\n * package) — good for budgeting / quota guards, not billing. The\n * optional model id is forwarded but currently ignored.\n */\n public async count(text: string, model?: string): Promise<number> {\n return this.openai.count(text, model);\n }\n\n /**\n * Build an `EmbedderContract` bound to this SDK's client. Mistral\n * serves embeddings (`mistral-embed`) through the OpenAI-compatible\n * `/v1/embeddings` endpoint, so this delegates straight to\n * `OpenAISDK.embedder()`.\n *\n * @example\n * const embedder = mistral.embedder({ name: \"mistral-embed\" });\n * const { vector } = await embedder.embed(\"Hello world\");\n */\n public embedder(config: EmbedderConfig): EmbedderContract {\n // `embedder` is optional on the contract but always present on the\n // wrapped OpenAI adapter — assert it for the delegation.\n return this.openai.embedder!(config);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,4BAA4B;CAChC;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,+BAA+B,CAAC,aAAa,eAAe;;;;;;;;;;;;;AAclE,SAAgB,sBAAsB,WAA4B;CAChE,MAAM,aAAa,UAAU,YAAY;CAEzC,OAAO,0BAA0B,MAAM,aAAa,WAAW,SAAS,QAAQ,CAAC;AACnF;;;;;;;;;;;;;AAcA,SAAgB,yBAAyB,WAA4B;CACnE,MAAM,aAAa,UAAU,YAAY;CAEzC,OAAO,6BAA6B,MAAM,aAAa,WAAW,SAAS,QAAQ,CAAC;AACtF;;;;;;;;;;AAWA,MAAa,iBAAiB;;CAE5B,MAAM;EAAC;EAAwB;EAAyB;CAAsB;;CAE9E,QAAQ,CAAC,wBAAwB,aAAa;;CAE9C,WAAW,CAAC,2BAA2B,wBAAwB;;CAE/D,WAAW,CAAC,eAAe;AAC7B;;;;;;;;;;;;;AAcA,MAAa,0BAAwD;CACnE,wBAAwB;EAAE,OAAO;EAAG,QAAQ;CAAE;CAC9C,yBAAyB;EAAE,OAAO;EAAK,QAAQ;CAAE;CACjD,wBAAwB;EAAE,OAAO;EAAK,QAAQ;CAAI;CAClD,wBAAwB;EAAE,OAAO;EAAG,QAAQ;CAAE;CAC9C,eAAe;EAAE,OAAO;EAAM,QAAQ;CAAK;CAC3C,2BAA2B;EAAE,OAAO;EAAG,QAAQ;CAAE;CACjD,0BAA0B;EAAE,OAAO;EAAK,QAAQ;CAAI;CACpD,iBAAiB;EAAE,OAAO;EAAK,QAAQ;CAAE;AAC3C;;;;;ACjHA,MAAM,mBAAmB;;AAGzB,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDzB,IAAa,aAAb,MAAsD;CAQpD,AAAO,YAAY,QAA0B;EAC3C,MAAM,EAAE,UAAU,SAAS,SAAS,GAAG,kBAAkB;EAIzD,MAAM,gBAA8C;GAClD,GAAG;GACH,GAAG;EACL;EAEA,KAAK,SAAS,IAAIA,gCAAU;GAC1B,GAAG;GACH,SAAS,WAAW;GACpB,UAAU,YAAY;GACtB,SAAS;EACX,CAAC;CACH;;;;;;;;;;;;;;;;;;;CAoBA,AAAO,MAAM,QAA2C;EACtD,MAAM,iBAAqC;GACzC,GAAG;GACH,QAAQ,OAAO,UAAU,sBAAsB,OAAO,IAAI;GAC1D,WAAW,OAAO,aAAa,yBAAyB,OAAO,IAAI;EACrE;EAEA,OAAO,KAAK,OAAO,MAAM,cAAc;CACzC;;;;;;;CAQA,MAAa,MAAM,MAAc,OAAiC;EAChE,OAAO,KAAK,OAAO,MAAM,MAAM,KAAK;CACtC;;;;;;;;;;;CAYA,AAAO,SAAS,QAA0C;EAGxD,OAAO,KAAK,OAAO,SAAU,MAAM;CACrC;AACF"}
1
+ {"version":3,"file":"index.cjs","names":["OpenAISDK"],"sources":["../../../../../../ai-mistral/src/known-models.ts","../../../../../../ai-mistral/src/sdk.ts"],"sourcesContent":["import type { ModelPricing } from \"@warlock.js/ai\";\n\n/**\n * Model-name fragments identifying Mistral families that accept image\n * input (vision / multimodal).\n *\n * - `pixtral` — Mistral's dedicated multimodal family\n * (`pixtral-large-latest`, `pixtral-12b`); documents, charts, and\n * natural images.\n * - `mistral-large` / `mistral-medium` — the recent frontier generations\n * (Large 3, Medium 3.5) are natively multimodal.\n * - `ministral-3` — the current small open-weight line ships with\n * best-in-class text + vision.\n *\n * Matched as a **substring** (not a strict prefix) so the date / version\n * suffixes Mistral appends (`pixtral-large-2411`, `mistral-large-2512`)\n * and the `-latest` aliases are all covered without enumerating every\n * release tag. Override per-model via\n * `mistral.model({ name, vision: true | false })` — explicit config\n * always wins over inference.\n *\n * Maintenance: append a fragment when Mistral ships a multimodal family\n * that doesn't already match.\n */\nconst VISION_CAPABLE_SUBSTRINGS = [\n \"pixtral\",\n \"mistral-large\",\n \"mistral-medium\",\n \"ministral-3\",\n] as const;\n\n/**\n * Model-name fragments identifying Mistral families that perform\n * explicit chain-of-thought reasoning.\n *\n * - `magistral` — Mistral's dedicated reasoning family\n * (`magistral-medium-latest`, `magistral-small-latest`); emits\n * tokenized thinking chunks.\n * - `mistral-small-4` / `mistral-small` — the current Small generation\n * is a hybrid model that unifies instruct + reasoning + coding.\n *\n * Matched as a **substring** so version-tagged ids\n * (`magistral-medium-2509`, `mistral-small-2603`) and `-latest` aliases\n * are covered. Override per-model via\n * `mistral.model({ name, reasoning: true | false })` — explicit config\n * always wins over inference.\n *\n * Maintenance: append a fragment when Mistral ships a reasoning family\n * that doesn't already match.\n */\nconst REASONING_CAPABLE_SUBSTRINGS = [\"magistral\", \"mistral-small\"] as const;\n\n/**\n * Infer whether a Mistral model id accepts image input (vision) based on\n * the known multimodal-family fragments. Unknown ids default to `false`\n * so passing an image attachment to a text-only model surfaces a clear,\n * agent-side capability error instead of an opaque Mistral 400.\n *\n * @example\n * inferVisionCapability(\"pixtral-large-latest\"); // → true\n * inferVisionCapability(\"mistral-large-2512\"); // → true\n * inferVisionCapability(\"magistral-medium-latest\");// → false\n * inferVisionCapability(\"mistral-embed\"); // → false\n */\nexport function inferVisionCapability(modelName: string): boolean {\n const normalized = modelName.toLowerCase();\n\n return VISION_CAPABLE_SUBSTRINGS.some((fragment) => normalized.includes(fragment));\n}\n\n/**\n * Infer whether a Mistral model id is a reasoning model (the `magistral`\n * family plus the hybrid `mistral-small` generation) based on the known\n * fragments. Unknown ids default to `false` so the adapter never forwards\n * an unsupported `reasoning_effort` param to a non-reasoning model.\n *\n * @example\n * inferReasoningCapability(\"magistral-medium-latest\"); // → true\n * inferReasoningCapability(\"mistral-small-2603\"); // → true\n * inferReasoningCapability(\"mistral-large-latest\"); // → false\n * inferReasoningCapability(\"pixtral-12b\"); // → false\n */\nexport function inferReasoningCapability(modelName: string): boolean {\n const normalized = modelName.toLowerCase();\n\n return REASONING_CAPABLE_SUBSTRINGS.some((fragment) => normalized.includes(fragment));\n}\n\n/**\n * Stable `-latest` alias ids for the headline Mistral chat / embeddings\n * models, grouped by role. Convenience constants only — `mistral.model()`\n * accepts any id string, so a version-pinned id\n * (`mistral-large-2512`, `magistral-medium-2509`) works just as well.\n * Capability inference keys off the family fragment, not this list, so a\n * newer alias is recognized the moment its name matches a fragment in\n * {@link inferVisionCapability} / {@link inferReasoningCapability}.\n */\nexport const MISTRAL_MODELS = {\n /** General-purpose multimodal flagship / mid / small chat aliases. */\n chat: [\"mistral-large-latest\", \"mistral-medium-latest\", \"mistral-small-latest\"],\n /** Dedicated multimodal (vision) aliases — the `pixtral` family. */\n vision: [\"pixtral-large-latest\", \"pixtral-12b\"],\n /** Dedicated reasoning aliases — the `magistral` family. */\n reasoning: [\"magistral-medium-latest\", \"magistral-small-latest\"],\n /** Embeddings model reachable via the OpenAI-compatible `/v1/embeddings`. */\n embedding: [\"mistral-embed\"],\n} as const;\n\n/**\n * Conservative default USD pricing registry (per 1,000,000 tokens),\n * keyed by stable `-latest` alias, surfaced onto every model unless the\n * caller overrides it via SDK-level or per-model `pricing`.\n *\n * These are sane published-list approximations for budgeting / cost-truth\n * out of the box — Mistral revises rates and ships new generations, so\n * pass an explicit `pricing` registry to `new MistralSDK({ pricing })`\n * for billing-grade numbers. Resolution at `model()` time always lets a\n * caller-supplied rate win: per-model `pricing` > SDK `pricing` > these\n * defaults > `undefined`.\n */\nexport const MISTRAL_DEFAULT_PRICING: Record<string, ModelPricing> = {\n \"mistral-large-latest\": { input: 2, output: 6 },\n \"mistral-medium-latest\": { input: 0.4, output: 2 },\n \"mistral-small-latest\": { input: 0.1, output: 0.3 },\n \"pixtral-large-latest\": { input: 2, output: 6 },\n \"pixtral-12b\": { input: 0.15, output: 0.15 },\n \"magistral-medium-latest\": { input: 2, output: 5 },\n \"magistral-small-latest\": { input: 0.5, output: 1.5 },\n \"mistral-embed\": { input: 0.1, output: 0 },\n};\n","import type {\n EmbedderConfig,\n EmbedderContract,\n ModelContract,\n ModelPricing,\n SDKAdapterContract,\n} from \"@warlock.js/ai\";\nimport { OpenAISDK } from \"@warlock.js/ai-openai\";\nimport type { MistralModelConfig, MistralSDKConfig } from \"./config.type\";\nimport {\n inferReasoningCapability,\n inferVisionCapability,\n MISTRAL_DEFAULT_PRICING,\n} from \"./known-models\";\n\n/** Default OpenAI-compatible base URL for the Mistral API. */\nconst MISTRAL_BASE_URL = \"https://api.mistral.ai/v1\";\n\n/** Default provider label stamped onto every model this SDK produces. */\nconst MISTRAL_PROVIDER = \"mistral\";\n\n/**\n * Mistral-backed implementation of `SDKAdapterContract`.\n *\n * **Role.** The package entry point for Mistral AI chat + embeddings.\n * Mistral exposes an **OpenAI-compatible** API (`/v1/chat/completions`,\n * `/v1/embeddings`), so `MistralSDK` is a *thin wrapper* over the\n * battle-tested {@link OpenAISDK} — it does NOT re-implement the wire\n * protocol, streaming loop, tool-call accumulation, structured-output\n * mapping, error wrapping, or token accounting. It constructs one\n * internal `OpenAISDK` pointed at Mistral's `baseURL` with\n * `provider: \"mistral\"`, and delegates `model()` / `embedder()` /\n * `count()` straight to it.\n *\n * **What this wrapper adds on top of the OpenAI adapter:**\n * - **Defaults.** Injects Mistral's `baseURL` + `provider` label and a\n * default {@link MISTRAL_DEFAULT_PRICING} registry so cost truth works\n * out of the box. All are overridable via config.\n * - **Provider-correct capability inference.** Mistral's model names\n * aren't OpenAI names, so the OpenAI prefix lists never match. Before\n * delegating `model()`, this wrapper infers `vision` (the `pixtral`\n * family + recent multimodal generations) and `reasoning` (the\n * `magistral` family + hybrid `mistral-small`) from *this provider's*\n * fragment lists and passes them as explicit overrides — which the\n * inner `OpenAISDK` honors verbatim. A caller-supplied explicit\n * `vision` / `reasoning` still wins.\n *\n * Construct one SDK per account and reuse it everywhere; the single\n * underlying `OpenAI` client (connection pool, auth, rate-limit state)\n * is shared by every model / embedder produced here.\n *\n * **Note — no image generation.** Mistral has no OpenAI-compatible image\n * endpoint, so `image()` is intentionally NOT exposed. The structural\n * absence of the method IS the capability guard (see\n * `SDKAdapterContract.image`): `ai.mistral.image(...)` is a compile-time\n * error rather than a runtime failure.\n *\n * @example\n * const mistral = new MistralSDK({ apiKey: process.env.MISTRAL_API_KEY! });\n * const model = mistral.model({ name: \"mistral-large-latest\", temperature: 0.7 });\n * const embedder = mistral.embedder({ name: \"mistral-embed\" });\n *\n * @example\n * // Compose into an `ai.mistral` namespace for ergonomic agent wiring.\n * const ai = { agent, tool, systemPrompt, mistral: new MistralSDK({ apiKey }) };\n * const reasoner = ai.agent({ model: ai.mistral.model({ name: \"magistral-medium-latest\" }) });\n */\nexport class MistralSDK implements SDKAdapterContract {\n /**\n * The wrapped OpenAI-compatible adapter doing all the real work. Built\n * once in the constructor with Mistral's `baseURL`, `provider` label,\n * and merged pricing registry; every public method delegates to it.\n */\n private readonly openai: OpenAISDK;\n\n public constructor(config: MistralSDKConfig) {\n const { provider, baseURL, pricing, ...clientOptions } = config;\n\n // Caller pricing wins per model id; otherwise fall back to this\n // provider's published-list defaults so cost truth works out of the box.\n const mergedPricing: Record<string, ModelPricing> = {\n ...MISTRAL_DEFAULT_PRICING,\n ...pricing,\n };\n\n this.openai = new OpenAISDK({\n ...clientOptions,\n baseURL: baseURL ?? MISTRAL_BASE_URL,\n provider: provider ?? MISTRAL_PROVIDER,\n pricing: mergedPricing,\n });\n }\n\n /**\n * Build a `ModelContract` for a Mistral chat model.\n *\n * Delegates to the inner `OpenAISDK.model()` but first injects\n * **Mistral-aware capability inference**: when the caller omits\n * `vision` / `reasoning`, they're inferred from this provider's family\n * fragments (`pixtral` → vision, `magistral` / `mistral-small` →\n * reasoning, see `known-models.ts`) and passed down as explicit\n * overrides. Without this step the wrapped OpenAI adapter would check\n * Mistral ids against OpenAI prefixes (`gpt-4o`, `o3`, …) and wrongly\n * report every Mistral model as non-vision / non-reasoning.\n *\n * A caller-supplied explicit `vision` / `reasoning` is preserved as-is\n * (explicit config always wins over inference). Pricing resolution is\n * handled downstream by `OpenAISDK` against the merged registry:\n * per-model `pricing` > SDK registry (caller + Mistral defaults) >\n * `undefined`.\n */\n public model(config: MistralModelConfig): ModelContract {\n const resolvedConfig: MistralModelConfig = {\n ...config,\n vision: config.vision ?? inferVisionCapability(config.name),\n reasoning: config.reasoning ?? inferReasoningCapability(config.name),\n };\n\n return this.openai.model(resolvedConfig);\n }\n\n /**\n * Rough offline token-count estimate. Delegates to the wrapped\n * `OpenAISDK.count()` (the shared character-heuristic from the core\n * package) — good for budgeting / quota guards, not billing. The\n * optional model id is forwarded but currently ignored.\n */\n public async count(text: string, model?: string): Promise<number> {\n return this.openai.count(text, model);\n }\n\n /**\n * Build an `EmbedderContract` bound to this SDK's client. Mistral\n * serves embeddings (`mistral-embed`) through the OpenAI-compatible\n * `/v1/embeddings` endpoint, so this delegates straight to\n * `OpenAISDK.embedder()`.\n *\n * @example\n * const embedder = mistral.embedder({ name: \"mistral-embed\" });\n * const { vector } = await embedder.embed(\"Hello world\");\n */\n public embedder(config: EmbedderConfig): EmbedderContract {\n // `embedder` is optional on the contract but always present on the\n // wrapped OpenAI adapter — assert it for the delegation.\n return this.openai.embedder!(config);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,4BAA4B;CAChC;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,+BAA+B,CAAC,aAAa,eAAe;;;;;;;;;;;;;AAclE,SAAgB,sBAAsB,WAA4B;CAChE,MAAM,aAAa,UAAU,YAAY;CAEzC,OAAO,0BAA0B,MAAM,aAAa,WAAW,SAAS,QAAQ,CAAC;AACnF;;;;;;;;;;;;;AAcA,SAAgB,yBAAyB,WAA4B;CACnE,MAAM,aAAa,UAAU,YAAY;CAEzC,OAAO,6BAA6B,MAAM,aAAa,WAAW,SAAS,QAAQ,CAAC;AACtF;;;;;;;;;;AAWA,MAAa,iBAAiB;;CAE5B,MAAM;EAAC;EAAwB;EAAyB;CAAsB;;CAE9E,QAAQ,CAAC,wBAAwB,aAAa;;CAE9C,WAAW,CAAC,2BAA2B,wBAAwB;;CAE/D,WAAW,CAAC,eAAe;AAC7B;;;;;;;;;;;;;AAcA,MAAa,0BAAwD;CACnE,wBAAwB;EAAE,OAAO;EAAG,QAAQ;CAAE;CAC9C,yBAAyB;EAAE,OAAO;EAAK,QAAQ;CAAE;CACjD,wBAAwB;EAAE,OAAO;EAAK,QAAQ;CAAI;CAClD,wBAAwB;EAAE,OAAO;EAAG,QAAQ;CAAE;CAC9C,eAAe;EAAE,OAAO;EAAM,QAAQ;CAAK;CAC3C,2BAA2B;EAAE,OAAO;EAAG,QAAQ;CAAE;CACjD,0BAA0B;EAAE,OAAO;EAAK,QAAQ;CAAI;CACpD,iBAAiB;EAAE,OAAO;EAAK,QAAQ;CAAE;AAC3C;;;;;ACjHA,MAAM,mBAAmB;;AAGzB,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDzB,IAAa,aAAb,MAAsD;CAQpD,AAAO,YAAY,QAA0B;EAC3C,MAAM,EAAE,UAAU,SAAS,SAAS,GAAG,kBAAkB;EAIzD,MAAM,gBAA8C;GAClD,GAAG;GACH,GAAG;EACL;EAEA,KAAK,SAAS,IAAIA,gCAAU;GAC1B,GAAG;GACH,SAAS,WAAW;GACpB,UAAU,YAAY;GACtB,SAAS;EACX,CAAC;CACH;;;;;;;;;;;;;;;;;;;CAoBA,AAAO,MAAM,QAA2C;EACtD,MAAM,iBAAqC;GACzC,GAAG;GACH,QAAQ,OAAO,UAAU,sBAAsB,OAAO,IAAI;GAC1D,WAAW,OAAO,aAAa,yBAAyB,OAAO,IAAI;EACrE;EAEA,OAAO,KAAK,OAAO,MAAM,cAAc;CACzC;;;;;;;CAQA,MAAa,MAAM,MAAc,OAAiC;EAChE,OAAO,KAAK,OAAO,MAAM,MAAM,KAAK;CACtC;;;;;;;;;;;CAYA,AAAO,SAAS,QAA0C;EAGxD,OAAO,KAAK,OAAO,SAAU,MAAM;CACrC;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { OpenAISDKConfig } from "@warlock.js/ai-openai";
2
2
  import { ModelConfig } from "@warlock.js/ai";
3
3
 
4
- //#region ../@warlock.js/ai-mistral/src/config.type.d.ts
4
+ //#region ../ai-mistral/src/config.type.d.ts
5
5
  /**
6
6
  * Configuration for the Mistral SDK adapter.
7
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"config.type.d.mts","names":[],"sources":["../../../../../../@warlock.js/ai-mistral/src/config.type.ts"],"mappings":";;;;;;AAmCA;;;;AAA8C;AAmB9C;;;;;;;;;;;;AA0CO;;;;;;;;;;;;;KA7DK,gBAAA,GAAmB,eAAe;;;;;;;;;;;;;;;;;;KAmBlC,kBAAA,GAAqB,WAAW;;;;;;;;EAQ1C,MAAA;;;;;;;;;EASA,SAAA;;;;;;EAMA,gBAAA;;;;;;;EAOA,cAAA;;;;;;EAMA,GAAA;;;;;;EAMA,KAAA;AAAA"}
1
+ {"version":3,"file":"config.type.d.mts","names":[],"sources":["../../../../../../ai-mistral/src/config.type.ts"],"mappings":";;;;;;AAmCA;;;;AAA8C;AAmB9C;;;;;;;;;;;;AA0CO;;;;;;;;;;;;;KA7DK,gBAAA,GAAmB,eAAe;;;;;;;;;;;;;;;;;;KAmBlC,kBAAA,GAAqB,WAAW;;;;;;;;EAQ1C,MAAA;;;;;;;;;EASA,SAAA;;;;;;EAMA,gBAAA;;;;;;;EAOA,cAAA;;;;;;EAMA,GAAA;;;;;;EAMA,KAAA;AAAA"}
@@ -1,6 +1,6 @@
1
1
  import { ModelPricing } from "@warlock.js/ai";
2
2
 
3
- //#region ../@warlock.js/ai-mistral/src/known-models.d.ts
3
+ //#region ../ai-mistral/src/known-models.d.ts
4
4
  /**
5
5
  * Infer whether a Mistral model id accepts image input (vision) based on
6
6
  * the known multimodal-family fragments. Unknown ids default to `false`
@@ -1 +1 @@
1
- {"version":3,"file":"known-models.d.mts","names":[],"sources":["../../../../../../@warlock.js/ai-mistral/src/known-models.ts"],"mappings":";;;;;AAgEA;;;;AAAuD;AAkBvD;;;;AAA0D;iBAlB1C,qBAAA,CAAsB,SAAiB;;;;;;;;;;AAwDvD;;;iBAtCgB,wBAAA,CAAyB,SAAiB;AAsCO;;;;;;;;;AAAA,cAvBpD,cAAA;;;;;;;;;;;;;;;;;;cAuBA,uBAAA,EAAyB,MAAM,SAAS,YAAA"}
1
+ {"version":3,"file":"known-models.d.mts","names":[],"sources":["../../../../../../ai-mistral/src/known-models.ts"],"mappings":";;;;;AAgEA;;;;AAAuD;AAkBvD;;;;AAA0D;iBAlB1C,qBAAA,CAAsB,SAAiB;;;;;;;;;;AAwDvD;;;iBAtCgB,wBAAA,CAAyB,SAAiB;AAsCO;;;;;;;;;AAAA,cAvBpD,cAAA;;;;;;;;;;;;;;;;;;cAuBA,uBAAA,EAAyB,MAAM,SAAS,YAAA"}
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai-mistral/src/known-models.ts
1
+ //#region ../ai-mistral/src/known-models.ts
2
2
  /**
3
3
  * Model-name fragments identifying Mistral families that accept image
4
4
  * input (vision / multimodal).
@@ -1 +1 @@
1
- {"version":3,"file":"known-models.mjs","names":[],"sources":["../../../../../../@warlock.js/ai-mistral/src/known-models.ts"],"sourcesContent":["import type { ModelPricing } from \"@warlock.js/ai\";\n\n/**\n * Model-name fragments identifying Mistral families that accept image\n * input (vision / multimodal).\n *\n * - `pixtral` — Mistral's dedicated multimodal family\n * (`pixtral-large-latest`, `pixtral-12b`); documents, charts, and\n * natural images.\n * - `mistral-large` / `mistral-medium` — the recent frontier generations\n * (Large 3, Medium 3.5) are natively multimodal.\n * - `ministral-3` — the current small open-weight line ships with\n * best-in-class text + vision.\n *\n * Matched as a **substring** (not a strict prefix) so the date / version\n * suffixes Mistral appends (`pixtral-large-2411`, `mistral-large-2512`)\n * and the `-latest` aliases are all covered without enumerating every\n * release tag. Override per-model via\n * `mistral.model({ name, vision: true | false })` — explicit config\n * always wins over inference.\n *\n * Maintenance: append a fragment when Mistral ships a multimodal family\n * that doesn't already match.\n */\nconst VISION_CAPABLE_SUBSTRINGS = [\n \"pixtral\",\n \"mistral-large\",\n \"mistral-medium\",\n \"ministral-3\",\n] as const;\n\n/**\n * Model-name fragments identifying Mistral families that perform\n * explicit chain-of-thought reasoning.\n *\n * - `magistral` — Mistral's dedicated reasoning family\n * (`magistral-medium-latest`, `magistral-small-latest`); emits\n * tokenized thinking chunks.\n * - `mistral-small-4` / `mistral-small` — the current Small generation\n * is a hybrid model that unifies instruct + reasoning + coding.\n *\n * Matched as a **substring** so version-tagged ids\n * (`magistral-medium-2509`, `mistral-small-2603`) and `-latest` aliases\n * are covered. Override per-model via\n * `mistral.model({ name, reasoning: true | false })` — explicit config\n * always wins over inference.\n *\n * Maintenance: append a fragment when Mistral ships a reasoning family\n * that doesn't already match.\n */\nconst REASONING_CAPABLE_SUBSTRINGS = [\"magistral\", \"mistral-small\"] as const;\n\n/**\n * Infer whether a Mistral model id accepts image input (vision) based on\n * the known multimodal-family fragments. Unknown ids default to `false`\n * so passing an image attachment to a text-only model surfaces a clear,\n * agent-side capability error instead of an opaque Mistral 400.\n *\n * @example\n * inferVisionCapability(\"pixtral-large-latest\"); // → true\n * inferVisionCapability(\"mistral-large-2512\"); // → true\n * inferVisionCapability(\"magistral-medium-latest\");// → false\n * inferVisionCapability(\"mistral-embed\"); // → false\n */\nexport function inferVisionCapability(modelName: string): boolean {\n const normalized = modelName.toLowerCase();\n\n return VISION_CAPABLE_SUBSTRINGS.some((fragment) => normalized.includes(fragment));\n}\n\n/**\n * Infer whether a Mistral model id is a reasoning model (the `magistral`\n * family plus the hybrid `mistral-small` generation) based on the known\n * fragments. Unknown ids default to `false` so the adapter never forwards\n * an unsupported `reasoning_effort` param to a non-reasoning model.\n *\n * @example\n * inferReasoningCapability(\"magistral-medium-latest\"); // → true\n * inferReasoningCapability(\"mistral-small-2603\"); // → true\n * inferReasoningCapability(\"mistral-large-latest\"); // → false\n * inferReasoningCapability(\"pixtral-12b\"); // → false\n */\nexport function inferReasoningCapability(modelName: string): boolean {\n const normalized = modelName.toLowerCase();\n\n return REASONING_CAPABLE_SUBSTRINGS.some((fragment) => normalized.includes(fragment));\n}\n\n/**\n * Stable `-latest` alias ids for the headline Mistral chat / embeddings\n * models, grouped by role. Convenience constants only — `mistral.model()`\n * accepts any id string, so a version-pinned id\n * (`mistral-large-2512`, `magistral-medium-2509`) works just as well.\n * Capability inference keys off the family fragment, not this list, so a\n * newer alias is recognized the moment its name matches a fragment in\n * {@link inferVisionCapability} / {@link inferReasoningCapability}.\n */\nexport const MISTRAL_MODELS = {\n /** General-purpose multimodal flagship / mid / small chat aliases. */\n chat: [\"mistral-large-latest\", \"mistral-medium-latest\", \"mistral-small-latest\"],\n /** Dedicated multimodal (vision) aliases — the `pixtral` family. */\n vision: [\"pixtral-large-latest\", \"pixtral-12b\"],\n /** Dedicated reasoning aliases — the `magistral` family. */\n reasoning: [\"magistral-medium-latest\", \"magistral-small-latest\"],\n /** Embeddings model reachable via the OpenAI-compatible `/v1/embeddings`. */\n embedding: [\"mistral-embed\"],\n} as const;\n\n/**\n * Conservative default USD pricing registry (per 1,000,000 tokens),\n * keyed by stable `-latest` alias, surfaced onto every model unless the\n * caller overrides it via SDK-level or per-model `pricing`.\n *\n * These are sane published-list approximations for budgeting / cost-truth\n * out of the box — Mistral revises rates and ships new generations, so\n * pass an explicit `pricing` registry to `new MistralSDK({ pricing })`\n * for billing-grade numbers. Resolution at `model()` time always lets a\n * caller-supplied rate win: per-model `pricing` > SDK `pricing` > these\n * defaults > `undefined`.\n */\nexport const MISTRAL_DEFAULT_PRICING: Record<string, ModelPricing> = {\n \"mistral-large-latest\": { input: 2, output: 6 },\n \"mistral-medium-latest\": { input: 0.4, output: 2 },\n \"mistral-small-latest\": { input: 0.1, output: 0.3 },\n \"pixtral-large-latest\": { input: 2, output: 6 },\n \"pixtral-12b\": { input: 0.15, output: 0.15 },\n \"magistral-medium-latest\": { input: 2, output: 5 },\n \"magistral-small-latest\": { input: 0.5, output: 1.5 },\n \"mistral-embed\": { input: 0.1, output: 0 },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,4BAA4B;CAChC;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,+BAA+B,CAAC,aAAa,eAAe;;;;;;;;;;;;;AAclE,SAAgB,sBAAsB,WAA4B;CAChE,MAAM,aAAa,UAAU,YAAY;CAEzC,OAAO,0BAA0B,MAAM,aAAa,WAAW,SAAS,QAAQ,CAAC;AACnF;;;;;;;;;;;;;AAcA,SAAgB,yBAAyB,WAA4B;CACnE,MAAM,aAAa,UAAU,YAAY;CAEzC,OAAO,6BAA6B,MAAM,aAAa,WAAW,SAAS,QAAQ,CAAC;AACtF;;;;;;;;;;AAWA,MAAa,iBAAiB;;CAE5B,MAAM;EAAC;EAAwB;EAAyB;CAAsB;;CAE9E,QAAQ,CAAC,wBAAwB,aAAa;;CAE9C,WAAW,CAAC,2BAA2B,wBAAwB;;CAE/D,WAAW,CAAC,eAAe;AAC7B;;;;;;;;;;;;;AAcA,MAAa,0BAAwD;CACnE,wBAAwB;EAAE,OAAO;EAAG,QAAQ;CAAE;CAC9C,yBAAyB;EAAE,OAAO;EAAK,QAAQ;CAAE;CACjD,wBAAwB;EAAE,OAAO;EAAK,QAAQ;CAAI;CAClD,wBAAwB;EAAE,OAAO;EAAG,QAAQ;CAAE;CAC9C,eAAe;EAAE,OAAO;EAAM,QAAQ;CAAK;CAC3C,2BAA2B;EAAE,OAAO;EAAG,QAAQ;CAAE;CACjD,0BAA0B;EAAE,OAAO;EAAK,QAAQ;CAAI;CACpD,iBAAiB;EAAE,OAAO;EAAK,QAAQ;CAAE;AAC3C"}
1
+ {"version":3,"file":"known-models.mjs","names":[],"sources":["../../../../../../ai-mistral/src/known-models.ts"],"sourcesContent":["import type { ModelPricing } from \"@warlock.js/ai\";\n\n/**\n * Model-name fragments identifying Mistral families that accept image\n * input (vision / multimodal).\n *\n * - `pixtral` — Mistral's dedicated multimodal family\n * (`pixtral-large-latest`, `pixtral-12b`); documents, charts, and\n * natural images.\n * - `mistral-large` / `mistral-medium` — the recent frontier generations\n * (Large 3, Medium 3.5) are natively multimodal.\n * - `ministral-3` — the current small open-weight line ships with\n * best-in-class text + vision.\n *\n * Matched as a **substring** (not a strict prefix) so the date / version\n * suffixes Mistral appends (`pixtral-large-2411`, `mistral-large-2512`)\n * and the `-latest` aliases are all covered without enumerating every\n * release tag. Override per-model via\n * `mistral.model({ name, vision: true | false })` — explicit config\n * always wins over inference.\n *\n * Maintenance: append a fragment when Mistral ships a multimodal family\n * that doesn't already match.\n */\nconst VISION_CAPABLE_SUBSTRINGS = [\n \"pixtral\",\n \"mistral-large\",\n \"mistral-medium\",\n \"ministral-3\",\n] as const;\n\n/**\n * Model-name fragments identifying Mistral families that perform\n * explicit chain-of-thought reasoning.\n *\n * - `magistral` — Mistral's dedicated reasoning family\n * (`magistral-medium-latest`, `magistral-small-latest`); emits\n * tokenized thinking chunks.\n * - `mistral-small-4` / `mistral-small` — the current Small generation\n * is a hybrid model that unifies instruct + reasoning + coding.\n *\n * Matched as a **substring** so version-tagged ids\n * (`magistral-medium-2509`, `mistral-small-2603`) and `-latest` aliases\n * are covered. Override per-model via\n * `mistral.model({ name, reasoning: true | false })` — explicit config\n * always wins over inference.\n *\n * Maintenance: append a fragment when Mistral ships a reasoning family\n * that doesn't already match.\n */\nconst REASONING_CAPABLE_SUBSTRINGS = [\"magistral\", \"mistral-small\"] as const;\n\n/**\n * Infer whether a Mistral model id accepts image input (vision) based on\n * the known multimodal-family fragments. Unknown ids default to `false`\n * so passing an image attachment to a text-only model surfaces a clear,\n * agent-side capability error instead of an opaque Mistral 400.\n *\n * @example\n * inferVisionCapability(\"pixtral-large-latest\"); // → true\n * inferVisionCapability(\"mistral-large-2512\"); // → true\n * inferVisionCapability(\"magistral-medium-latest\");// → false\n * inferVisionCapability(\"mistral-embed\"); // → false\n */\nexport function inferVisionCapability(modelName: string): boolean {\n const normalized = modelName.toLowerCase();\n\n return VISION_CAPABLE_SUBSTRINGS.some((fragment) => normalized.includes(fragment));\n}\n\n/**\n * Infer whether a Mistral model id is a reasoning model (the `magistral`\n * family plus the hybrid `mistral-small` generation) based on the known\n * fragments. Unknown ids default to `false` so the adapter never forwards\n * an unsupported `reasoning_effort` param to a non-reasoning model.\n *\n * @example\n * inferReasoningCapability(\"magistral-medium-latest\"); // → true\n * inferReasoningCapability(\"mistral-small-2603\"); // → true\n * inferReasoningCapability(\"mistral-large-latest\"); // → false\n * inferReasoningCapability(\"pixtral-12b\"); // → false\n */\nexport function inferReasoningCapability(modelName: string): boolean {\n const normalized = modelName.toLowerCase();\n\n return REASONING_CAPABLE_SUBSTRINGS.some((fragment) => normalized.includes(fragment));\n}\n\n/**\n * Stable `-latest` alias ids for the headline Mistral chat / embeddings\n * models, grouped by role. Convenience constants only — `mistral.model()`\n * accepts any id string, so a version-pinned id\n * (`mistral-large-2512`, `magistral-medium-2509`) works just as well.\n * Capability inference keys off the family fragment, not this list, so a\n * newer alias is recognized the moment its name matches a fragment in\n * {@link inferVisionCapability} / {@link inferReasoningCapability}.\n */\nexport const MISTRAL_MODELS = {\n /** General-purpose multimodal flagship / mid / small chat aliases. */\n chat: [\"mistral-large-latest\", \"mistral-medium-latest\", \"mistral-small-latest\"],\n /** Dedicated multimodal (vision) aliases — the `pixtral` family. */\n vision: [\"pixtral-large-latest\", \"pixtral-12b\"],\n /** Dedicated reasoning aliases — the `magistral` family. */\n reasoning: [\"magistral-medium-latest\", \"magistral-small-latest\"],\n /** Embeddings model reachable via the OpenAI-compatible `/v1/embeddings`. */\n embedding: [\"mistral-embed\"],\n} as const;\n\n/**\n * Conservative default USD pricing registry (per 1,000,000 tokens),\n * keyed by stable `-latest` alias, surfaced onto every model unless the\n * caller overrides it via SDK-level or per-model `pricing`.\n *\n * These are sane published-list approximations for budgeting / cost-truth\n * out of the box — Mistral revises rates and ships new generations, so\n * pass an explicit `pricing` registry to `new MistralSDK({ pricing })`\n * for billing-grade numbers. Resolution at `model()` time always lets a\n * caller-supplied rate win: per-model `pricing` > SDK `pricing` > these\n * defaults > `undefined`.\n */\nexport const MISTRAL_DEFAULT_PRICING: Record<string, ModelPricing> = {\n \"mistral-large-latest\": { input: 2, output: 6 },\n \"mistral-medium-latest\": { input: 0.4, output: 2 },\n \"mistral-small-latest\": { input: 0.1, output: 0.3 },\n \"pixtral-large-latest\": { input: 2, output: 6 },\n \"pixtral-12b\": { input: 0.15, output: 0.15 },\n \"magistral-medium-latest\": { input: 2, output: 5 },\n \"magistral-small-latest\": { input: 0.5, output: 1.5 },\n \"mistral-embed\": { input: 0.1, output: 0 },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,4BAA4B;CAChC;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,+BAA+B,CAAC,aAAa,eAAe;;;;;;;;;;;;;AAclE,SAAgB,sBAAsB,WAA4B;CAChE,MAAM,aAAa,UAAU,YAAY;CAEzC,OAAO,0BAA0B,MAAM,aAAa,WAAW,SAAS,QAAQ,CAAC;AACnF;;;;;;;;;;;;;AAcA,SAAgB,yBAAyB,WAA4B;CACnE,MAAM,aAAa,UAAU,YAAY;CAEzC,OAAO,6BAA6B,MAAM,aAAa,WAAW,SAAS,QAAQ,CAAC;AACtF;;;;;;;;;;AAWA,MAAa,iBAAiB;;CAE5B,MAAM;EAAC;EAAwB;EAAyB;CAAsB;;CAE9E,QAAQ,CAAC,wBAAwB,aAAa;;CAE9C,WAAW,CAAC,2BAA2B,wBAAwB;;CAE/D,WAAW,CAAC,eAAe;AAC7B;;;;;;;;;;;;;AAcA,MAAa,0BAAwD;CACnE,wBAAwB;EAAE,OAAO;EAAG,QAAQ;CAAE;CAC9C,yBAAyB;EAAE,OAAO;EAAK,QAAQ;CAAE;CACjD,wBAAwB;EAAE,OAAO;EAAK,QAAQ;CAAI;CAClD,wBAAwB;EAAE,OAAO;EAAG,QAAQ;CAAE;CAC9C,eAAe;EAAE,OAAO;EAAM,QAAQ;CAAK;CAC3C,2BAA2B;EAAE,OAAO;EAAG,QAAQ;CAAE;CACjD,0BAA0B;EAAE,OAAO;EAAK,QAAQ;CAAI;CACpD,iBAAiB;EAAE,OAAO;EAAK,QAAQ;CAAE;AAC3C"}
package/esm/sdk.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { MistralModelConfig, MistralSDKConfig } from "./config.type.mjs";
2
2
  import { EmbedderConfig, EmbedderContract, ModelContract, SDKAdapterContract } from "@warlock.js/ai";
3
3
 
4
- //#region ../@warlock.js/ai-mistral/src/sdk.d.ts
4
+ //#region ../ai-mistral/src/sdk.d.ts
5
5
  /**
6
6
  * Mistral-backed implementation of `SDKAdapterContract`.
7
7
  *
package/esm/sdk.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.mts","names":[],"sources":["../../../../../../@warlock.js/ai-mistral/src/sdk.ts"],"mappings":";;;;;;AAmEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0E2D;;;;;;;;;;;;;;cA1E9C,UAAA,YAAsB,kBAAA;;;;;;mBAMhB,MAAA;cAEE,MAAA,EAAQ,gBAAA;;;;;;;;;;;;;;;;;;;EAoCpB,KAAA,CAAM,MAAA,EAAQ,kBAAA,GAAqB,aAAA;;;;;;;EAgB7B,KAAA,CAAM,IAAA,UAAc,KAAA,YAAiB,OAAA;;;;;;;;;;;EAc3C,QAAA,CAAS,MAAA,EAAQ,cAAA,GAAiB,gBAAA;AAAA"}
1
+ {"version":3,"file":"sdk.d.mts","names":[],"sources":["../../../../../../ai-mistral/src/sdk.ts"],"mappings":";;;;;;AAmEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0E2D;;;;;;;;;;;;;;cA1E9C,UAAA,YAAsB,kBAAA;;;;;;mBAMhB,MAAA;cAEE,MAAA,EAAQ,gBAAA;;;;;;;;;;;;;;;;;;;EAoCpB,KAAA,CAAM,MAAA,EAAQ,kBAAA,GAAqB,aAAA;;;;;;;EAgB7B,KAAA,CAAM,IAAA,UAAc,KAAA,YAAiB,OAAA;;;;;;;;;;;EAc3C,QAAA,CAAS,MAAA,EAAQ,cAAA,GAAiB,gBAAA;AAAA"}
package/esm/sdk.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { MISTRAL_DEFAULT_PRICING, inferReasoningCapability, inferVisionCapability } from "./known-models.mjs";
2
2
  import { OpenAISDK } from "@warlock.js/ai-openai";
3
3
 
4
- //#region ../@warlock.js/ai-mistral/src/sdk.ts
4
+ //#region ../ai-mistral/src/sdk.ts
5
5
  /** Default OpenAI-compatible base URL for the Mistral API. */
6
6
  const MISTRAL_BASE_URL = "https://api.mistral.ai/v1";
7
7
  /** Default provider label stamped onto every model this SDK produces. */
package/esm/sdk.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.mjs","names":[],"sources":["../../../../../../@warlock.js/ai-mistral/src/sdk.ts"],"sourcesContent":["import type {\n EmbedderConfig,\n EmbedderContract,\n ModelContract,\n ModelPricing,\n SDKAdapterContract,\n} from \"@warlock.js/ai\";\nimport { OpenAISDK } from \"@warlock.js/ai-openai\";\nimport type { MistralModelConfig, MistralSDKConfig } from \"./config.type\";\nimport {\n inferReasoningCapability,\n inferVisionCapability,\n MISTRAL_DEFAULT_PRICING,\n} from \"./known-models\";\n\n/** Default OpenAI-compatible base URL for the Mistral API. */\nconst MISTRAL_BASE_URL = \"https://api.mistral.ai/v1\";\n\n/** Default provider label stamped onto every model this SDK produces. */\nconst MISTRAL_PROVIDER = \"mistral\";\n\n/**\n * Mistral-backed implementation of `SDKAdapterContract`.\n *\n * **Role.** The package entry point for Mistral AI chat + embeddings.\n * Mistral exposes an **OpenAI-compatible** API (`/v1/chat/completions`,\n * `/v1/embeddings`), so `MistralSDK` is a *thin wrapper* over the\n * battle-tested {@link OpenAISDK} — it does NOT re-implement the wire\n * protocol, streaming loop, tool-call accumulation, structured-output\n * mapping, error wrapping, or token accounting. It constructs one\n * internal `OpenAISDK` pointed at Mistral's `baseURL` with\n * `provider: \"mistral\"`, and delegates `model()` / `embedder()` /\n * `count()` straight to it.\n *\n * **What this wrapper adds on top of the OpenAI adapter:**\n * - **Defaults.** Injects Mistral's `baseURL` + `provider` label and a\n * default {@link MISTRAL_DEFAULT_PRICING} registry so cost truth works\n * out of the box. All are overridable via config.\n * - **Provider-correct capability inference.** Mistral's model names\n * aren't OpenAI names, so the OpenAI prefix lists never match. Before\n * delegating `model()`, this wrapper infers `vision` (the `pixtral`\n * family + recent multimodal generations) and `reasoning` (the\n * `magistral` family + hybrid `mistral-small`) from *this provider's*\n * fragment lists and passes them as explicit overrides — which the\n * inner `OpenAISDK` honors verbatim. A caller-supplied explicit\n * `vision` / `reasoning` still wins.\n *\n * Construct one SDK per account and reuse it everywhere; the single\n * underlying `OpenAI` client (connection pool, auth, rate-limit state)\n * is shared by every model / embedder produced here.\n *\n * **Note — no image generation.** Mistral has no OpenAI-compatible image\n * endpoint, so `image()` is intentionally NOT exposed. The structural\n * absence of the method IS the capability guard (see\n * `SDKAdapterContract.image`): `ai.mistral.image(...)` is a compile-time\n * error rather than a runtime failure.\n *\n * @example\n * const mistral = new MistralSDK({ apiKey: process.env.MISTRAL_API_KEY! });\n * const model = mistral.model({ name: \"mistral-large-latest\", temperature: 0.7 });\n * const embedder = mistral.embedder({ name: \"mistral-embed\" });\n *\n * @example\n * // Compose into an `ai.mistral` namespace for ergonomic agent wiring.\n * const ai = { agent, tool, systemPrompt, mistral: new MistralSDK({ apiKey }) };\n * const reasoner = ai.agent({ model: ai.mistral.model({ name: \"magistral-medium-latest\" }) });\n */\nexport class MistralSDK implements SDKAdapterContract {\n /**\n * The wrapped OpenAI-compatible adapter doing all the real work. Built\n * once in the constructor with Mistral's `baseURL`, `provider` label,\n * and merged pricing registry; every public method delegates to it.\n */\n private readonly openai: OpenAISDK;\n\n public constructor(config: MistralSDKConfig) {\n const { provider, baseURL, pricing, ...clientOptions } = config;\n\n // Caller pricing wins per model id; otherwise fall back to this\n // provider's published-list defaults so cost truth works out of the box.\n const mergedPricing: Record<string, ModelPricing> = {\n ...MISTRAL_DEFAULT_PRICING,\n ...pricing,\n };\n\n this.openai = new OpenAISDK({\n ...clientOptions,\n baseURL: baseURL ?? MISTRAL_BASE_URL,\n provider: provider ?? MISTRAL_PROVIDER,\n pricing: mergedPricing,\n });\n }\n\n /**\n * Build a `ModelContract` for a Mistral chat model.\n *\n * Delegates to the inner `OpenAISDK.model()` but first injects\n * **Mistral-aware capability inference**: when the caller omits\n * `vision` / `reasoning`, they're inferred from this provider's family\n * fragments (`pixtral` → vision, `magistral` / `mistral-small` →\n * reasoning, see `known-models.ts`) and passed down as explicit\n * overrides. Without this step the wrapped OpenAI adapter would check\n * Mistral ids against OpenAI prefixes (`gpt-4o`, `o3`, …) and wrongly\n * report every Mistral model as non-vision / non-reasoning.\n *\n * A caller-supplied explicit `vision` / `reasoning` is preserved as-is\n * (explicit config always wins over inference). Pricing resolution is\n * handled downstream by `OpenAISDK` against the merged registry:\n * per-model `pricing` > SDK registry (caller + Mistral defaults) >\n * `undefined`.\n */\n public model(config: MistralModelConfig): ModelContract {\n const resolvedConfig: MistralModelConfig = {\n ...config,\n vision: config.vision ?? inferVisionCapability(config.name),\n reasoning: config.reasoning ?? inferReasoningCapability(config.name),\n };\n\n return this.openai.model(resolvedConfig);\n }\n\n /**\n * Rough offline token-count estimate. Delegates to the wrapped\n * `OpenAISDK.count()` (the shared character-heuristic from the core\n * package) — good for budgeting / quota guards, not billing. The\n * optional model id is forwarded but currently ignored.\n */\n public async count(text: string, model?: string): Promise<number> {\n return this.openai.count(text, model);\n }\n\n /**\n * Build an `EmbedderContract` bound to this SDK's client. Mistral\n * serves embeddings (`mistral-embed`) through the OpenAI-compatible\n * `/v1/embeddings` endpoint, so this delegates straight to\n * `OpenAISDK.embedder()`.\n *\n * @example\n * const embedder = mistral.embedder({ name: \"mistral-embed\" });\n * const { vector } = await embedder.embed(\"Hello world\");\n */\n public embedder(config: EmbedderConfig): EmbedderContract {\n // `embedder` is optional on the contract but always present on the\n // wrapped OpenAI adapter — assert it for the delegation.\n return this.openai.embedder!(config);\n }\n}\n"],"mappings":";;;;;AAgBA,MAAM,mBAAmB;;AAGzB,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDzB,IAAa,aAAb,MAAsD;CAQpD,AAAO,YAAY,QAA0B;EAC3C,MAAM,EAAE,UAAU,SAAS,SAAS,GAAG,kBAAkB;EAIzD,MAAM,gBAA8C;GAClD,GAAG;GACH,GAAG;EACL;EAEA,KAAK,SAAS,IAAI,UAAU;GAC1B,GAAG;GACH,SAAS,WAAW;GACpB,UAAU,YAAY;GACtB,SAAS;EACX,CAAC;CACH;;;;;;;;;;;;;;;;;;;CAoBA,AAAO,MAAM,QAA2C;EACtD,MAAM,iBAAqC;GACzC,GAAG;GACH,QAAQ,OAAO,UAAU,sBAAsB,OAAO,IAAI;GAC1D,WAAW,OAAO,aAAa,yBAAyB,OAAO,IAAI;EACrE;EAEA,OAAO,KAAK,OAAO,MAAM,cAAc;CACzC;;;;;;;CAQA,MAAa,MAAM,MAAc,OAAiC;EAChE,OAAO,KAAK,OAAO,MAAM,MAAM,KAAK;CACtC;;;;;;;;;;;CAYA,AAAO,SAAS,QAA0C;EAGxD,OAAO,KAAK,OAAO,SAAU,MAAM;CACrC;AACF"}
1
+ {"version":3,"file":"sdk.mjs","names":[],"sources":["../../../../../../ai-mistral/src/sdk.ts"],"sourcesContent":["import type {\n EmbedderConfig,\n EmbedderContract,\n ModelContract,\n ModelPricing,\n SDKAdapterContract,\n} from \"@warlock.js/ai\";\nimport { OpenAISDK } from \"@warlock.js/ai-openai\";\nimport type { MistralModelConfig, MistralSDKConfig } from \"./config.type\";\nimport {\n inferReasoningCapability,\n inferVisionCapability,\n MISTRAL_DEFAULT_PRICING,\n} from \"./known-models\";\n\n/** Default OpenAI-compatible base URL for the Mistral API. */\nconst MISTRAL_BASE_URL = \"https://api.mistral.ai/v1\";\n\n/** Default provider label stamped onto every model this SDK produces. */\nconst MISTRAL_PROVIDER = \"mistral\";\n\n/**\n * Mistral-backed implementation of `SDKAdapterContract`.\n *\n * **Role.** The package entry point for Mistral AI chat + embeddings.\n * Mistral exposes an **OpenAI-compatible** API (`/v1/chat/completions`,\n * `/v1/embeddings`), so `MistralSDK` is a *thin wrapper* over the\n * battle-tested {@link OpenAISDK} — it does NOT re-implement the wire\n * protocol, streaming loop, tool-call accumulation, structured-output\n * mapping, error wrapping, or token accounting. It constructs one\n * internal `OpenAISDK` pointed at Mistral's `baseURL` with\n * `provider: \"mistral\"`, and delegates `model()` / `embedder()` /\n * `count()` straight to it.\n *\n * **What this wrapper adds on top of the OpenAI adapter:**\n * - **Defaults.** Injects Mistral's `baseURL` + `provider` label and a\n * default {@link MISTRAL_DEFAULT_PRICING} registry so cost truth works\n * out of the box. All are overridable via config.\n * - **Provider-correct capability inference.** Mistral's model names\n * aren't OpenAI names, so the OpenAI prefix lists never match. Before\n * delegating `model()`, this wrapper infers `vision` (the `pixtral`\n * family + recent multimodal generations) and `reasoning` (the\n * `magistral` family + hybrid `mistral-small`) from *this provider's*\n * fragment lists and passes them as explicit overrides — which the\n * inner `OpenAISDK` honors verbatim. A caller-supplied explicit\n * `vision` / `reasoning` still wins.\n *\n * Construct one SDK per account and reuse it everywhere; the single\n * underlying `OpenAI` client (connection pool, auth, rate-limit state)\n * is shared by every model / embedder produced here.\n *\n * **Note — no image generation.** Mistral has no OpenAI-compatible image\n * endpoint, so `image()` is intentionally NOT exposed. The structural\n * absence of the method IS the capability guard (see\n * `SDKAdapterContract.image`): `ai.mistral.image(...)` is a compile-time\n * error rather than a runtime failure.\n *\n * @example\n * const mistral = new MistralSDK({ apiKey: process.env.MISTRAL_API_KEY! });\n * const model = mistral.model({ name: \"mistral-large-latest\", temperature: 0.7 });\n * const embedder = mistral.embedder({ name: \"mistral-embed\" });\n *\n * @example\n * // Compose into an `ai.mistral` namespace for ergonomic agent wiring.\n * const ai = { agent, tool, systemPrompt, mistral: new MistralSDK({ apiKey }) };\n * const reasoner = ai.agent({ model: ai.mistral.model({ name: \"magistral-medium-latest\" }) });\n */\nexport class MistralSDK implements SDKAdapterContract {\n /**\n * The wrapped OpenAI-compatible adapter doing all the real work. Built\n * once in the constructor with Mistral's `baseURL`, `provider` label,\n * and merged pricing registry; every public method delegates to it.\n */\n private readonly openai: OpenAISDK;\n\n public constructor(config: MistralSDKConfig) {\n const { provider, baseURL, pricing, ...clientOptions } = config;\n\n // Caller pricing wins per model id; otherwise fall back to this\n // provider's published-list defaults so cost truth works out of the box.\n const mergedPricing: Record<string, ModelPricing> = {\n ...MISTRAL_DEFAULT_PRICING,\n ...pricing,\n };\n\n this.openai = new OpenAISDK({\n ...clientOptions,\n baseURL: baseURL ?? MISTRAL_BASE_URL,\n provider: provider ?? MISTRAL_PROVIDER,\n pricing: mergedPricing,\n });\n }\n\n /**\n * Build a `ModelContract` for a Mistral chat model.\n *\n * Delegates to the inner `OpenAISDK.model()` but first injects\n * **Mistral-aware capability inference**: when the caller omits\n * `vision` / `reasoning`, they're inferred from this provider's family\n * fragments (`pixtral` → vision, `magistral` / `mistral-small` →\n * reasoning, see `known-models.ts`) and passed down as explicit\n * overrides. Without this step the wrapped OpenAI adapter would check\n * Mistral ids against OpenAI prefixes (`gpt-4o`, `o3`, …) and wrongly\n * report every Mistral model as non-vision / non-reasoning.\n *\n * A caller-supplied explicit `vision` / `reasoning` is preserved as-is\n * (explicit config always wins over inference). Pricing resolution is\n * handled downstream by `OpenAISDK` against the merged registry:\n * per-model `pricing` > SDK registry (caller + Mistral defaults) >\n * `undefined`.\n */\n public model(config: MistralModelConfig): ModelContract {\n const resolvedConfig: MistralModelConfig = {\n ...config,\n vision: config.vision ?? inferVisionCapability(config.name),\n reasoning: config.reasoning ?? inferReasoningCapability(config.name),\n };\n\n return this.openai.model(resolvedConfig);\n }\n\n /**\n * Rough offline token-count estimate. Delegates to the wrapped\n * `OpenAISDK.count()` (the shared character-heuristic from the core\n * package) — good for budgeting / quota guards, not billing. The\n * optional model id is forwarded but currently ignored.\n */\n public async count(text: string, model?: string): Promise<number> {\n return this.openai.count(text, model);\n }\n\n /**\n * Build an `EmbedderContract` bound to this SDK's client. Mistral\n * serves embeddings (`mistral-embed`) through the OpenAI-compatible\n * `/v1/embeddings` endpoint, so this delegates straight to\n * `OpenAISDK.embedder()`.\n *\n * @example\n * const embedder = mistral.embedder({ name: \"mistral-embed\" });\n * const { vector } = await embedder.embed(\"Hello world\");\n */\n public embedder(config: EmbedderConfig): EmbedderContract {\n // `embedder` is optional on the contract but always present on the\n // wrapped OpenAI adapter — assert it for the delegation.\n return this.openai.embedder!(config);\n }\n}\n"],"mappings":";;;;;AAgBA,MAAM,mBAAmB;;AAGzB,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDzB,IAAa,aAAb,MAAsD;CAQpD,AAAO,YAAY,QAA0B;EAC3C,MAAM,EAAE,UAAU,SAAS,SAAS,GAAG,kBAAkB;EAIzD,MAAM,gBAA8C;GAClD,GAAG;GACH,GAAG;EACL;EAEA,KAAK,SAAS,IAAI,UAAU;GAC1B,GAAG;GACH,SAAS,WAAW;GACpB,UAAU,YAAY;GACtB,SAAS;EACX,CAAC;CACH;;;;;;;;;;;;;;;;;;;CAoBA,AAAO,MAAM,QAA2C;EACtD,MAAM,iBAAqC;GACzC,GAAG;GACH,QAAQ,OAAO,UAAU,sBAAsB,OAAO,IAAI;GAC1D,WAAW,OAAO,aAAa,yBAAyB,OAAO,IAAI;EACrE;EAEA,OAAO,KAAK,OAAO,MAAM,cAAc;CACzC;;;;;;;CAQA,MAAa,MAAM,MAAc,OAAiC;EAChE,OAAO,KAAK,OAAO,MAAM,MAAM,KAAK;CACtC;;;;;;;;;;;CAYA,AAAO,SAAS,QAA0C;EAGxD,OAAO,KAAK,OAAO,SAAU,MAAM;CACrC;AACF"}
package/package.json CHANGED
@@ -15,13 +15,13 @@
15
15
  "url": "https://github.com/warlockjs/ai-mistral"
16
16
  },
17
17
  "dependencies": {
18
- "@warlock.js/ai-openai": "4.8.2",
19
- "@warlock.js/logger": "4.8.2"
18
+ "@warlock.js/ai-openai": "4.9.1",
19
+ "@warlock.js/logger": "4.9.1"
20
20
  },
21
21
  "peerDependencies": {
22
- "@warlock.js/ai": "4.8.2"
22
+ "@warlock.js/ai": "4.9.1"
23
23
  },
24
- "version": "4.8.2",
24
+ "version": "4.9.1",
25
25
  "main": "./cjs/index.cjs",
26
26
  "module": "./esm/index.mjs",
27
27
  "types": "./esm/index.d.mts",