@elizaos/plugin-xai 2.0.0-alpha.6 → 2.0.3-beta.5
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/LICENSE +21 -0
- package/README.md +43 -21
- package/auto-enable.ts +17 -0
- package/package.json +44 -102
- package/registry-entry.json +75 -0
- package/dist/actions/post.d.ts +0 -3
- package/dist/actions/post.d.ts.map +0 -1
- package/dist/base.d.ts +0 -55
- package/dist/base.d.ts.map +0 -1
- package/dist/browser/index.browser.js +0 -4
- package/dist/browser/index.browser.js.map +0 -11
- package/dist/browser/index.d.ts +0 -2
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.node.cjs +0 -11197
- package/dist/cjs/index.node.js.map +0 -116
- package/dist/client/api-types.d.ts +0 -28
- package/dist/client/api-types.d.ts.map +0 -1
- package/dist/client/auth-providers/broker.d.ts +0 -19
- package/dist/client/auth-providers/broker.d.ts.map +0 -1
- package/dist/client/auth-providers/env.d.ts +0 -20
- package/dist/client/auth-providers/env.d.ts.map +0 -1
- package/dist/client/auth-providers/factory.d.ts +0 -5
- package/dist/client/auth-providers/factory.d.ts.map +0 -1
- package/dist/client/auth-providers/interactive.d.ts +0 -7
- package/dist/client/auth-providers/interactive.d.ts.map +0 -1
- package/dist/client/auth-providers/oauth2-pkce.d.ts +0 -24
- package/dist/client/auth-providers/oauth2-pkce.d.ts.map +0 -1
- package/dist/client/auth-providers/pkce.d.ts +0 -5
- package/dist/client/auth-providers/pkce.d.ts.map +0 -1
- package/dist/client/auth-providers/token-store.d.ts +0 -31
- package/dist/client/auth-providers/token-store.d.ts.map +0 -1
- package/dist/client/auth-providers/types.d.ts +0 -35
- package/dist/client/auth-providers/types.d.ts.map +0 -1
- package/dist/client/auth.d.ts +0 -38
- package/dist/client/auth.d.ts.map +0 -1
- package/dist/client/client.d.ts +0 -462
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/errors.d.ts +0 -72
- package/dist/client/errors.d.ts.map +0 -1
- package/dist/client/index.d.ts +0 -21
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/posts.d.ts +0 -325
- package/dist/client/posts.d.ts.map +0 -1
- package/dist/client/profile.d.ts +0 -140
- package/dist/client/profile.d.ts.map +0 -1
- package/dist/client/relationships.d.ts +0 -47
- package/dist/client/relationships.d.ts.map +0 -1
- package/dist/client/search.d.ts +0 -48
- package/dist/client/search.d.ts.map +0 -1
- package/dist/client/types.d.ts +0 -24
- package/dist/client/types.d.ts.map +0 -1
- package/dist/constants.d.ts +0 -5
- package/dist/constants.d.ts.map +0 -1
- package/dist/discovery.d.ts +0 -37
- package/dist/discovery.d.ts.map +0 -1
- package/dist/environment.d.ts +0 -40
- package/dist/environment.d.ts.map +0 -1
- package/dist/generated/prompts/typescript/prompts.d.ts +0 -22
- package/dist/generated/prompts/typescript/prompts.d.ts.map +0 -1
- package/dist/generated/specs/spec-helpers.d.ts +0 -49
- package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
- package/dist/generated/specs/specs.d.ts +0 -65
- package/dist/generated/specs/specs.d.ts.map +0 -1
- package/dist/index.browser.d.ts +0 -6
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +0 -1
- package/dist/index.node.d.ts +0 -3
- package/dist/index.node.d.ts.map +0 -1
- package/dist/interactions.d.ts +0 -129
- package/dist/interactions.d.ts.map +0 -1
- package/dist/models/grok.d.ts +0 -7
- package/dist/models/grok.d.ts.map +0 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.node.js +0 -11212
- package/dist/node/index.node.js.map +0 -116
- package/dist/post.d.ts +0 -43
- package/dist/post.d.ts.map +0 -1
- package/dist/services/x.service.d.ts +0 -23
- package/dist/services/x.service.d.ts.map +0 -1
- package/dist/templates.d.ts +0 -6
- package/dist/templates.d.ts.map +0 -1
- package/dist/timeline.d.ts +0 -46
- package/dist/timeline.d.ts.map +0 -1
- package/dist/types.d.ts +0 -150
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -20
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/memory.d.ts +0 -21
- package/dist/utils/memory.d.ts.map +0 -1
- package/dist/utils/settings.d.ts +0 -3
- package/dist/utils/settings.d.ts.map +0 -1
- package/dist/utils/time.d.ts +0 -2
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -36
- package/dist/utils.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,47 +1,69 @@
|
|
|
1
|
-
# @elizaos/plugin-xai
|
|
1
|
+
# @elizaos/plugin-xai
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
xAI Grok models for elizaOS — text generation and embeddings.
|
|
4
|
+
|
|
5
|
+
Registers Grok as the `TEXT_SMALL`, `TEXT_LARGE`, and `TEXT_EMBEDDING` model
|
|
6
|
+
handlers in an Eliza agent runtime. The plugin is **auto-enabled** when
|
|
7
|
+
`XAI_API_KEY` (or the alias `GROK_API_KEY`) is present. It adds no actions,
|
|
8
|
+
providers, or services — purely model handlers.
|
|
9
|
+
|
|
10
|
+
For X (formerly Twitter) social posting, mentions, and timeline interactions,
|
|
11
|
+
use [`@elizaos/plugin-x`](../plugin-x) instead. This package is
|
|
12
|
+
intentionally Grok-only.
|
|
4
13
|
|
|
5
14
|
## Installation
|
|
6
15
|
|
|
7
16
|
```bash
|
|
8
|
-
|
|
17
|
+
bun add @elizaos/plugin-xai
|
|
9
18
|
```
|
|
10
19
|
|
|
20
|
+
## Capabilities
|
|
21
|
+
|
|
22
|
+
| Capability | Model type registered | Default model |
|
|
23
|
+
| ---------------- | --------------------- | --------------- |
|
|
24
|
+
| Text (large) | `TEXT_LARGE` | `grok-3` |
|
|
25
|
+
| Text (small) | `TEXT_SMALL` | `grok-3-mini` |
|
|
26
|
+
| Embeddings | `TEXT_EMBEDDING` | `grok-embedding`|
|
|
27
|
+
|
|
28
|
+
Streaming (`stream: true` + `onStreamChunk`) is supported for both text model
|
|
29
|
+
types. Tool calling (`tools`, `toolChoice`) and structured output
|
|
30
|
+
(`responseSchema`) are handled natively via the xAI OpenAI-compatible API.
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
Set `XAI_API_KEY` and (optionally) override the defaults:
|
|
35
|
+
|
|
36
|
+
| Variable | Default | Description |
|
|
37
|
+
| --------------------- | --------------------- | ------------------------------------------------ |
|
|
38
|
+
| `XAI_API_KEY` | — | **Required.** xAI API key. |
|
|
39
|
+
| `GROK_API_KEY` | — | Alias recognized by auto-enable only; runtime model calls require `XAI_API_KEY`. |
|
|
40
|
+
| `XAI_MODEL` | `grok-3` | Large/default text model. Also accepts `XAI_LARGE_MODEL`. |
|
|
41
|
+
| `XAI_SMALL_MODEL` | `grok-3-mini` | Smaller/faster text model. |
|
|
42
|
+
| `XAI_EMBEDDING_MODEL` | `grok-embedding` | Embedding model. |
|
|
43
|
+
| `XAI_BASE_URL` | `https://api.x.ai/v1` | API base URL (useful for proxies or local mocks).|
|
|
44
|
+
|
|
11
45
|
## Usage
|
|
12
46
|
|
|
13
47
|
```typescript
|
|
14
48
|
import { XAIPlugin } from "@elizaos/plugin-xai";
|
|
15
49
|
import { AgentRuntime, ModelType } from "@elizaos/core";
|
|
16
50
|
|
|
17
|
-
// Register plugin
|
|
18
51
|
const runtime = new AgentRuntime({
|
|
19
52
|
plugins: [XAIPlugin],
|
|
20
53
|
});
|
|
21
54
|
|
|
22
|
-
// Use Grok models
|
|
23
55
|
const text = await runtime.useModel(ModelType.TEXT_SMALL, {
|
|
24
56
|
prompt: "Explain quantum computing",
|
|
25
57
|
});
|
|
26
|
-
|
|
27
|
-
// Use X service
|
|
28
|
-
const xService = runtime.getService("x") as XService;
|
|
29
|
-
const profile = await xService.xClient.client.xClient.me();
|
|
30
|
-
console.log(`@${profile.username}`);
|
|
31
58
|
```
|
|
32
59
|
|
|
60
|
+
The plugin is auto-enabled when `XAI_API_KEY` is set in the environment, so
|
|
61
|
+
explicit registration in `plugins` is only required when auto-enable is bypassed.
|
|
62
|
+
|
|
33
63
|
## Development
|
|
34
64
|
|
|
35
65
|
```bash
|
|
36
|
-
|
|
37
|
-
bun run
|
|
38
|
-
|
|
39
|
-
# Test
|
|
40
|
-
npx vitest
|
|
41
|
-
|
|
42
|
-
# Lint
|
|
43
|
-
bun run lint
|
|
44
|
-
|
|
45
|
-
# Type check
|
|
46
|
-
bun run typecheck
|
|
66
|
+
bun run --cwd plugins/plugin-xai build
|
|
67
|
+
bun run --cwd plugins/plugin-xai test
|
|
68
|
+
bun run --cwd plugins/plugin-xai typecheck
|
|
47
69
|
```
|
package/auto-enable.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Auto-enable check for @elizaos/plugin-xai.
|
|
2
|
+
//
|
|
3
|
+
// Plugin manifest entry-point — referenced by package.json's
|
|
4
|
+
// `elizaos.plugin.autoEnableModule`. Keep this module light: env reads only,
|
|
5
|
+
// no service init, no transitive imports of the full plugin runtime. The
|
|
6
|
+
// auto-enable engine loads dozens of these per boot.
|
|
7
|
+
import type { PluginAutoEnableContext } from "@elizaos/core";
|
|
8
|
+
|
|
9
|
+
const ENV_KEYS = ["XAI_API_KEY", "GROK_API_KEY"] as const;
|
|
10
|
+
|
|
11
|
+
/** Enable when an xAI / Grok API key is present. */
|
|
12
|
+
export function shouldEnable(ctx: PluginAutoEnableContext): boolean {
|
|
13
|
+
return ENV_KEYS.some((k) => {
|
|
14
|
+
const v = ctx.env[k];
|
|
15
|
+
return typeof v === "string" && v.trim() !== "";
|
|
16
|
+
});
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-xai",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "2.0.3-beta.5",
|
|
4
|
+
"description": "elizaOS xAI plugin: Grok models for text generation and embeddings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/node/index.node.js",
|
|
7
7
|
"module": "dist/node/index.node.js",
|
|
@@ -32,37 +32,62 @@
|
|
|
32
32
|
},
|
|
33
33
|
"require": "./dist/cjs/index.node.cjs",
|
|
34
34
|
"default": "./dist/node/index.node.js"
|
|
35
|
+
},
|
|
36
|
+
"./*.css": "./dist/*.css",
|
|
37
|
+
"./*": {
|
|
38
|
+
"types": "./dist/*.d.ts",
|
|
39
|
+
"import": "./dist/*.js",
|
|
40
|
+
"default": "./dist/*.js"
|
|
35
41
|
}
|
|
36
42
|
},
|
|
37
43
|
"files": [
|
|
38
|
-
"
|
|
44
|
+
"registry-entry.json",
|
|
45
|
+
"dist",
|
|
46
|
+
"auto-enable.ts"
|
|
47
|
+
],
|
|
48
|
+
"elizaos": {
|
|
49
|
+
"plugin": {
|
|
50
|
+
"autoEnableModule": "./auto-enable.ts",
|
|
51
|
+
"capabilities": [
|
|
52
|
+
"text-large",
|
|
53
|
+
"text-small",
|
|
54
|
+
"tool-use",
|
|
55
|
+
"embedding"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"keywords": [
|
|
60
|
+
"elizaos",
|
|
61
|
+
"plugin",
|
|
62
|
+
"xai",
|
|
63
|
+
"grok",
|
|
64
|
+
"ai-provider"
|
|
39
65
|
],
|
|
40
|
-
"keywords": [],
|
|
41
66
|
"author": "elizaOS",
|
|
42
67
|
"license": "MIT",
|
|
43
68
|
"scripts": {
|
|
44
69
|
"build": "bun run build.ts",
|
|
45
70
|
"build:ts": "bun run build.ts",
|
|
46
71
|
"dev": "bun --hot build.ts",
|
|
47
|
-
"clean": "rm
|
|
48
|
-
"test": "vitest run
|
|
49
|
-
"typecheck": "
|
|
50
|
-
"lint": "
|
|
72
|
+
"clean": "node ../../packages/scripts/rm-path-recursive.mjs dist .turbo",
|
|
73
|
+
"test": "vitest run",
|
|
74
|
+
"typecheck": "tsgo --noEmit",
|
|
75
|
+
"lint": "bunx @biomejs/biome check .",
|
|
51
76
|
"lint:check": "bun run lint",
|
|
52
77
|
"format": "bunx @biomejs/biome format --write .",
|
|
53
78
|
"format:check": "bunx @biomejs/biome format ."
|
|
54
79
|
},
|
|
55
80
|
"dependencies": {
|
|
56
|
-
"@elizaos/core": "2.0.
|
|
57
|
-
"twitter-api-v2": "^1.28.0"
|
|
81
|
+
"@elizaos/core": "2.0.3-beta.5"
|
|
58
82
|
},
|
|
59
83
|
"devDependencies": {
|
|
60
|
-
"@biomejs/biome": "^2.
|
|
84
|
+
"@biomejs/biome": "^2.4.14",
|
|
61
85
|
"@types/node": "^25.0.3",
|
|
62
|
-
"typescript": "^
|
|
86
|
+
"typescript": "^6.0.3",
|
|
87
|
+
"vitest": "^4.0.0"
|
|
63
88
|
},
|
|
64
89
|
"peerDependencies": {
|
|
65
|
-
"@elizaos/core": "2.0.
|
|
90
|
+
"@elizaos/core": "2.0.3-beta.5"
|
|
66
91
|
},
|
|
67
92
|
"publishConfig": {
|
|
68
93
|
"access": "public"
|
|
@@ -72,20 +97,20 @@
|
|
|
72
97
|
"pluginParameters": {
|
|
73
98
|
"XAI_API_KEY": {
|
|
74
99
|
"type": "string",
|
|
75
|
-
"description": "xAI API key for Grok model access
|
|
100
|
+
"description": "xAI API key for Grok model access.",
|
|
76
101
|
"required": true,
|
|
77
102
|
"sensitive": true
|
|
78
103
|
},
|
|
79
104
|
"XAI_MODEL": {
|
|
80
105
|
"type": "string",
|
|
81
|
-
"description": "xAI Grok model for text generation (
|
|
106
|
+
"description": "xAI Grok model for large/default text generation (e.g. grok-3).",
|
|
82
107
|
"required": false,
|
|
83
108
|
"default": "grok-3",
|
|
84
109
|
"sensitive": false
|
|
85
110
|
},
|
|
86
111
|
"XAI_SMALL_MODEL": {
|
|
87
112
|
"type": "string",
|
|
88
|
-
"description": "xAI Grok model for faster/smaller tasks.",
|
|
113
|
+
"description": "xAI Grok model for faster/smaller tasks (e.g. grok-3-mini).",
|
|
89
114
|
"required": false,
|
|
90
115
|
"default": "grok-3-mini",
|
|
91
116
|
"sensitive": false
|
|
@@ -103,94 +128,10 @@
|
|
|
103
128
|
"required": false,
|
|
104
129
|
"default": "https://api.x.ai/v1",
|
|
105
130
|
"sensitive": false
|
|
106
|
-
},
|
|
107
|
-
"X_AUTH_MODE": {
|
|
108
|
-
"type": "string",
|
|
109
|
-
"description": "X (formerly Twitter) auth mode: 'env' (API keys), 'oauth' (OAuth2 PKCE), or 'bearer'.",
|
|
110
|
-
"required": false,
|
|
111
|
-
"default": "env",
|
|
112
|
-
"sensitive": false
|
|
113
|
-
},
|
|
114
|
-
"X_API_KEY": {
|
|
115
|
-
"type": "string",
|
|
116
|
-
"description": "X (formerly Twitter) API key for OAuth 1.0a.",
|
|
117
|
-
"required": false,
|
|
118
|
-
"sensitive": true
|
|
119
|
-
},
|
|
120
|
-
"X_API_SECRET": {
|
|
121
|
-
"type": "string",
|
|
122
|
-
"description": "X (formerly Twitter) API secret key for OAuth 1.0a.",
|
|
123
|
-
"required": false,
|
|
124
|
-
"sensitive": true
|
|
125
|
-
},
|
|
126
|
-
"X_ACCESS_TOKEN": {
|
|
127
|
-
"type": "string",
|
|
128
|
-
"description": "X (formerly Twitter) access token for OAuth 1.0a.",
|
|
129
|
-
"required": false,
|
|
130
|
-
"sensitive": true
|
|
131
|
-
},
|
|
132
|
-
"X_ACCESS_TOKEN_SECRET": {
|
|
133
|
-
"type": "string",
|
|
134
|
-
"description": "X (formerly Twitter) access token secret for OAuth 1.0a.",
|
|
135
|
-
"required": false,
|
|
136
|
-
"sensitive": true
|
|
137
|
-
},
|
|
138
|
-
"X_BEARER_TOKEN": {
|
|
139
|
-
"type": "string",
|
|
140
|
-
"description": "X (formerly Twitter) Bearer token for app-only authentication.",
|
|
141
|
-
"required": false,
|
|
142
|
-
"sensitive": true
|
|
143
|
-
},
|
|
144
|
-
"X_CLIENT_ID": {
|
|
145
|
-
"type": "string",
|
|
146
|
-
"description": "X (formerly Twitter) OAuth2 client ID.",
|
|
147
|
-
"required": false,
|
|
148
|
-
"sensitive": false
|
|
149
|
-
},
|
|
150
|
-
"X_REDIRECT_URI": {
|
|
151
|
-
"type": "string",
|
|
152
|
-
"description": "OAuth2 redirect URI.",
|
|
153
|
-
"required": false,
|
|
154
|
-
"sensitive": false
|
|
155
|
-
},
|
|
156
|
-
"X_DRY_RUN": {
|
|
157
|
-
"type": "boolean",
|
|
158
|
-
"description": "When true, all X actions are simulated.",
|
|
159
|
-
"required": false,
|
|
160
|
-
"default": false,
|
|
161
|
-
"sensitive": false
|
|
162
|
-
},
|
|
163
|
-
"X_ENABLE_POST": {
|
|
164
|
-
"type": "boolean",
|
|
165
|
-
"description": "Enable autonomous posting.",
|
|
166
|
-
"required": false,
|
|
167
|
-
"default": false,
|
|
168
|
-
"sensitive": false
|
|
169
|
-
},
|
|
170
|
-
"X_ENABLE_REPLIES": {
|
|
171
|
-
"type": "boolean",
|
|
172
|
-
"description": "Enable reply handling.",
|
|
173
|
-
"required": false,
|
|
174
|
-
"default": true,
|
|
175
|
-
"sensitive": false
|
|
176
|
-
},
|
|
177
|
-
"X_ENABLE_ACTIONS": {
|
|
178
|
-
"type": "boolean",
|
|
179
|
-
"description": "Enable timeline actions (like, repost).",
|
|
180
|
-
"required": false,
|
|
181
|
-
"default": false,
|
|
182
|
-
"sensitive": false
|
|
183
|
-
},
|
|
184
|
-
"X_MAX_POST_LENGTH": {
|
|
185
|
-
"type": "number",
|
|
186
|
-
"description": "Maximum post length (up to 4000 for premium).",
|
|
187
|
-
"required": false,
|
|
188
|
-
"default": 280,
|
|
189
|
-
"sensitive": false
|
|
190
131
|
}
|
|
191
132
|
}
|
|
192
133
|
},
|
|
193
|
-
"
|
|
134
|
+
"eliza": {
|
|
194
135
|
"platforms": [
|
|
195
136
|
"browser",
|
|
196
137
|
"node"
|
|
@@ -200,5 +141,6 @@
|
|
|
200
141
|
"browser": "Browser-compatible build available via exports.browser",
|
|
201
142
|
"node": "Node.js build available via exports.node"
|
|
202
143
|
}
|
|
203
|
-
}
|
|
144
|
+
},
|
|
145
|
+
"gitHead": "ff6157011c9459670021cc28a6797592a78b8817"
|
|
204
146
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "xai",
|
|
3
|
+
"name": "xAI (Grok)",
|
|
4
|
+
"description": "xAI Grok models for text generation and embeddings.",
|
|
5
|
+
"npmName": "@elizaos/plugin-xai",
|
|
6
|
+
"version": "2.0.0-beta.0",
|
|
7
|
+
"source": "bundled",
|
|
8
|
+
"tags": ["ai-provider", "llm", "xai", "grok"],
|
|
9
|
+
"config": {
|
|
10
|
+
"XAI_API_KEY": {
|
|
11
|
+
"type": "secret",
|
|
12
|
+
"required": true,
|
|
13
|
+
"sensitive": true,
|
|
14
|
+
"label": "API Key",
|
|
15
|
+
"help": "xAI API key for Grok model access.",
|
|
16
|
+
"advanced": false
|
|
17
|
+
},
|
|
18
|
+
"XAI_MODEL": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"required": false,
|
|
21
|
+
"sensitive": false,
|
|
22
|
+
"default": "grok-3",
|
|
23
|
+
"label": "Model",
|
|
24
|
+
"help": "xAI Grok model for large/default text generation (e.g. grok-3).",
|
|
25
|
+
"placeholder": "e.g., grok-3",
|
|
26
|
+
"advanced": false
|
|
27
|
+
},
|
|
28
|
+
"XAI_SMALL_MODEL": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"required": false,
|
|
31
|
+
"sensitive": false,
|
|
32
|
+
"default": "grok-3-mini",
|
|
33
|
+
"label": "Small Model",
|
|
34
|
+
"help": "xAI Grok model for faster/smaller tasks.",
|
|
35
|
+
"placeholder": "e.g., grok-3-mini",
|
|
36
|
+
"advanced": false
|
|
37
|
+
},
|
|
38
|
+
"XAI_EMBEDDING_MODEL": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"required": false,
|
|
41
|
+
"sensitive": false,
|
|
42
|
+
"default": "grok-embedding",
|
|
43
|
+
"label": "Embedding Model",
|
|
44
|
+
"help": "xAI model for text embeddings.",
|
|
45
|
+
"placeholder": "e.g., grok-embedding",
|
|
46
|
+
"advanced": true
|
|
47
|
+
},
|
|
48
|
+
"XAI_BASE_URL": {
|
|
49
|
+
"type": "url",
|
|
50
|
+
"required": false,
|
|
51
|
+
"sensitive": false,
|
|
52
|
+
"default": "https://api.x.ai/v1",
|
|
53
|
+
"label": "Base URL",
|
|
54
|
+
"help": "xAI API base URL.",
|
|
55
|
+
"advanced": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"render": {
|
|
59
|
+
"visible": true,
|
|
60
|
+
"pinTo": [],
|
|
61
|
+
"style": "card",
|
|
62
|
+
"icon": "Hash",
|
|
63
|
+
"group": "ai-provider",
|
|
64
|
+
"groupOrder": 0,
|
|
65
|
+
"actions": ["enable", "configure"]
|
|
66
|
+
},
|
|
67
|
+
"resources": {
|
|
68
|
+
"homepage": "https://github.com/elizaos-plugins/plugin-xai#readme",
|
|
69
|
+
"repository": "https://github.com/elizaos-plugins/plugin-xai",
|
|
70
|
+
"setupGuideUrl": "https://docs.eliza.ai/plugin-setup-guide#xai-grok"
|
|
71
|
+
},
|
|
72
|
+
"dependsOn": [],
|
|
73
|
+
"kind": "plugin",
|
|
74
|
+
"subtype": "ai-provider"
|
|
75
|
+
}
|
package/dist/actions/post.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../actions/post.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAUZ,MAAM,eAAe,CAAC;AAOvB,eAAO,MAAM,UAAU,EAAE,MAwJxB,CAAC"}
|
package/dist/base.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { type IAgentRuntime, type Memory, type State } from "@elizaos/core";
|
|
2
|
-
import { Client, type Post, type QueryPostsResponse, SearchMode } from "./client/index";
|
|
3
|
-
import type { XInteractionPayload } from "./types";
|
|
4
|
-
export declare function extractAnswer(text: string): string;
|
|
5
|
-
type XProfile = {
|
|
6
|
-
id: string;
|
|
7
|
-
username: string;
|
|
8
|
-
screenName: string;
|
|
9
|
-
bio: string;
|
|
10
|
-
nicknames: string[];
|
|
11
|
-
};
|
|
12
|
-
declare class RequestQueue {
|
|
13
|
-
private queue;
|
|
14
|
-
private processing;
|
|
15
|
-
private maxRetries;
|
|
16
|
-
private retryAttempts;
|
|
17
|
-
add<T>(request: () => Promise<T>): Promise<T>;
|
|
18
|
-
private processQueue;
|
|
19
|
-
private exponentialBackoff;
|
|
20
|
-
private randomDelay;
|
|
21
|
-
}
|
|
22
|
-
export declare class ClientBase {
|
|
23
|
-
static _xClients: {
|
|
24
|
-
[accountIdentifier: string]: Client;
|
|
25
|
-
};
|
|
26
|
-
xClient: Client;
|
|
27
|
-
runtime: IAgentRuntime;
|
|
28
|
-
lastCheckedPostId: bigint | null;
|
|
29
|
-
temperature: number;
|
|
30
|
-
requestQueue: RequestQueue;
|
|
31
|
-
profile: XProfile | null;
|
|
32
|
-
cachePost(post: Post): Promise<void>;
|
|
33
|
-
getCachedPost(postId: string): Promise<Post | undefined>;
|
|
34
|
-
getPost(postId: string): Promise<Post>;
|
|
35
|
-
callback: ((self: ClientBase) => void) | null;
|
|
36
|
-
onReady(): void;
|
|
37
|
-
state: Record<string, unknown>;
|
|
38
|
-
constructor(runtime: IAgentRuntime, state: Record<string, unknown>);
|
|
39
|
-
init(): Promise<void>;
|
|
40
|
-
fetchOwnPosts(count: number): Promise<Post[]>;
|
|
41
|
-
fetchHomeTimeline(count: number, following?: boolean): Promise<Post[]>;
|
|
42
|
-
fetchSearchPosts(query: string, maxPosts: number, searchMode: SearchMode, cursor?: string): Promise<QueryPostsResponse>;
|
|
43
|
-
private populateTimeline;
|
|
44
|
-
saveRequestMessage(message: Memory, state: State): Promise<void>;
|
|
45
|
-
loadLatestCheckedPostId(): Promise<void>;
|
|
46
|
-
cacheLatestCheckedPostId(): Promise<void>;
|
|
47
|
-
getCachedTimeline(): Promise<Post[] | undefined>;
|
|
48
|
-
cacheTimeline(timeline: Post[]): Promise<void>;
|
|
49
|
-
cacheMentions(mentions: Post[]): Promise<void>;
|
|
50
|
-
fetchProfile(username: string): Promise<XProfile>;
|
|
51
|
-
fetchInteractions(): Promise<(XInteractionPayload | null)[]>;
|
|
52
|
-
formatPostToInteraction(post: Post): XInteractionPayload | null;
|
|
53
|
-
}
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=base.d.ts.map
|
package/dist/base.d.ts.map
DELETED
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@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{logger as T,ModelType as u}from"@elizaos/core";import{logger as c}from"@elizaos/core";var S="https://api.x.ai/v1",g={small:"grok-3-mini",large:"grok-3",embedding:"grok-embedding"};function m(t){let n=t.getSetting("XAI_API_KEY");if(!n||typeof n!=="string")throw Error("XAI_API_KEY is required");let e=t.getSetting("XAI_BASE_URL"),o=t.getSetting("XAI_SMALL_MODEL"),r=t.getSetting("XAI_MODEL")||t.getSetting("XAI_LARGE_MODEL"),s=t.getSetting("XAI_EMBEDDING_MODEL");return{apiKey:n,baseUrl:typeof e==="string"?e:S,smallModel:typeof o==="string"?o:g.small,largeModel:typeof r==="string"?r:g.large,embeddingModel:typeof s==="string"?s:g.embedding}}function l(t){return{Authorization:`Bearer ${t.apiKey}`,"Content-Type":"application/json"}}async function w(t,n,e){let o=[];o.push({role:"user",content:e.prompt});let r={model:n,messages:o};if(e.temperature!==void 0)r.temperature=e.temperature;if(e.maxTokens!==void 0)r.max_tokens=e.maxTokens;if(e.stopSequences)r.stop=e.stopSequences;if(e.stream&&e.onStreamChunk){r.stream=!0;let i=await fetch(`${t.baseUrl}/chat/completions`,{method:"POST",headers:l(t),body:JSON.stringify(r)});if(!i.ok){let a=await i.text();throw Error(`Grok API error (${i.status}): ${a}`)}let p=i.body?.getReader();if(!p)throw Error("No response body");let I=new TextDecoder,b="";while(!0){let{done:a,value:M}=await p.read();if(a)break;let P=I.decode(M).split(`
|
|
2
|
-
`);for(let h of P){if(!h.startsWith("data: "))continue;let x=h.slice(6);if(x==="[DONE]")continue;let d=JSON.parse(x).choices[0].delta?.content;if(d)b+=d,e.onStreamChunk(d)}}return b}let s=await fetch(`${t.baseUrl}/chat/completions`,{method:"POST",headers:l(t),body:JSON.stringify(r)});if(!s.ok){let i=await s.text();throw Error(`Grok API error (${s.status}): ${i}`)}let f=await s.json();if(!f.choices?.[0]?.message?.content)throw Error("No content in Grok response");return f.choices[0].message.content}async function _(t,n){let e=await fetch(`${t.baseUrl}/embeddings`,{method:"POST",headers:l(t),body:JSON.stringify({model:t.embeddingModel,input:n})});if(!e.ok){let r=await e.text();throw Error(`Grok Embedding API error (${e.status}): ${r}`)}let o=await e.json();if(!o.data?.[0]?.embedding)throw Error("No embedding in Grok response");return o.data[0].embedding}async function A(t,n){let e=m(t);return c.debug(`[Grok] Generating text with model: ${e.smallModel}`),w(e,e.smallModel,n)}async function k(t,n){let e=m(t);return c.debug(`[Grok] Generating text with model: ${e.largeModel}`),w(e,e.largeModel,n)}async function E(t,n){if(n===null)throw Error("Null params provided for embedding");let e=m(t),o=typeof n==="string"?n:n.text;if(!o)throw Error("Empty text provided for embedding");return c.debug(`[Grok] Creating embedding with model: ${e.embeddingModel}`),_(e,o)}function y(t){return!!t.getSetting("XAI_API_KEY")}var G={name:"xai",description:"xAI Grok models (browser-safe, no X actions/services)",init:async(t,n)=>{if(T.log("Initializing xAI browser plugin..."),y(n))T.log("✓ Grok API configured")},models:{[u.TEXT_SMALL]:A,[u.TEXT_LARGE]:k,[u.TEXT_EMBEDDING]:E}},N=G;export{N as default,G as XAIPlugin};
|
|
3
|
-
|
|
4
|
-
//# debugId=1F17873EF79E345F64756E2164756E21
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../index.browser.ts", "../../models/grok.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { IAgentRuntime, Plugin } from \"@elizaos/core\";\nimport { logger, ModelType } from \"@elizaos/core\";\nimport {\n handleTextEmbedding,\n handleTextLarge,\n handleTextSmall,\n isGrokConfigured,\n} from \"./models/grok\";\n\nexport type { TwitterConfig } from \"./environment\";\nexport type { ActionResponse, IXClient, MediaData, Post } from \"./types\";\n\nexport const XAIPlugin: Plugin = {\n name: \"xai\",\n description: \"xAI Grok models (browser-safe, no X actions/services)\",\n\n init: async (_config: Record<string, string>, runtime: IAgentRuntime) => {\n logger.log(\"Initializing xAI browser plugin...\");\n if (isGrokConfigured(runtime)) {\n logger.log(\"✓ Grok API configured\");\n }\n },\n\n models: {\n [ModelType.TEXT_SMALL]: handleTextSmall,\n [ModelType.TEXT_LARGE]: handleTextLarge,\n [ModelType.TEXT_EMBEDDING]: handleTextEmbedding,\n },\n};\n\nexport default XAIPlugin;\n",
|
|
6
|
-
"import {\n type GenerateTextParams,\n type IAgentRuntime,\n logger,\n type TextEmbeddingParams,\n type TextStreamResult,\n} from \"@elizaos/core\";\n\nconst XAI_API_BASE = \"https://api.x.ai/v1\";\n\nconst DEFAULT_MODELS = {\n small: \"grok-3-mini\",\n large: \"grok-3\",\n embedding: \"grok-embedding\",\n} as const;\n\ninterface GrokConfig {\n apiKey: string;\n baseUrl: string;\n smallModel: string;\n largeModel: string;\n embeddingModel: string;\n}\n\nfunction getConfig(runtime: IAgentRuntime): GrokConfig {\n const apiKey = runtime.getSetting(\"XAI_API_KEY\");\n if (!apiKey || typeof apiKey !== \"string\") {\n throw new Error(\"XAI_API_KEY is required\");\n }\n\n const baseUrl = runtime.getSetting(\"XAI_BASE_URL\");\n const smallModel = runtime.getSetting(\"XAI_SMALL_MODEL\");\n const largeModel = runtime.getSetting(\"XAI_MODEL\") || runtime.getSetting(\"XAI_LARGE_MODEL\");\n const embeddingModel = runtime.getSetting(\"XAI_EMBEDDING_MODEL\");\n\n return {\n apiKey,\n baseUrl: typeof baseUrl === \"string\" ? baseUrl : XAI_API_BASE,\n smallModel: typeof smallModel === \"string\" ? smallModel : DEFAULT_MODELS.small,\n largeModel: typeof largeModel === \"string\" ? largeModel : DEFAULT_MODELS.large,\n embeddingModel: typeof embeddingModel === \"string\" ? embeddingModel : DEFAULT_MODELS.embedding,\n };\n}\n\nfunction getAuthHeader(config: GrokConfig): Record<string, string> {\n return {\n Authorization: `Bearer ${config.apiKey}`,\n \"Content-Type\": \"application/json\",\n };\n}\n\ninterface ChatMessage {\n role: \"system\" | \"user\" | \"assistant\";\n content: string;\n}\n\ninterface ChatCompletionResponse {\n id: string;\n object: string;\n created: number;\n model: string;\n choices: Array<{\n index: number;\n message: {\n role: string;\n content: string;\n };\n finish_reason: string;\n }>;\n usage: {\n prompt_tokens: number;\n completion_tokens: number;\n total_tokens: number;\n };\n}\n\ninterface EmbeddingResponse {\n object: string;\n data: Array<{\n object: string;\n embedding: number[];\n index: number;\n }>;\n model: string;\n usage: {\n prompt_tokens: number;\n total_tokens: number;\n };\n}\n\nasync function generateText(\n config: GrokConfig,\n model: string,\n params: GenerateTextParams\n): Promise<string | TextStreamResult> {\n const messages: ChatMessage[] = [];\n messages.push({ role: \"user\", content: params.prompt });\n\n const body: Record<string, unknown> = {\n model,\n messages,\n };\n\n if (params.temperature !== undefined) {\n body.temperature = params.temperature;\n }\n if (params.maxTokens !== undefined) {\n body.max_tokens = params.maxTokens;\n }\n if (params.stopSequences) {\n body.stop = params.stopSequences;\n }\n\n if (params.stream && params.onStreamChunk) {\n body.stream = true;\n\n const response = await fetch(`${config.baseUrl}/chat/completions`, {\n method: \"POST\",\n headers: getAuthHeader(config),\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`Grok API error (${response.status}): ${error}`);\n }\n\n const reader = response.body?.getReader();\n if (!reader) {\n throw new Error(\"No response body\");\n }\n\n const decoder = new TextDecoder();\n let fullText = \"\";\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n const chunk = decoder.decode(value);\n const lines = chunk.split(\"\\n\");\n\n for (const line of lines) {\n if (!line.startsWith(\"data: \")) continue;\n const data = line.slice(6);\n if (data === \"[DONE]\") continue;\n\n const parsed = JSON.parse(data);\n const content = parsed.choices[0].delta?.content;\n if (content) {\n fullText += content;\n params.onStreamChunk(content);\n }\n }\n }\n\n return fullText;\n }\n\n const response = await fetch(`${config.baseUrl}/chat/completions`, {\n method: \"POST\",\n headers: getAuthHeader(config),\n body: JSON.stringify(body),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`Grok API error (${response.status}): ${error}`);\n }\n\n const data = (await response.json()) as ChatCompletionResponse;\n\n if (!data.choices?.[0]?.message?.content) {\n throw new Error(\"No content in Grok response\");\n }\n\n return data.choices[0].message.content;\n}\n\nasync function createEmbedding(config: GrokConfig, text: string): Promise<number[]> {\n const response = await fetch(`${config.baseUrl}/embeddings`, {\n method: \"POST\",\n headers: getAuthHeader(config),\n body: JSON.stringify({\n model: config.embeddingModel,\n input: text,\n }),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`Grok Embedding API error (${response.status}): ${error}`);\n }\n\n const data = (await response.json()) as EmbeddingResponse;\n\n if (!data.data?.[0]?.embedding) {\n throw new Error(\"No embedding in Grok response\");\n }\n\n return data.data[0].embedding;\n}\n\nexport async function handleTextSmall(\n runtime: IAgentRuntime,\n params: GenerateTextParams\n): Promise<string | TextStreamResult> {\n const config = getConfig(runtime);\n logger.debug(`[Grok] Generating text with model: ${config.smallModel}`);\n return generateText(config, config.smallModel, params);\n}\n\nexport async function handleTextLarge(\n runtime: IAgentRuntime,\n params: GenerateTextParams\n): Promise<string | TextStreamResult> {\n const config = getConfig(runtime);\n logger.debug(`[Grok] Generating text with model: ${config.largeModel}`);\n return generateText(config, config.largeModel, params);\n}\n\nexport async function handleTextEmbedding(\n runtime: IAgentRuntime,\n params: TextEmbeddingParams | string | null\n): Promise<number[]> {\n if (params === null) {\n throw new Error(\"Null params provided for embedding\");\n }\n const config = getConfig(runtime);\n const text = typeof params === \"string\" ? params : (params as TextEmbeddingParams).text;\n if (!text) {\n throw new Error(\"Empty text provided for embedding\");\n }\n logger.debug(`[Grok] Creating embedding with model: ${config.embeddingModel}`);\n return createEmbedding(config, text);\n}\n\nexport async function listModels(runtime: IAgentRuntime): Promise<Record<string, unknown>[]> {\n const config = getConfig(runtime);\n\n const response = await fetch(`${config.baseUrl}/models`, {\n headers: getAuthHeader(config),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`Grok API error (${response.status}): ${error}`);\n }\n\n const data = (await response.json()) as { data: Record<string, unknown>[] };\n return data.data;\n}\n\nexport function isGrokConfigured(runtime: IAgentRuntime): boolean {\n return !!runtime.getSetting(\"XAI_API_KEY\");\n}\n"
|
|
7
|
-
],
|
|
8
|
-
"mappings": "AACA,iBAAS,eAAQ,sBCDjB,iBAGE,sBAKF,IAAM,EAAe,sBAEf,EAAiB,CACrB,MAAO,cACP,MAAO,SACP,UAAW,gBACb,EAUA,SAAS,CAAS,CAAC,EAAoC,CACrD,IAAM,EAAS,EAAQ,WAAW,aAAa,EAC/C,GAAI,CAAC,GAAU,OAAO,IAAW,SAC/B,MAAU,MAAM,yBAAyB,EAG3C,IAAM,EAAU,EAAQ,WAAW,cAAc,EAC3C,EAAa,EAAQ,WAAW,iBAAiB,EACjD,EAAa,EAAQ,WAAW,WAAW,GAAK,EAAQ,WAAW,iBAAiB,EACpF,EAAiB,EAAQ,WAAW,qBAAqB,EAE/D,MAAO,CACL,SACA,QAAS,OAAO,IAAY,SAAW,EAAU,EACjD,WAAY,OAAO,IAAe,SAAW,EAAa,EAAe,MACzE,WAAY,OAAO,IAAe,SAAW,EAAa,EAAe,MACzE,eAAgB,OAAO,IAAmB,SAAW,EAAiB,EAAe,SACvF,EAGF,SAAS,CAAa,CAAC,EAA4C,CACjE,MAAO,CACL,cAAe,UAAU,EAAO,SAChC,eAAgB,kBAClB,EA0CF,eAAe,CAAY,CACzB,EACA,EACA,EACoC,CACpC,IAAM,EAA0B,CAAC,EACjC,EAAS,KAAK,CAAE,KAAM,OAAQ,QAAS,EAAO,MAAO,CAAC,EAEtD,IAAM,EAAgC,CACpC,QACA,UACF,EAEA,GAAI,EAAO,cAAgB,OACzB,EAAK,YAAc,EAAO,YAE5B,GAAI,EAAO,YAAc,OACvB,EAAK,WAAa,EAAO,UAE3B,GAAI,EAAO,cACT,EAAK,KAAO,EAAO,cAGrB,GAAI,EAAO,QAAU,EAAO,cAAe,CACzC,EAAK,OAAS,GAEd,IAAM,EAAW,MAAM,MAAM,GAAG,EAAO,2BAA4B,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