@xquik/tweetclaw 1.6.12 → 1.6.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 +16 -4
- package/dist/index.d.ts +0 -3
- package/dist/index.js +103 -66
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +13 -8
- package/package.json +2 -2
- package/skills/tweetclaw/SKILL.md +26 -29
- package/src/index.ts +126 -68
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|

|
|
7
7
|
[](https://glama.ai/mcp/servers/Xquik-dev/x-twitter-scraper)
|
|
8
8
|
[](https://smithery.ai/servers/xquik/x-twitter-scraper)
|
|
9
|
+
[](https://apify.com/xquik/x-tweet-scraper)
|
|
9
10
|
|
|
10
11
|
Post tweets, reply, like, retweet, follow, DM & more - directly from your chat. Full X/Twitter automation for [OpenClaw](https://github.com/openclaw/openclaw).
|
|
11
12
|
|
|
@@ -63,6 +64,8 @@ Tweet composition, style analysis, drafts, curated radar (7 sources), and accoun
|
|
|
63
64
|
openclaw plugins install @xquik/tweetclaw
|
|
64
65
|
```
|
|
65
66
|
|
|
67
|
+
TweetClaw can be installed before credentials are configured. Until you add an API key or MPP signing key, the free `explore` catalog remains available and live API calls return setup guidance instead of failing plugin installation.
|
|
68
|
+
|
|
66
69
|
> **Note:** `@xquik/tweetclaw` is the only official npm package. Any other scope (for example `@intentsolutionsio/tweetclaw`) is an unofficial redistribution and may ship stale metadata or outdated endpoint counts.
|
|
67
70
|
|
|
68
71
|
## Configure
|
|
@@ -75,7 +78,7 @@ Get an API key at [dashboard.xquik.com](https://dashboard.xquik.com/). Store it
|
|
|
75
78
|
openclaw config set plugins.entries.tweetclaw.config.apiKey "$XQUIK_API_KEY"
|
|
76
79
|
```
|
|
77
80
|
|
|
78
|
-
**Security**:
|
|
81
|
+
**Security**: Keep the key out of chats, docs, and shell history. Prefer the environment-variable command above so OpenClaw writes the secret to its local config without exposing it in the prompt.
|
|
79
82
|
|
|
80
83
|
### Option B: Credits (pay-per-use, no subscription)
|
|
81
84
|
|
|
@@ -90,16 +93,25 @@ npm i mppx viem
|
|
|
90
93
|
openclaw config set plugins.entries.tweetclaw.config.tempoSigningKey "$MPP_SIGNING_KEY"
|
|
91
94
|
```
|
|
92
95
|
|
|
93
|
-
**Security**:
|
|
96
|
+
**Security**: Keep the signing key out of chats, docs, and shell history. Prefer the environment-variable command above so OpenClaw writes the secret to its local config without exposing it in the prompt.
|
|
94
97
|
|
|
95
98
|
MPP-eligible endpoints: tweet lookup ($0.00015), tweet search ($0.00015/tweet), user lookup ($0.00015), user tweets ($0.00015/tweet), follower check ($0.00105), article lookup ($0.00105), media download ($0.00015/media), trends ($0.00045), X trends ($0.00045), quotes ($0.00015/tweet), replies ($0.00015/tweet), retweeters ($0.00015/user), favoriters ($0.00015/user), thread ($0.00015/tweet), user likes ($0.00015/tweet), user media ($0.00015/tweet), community info ($0.00015), community members ($0.00015/user), community moderators ($0.00015/user), community tweets ($0.00015/tweet), community search ($0.00015/community), communities tweets ($0.00015/tweet), list followers ($0.00015/user), list members ($0.00015/user), list tweets ($0.00015/tweet), users batch ($0.00015/user), users search ($0.00015/user), user followers ($0.00015/user), followers you know ($0.00015/user), user following ($0.00015/user), user mentions ($0.00015/tweet), verified followers ($0.00015/user).
|
|
96
99
|
|
|
97
100
|
### Enable the optional action tool
|
|
98
101
|
|
|
99
|
-
OpenClaw loads `explore` as the safe catalog tool. The live endpoint invoker, `tweetclaw`, is registered as an optional tool because it can perform paid reads, private reads, and write actions.
|
|
102
|
+
OpenClaw loads `explore` as the safe catalog tool. The live endpoint invoker, `tweetclaw`, is registered as an optional tool because it can perform paid reads, private reads, and write actions.
|
|
103
|
+
|
|
104
|
+
OpenClaw's local onboarding default is often `tools.profile: "coding"`, which excludes external plugin tools from agent runs until they are explicitly allowed. If the agent can see the TweetClaw skill but cannot call the tools, add the tool names to `tools.alsoAllow` so you keep the normal coding tools and opt into TweetClaw.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
openclaw config set tools.alsoAllow '["explore", "tweetclaw"]'
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Verify runtime registration after install or update:
|
|
100
111
|
|
|
101
112
|
```bash
|
|
102
|
-
openclaw
|
|
113
|
+
openclaw plugins inspect tweetclaw --runtime
|
|
114
|
+
openclaw skills info tweetclaw
|
|
103
115
|
```
|
|
104
116
|
|
|
105
117
|
### Optional settings
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,25 +6,19 @@ import { createProxiedRequest } from './request.js';
|
|
|
6
6
|
import { createEventPoller } from './services/event-poller.js';
|
|
7
7
|
import { normalizeMethod, requestNeedsApproval } from './tools/catalog.js';
|
|
8
8
|
import { handleExplore, SEARCH_DESCRIPTION } from './tools/explore.js';
|
|
9
|
+
import { errorResult } from './tools/result.js';
|
|
9
10
|
import { EXECUTE_DESCRIPTION, handleTweetclaw } from './tools/tweetclaw.js';
|
|
10
11
|
function isPollerEvent(value) {
|
|
11
12
|
return typeof value === 'object' && value !== null;
|
|
12
13
|
}
|
|
13
|
-
function isPluginConfig(value) {
|
|
14
|
-
if (typeof value !== 'object' || value === null)
|
|
15
|
-
return false;
|
|
16
|
-
return 'apiKey' in value || 'tempoSigningKey' in value;
|
|
17
|
-
}
|
|
18
14
|
const DEFAULT_POLLING_INTERVAL_SECONDS = 60;
|
|
15
|
+
const DEFAULT_BASE_URL = 'https://xquik.com';
|
|
16
|
+
const MISSING_CREDENTIALS_MESSAGE = 'TweetClaw is installed but not configured. Add an Xquik API key for account-backed workflows or a Tempo signing key for MPP read-only mode in OpenClaw plugin config.';
|
|
19
17
|
const CONFIG_SCHEMA = {
|
|
20
18
|
additionalProperties: false,
|
|
21
|
-
anyOf: [
|
|
22
|
-
{ required: ['apiKey'] },
|
|
23
|
-
{ required: ['tempoSigningKey'] },
|
|
24
|
-
],
|
|
25
19
|
properties: {
|
|
26
20
|
apiKey: {
|
|
27
|
-
description: 'Xquik API key (get one at dashboard.xquik.com).
|
|
21
|
+
description: 'Xquik API key (get one at dashboard.xquik.com). Use for account-backed X automation.',
|
|
28
22
|
minLength: 1,
|
|
29
23
|
type: 'string',
|
|
30
24
|
},
|
|
@@ -36,7 +30,7 @@ const CONFIG_SCHEMA = {
|
|
|
36
30
|
type: 'number',
|
|
37
31
|
},
|
|
38
32
|
tempoSigningKey: {
|
|
39
|
-
description: 'MPP signing key for pay-per-use mode.
|
|
33
|
+
description: 'MPP signing key for pay-per-use mode. Use for accountless access to 32 read-only X-API endpoints.',
|
|
40
34
|
minLength: 1,
|
|
41
35
|
type: 'string',
|
|
42
36
|
},
|
|
@@ -58,7 +52,11 @@ const EXPLORE_PARAMETERS = {
|
|
|
58
52
|
const TWEETCLAW_PARAMETERS = {
|
|
59
53
|
additionalProperties: false,
|
|
60
54
|
properties: {
|
|
61
|
-
body: {
|
|
55
|
+
body: {
|
|
56
|
+
description: 'JSON request body',
|
|
57
|
+
items: {},
|
|
58
|
+
type: ['object', 'array', 'string', 'number', 'boolean', 'null'],
|
|
59
|
+
},
|
|
62
60
|
method: { default: 'GET', description: 'HTTP method', enum: ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'], type: 'string' },
|
|
63
61
|
path: { description: 'Concrete /api/v1/... endpoint path from the catalog', type: 'string' },
|
|
64
62
|
query: {
|
|
@@ -76,6 +74,19 @@ function asObject(value) {
|
|
|
76
74
|
}
|
|
77
75
|
return Object.fromEntries(Object.entries(value));
|
|
78
76
|
}
|
|
77
|
+
function asPluginConfig(value) {
|
|
78
|
+
const config = asObject(value);
|
|
79
|
+
if (config === undefined)
|
|
80
|
+
return {};
|
|
81
|
+
const { apiKey, baseUrl, pollingEnabled, pollingInterval, tempoSigningKey } = config;
|
|
82
|
+
return {
|
|
83
|
+
...(typeof apiKey === 'string' && apiKey.length > 0 ? { apiKey } : {}),
|
|
84
|
+
...(typeof baseUrl === 'string' && baseUrl.length > 0 ? { baseUrl } : {}),
|
|
85
|
+
...(typeof pollingEnabled === 'boolean' ? { pollingEnabled } : {}),
|
|
86
|
+
...(typeof pollingInterval === 'number' ? { pollingInterval } : {}),
|
|
87
|
+
...(typeof tempoSigningKey === 'string' && tempoSigningKey.length > 0 ? { tempoSigningKey } : {}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
79
90
|
function asExploreParams(params) {
|
|
80
91
|
const value = asObject(params);
|
|
81
92
|
if (value === undefined)
|
|
@@ -151,30 +162,32 @@ function registerWriteApprovalHook(api) {
|
|
|
151
162
|
};
|
|
152
163
|
}, { priority: 50 });
|
|
153
164
|
}
|
|
154
|
-
function
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
return;
|
|
165
|
+
function resolveCredentialState(config) {
|
|
166
|
+
const accountValue = config.apiKey;
|
|
167
|
+
if (accountValue !== undefined) {
|
|
168
|
+
return { accountValue, mode: 'api-key', signingValue: '' };
|
|
159
169
|
}
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (isMppMode) {
|
|
164
|
-
void (async () => {
|
|
165
|
-
try {
|
|
166
|
-
await initMpp(tempoSigningKey);
|
|
167
|
-
api.logger.info('TweetClaw: MPP initialized - payment account ready');
|
|
168
|
-
}
|
|
169
|
-
catch (error) {
|
|
170
|
-
api.logger.error(`TweetClaw: MPP init failed - ${error instanceof Error ? error.message : String(error)}`);
|
|
171
|
-
}
|
|
172
|
-
})();
|
|
173
|
-
api.logger.info('TweetClaw: MPP mode - pay-per-use (32 X-API endpoints, no subscription needed)');
|
|
170
|
+
const signingValue = config.tempoSigningKey;
|
|
171
|
+
if (signingValue !== undefined) {
|
|
172
|
+
return { accountValue: '', mode: 'mpp', signingValue };
|
|
174
173
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
return { accountValue: '', mode: 'none', signingValue: '' };
|
|
175
|
+
}
|
|
176
|
+
function registerMppMode(api, credentialMode, signingValue) {
|
|
177
|
+
if (credentialMode !== 'mpp')
|
|
178
|
+
return;
|
|
179
|
+
void (async () => {
|
|
180
|
+
try {
|
|
181
|
+
await initMpp(signingValue);
|
|
182
|
+
api.logger.info('TweetClaw: MPP initialized - payment account ready');
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
api.logger.error(`TweetClaw: MPP init failed - ${error instanceof Error ? error.message : String(error)}`);
|
|
186
|
+
}
|
|
187
|
+
})();
|
|
188
|
+
api.logger.info('TweetClaw: MPP mode - pay-per-use (32 X-API endpoints, no subscription needed)');
|
|
189
|
+
}
|
|
190
|
+
function registerTools(api, options) {
|
|
178
191
|
api.registerTool({
|
|
179
192
|
description: SEARCH_DESCRIPTION,
|
|
180
193
|
execute: async (_toolCallId, params) => {
|
|
@@ -186,18 +199,25 @@ function register(api, fetchFunction) {
|
|
|
186
199
|
}, { name: 'explore' });
|
|
187
200
|
api.registerTool({
|
|
188
201
|
description: EXECUTE_DESCRIPTION,
|
|
189
|
-
execute: async (_toolCallId, params) =>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
202
|
+
execute: async (_toolCallId, params) => {
|
|
203
|
+
if (options.credentialMode === 'none') {
|
|
204
|
+
await Promise.resolve();
|
|
205
|
+
return errorResult(new Error(MISSING_CREDENTIALS_MESSAGE));
|
|
206
|
+
}
|
|
207
|
+
return handleTweetclaw({
|
|
208
|
+
apiKey: options.credential,
|
|
209
|
+
baseUrl: options.baseUrl,
|
|
210
|
+
fetchFunction: options.fetchFunction,
|
|
211
|
+
mppMode: options.credentialMode === 'mpp',
|
|
212
|
+
params: asTweetclawParams(params),
|
|
213
|
+
});
|
|
214
|
+
},
|
|
196
215
|
name: 'tweetclaw',
|
|
197
216
|
parameters: TWEETCLAW_PARAMETERS,
|
|
198
217
|
}, { name: 'tweetclaw', optional: true });
|
|
199
|
-
|
|
200
|
-
|
|
218
|
+
}
|
|
219
|
+
function registerCommands(api, credentialMode, request) {
|
|
220
|
+
if (credentialMode === 'api-key') {
|
|
201
221
|
api.registerCommand({
|
|
202
222
|
description: 'Show Xquik account status & usage',
|
|
203
223
|
handler: async () => {
|
|
@@ -216,30 +236,47 @@ function register(api, fetchFunction) {
|
|
|
216
236
|
},
|
|
217
237
|
name: 'xtrends',
|
|
218
238
|
});
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
}
|
|
240
|
+
function registerPoller(api, config, credentialMode, request) {
|
|
241
|
+
if (credentialMode !== 'api-key' || config.pollingEnabled === false)
|
|
242
|
+
return;
|
|
243
|
+
const poller = createEventPoller({
|
|
244
|
+
intervalSeconds: config.pollingInterval ?? DEFAULT_POLLING_INTERVAL_SECONDS,
|
|
245
|
+
onEvents: (events) => {
|
|
246
|
+
for (const event of events) {
|
|
247
|
+
const eventType = isPollerEvent(event) && typeof event['eventType'] === 'string'
|
|
248
|
+
? event['eventType']
|
|
249
|
+
: 'unknown';
|
|
250
|
+
const username = isPollerEvent(event) && typeof event['xUsername'] === 'string'
|
|
251
|
+
? event['xUsername']
|
|
252
|
+
: '';
|
|
253
|
+
api.logger.info(`[TweetClaw] ${eventType} from @${username}`);
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
request,
|
|
257
|
+
});
|
|
258
|
+
api.registerService({
|
|
259
|
+
id: 'tweetclaw-poller',
|
|
260
|
+
start: () => { poller.start(); },
|
|
261
|
+
stop: () => { poller.stop(); },
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
function register(api, fetchFunction) {
|
|
265
|
+
const config = asPluginConfig(api.pluginConfig);
|
|
266
|
+
const { baseUrl = DEFAULT_BASE_URL } = config;
|
|
267
|
+
const credential = resolveCredentialState(config);
|
|
268
|
+
registerMppMode(api, credential.mode, credential.signingValue);
|
|
269
|
+
const request = createProxiedRequest(baseUrl, credential.accountValue, fetchFunction);
|
|
270
|
+
registerWriteApprovalHook(api);
|
|
271
|
+
if (credential.mode === 'none') {
|
|
272
|
+
api.logger.warn('TweetClaw: No API key or signing key configured. Install succeeded; configure credentials before network calls.');
|
|
242
273
|
}
|
|
274
|
+
const toolOptions = fetchFunction === undefined
|
|
275
|
+
? { baseUrl, credential: credential.accountValue, credentialMode: credential.mode }
|
|
276
|
+
: { baseUrl, credential: credential.accountValue, credentialMode: credential.mode, fetchFunction };
|
|
277
|
+
registerTools(api, toolOptions);
|
|
278
|
+
registerCommands(api, credential.mode, request);
|
|
279
|
+
registerPoller(api, config, credential.mode, request);
|
|
243
280
|
api.logger.info('TweetClaw: Plugin registered successfully');
|
|
244
281
|
}
|
|
245
282
|
const plugin = definePluginEntry({
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,s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MAAM,WAAW,GAAyB,aAAa,KAAK,SAAS;QACnE,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,CAAC,IAAI,EAAE;QACnF,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC;IACrG,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAChC,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAChD,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,MAAM,GAAG,iBAAiB,CAAC;IAC/B,YAAY,EAAE,aAAa;IAC3B,WAAW,EAAE,+CAA+C;IAC5D,EAAE,EAAE,WAAW;IACf,IAAI,EAAE,WAAW;IACjB,QAAQ;CACT,CAAC,CAAC;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,eAAe,MAAM,CAAC"}
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "tweetclaw",
|
|
3
3
|
"name": "TweetClaw",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.13",
|
|
5
5
|
"description": "Post tweets, reply, like, retweet, follow, DM, search, and monitor X/Twitter through structured Xquik endpoints.",
|
|
6
|
+
"activation": {
|
|
7
|
+
"onStartup": false,
|
|
8
|
+
"onCapabilities": ["tool"]
|
|
9
|
+
},
|
|
6
10
|
"skills": ["skills/tweetclaw"],
|
|
7
11
|
"contracts": {
|
|
8
12
|
"tools": ["explore", "tweetclaw"]
|
|
9
13
|
},
|
|
14
|
+
"toolMetadata": {
|
|
15
|
+
"tweetclaw": {
|
|
16
|
+
"optional": true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
10
19
|
"configSchema": {
|
|
11
20
|
"type": "object",
|
|
12
21
|
"additionalProperties": false,
|
|
13
22
|
"properties": {
|
|
14
|
-
"apiKey": { "type": "string", "minLength": 1, "description": "Xquik API key (get one at dashboard.xquik.com).
|
|
15
|
-
"tempoSigningKey": { "type": "string", "minLength": 1, "description": "MPP signing key for pay-per-use mode.
|
|
23
|
+
"apiKey": { "type": "string", "minLength": 1, "description": "Xquik API key (get one at dashboard.xquik.com). Use for account-backed X automation." },
|
|
24
|
+
"tempoSigningKey": { "type": "string", "minLength": 1, "description": "MPP signing key for pay-per-use mode. Use for accountless access to 32 read-only X-API endpoints." },
|
|
16
25
|
"baseUrl": { "type": "string", "default": "https://xquik.com" },
|
|
17
26
|
"pollingInterval": { "type": "number", "default": 60, "description": "Event polling interval in seconds" },
|
|
18
27
|
"pollingEnabled": { "type": "boolean", "default": true }
|
|
19
|
-
}
|
|
20
|
-
"anyOf": [
|
|
21
|
-
{ "required": ["apiKey"] },
|
|
22
|
-
{ "required": ["tempoSigningKey"] }
|
|
23
|
-
]
|
|
28
|
+
}
|
|
24
29
|
},
|
|
25
30
|
"uiHints": {
|
|
26
31
|
"apiKey": { "label": "Xquik API Key", "sensitive": true, "placeholder": "xq_...", "help": "Account-backed X automation. Generate at dashboard.xquik.com." },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xquik/tweetclaw",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.13",
|
|
4
4
|
"description": "Post tweets, reply, like, retweet, follow, DM & more from OpenClaw through structured Xquik endpoints.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"install": {
|
|
34
34
|
"defaultChoice": "npm",
|
|
35
|
-
"npmSpec": "@xquik/tweetclaw@1.6.
|
|
35
|
+
"npmSpec": "@xquik/tweetclaw@1.6.13",
|
|
36
36
|
"minHostVersion": ">=2026.5.4"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tweetclaw
|
|
3
|
-
description: "
|
|
3
|
+
description: "Safety-reviewed guide for @xquik/tweetclaw, the Xquik OpenClaw plugin for structured X/Twitter workflows. Covers setup, credential boundaries, explicit approval for writes and paid actions, spending limits, private-data handling, and monitor controls."
|
|
4
4
|
homepage: https://xquik.com
|
|
5
5
|
read_when:
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- Downloading tweet media or uploading images
|
|
13
|
-
- Sending DMs or updating X/Twitter profile
|
|
14
|
-
- Checking credit balance
|
|
15
|
-
- Browsing bookmarks, notifications, timeline, or DM history
|
|
16
|
-
metadata: {"openclaw":{"emoji":"🐦","tags":["twitter","x","automation","social-media","tweets","scraping","giveaway","monitoring","rest-api","cheap-api"]}}
|
|
17
|
-
license: MIT
|
|
6
|
+
- Installing or configuring the TweetClaw OpenClaw plugin
|
|
7
|
+
- Using Xquik from OpenClaw with explicit user approval
|
|
8
|
+
- Checking TweetClaw pricing, credentials, permissions, or safety boundaries
|
|
9
|
+
- Planning X/Twitter reads, writes, extractions, draws, or monitors safely
|
|
10
|
+
metadata: {"openclaw":{"emoji":"🐦","tags":["twitter","x","automation","social-media","tweets","scraping","giveaway","monitoring","rest-api","cheap-api"],"primaryEnv":"XQUIK_API_KEY","envVars":[{"name":"XQUIK_API_KEY","required":false,"description":"Optional Xquik API key for account-backed TweetClaw workflows. Prefer storing it in OpenClaw plugin config rather than exposing it to the agent session."},{"name":"MPP_SIGNING_KEY","required":false,"description":"Optional Machine Payments Protocol signing key for read-only pay-per-use mode. Store as sensitive OpenClaw plugin config and never print it."}]}}
|
|
11
|
+
license: MIT-0
|
|
18
12
|
---
|
|
19
13
|
|
|
20
14
|
# TweetClaw
|
|
@@ -25,6 +19,22 @@ OpenClaw plugin for X/Twitter automation powered by Xquik.
|
|
|
25
19
|
openclaw plugins install @xquik/tweetclaw
|
|
26
20
|
```
|
|
27
21
|
|
|
22
|
+
TweetClaw can be installed before credentials are configured. In that state, use `explore` for free endpoint discovery; live API calls will return setup guidance until the user configures an Xquik API key or MPP signing key.
|
|
23
|
+
|
|
24
|
+
## Safety Rules
|
|
25
|
+
|
|
26
|
+
Use TweetClaw only for user-authorized X/Twitter workflows. Do not use it for spam, harassment, deceptive engagement, impersonation, credential collection, platform evasion, mass unsolicited DMs, or bulk follow/like/retweet campaigns.
|
|
27
|
+
|
|
28
|
+
Before any visible, state-changing, paid, or recurring action, summarize the exact target, account, action, text/media when relevant, and estimated credits, then wait for explicit user confirmation. This includes posting, replying, deleting, liking, retweeting, following, unfollowing, sending DMs, editing profiles, uploading media, creating webhooks, creating monitors, running draws, and starting extraction jobs.
|
|
29
|
+
|
|
30
|
+
For reads that expose private or account-scoped data, such as bookmarks, notifications, timelines, DMs, connected accounts, and account usage, confirm the user owns or is authorized to access the account before showing results. Redact credentials and avoid exposing sensitive personal data unless the user explicitly asks for that specific data.
|
|
31
|
+
|
|
32
|
+
For bulk extraction, draw, or monitor requests, keep limits narrow by default. State the requested limit, estimated cost, and storage or notification behavior. Ask for confirmation again if the user expands the scope, changes the target, or asks for recurring monitoring.
|
|
33
|
+
|
|
34
|
+
For content posting, show the final text and media list before sending. Do not post confidential, proprietary, personal, or third-party private information unless the user explicitly confirms they have the right to publish it. Do not add links, mentions, hashtags, or claims the user did not request.
|
|
35
|
+
|
|
36
|
+
MPP mode is read-only. Never attempt writes, account-backed actions, monitors, webhooks, DMs, profile changes, or uploads when only `tempoSigningKey` is configured. Treat the signing key as sensitive config and never print it.
|
|
37
|
+
|
|
28
38
|
## Pricing
|
|
29
39
|
|
|
30
40
|
TweetClaw uses Xquik's credit-based pricing. 1 credit = $0.00015.
|
|
@@ -102,7 +112,7 @@ Do NOT use TweetClaw for browsing X in a browser, analytics dashboards, scheduli
|
|
|
102
112
|
|
|
103
113
|
## Configuration
|
|
104
114
|
|
|
105
|
-
Credentials are stored in OpenClaw plugin config
|
|
115
|
+
Credentials are stored in OpenClaw plugin config after setup. Users should pass secrets through environment-variable commands and avoid pasting raw keys into chats, docs, shell history, or troubleshooting output.
|
|
106
116
|
|
|
107
117
|
**IMPORTANT: Never log, echo, display, or include API keys or signing keys in tool output, chat responses, or error messages. Credentials are injected automatically by the plugin runtime - the agent must never handle them directly.**
|
|
108
118
|
|
|
@@ -124,20 +134,6 @@ Configure the signing key in your OpenClaw plugin config:
|
|
|
124
134
|
{ "tempoSigningKey": "your-66-char-hex-key" }
|
|
125
135
|
```
|
|
126
136
|
|
|
127
|
-
## Safety Rules
|
|
128
|
-
|
|
129
|
-
Use TweetClaw only for user-authorized X/Twitter workflows. Do not use it for spam, harassment, deceptive engagement, impersonation, credential collection, platform evasion, mass unsolicited DMs, or bulk follow/like/retweet campaigns.
|
|
130
|
-
|
|
131
|
-
Before any visible, state-changing, paid, or recurring action, summarize the exact target, account, action, text/media when relevant, and estimated credits, then wait for explicit user confirmation. This includes posting, replying, deleting, liking, retweeting, following, unfollowing, sending DMs, editing profiles, uploading media, creating webhooks, creating monitors, running draws, and starting extraction jobs.
|
|
132
|
-
|
|
133
|
-
For reads that expose private or account-scoped data, such as bookmarks, notifications, timelines, DMs, connected accounts, and account usage, confirm the user owns or is authorized to access the account before showing results. Redact credentials and avoid exposing sensitive personal data unless the user explicitly asks for that specific data.
|
|
134
|
-
|
|
135
|
-
For bulk extraction, draw, or monitor requests, keep limits narrow by default. State the requested limit, estimated cost, and storage or notification behavior. Ask for confirmation again if the user expands the scope, changes the target, or asks for recurring monitoring.
|
|
136
|
-
|
|
137
|
-
For content posting, show the final text and media list before sending. Do not post confidential, proprietary, personal, or third-party private information unless the user explicitly confirms they have the right to publish it. Do not add links, mentions, hashtags, or claims the user did not request.
|
|
138
|
-
|
|
139
|
-
MPP mode is read-only. Never attempt writes, account-backed actions, monitors, webhooks, DMs, profile changes, or uploads when only `tempoSigningKey` is configured. Treat the signing key as sensitive config and never print it.
|
|
140
|
-
|
|
141
137
|
## Tools
|
|
142
138
|
|
|
143
139
|
TweetClaw registers 2 tools for the agent-safe Xquik endpoint catalog:
|
|
@@ -155,7 +151,8 @@ Structured endpoint invoker. The agent selects one endpoint from the catalog and
|
|
|
155
151
|
- Only endpoints listed in the catalog can be invoked; unknown paths are rejected
|
|
156
152
|
- Only the `xquik.com` origin can be reached; the runtime does not issue requests to any other host
|
|
157
153
|
- No arbitrary commands, no shell, no filesystem access, no third-party network
|
|
158
|
-
- The tool is registered as optional in OpenClaw. If
|
|
154
|
+
- The tool is registered as optional in OpenClaw. If the agent can see this skill but cannot call TweetClaw tools, add `explore` and `tweetclaw` to `tools.alsoAllow` so the normal tool profile stays intact
|
|
155
|
+
- After install or update, use `openclaw plugins inspect tweetclaw --runtime` and `openclaw skills info tweetclaw` to verify the runtime tool and skill registrations
|
|
159
156
|
|
|
160
157
|
Example: "Post a tweet saying 'Hello from TweetClaw!'" invokes `POST /api/v1/x/tweets` with `{ account, text }` after fetching the connected account from `GET /api/v1/x/accounts`.
|
|
161
158
|
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { createProxiedRequest } from './request.js';
|
|
|
6
6
|
import { createEventPoller } from './services/event-poller.js';
|
|
7
7
|
import { normalizeMethod, requestNeedsApproval } from './tools/catalog.js';
|
|
8
8
|
import { handleExplore, SEARCH_DESCRIPTION } from './tools/explore.js';
|
|
9
|
+
import { errorResult } from './tools/result.js';
|
|
9
10
|
import { EXECUTE_DESCRIPTION, handleTweetclaw } from './tools/tweetclaw.js';
|
|
10
11
|
import type { ExploreParams, FetchFunction, PluginConfig, TweetclawParams } from './types.js';
|
|
11
12
|
|
|
@@ -18,22 +19,16 @@ function isPollerEvent(value: unknown): value is PollerEvent {
|
|
|
18
19
|
return typeof value === 'object' && value !== null;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
function isPluginConfig(value: unknown): value is PluginConfig {
|
|
22
|
-
if (typeof value !== 'object' || value === null) return false;
|
|
23
|
-
return 'apiKey' in value || 'tempoSigningKey' in value;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
22
|
const DEFAULT_POLLING_INTERVAL_SECONDS = 60;
|
|
23
|
+
const DEFAULT_BASE_URL = 'https://xquik.com';
|
|
24
|
+
const MISSING_CREDENTIALS_MESSAGE =
|
|
25
|
+
'TweetClaw is installed but not configured. Add an Xquik API key for account-backed workflows or a Tempo signing key for MPP read-only mode in OpenClaw plugin config.';
|
|
27
26
|
|
|
28
27
|
const CONFIG_SCHEMA = {
|
|
29
28
|
additionalProperties: false,
|
|
30
|
-
anyOf: [
|
|
31
|
-
{ required: ['apiKey'] },
|
|
32
|
-
{ required: ['tempoSigningKey'] },
|
|
33
|
-
],
|
|
34
29
|
properties: {
|
|
35
30
|
apiKey: {
|
|
36
|
-
description: 'Xquik API key (get one at dashboard.xquik.com).
|
|
31
|
+
description: 'Xquik API key (get one at dashboard.xquik.com). Use for account-backed X automation.',
|
|
37
32
|
minLength: 1,
|
|
38
33
|
type: 'string',
|
|
39
34
|
},
|
|
@@ -45,7 +40,7 @@ const CONFIG_SCHEMA = {
|
|
|
45
40
|
type: 'number',
|
|
46
41
|
},
|
|
47
42
|
tempoSigningKey: {
|
|
48
|
-
description: 'MPP signing key for pay-per-use mode.
|
|
43
|
+
description: 'MPP signing key for pay-per-use mode. Use for accountless access to 32 read-only X-API endpoints.',
|
|
49
44
|
minLength: 1,
|
|
50
45
|
type: 'string',
|
|
51
46
|
},
|
|
@@ -86,6 +81,22 @@ type BeforeToolCallHandler = (
|
|
|
86
81
|
event: BeforeToolCallEvent,
|
|
87
82
|
) => BeforeToolCallResult | Promise<BeforeToolCallResult | undefined> | undefined;
|
|
88
83
|
|
|
84
|
+
type CredentialMode = 'api-key' | 'mpp' | 'none';
|
|
85
|
+
type XquikRequest = ReturnType<typeof createProxiedRequest>;
|
|
86
|
+
|
|
87
|
+
interface RegisterToolsOptions {
|
|
88
|
+
readonly baseUrl: string;
|
|
89
|
+
readonly credential: string;
|
|
90
|
+
readonly credentialMode: CredentialMode;
|
|
91
|
+
readonly fetchFunction?: FetchFunction;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface CredentialState {
|
|
95
|
+
readonly accountValue: string;
|
|
96
|
+
readonly mode: CredentialMode;
|
|
97
|
+
readonly signingValue: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
89
100
|
interface OpenClawApi {
|
|
90
101
|
readonly logger: {
|
|
91
102
|
readonly debug?: (message: string) => void;
|
|
@@ -142,7 +153,11 @@ const EXPLORE_PARAMETERS = {
|
|
|
142
153
|
const TWEETCLAW_PARAMETERS = {
|
|
143
154
|
additionalProperties: false,
|
|
144
155
|
properties: {
|
|
145
|
-
body: {
|
|
156
|
+
body: {
|
|
157
|
+
description: 'JSON request body',
|
|
158
|
+
items: {},
|
|
159
|
+
type: ['object', 'array', 'string', 'number', 'boolean', 'null'],
|
|
160
|
+
},
|
|
146
161
|
method: { default: 'GET', description: 'HTTP method', enum: ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'], type: 'string' },
|
|
147
162
|
path: { description: 'Concrete /api/v1/... endpoint path from the catalog', type: 'string' },
|
|
148
163
|
query: {
|
|
@@ -162,6 +177,20 @@ function asObject(value: unknown): Readonly<Record<string, unknown>> | undefined
|
|
|
162
177
|
return Object.fromEntries(Object.entries(value));
|
|
163
178
|
}
|
|
164
179
|
|
|
180
|
+
function asPluginConfig(value: unknown): PluginConfig {
|
|
181
|
+
const config = asObject(value);
|
|
182
|
+
if (config === undefined) return {};
|
|
183
|
+
|
|
184
|
+
const { apiKey, baseUrl, pollingEnabled, pollingInterval, tempoSigningKey } = config;
|
|
185
|
+
return {
|
|
186
|
+
...(typeof apiKey === 'string' && apiKey.length > 0 ? { apiKey } : {}),
|
|
187
|
+
...(typeof baseUrl === 'string' && baseUrl.length > 0 ? { baseUrl } : {}),
|
|
188
|
+
...(typeof pollingEnabled === 'boolean' ? { pollingEnabled } : {}),
|
|
189
|
+
...(typeof pollingInterval === 'number' ? { pollingInterval } : {}),
|
|
190
|
+
...(typeof tempoSigningKey === 'string' && tempoSigningKey.length > 0 ? { tempoSigningKey } : {}),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
165
194
|
function asExploreParams(params: unknown): Readonly<ExploreParams> {
|
|
166
195
|
const value = asObject(params);
|
|
167
196
|
if (value === undefined) return {};
|
|
@@ -258,35 +287,35 @@ function registerWriteApprovalHook(api: OpenClawApi): void {
|
|
|
258
287
|
);
|
|
259
288
|
}
|
|
260
289
|
|
|
261
|
-
function
|
|
262
|
-
const
|
|
263
|
-
if (
|
|
264
|
-
api
|
|
265
|
-
'TweetClaw: No API key or signing key configured. See the README for setup instructions.',
|
|
266
|
-
);
|
|
267
|
-
return;
|
|
290
|
+
function resolveCredentialState(config: Readonly<PluginConfig>): CredentialState {
|
|
291
|
+
const accountValue = config.apiKey;
|
|
292
|
+
if (accountValue !== undefined) {
|
|
293
|
+
return { accountValue, mode: 'api-key', signingValue: '' };
|
|
268
294
|
}
|
|
269
295
|
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
if (isMppMode) {
|
|
275
|
-
void (async (): Promise<void> => {
|
|
276
|
-
try {
|
|
277
|
-
await initMpp(tempoSigningKey);
|
|
278
|
-
api.logger.info('TweetClaw: MPP initialized - payment account ready');
|
|
279
|
-
} catch (error: unknown) {
|
|
280
|
-
api.logger.error(`TweetClaw: MPP init failed - ${error instanceof Error ? error.message : String(error)}`);
|
|
281
|
-
}
|
|
282
|
-
})();
|
|
283
|
-
api.logger.info('TweetClaw: MPP mode - pay-per-use (32 X-API endpoints, no subscription needed)');
|
|
296
|
+
const signingValue = config.tempoSigningKey;
|
|
297
|
+
if (signingValue !== undefined) {
|
|
298
|
+
return { accountValue: '', mode: 'mpp', signingValue };
|
|
284
299
|
}
|
|
285
300
|
|
|
286
|
-
|
|
287
|
-
|
|
301
|
+
return { accountValue: '', mode: 'none', signingValue: '' };
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function registerMppMode(api: OpenClawApi, credentialMode: CredentialMode, signingValue: string): void {
|
|
305
|
+
if (credentialMode !== 'mpp') return;
|
|
306
|
+
|
|
307
|
+
void (async (): Promise<void> => {
|
|
308
|
+
try {
|
|
309
|
+
await initMpp(signingValue);
|
|
310
|
+
api.logger.info('TweetClaw: MPP initialized - payment account ready');
|
|
311
|
+
} catch (error: unknown) {
|
|
312
|
+
api.logger.error(`TweetClaw: MPP init failed - ${error instanceof Error ? error.message : String(error)}`);
|
|
313
|
+
}
|
|
314
|
+
})();
|
|
315
|
+
api.logger.info('TweetClaw: MPP mode - pay-per-use (32 X-API endpoints, no subscription needed)');
|
|
316
|
+
}
|
|
288
317
|
|
|
289
|
-
|
|
318
|
+
function registerTools(api: OpenClawApi, options: RegisterToolsOptions): void {
|
|
290
319
|
api.registerTool(
|
|
291
320
|
{
|
|
292
321
|
description: SEARCH_DESCRIPTION,
|
|
@@ -303,21 +332,28 @@ function register(api: OpenClawApi, fetchFunction?: FetchFunction): void {
|
|
|
303
332
|
api.registerTool(
|
|
304
333
|
{
|
|
305
334
|
description: EXECUTE_DESCRIPTION,
|
|
306
|
-
execute: async (_toolCallId, params) =>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
335
|
+
execute: async (_toolCallId, params) => {
|
|
336
|
+
if (options.credentialMode === 'none') {
|
|
337
|
+
await Promise.resolve();
|
|
338
|
+
return errorResult(new Error(MISSING_CREDENTIALS_MESSAGE));
|
|
339
|
+
}
|
|
340
|
+
return handleTweetclaw({
|
|
341
|
+
apiKey: options.credential,
|
|
342
|
+
baseUrl: options.baseUrl,
|
|
343
|
+
fetchFunction: options.fetchFunction,
|
|
344
|
+
mppMode: options.credentialMode === 'mpp',
|
|
345
|
+
params: asTweetclawParams(params),
|
|
346
|
+
});
|
|
347
|
+
},
|
|
313
348
|
name: 'tweetclaw',
|
|
314
349
|
parameters: TWEETCLAW_PARAMETERS,
|
|
315
350
|
},
|
|
316
351
|
{ name: 'tweetclaw', optional: true },
|
|
317
352
|
);
|
|
353
|
+
}
|
|
318
354
|
|
|
319
|
-
|
|
320
|
-
if (
|
|
355
|
+
function registerCommands(api: OpenClawApi, credentialMode: CredentialMode, request: XquikRequest): void {
|
|
356
|
+
if (credentialMode === 'api-key') {
|
|
321
357
|
api.registerCommand({
|
|
322
358
|
description: 'Show Xquik account status & usage',
|
|
323
359
|
handler: async () => {
|
|
@@ -337,33 +373,55 @@ function register(api: OpenClawApi, fetchFunction?: FetchFunction): void {
|
|
|
337
373
|
},
|
|
338
374
|
name: 'xtrends',
|
|
339
375
|
});
|
|
376
|
+
}
|
|
340
377
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
378
|
+
function registerPoller(api: OpenClawApi, config: Readonly<PluginConfig>, credentialMode: CredentialMode, request: XquikRequest): void {
|
|
379
|
+
if (credentialMode !== 'api-key' || config.pollingEnabled === false) return;
|
|
380
|
+
|
|
381
|
+
const poller = createEventPoller({
|
|
382
|
+
intervalSeconds: config.pollingInterval ?? DEFAULT_POLLING_INTERVAL_SECONDS,
|
|
383
|
+
onEvents: (events) => {
|
|
384
|
+
for (const event of events) {
|
|
385
|
+
const eventType: string = isPollerEvent(event) && typeof event['eventType'] === 'string'
|
|
386
|
+
? event['eventType']
|
|
387
|
+
: 'unknown';
|
|
388
|
+
const username: string = isPollerEvent(event) && typeof event['xUsername'] === 'string'
|
|
389
|
+
? event['xUsername']
|
|
390
|
+
: '';
|
|
391
|
+
api.logger.info(`[TweetClaw] ${eventType} from @${username}`);
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
request,
|
|
395
|
+
});
|
|
359
396
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
397
|
+
api.registerService({
|
|
398
|
+
id: 'tweetclaw-poller',
|
|
399
|
+
start: () => { poller.start(); },
|
|
400
|
+
stop: () => { poller.stop(); },
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function register(api: OpenClawApi, fetchFunction?: FetchFunction): void {
|
|
405
|
+
const config = asPluginConfig(api.pluginConfig);
|
|
406
|
+
const { baseUrl = DEFAULT_BASE_URL } = config;
|
|
407
|
+
const credential = resolveCredentialState(config);
|
|
408
|
+
|
|
409
|
+
registerMppMode(api, credential.mode, credential.signingValue);
|
|
410
|
+
const request = createProxiedRequest(baseUrl, credential.accountValue, fetchFunction);
|
|
411
|
+
registerWriteApprovalHook(api);
|
|
412
|
+
|
|
413
|
+
if (credential.mode === 'none') {
|
|
414
|
+
api.logger.warn(
|
|
415
|
+
'TweetClaw: No API key or signing key configured. Install succeeded; configure credentials before network calls.',
|
|
416
|
+
);
|
|
365
417
|
}
|
|
366
418
|
|
|
419
|
+
const toolOptions: RegisterToolsOptions = fetchFunction === undefined
|
|
420
|
+
? { baseUrl, credential: credential.accountValue, credentialMode: credential.mode }
|
|
421
|
+
: { baseUrl, credential: credential.accountValue, credentialMode: credential.mode, fetchFunction };
|
|
422
|
+
registerTools(api, toolOptions);
|
|
423
|
+
registerCommands(api, credential.mode, request);
|
|
424
|
+
registerPoller(api, config, credential.mode, request);
|
|
367
425
|
api.logger.info('TweetClaw: Plugin registered successfully');
|
|
368
426
|
}
|
|
369
427
|
|