@jaypie/mcp 0.7.31 → 0.7.33
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/suites/docs/index.js +1 -1
- package/dist/suites/llm/help.md +3 -2
- package/dist/suites/llm/llm.d.ts +2 -1
- package/dist/suites/llm/llm.js +7 -1
- package/dist/suites/llm/llm.js.map +1 -1
- package/package.json +1 -1
- package/release-notes/jaypie/1.2.18.md +9 -0
- package/release-notes/llm/1.2.16.md +15 -0
- package/release-notes/llm/1.2.17.md +16 -0
- package/release-notes/mcp/0.7.32.md +11 -0
- package/release-notes/testkit/1.2.24.md +9 -0
- package/skills/llm.md +4 -2
- package/skills/tools-llm.md +6 -4
|
@@ -9,7 +9,7 @@ import { gt } from 'semver';
|
|
|
9
9
|
/**
|
|
10
10
|
* Docs Suite - Documentation services (skill, version, release_notes)
|
|
11
11
|
*/
|
|
12
|
-
const BUILD_VERSION_STRING = "@jaypie/mcp@0.7.
|
|
12
|
+
const BUILD_VERSION_STRING = "@jaypie/mcp@0.7.33#fc2fb4b9"
|
|
13
13
|
;
|
|
14
14
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
15
15
|
const __dirname$1 = path.dirname(__filename$1);
|
package/dist/suites/llm/help.md
CHANGED
|
@@ -16,13 +16,13 @@ All parameters are passed at the top level (flat structure):
|
|
|
16
16
|
| Parameter | Type | Description |
|
|
17
17
|
|-----------|------|-------------|
|
|
18
18
|
| `command` | string | Command to execute (omit for help) |
|
|
19
|
-
| `provider` | string | LLM provider: anthropic,
|
|
19
|
+
| `provider` | string | LLM provider: anthropic, google, openai, openrouter, xai |
|
|
20
20
|
| `message` | string | Message to send to the LLM provider |
|
|
21
21
|
| `model` | string | Model to use (provider-specific, e.g., gpt-4, claude-3-sonnet) |
|
|
22
22
|
|
|
23
23
|
## Providers
|
|
24
24
|
|
|
25
|
-
Supported providers: `
|
|
25
|
+
Supported providers: `anthropic`, `gemini`, `openai`, `openrouter`, `xai`
|
|
26
26
|
|
|
27
27
|
## Environment Variables
|
|
28
28
|
|
|
@@ -32,6 +32,7 @@ Supported providers: `openai`, `anthropic`, `gemini`, `openrouter`
|
|
|
32
32
|
| `ANTHROPIC_API_KEY` | Anthropic API key |
|
|
33
33
|
| `GOOGLE_API_KEY` or `GEMINI_API_KEY` | Google/Gemini API key |
|
|
34
34
|
| `OPENROUTER_API_KEY` | OpenRouter API key |
|
|
35
|
+
| `XAI_API_KEY` | xAI (Grok) API key |
|
|
35
36
|
|
|
36
37
|
## Examples
|
|
37
38
|
|
package/dist/suites/llm/llm.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LLM debugging utilities for inspecting raw provider responses
|
|
3
3
|
*/
|
|
4
|
-
export type LlmProvider = "anthropic" | "google" | "openai" | "openrouter";
|
|
4
|
+
export type LlmProvider = "anthropic" | "google" | "openai" | "openrouter" | "xai";
|
|
5
5
|
export interface LlmDebugCallParams {
|
|
6
6
|
provider: LlmProvider;
|
|
7
7
|
model?: string;
|
|
@@ -29,6 +29,7 @@ export interface LlmValidationResult {
|
|
|
29
29
|
google: LlmProviderStatus;
|
|
30
30
|
openai: LlmProviderStatus;
|
|
31
31
|
openrouter: LlmProviderStatus;
|
|
32
|
+
xai: LlmProviderStatus;
|
|
32
33
|
};
|
|
33
34
|
availableCount: number;
|
|
34
35
|
totalProviders: number;
|
package/dist/suites/llm/llm.js
CHANGED
|
@@ -18,6 +18,8 @@ function inferProvider(model) {
|
|
|
18
18
|
m.startsWith("o3-") ||
|
|
19
19
|
m.startsWith("o4-"))
|
|
20
20
|
return "openai";
|
|
21
|
+
if (m.startsWith("grok-"))
|
|
22
|
+
return "xai";
|
|
21
23
|
return undefined;
|
|
22
24
|
}
|
|
23
25
|
// Default models for each provider
|
|
@@ -26,8 +28,9 @@ const DEFAULT_MODELS = {
|
|
|
26
28
|
google: LLM.PROVIDER.GEMINI.MODEL.SMALL,
|
|
27
29
|
openai: LLM.PROVIDER.OPENAI.MODEL.SMALL,
|
|
28
30
|
openrouter: LLM.PROVIDER.OPENROUTER.MODEL.SMALL,
|
|
31
|
+
xai: LLM.PROVIDER.XAI.MODEL.SMALL,
|
|
29
32
|
};
|
|
30
|
-
const TOTAL_PROVIDERS =
|
|
33
|
+
const TOTAL_PROVIDERS = 5;
|
|
31
34
|
/**
|
|
32
35
|
* Validate LLM setup without making API calls
|
|
33
36
|
*/
|
|
@@ -36,11 +39,13 @@ function validateLlmSetup() {
|
|
|
36
39
|
const googleAvailable = Boolean(process.env.GOOGLE_API_KEY || process.env.GEMINI_API_KEY);
|
|
37
40
|
const openaiAvailable = Boolean(process.env.OPENAI_API_KEY);
|
|
38
41
|
const openrouterAvailable = Boolean(process.env.OPENROUTER_API_KEY);
|
|
42
|
+
const xaiAvailable = Boolean(process.env.XAI_API_KEY);
|
|
39
43
|
const availableCount = [
|
|
40
44
|
anthropicAvailable,
|
|
41
45
|
googleAvailable,
|
|
42
46
|
openaiAvailable,
|
|
43
47
|
openrouterAvailable,
|
|
48
|
+
xaiAvailable,
|
|
44
49
|
].filter(Boolean).length;
|
|
45
50
|
return {
|
|
46
51
|
availableCount,
|
|
@@ -49,6 +54,7 @@ function validateLlmSetup() {
|
|
|
49
54
|
google: { available: googleAvailable },
|
|
50
55
|
openai: { available: openaiAvailable },
|
|
51
56
|
openrouter: { available: openrouterAvailable },
|
|
57
|
+
xai: { available: xaiAvailable },
|
|
52
58
|
},
|
|
53
59
|
success: availableCount > 0,
|
|
54
60
|
totalProviders: TOTAL_PROVIDERS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm.js","sources":["../../../src/suites/llm/llm.ts"],"sourcesContent":["/**\n * LLM debugging utilities for inspecting raw provider responses\n */\n\nimport { LLM, Llm } from \"@jaypie/llm\";\n\nexport type LlmProvider = \"anthropic\" | \"google\" | \"openai\" | \"openrouter\";\n\nexport interface LlmDebugCallParams {\n provider: LlmProvider;\n model?: string;\n message: string;\n}\n\nexport interface LlmDebugCallResult {\n success: boolean;\n provider: string;\n model: string;\n content?: string;\n reasoning?: string[];\n reasoningTokens?: number;\n history?: unknown[];\n rawResponses?: unknown[];\n usage?: unknown[];\n error?: string;\n}\n\n// Validation types\nexport interface LlmProviderStatus {\n available: boolean;\n}\n\nexport interface LlmValidationResult {\n success: boolean;\n providers: {\n anthropic: LlmProviderStatus;\n google: LlmProviderStatus;\n openai: LlmProviderStatus;\n openrouter: LlmProviderStatus;\n };\n availableCount: number;\n totalProviders: number;\n}\n\ninterface Logger {\n info: (message: string, ...args: unknown[]) => void;\n error: (message: string, ...args: unknown[]) => void;\n}\n\n/**\n * Infer provider from model string prefix\n */\nexport function inferProvider(model: string): LlmProvider | undefined {\n const m = model.toLowerCase();\n if (m.startsWith(\"claude-\")) return \"anthropic\";\n if (m.startsWith(\"gemini-\")) return \"google\";\n if (\n m.startsWith(\"chatgpt-\") ||\n m.startsWith(\"gpt-\") ||\n m.startsWith(\"o1-\") ||\n m.startsWith(\"o3-\") ||\n m.startsWith(\"o4-\")\n )\n return \"openai\";\n return undefined;\n}\n\n// Default models for each provider\nconst DEFAULT_MODELS: Record<LlmProvider, string> = {\n anthropic: LLM.PROVIDER.ANTHROPIC.MODEL.SMALL,\n google: LLM.PROVIDER.GEMINI.MODEL.SMALL,\n openai: LLM.PROVIDER.OPENAI.MODEL.SMALL,\n openrouter: LLM.PROVIDER.OPENROUTER.MODEL.SMALL,\n};\n\nconst TOTAL_PROVIDERS =
|
|
1
|
+
{"version":3,"file":"llm.js","sources":["../../../src/suites/llm/llm.ts"],"sourcesContent":["/**\n * LLM debugging utilities for inspecting raw provider responses\n */\n\nimport { LLM, Llm } from \"@jaypie/llm\";\n\nexport type LlmProvider = \"anthropic\" | \"google\" | \"openai\" | \"openrouter\" | \"xai\";\n\nexport interface LlmDebugCallParams {\n provider: LlmProvider;\n model?: string;\n message: string;\n}\n\nexport interface LlmDebugCallResult {\n success: boolean;\n provider: string;\n model: string;\n content?: string;\n reasoning?: string[];\n reasoningTokens?: number;\n history?: unknown[];\n rawResponses?: unknown[];\n usage?: unknown[];\n error?: string;\n}\n\n// Validation types\nexport interface LlmProviderStatus {\n available: boolean;\n}\n\nexport interface LlmValidationResult {\n success: boolean;\n providers: {\n anthropic: LlmProviderStatus;\n google: LlmProviderStatus;\n openai: LlmProviderStatus;\n openrouter: LlmProviderStatus;\n xai: LlmProviderStatus;\n };\n availableCount: number;\n totalProviders: number;\n}\n\ninterface Logger {\n info: (message: string, ...args: unknown[]) => void;\n error: (message: string, ...args: unknown[]) => void;\n}\n\n/**\n * Infer provider from model string prefix\n */\nexport function inferProvider(model: string): LlmProvider | undefined {\n const m = model.toLowerCase();\n if (m.startsWith(\"claude-\")) return \"anthropic\";\n if (m.startsWith(\"gemini-\")) return \"google\";\n if (\n m.startsWith(\"chatgpt-\") ||\n m.startsWith(\"gpt-\") ||\n m.startsWith(\"o1-\") ||\n m.startsWith(\"o3-\") ||\n m.startsWith(\"o4-\")\n )\n return \"openai\";\n if (m.startsWith(\"grok-\")) return \"xai\";\n return undefined;\n}\n\n// Default models for each provider\nconst DEFAULT_MODELS: Record<LlmProvider, string> = {\n anthropic: LLM.PROVIDER.ANTHROPIC.MODEL.SMALL,\n google: LLM.PROVIDER.GEMINI.MODEL.SMALL,\n openai: LLM.PROVIDER.OPENAI.MODEL.SMALL,\n openrouter: LLM.PROVIDER.OPENROUTER.MODEL.SMALL,\n xai: LLM.PROVIDER.XAI.MODEL.SMALL,\n};\n\nconst TOTAL_PROVIDERS = 5;\n\n/**\n * Validate LLM setup without making API calls\n */\nexport function validateLlmSetup(): LlmValidationResult {\n const anthropicAvailable = Boolean(process.env.ANTHROPIC_API_KEY);\n const googleAvailable = Boolean(\n process.env.GOOGLE_API_KEY || process.env.GEMINI_API_KEY,\n );\n const openaiAvailable = Boolean(process.env.OPENAI_API_KEY);\n const openrouterAvailable = Boolean(process.env.OPENROUTER_API_KEY);\n const xaiAvailable = Boolean(process.env.XAI_API_KEY);\n\n const availableCount = [\n anthropicAvailable,\n googleAvailable,\n openaiAvailable,\n openrouterAvailable,\n xaiAvailable,\n ].filter(Boolean).length;\n\n return {\n availableCount,\n providers: {\n anthropic: { available: anthropicAvailable },\n google: { available: googleAvailable },\n openai: { available: openaiAvailable },\n openrouter: { available: openrouterAvailable },\n xai: { available: xaiAvailable },\n },\n success: availableCount > 0,\n totalProviders: TOTAL_PROVIDERS,\n };\n}\n\n/**\n * Make a debug LLM call and return the raw response data for inspection\n */\nexport async function debugLlmCall(\n params: LlmDebugCallParams,\n log: Logger,\n): Promise<LlmDebugCallResult> {\n const { provider, message } = params;\n const model = params.model || DEFAULT_MODELS[provider];\n\n log.info(`Making debug LLM call to ${provider} with model ${model}`);\n\n try {\n const llm = new Llm(provider, { model });\n\n const result = await llm.operate(message, {\n user: \"[jaypie-mcp] Debug LLM Call\",\n });\n\n if (result.error) {\n return {\n success: false,\n provider,\n model,\n error: `${result.error.title}: ${result.error.detail || \"Unknown error\"}`,\n };\n }\n\n // Calculate total reasoning tokens\n const reasoningTokens = result.usage.reduce(\n (sum, u) => sum + (u.reasoning || 0),\n 0,\n );\n\n return {\n success: true,\n provider,\n model,\n content:\n typeof result.content === \"string\"\n ? result.content\n : JSON.stringify(result.content),\n reasoning: result.reasoning,\n reasoningTokens,\n history: result.history,\n rawResponses: result.responses,\n usage: result.usage,\n };\n } catch (error) {\n log.error(`Error calling ${provider}:`, error);\n return {\n success: false,\n provider,\n model,\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n"],"names":[],"mappings":";;AAAA;;AAEG;AAgDH;;AAEG;AACG,SAAU,aAAa,CAAC,KAAa,EAAA;AACzC,IAAA,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE;AAC7B,IAAA,IAAI,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC;AAAE,QAAA,OAAO,WAAW;AAC/C,IAAA,IAAI,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC;AAAE,QAAA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BAAA,KAAK,EAAE,CAAA,EAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAA,EAAA,EAAK,MAAM,CAAC,KAAK,CAAC,MAAM,IAAI,eAAe,CAAA,CAAE;aAC1E;QACH;;QAGA,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CACzC,CAAC,GAAG,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,EACpC,CAAC,CACF;QAED,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,QAAQ;YACR,KAAK;AACL,YAAA,OAAO,EACL,OAAO,MAAM,CAAC,OAAO,KAAK;kBACtB,MAAM,CAAC;kBACP,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;YACpC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,eAAe;YACf,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,YAAY,EAAE,MAAM,CAAC,SAAS;YAC9B,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB;IACH;IAAE,OAAO,KAAK,EAAE;QACd,GAAG,CAAC,KAAK,CAAC,CAAA,cAAA,EAAiB,QAAQ,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QAC9C,OAAO;AACL,YAAA,OAAO,EAAE,KAAK;YACd,QAAQ;YACR,KAAK;AACL,YAAA,KAAK,EAAE,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;SAC9D;IACH;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 1.2.16
|
|
3
|
+
date: 2026-03-04
|
|
4
|
+
summary: Add first-class xAI (Grok) provider support
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Changes
|
|
8
|
+
|
|
9
|
+
- Add xAI as a first-class LLM provider with full parity (operate, stream, tools, structured output, fallback)
|
|
10
|
+
- XaiAdapter extends OpenAiAdapter (xAI API is OpenAI-compatible)
|
|
11
|
+
- XaiProvider with `XAI_API_KEY` env var and `https://api.x.ai/v1` base URL
|
|
12
|
+
- Models: grok-4-1-fast-reasoning (default/large), grok-3 (small), grok-3-mini (tiny)
|
|
13
|
+
- Provider auto-detection from "grok-" model prefix and "xai" name
|
|
14
|
+
- Add xAI to integration test scripts (structured, document/image)
|
|
15
|
+
- Add xAI to CI/CD workflows (npm-check, npm-deploy)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 1.2.17
|
|
3
|
+
date: 2026-03-11
|
|
4
|
+
summary: Fix streaming tool-call roundtrip for OpenAI and Gemini providers
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# @jaypie/llm 1.2.17
|
|
8
|
+
|
|
9
|
+
## Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **OpenAI streaming tool calls**: Preserve item ID (`fc_` prefix) separately from call ID (`call_` prefix) during streaming tool-call roundtrip. Previously both were set to `call_id`, causing `400 Invalid 'input[2].id'` errors on post-tool turns.
|
|
12
|
+
- **Gemini streaming tool calls**: Preserve `thoughtSignature` field from Gemini 3 model responses through the streaming roundtrip. Previously dropped between turns, causing `Function call is missing a thought_signature` errors.
|
|
13
|
+
|
|
14
|
+
## Details
|
|
15
|
+
|
|
16
|
+
Added optional `metadata` field to `LlmStreamChunkToolCall.toolCall` interface for provider-specific data that must survive the tool-call roundtrip. OpenAI adapter emits `itemId`, Gemini adapter emits `thoughtSignature`, and `StreamLoop` applies both when building history items for the next turn.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 0.7.32
|
|
3
|
+
date: 2026-03-04
|
|
4
|
+
summary: Add xAI provider to LLM tool and documentation
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Changes
|
|
8
|
+
|
|
9
|
+
- Add xAI to LLM tool provider list (validate, debug_call, inferProvider)
|
|
10
|
+
- Update LLM skills and help documentation with xAI provider details
|
|
11
|
+
- Add `XAI_API_KEY` to environment variables documentation
|
package/skills/llm.md
CHANGED
|
@@ -21,10 +21,11 @@ console.log(response.content); // "4"
|
|
|
21
21
|
|
|
22
22
|
| Provider | Match Keywords | Default Model |
|
|
23
23
|
|----------|----------------|---------------|
|
|
24
|
-
| OpenAI | "openai", "gpt", /^o\d/ | gpt-5.
|
|
24
|
+
| OpenAI | "openai", "gpt", /^o\d/ | gpt-5.2 |
|
|
25
25
|
| Anthropic | "anthropic", "claude", "haiku", "opus", "sonnet" | claude-sonnet-4-5 |
|
|
26
26
|
| Google | "google", "gemini" | gemini-3-pro-preview |
|
|
27
27
|
| OpenRouter | "openrouter" | z-ai/glm-4.7 |
|
|
28
|
+
| xAI | "xai", "grok" | grok-4-1-fast-reasoning |
|
|
28
29
|
|
|
29
30
|
```typescript
|
|
30
31
|
// Provider auto-detected from model
|
|
@@ -315,10 +316,11 @@ const review2 = await llm.operate(code2);
|
|
|
315
316
|
## Environment Variables
|
|
316
317
|
|
|
317
318
|
```bash
|
|
318
|
-
OPENAI_API_KEY # Required for OpenAI
|
|
319
319
|
ANTHROPIC_API_KEY # Required for Anthropic
|
|
320
320
|
GOOGLE_API_KEY # Required for Gemini
|
|
321
|
+
OPENAI_API_KEY # Required for OpenAI
|
|
321
322
|
OPENROUTER_API_KEY # Required for OpenRouter
|
|
323
|
+
XAI_API_KEY # Required for xAI (Grok)
|
|
322
324
|
```
|
|
323
325
|
|
|
324
326
|
Keys are resolved via `getEnvSecret()` which supports AWS Secrets Manager.
|
package/skills/tools-llm.md
CHANGED
|
@@ -32,9 +32,9 @@ llm({ command: "validate" })
|
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Returns:
|
|
35
|
-
- `providers` - Status for each provider: anthropic, google, openai, openrouter
|
|
35
|
+
- `providers` - Status for each provider: anthropic, google, openai, openrouter, xai
|
|
36
36
|
- `availableCount` - Number of providers with API keys configured
|
|
37
|
-
- `totalProviders` - Total number of supported providers (
|
|
37
|
+
- `totalProviders` - Total number of supported providers (5)
|
|
38
38
|
- `success` - true if at least one provider is available
|
|
39
39
|
|
|
40
40
|
## Debug Call
|
|
@@ -54,7 +54,7 @@ All parameters are passed at the top level (flat structure):
|
|
|
54
54
|
| Parameter | Type | Description |
|
|
55
55
|
|-----------|------|-------------|
|
|
56
56
|
| `command` | string | Command to execute (omit for help) |
|
|
57
|
-
| `provider` | string | LLM provider: anthropic,
|
|
57
|
+
| `provider` | string | LLM provider: anthropic, google, openai, openrouter, xai |
|
|
58
58
|
| `message` | string | Message to send to the LLM provider |
|
|
59
59
|
| `model` | string | Model to use (provider-specific, e.g., gpt-4, claude-3-sonnet) |
|
|
60
60
|
|
|
@@ -77,15 +77,17 @@ All parameters are passed at the top level (flat structure):
|
|
|
77
77
|
| `ANTHROPIC_API_KEY` | Anthropic API key |
|
|
78
78
|
| `GOOGLE_API_KEY` or `GEMINI_API_KEY` | Google/Gemini API key |
|
|
79
79
|
| `OPENROUTER_API_KEY` | OpenRouter API key |
|
|
80
|
+
| `XAI_API_KEY` | xAI (Grok) API key |
|
|
80
81
|
|
|
81
82
|
## Supported Providers
|
|
82
83
|
|
|
83
84
|
| Provider | Models |
|
|
84
85
|
|----------|--------|
|
|
85
|
-
| `openai` | gpt-4o, gpt-4o-mini, o1, o3-mini, etc. |
|
|
86
86
|
| `anthropic` | claude-sonnet-4-20250514, claude-opus-4-20250514, etc. |
|
|
87
87
|
| `gemini` | gemini-2.0-flash, gemini-1.5-pro, etc. |
|
|
88
|
+
| `openai` | gpt-4o, gpt-4o-mini, o1, o3-mini, etc. |
|
|
88
89
|
| `openrouter` | Access to multiple providers |
|
|
90
|
+
| `xai` | grok-4-1-fast-reasoning, grok-3, grok-3-mini |
|
|
89
91
|
|
|
90
92
|
## Common Patterns
|
|
91
93
|
|