@dominusnode/chatgpt 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dominus Node
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # Dominus Node -- ChatGPT Integration
2
+
3
+ Full integration for ChatGPT Custom GPTs and OpenAI Assistants API. Includes both an OpenAPI 3.1.0 spec for direct API actions and a TypeScript function handler with 53 tools, PoW solver, SSRF protection, and credential scrubbing.
4
+
5
+ ## Two Usage Modes
6
+
7
+ ### Mode 1: Custom GPT Actions (Schema-Only)
8
+
9
+ Paste `openapi.yaml` into your Custom GPT action schema. ChatGPT calls the Dominus Node REST API directly.
10
+
11
+ ### Mode 2: Programmatic Handler (Recommended)
12
+
13
+ Use the TypeScript handler for full security and PoW support:
14
+
15
+ ```ts
16
+ import { createDominusNodeFunctionHandler } from "@dominusnode/chatgpt";
17
+
18
+ const handler = createDominusNodeFunctionHandler({
19
+ apiKey: "dn_live_...",
20
+ baseUrl: "https://api.dominusnode.com",
21
+ });
22
+
23
+ // Dispatch function calls from ChatGPT
24
+ const balance = await handler("dominusnode_check_balance", {});
25
+ const usage = await handler("dominusnode_check_usage", { period: "week" });
26
+ const fetch = await handler("dominusnode_proxied_fetch", {
27
+ url: "https://httpbin.org/ip",
28
+ country: "US",
29
+ proxy_type: "dc",
30
+ });
31
+ ```
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ npm install @dominusnode/chatgpt
37
+ # or install from GitHub
38
+ npm install github:Dominus-Node/dominusnode#main --workspace=integrations/chatgpt
39
+ ```
40
+
41
+ ## 53 Tools
42
+
43
+ ### Proxy (3)
44
+
45
+ | Tool | Description |
46
+ | ------------------------------ | --------------------------------------------------- |
47
+ | `dominusnode_proxied_fetch` | Fetch URL through rotating proxy with geo-targeting |
48
+ | `dominusnode_get_proxy_config` | Get proxy endpoints and supported countries |
49
+ | `dominusnode_get_proxy_status` | Get proxy service status |
50
+
51
+ ### Wallet (7)
52
+
53
+ | Tool | Description |
54
+ | ------------------------------ | ------------------------------------- |
55
+ | `dominusnode_check_balance` | Check wallet balance |
56
+ | `dominusnode_get_transactions` | View transaction history |
57
+ | `dominusnode_get_forecast` | Get spending forecast |
58
+ | `dominusnode_check_payment` | Check crypto invoice status |
59
+ | `dominusnode_topup_stripe` | Create Stripe checkout ($5-$1,000) |
60
+ | `dominusnode_topup_paypal` | Create PayPal order ($5-$1,000) |
61
+ | `dominusnode_topup_crypto` | Create crypto invoice (10 currencies) |
62
+
63
+ ### Usage (3)
64
+
65
+ | Tool | Description |
66
+ | ----------------------------- | ------------------------------- |
67
+ | `dominusnode_check_usage` | Get usage stats for period |
68
+ | `dominusnode_get_daily_usage` | Get daily breakdown (1-90 days) |
69
+ | `dominusnode_get_top_hosts` | Get most-accessed domains |
70
+
71
+ ### Sessions (1)
72
+
73
+ | Tool | Description |
74
+ | --------------------------- | -------------------------- |
75
+ | `dominusnode_list_sessions` | List active proxy sessions |
76
+
77
+ ### Account (6)
78
+
79
+ | Tool | Description |
80
+ | --------------------------------- | -------------------------------- |
81
+ | `dominusnode_register` | Create account (with PoW solver) |
82
+ | `dominusnode_login` | Login with email/password |
83
+ | `dominusnode_get_account_info` | Get account details |
84
+ | `dominusnode_verify_email` | Verify email with token |
85
+ | `dominusnode_resend_verification` | Resend verification email |
86
+ | `dominusnode_update_password` | Change password |
87
+
88
+ ### API Keys (3)
89
+
90
+ | Tool | Description |
91
+ | ------------------------ | -------------- |
92
+ | `dominusnode_list_keys` | List API keys |
93
+ | `dominusnode_create_key` | Create API key |
94
+ | `dominusnode_revoke_key` | Revoke API key |
95
+
96
+ ### Plans (3)
97
+
98
+ | Tool | Description |
99
+ | ------------------------- | -------------------- |
100
+ | `dominusnode_get_plan` | Get current plan |
101
+ | `dominusnode_list_plans` | List available plans |
102
+ | `dominusnode_change_plan` | Switch plan |
103
+
104
+ ### Agentic Wallets (9)
105
+
106
+ | Tool | Description |
107
+ | ------------------------------------- | ------------------------------ |
108
+ | `dominusnode_create_agentic_wallet` | Create sub-wallet for AI agent |
109
+ | `dominusnode_fund_agentic_wallet` | Fund from main wallet |
110
+ | `dominusnode_agentic_wallet_balance` | Check sub-wallet balance |
111
+ | `dominusnode_list_agentic_wallets` | List all sub-wallets |
112
+ | `dominusnode_agentic_transactions` | View sub-wallet transactions |
113
+ | `dominusnode_freeze_agentic_wallet` | Freeze sub-wallet |
114
+ | `dominusnode_unfreeze_agentic_wallet` | Unfreeze sub-wallet |
115
+ | `dominusnode_delete_agentic_wallet` | Delete sub-wallet |
116
+ | `dominusnode_update_wallet_policy` | Update daily limits/domains |
117
+
118
+ ### Teams (17)
119
+
120
+ | Tool | Description |
121
+ | ------------------------------------- | ---------------------- |
122
+ | `dominusnode_create_team` | Create team |
123
+ | `dominusnode_list_teams` | List teams |
124
+ | `dominusnode_team_details` | Get team details |
125
+ | `dominusnode_team_fund` | Fund team wallet |
126
+ | `dominusnode_team_create_key` | Create team API key |
127
+ | `dominusnode_team_usage` | View team transactions |
128
+ | `dominusnode_update_team` | Update team settings |
129
+ | `dominusnode_update_team_member_role` | Change member role |
130
+ | `dominusnode_team_delete` | Delete team |
131
+ | `dominusnode_team_revoke_key` | Revoke team API key |
132
+ | `dominusnode_team_list_keys` | List team API keys |
133
+ | `dominusnode_team_list_members` | List team members |
134
+ | `dominusnode_team_add_member` | Add team member |
135
+ | `dominusnode_team_remove_member` | Remove team member |
136
+ | `dominusnode_team_invite_member` | Invite member by email |
137
+ | `dominusnode_team_list_invites` | List pending invites |
138
+ | `dominusnode_team_cancel_invite` | Cancel invite |
139
+
140
+ ### x402 (1)
141
+
142
+ | Tool | Description |
143
+ | ----------------------- | -------------------------- |
144
+ | `dominusnode_x402_info` | Get x402 micropayment info |
145
+
146
+ ## Security
147
+
148
+ - SSRF: DNS rebinding protection, private IP blocking, hex/octal/decimal normalization
149
+ - OFAC: Sanctioned countries (CU, IR, KP, RU, SY) blocked
150
+ - Credential scrubbing: `dn_live_*`, `dn_test_*`, `dn_proxy_*` redacted from errors
151
+ - Prototype pollution: Recursive `stripDangerousKeys` on all JSON parsing
152
+ - Response size cap: 10MB max
153
+ - HTTP methods: Only GET, HEAD, OPTIONS for proxied fetch
154
+ - PoW solver: SHA-256 challenge solver for CAPTCHA-free registration
155
+
156
+ ## Custom GPT Setup (Schema-Only Mode)
157
+
158
+ 1. Go to [ChatGPT](https://chat.openai.com) > **Explore GPTs** > **Create a GPT**
159
+ 2. In **Actions**, paste the contents of `openapi.yaml`
160
+ 3. Set auth to **Bearer** and paste your JWT token
161
+ 4. JWT tokens expire in 15 minutes; refresh via POST `/api/auth/refresh`
162
+
163
+ ## Files
164
+
165
+ | File | Description |
166
+ | ----------------- | ------------------------------------------- |
167
+ | `handler.ts` | 53-tool function handler with full security |
168
+ | `handler.test.ts` | 131 test cases (SSRF, validation, dispatch) |
169
+ | `functions.json` | Tool definitions for LLM function calling |
170
+ | `openapi.yaml` | OpenAPI 3.1.0 spec for Custom GPT actions |
171
+ | `ai-plugin.json` | Legacy ChatGPT plugin manifest |
172
+
173
+ ## License
174
+
175
+ MIT License. See [LICENSE](./LICENSE).
package/ai-plugin.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "schema_version": "v1",
3
+ "name_for_human": "Dominus Node Proxy",
4
+ "name_for_model": "dominusnode",
5
+ "description_for_human": "Access rotating proxy network for web scraping with geo-targeting, wallet management, and team billing.",
6
+ "description_for_model": "Dominus Node provides rotating proxy-as-a-service with datacenter ($3/GB) and residential ($5/GB) proxies. Use this to manage proxy API keys, check wallet balance, monitor usage, create agentic sub-wallets for AI agents, manage teams with shared billing, and top up via Stripe, crypto, or PayPal.",
7
+ "auth": {
8
+ "type": "user_http",
9
+ "authorization_type": "bearer"
10
+ },
11
+ "api": {
12
+ "type": "openapi",
13
+ "url": "https://api.dominusnode.com/.well-known/openapi.yaml"
14
+ },
15
+ "logo_url": "https://dominusnode.com/logo.png",
16
+ "contact_email": "support@dominusnode.com",
17
+ "legal_info_url": "https://dominusnode.com/legal"
18
+ }
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Dominus Node ChatGPT Actions / function calling handler (TypeScript).
3
+ *
4
+ * 53 tools covering proxy, wallet, usage, account lifecycle, API keys,
5
+ * plans, and teams.
6
+ *
7
+ * Provides a factory function that creates a handler for dispatching
8
+ * ChatGPT function calls to the Dominus Node REST API. Designed for
9
+ * ChatGPT Custom GPTs (Actions), OpenAI Assistants API, and any
10
+ * OpenAI-compatible function-calling system.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { createDominusNodeFunctionHandler } from "./handler";
15
+ *
16
+ * const handler = createDominusNodeFunctionHandler({
17
+ * apiKey: "dn_live_...",
18
+ * baseUrl: "https://api.dominusnode.com",
19
+ * });
20
+ *
21
+ * // Handle an action call from a ChatGPT Custom GPT
22
+ * const result = await handler("dominusnode_check_balance", {});
23
+ * console.log(result); // JSON string with balance info
24
+ * ```
25
+ *
26
+ * @module
27
+ */
28
+ /**
29
+ * Normalize non-standard IPv4 representations (hex, octal, decimal integer)
30
+ * to standard dotted-decimal to prevent SSRF bypasses like 0x7f000001,
31
+ * 2130706433, or 0177.0.0.1.
32
+ */
33
+ declare function normalizeIpv4(hostname: string): string | null;
34
+ declare function isPrivateIp(hostname: string): boolean;
35
+ /**
36
+ * Validate a URL for safety before sending through the proxy.
37
+ * Blocks private IPs, localhost, internal hostnames, and non-HTTP(S) protocols.
38
+ *
39
+ * @throws {Error} If the URL is invalid or targets a private/blocked address.
40
+ */
41
+ declare function validateUrl(url: string): URL;
42
+ declare function stripDangerousKeys(obj: unknown, depth?: number): void;
43
+ declare function safeJsonParse<T>(text: string): T;
44
+ declare function sanitizeError(message: string): string;
45
+ export interface DominusNodeFunctionConfig {
46
+ /** Dominus Node API key (starts with dn_live_ or dn_test_). */
47
+ apiKey: string;
48
+ /** Base URL of the Dominus Node REST API. Defaults to https://api.dominusnode.com */
49
+ baseUrl?: string;
50
+ /** Request timeout in milliseconds. Defaults to 30000. */
51
+ timeoutMs?: number;
52
+ /** Agent secret for MCP agent identification. Bypasses reCAPTCHA and auto-verifies email. */
53
+ agentSecret?: string;
54
+ }
55
+ /**
56
+ * Handler function type returned by createDominusNodeFunctionHandler.
57
+ * Dispatches function calls to the Dominus Node API and returns JSON string results.
58
+ */
59
+ export type FunctionHandler = (name: string, args: Record<string, unknown>) => Promise<string>;
60
+ /**
61
+ * Create a Dominus Node function handler for OpenAI-compatible function calling.
62
+ *
63
+ * Authenticates using the provided API key, then returns a handler function
64
+ * that dispatches function calls to the appropriate Dominus Node REST API endpoint.
65
+ *
66
+ * @param config - API key and optional base URL / timeout.
67
+ * @returns A handler function: (name, args) => Promise<string>
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * import { createDominusNodeFunctionHandler } from "./handler";
72
+ *
73
+ * const handler = createDominusNodeFunctionHandler({
74
+ * apiKey: "dn_live_abc123",
75
+ * baseUrl: "https://api.dominusnode.com",
76
+ * });
77
+ *
78
+ * // Handle a function call from an LLM
79
+ * const result = await handler("dominusnode_check_balance", {});
80
+ * console.log(JSON.parse(result));
81
+ * // { balanceCents: 5000, balanceUsd: 50.00, currency: "USD", lastToppedUp: "..." }
82
+ * ```
83
+ */
84
+ export { isPrivateIp, validateUrl, normalizeIpv4, sanitizeError, stripDangerousKeys, safeJsonParse, };
85
+ export declare function createDominusNodeFunctionHandler(config: DominusNodeFunctionConfig): FunctionHandler;
86
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA4EH;;;;GAIG;AACH,iBAAS,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAoCtD;AAED,iBAAS,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CA6E9C;AAED;;;;;GAKG;AACH,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CA0CrC;AAcD,iBAAS,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,IAAI,CAczD;AAED,iBAAS,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAIzC;AAmDD,iBAAS,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9C;AAqBD,MAAM,WAAW,yBAAyB;IACxC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoGD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,CAAC;AAEF,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,yBAAyB,GAChC,eAAe,CAq4DjB"}