@elizaos/plugin-twitter 1.0.8 → 1.0.13
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/README.md +181 -91
- package/dist/index.d.ts +126 -949
- package/dist/index.js +2021 -7284
- package/dist/index.js.map +1 -1
- package/package.json +202 -21
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/node-L7ZVN5QV.js +0 -40
- package/dist/node-L7ZVN5QV.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-twitter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,40 +18,28 @@
|
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@elizaos/core": "^1.0.
|
|
22
|
-
"@roamhq/wrtc": "^0.9.0",
|
|
23
|
-
"@sinclair/typebox": "^0.34.33",
|
|
24
|
-
"glob": "11.0.2",
|
|
21
|
+
"@elizaos/core": "^1.0.13",
|
|
25
22
|
"headers-polyfill": "^4.0.3",
|
|
26
23
|
"json-stable-stringify": "^1.3.0",
|
|
27
|
-
"
|
|
28
|
-
"set-cookie-parser": "^2.7.1",
|
|
29
|
-
"tough-cookie": "^5.1.2",
|
|
30
|
-
"twitter-api-v2": "^1.23.2",
|
|
31
|
-
"typescript": "^5.8.3",
|
|
32
|
-
"undici": "^7.10.0",
|
|
33
|
-
"undici-types": "^7.10.0",
|
|
34
|
-
"ws": "^8.18.2"
|
|
24
|
+
"twitter-api-v2": "^1.23.2"
|
|
35
25
|
},
|
|
36
26
|
"devDependencies": {
|
|
37
|
-
"@vitest/coverage-v8": "3.
|
|
38
|
-
"prettier": "3.
|
|
27
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
28
|
+
"prettier": "3.6.1",
|
|
39
29
|
"tsup": "8.5.0",
|
|
40
|
-
"
|
|
30
|
+
"typescript": "^5.8.3",
|
|
31
|
+
"vitest": "3.2.4"
|
|
41
32
|
},
|
|
42
33
|
"scripts": {
|
|
43
34
|
"build": "tsup",
|
|
44
35
|
"dev": "tsup --watch",
|
|
45
|
-
"test": "
|
|
36
|
+
"test": "tsup && elizaos test",
|
|
46
37
|
"test:coverage": "vitest run --coverage",
|
|
47
38
|
"lint": "prettier --write ./src",
|
|
48
39
|
"clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
|
|
49
40
|
"format": "prettier --write ./src",
|
|
50
41
|
"format:check": "prettier --check ./src"
|
|
51
42
|
},
|
|
52
|
-
"peerDependencies": {
|
|
53
|
-
"whatwg-url": "14.2.0"
|
|
54
|
-
},
|
|
55
43
|
"publishConfig": {
|
|
56
44
|
"access": "public"
|
|
57
45
|
},
|
|
@@ -62,6 +50,199 @@
|
|
|
62
50
|
},
|
|
63
51
|
"agentConfig": {
|
|
64
52
|
"pluginType": "elizaos:plugin:1.0.0",
|
|
65
|
-
"pluginParameters": {
|
|
53
|
+
"pluginParameters": {
|
|
54
|
+
"TWITTER_API_KEY": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Twitter API v2 key for authentication.",
|
|
57
|
+
"required": true,
|
|
58
|
+
"sensitive": true
|
|
59
|
+
},
|
|
60
|
+
"TWITTER_API_SECRET_KEY": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Twitter API v2 secret key paired with the API key for authentication.",
|
|
63
|
+
"required": true,
|
|
64
|
+
"sensitive": true
|
|
65
|
+
},
|
|
66
|
+
"TWITTER_ACCESS_TOKEN": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"description": "OAuth access token for Twitter API v2 requests.",
|
|
69
|
+
"required": true,
|
|
70
|
+
"sensitive": true
|
|
71
|
+
},
|
|
72
|
+
"TWITTER_ACCESS_TOKEN_SECRET": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"description": "OAuth access token secret used with the access token for authentication.",
|
|
75
|
+
"required": true,
|
|
76
|
+
"sensitive": true
|
|
77
|
+
},
|
|
78
|
+
"TWITTER_TARGET_USERS": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "Comma-separated list of Twitter usernames the bot should interact with. Use '*' for all users.",
|
|
81
|
+
"required": false,
|
|
82
|
+
"default": "",
|
|
83
|
+
"sensitive": false
|
|
84
|
+
},
|
|
85
|
+
"TWITTER_RETRY_LIMIT": {
|
|
86
|
+
"type": "number",
|
|
87
|
+
"description": "Maximum number of retry attempts when a Twitter operation fails.",
|
|
88
|
+
"required": false,
|
|
89
|
+
"default": 5,
|
|
90
|
+
"sensitive": false
|
|
91
|
+
},
|
|
92
|
+
"TWITTER_POLL_INTERVAL": {
|
|
93
|
+
"type": "number",
|
|
94
|
+
"description": "Timeline polling interval in seconds.",
|
|
95
|
+
"required": false,
|
|
96
|
+
"default": 120,
|
|
97
|
+
"sensitive": false
|
|
98
|
+
},
|
|
99
|
+
"TWITTER_SEARCH_ENABLE": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"description": "Enable timeline monitoring and interaction processing.",
|
|
102
|
+
"required": false,
|
|
103
|
+
"default": true,
|
|
104
|
+
"sensitive": false
|
|
105
|
+
},
|
|
106
|
+
"TWITTER_DRY_RUN": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"description": "When true, all Twitter actions are simulated and nothing is actually posted.",
|
|
109
|
+
"required": false,
|
|
110
|
+
"default": false,
|
|
111
|
+
"sensitive": false
|
|
112
|
+
},
|
|
113
|
+
"TWITTER_POST_ENABLE": {
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"description": "Enable autonomous tweet posting.",
|
|
116
|
+
"required": false,
|
|
117
|
+
"default": false,
|
|
118
|
+
"sensitive": false
|
|
119
|
+
},
|
|
120
|
+
"TWITTER_POST_INTERVAL_MIN": {
|
|
121
|
+
"type": "number",
|
|
122
|
+
"description": "Minimum interval in minutes between automatically generated posts.",
|
|
123
|
+
"required": false,
|
|
124
|
+
"default": 90,
|
|
125
|
+
"sensitive": false
|
|
126
|
+
},
|
|
127
|
+
"TWITTER_POST_INTERVAL_MAX": {
|
|
128
|
+
"type": "number",
|
|
129
|
+
"description": "Maximum interval in minutes between automatically generated posts.",
|
|
130
|
+
"required": false,
|
|
131
|
+
"default": 180,
|
|
132
|
+
"sensitive": false
|
|
133
|
+
},
|
|
134
|
+
"TWITTER_POST_IMMEDIATELY": {
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"description": "Skip intervals and post immediately after generation.",
|
|
137
|
+
"required": false,
|
|
138
|
+
"default": false,
|
|
139
|
+
"sensitive": false
|
|
140
|
+
},
|
|
141
|
+
"TWITTER_POST_INTERVAL_VARIANCE": {
|
|
142
|
+
"type": "number",
|
|
143
|
+
"description": "Random variance factor (0.0-1.0) applied to posting intervals for natural behavior.",
|
|
144
|
+
"required": false,
|
|
145
|
+
"default": 0.2,
|
|
146
|
+
"sensitive": false
|
|
147
|
+
},
|
|
148
|
+
"TWITTER_INTERACTION_INTERVAL_MIN": {
|
|
149
|
+
"type": "number",
|
|
150
|
+
"description": "Minimum interval in minutes between interactions.",
|
|
151
|
+
"required": false,
|
|
152
|
+
"default": 15,
|
|
153
|
+
"sensitive": false
|
|
154
|
+
},
|
|
155
|
+
"TWITTER_INTERACTION_INTERVAL_MAX": {
|
|
156
|
+
"type": "number",
|
|
157
|
+
"description": "Maximum interval in minutes between interactions.",
|
|
158
|
+
"required": false,
|
|
159
|
+
"default": 30,
|
|
160
|
+
"sensitive": false
|
|
161
|
+
},
|
|
162
|
+
"TWITTER_INTERACTION_INTERVAL_VARIANCE": {
|
|
163
|
+
"type": "number",
|
|
164
|
+
"description": "Random variance factor (0.0-1.0) applied to interaction intervals for natural behavior.",
|
|
165
|
+
"required": false,
|
|
166
|
+
"default": 0.3,
|
|
167
|
+
"sensitive": false
|
|
168
|
+
},
|
|
169
|
+
"TWITTER_TIMELINE_ALGORITHM": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "Timeline processing algorithm: 'weighted' (default) or 'latest'.",
|
|
172
|
+
"required": false,
|
|
173
|
+
"default": "weighted",
|
|
174
|
+
"sensitive": false
|
|
175
|
+
},
|
|
176
|
+
"TWITTER_TIMELINE_USER_BASED_WEIGHT": {
|
|
177
|
+
"type": "number",
|
|
178
|
+
"description": "Weight for user-based scoring in weighted timeline algorithm.",
|
|
179
|
+
"required": false,
|
|
180
|
+
"default": 3,
|
|
181
|
+
"sensitive": false
|
|
182
|
+
},
|
|
183
|
+
"TWITTER_TIMELINE_TIME_BASED_WEIGHT": {
|
|
184
|
+
"type": "number",
|
|
185
|
+
"description": "Weight for time-based scoring in weighted timeline algorithm.",
|
|
186
|
+
"required": false,
|
|
187
|
+
"default": 2,
|
|
188
|
+
"sensitive": false
|
|
189
|
+
},
|
|
190
|
+
"TWITTER_TIMELINE_RELEVANCE_WEIGHT": {
|
|
191
|
+
"type": "number",
|
|
192
|
+
"description": "Weight for relevance-based scoring in weighted timeline algorithm.",
|
|
193
|
+
"required": false,
|
|
194
|
+
"default": 5,
|
|
195
|
+
"sensitive": false
|
|
196
|
+
},
|
|
197
|
+
"TWITTER_MAX_TWEET_LENGTH": {
|
|
198
|
+
"type": "number",
|
|
199
|
+
"description": "Maximum tweet length (supports long-form tweets up to 4000 characters).",
|
|
200
|
+
"required": false,
|
|
201
|
+
"default": 4000,
|
|
202
|
+
"sensitive": false
|
|
203
|
+
},
|
|
204
|
+
"TWITTER_MAX_INTERACTIONS_PER_RUN": {
|
|
205
|
+
"type": "number",
|
|
206
|
+
"description": "Maximum number of interactions processed per cycle.",
|
|
207
|
+
"required": false,
|
|
208
|
+
"default": 10,
|
|
209
|
+
"sensitive": false
|
|
210
|
+
},
|
|
211
|
+
"TWITTER_DM_ONLY": {
|
|
212
|
+
"type": "boolean",
|
|
213
|
+
"description": "Only process direct messages, ignore public interactions.",
|
|
214
|
+
"required": false,
|
|
215
|
+
"default": false,
|
|
216
|
+
"sensitive": false
|
|
217
|
+
},
|
|
218
|
+
"TWITTER_ENABLE_ACTION_PROCESSING": {
|
|
219
|
+
"type": "boolean",
|
|
220
|
+
"description": "Enable timeline action processing and automated responses.",
|
|
221
|
+
"required": false,
|
|
222
|
+
"default": false,
|
|
223
|
+
"sensitive": false
|
|
224
|
+
},
|
|
225
|
+
"TWITTER_ACTION_INTERVAL": {
|
|
226
|
+
"type": "number",
|
|
227
|
+
"description": "Interval in minutes between timeline action processing cycles.",
|
|
228
|
+
"required": false,
|
|
229
|
+
"default": 240,
|
|
230
|
+
"sensitive": false
|
|
231
|
+
},
|
|
232
|
+
"TWITTER_AUTO_RESPOND_MENTIONS": {
|
|
233
|
+
"type": "boolean",
|
|
234
|
+
"description": "Automatically respond to mentions.",
|
|
235
|
+
"required": false,
|
|
236
|
+
"default": true,
|
|
237
|
+
"sensitive": false
|
|
238
|
+
},
|
|
239
|
+
"TWITTER_AUTO_RESPOND_REPLIES": {
|
|
240
|
+
"type": "boolean",
|
|
241
|
+
"description": "Automatically respond to replies.",
|
|
242
|
+
"required": false,
|
|
243
|
+
"default": true,
|
|
244
|
+
"sensitive": false
|
|
245
|
+
}
|
|
246
|
+
}
|
|
66
247
|
}
|
|
67
248
|
}
|
package/dist/chunk-PZ5AY32C.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/node-L7ZVN5QV.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import "./chunk-PZ5AY32C.js";
|
|
2
|
-
|
|
3
|
-
// src/client/platform/node/randomize-ciphers.ts
|
|
4
|
-
import { randomBytes } from "crypto";
|
|
5
|
-
import tls from "tls";
|
|
6
|
-
var ORIGINAL_CIPHERS = tls.DEFAULT_CIPHERS;
|
|
7
|
-
var TOP_N_SHUFFLE = 8;
|
|
8
|
-
var shuffleArray = (array) => {
|
|
9
|
-
for (let i = array.length - 1; i > 0; i--) {
|
|
10
|
-
const j = randomBytes(4).readUint32LE() % array.length;
|
|
11
|
-
[array[i], array[j]] = [array[j], array[i]];
|
|
12
|
-
}
|
|
13
|
-
return array;
|
|
14
|
-
};
|
|
15
|
-
var randomizeCiphers = () => {
|
|
16
|
-
do {
|
|
17
|
-
const cipherList = ORIGINAL_CIPHERS.split(":");
|
|
18
|
-
const shuffled = shuffleArray(cipherList.slice(0, TOP_N_SHUFFLE));
|
|
19
|
-
const retained = cipherList.slice(TOP_N_SHUFFLE);
|
|
20
|
-
tls.DEFAULT_CIPHERS = [...shuffled, ...retained].join(":");
|
|
21
|
-
} while (tls.DEFAULT_CIPHERS === ORIGINAL_CIPHERS);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// src/client/platform/node/index.ts
|
|
25
|
-
var NodePlatform = class {
|
|
26
|
-
/**
|
|
27
|
-
* Asynchronously randomizes ciphers.
|
|
28
|
-
*
|
|
29
|
-
* @returns {Promise<void>} A promise that resolves once the ciphers are randomized.
|
|
30
|
-
*/
|
|
31
|
-
randomizeCiphers() {
|
|
32
|
-
randomizeCiphers();
|
|
33
|
-
return Promise.resolve();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var platform = new NodePlatform();
|
|
37
|
-
export {
|
|
38
|
-
platform
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=node-L7ZVN5QV.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client/platform/node/randomize-ciphers.ts","../src/client/platform/node/index.ts"],"sourcesContent":["import { randomBytes } from 'node:crypto';\nimport tls from 'node:tls';\n\nconst ORIGINAL_CIPHERS = tls.DEFAULT_CIPHERS;\n\n// How many ciphers from the top of the list to shuffle.\n// The remaining ciphers are left in the original order.\nconst TOP_N_SHUFFLE = 8;\n\n// Modified variation of https://stackoverflow.com/a/12646864\nconst shuffleArray = (array: unknown[]) => {\n for (let i = array.length - 1; i > 0; i--) {\n const j = randomBytes(4).readUint32LE() % array.length;\n [array[i], array[j]] = [array[j], array[i]];\n }\n\n return array;\n};\n\n// https://github.com/imputnet/cobalt/pull/574\nexport const randomizeCiphers = () => {\n do {\n const cipherList = ORIGINAL_CIPHERS.split(':');\n const shuffled = shuffleArray(cipherList.slice(0, TOP_N_SHUFFLE));\n const retained = cipherList.slice(TOP_N_SHUFFLE);\n\n tls.DEFAULT_CIPHERS = [...shuffled, ...retained].join(':');\n } while (tls.DEFAULT_CIPHERS === ORIGINAL_CIPHERS);\n};\n","import type { PlatformExtensions } from '../platform-interface';\nimport { randomizeCiphers } from './randomize-ciphers';\n\n/**\n * Asynchronously randomizes the order of ciphers used by the Node.js platform.\n * @returns {Promise<void>} A Promise that resolves once the ciphers have been randomized.\n */\nclass NodePlatform implements PlatformExtensions {\n /**\n * Asynchronously randomizes ciphers.\n *\n * @returns {Promise<void>} A promise that resolves once the ciphers are randomized.\n */\n randomizeCiphers(): Promise<void> {\n randomizeCiphers();\n return Promise.resolve();\n }\n}\n\nexport const platform = new NodePlatform();\n"],"mappings":";;;AAAA,SAAS,mBAAmB;AAC5B,OAAO,SAAS;AAEhB,IAAM,mBAAmB,IAAI;AAI7B,IAAM,gBAAgB;AAGtB,IAAM,eAAe,CAAC,UAAqB;AACzC,WAAS,IAAI,MAAM,SAAS,GAAG,IAAI,GAAG,KAAK;AACzC,UAAM,IAAI,YAAY,CAAC,EAAE,aAAa,IAAI,MAAM;AAChD,KAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAAA,EAC5C;AAEA,SAAO;AACT;AAGO,IAAM,mBAAmB,MAAM;AACpC,KAAG;AACD,UAAM,aAAa,iBAAiB,MAAM,GAAG;AAC7C,UAAM,WAAW,aAAa,WAAW,MAAM,GAAG,aAAa,CAAC;AAChE,UAAM,WAAW,WAAW,MAAM,aAAa;AAE/C,QAAI,kBAAkB,CAAC,GAAG,UAAU,GAAG,QAAQ,EAAE,KAAK,GAAG;AAAA,EAC3D,SAAS,IAAI,oBAAoB;AACnC;;;ACrBA,IAAM,eAAN,MAAiD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM/C,mBAAkC;AAChC,qBAAiB;AACjB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;AAEO,IAAM,WAAW,IAAI,aAAa;","names":[]}
|