@arnilo/prism-provider-xai 0.3.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1] - 2026-08-29
4
+
5
+ ### Changed
6
+ - Plan 037 provider parity and caching closeouts (additive model/adapter surface, shared canonical tool-parameters and bounded JSON-schema canonicalization); plan 035+ runtime additions carried by the changed-package cut.
7
+
3
8
  ## [0.2.8] - 2026-08-19
4
9
 
5
10
  ### Added
package/dist/models.js CHANGED
@@ -1,4 +1,4 @@
1
- import { redactSecrets, resolveCredentialValue } from "@arnilo/prism";
1
+ import { redactSecrets, resolveCredentialValue, trimTrailingSlashes, } from "@arnilo/prism";
2
2
  import { readBoundedResponseJson, readBoundedResponseText } from "@arnilo/prism/providers/transport";
3
3
  export const XAI_DEFAULT_BASE_URL = "https://api.x.ai/v1";
4
4
  const FEATURED = {
@@ -37,7 +37,7 @@ export function defineXaiModel(config) {
37
37
  /** Caller-gated `GET {base}/models`. Never invoked by `createXaiProviderPackage`. */
38
38
  export async function listXaiModels(options = {}) {
39
39
  const provider = options.provider ?? "xai";
40
- const baseUrl = (options.baseUrl ?? XAI_DEFAULT_BASE_URL).replace(/\/+$/, "");
40
+ const baseUrl = trimTrailingSlashes(options.baseUrl ?? XAI_DEFAULT_BASE_URL);
41
41
  const token = await resolveCredentialValue(options.apiKey, { provider, name: "apiKey" });
42
42
  const response = await (options.fetch ?? fetch)(`${baseUrl}/models`, {
43
43
  method: "GET",
package/dist/provider.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { trimTrailingSlashes } from "@arnilo/prism";
1
2
  import { applyOpenAIChatStructuredOutput, serializeOpenAIChatMessage } from "@arnilo/prism/providers/openai";
2
3
  import { buildOpenAIChatBody, createOpenAICompatibleProvider, openAIChatEvents } from "@arnilo/prism/providers/openai-compatible";
3
4
  import { xGrokConvId } from "./cache.js";
@@ -7,7 +8,7 @@ export { XAI_DEFAULT_BASE_URL };
7
8
  export function createXaiProvider(options = {}) {
8
9
  return createOpenAICompatibleProvider({
9
10
  id: options.id ?? "xai",
10
- baseUrl: (options.baseUrl ?? XAI_DEFAULT_BASE_URL).replace(/\/+$/, ""),
11
+ baseUrl: trimTrailingSlashes(options.baseUrl ?? XAI_DEFAULT_BASE_URL),
11
12
  apiKey: options.apiKey,
12
13
  fetch: options.fetch,
13
14
  doneUsage: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arnilo/prism-provider-xai",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "xAI (Grok) provider package for Prism.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "pack:dry-run": "npm pack --dry-run"
26
26
  },
27
27
  "peerDependencies": {
28
- "@arnilo/prism": "^0.3.0"
28
+ "@arnilo/prism": "^0.3.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@arnilo/prism": "file:../.."