@superagnt/dub-links 2.0.2 → 2.0.3
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 +42 -254
- package/openclaw.plugin.json +46 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,21 +8,20 @@ Connect your Dub workspace to superagnt to programmatically manage short links,
|
|
|
8
8
|
openclaw plugins install @superagnt/dub-links
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This package is the official **OpenClaw** plugin for the **Dub** integration 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 the **Dub** integration 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
|
OpenClaw plugin for Dub — manage short links, conversion events, customers, tags, folders, and domains with your superagnt API key.
|
|
@@ -66,8 +65,8 @@ Set `SUPERAGNT_API_KEY` in your environment, or complete browser login when the
|
|
|
66
65
|
|
|
67
66
|
## Documentation
|
|
68
67
|
|
|
69
|
-
- [Documentation](https://superagnt.com) — getting started and concepts
|
|
70
|
-
- [Connection guide (Dub)](https://superagnt.com/
|
|
68
|
+
- [Documentation](https://superagnt.com/docs) — getting started and concepts
|
|
69
|
+
- [Connection guide (Dub)](https://superagnt.com/docs) — setup and endpoints
|
|
71
70
|
- [Dashboard](https://app.superagnt.com/dashboard) — API keys and usage
|
|
72
71
|
|
|
73
72
|
## 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 Dub integration (dub)."
|
|
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'
|
|
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,26 +92,6 @@ 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_connection_dub_getLinks',
|
|
306
97
|
description: "Retrieve a list of links",
|
|
@@ -366,7 +157,7 @@ export default async function register(api) {
|
|
|
366
157
|
}
|
|
367
158
|
},
|
|
368
159
|
execute: async (input) => {
|
|
369
|
-
const key =
|
|
160
|
+
const key = ensureApiKey()
|
|
370
161
|
const params = parseToolInput(input)
|
|
371
162
|
return callSuperagnt(key, 'GET', '/links', params)
|
|
372
163
|
},
|
|
@@ -380,7 +171,7 @@ export default async function register(api) {
|
|
|
380
171
|
"properties": {}
|
|
381
172
|
},
|
|
382
173
|
execute: async (input) => {
|
|
383
|
-
const key =
|
|
174
|
+
const key = ensureApiKey()
|
|
384
175
|
const params = parseToolInput(input)
|
|
385
176
|
return callSuperagnt(key, 'POST', '/links', undefined, params)
|
|
386
177
|
},
|
|
@@ -394,7 +185,7 @@ export default async function register(api) {
|
|
|
394
185
|
"properties": {}
|
|
395
186
|
},
|
|
396
187
|
execute: async (input) => {
|
|
397
|
-
const key =
|
|
188
|
+
const key = ensureApiKey()
|
|
398
189
|
const params = parseToolInput(input)
|
|
399
190
|
return callSuperagnt(key, 'PUT', '/links', undefined, params)
|
|
400
191
|
},
|
|
@@ -425,7 +216,7 @@ export default async function register(api) {
|
|
|
425
216
|
}
|
|
426
217
|
},
|
|
427
218
|
execute: async (input) => {
|
|
428
|
-
const key =
|
|
219
|
+
const key = ensureApiKey()
|
|
429
220
|
const params = parseToolInput(input)
|
|
430
221
|
return callSuperagnt(key, 'GET', '/links/info', params)
|
|
431
222
|
},
|
|
@@ -472,7 +263,7 @@ export default async function register(api) {
|
|
|
472
263
|
}
|
|
473
264
|
},
|
|
474
265
|
execute: async (input) => {
|
|
475
|
-
const key =
|
|
266
|
+
const key = ensureApiKey()
|
|
476
267
|
const params = parseToolInput(input)
|
|
477
268
|
return callSuperagnt(key, 'GET', '/links/count', params)
|
|
478
269
|
},
|
|
@@ -494,7 +285,7 @@ export default async function register(api) {
|
|
|
494
285
|
]
|
|
495
286
|
},
|
|
496
287
|
execute: async (input) => {
|
|
497
|
-
const key =
|
|
288
|
+
const key = ensureApiKey()
|
|
498
289
|
const params = parseToolInput(input)
|
|
499
290
|
return callSuperagnt(key, 'PATCH', '/links/{linkId}', undefined, params)
|
|
500
291
|
},
|
|
@@ -516,7 +307,7 @@ export default async function register(api) {
|
|
|
516
307
|
]
|
|
517
308
|
},
|
|
518
309
|
execute: async (input) => {
|
|
519
|
-
const key =
|
|
310
|
+
const key = ensureApiKey()
|
|
520
311
|
const params = parseToolInput(input)
|
|
521
312
|
return callSuperagnt(key, 'DELETE', '/links/{linkId}', undefined, params)
|
|
522
313
|
},
|
|
@@ -530,7 +321,7 @@ export default async function register(api) {
|
|
|
530
321
|
"properties": {}
|
|
531
322
|
},
|
|
532
323
|
execute: async (input) => {
|
|
533
|
-
const key =
|
|
324
|
+
const key = ensureApiKey()
|
|
534
325
|
const params = parseToolInput(input)
|
|
535
326
|
return callSuperagnt(key, 'POST', '/links/bulk', undefined, params)
|
|
536
327
|
},
|
|
@@ -560,7 +351,7 @@ export default async function register(api) {
|
|
|
560
351
|
]
|
|
561
352
|
},
|
|
562
353
|
execute: async (input) => {
|
|
563
|
-
const key =
|
|
354
|
+
const key = ensureApiKey()
|
|
564
355
|
const params = parseToolInput(input)
|
|
565
356
|
return callSuperagnt(key, 'PATCH', '/links/bulk', undefined, params)
|
|
566
357
|
},
|
|
@@ -582,7 +373,7 @@ export default async function register(api) {
|
|
|
582
373
|
]
|
|
583
374
|
},
|
|
584
375
|
execute: async (input) => {
|
|
585
|
-
const key =
|
|
376
|
+
const key = ensureApiKey()
|
|
586
377
|
const params = parseToolInput(input)
|
|
587
378
|
return callSuperagnt(key, 'DELETE', '/links/bulk', undefined, params)
|
|
588
379
|
},
|
|
@@ -737,7 +528,7 @@ export default async function register(api) {
|
|
|
737
528
|
}
|
|
738
529
|
},
|
|
739
530
|
execute: async (input) => {
|
|
740
|
-
const key =
|
|
531
|
+
const key = ensureApiKey()
|
|
741
532
|
const params = parseToolInput(input)
|
|
742
533
|
return callSuperagnt(key, 'GET', '/analytics', params)
|
|
743
534
|
},
|
|
@@ -892,7 +683,7 @@ export default async function register(api) {
|
|
|
892
683
|
}
|
|
893
684
|
},
|
|
894
685
|
execute: async (input) => {
|
|
895
|
-
const key =
|
|
686
|
+
const key = ensureApiKey()
|
|
896
687
|
const params = parseToolInput(input)
|
|
897
688
|
return callSuperagnt(key, 'GET', '/events', params)
|
|
898
689
|
},
|
|
@@ -931,7 +722,7 @@ export default async function register(api) {
|
|
|
931
722
|
}
|
|
932
723
|
},
|
|
933
724
|
execute: async (input) => {
|
|
934
|
-
const key =
|
|
725
|
+
const key = ensureApiKey()
|
|
935
726
|
const params = parseToolInput(input)
|
|
936
727
|
return callSuperagnt(key, 'GET', '/tags', params)
|
|
937
728
|
},
|
|
@@ -954,7 +745,7 @@ export default async function register(api) {
|
|
|
954
745
|
}
|
|
955
746
|
},
|
|
956
747
|
execute: async (input) => {
|
|
957
|
-
const key =
|
|
748
|
+
const key = ensureApiKey()
|
|
958
749
|
const params = parseToolInput(input)
|
|
959
750
|
return callSuperagnt(key, 'POST', '/tags', undefined, params)
|
|
960
751
|
},
|
|
@@ -984,7 +775,7 @@ export default async function register(api) {
|
|
|
984
775
|
]
|
|
985
776
|
},
|
|
986
777
|
execute: async (input) => {
|
|
987
|
-
const key =
|
|
778
|
+
const key = ensureApiKey()
|
|
988
779
|
const params = parseToolInput(input)
|
|
989
780
|
return callSuperagnt(key, 'PATCH', '/tags/{id}', undefined, params)
|
|
990
781
|
},
|
|
@@ -1011,7 +802,7 @@ export default async function register(api) {
|
|
|
1011
802
|
}
|
|
1012
803
|
},
|
|
1013
804
|
execute: async (input) => {
|
|
1014
|
-
const key =
|
|
805
|
+
const key = ensureApiKey()
|
|
1015
806
|
const params = parseToolInput(input)
|
|
1016
807
|
return callSuperagnt(key, 'GET', '/folders', params)
|
|
1017
808
|
},
|
|
@@ -1037,7 +828,7 @@ export default async function register(api) {
|
|
|
1037
828
|
]
|
|
1038
829
|
},
|
|
1039
830
|
execute: async (input) => {
|
|
1040
|
-
const key =
|
|
831
|
+
const key = ensureApiKey()
|
|
1041
832
|
const params = parseToolInput(input)
|
|
1042
833
|
return callSuperagnt(key, 'POST', '/folders', undefined, params)
|
|
1043
834
|
},
|
|
@@ -1067,7 +858,7 @@ export default async function register(api) {
|
|
|
1067
858
|
]
|
|
1068
859
|
},
|
|
1069
860
|
execute: async (input) => {
|
|
1070
|
-
const key =
|
|
861
|
+
const key = ensureApiKey()
|
|
1071
862
|
const params = parseToolInput(input)
|
|
1072
863
|
return callSuperagnt(key, 'PATCH', '/folders/{id}', undefined, params)
|
|
1073
864
|
},
|
|
@@ -1089,7 +880,7 @@ export default async function register(api) {
|
|
|
1089
880
|
]
|
|
1090
881
|
},
|
|
1091
882
|
execute: async (input) => {
|
|
1092
|
-
const key =
|
|
883
|
+
const key = ensureApiKey()
|
|
1093
884
|
const params = parseToolInput(input)
|
|
1094
885
|
return callSuperagnt(key, 'DELETE', '/folders/{id}', undefined, params)
|
|
1095
886
|
},
|
|
@@ -1140,7 +931,7 @@ export default async function register(api) {
|
|
|
1140
931
|
}
|
|
1141
932
|
},
|
|
1142
933
|
execute: async (input) => {
|
|
1143
|
-
const key =
|
|
934
|
+
const key = ensureApiKey()
|
|
1144
935
|
const params = parseToolInput(input)
|
|
1145
936
|
return callSuperagnt(key, 'GET', '/customers', params)
|
|
1146
937
|
},
|
|
@@ -1166,7 +957,7 @@ export default async function register(api) {
|
|
|
1166
957
|
]
|
|
1167
958
|
},
|
|
1168
959
|
execute: async (input) => {
|
|
1169
|
-
const key =
|
|
960
|
+
const key = ensureApiKey()
|
|
1170
961
|
const params = parseToolInput(input)
|
|
1171
962
|
return callSuperagnt(key, 'GET', '/customers/{id}', params)
|
|
1172
963
|
},
|
|
@@ -1204,7 +995,7 @@ export default async function register(api) {
|
|
|
1204
995
|
]
|
|
1205
996
|
},
|
|
1206
997
|
execute: async (input) => {
|
|
1207
|
-
const key =
|
|
998
|
+
const key = ensureApiKey()
|
|
1208
999
|
const params = parseToolInput(input)
|
|
1209
1000
|
return callSuperagnt(key, 'PATCH', '/customers/{id}', undefined, params)
|
|
1210
1001
|
},
|
|
@@ -1226,7 +1017,7 @@ export default async function register(api) {
|
|
|
1226
1017
|
]
|
|
1227
1018
|
},
|
|
1228
1019
|
execute: async (input) => {
|
|
1229
|
-
const key =
|
|
1020
|
+
const key = ensureApiKey()
|
|
1230
1021
|
const params = parseToolInput(input)
|
|
1231
1022
|
return callSuperagnt(key, 'DELETE', '/customers/{id}', undefined, params)
|
|
1232
1023
|
},
|
|
@@ -1264,7 +1055,7 @@ export default async function register(api) {
|
|
|
1264
1055
|
]
|
|
1265
1056
|
},
|
|
1266
1057
|
execute: async (input) => {
|
|
1267
|
-
const key =
|
|
1058
|
+
const key = ensureApiKey()
|
|
1268
1059
|
const params = parseToolInput(input)
|
|
1269
1060
|
return callSuperagnt(key, 'POST', '/domains', undefined, params)
|
|
1270
1061
|
},
|
|
@@ -1302,7 +1093,7 @@ export default async function register(api) {
|
|
|
1302
1093
|
]
|
|
1303
1094
|
},
|
|
1304
1095
|
execute: async (input) => {
|
|
1305
|
-
const key =
|
|
1096
|
+
const key = ensureApiKey()
|
|
1306
1097
|
const params = parseToolInput(input)
|
|
1307
1098
|
return callSuperagnt(key, 'PATCH', '/domains/{slug}', undefined, params)
|
|
1308
1099
|
},
|
|
@@ -1324,7 +1115,7 @@ export default async function register(api) {
|
|
|
1324
1115
|
]
|
|
1325
1116
|
},
|
|
1326
1117
|
execute: async (input) => {
|
|
1327
|
-
const key =
|
|
1118
|
+
const key = ensureApiKey()
|
|
1328
1119
|
const params = parseToolInput(input)
|
|
1329
1120
|
return callSuperagnt(key, 'DELETE', '/domains/{slug}', undefined, params)
|
|
1330
1121
|
},
|
|
@@ -1380,7 +1171,7 @@ export default async function register(api) {
|
|
|
1380
1171
|
]
|
|
1381
1172
|
},
|
|
1382
1173
|
execute: async (input) => {
|
|
1383
|
-
const key =
|
|
1174
|
+
const key = ensureApiKey()
|
|
1384
1175
|
const params = parseToolInput(input)
|
|
1385
1176
|
return callSuperagnt(key, 'POST', '/track/lead', undefined, params)
|
|
1386
1177
|
},
|
|
@@ -1447,7 +1238,7 @@ export default async function register(api) {
|
|
|
1447
1238
|
]
|
|
1448
1239
|
},
|
|
1449
1240
|
execute: async (input) => {
|
|
1450
|
-
const key =
|
|
1241
|
+
const key = ensureApiKey()
|
|
1451
1242
|
const params = parseToolInput(input)
|
|
1452
1243
|
return callSuperagnt(key, 'POST', '/track/sale', undefined, params)
|
|
1453
1244
|
},
|
|
@@ -1502,7 +1293,7 @@ export default async function register(api) {
|
|
|
1502
1293
|
}
|
|
1503
1294
|
},
|
|
1504
1295
|
execute: async (input) => {
|
|
1505
|
-
const key =
|
|
1296
|
+
const key = ensureApiKey()
|
|
1506
1297
|
const params = parseToolInput(input)
|
|
1507
1298
|
return callSuperagnt(key, 'GET', '/partners', params)
|
|
1508
1299
|
},
|
|
@@ -1556,7 +1347,7 @@ export default async function register(api) {
|
|
|
1556
1347
|
]
|
|
1557
1348
|
},
|
|
1558
1349
|
execute: async (input) => {
|
|
1559
|
-
const key =
|
|
1350
|
+
const key = ensureApiKey()
|
|
1560
1351
|
const params = parseToolInput(input)
|
|
1561
1352
|
return callSuperagnt(key, 'POST', '/partners', undefined, params)
|
|
1562
1353
|
},
|
|
@@ -1579,7 +1370,7 @@ export default async function register(api) {
|
|
|
1579
1370
|
}
|
|
1580
1371
|
},
|
|
1581
1372
|
execute: async (input) => {
|
|
1582
|
-
const key =
|
|
1373
|
+
const key = ensureApiKey()
|
|
1583
1374
|
const params = parseToolInput(input)
|
|
1584
1375
|
return callSuperagnt(key, 'GET', '/partners/links', params)
|
|
1585
1376
|
},
|
|
@@ -1593,7 +1384,7 @@ export default async function register(api) {
|
|
|
1593
1384
|
"properties": {}
|
|
1594
1385
|
},
|
|
1595
1386
|
execute: async (input) => {
|
|
1596
|
-
const key =
|
|
1387
|
+
const key = ensureApiKey()
|
|
1597
1388
|
const params = parseToolInput(input)
|
|
1598
1389
|
return callSuperagnt(key, 'POST', '/partners/links', undefined, params)
|
|
1599
1390
|
},
|
|
@@ -1607,7 +1398,7 @@ export default async function register(api) {
|
|
|
1607
1398
|
"properties": {}
|
|
1608
1399
|
},
|
|
1609
1400
|
execute: async (input) => {
|
|
1610
|
-
const key =
|
|
1401
|
+
const key = ensureApiKey()
|
|
1611
1402
|
const params = parseToolInput(input)
|
|
1612
1403
|
return callSuperagnt(key, 'PUT', '/partners/links/upsert', undefined, params)
|
|
1613
1404
|
},
|
|
@@ -1637,7 +1428,7 @@ export default async function register(api) {
|
|
|
1637
1428
|
]
|
|
1638
1429
|
},
|
|
1639
1430
|
execute: async (input) => {
|
|
1640
|
-
const key =
|
|
1431
|
+
const key = ensureApiKey()
|
|
1641
1432
|
const params = parseToolInput(input)
|
|
1642
1433
|
return callSuperagnt(key, 'POST', '/partners/ban', undefined, params)
|
|
1643
1434
|
},
|
|
@@ -1660,7 +1451,7 @@ export default async function register(api) {
|
|
|
1660
1451
|
}
|
|
1661
1452
|
},
|
|
1662
1453
|
execute: async (input) => {
|
|
1663
|
-
const key =
|
|
1454
|
+
const key = ensureApiKey()
|
|
1664
1455
|
const params = parseToolInput(input)
|
|
1665
1456
|
return callSuperagnt(key, 'POST', '/partners/deactivate', undefined, params)
|
|
1666
1457
|
},
|
|
@@ -1710,7 +1501,7 @@ export default async function register(api) {
|
|
|
1710
1501
|
]
|
|
1711
1502
|
},
|
|
1712
1503
|
execute: async (input) => {
|
|
1713
|
-
const key =
|
|
1504
|
+
const key = ensureApiKey()
|
|
1714
1505
|
const params = parseToolInput(input)
|
|
1715
1506
|
return callSuperagnt(key, 'GET', '/bounties/{bountyId}/submissions', params)
|
|
1716
1507
|
},
|
|
@@ -1741,7 +1532,7 @@ export default async function register(api) {
|
|
|
1741
1532
|
]
|
|
1742
1533
|
},
|
|
1743
1534
|
execute: async (input) => {
|
|
1744
|
-
const key =
|
|
1535
|
+
const key = ensureApiKey()
|
|
1745
1536
|
const params = parseToolInput(input)
|
|
1746
1537
|
return callSuperagnt(key, 'POST', '/bounties/{bountyId}/submissions/{submissionId}/approve', undefined, params)
|
|
1747
1538
|
},
|
|
@@ -1776,7 +1567,7 @@ export default async function register(api) {
|
|
|
1776
1567
|
]
|
|
1777
1568
|
},
|
|
1778
1569
|
execute: async (input) => {
|
|
1779
|
-
const key =
|
|
1570
|
+
const key = ensureApiKey()
|
|
1780
1571
|
const params = parseToolInput(input)
|
|
1781
1572
|
return callSuperagnt(key, 'POST', '/bounties/{bountyId}/submissions/{submissionId}/reject', undefined, params)
|
|
1782
1573
|
},
|
|
@@ -1863,7 +1654,7 @@ export default async function register(api) {
|
|
|
1863
1654
|
}
|
|
1864
1655
|
},
|
|
1865
1656
|
execute: async (input) => {
|
|
1866
|
-
const key =
|
|
1657
|
+
const key = ensureApiKey()
|
|
1867
1658
|
const params = parseToolInput(input)
|
|
1868
1659
|
return callSuperagnt(key, 'GET', '/commissions', params)
|
|
1869
1660
|
},
|
|
@@ -1913,7 +1704,7 @@ export default async function register(api) {
|
|
|
1913
1704
|
]
|
|
1914
1705
|
},
|
|
1915
1706
|
execute: async (input) => {
|
|
1916
|
-
const key =
|
|
1707
|
+
const key = ensureApiKey()
|
|
1917
1708
|
const params = parseToolInput(input)
|
|
1918
1709
|
return callSuperagnt(key, 'PATCH', '/commissions/{id}', undefined, params)
|
|
1919
1710
|
},
|
|
@@ -1960,12 +1751,9 @@ export default async function register(api) {
|
|
|
1960
1751
|
}
|
|
1961
1752
|
},
|
|
1962
1753
|
execute: async (input) => {
|
|
1963
|
-
const key =
|
|
1754
|
+
const key = ensureApiKey()
|
|
1964
1755
|
const params = parseToolInput(input)
|
|
1965
1756
|
return callSuperagnt(key, 'GET', '/payouts', params)
|
|
1966
1757
|
},
|
|
1967
1758
|
})
|
|
1968
|
-
|
|
1969
|
-
promptState.toolCount = 41
|
|
1970
|
-
promptState.ready = true
|
|
1971
1759
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,52 @@
|
|
|
2
2
|
"id": "dub-links",
|
|
3
3
|
"name": "Dub Integration",
|
|
4
4
|
"description": "OpenClaw plugin for Dub — manage short links, conversion events, customers, tags, folders, and domains with your superagnt API key.",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.3",
|
|
6
|
+
"contracts": {
|
|
7
|
+
"tools": [
|
|
8
|
+
"superagnt_connection_dub_getLinks",
|
|
9
|
+
"superagnt_connection_dub_createLink",
|
|
10
|
+
"superagnt_connection_dub_upsertLink",
|
|
11
|
+
"superagnt_connection_dub_getLinkInfo",
|
|
12
|
+
"superagnt_connection_dub_getLinksCount",
|
|
13
|
+
"superagnt_connection_dub_updateLink",
|
|
14
|
+
"superagnt_connection_dub_deleteLink",
|
|
15
|
+
"superagnt_connection_dub_bulkCreateLinks",
|
|
16
|
+
"superagnt_connection_dub_bulkUpdateLinks",
|
|
17
|
+
"superagnt_connection_dub_bulkDeleteLinks",
|
|
18
|
+
"superagnt_connection_dub_retrieveAnalytics",
|
|
19
|
+
"superagnt_connection_dub_listEvents",
|
|
20
|
+
"superagnt_connection_dub_getTags",
|
|
21
|
+
"superagnt_connection_dub_createTag",
|
|
22
|
+
"superagnt_connection_dub_updateTag",
|
|
23
|
+
"superagnt_connection_dub_listFolders",
|
|
24
|
+
"superagnt_connection_dub_createFolder",
|
|
25
|
+
"superagnt_connection_dub_updateFolder",
|
|
26
|
+
"superagnt_connection_dub_deleteFolder",
|
|
27
|
+
"superagnt_connection_dub_listCustomers",
|
|
28
|
+
"superagnt_connection_dub_getCustomer",
|
|
29
|
+
"superagnt_connection_dub_updateCustomer",
|
|
30
|
+
"superagnt_connection_dub_deleteCustomer",
|
|
31
|
+
"superagnt_connection_dub_createDomain",
|
|
32
|
+
"superagnt_connection_dub_updateDomain",
|
|
33
|
+
"superagnt_connection_dub_deleteDomain",
|
|
34
|
+
"superagnt_connection_dub_trackLead",
|
|
35
|
+
"superagnt_connection_dub_trackSale",
|
|
36
|
+
"superagnt_connection_dub_listPartners",
|
|
37
|
+
"superagnt_connection_dub_createPartner",
|
|
38
|
+
"superagnt_connection_dub_retrievePartnerLinks",
|
|
39
|
+
"superagnt_connection_dub_createPartnerLink",
|
|
40
|
+
"superagnt_connection_dub_upsertPartnerLink",
|
|
41
|
+
"superagnt_connection_dub_banPartner",
|
|
42
|
+
"superagnt_connection_dub_deactivatePartner",
|
|
43
|
+
"superagnt_connection_dub_listBountySubmissions",
|
|
44
|
+
"superagnt_connection_dub_approveBountySubmission",
|
|
45
|
+
"superagnt_connection_dub_rejectBountySubmission",
|
|
46
|
+
"superagnt_connection_dub_listCommissions",
|
|
47
|
+
"superagnt_connection_dub_updateCommission",
|
|
48
|
+
"superagnt_connection_dub_listPayouts"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
6
51
|
"configSchema": {
|
|
7
52
|
"type": "object",
|
|
8
53
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superagnt/dub-links",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenClaw plugin for Dub — manage short links, conversion events, customers, tags, folders, and domains with your superagnt API key.",
|
|
6
6
|
"main": "index.js",
|