@superagnt/reddit-data 2.0.2 → 2.0.4
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 +10 -11
- package/index.js +59 -271
- package/openclaw.plugin.json +34 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,21 +8,20 @@ Use one API key to pull Reddit data (subreddits, posts, and community data) for
|
|
|
8
8
|
openclaw plugins install @superagnt/reddit-data
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This package is the official **OpenClaw** plugin for **Reddit** social and public data via [superagnt](https://superagnt.com). Pair it with the [documentation](https://superagnt.com) and your superagnt API key.
|
|
11
|
+
This package is the official **OpenClaw** plugin for **Reddit** social and public data via [superagnt](https://superagnt.com). Pair it with the [documentation](https://superagnt.com/docs) and your superagnt API key.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Want the live MCP surface instead?
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
the live tool
|
|
17
|
-
|
|
15
|
+
This plugin ships a fixed, baked-in toolset that only needs your
|
|
16
|
+
`SUPERAGNT_API_KEY`. For the live workspace tool surface — the full value
|
|
17
|
+
layer (data sources plus workspace Postgres, schedules, canvases,
|
|
18
|
+
enrichment), growing server-side with no plugin update — install the
|
|
19
|
+
primary superagnt plugin instead:
|
|
18
20
|
|
|
19
21
|
```bash
|
|
20
|
-
|
|
22
|
+
openclaw plugins install @superagnt/superagnt
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
Without the token the plugin uses its built-in toolset with your
|
|
24
|
-
`SUPERAGNT_API_KEY` — no behavior change from previous versions.
|
|
25
|
-
|
|
26
25
|
## Overview
|
|
27
26
|
|
|
28
27
|
Unified access to subreddit metadata, post threads, user activity, and search. Built for LLMs and automation — not one-off scraping.
|
|
@@ -58,8 +57,8 @@ Use a single **superagnt API key** (Bearer token). Set `SUPERAGNT_API_KEY` in yo
|
|
|
58
57
|
|
|
59
58
|
## Documentation
|
|
60
59
|
|
|
61
|
-
- [Documentation](https://superagnt.com) — getting started and concepts
|
|
62
|
-
- [API reference (Reddit)](https://superagnt.com/apis/social/reddit) — endpoints and schemas
|
|
60
|
+
- [Documentation](https://superagnt.com/docs) — getting started and concepts
|
|
61
|
+
- [API reference (Reddit)](https://superagnt.com/docs/apis/social/reddit) — endpoints and schemas
|
|
63
62
|
- [Dashboard](https://app.superagnt.com/dashboard) — API keys and usage
|
|
64
63
|
|
|
65
64
|
## Related
|
package/index.js
CHANGED
|
@@ -28,194 +28,6 @@ function readAgntConfig() {
|
|
|
28
28
|
|
|
29
29
|
// ── End Auth Module ──────────────────────────────────────────────────────────
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
// ── CLI Module (inlined) ─────────────────────────────────────────────────────
|
|
33
|
-
|
|
34
|
-
function maskApiKey(key) {
|
|
35
|
-
if (!key || typeof key !== 'string') return '(none)'
|
|
36
|
-
const k = key.trim()
|
|
37
|
-
if (k.length <= 8) return k.slice(0, 2) + '…'
|
|
38
|
-
return k.slice(0, 6) + '…' + k.slice(-4)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function registerAgntCli(api) {
|
|
42
|
-
api.registerCli(
|
|
43
|
-
({ program }) => {
|
|
44
|
-
const cmd = program
|
|
45
|
-
.command('superagnt')
|
|
46
|
-
.description('superagnt social data API (status, doctor)')
|
|
47
|
-
|
|
48
|
-
cmd
|
|
49
|
-
.command('status')
|
|
50
|
-
.description('Show whether an API key is configured (masked)')
|
|
51
|
-
.action(async () => {
|
|
52
|
-
const cfg = readAgntConfig()
|
|
53
|
-
const key = cfg?.apiKey
|
|
54
|
-
|
|
55
|
-
console.log('\nsuperagnt status\n')
|
|
56
|
-
if (!key) {
|
|
57
|
-
console.log(' API key: not configured')
|
|
58
|
-
console.log(' Workspace: —')
|
|
59
|
-
console.log('\n Get your API key at: https://app.superagnt.com/dashboard\n')
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
console.log(' API key: ' + maskApiKey(key) + ' (from ~/.superagnt/config.json)')
|
|
63
|
-
console.log(' Workspace: ' + (cfg?.workspaceId ?? '—'))
|
|
64
|
-
console.log('')
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
cmd
|
|
68
|
-
.command('doctor')
|
|
69
|
-
.description('Check connectivity and validate API key against api.superagnt.dev')
|
|
70
|
-
.action(async () => {
|
|
71
|
-
console.log('\nsuperagnt doctor\n')
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
const publicRes = await fetch('https://api.superagnt.com/v1/platforms')
|
|
75
|
-
console.log(' Public API: ' + (publicRes.ok ? 'OK (' + publicRes.status + ')' : 'HTTP ' + publicRes.status))
|
|
76
|
-
} catch (err) {
|
|
77
|
-
const msg = err instanceof Error ? err.message : String(err)
|
|
78
|
-
console.log(' Public API: failed — ' + msg)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const cfg = readAgntConfig()
|
|
82
|
-
const key = cfg?.apiKey
|
|
83
|
-
|
|
84
|
-
if (!key) {
|
|
85
|
-
console.log('\n Authenticated: skipped (no API key)')
|
|
86
|
-
console.log(' Get your API key at: https://app.superagnt.com/dashboard\n')
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
try {
|
|
91
|
-
const res = await fetch('https://api.superagnt.com/v1/platforms', {
|
|
92
|
-
headers: { Authorization: 'Bearer ' + key },
|
|
93
|
-
})
|
|
94
|
-
const text = await res.text()
|
|
95
|
-
let summary = 'HTTP ' + res.status
|
|
96
|
-
if (res.ok) {
|
|
97
|
-
try {
|
|
98
|
-
const json = JSON.parse(text)
|
|
99
|
-
const n = Array.isArray(json?.data) ? json.data.length : (json?.data ? Object.keys(json.data).length : 'ok')
|
|
100
|
-
summary = 'OK — platforms payload received (' + (typeof n === 'number' ? n + ' entries' : String(n)) + ')'
|
|
101
|
-
} catch {
|
|
102
|
-
summary = 'OK (' + res.status + ')'
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
console.log(' Authenticated: ' + summary)
|
|
106
|
-
if (!res.ok) {
|
|
107
|
-
console.log(' If 401, get a new key at: https://app.superagnt.com/dashboard')
|
|
108
|
-
}
|
|
109
|
-
} catch (err) {
|
|
110
|
-
const msg = err instanceof Error ? err.message : String(err)
|
|
111
|
-
console.log(' Authenticated: failed — ' + msg)
|
|
112
|
-
}
|
|
113
|
-
console.log('')
|
|
114
|
-
})
|
|
115
|
-
},
|
|
116
|
-
{ commands: ['superagnt'] },
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// ── End CLI Module ───────────────────────────────────────────────────────────
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
// ── System prompt (inlined) ─────────────────────────────────────────────────
|
|
124
|
-
|
|
125
|
-
function getSystemPrompt(state) {
|
|
126
|
-
const scope = "Only the Reddit API (reddit)."
|
|
127
|
-
if (state.ready && state.toolCount > 0) {
|
|
128
|
-
return (
|
|
129
|
-
'<superagnt>\n' +
|
|
130
|
-
'Ignore pretrained knowledge about superagnt tool names — use only tools that exist in this session.\n' +
|
|
131
|
-
'\n' +
|
|
132
|
-
'## What superagnt is\n' +
|
|
133
|
-
'superagnt exposes **structured social-data HTTP APIs** behind OpenClaw tools. Scope for this plugin: **' + scope + '**.\n' +
|
|
134
|
-
'\n' +
|
|
135
|
-
'## When to use superagnt tools\n' +
|
|
136
|
-
'- Use superagnt when the user needs **live social/network data** (profiles, posts, companies, comments, etc.) from supported platforms.\n' +
|
|
137
|
-
'- Prefer **discovery** when unsure which endpoint fits: call public discovery (GET /v1/platforms and GET /v1/platforms/{slug}) or read tool descriptions; do not invent endpoints or parameters.\n' +
|
|
138
|
-
'\n' +
|
|
139
|
-
'## Platform selection (high level)\n' +
|
|
140
|
-
'- **linkedin** — B2B enrichment, org/person research, hiring/sales workflows\n' +
|
|
141
|
-
'- **youtube** / **tiktok** — video/creator/channel metadata and content signals\n' +
|
|
142
|
-
'- **x** / **reddit** — short-form social and community threads\n' +
|
|
143
|
-
'- **instagram** — visual/creator discovery where Instagram is the source of truth\n' +
|
|
144
|
-
'- **facebook** — pages/groups/marketplace/adjacent Facebook surface areas exposed by the API\n' +
|
|
145
|
-
'\n' +
|
|
146
|
-
'## Rules\n' +
|
|
147
|
-
'- Do **not** fabricate tool names — pick from the registered superagnt_* tools only.\n' +
|
|
148
|
-
'- If authentication fails (401), tell the user to get a new key at https://app.superagnt.com/dashboard\n' +
|
|
149
|
-
'</superagnt>'
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (state.ready && state.toolCount === 0) {
|
|
154
|
-
return (
|
|
155
|
-
'<superagnt>\n' +
|
|
156
|
-
'The superagnt plugin loaded but registered **zero** API tools. Check your OpenClaw plugin packaging and regenerate the plugin from @superagnt/clawhub.\n' +
|
|
157
|
-
'</superagnt>'
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (state.error) {
|
|
162
|
-
return (
|
|
163
|
-
'<superagnt>\n' +
|
|
164
|
-
'superagnt plugin diagnostic: ' + state.error + '\n' +
|
|
165
|
-
'Do not pretend superagnt tools exist. Ask the user to fix configuration and restart the gateway.\n' +
|
|
166
|
-
'</superagnt>'
|
|
167
|
-
)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
'<superagnt>\n' +
|
|
172
|
-
'superagnt tools are still loading. If the user asks for social data right now, ask them to wait a moment and retry.\n' +
|
|
173
|
-
'</superagnt>'
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// ── End System prompt ────────────────────────────────────────────────────────
|
|
178
|
-
|
|
179
|
-
const MCP_URL = 'https://mcp.superagnt.com/mcp/reddit'
|
|
180
|
-
|
|
181
|
-
async function mcpRpc(token, method, params) {
|
|
182
|
-
const res = await fetch(MCP_URL, {
|
|
183
|
-
method: 'POST',
|
|
184
|
-
headers: {
|
|
185
|
-
Authorization: `Bearer ${token}`,
|
|
186
|
-
'Content-Type': 'application/json',
|
|
187
|
-
Accept: 'application/json, text/event-stream',
|
|
188
|
-
},
|
|
189
|
-
body: JSON.stringify({ jsonrpc: '2.0', id: Date.now(), method, params }),
|
|
190
|
-
})
|
|
191
|
-
if (!res.ok) throw new Error(`MCP ${method} failed: HTTP ${res.status}`)
|
|
192
|
-
const data = await res.json()
|
|
193
|
-
if (data.error) throw new Error(`MCP ${method} error: ${data.error.message}`)
|
|
194
|
-
return data.result
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
async function registerLiveMcpTools(api, token) {
|
|
198
|
-
const result = await mcpRpc(token, 'tools/list', {})
|
|
199
|
-
const tools = Array.isArray(result?.tools) ? result.tools : []
|
|
200
|
-
if (tools.length === 0) throw new Error('MCP tools/list returned no tools')
|
|
201
|
-
for (const t of tools) {
|
|
202
|
-
api.registerTool({
|
|
203
|
-
name: t.name,
|
|
204
|
-
description: t.description,
|
|
205
|
-
inputSchema: t.inputSchema,
|
|
206
|
-
execute: async (input) => {
|
|
207
|
-
const args = parseToolInput(input)
|
|
208
|
-
const r = await mcpRpc(token, 'tools/call', { name: t.name, arguments: args })
|
|
209
|
-
if (r && r.structuredContent !== undefined) return r.structuredContent
|
|
210
|
-
const text = Array.isArray(r?.content) ? r.content.find((c) => c.type === 'text')?.text : undefined
|
|
211
|
-
if (text === undefined) return r
|
|
212
|
-
try { return JSON.parse(text) } catch { return text }
|
|
213
|
-
},
|
|
214
|
-
})
|
|
215
|
-
}
|
|
216
|
-
return tools.length
|
|
217
|
-
}
|
|
218
|
-
|
|
219
31
|
function parseToolInput(input) {
|
|
220
32
|
if (input == null) return {}
|
|
221
33
|
if (typeof input === 'object' && !Array.isArray(input)) return input
|
|
@@ -267,9 +79,8 @@ async function callSuperagnt(apiKey, method, path, query, body) {
|
|
|
267
79
|
return res.json()
|
|
268
80
|
}
|
|
269
81
|
|
|
270
|
-
export default
|
|
82
|
+
export default function register(api) {
|
|
271
83
|
const apiKey = api.pluginConfig.apiKey || process.env.SUPERAGNT_API_KEY || readAgntConfig()?.apiKey
|
|
272
|
-
const mcpToken = api.pluginConfig.mcpToken || process.env.SUPERAGNT_MCP_TOKEN
|
|
273
84
|
|
|
274
85
|
function ensureApiKey() {
|
|
275
86
|
if (apiKey) return apiKey
|
|
@@ -281,30 +92,10 @@ export default async function register(api) {
|
|
|
281
92
|
)
|
|
282
93
|
}
|
|
283
94
|
|
|
284
|
-
registerAgntCli(api)
|
|
285
|
-
|
|
286
|
-
const promptState = { toolCount: 0, error: '', ready: false }
|
|
287
|
-
api.on('before_prompt_build', () => ({
|
|
288
|
-
prependSystemContext: getSystemPrompt(promptState),
|
|
289
|
-
}))
|
|
290
|
-
|
|
291
|
-
// Live MCP mode: a workspace MCP token upgrades this plugin to the server's
|
|
292
|
-
// own tool surface, fetched fresh at load — it grows with agnt_tools_enable
|
|
293
|
-
// and never goes stale. Any failure falls back to the baked toolset below.
|
|
294
|
-
if (mcpToken) {
|
|
295
|
-
try {
|
|
296
|
-
promptState.toolCount = await registerLiveMcpTools(api, mcpToken)
|
|
297
|
-
promptState.ready = true
|
|
298
|
-
return
|
|
299
|
-
} catch (err) {
|
|
300
|
-
promptState.error = 'Live MCP connect failed (' + (err && err.message ? err.message : err) + '); using the built-in toolset.'
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
95
|
api.registerTool({
|
|
305
96
|
name: 'superagnt_reddit_Similar_Subreddits',
|
|
306
97
|
description: "Similar Subreddits",
|
|
307
|
-
|
|
98
|
+
parameters: {
|
|
308
99
|
"type": "object",
|
|
309
100
|
"properties": {
|
|
310
101
|
"cursor": {
|
|
@@ -321,7 +112,7 @@ export default async function register(api) {
|
|
|
321
112
|
]
|
|
322
113
|
},
|
|
323
114
|
execute: async (input) => {
|
|
324
|
-
const key =
|
|
115
|
+
const key = ensureApiKey()
|
|
325
116
|
const params = parseToolInput(input)
|
|
326
117
|
return callSuperagnt(key, 'GET', '/getSimilarSubreddits', params)
|
|
327
118
|
},
|
|
@@ -330,7 +121,7 @@ export default async function register(api) {
|
|
|
330
121
|
api.registerTool({
|
|
331
122
|
name: 'superagnt_reddit_Post_Duplicates',
|
|
332
123
|
description: "Post Duplicates",
|
|
333
|
-
|
|
124
|
+
parameters: {
|
|
334
125
|
"type": "object",
|
|
335
126
|
"properties": {
|
|
336
127
|
"cursor": {
|
|
@@ -347,7 +138,7 @@ export default async function register(api) {
|
|
|
347
138
|
]
|
|
348
139
|
},
|
|
349
140
|
execute: async (input) => {
|
|
350
|
-
const key =
|
|
141
|
+
const key = ensureApiKey()
|
|
351
142
|
const params = parseToolInput(input)
|
|
352
143
|
return callSuperagnt(key, 'GET', '/getPostDuplicates', params)
|
|
353
144
|
},
|
|
@@ -356,7 +147,7 @@ export default async function register(api) {
|
|
|
356
147
|
api.registerTool({
|
|
357
148
|
name: 'superagnt_reddit_Subreddit_Moderators',
|
|
358
149
|
description: "Subreddit Moderators",
|
|
359
|
-
|
|
150
|
+
parameters: {
|
|
360
151
|
"type": "object",
|
|
361
152
|
"properties": {
|
|
362
153
|
"subreddit": {
|
|
@@ -369,7 +160,7 @@ export default async function register(api) {
|
|
|
369
160
|
]
|
|
370
161
|
},
|
|
371
162
|
execute: async (input) => {
|
|
372
|
-
const key =
|
|
163
|
+
const key = ensureApiKey()
|
|
373
164
|
const params = parseToolInput(input)
|
|
374
165
|
return callSuperagnt(key, 'GET', '/getSubredditModerators', params)
|
|
375
166
|
},
|
|
@@ -378,7 +169,7 @@ export default async function register(api) {
|
|
|
378
169
|
api.registerTool({
|
|
379
170
|
name: 'superagnt_reddit_Subreddit_Rules',
|
|
380
171
|
description: "Subreddit Rules",
|
|
381
|
-
|
|
172
|
+
parameters: {
|
|
382
173
|
"type": "object",
|
|
383
174
|
"properties": {
|
|
384
175
|
"subreddit": {
|
|
@@ -391,7 +182,7 @@ export default async function register(api) {
|
|
|
391
182
|
]
|
|
392
183
|
},
|
|
393
184
|
execute: async (input) => {
|
|
394
|
-
const key =
|
|
185
|
+
const key = ensureApiKey()
|
|
395
186
|
const params = parseToolInput(input)
|
|
396
187
|
return callSuperagnt(key, 'GET', '/getSubredditRules', params)
|
|
397
188
|
},
|
|
@@ -400,7 +191,7 @@ export default async function register(api) {
|
|
|
400
191
|
api.registerTool({
|
|
401
192
|
name: 'superagnt_reddit_User_Overview',
|
|
402
193
|
description: "User Overview",
|
|
403
|
-
|
|
194
|
+
parameters: {
|
|
404
195
|
"type": "object",
|
|
405
196
|
"properties": {
|
|
406
197
|
"sort": {
|
|
@@ -426,7 +217,7 @@ export default async function register(api) {
|
|
|
426
217
|
]
|
|
427
218
|
},
|
|
428
219
|
execute: async (input) => {
|
|
429
|
-
const key =
|
|
220
|
+
const key = ensureApiKey()
|
|
430
221
|
const params = parseToolInput(input)
|
|
431
222
|
return callSuperagnt(key, 'GET', '/getUserOverview', params)
|
|
432
223
|
},
|
|
@@ -435,7 +226,7 @@ export default async function register(api) {
|
|
|
435
226
|
api.registerTool({
|
|
436
227
|
name: 'superagnt_reddit_Search_Users',
|
|
437
228
|
description: "Search Users",
|
|
438
|
-
|
|
229
|
+
parameters: {
|
|
439
230
|
"type": "object",
|
|
440
231
|
"properties": {
|
|
441
232
|
"query": {
|
|
@@ -452,7 +243,7 @@ export default async function register(api) {
|
|
|
452
243
|
]
|
|
453
244
|
},
|
|
454
245
|
execute: async (input) => {
|
|
455
|
-
const key =
|
|
246
|
+
const key = ensureApiKey()
|
|
456
247
|
const params = parseToolInput(input)
|
|
457
248
|
return callSuperagnt(key, 'GET', '/getSearchUsers', params)
|
|
458
249
|
},
|
|
@@ -461,7 +252,7 @@ export default async function register(api) {
|
|
|
461
252
|
api.registerTool({
|
|
462
253
|
name: 'superagnt_reddit_Best_Popular_Posts',
|
|
463
254
|
description: "Best Popular Posts",
|
|
464
|
-
|
|
255
|
+
parameters: {
|
|
465
256
|
"type": "object",
|
|
466
257
|
"properties": {
|
|
467
258
|
"cursor": {
|
|
@@ -471,7 +262,7 @@ export default async function register(api) {
|
|
|
471
262
|
}
|
|
472
263
|
},
|
|
473
264
|
execute: async (input) => {
|
|
474
|
-
const key =
|
|
265
|
+
const key = ensureApiKey()
|
|
475
266
|
const params = parseToolInput(input)
|
|
476
267
|
return callSuperagnt(key, 'GET', '/getBestPopularPosts', params)
|
|
477
268
|
},
|
|
@@ -480,7 +271,7 @@ export default async function register(api) {
|
|
|
480
271
|
api.registerTool({
|
|
481
272
|
name: 'superagnt_reddit_Controversial_Posts_By_Subreddit',
|
|
482
273
|
description: "Controversial Posts By Subreddit",
|
|
483
|
-
|
|
274
|
+
parameters: {
|
|
484
275
|
"type": "object",
|
|
485
276
|
"properties": {
|
|
486
277
|
"cursor": {
|
|
@@ -502,7 +293,7 @@ export default async function register(api) {
|
|
|
502
293
|
]
|
|
503
294
|
},
|
|
504
295
|
execute: async (input) => {
|
|
505
|
-
const key =
|
|
296
|
+
const key = ensureApiKey()
|
|
506
297
|
const params = parseToolInput(input)
|
|
507
298
|
return callSuperagnt(key, 'GET', '/getControversialPostsBySubreddit', params)
|
|
508
299
|
},
|
|
@@ -511,7 +302,7 @@ export default async function register(api) {
|
|
|
511
302
|
api.registerTool({
|
|
512
303
|
name: 'superagnt_reddit_User_Post_Rank_In_Subreddit',
|
|
513
304
|
description: "User Post Rank In Subreddit",
|
|
514
|
-
|
|
305
|
+
parameters: {
|
|
515
306
|
"type": "object",
|
|
516
307
|
"properties": {
|
|
517
308
|
"sort": {
|
|
@@ -542,7 +333,7 @@ export default async function register(api) {
|
|
|
542
333
|
]
|
|
543
334
|
},
|
|
544
335
|
execute: async (input) => {
|
|
545
|
-
const key =
|
|
336
|
+
const key = ensureApiKey()
|
|
546
337
|
const params = parseToolInput(input)
|
|
547
338
|
return callSuperagnt(key, 'GET', '/getUserPostRankInSubreddit', params)
|
|
548
339
|
},
|
|
@@ -551,7 +342,7 @@ export default async function register(api) {
|
|
|
551
342
|
api.registerTool({
|
|
552
343
|
name: 'superagnt_reddit_Subreddit_Info',
|
|
553
344
|
description: "Subreddit Info",
|
|
554
|
-
|
|
345
|
+
parameters: {
|
|
555
346
|
"type": "object",
|
|
556
347
|
"properties": {
|
|
557
348
|
"subreddit": {
|
|
@@ -564,7 +355,7 @@ export default async function register(api) {
|
|
|
564
355
|
]
|
|
565
356
|
},
|
|
566
357
|
execute: async (input) => {
|
|
567
|
-
const key =
|
|
358
|
+
const key = ensureApiKey()
|
|
568
359
|
const params = parseToolInput(input)
|
|
569
360
|
return callSuperagnt(key, 'GET', '/getSubredditInfo', params)
|
|
570
361
|
},
|
|
@@ -573,7 +364,7 @@ export default async function register(api) {
|
|
|
573
364
|
api.registerTool({
|
|
574
365
|
name: 'superagnt_reddit_Comments_By_Subreddit',
|
|
575
366
|
description: "Comments By Subreddit",
|
|
576
|
-
|
|
367
|
+
parameters: {
|
|
577
368
|
"type": "object",
|
|
578
369
|
"properties": {
|
|
579
370
|
"subreddit": {
|
|
@@ -590,7 +381,7 @@ export default async function register(api) {
|
|
|
590
381
|
]
|
|
591
382
|
},
|
|
592
383
|
execute: async (input) => {
|
|
593
|
-
const key =
|
|
384
|
+
const key = ensureApiKey()
|
|
594
385
|
const params = parseToolInput(input)
|
|
595
386
|
return callSuperagnt(key, 'GET', '/getCommentsBySubreddit', params)
|
|
596
387
|
},
|
|
@@ -599,7 +390,7 @@ export default async function register(api) {
|
|
|
599
390
|
api.registerTool({
|
|
600
391
|
name: 'superagnt_reddit_Post_Comments_With_Sort',
|
|
601
392
|
description: "Post Comments With Sort",
|
|
602
|
-
|
|
393
|
+
parameters: {
|
|
603
394
|
"type": "object",
|
|
604
395
|
"properties": {
|
|
605
396
|
"sort": {
|
|
@@ -621,7 +412,7 @@ export default async function register(api) {
|
|
|
621
412
|
]
|
|
622
413
|
},
|
|
623
414
|
execute: async (input) => {
|
|
624
|
-
const key =
|
|
415
|
+
const key = ensureApiKey()
|
|
625
416
|
const params = parseToolInput(input)
|
|
626
417
|
return callSuperagnt(key, 'GET', '/getPostCommentsWithSort', params)
|
|
627
418
|
},
|
|
@@ -630,7 +421,7 @@ export default async function register(api) {
|
|
|
630
421
|
api.registerTool({
|
|
631
422
|
name: 'superagnt_reddit_Profile',
|
|
632
423
|
description: "Profile",
|
|
633
|
-
|
|
424
|
+
parameters: {
|
|
634
425
|
"type": "object",
|
|
635
426
|
"properties": {
|
|
636
427
|
"username": {
|
|
@@ -643,7 +434,7 @@ export default async function register(api) {
|
|
|
643
434
|
]
|
|
644
435
|
},
|
|
645
436
|
execute: async (input) => {
|
|
646
|
-
const key =
|
|
437
|
+
const key = ensureApiKey()
|
|
647
438
|
const params = parseToolInput(input)
|
|
648
439
|
return callSuperagnt(key, 'GET', '/getProfile', params)
|
|
649
440
|
},
|
|
@@ -652,7 +443,7 @@ export default async function register(api) {
|
|
|
652
443
|
api.registerTool({
|
|
653
444
|
name: 'superagnt_reddit_Post_Comments',
|
|
654
445
|
description: "Post Comments",
|
|
655
|
-
|
|
446
|
+
parameters: {
|
|
656
447
|
"type": "object",
|
|
657
448
|
"properties": {
|
|
658
449
|
"post_url": {
|
|
@@ -665,7 +456,7 @@ export default async function register(api) {
|
|
|
665
456
|
]
|
|
666
457
|
},
|
|
667
458
|
execute: async (input) => {
|
|
668
|
-
const key =
|
|
459
|
+
const key = ensureApiKey()
|
|
669
460
|
const params = parseToolInput(input)
|
|
670
461
|
return callSuperagnt(key, 'GET', '/getPostComments', params)
|
|
671
462
|
},
|
|
@@ -674,7 +465,7 @@ export default async function register(api) {
|
|
|
674
465
|
api.registerTool({
|
|
675
466
|
name: 'superagnt_reddit_User_Stats',
|
|
676
467
|
description: "User Stats",
|
|
677
|
-
|
|
468
|
+
parameters: {
|
|
678
469
|
"type": "object",
|
|
679
470
|
"properties": {
|
|
680
471
|
"username": {
|
|
@@ -687,7 +478,7 @@ export default async function register(api) {
|
|
|
687
478
|
]
|
|
688
479
|
},
|
|
689
480
|
execute: async (input) => {
|
|
690
|
-
const key =
|
|
481
|
+
const key = ensureApiKey()
|
|
691
482
|
const params = parseToolInput(input)
|
|
692
483
|
return callSuperagnt(key, 'GET', '/getUserStats', params)
|
|
693
484
|
},
|
|
@@ -696,7 +487,7 @@ export default async function register(api) {
|
|
|
696
487
|
api.registerTool({
|
|
697
488
|
name: 'superagnt_reddit_Search_Posts',
|
|
698
489
|
description: "Search Posts",
|
|
699
|
-
|
|
490
|
+
parameters: {
|
|
700
491
|
"type": "object",
|
|
701
492
|
"properties": {
|
|
702
493
|
"query": {
|
|
@@ -725,7 +516,7 @@ export default async function register(api) {
|
|
|
725
516
|
]
|
|
726
517
|
},
|
|
727
518
|
execute: async (input) => {
|
|
728
|
-
const key =
|
|
519
|
+
const key = ensureApiKey()
|
|
729
520
|
const params = parseToolInput(input)
|
|
730
521
|
return callSuperagnt(key, 'GET', '/getSearchPosts', params)
|
|
731
522
|
},
|
|
@@ -734,7 +525,7 @@ export default async function register(api) {
|
|
|
734
525
|
api.registerTool({
|
|
735
526
|
name: 'superagnt_reddit_Search_Subreddits',
|
|
736
527
|
description: "Search Subreddits",
|
|
737
|
-
|
|
528
|
+
parameters: {
|
|
738
529
|
"type": "object",
|
|
739
530
|
"properties": {
|
|
740
531
|
"cursor": {
|
|
@@ -751,7 +542,7 @@ export default async function register(api) {
|
|
|
751
542
|
]
|
|
752
543
|
},
|
|
753
544
|
execute: async (input) => {
|
|
754
|
-
const key =
|
|
545
|
+
const key = ensureApiKey()
|
|
755
546
|
const params = parseToolInput(input)
|
|
756
547
|
return callSuperagnt(key, 'GET', '/getSearchSubreddits', params)
|
|
757
548
|
},
|
|
@@ -760,7 +551,7 @@ export default async function register(api) {
|
|
|
760
551
|
api.registerTool({
|
|
761
552
|
name: 'superagnt_reddit_New_Subreddits',
|
|
762
553
|
description: "New Subreddits",
|
|
763
|
-
|
|
554
|
+
parameters: {
|
|
764
555
|
"type": "object",
|
|
765
556
|
"properties": {
|
|
766
557
|
"cursor": {
|
|
@@ -770,7 +561,7 @@ export default async function register(api) {
|
|
|
770
561
|
}
|
|
771
562
|
},
|
|
772
563
|
execute: async (input) => {
|
|
773
|
-
const key =
|
|
564
|
+
const key = ensureApiKey()
|
|
774
565
|
const params = parseToolInput(input)
|
|
775
566
|
return callSuperagnt(key, 'GET', '/getNewSubreddits', params)
|
|
776
567
|
},
|
|
@@ -779,7 +570,7 @@ export default async function register(api) {
|
|
|
779
570
|
api.registerTool({
|
|
780
571
|
name: 'superagnt_reddit_Popular_Subreddits',
|
|
781
572
|
description: "Popular Subreddits",
|
|
782
|
-
|
|
573
|
+
parameters: {
|
|
783
574
|
"type": "object",
|
|
784
575
|
"properties": {
|
|
785
576
|
"cursor": {
|
|
@@ -789,7 +580,7 @@ export default async function register(api) {
|
|
|
789
580
|
}
|
|
790
581
|
},
|
|
791
582
|
execute: async (input) => {
|
|
792
|
-
const key =
|
|
583
|
+
const key = ensureApiKey()
|
|
793
584
|
const params = parseToolInput(input)
|
|
794
585
|
return callSuperagnt(key, 'GET', '/getPopularSubreddits', params)
|
|
795
586
|
},
|
|
@@ -798,7 +589,7 @@ export default async function register(api) {
|
|
|
798
589
|
api.registerTool({
|
|
799
590
|
name: 'superagnt_reddit_Post_Details',
|
|
800
591
|
description: "Post Details",
|
|
801
|
-
|
|
592
|
+
parameters: {
|
|
802
593
|
"type": "object",
|
|
803
594
|
"properties": {
|
|
804
595
|
"post_url": {
|
|
@@ -811,7 +602,7 @@ export default async function register(api) {
|
|
|
811
602
|
]
|
|
812
603
|
},
|
|
813
604
|
execute: async (input) => {
|
|
814
|
-
const key =
|
|
605
|
+
const key = ensureApiKey()
|
|
815
606
|
const params = parseToolInput(input)
|
|
816
607
|
return callSuperagnt(key, 'GET', '/getPostDetails', params)
|
|
817
608
|
},
|
|
@@ -820,7 +611,7 @@ export default async function register(api) {
|
|
|
820
611
|
api.registerTool({
|
|
821
612
|
name: 'superagnt_reddit_Posts_By_Subreddit',
|
|
822
613
|
description: "Posts By Subreddit",
|
|
823
|
-
|
|
614
|
+
parameters: {
|
|
824
615
|
"type": "object",
|
|
825
616
|
"properties": {
|
|
826
617
|
"subreddit": {
|
|
@@ -842,7 +633,7 @@ export default async function register(api) {
|
|
|
842
633
|
]
|
|
843
634
|
},
|
|
844
635
|
execute: async (input) => {
|
|
845
|
-
const key =
|
|
636
|
+
const key = ensureApiKey()
|
|
846
637
|
const params = parseToolInput(input)
|
|
847
638
|
return callSuperagnt(key, 'GET', '/getPostsBySubreddit', params)
|
|
848
639
|
},
|
|
@@ -851,7 +642,7 @@ export default async function register(api) {
|
|
|
851
642
|
api.registerTool({
|
|
852
643
|
name: 'superagnt_reddit_Top_Comments_By_Username',
|
|
853
644
|
description: "Top Comments By Username",
|
|
854
|
-
|
|
645
|
+
parameters: {
|
|
855
646
|
"type": "object",
|
|
856
647
|
"properties": {
|
|
857
648
|
"time": {
|
|
@@ -873,7 +664,7 @@ export default async function register(api) {
|
|
|
873
664
|
]
|
|
874
665
|
},
|
|
875
666
|
execute: async (input) => {
|
|
876
|
-
const key =
|
|
667
|
+
const key = ensureApiKey()
|
|
877
668
|
const params = parseToolInput(input)
|
|
878
669
|
return callSuperagnt(key, 'GET', '/getTopCommentsByUsername', params)
|
|
879
670
|
},
|
|
@@ -882,7 +673,7 @@ export default async function register(api) {
|
|
|
882
673
|
api.registerTool({
|
|
883
674
|
name: 'superagnt_reddit_Popular_Posts',
|
|
884
675
|
description: "Popular Posts",
|
|
885
|
-
|
|
676
|
+
parameters: {
|
|
886
677
|
"type": "object",
|
|
887
678
|
"properties": {
|
|
888
679
|
"cursor": {
|
|
@@ -899,7 +690,7 @@ export default async function register(api) {
|
|
|
899
690
|
]
|
|
900
691
|
},
|
|
901
692
|
execute: async (input) => {
|
|
902
|
-
const key =
|
|
693
|
+
const key = ensureApiKey()
|
|
903
694
|
const params = parseToolInput(input)
|
|
904
695
|
return callSuperagnt(key, 'GET', '/getPopularPosts', params)
|
|
905
696
|
},
|
|
@@ -908,7 +699,7 @@ export default async function register(api) {
|
|
|
908
699
|
api.registerTool({
|
|
909
700
|
name: 'superagnt_reddit_Top_Posts_By_Subreddit',
|
|
910
701
|
description: "Top Posts By Subreddit",
|
|
911
|
-
|
|
702
|
+
parameters: {
|
|
912
703
|
"type": "object",
|
|
913
704
|
"properties": {
|
|
914
705
|
"time": {
|
|
@@ -930,7 +721,7 @@ export default async function register(api) {
|
|
|
930
721
|
]
|
|
931
722
|
},
|
|
932
723
|
execute: async (input) => {
|
|
933
|
-
const key =
|
|
724
|
+
const key = ensureApiKey()
|
|
934
725
|
const params = parseToolInput(input)
|
|
935
726
|
return callSuperagnt(key, 'GET', '/getTopPostsBySubreddit', params)
|
|
936
727
|
},
|
|
@@ -939,7 +730,7 @@ export default async function register(api) {
|
|
|
939
730
|
api.registerTool({
|
|
940
731
|
name: 'superagnt_reddit_Comments_By_Username',
|
|
941
732
|
description: "Comments By Username",
|
|
942
|
-
|
|
733
|
+
parameters: {
|
|
943
734
|
"type": "object",
|
|
944
735
|
"properties": {
|
|
945
736
|
"sort": {
|
|
@@ -961,7 +752,7 @@ export default async function register(api) {
|
|
|
961
752
|
]
|
|
962
753
|
},
|
|
963
754
|
execute: async (input) => {
|
|
964
|
-
const key =
|
|
755
|
+
const key = ensureApiKey()
|
|
965
756
|
const params = parseToolInput(input)
|
|
966
757
|
return callSuperagnt(key, 'GET', '/getCommentsByUsername', params)
|
|
967
758
|
},
|
|
@@ -970,7 +761,7 @@ export default async function register(api) {
|
|
|
970
761
|
api.registerTool({
|
|
971
762
|
name: 'superagnt_reddit_Top_Posts_By_Username',
|
|
972
763
|
description: "Top Posts By Username",
|
|
973
|
-
|
|
764
|
+
parameters: {
|
|
974
765
|
"type": "object",
|
|
975
766
|
"properties": {
|
|
976
767
|
"cursor": {
|
|
@@ -992,7 +783,7 @@ export default async function register(api) {
|
|
|
992
783
|
]
|
|
993
784
|
},
|
|
994
785
|
execute: async (input) => {
|
|
995
|
-
const key =
|
|
786
|
+
const key = ensureApiKey()
|
|
996
787
|
const params = parseToolInput(input)
|
|
997
788
|
return callSuperagnt(key, 'GET', '/getTopPostsByUsername', params)
|
|
998
789
|
},
|
|
@@ -1001,7 +792,7 @@ export default async function register(api) {
|
|
|
1001
792
|
api.registerTool({
|
|
1002
793
|
name: 'superagnt_reddit_Posts_By_Username',
|
|
1003
794
|
description: "Posts By Username",
|
|
1004
|
-
|
|
795
|
+
parameters: {
|
|
1005
796
|
"type": "object",
|
|
1006
797
|
"properties": {
|
|
1007
798
|
"username": {
|
|
@@ -1023,7 +814,7 @@ export default async function register(api) {
|
|
|
1023
814
|
]
|
|
1024
815
|
},
|
|
1025
816
|
execute: async (input) => {
|
|
1026
|
-
const key =
|
|
817
|
+
const key = ensureApiKey()
|
|
1027
818
|
const params = parseToolInput(input)
|
|
1028
819
|
return callSuperagnt(key, 'GET', '/getPostsByUsername', params)
|
|
1029
820
|
},
|
|
@@ -1032,7 +823,7 @@ export default async function register(api) {
|
|
|
1032
823
|
api.registerTool({
|
|
1033
824
|
name: 'superagnt_reddit_Rising_Popular_Posts',
|
|
1034
825
|
description: "Rising Popular Posts",
|
|
1035
|
-
|
|
826
|
+
parameters: {
|
|
1036
827
|
"type": "object",
|
|
1037
828
|
"properties": {
|
|
1038
829
|
"cursor": {
|
|
@@ -1042,7 +833,7 @@ export default async function register(api) {
|
|
|
1042
833
|
}
|
|
1043
834
|
},
|
|
1044
835
|
execute: async (input) => {
|
|
1045
|
-
const key =
|
|
836
|
+
const key = ensureApiKey()
|
|
1046
837
|
const params = parseToolInput(input)
|
|
1047
838
|
return callSuperagnt(key, 'GET', '/getRisingPopularPosts', params)
|
|
1048
839
|
},
|
|
@@ -1051,7 +842,7 @@ export default async function register(api) {
|
|
|
1051
842
|
api.registerTool({
|
|
1052
843
|
name: 'superagnt_reddit_Top_Popular_Posts',
|
|
1053
844
|
description: "Top Popular Posts",
|
|
1054
|
-
|
|
845
|
+
parameters: {
|
|
1055
846
|
"type": "object",
|
|
1056
847
|
"properties": {
|
|
1057
848
|
"time": {
|
|
@@ -1068,12 +859,9 @@ export default async function register(api) {
|
|
|
1068
859
|
]
|
|
1069
860
|
},
|
|
1070
861
|
execute: async (input) => {
|
|
1071
|
-
const key =
|
|
862
|
+
const key = ensureApiKey()
|
|
1072
863
|
const params = parseToolInput(input)
|
|
1073
864
|
return callSuperagnt(key, 'GET', '/getTopPopularPosts', params)
|
|
1074
865
|
},
|
|
1075
866
|
})
|
|
1076
|
-
|
|
1077
|
-
promptState.toolCount = 29
|
|
1078
|
-
promptState.ready = true
|
|
1079
867
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,40 @@
|
|
|
2
2
|
"id": "reddit-data",
|
|
3
3
|
"name": "Reddit Data",
|
|
4
4
|
"description": "Unified access to subreddit metadata, post threads, user activity, and search. Built for LLMs and automation — not one-off scraping.",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.4",
|
|
6
|
+
"contracts": {
|
|
7
|
+
"tools": [
|
|
8
|
+
"superagnt_reddit_Similar_Subreddits",
|
|
9
|
+
"superagnt_reddit_Post_Duplicates",
|
|
10
|
+
"superagnt_reddit_Subreddit_Moderators",
|
|
11
|
+
"superagnt_reddit_Subreddit_Rules",
|
|
12
|
+
"superagnt_reddit_User_Overview",
|
|
13
|
+
"superagnt_reddit_Search_Users",
|
|
14
|
+
"superagnt_reddit_Best_Popular_Posts",
|
|
15
|
+
"superagnt_reddit_Controversial_Posts_By_Subreddit",
|
|
16
|
+
"superagnt_reddit_User_Post_Rank_In_Subreddit",
|
|
17
|
+
"superagnt_reddit_Subreddit_Info",
|
|
18
|
+
"superagnt_reddit_Comments_By_Subreddit",
|
|
19
|
+
"superagnt_reddit_Post_Comments_With_Sort",
|
|
20
|
+
"superagnt_reddit_Profile",
|
|
21
|
+
"superagnt_reddit_Post_Comments",
|
|
22
|
+
"superagnt_reddit_User_Stats",
|
|
23
|
+
"superagnt_reddit_Search_Posts",
|
|
24
|
+
"superagnt_reddit_Search_Subreddits",
|
|
25
|
+
"superagnt_reddit_New_Subreddits",
|
|
26
|
+
"superagnt_reddit_Popular_Subreddits",
|
|
27
|
+
"superagnt_reddit_Post_Details",
|
|
28
|
+
"superagnt_reddit_Posts_By_Subreddit",
|
|
29
|
+
"superagnt_reddit_Top_Comments_By_Username",
|
|
30
|
+
"superagnt_reddit_Popular_Posts",
|
|
31
|
+
"superagnt_reddit_Top_Posts_By_Subreddit",
|
|
32
|
+
"superagnt_reddit_Comments_By_Username",
|
|
33
|
+
"superagnt_reddit_Top_Posts_By_Username",
|
|
34
|
+
"superagnt_reddit_Posts_By_Username",
|
|
35
|
+
"superagnt_reddit_Rising_Popular_Posts",
|
|
36
|
+
"superagnt_reddit_Top_Popular_Posts"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
6
39
|
"configSchema": {
|
|
7
40
|
"type": "object",
|
|
8
41
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superagnt/reddit-data",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Unified access to subreddit metadata, post threads, user activity, and search. Built for LLMs and automation — not one-off scraping.",
|
|
6
6
|
"main": "index.js",
|