@kenkaiiii/gg-ai 5.18.0 → 5.19.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/dist/index.cjs +15 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
3
|
import OpenAI from 'openai';
|
|
4
4
|
|
|
5
|
-
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "sakana" | "palsu";
|
|
5
|
+
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "sakana" | "xai" | "palsu";
|
|
6
6
|
type ThinkingLevel = "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
7
7
|
type CacheRetention = "none" | "short" | "long";
|
|
8
8
|
interface TextContent {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
3
|
import OpenAI from 'openai';
|
|
4
4
|
|
|
5
|
-
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "sakana" | "palsu";
|
|
5
|
+
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "sakana" | "xai" | "palsu";
|
|
6
6
|
type ThinkingLevel = "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
7
7
|
type CacheRetention = "none" | "short" | "long";
|
|
8
8
|
interface TextContent {
|
package/dist/index.js
CHANGED
|
@@ -58,12 +58,14 @@ var PROVIDER_DISPLAY = {
|
|
|
58
58
|
deepseek: "DeepSeek",
|
|
59
59
|
openrouter: "OpenRouter",
|
|
60
60
|
sakana: "Sakana",
|
|
61
|
+
xai: "xAI (Grok)",
|
|
61
62
|
xiaomi: "Xiaomi (MiMo)",
|
|
62
63
|
minimax: "MiniMax"
|
|
63
64
|
};
|
|
64
65
|
var PROVIDER_STATUS_URL = {
|
|
65
66
|
openai: "status.openai.com",
|
|
66
|
-
anthropic: "status.anthropic.com"
|
|
67
|
+
anthropic: "status.anthropic.com",
|
|
68
|
+
xai: "status.x.ai"
|
|
67
69
|
};
|
|
68
70
|
function providerDisplayName(provider) {
|
|
69
71
|
return PROVIDER_DISPLAY[provider] ?? provider;
|
|
@@ -3351,6 +3353,18 @@ providerRegistry.register("sakana", {
|
|
|
3351
3353
|
baseUrl: options.baseUrl ?? "https://api.sakana.ai/v1"
|
|
3352
3354
|
})
|
|
3353
3355
|
});
|
|
3356
|
+
providerRegistry.register("xai", {
|
|
3357
|
+
// xAI's public API (console.x.ai key) is OpenAI-compatible — ride the Chat
|
|
3358
|
+
// Completions transport like Moonshot/DeepSeek. Grok reasoning models take
|
|
3359
|
+
// top-level `reasoning_effort` (low/medium/high), which the shared thinking
|
|
3360
|
+
// path already sends. xAI's OAuth path exists but only via the Grok CLI's
|
|
3361
|
+
// private Responses proxy (cli-chat-proxy.grok.com) with reverse-engineered
|
|
3362
|
+
// attribution headers and account-tier gating — intentionally not wired.
|
|
3363
|
+
stream: (options) => streamOpenAI({
|
|
3364
|
+
...options,
|
|
3365
|
+
baseUrl: options.baseUrl ?? "https://api.x.ai/v1"
|
|
3366
|
+
})
|
|
3367
|
+
});
|
|
3354
3368
|
providerRegistry.register("minimax", {
|
|
3355
3369
|
stream: (options) => streamAnthropic({
|
|
3356
3370
|
...options,
|