@dominusnode/pi-extension 1.1.0 → 1.3.0
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/CHANGELOG.md +1 -0
- package/README.md +63 -34
- package/dist/index.d.ts +1 -1
- package/dist/index.js +471 -32
- package/dist/toolkit.d.ts +38 -1
- package/dist/toolkit.js +784 -54
- package/package.json +3 -1
- package/skills/use-dominus-proxy.md +37 -31
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Dominus Node — Pi Extension
|
|
4
4
|
*
|
|
5
|
-
* Pi-mono extension providing
|
|
5
|
+
* Pi-mono extension providing 53 tools for the Dominus Node rotating proxy
|
|
6
6
|
* and management platform. Loaded by the pi coding agent from:
|
|
7
7
|
* ~/.pi/agent/extensions/dominusnode/ (global)
|
|
8
8
|
* .pi/extensions/dominusnode/ (project-local)
|
|
@@ -49,14 +49,20 @@ function dominusNodeExtension(pi) {
|
|
|
49
49
|
"Use for web scraping, bypassing geo-restrictions, or rotating IPs. " +
|
|
50
50
|
"Only GET, HEAD, and OPTIONS are permitted. Private/internal URLs are blocked.",
|
|
51
51
|
parameters: typebox_1.Type.Object({
|
|
52
|
-
url: typebox_1.Type.String({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
], { description: "HTTP method (default: GET)" })),
|
|
56
|
-
country: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
52
|
+
url: typebox_1.Type.String({
|
|
53
|
+
description: "Target URL to fetch (http or https only)",
|
|
54
|
+
}),
|
|
55
|
+
method: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("GET"), typebox_1.Type.Literal("HEAD"), typebox_1.Type.Literal("OPTIONS")], { description: "HTTP method (default: GET)" })),
|
|
56
|
+
country: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
57
|
+
description: "ISO 3166-1 two-letter country code for geo-targeting (e.g. US, GB, DE)",
|
|
58
|
+
})),
|
|
57
59
|
proxyType: typebox_1.Type.Optional(typebox_1.Type.Union([
|
|
58
|
-
typebox_1.Type.Literal("dc"),
|
|
59
|
-
|
|
60
|
+
typebox_1.Type.Literal("dc"),
|
|
61
|
+
typebox_1.Type.Literal("residential"),
|
|
62
|
+
typebox_1.Type.Literal("auto"),
|
|
63
|
+
], {
|
|
64
|
+
description: "Proxy pool: 'dc' (datacenter, $3/GB), 'residential' ($5/GB), or 'auto' (default: dc)",
|
|
65
|
+
})),
|
|
60
66
|
}),
|
|
61
67
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
62
68
|
return toolkit.proxiedFetch(String(params.url ?? ""), String(params.method ?? "GET"), params.country ? String(params.country) : undefined, String(params.proxyType ?? "dc"));
|
|
@@ -78,7 +84,11 @@ function dominusNodeExtension(pi) {
|
|
|
78
84
|
label: "DominusNode: Check Bandwidth Usage",
|
|
79
85
|
description: "Get bandwidth usage statistics for the past N days (1–365). Shows bytes consumed by datacenter and residential proxy pools.",
|
|
80
86
|
parameters: typebox_1.Type.Object({
|
|
81
|
-
days: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
87
|
+
days: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
88
|
+
description: "Number of days to look back (default: 30, max: 365)",
|
|
89
|
+
minimum: 1,
|
|
90
|
+
maximum: 365,
|
|
91
|
+
})),
|
|
82
92
|
}),
|
|
83
93
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
84
94
|
return toolkit.checkUsage(params.days !== undefined ? Number(params.days) : 30);
|
|
@@ -111,11 +121,19 @@ function dominusNodeExtension(pi) {
|
|
|
111
121
|
description: "Create a server-side sub-wallet for an AI agent with an optional per-transaction spending limit. " +
|
|
112
122
|
"Useful for giving sub-agents controlled budgets. Wallets are funded from the main wallet.",
|
|
113
123
|
parameters: typebox_1.Type.Object({
|
|
114
|
-
label: typebox_1.Type.String({
|
|
115
|
-
|
|
124
|
+
label: typebox_1.Type.String({
|
|
125
|
+
description: "Human-readable name for this wallet (e.g. 'research-agent-1')",
|
|
126
|
+
}),
|
|
127
|
+
spendingLimitCents: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
128
|
+
description: "Maximum spend per transaction in cents (e.g. 500 = $5.00)",
|
|
129
|
+
minimum: 1,
|
|
130
|
+
maximum: 1000000,
|
|
131
|
+
})),
|
|
116
132
|
}),
|
|
117
133
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
118
|
-
return toolkit.createAgenticWallet(String(params.label ?? ""), params.spendingLimitCents !== undefined
|
|
134
|
+
return toolkit.createAgenticWallet(String(params.label ?? ""), params.spendingLimitCents !== undefined
|
|
135
|
+
? Number(params.spendingLimitCents)
|
|
136
|
+
: undefined);
|
|
119
137
|
},
|
|
120
138
|
});
|
|
121
139
|
// ── Tool 7: fund_agentic_wallet ──────────────────────────────────────────
|
|
@@ -124,8 +142,13 @@ function dominusNodeExtension(pi) {
|
|
|
124
142
|
label: "DominusNode: Fund Agentic Wallet",
|
|
125
143
|
description: "Transfer funds from the main wallet to an agentic sub-wallet. Amount in cents (e.g. 1000 = $10.00).",
|
|
126
144
|
parameters: typebox_1.Type.Object({
|
|
127
|
-
walletId: typebox_1.Type.String({
|
|
128
|
-
|
|
145
|
+
walletId: typebox_1.Type.String({
|
|
146
|
+
description: "UUID of the agentic wallet to fund",
|
|
147
|
+
}),
|
|
148
|
+
amountCents: typebox_1.Type.Number({
|
|
149
|
+
description: "Amount to transfer in cents (e.g. 1000 = $10.00)",
|
|
150
|
+
minimum: 1,
|
|
151
|
+
}),
|
|
129
152
|
}),
|
|
130
153
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
131
154
|
return toolkit.fundAgenticWallet(String(params.walletId ?? ""), Number(params.amountCents));
|
|
@@ -160,7 +183,11 @@ function dominusNodeExtension(pi) {
|
|
|
160
183
|
description: "List recent transactions for an agentic sub-wallet.",
|
|
161
184
|
parameters: typebox_1.Type.Object({
|
|
162
185
|
walletId: typebox_1.Type.String({ description: "UUID of the agentic wallet" }),
|
|
163
|
-
limit: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
186
|
+
limit: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
187
|
+
description: "Number of transactions to return (default: 20, max: 100)",
|
|
188
|
+
minimum: 1,
|
|
189
|
+
maximum: 100,
|
|
190
|
+
})),
|
|
164
191
|
}),
|
|
165
192
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
166
193
|
return toolkit.agenticTransactions(String(params.walletId ?? ""), params.limit !== undefined ? Number(params.limit) : 20);
|
|
@@ -172,7 +199,9 @@ function dominusNodeExtension(pi) {
|
|
|
172
199
|
label: "DominusNode: Freeze Agentic Wallet",
|
|
173
200
|
description: "Freeze an agentic sub-wallet to prevent further spending. The wallet must be unfrozen before it can be deleted.",
|
|
174
201
|
parameters: typebox_1.Type.Object({
|
|
175
|
-
walletId: typebox_1.Type.String({
|
|
202
|
+
walletId: typebox_1.Type.String({
|
|
203
|
+
description: "UUID of the agentic wallet to freeze",
|
|
204
|
+
}),
|
|
176
205
|
}),
|
|
177
206
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
178
207
|
return toolkit.freezeAgenticWallet(String(params.walletId ?? ""));
|
|
@@ -184,7 +213,9 @@ function dominusNodeExtension(pi) {
|
|
|
184
213
|
label: "DominusNode: Unfreeze Agentic Wallet",
|
|
185
214
|
description: "Unfreeze a previously frozen agentic sub-wallet to resume spending.",
|
|
186
215
|
parameters: typebox_1.Type.Object({
|
|
187
|
-
walletId: typebox_1.Type.String({
|
|
216
|
+
walletId: typebox_1.Type.String({
|
|
217
|
+
description: "UUID of the agentic wallet to unfreeze",
|
|
218
|
+
}),
|
|
188
219
|
}),
|
|
189
220
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
190
221
|
return toolkit.unfreezeAgenticWallet(String(params.walletId ?? ""));
|
|
@@ -196,7 +227,9 @@ function dominusNodeExtension(pi) {
|
|
|
196
227
|
label: "DominusNode: Delete Agentic Wallet",
|
|
197
228
|
description: "Permanently delete an agentic sub-wallet. Any remaining balance is returned to the main wallet. The wallet must be frozen first.",
|
|
198
229
|
parameters: typebox_1.Type.Object({
|
|
199
|
-
walletId: typebox_1.Type.String({
|
|
230
|
+
walletId: typebox_1.Type.String({
|
|
231
|
+
description: "UUID of the agentic wallet to delete (must be frozen first)",
|
|
232
|
+
}),
|
|
200
233
|
}),
|
|
201
234
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
202
235
|
return toolkit.deleteAgenticWallet(String(params.walletId ?? ""));
|
|
@@ -209,7 +242,11 @@ function dominusNodeExtension(pi) {
|
|
|
209
242
|
description: "Create a new team with a shared wallet. Teams allow multiple users or agents to share bandwidth and billing.",
|
|
210
243
|
parameters: typebox_1.Type.Object({
|
|
211
244
|
name: typebox_1.Type.String({ description: "Team name" }),
|
|
212
|
-
maxMembers: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
245
|
+
maxMembers: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
246
|
+
description: "Maximum number of members (default: 10, max: 100)",
|
|
247
|
+
minimum: 1,
|
|
248
|
+
maximum: 100,
|
|
249
|
+
})),
|
|
213
250
|
}),
|
|
214
251
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
215
252
|
return toolkit.createTeam(String(params.name ?? ""), params.maxMembers !== undefined ? Number(params.maxMembers) : 10);
|
|
@@ -221,7 +258,11 @@ function dominusNodeExtension(pi) {
|
|
|
221
258
|
label: "DominusNode: List Teams",
|
|
222
259
|
description: "List all teams the current account belongs to.",
|
|
223
260
|
parameters: typebox_1.Type.Object({
|
|
224
|
-
limit: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
261
|
+
limit: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
262
|
+
description: "Number of teams to return (default: 20, max: 100)",
|
|
263
|
+
minimum: 1,
|
|
264
|
+
maximum: 100,
|
|
265
|
+
})),
|
|
225
266
|
}),
|
|
226
267
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
227
268
|
return toolkit.listTeams(params.limit !== undefined ? Number(params.limit) : 20);
|
|
@@ -246,7 +287,10 @@ function dominusNodeExtension(pi) {
|
|
|
246
287
|
description: "Transfer funds from the main wallet to a team's shared wallet. Amount in cents.",
|
|
247
288
|
parameters: typebox_1.Type.Object({
|
|
248
289
|
teamId: typebox_1.Type.String({ description: "UUID of the team" }),
|
|
249
|
-
amountCents: typebox_1.Type.Number({
|
|
290
|
+
amountCents: typebox_1.Type.Number({
|
|
291
|
+
description: "Amount to transfer in cents (e.g. 1000 = $10.00)",
|
|
292
|
+
minimum: 1,
|
|
293
|
+
}),
|
|
250
294
|
}),
|
|
251
295
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
252
296
|
return toolkit.teamFund(String(params.teamId ?? ""), Number(params.amountCents));
|
|
@@ -259,7 +303,9 @@ function dominusNodeExtension(pi) {
|
|
|
259
303
|
description: "Generate a new API key scoped to a team. Traffic through this key bills to the team wallet. The key is shown only once.",
|
|
260
304
|
parameters: typebox_1.Type.Object({
|
|
261
305
|
teamId: typebox_1.Type.String({ description: "UUID of the team" }),
|
|
262
|
-
label: typebox_1.Type.String({
|
|
306
|
+
label: typebox_1.Type.String({
|
|
307
|
+
description: "Label for the API key (e.g. 'research-agent')",
|
|
308
|
+
}),
|
|
263
309
|
}),
|
|
264
310
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
265
311
|
return toolkit.teamCreateApiKey(String(params.teamId ?? ""), String(params.label ?? ""));
|
|
@@ -272,7 +318,11 @@ function dominusNodeExtension(pi) {
|
|
|
272
318
|
description: "Get bandwidth usage statistics for a team over the past N days.",
|
|
273
319
|
parameters: typebox_1.Type.Object({
|
|
274
320
|
teamId: typebox_1.Type.String({ description: "UUID of the team" }),
|
|
275
|
-
days: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
321
|
+
days: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
322
|
+
description: "Number of days to look back (default: 30, max: 365)",
|
|
323
|
+
minimum: 1,
|
|
324
|
+
maximum: 365,
|
|
325
|
+
})),
|
|
276
326
|
}),
|
|
277
327
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
278
328
|
return toolkit.teamUsage(String(params.teamId ?? ""), params.days !== undefined ? Number(params.days) : 30);
|
|
@@ -286,7 +336,11 @@ function dominusNodeExtension(pi) {
|
|
|
286
336
|
parameters: typebox_1.Type.Object({
|
|
287
337
|
teamId: typebox_1.Type.String({ description: "UUID of the team" }),
|
|
288
338
|
name: typebox_1.Type.Optional(typebox_1.Type.String({ description: "New team name" })),
|
|
289
|
-
maxMembers: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
339
|
+
maxMembers: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
340
|
+
description: "New maximum member count (1–100)",
|
|
341
|
+
minimum: 1,
|
|
342
|
+
maximum: 100,
|
|
343
|
+
})),
|
|
290
344
|
}),
|
|
291
345
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
292
346
|
return toolkit.updateTeam(String(params.teamId ?? ""), params.name !== undefined ? String(params.name) : undefined, params.maxMembers !== undefined ? Number(params.maxMembers) : undefined);
|
|
@@ -300,7 +354,9 @@ function dominusNodeExtension(pi) {
|
|
|
300
354
|
parameters: typebox_1.Type.Object({
|
|
301
355
|
teamId: typebox_1.Type.String({ description: "UUID of the team" }),
|
|
302
356
|
userId: typebox_1.Type.String({ description: "UUID of the user to update" }),
|
|
303
|
-
role: typebox_1.Type.Union([typebox_1.Type.Literal("admin"), typebox_1.Type.Literal("member")], {
|
|
357
|
+
role: typebox_1.Type.Union([typebox_1.Type.Literal("admin"), typebox_1.Type.Literal("member")], {
|
|
358
|
+
description: "New role: 'admin' or 'member'",
|
|
359
|
+
}),
|
|
304
360
|
}),
|
|
305
361
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
306
362
|
return toolkit.updateTeamMemberRole(String(params.teamId ?? ""), String(params.userId ?? ""), String(params.role ?? ""));
|
|
@@ -312,7 +368,11 @@ function dominusNodeExtension(pi) {
|
|
|
312
368
|
label: "DominusNode: Top Up Wallet via PayPal",
|
|
313
369
|
description: "Create a PayPal checkout session to add funds to the Dominus Node wallet. Returns a payment URL to redirect the user to.",
|
|
314
370
|
parameters: typebox_1.Type.Object({
|
|
315
|
-
amountCents: typebox_1.Type.Number({
|
|
371
|
+
amountCents: typebox_1.Type.Number({
|
|
372
|
+
description: "Amount to add in cents (min: 500 = $5.00, max: 1,000,000 = $10,000.00)",
|
|
373
|
+
minimum: 500,
|
|
374
|
+
maximum: 1000000,
|
|
375
|
+
}),
|
|
316
376
|
}),
|
|
317
377
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
318
378
|
return toolkit.topupPaypal(Number(params.amountCents));
|
|
@@ -324,7 +384,11 @@ function dominusNodeExtension(pi) {
|
|
|
324
384
|
label: "DominusNode: Top Up Wallet via Stripe",
|
|
325
385
|
description: "Create a Stripe checkout session to add funds to the Dominus Node wallet. Supports cards and Link. Returns a payment URL.",
|
|
326
386
|
parameters: typebox_1.Type.Object({
|
|
327
|
-
amountCents: typebox_1.Type.Number({
|
|
387
|
+
amountCents: typebox_1.Type.Number({
|
|
388
|
+
description: "Amount to add in cents (min: 500 = $5.00, max: 1,000,000 = $10,000.00)",
|
|
389
|
+
minimum: 500,
|
|
390
|
+
maximum: 1000000,
|
|
391
|
+
}),
|
|
328
392
|
}),
|
|
329
393
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
330
394
|
return toolkit.topupStripe(Number(params.amountCents));
|
|
@@ -338,8 +402,14 @@ function dominusNodeExtension(pi) {
|
|
|
338
402
|
"Supported currencies: BTC, ETH, LTC, XMR, ZEC, USDC, SOL, USDT, DAI, BNB, LINK. " +
|
|
339
403
|
"Returns a payment address and invoice details.",
|
|
340
404
|
parameters: typebox_1.Type.Object({
|
|
341
|
-
amountUsd: typebox_1.Type.Number({
|
|
342
|
-
|
|
405
|
+
amountUsd: typebox_1.Type.Number({
|
|
406
|
+
description: "Amount in USD (min: $5, max: $10,000)",
|
|
407
|
+
minimum: 5,
|
|
408
|
+
maximum: 10000,
|
|
409
|
+
}),
|
|
410
|
+
currency: typebox_1.Type.String({
|
|
411
|
+
description: "Crypto currency code: BTC, ETH, LTC, XMR, ZEC, USDC, SOL, USDT, DAI, BNB, or LINK",
|
|
412
|
+
}),
|
|
343
413
|
}),
|
|
344
414
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
345
415
|
return toolkit.topupCrypto(Number(params.amountUsd), String(params.currency ?? ""));
|
|
@@ -363,11 +433,380 @@ function dominusNodeExtension(pi) {
|
|
|
363
433
|
description: "Update spending policy for an agentic sub-wallet: set a daily spending limit or restrict it to allowed domains.",
|
|
364
434
|
parameters: typebox_1.Type.Object({
|
|
365
435
|
walletId: typebox_1.Type.String({ description: "UUID of the agentic wallet" }),
|
|
366
|
-
dailyLimitCents: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
367
|
-
|
|
436
|
+
dailyLimitCents: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
437
|
+
description: "Daily spending limit in cents (0 = no limit)",
|
|
438
|
+
minimum: 0,
|
|
439
|
+
maximum: 1000000,
|
|
440
|
+
})),
|
|
441
|
+
allowedDomains: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String(), {
|
|
442
|
+
description: "List of domains this wallet is permitted to make requests to (e.g. ['example.com', 'api.service.io'])",
|
|
443
|
+
})),
|
|
368
444
|
}),
|
|
369
445
|
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
370
|
-
return toolkit.updateWalletPolicy(String(params.walletId ?? ""), params.dailyLimitCents !== undefined
|
|
446
|
+
return toolkit.updateWalletPolicy(String(params.walletId ?? ""), params.dailyLimitCents !== undefined
|
|
447
|
+
? Number(params.dailyLimitCents)
|
|
448
|
+
: undefined, params.allowedDomains !== undefined
|
|
449
|
+
? params.allowedDomains
|
|
450
|
+
: undefined);
|
|
451
|
+
},
|
|
452
|
+
});
|
|
453
|
+
// ── Tool 27: get_proxy_status ───────────────────────────────────────────
|
|
454
|
+
pi.registerTool({
|
|
455
|
+
name: "dominusnode_get_proxy_status",
|
|
456
|
+
label: "DominusNode: Get Proxy Status",
|
|
457
|
+
description: "Get the current status of the proxy gateway including uptime, active connections, and pool health.",
|
|
458
|
+
parameters: typebox_1.Type.Object({}),
|
|
459
|
+
async execute(_id, _params, _signal, _onUpdate, _ctx) {
|
|
460
|
+
return toolkit.getProxyStatus();
|
|
461
|
+
},
|
|
462
|
+
});
|
|
463
|
+
// ── Tool 28: get_transactions ───────────────────────────────────────────
|
|
464
|
+
pi.registerTool({
|
|
465
|
+
name: "dominusnode_get_transactions",
|
|
466
|
+
label: "DominusNode: Get Wallet Transactions",
|
|
467
|
+
description: "Get wallet transaction history showing top-ups, charges, and refunds.",
|
|
468
|
+
parameters: typebox_1.Type.Object({
|
|
469
|
+
limit: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
470
|
+
description: "Number of transactions to return (default: 20, max: 100)",
|
|
471
|
+
minimum: 1,
|
|
472
|
+
maximum: 100,
|
|
473
|
+
})),
|
|
474
|
+
}),
|
|
475
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
476
|
+
return toolkit.getTransactions(params.limit !== undefined ? Number(params.limit) : 20);
|
|
477
|
+
},
|
|
478
|
+
});
|
|
479
|
+
// ── Tool 29: get_forecast ──────────────────────────────────────────────
|
|
480
|
+
pi.registerTool({
|
|
481
|
+
name: "dominusnode_get_forecast",
|
|
482
|
+
label: "DominusNode: Get Spending Forecast",
|
|
483
|
+
description: "Get a spending forecast based on recent usage patterns. " +
|
|
484
|
+
"Shows estimated days until balance runs out and projected monthly cost.",
|
|
485
|
+
parameters: typebox_1.Type.Object({}),
|
|
486
|
+
async execute(_id, _params, _signal, _onUpdate, _ctx) {
|
|
487
|
+
return toolkit.getForecast();
|
|
488
|
+
},
|
|
489
|
+
});
|
|
490
|
+
// ── Tool 30: check_payment ─────────────────────────────────────────────
|
|
491
|
+
pi.registerTool({
|
|
492
|
+
name: "dominusnode_check_payment",
|
|
493
|
+
label: "DominusNode: Check Crypto Payment Status",
|
|
494
|
+
description: "Check the status of a crypto top-up payment by invoice ID. " +
|
|
495
|
+
"Returns payment status (pending, confirming, completed, expired).",
|
|
496
|
+
parameters: typebox_1.Type.Object({
|
|
497
|
+
invoiceId: typebox_1.Type.String({
|
|
498
|
+
description: "Crypto invoice ID (UUID) returned from topup_crypto",
|
|
499
|
+
}),
|
|
500
|
+
}),
|
|
501
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
502
|
+
return toolkit.checkPayment(String(params.invoiceId ?? ""));
|
|
503
|
+
},
|
|
504
|
+
});
|
|
505
|
+
// ── Tool 31: get_daily_usage ───────────────────────────────────────────
|
|
506
|
+
pi.registerTool({
|
|
507
|
+
name: "dominusnode_get_daily_usage",
|
|
508
|
+
label: "DominusNode: Get Daily Usage Breakdown",
|
|
509
|
+
description: "Get daily bandwidth usage breakdown for the specified number of days. " +
|
|
510
|
+
"Returns per-day bytes transferred and cost.",
|
|
511
|
+
parameters: typebox_1.Type.Object({
|
|
512
|
+
days: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
513
|
+
description: "Number of days to look back (default: 7, max: 365)",
|
|
514
|
+
minimum: 1,
|
|
515
|
+
maximum: 365,
|
|
516
|
+
})),
|
|
517
|
+
}),
|
|
518
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
519
|
+
return toolkit.getDailyUsage(params.days !== undefined ? Number(params.days) : 7);
|
|
520
|
+
},
|
|
521
|
+
});
|
|
522
|
+
// ── Tool 32: get_top_hosts ─────────────────────────────────────────────
|
|
523
|
+
pi.registerTool({
|
|
524
|
+
name: "dominusnode_get_top_hosts",
|
|
525
|
+
label: "DominusNode: Get Top Hosts by Usage",
|
|
526
|
+
description: "Get the top hosts by bandwidth usage. Shows which domains consume the most proxy traffic.",
|
|
527
|
+
parameters: typebox_1.Type.Object({
|
|
528
|
+
limit: typebox_1.Type.Optional(typebox_1.Type.Number({
|
|
529
|
+
description: "Number of top hosts to return (default: 10, max: 100)",
|
|
530
|
+
minimum: 1,
|
|
531
|
+
maximum: 100,
|
|
532
|
+
})),
|
|
533
|
+
}),
|
|
534
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
535
|
+
return toolkit.getTopHosts(params.limit !== undefined ? Number(params.limit) : 10);
|
|
536
|
+
},
|
|
537
|
+
});
|
|
538
|
+
// ── Tool 33: register ──────────────────────────────────────────────────
|
|
539
|
+
pi.registerTool({
|
|
540
|
+
name: "dominusnode_register",
|
|
541
|
+
label: "DominusNode: Register Account",
|
|
542
|
+
description: "Register a new Dominus Node account. Does not require authentication. " +
|
|
543
|
+
"Returns user info and initial API key.",
|
|
544
|
+
parameters: typebox_1.Type.Object({
|
|
545
|
+
email: typebox_1.Type.String({ description: "Email address for the new account" }),
|
|
546
|
+
password: typebox_1.Type.String({ description: "Password (8-128 characters)" }),
|
|
547
|
+
}),
|
|
548
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
549
|
+
return toolkit.register(String(params.email ?? ""), String(params.password ?? ""));
|
|
550
|
+
},
|
|
551
|
+
});
|
|
552
|
+
// ── Tool 34: login ─────────────────────────────────────────────────────
|
|
553
|
+
pi.registerTool({
|
|
554
|
+
name: "dominusnode_login",
|
|
555
|
+
label: "DominusNode: Login",
|
|
556
|
+
description: "Log in to an existing Dominus Node account. Does not require authentication. " +
|
|
557
|
+
"Returns JWT access and refresh tokens.",
|
|
558
|
+
parameters: typebox_1.Type.Object({
|
|
559
|
+
email: typebox_1.Type.String({ description: "Account email address" }),
|
|
560
|
+
password: typebox_1.Type.String({ description: "Account password" }),
|
|
561
|
+
}),
|
|
562
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
563
|
+
return toolkit.login(String(params.email ?? ""), String(params.password ?? ""));
|
|
564
|
+
},
|
|
565
|
+
});
|
|
566
|
+
// ── Tool 35: get_account_info ──────────────────────────────────────────
|
|
567
|
+
pi.registerTool({
|
|
568
|
+
name: "dominusnode_get_account_info",
|
|
569
|
+
label: "DominusNode: Get Account Info",
|
|
570
|
+
description: "Get your account profile information including email, plan, verification status, and creation date.",
|
|
571
|
+
parameters: typebox_1.Type.Object({}),
|
|
572
|
+
async execute(_id, _params, _signal, _onUpdate, _ctx) {
|
|
573
|
+
return toolkit.getAccountInfo();
|
|
574
|
+
},
|
|
575
|
+
});
|
|
576
|
+
// ── Tool 36: verify_email ──────────────────────────────────────────────
|
|
577
|
+
pi.registerTool({
|
|
578
|
+
name: "dominusnode_verify_email",
|
|
579
|
+
label: "DominusNode: Verify Email",
|
|
580
|
+
description: "Verify an email address using the verification token sent to the user's email. " +
|
|
581
|
+
"Does not require authentication.",
|
|
582
|
+
parameters: typebox_1.Type.Object({
|
|
583
|
+
token: typebox_1.Type.String({
|
|
584
|
+
description: "Email verification token from the verification email",
|
|
585
|
+
}),
|
|
586
|
+
}),
|
|
587
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
588
|
+
return toolkit.verifyEmail(String(params.token ?? ""));
|
|
589
|
+
},
|
|
590
|
+
});
|
|
591
|
+
// ── Tool 37: resend_verification ───────────────────────────────────────
|
|
592
|
+
pi.registerTool({
|
|
593
|
+
name: "dominusnode_resend_verification",
|
|
594
|
+
label: "DominusNode: Resend Verification Email",
|
|
595
|
+
description: "Resend the email verification link. Requires authentication.",
|
|
596
|
+
parameters: typebox_1.Type.Object({}),
|
|
597
|
+
async execute(_id, _params, _signal, _onUpdate, _ctx) {
|
|
598
|
+
return toolkit.resendVerification();
|
|
599
|
+
},
|
|
600
|
+
});
|
|
601
|
+
// ── Tool 38: update_password ───────────────────────────────────────────
|
|
602
|
+
pi.registerTool({
|
|
603
|
+
name: "dominusnode_update_password",
|
|
604
|
+
label: "DominusNode: Update Password",
|
|
605
|
+
description: "Change your account password. Requires current password for verification.",
|
|
606
|
+
parameters: typebox_1.Type.Object({
|
|
607
|
+
currentPassword: typebox_1.Type.String({ description: "Current account password" }),
|
|
608
|
+
newPassword: typebox_1.Type.String({
|
|
609
|
+
description: "New password (8-128 characters)",
|
|
610
|
+
}),
|
|
611
|
+
}),
|
|
612
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
613
|
+
return toolkit.updatePassword(String(params.currentPassword ?? ""), String(params.newPassword ?? ""));
|
|
614
|
+
},
|
|
615
|
+
});
|
|
616
|
+
// ── Tool 39: list_keys ─────────────────────────────────────────────────
|
|
617
|
+
pi.registerTool({
|
|
618
|
+
name: "dominusnode_list_keys",
|
|
619
|
+
label: "DominusNode: List API Keys",
|
|
620
|
+
description: "List all your personal API keys with their labels, creation dates, and last-used timestamps.",
|
|
621
|
+
parameters: typebox_1.Type.Object({}),
|
|
622
|
+
async execute(_id, _params, _signal, _onUpdate, _ctx) {
|
|
623
|
+
return toolkit.listKeys();
|
|
624
|
+
},
|
|
625
|
+
});
|
|
626
|
+
// ── Tool 40: create_key ────────────────────────────────────────────────
|
|
627
|
+
pi.registerTool({
|
|
628
|
+
name: "dominusnode_create_key",
|
|
629
|
+
label: "DominusNode: Create API Key",
|
|
630
|
+
description: "Create a new personal API key. The key is shown only once -- save it immediately. " +
|
|
631
|
+
"Usage is billed against your personal wallet.",
|
|
632
|
+
parameters: typebox_1.Type.Object({
|
|
633
|
+
label: typebox_1.Type.String({
|
|
634
|
+
description: "Label for the API key (e.g. 'production', 'dev-testing')",
|
|
635
|
+
}),
|
|
636
|
+
}),
|
|
637
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
638
|
+
return toolkit.createKey(String(params.label ?? ""));
|
|
639
|
+
},
|
|
640
|
+
});
|
|
641
|
+
// ── Tool 41: revoke_key ────────────────────────────────────────────────
|
|
642
|
+
pi.registerTool({
|
|
643
|
+
name: "dominusnode_revoke_key",
|
|
644
|
+
label: "DominusNode: Revoke API Key",
|
|
645
|
+
description: "Revoke (delete) a personal API key. This action is irreversible -- " +
|
|
646
|
+
"any applications using this key will lose access immediately.",
|
|
647
|
+
parameters: typebox_1.Type.Object({
|
|
648
|
+
keyId: typebox_1.Type.String({ description: "API key ID (UUID) to revoke" }),
|
|
649
|
+
}),
|
|
650
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
651
|
+
return toolkit.revokeKey(String(params.keyId ?? ""));
|
|
652
|
+
},
|
|
653
|
+
});
|
|
654
|
+
// ── Tool 42: get_plan ──────────────────────────────────────────────────
|
|
655
|
+
pi.registerTool({
|
|
656
|
+
name: "dominusnode_get_plan",
|
|
657
|
+
label: "DominusNode: Get Current Plan",
|
|
658
|
+
description: "Get your current subscription plan including tier, bandwidth limits, and pricing.",
|
|
659
|
+
parameters: typebox_1.Type.Object({}),
|
|
660
|
+
async execute(_id, _params, _signal, _onUpdate, _ctx) {
|
|
661
|
+
return toolkit.getPlan();
|
|
662
|
+
},
|
|
663
|
+
});
|
|
664
|
+
// ── Tool 43: list_plans ────────────────────────────────────────────────
|
|
665
|
+
pi.registerTool({
|
|
666
|
+
name: "dominusnode_list_plans",
|
|
667
|
+
label: "DominusNode: List Available Plans",
|
|
668
|
+
description: "List all available subscription plans with features, pricing, and bandwidth limits.",
|
|
669
|
+
parameters: typebox_1.Type.Object({}),
|
|
670
|
+
async execute(_id, _params, _signal, _onUpdate, _ctx) {
|
|
671
|
+
return toolkit.listPlans();
|
|
672
|
+
},
|
|
673
|
+
});
|
|
674
|
+
// ── Tool 44: change_plan ───────────────────────────────────────────────
|
|
675
|
+
pi.registerTool({
|
|
676
|
+
name: "dominusnode_change_plan",
|
|
677
|
+
label: "DominusNode: Change Subscription Plan",
|
|
678
|
+
description: "Change your subscription plan. Takes effect immediately. " +
|
|
679
|
+
"Use list_plans to see available options.",
|
|
680
|
+
parameters: typebox_1.Type.Object({
|
|
681
|
+
planId: typebox_1.Type.String({ description: "Plan ID (UUID) to switch to" }),
|
|
682
|
+
}),
|
|
683
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
684
|
+
return toolkit.changePlan(String(params.planId ?? ""));
|
|
685
|
+
},
|
|
686
|
+
});
|
|
687
|
+
// ── Tool 45: team_delete ───────────────────────────────────────────────
|
|
688
|
+
pi.registerTool({
|
|
689
|
+
name: "dominusnode_team_delete",
|
|
690
|
+
label: "DominusNode: Delete Team",
|
|
691
|
+
description: "Delete a team. Only the team owner can delete. " +
|
|
692
|
+
"All team keys are revoked and remaining balance is refunded.",
|
|
693
|
+
parameters: typebox_1.Type.Object({
|
|
694
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID) to delete" }),
|
|
695
|
+
}),
|
|
696
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
697
|
+
return toolkit.teamDelete(String(params.teamId ?? ""));
|
|
698
|
+
},
|
|
699
|
+
});
|
|
700
|
+
// ── Tool 46: team_revoke_key ───────────────────────────────────────────
|
|
701
|
+
pi.registerTool({
|
|
702
|
+
name: "dominusnode_team_revoke_key",
|
|
703
|
+
label: "DominusNode: Revoke Team API Key",
|
|
704
|
+
description: "Revoke a team API key. Only owners and admins can revoke keys. " +
|
|
705
|
+
"Applications using this key will lose access immediately.",
|
|
706
|
+
parameters: typebox_1.Type.Object({
|
|
707
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID)" }),
|
|
708
|
+
keyId: typebox_1.Type.String({ description: "API key ID (UUID) to revoke" }),
|
|
709
|
+
}),
|
|
710
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
711
|
+
return toolkit.teamRevokeKey(String(params.teamId ?? ""), String(params.keyId ?? ""));
|
|
712
|
+
},
|
|
713
|
+
});
|
|
714
|
+
// ── Tool 47: team_list_keys ────────────────────────────────────────────
|
|
715
|
+
pi.registerTool({
|
|
716
|
+
name: "dominusnode_team_list_keys",
|
|
717
|
+
label: "DominusNode: List Team API Keys",
|
|
718
|
+
description: "List all API keys for a team with labels, creation dates, and last-used timestamps.",
|
|
719
|
+
parameters: typebox_1.Type.Object({
|
|
720
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID)" }),
|
|
721
|
+
}),
|
|
722
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
723
|
+
return toolkit.teamListKeys(String(params.teamId ?? ""));
|
|
724
|
+
},
|
|
725
|
+
});
|
|
726
|
+
// ── Tool 48: team_list_members ─────────────────────────────────────────
|
|
727
|
+
pi.registerTool({
|
|
728
|
+
name: "dominusnode_team_list_members",
|
|
729
|
+
label: "DominusNode: List Team Members",
|
|
730
|
+
description: "List all members of a team with their roles and join dates.",
|
|
731
|
+
parameters: typebox_1.Type.Object({
|
|
732
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID)" }),
|
|
733
|
+
}),
|
|
734
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
735
|
+
return toolkit.teamListMembers(String(params.teamId ?? ""));
|
|
736
|
+
},
|
|
737
|
+
});
|
|
738
|
+
// ── Tool 49: team_add_member ───────────────────────────────────────────
|
|
739
|
+
pi.registerTool({
|
|
740
|
+
name: "dominusnode_team_add_member",
|
|
741
|
+
label: "DominusNode: Add Team Member",
|
|
742
|
+
description: "Add a user directly to a team by user ID. Only owners and admins can add members.",
|
|
743
|
+
parameters: typebox_1.Type.Object({
|
|
744
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID)" }),
|
|
745
|
+
userId: typebox_1.Type.String({ description: "User ID (UUID) of the user to add" }),
|
|
746
|
+
role: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("member"), typebox_1.Type.Literal("admin")], {
|
|
747
|
+
description: "Role for the new member (default: 'member')",
|
|
748
|
+
})),
|
|
749
|
+
}),
|
|
750
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
751
|
+
return toolkit.teamAddMember(String(params.teamId ?? ""), String(params.userId ?? ""), params.role !== undefined ? String(params.role) : "member");
|
|
752
|
+
},
|
|
753
|
+
});
|
|
754
|
+
// ── Tool 50: team_remove_member ────────────────────────────────────────
|
|
755
|
+
pi.registerTool({
|
|
756
|
+
name: "dominusnode_team_remove_member",
|
|
757
|
+
label: "DominusNode: Remove Team Member",
|
|
758
|
+
description: "Remove a member from a team. Only owners and admins can remove members.",
|
|
759
|
+
parameters: typebox_1.Type.Object({
|
|
760
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID)" }),
|
|
761
|
+
userId: typebox_1.Type.String({
|
|
762
|
+
description: "User ID (UUID) of the member to remove",
|
|
763
|
+
}),
|
|
764
|
+
}),
|
|
765
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
766
|
+
return toolkit.teamRemoveMember(String(params.teamId ?? ""), String(params.userId ?? ""));
|
|
767
|
+
},
|
|
768
|
+
});
|
|
769
|
+
// ── Tool 51: team_invite_member ────────────────────────────────────────
|
|
770
|
+
pi.registerTool({
|
|
771
|
+
name: "dominusnode_team_invite_member",
|
|
772
|
+
label: "DominusNode: Invite Team Member",
|
|
773
|
+
description: "Invite a user to join a team by email address. The user will receive an invitation email.",
|
|
774
|
+
parameters: typebox_1.Type.Object({
|
|
775
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID)" }),
|
|
776
|
+
email: typebox_1.Type.String({
|
|
777
|
+
description: "Email address of the user to invite",
|
|
778
|
+
}),
|
|
779
|
+
role: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("member"), typebox_1.Type.Literal("admin")], {
|
|
780
|
+
description: "Role for the invited member (default: 'member')",
|
|
781
|
+
})),
|
|
782
|
+
}),
|
|
783
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
784
|
+
return toolkit.teamInviteMember(String(params.teamId ?? ""), String(params.email ?? ""), params.role !== undefined ? String(params.role) : "member");
|
|
785
|
+
},
|
|
786
|
+
});
|
|
787
|
+
// ── Tool 52: team_list_invites ─────────────────────────────────────────
|
|
788
|
+
pi.registerTool({
|
|
789
|
+
name: "dominusnode_team_list_invites",
|
|
790
|
+
label: "DominusNode: List Team Invites",
|
|
791
|
+
description: "List all pending invitations for a team.",
|
|
792
|
+
parameters: typebox_1.Type.Object({
|
|
793
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID)" }),
|
|
794
|
+
}),
|
|
795
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
796
|
+
return toolkit.teamListInvites(String(params.teamId ?? ""));
|
|
797
|
+
},
|
|
798
|
+
});
|
|
799
|
+
// ── Tool 53: team_cancel_invite ────────────────────────────────────────
|
|
800
|
+
pi.registerTool({
|
|
801
|
+
name: "dominusnode_team_cancel_invite",
|
|
802
|
+
label: "DominusNode: Cancel Team Invite",
|
|
803
|
+
description: "Cancel a pending team invitation. Only owners and admins can cancel invites.",
|
|
804
|
+
parameters: typebox_1.Type.Object({
|
|
805
|
+
teamId: typebox_1.Type.String({ description: "Team ID (UUID)" }),
|
|
806
|
+
inviteId: typebox_1.Type.String({ description: "Invite ID (UUID) to cancel" }),
|
|
807
|
+
}),
|
|
808
|
+
async execute(_id, params, _signal, _onUpdate, _ctx) {
|
|
809
|
+
return toolkit.teamCancelInvite(String(params.teamId ?? ""), String(params.inviteId ?? ""));
|
|
371
810
|
},
|
|
372
811
|
});
|
|
373
812
|
}
|