@warlock.js/ai-xai 5.34.1 → 5.34.3
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 +6 -0
- package/llms-full.txt +8 -8
- package/llms.txt +1 -1
- package/package.json +4 -4
- package/skills/{setup-xai/SKILL.md → SKILL.md} +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@warlock.js/ai-xai` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
6
|
|
|
7
|
+
## 5.34.3 - 2026-10-20
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- The agent skill now exports as `warlock-js-ai-xai`; package discovery descriptions stay within 450 characters.
|
|
12
|
+
|
|
7
13
|
## 5.32.0 - 2026-10-18
|
|
8
14
|
|
|
9
15
|
### Changed
|
package/llms-full.txt
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
> Generated artifact. Concatenates every SKILL.md and reference file under `@warlock.js/ai-xai/skills/`. Re-run `node scripts/generate-llms.mjs` after any change.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## ai-xai `@warlock.js/ai-xai/skills/SKILL.md`
|
|
8
8
|
|
|
9
9
|
---
|
|
10
|
-
name:
|
|
11
|
-
description: '
|
|
10
|
+
name: warlock-js-ai-xai
|
|
11
|
+
description: 'xAI Grok adapter for Warlock AI: `XaiSDK`, `XAI_CHAT_MODELS`, `inferVisionCapability`, `inferReasoningCapability` and `XaiModelConfig`. Use for "connect Grok", streaming, tools, vision, reasoning, model capabilities or pricing overrides through `sdk.model()`. Not this package → @warlock.js/ai for agents, tools and workflows; @warlock.js/ai-openai for generic OpenAI-compatible endpoints.'
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
# `@warlock.js/ai-xai`
|
|
15
15
|
|
|
16
|
-
Provider adapter for xAI's **Grok** models. xAI speaks the OpenAI Chat Completions protocol, so `XaiSDK` is a **thin wrapper** over `OpenAISDK` (the `
|
|
16
|
+
Provider adapter for xAI's **Grok** models. xAI speaks the OpenAI Chat Completions protocol, so `XaiSDK` is a **thin wrapper** over `OpenAISDK` (the `warlock-js-ai-openai` skill) — it does not reimplement the wire layer. It constructs one internal `OpenAISDK` pointed at xAI's `baseURL` and labeled `provider: "xai"`, then delegates `model()` / `embedder()` / `image()` / `count()`, injecting xAI's own capability inference so Grok model names resolve correctly. Pair with `@warlock.js/ai` for the agent / tool / system-prompt surface.
|
|
17
17
|
|
|
18
18
|
## Construction
|
|
19
19
|
|
|
@@ -55,7 +55,7 @@ This adapter ships xAI's OWN name lists (Grok ids don't match OpenAI's `gpt-*` /
|
|
|
55
55
|
|
|
56
56
|
- `vision` — inferred `true` for the `grok-4` and `grok-2-vision` prefixes; `false` otherwise.
|
|
57
57
|
- `reasoning` — inferred `true` for `grok-4` and `grok-3-mini`; drives whether `reasoning.effort` is forwarded as `reasoning_effort` on the wire.
|
|
58
|
-
- `structuredOutput` / `promptCaching` and the image/PDF/audio wire mapping all come from the wrapped OpenAI adapter unchanged — see the `
|
|
58
|
+
- `structuredOutput` / `promptCaching` and the image/PDF/audio wire mapping all come from the wrapped OpenAI adapter unchanged — see the `warlock-js-ai-openai` skill.
|
|
59
59
|
|
|
60
60
|
**Override `vision`, `reasoning`, or `structuredOutput` explicitly** via `.model({ name, vision?, reasoning?, structuredOutput? })`.
|
|
61
61
|
|
|
@@ -72,11 +72,11 @@ await model.complete(messages, { reasoning: { effort: "high" } }); // → reason
|
|
|
72
72
|
|
|
73
73
|
## Multipart messages (image input)
|
|
74
74
|
|
|
75
|
-
Image attachments reach the wire only on a vision-capable model (`grok-4`, `grok-2-vision`); the agent's modality gate throws otherwise. Mapping to OpenAI `image_url` parts is identical to the OpenAI adapter — see the `
|
|
75
|
+
Image attachments reach the wire only on a vision-capable model (`grok-4`, `grok-2-vision`); the agent's modality gate throws otherwise. Mapping to OpenAI `image_url` parts is identical to the OpenAI adapter — see the `warlock-js-ai-openai` skill.
|
|
76
76
|
|
|
77
77
|
## Uses the OpenAI-compatible endpoint
|
|
78
78
|
|
|
79
|
-
All wire work — request/response mapping, streaming, tool-call accumulation, structured output, usage extraction — is the wrapped `OpenAISDK`'s, unchanged. The wrapper only: (1) sets the xAI `baseURL` + `provider` defaults, and (2) injects xAI's vision/reasoning inference per model. For streaming, structured output, and the full multipart surface, read the `
|
|
79
|
+
All wire work — request/response mapping, streaming, tool-call accumulation, structured output, usage extraction — is the wrapped `OpenAISDK`'s, unchanged. The wrapper only: (1) sets the xAI `baseURL` + `provider` defaults, and (2) injects xAI's vision/reasoning inference per model. For streaming, structured output, and the full multipart surface, read the `warlock-js-ai-openai` skill.
|
|
80
80
|
|
|
81
81
|
## Embeddings — not available on xAI
|
|
82
82
|
|
|
@@ -136,7 +136,7 @@ Raw xAI / OpenAI-SDK errors are wrapped into the typed `@warlock.js/ai` `AIError
|
|
|
136
136
|
|
|
137
137
|
## See also
|
|
138
138
|
|
|
139
|
-
- The `
|
|
139
|
+
- The `warlock-js-ai-openai` skill — the wrapped adapter; full wire / streaming / structured-output / multipart surface
|
|
140
140
|
- The `run-ai-agent` topic of the `warlock-js-ai` skill — passing the model into `ai.agent({...})`
|
|
141
141
|
- The `pick-ai-provider` topic of the `warlock-js-ai` skill — adapter comparison
|
|
142
142
|
|
package/llms.txt
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
|
|
7
7
|
## Skills
|
|
8
8
|
|
|
9
|
-
- [
|
|
9
|
+
- [ai-xai](@warlock.js/ai-xai/skills/SKILL.md): xAI Grok adapter for Warlock AI: `XaiSDK`, `XAI_CHAT_MODELS`, `inferVisionCapability`, `inferReasoningCapability` and `XaiModelConfig`. Use for "connect Grok", streaming, tools, vision, reasoning, model capabilities or pricing overrides through `sdk.model()`. Not this package → @warlock.js/ai for agents, tools and workflows; @warlock.js/ai-openai for generic OpenAI-compatible endpoints.
|
package/package.json
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"directory": "packages/ai-xai"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@warlock.js/ai-openai": "5.34.
|
|
19
|
-
"@warlock.js/logger": "5.34.
|
|
18
|
+
"@warlock.js/ai-openai": "5.34.3",
|
|
19
|
+
"@warlock.js/logger": "5.34.3"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@warlock.js/ai": "5.34.
|
|
22
|
+
"@warlock.js/ai": "5.34.3"
|
|
23
23
|
},
|
|
24
|
-
"version": "5.34.
|
|
24
|
+
"version": "5.34.3",
|
|
25
25
|
"main": "./cjs/index.cjs",
|
|
26
26
|
"module": "./esm/index.mjs",
|
|
27
27
|
"types": "./esm/index.d.mts",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: '
|
|
2
|
+
name: warlock-js-ai-xai
|
|
3
|
+
description: 'xAI Grok adapter for Warlock AI: `XaiSDK`, `XAI_CHAT_MODELS`, `inferVisionCapability`, `inferReasoningCapability` and `XaiModelConfig`. Use for "connect Grok", streaming, tools, vision, reasoning, model capabilities or pricing overrides through `sdk.model()`. Not this package → @warlock.js/ai for agents, tools and workflows; @warlock.js/ai-openai for generic OpenAI-compatible endpoints.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# `@warlock.js/ai-xai`
|
|
7
7
|
|
|
8
|
-
Provider adapter for xAI's **Grok** models. xAI speaks the OpenAI Chat Completions protocol, so `XaiSDK` is a **thin wrapper** over `OpenAISDK` (the `
|
|
8
|
+
Provider adapter for xAI's **Grok** models. xAI speaks the OpenAI Chat Completions protocol, so `XaiSDK` is a **thin wrapper** over `OpenAISDK` (the `warlock-js-ai-openai` skill) — it does not reimplement the wire layer. It constructs one internal `OpenAISDK` pointed at xAI's `baseURL` and labeled `provider: "xai"`, then delegates `model()` / `embedder()` / `image()` / `count()`, injecting xAI's own capability inference so Grok model names resolve correctly. Pair with `@warlock.js/ai` for the agent / tool / system-prompt surface.
|
|
9
9
|
|
|
10
10
|
## Construction
|
|
11
11
|
|
|
@@ -47,7 +47,7 @@ This adapter ships xAI's OWN name lists (Grok ids don't match OpenAI's `gpt-*` /
|
|
|
47
47
|
|
|
48
48
|
- `vision` — inferred `true` for the `grok-4` and `grok-2-vision` prefixes; `false` otherwise.
|
|
49
49
|
- `reasoning` — inferred `true` for `grok-4` and `grok-3-mini`; drives whether `reasoning.effort` is forwarded as `reasoning_effort` on the wire.
|
|
50
|
-
- `structuredOutput` / `promptCaching` and the image/PDF/audio wire mapping all come from the wrapped OpenAI adapter unchanged — see the `
|
|
50
|
+
- `structuredOutput` / `promptCaching` and the image/PDF/audio wire mapping all come from the wrapped OpenAI adapter unchanged — see the `warlock-js-ai-openai` skill.
|
|
51
51
|
|
|
52
52
|
**Override `vision`, `reasoning`, or `structuredOutput` explicitly** via `.model({ name, vision?, reasoning?, structuredOutput? })`.
|
|
53
53
|
|
|
@@ -64,11 +64,11 @@ await model.complete(messages, { reasoning: { effort: "high" } }); // → reason
|
|
|
64
64
|
|
|
65
65
|
## Multipart messages (image input)
|
|
66
66
|
|
|
67
|
-
Image attachments reach the wire only on a vision-capable model (`grok-4`, `grok-2-vision`); the agent's modality gate throws otherwise. Mapping to OpenAI `image_url` parts is identical to the OpenAI adapter — see the `
|
|
67
|
+
Image attachments reach the wire only on a vision-capable model (`grok-4`, `grok-2-vision`); the agent's modality gate throws otherwise. Mapping to OpenAI `image_url` parts is identical to the OpenAI adapter — see the `warlock-js-ai-openai` skill.
|
|
68
68
|
|
|
69
69
|
## Uses the OpenAI-compatible endpoint
|
|
70
70
|
|
|
71
|
-
All wire work — request/response mapping, streaming, tool-call accumulation, structured output, usage extraction — is the wrapped `OpenAISDK`'s, unchanged. The wrapper only: (1) sets the xAI `baseURL` + `provider` defaults, and (2) injects xAI's vision/reasoning inference per model. For streaming, structured output, and the full multipart surface, read the `
|
|
71
|
+
All wire work — request/response mapping, streaming, tool-call accumulation, structured output, usage extraction — is the wrapped `OpenAISDK`'s, unchanged. The wrapper only: (1) sets the xAI `baseURL` + `provider` defaults, and (2) injects xAI's vision/reasoning inference per model. For streaming, structured output, and the full multipart surface, read the `warlock-js-ai-openai` skill.
|
|
72
72
|
|
|
73
73
|
## Embeddings — not available on xAI
|
|
74
74
|
|
|
@@ -128,7 +128,7 @@ Raw xAI / OpenAI-SDK errors are wrapped into the typed `@warlock.js/ai` `AIError
|
|
|
128
128
|
|
|
129
129
|
## See also
|
|
130
130
|
|
|
131
|
-
- The `
|
|
131
|
+
- The `warlock-js-ai-openai` skill — the wrapped adapter; full wire / streaming / structured-output / multipart surface
|
|
132
132
|
- The `run-ai-agent` topic of the `warlock-js-ai` skill — passing the model into `ai.agent({...})`
|
|
133
133
|
- The `pick-ai-provider` topic of the `warlock-js-ai` skill — adapter comparison
|
|
134
134
|
|