@elizaos/plugin-x 2.0.0-beta.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/LICENSE +21 -0
- package/README.md +536 -0
- package/auto-enable.ts +30 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +12756 -0
- package/dist/index.js.map +1 -0
- package/package.json +394 -0
package/package.json
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elizaos/plugin-x",
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
|
+
"description": "elizaOS X (formerly Twitter) connector: posting, mentions, replies, DMs, and timeline interactions.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"auto-enable.ts"
|
|
20
|
+
],
|
|
21
|
+
"elizaos": {
|
|
22
|
+
"plugin": {
|
|
23
|
+
"autoEnableModule": "./auto-enable.ts",
|
|
24
|
+
"capabilities": [
|
|
25
|
+
"messaging",
|
|
26
|
+
"social-posting"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"headers-polyfill": "^5.0.0",
|
|
32
|
+
"json-stable-stringify": "^1.3.0",
|
|
33
|
+
"twitter-api-v2": "^1.23.2"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@biomejs/biome": "^2.4.14",
|
|
37
|
+
"@types/node": "^22.19.17",
|
|
38
|
+
"@vitest/coverage-v8": "^4.0.0",
|
|
39
|
+
"dotenv": "^17.2.3",
|
|
40
|
+
"tsup": "^8.5.1",
|
|
41
|
+
"typescript": "^6.0.3",
|
|
42
|
+
"vitest": "^4.0.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"dev": "tsup --watch",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:coverage": "vitest run --coverage",
|
|
49
|
+
"lint": "bunx @biomejs/biome check --write --unsafe .",
|
|
50
|
+
"lint:check": "bunx @biomejs/biome check .",
|
|
51
|
+
"typecheck": "echo \"Typecheck skipped for release\"",
|
|
52
|
+
"clean": "rm -rf dist .turbo .turbo-tsconfig.json tsconfig.tsbuildinfo",
|
|
53
|
+
"format": "bunx @biomejs/biome format --write .",
|
|
54
|
+
"format:check": "bunx @biomejs/biome format ."
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"access": "public"
|
|
58
|
+
},
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "git+https://github.com/elizaos-plugins/plugin-x.git"
|
|
62
|
+
},
|
|
63
|
+
"keywords": [
|
|
64
|
+
"elizaos",
|
|
65
|
+
"plugin",
|
|
66
|
+
"x",
|
|
67
|
+
"twitter",
|
|
68
|
+
"social",
|
|
69
|
+
"connector"
|
|
70
|
+
],
|
|
71
|
+
"agentConfig": {
|
|
72
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
73
|
+
"pluginParameters": {
|
|
74
|
+
"TWITTER_AUTH_MODE": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "Auth mode: 'env' (static keys/tokens) or 'oauth' (3-legged OAuth2 PKCE).",
|
|
77
|
+
"required": false,
|
|
78
|
+
"default": "env",
|
|
79
|
+
"sensitive": false
|
|
80
|
+
},
|
|
81
|
+
"TWITTER_ACCOUNT_ID": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"description": "Account ID for the default X account when connector account routing is enabled.",
|
|
84
|
+
"required": false,
|
|
85
|
+
"default": "default",
|
|
86
|
+
"sensitive": false
|
|
87
|
+
},
|
|
88
|
+
"TWITTER_DEFAULT_ACCOUNT_ID": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"description": "Default X account ID used when a target/content does not specify accountId.",
|
|
91
|
+
"required": false,
|
|
92
|
+
"default": "default",
|
|
93
|
+
"sensitive": false
|
|
94
|
+
},
|
|
95
|
+
"TWITTER_ACCOUNTS": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "Optional JSON object/array of account-scoped X credentials for multi-account pilots.",
|
|
98
|
+
"required": false,
|
|
99
|
+
"sensitive": true
|
|
100
|
+
},
|
|
101
|
+
"TWITTER_API_KEY": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "Twitter API key (required for TWITTER_AUTH_MODE=env).",
|
|
104
|
+
"required": false,
|
|
105
|
+
"sensitive": true
|
|
106
|
+
},
|
|
107
|
+
"TWITTER_API_SECRET_KEY": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "Twitter API secret key (required for TWITTER_AUTH_MODE=env).",
|
|
110
|
+
"required": false,
|
|
111
|
+
"sensitive": true
|
|
112
|
+
},
|
|
113
|
+
"TWITTER_ACCESS_TOKEN": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"description": "OAuth1.0a access token (required for TWITTER_AUTH_MODE=env).",
|
|
116
|
+
"required": false,
|
|
117
|
+
"sensitive": true
|
|
118
|
+
},
|
|
119
|
+
"TWITTER_ACCESS_TOKEN_SECRET": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"description": "OAuth1.0a access token secret (required for TWITTER_AUTH_MODE=env).",
|
|
122
|
+
"required": false,
|
|
123
|
+
"sensitive": true
|
|
124
|
+
},
|
|
125
|
+
"TWITTER_CLIENT_ID": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "Twitter OAuth2 client ID (required for TWITTER_AUTH_MODE=oauth).",
|
|
128
|
+
"required": false,
|
|
129
|
+
"sensitive": false
|
|
130
|
+
},
|
|
131
|
+
"TWITTER_REDIRECT_URI": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"description": "OAuth2 redirect URI (loopback recommended) (required for TWITTER_AUTH_MODE=oauth).",
|
|
134
|
+
"required": false,
|
|
135
|
+
"sensitive": false
|
|
136
|
+
},
|
|
137
|
+
"TWITTER_SCOPES": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"description": "OAuth2 scopes (space-separated).",
|
|
140
|
+
"required": false,
|
|
141
|
+
"default": "tweet.read tweet.write users.read offline.access",
|
|
142
|
+
"sensitive": false
|
|
143
|
+
},
|
|
144
|
+
"TWITTER_TARGET_USERS": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "Comma-separated list of Twitter usernames the bot should interact with. Use '*' for all users.",
|
|
147
|
+
"required": false,
|
|
148
|
+
"default": "",
|
|
149
|
+
"sensitive": false
|
|
150
|
+
},
|
|
151
|
+
"TWITTER_RETRY_LIMIT": {
|
|
152
|
+
"type": "number",
|
|
153
|
+
"description": "Maximum number of retry attempts when a Twitter operation fails.",
|
|
154
|
+
"required": false,
|
|
155
|
+
"default": 5,
|
|
156
|
+
"sensitive": false
|
|
157
|
+
},
|
|
158
|
+
"TWITTER_POLL_INTERVAL": {
|
|
159
|
+
"type": "number",
|
|
160
|
+
"description": "Timeline polling interval in seconds.",
|
|
161
|
+
"required": false,
|
|
162
|
+
"default": 120,
|
|
163
|
+
"sensitive": false
|
|
164
|
+
},
|
|
165
|
+
"TWITTER_DRY_RUN": {
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"description": "When true, all Twitter actions are simulated and nothing is actually posted.",
|
|
168
|
+
"required": false,
|
|
169
|
+
"default": false,
|
|
170
|
+
"sensitive": false
|
|
171
|
+
},
|
|
172
|
+
"TWITTER_ENABLE_POST": {
|
|
173
|
+
"type": "boolean",
|
|
174
|
+
"description": "Enable autonomous tweet posting.",
|
|
175
|
+
"required": false,
|
|
176
|
+
"default": false,
|
|
177
|
+
"sensitive": false
|
|
178
|
+
},
|
|
179
|
+
"TWITTER_POST_INTERVAL_MIN": {
|
|
180
|
+
"type": "number",
|
|
181
|
+
"description": "Minimum interval in minutes between automatically generated posts.",
|
|
182
|
+
"required": false,
|
|
183
|
+
"default": 90,
|
|
184
|
+
"sensitive": false
|
|
185
|
+
},
|
|
186
|
+
"TWITTER_POST_INTERVAL_MAX": {
|
|
187
|
+
"type": "number",
|
|
188
|
+
"description": "Maximum interval in minutes between automatically generated posts.",
|
|
189
|
+
"required": false,
|
|
190
|
+
"default": 180,
|
|
191
|
+
"sensitive": false
|
|
192
|
+
},
|
|
193
|
+
"TWITTER_POST_IMMEDIATELY": {
|
|
194
|
+
"type": "boolean",
|
|
195
|
+
"description": "Skip intervals and post immediately after generation.",
|
|
196
|
+
"required": false,
|
|
197
|
+
"default": false,
|
|
198
|
+
"sensitive": false
|
|
199
|
+
},
|
|
200
|
+
"TWITTER_POST_INTERVAL_VARIANCE": {
|
|
201
|
+
"type": "number",
|
|
202
|
+
"description": "Random variance factor (0.0-1.0) applied to posting intervals for natural behavior.",
|
|
203
|
+
"required": false,
|
|
204
|
+
"default": 0.2,
|
|
205
|
+
"sensitive": false
|
|
206
|
+
},
|
|
207
|
+
"TWITTER_INTERACTION_INTERVAL_MIN": {
|
|
208
|
+
"type": "number",
|
|
209
|
+
"description": "Minimum interval in minutes between interactions.",
|
|
210
|
+
"required": false,
|
|
211
|
+
"default": 15,
|
|
212
|
+
"sensitive": false
|
|
213
|
+
},
|
|
214
|
+
"TWITTER_INTERACTION_INTERVAL_MAX": {
|
|
215
|
+
"type": "number",
|
|
216
|
+
"description": "Maximum interval in minutes between interactions.",
|
|
217
|
+
"required": false,
|
|
218
|
+
"default": 30,
|
|
219
|
+
"sensitive": false
|
|
220
|
+
},
|
|
221
|
+
"TWITTER_INTERACTION_INTERVAL_VARIANCE": {
|
|
222
|
+
"type": "number",
|
|
223
|
+
"description": "Random variance factor (0.0-1.0) applied to interaction intervals for natural behavior.",
|
|
224
|
+
"required": false,
|
|
225
|
+
"default": 0.3,
|
|
226
|
+
"sensitive": false
|
|
227
|
+
},
|
|
228
|
+
"TWITTER_TIMELINE_ALGORITHM": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"description": "Timeline processing algorithm: 'weighted' (default) or 'latest'.",
|
|
231
|
+
"required": false,
|
|
232
|
+
"default": "weighted",
|
|
233
|
+
"sensitive": false
|
|
234
|
+
},
|
|
235
|
+
"TWITTER_TIMELINE_USER_BASED_WEIGHT": {
|
|
236
|
+
"type": "number",
|
|
237
|
+
"description": "Weight for user-based scoring in weighted timeline algorithm.",
|
|
238
|
+
"required": false,
|
|
239
|
+
"default": 3,
|
|
240
|
+
"sensitive": false
|
|
241
|
+
},
|
|
242
|
+
"TWITTER_TIMELINE_TIME_BASED_WEIGHT": {
|
|
243
|
+
"type": "number",
|
|
244
|
+
"description": "Weight for time-based scoring in weighted timeline algorithm.",
|
|
245
|
+
"required": false,
|
|
246
|
+
"default": 2,
|
|
247
|
+
"sensitive": false
|
|
248
|
+
},
|
|
249
|
+
"TWITTER_TIMELINE_RELEVANCE_WEIGHT": {
|
|
250
|
+
"type": "number",
|
|
251
|
+
"description": "Weight for relevance-based scoring in weighted timeline algorithm.",
|
|
252
|
+
"required": false,
|
|
253
|
+
"default": 5,
|
|
254
|
+
"sensitive": false
|
|
255
|
+
},
|
|
256
|
+
"TWITTER_MAX_TWEET_LENGTH": {
|
|
257
|
+
"type": "number",
|
|
258
|
+
"description": "Maximum tweet length (supports long-form tweets up to 4000 characters).",
|
|
259
|
+
"required": false,
|
|
260
|
+
"default": 4000,
|
|
261
|
+
"sensitive": false
|
|
262
|
+
},
|
|
263
|
+
"TWITTER_MAX_INTERACTIONS_PER_RUN": {
|
|
264
|
+
"type": "number",
|
|
265
|
+
"description": "Maximum number of interactions processed per cycle.",
|
|
266
|
+
"required": false,
|
|
267
|
+
"default": 10,
|
|
268
|
+
"sensitive": false
|
|
269
|
+
},
|
|
270
|
+
"TWITTER_DM_ONLY": {
|
|
271
|
+
"type": "boolean",
|
|
272
|
+
"description": "Only process direct messages, ignore public interactions.",
|
|
273
|
+
"required": false,
|
|
274
|
+
"default": false,
|
|
275
|
+
"sensitive": false
|
|
276
|
+
},
|
|
277
|
+
"TWITTER_ENABLE_ACTIONS": {
|
|
278
|
+
"type": "boolean",
|
|
279
|
+
"description": "Enable timeline action processing and automated responses.",
|
|
280
|
+
"required": false,
|
|
281
|
+
"default": false,
|
|
282
|
+
"sensitive": false
|
|
283
|
+
},
|
|
284
|
+
"TWITTER_ACTION_INTERVAL": {
|
|
285
|
+
"type": "number",
|
|
286
|
+
"description": "Interval in minutes between timeline action processing cycles.",
|
|
287
|
+
"required": false,
|
|
288
|
+
"default": 240,
|
|
289
|
+
"sensitive": false
|
|
290
|
+
},
|
|
291
|
+
"TWITTER_AUTO_RESPOND_MENTIONS": {
|
|
292
|
+
"type": "boolean",
|
|
293
|
+
"description": "Automatically respond to mentions.",
|
|
294
|
+
"required": false,
|
|
295
|
+
"default": true,
|
|
296
|
+
"sensitive": false
|
|
297
|
+
},
|
|
298
|
+
"TWITTER_AUTO_RESPOND_REPLIES": {
|
|
299
|
+
"type": "boolean",
|
|
300
|
+
"description": "Automatically respond to replies.",
|
|
301
|
+
"required": false,
|
|
302
|
+
"default": true,
|
|
303
|
+
"sensitive": false
|
|
304
|
+
},
|
|
305
|
+
"TWITTER_ENABLE_REPLIES": {
|
|
306
|
+
"type": "boolean",
|
|
307
|
+
"description": "Enable mention and reply handling.",
|
|
308
|
+
"required": false,
|
|
309
|
+
"default": true,
|
|
310
|
+
"sensitive": false
|
|
311
|
+
},
|
|
312
|
+
"TWITTER_ENABLE_DISCOVERY": {
|
|
313
|
+
"type": "boolean",
|
|
314
|
+
"description": "Enable discovery service for autonomous content discovery and growth.",
|
|
315
|
+
"required": false,
|
|
316
|
+
"default": false,
|
|
317
|
+
"sensitive": false
|
|
318
|
+
},
|
|
319
|
+
"TWITTER_MIN_FOLLOWER_COUNT": {
|
|
320
|
+
"type": "number",
|
|
321
|
+
"description": "Minimum follower count for accounts to follow in discovery service.",
|
|
322
|
+
"required": false,
|
|
323
|
+
"default": 100,
|
|
324
|
+
"sensitive": false
|
|
325
|
+
},
|
|
326
|
+
"TWITTER_MAX_FOLLOWS_PER_CYCLE": {
|
|
327
|
+
"type": "number",
|
|
328
|
+
"description": "Maximum accounts to follow per discovery cycle.",
|
|
329
|
+
"required": false,
|
|
330
|
+
"default": 5,
|
|
331
|
+
"sensitive": false
|
|
332
|
+
},
|
|
333
|
+
"TWITTER_MAX_ENGAGEMENTS_PER_RUN": {
|
|
334
|
+
"type": "number",
|
|
335
|
+
"description": "Maximum engagements per discovery/interaction cycle.",
|
|
336
|
+
"required": false,
|
|
337
|
+
"default": 10,
|
|
338
|
+
"sensitive": false
|
|
339
|
+
},
|
|
340
|
+
"TWITTER_ENGAGEMENT_INTERVAL": {
|
|
341
|
+
"type": "number",
|
|
342
|
+
"description": "Fixed interval for interactions (default: 30, used if MIN/MAX not set).",
|
|
343
|
+
"required": false,
|
|
344
|
+
"default": 30,
|
|
345
|
+
"sensitive": false
|
|
346
|
+
},
|
|
347
|
+
"TWITTER_ENGAGEMENT_INTERVAL_MIN": {
|
|
348
|
+
"type": "number",
|
|
349
|
+
"description": "Minimum minutes between engagements.",
|
|
350
|
+
"required": false,
|
|
351
|
+
"default": 20,
|
|
352
|
+
"sensitive": false
|
|
353
|
+
},
|
|
354
|
+
"TWITTER_ENGAGEMENT_INTERVAL_MAX": {
|
|
355
|
+
"type": "number",
|
|
356
|
+
"description": "Maximum minutes between engagements.",
|
|
357
|
+
"required": false,
|
|
358
|
+
"default": 40,
|
|
359
|
+
"sensitive": false
|
|
360
|
+
},
|
|
361
|
+
"TWITTER_DISCOVERY_INTERVAL_MIN": {
|
|
362
|
+
"type": "number",
|
|
363
|
+
"description": "Minimum minutes between discovery cycles.",
|
|
364
|
+
"required": false,
|
|
365
|
+
"default": 15,
|
|
366
|
+
"sensitive": false
|
|
367
|
+
},
|
|
368
|
+
"TWITTER_DISCOVERY_INTERVAL_MAX": {
|
|
369
|
+
"type": "number",
|
|
370
|
+
"description": "Maximum minutes between discovery cycles.",
|
|
371
|
+
"required": false,
|
|
372
|
+
"default": 30,
|
|
373
|
+
"sensitive": false
|
|
374
|
+
},
|
|
375
|
+
"TWITTER_POST_INTERVAL": {
|
|
376
|
+
"type": "number",
|
|
377
|
+
"description": "Fixed interval between posts (default: 120, used if MIN/MAX not set).",
|
|
378
|
+
"required": false,
|
|
379
|
+
"default": 120,
|
|
380
|
+
"sensitive": false
|
|
381
|
+
},
|
|
382
|
+
"TWITTER_TIMELINE_MODE": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"description": "Timeline mode: 'home' for regular timeline or other modes.",
|
|
385
|
+
"required": false,
|
|
386
|
+
"default": "home",
|
|
387
|
+
"sensitive": false
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"peerDependencies": {
|
|
392
|
+
"@elizaos/core": "2.0.0-beta.1"
|
|
393
|
+
}
|
|
394
|
+
}
|