dodopayments-mcp 1.49.0 → 1.51.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/README.md +45 -6
- package/code-tool-paths.cjs +6 -0
- package/code-tool-paths.cjs.map +1 -0
- package/code-tool-paths.d.cts +2 -0
- package/code-tool-paths.d.cts.map +1 -0
- package/code-tool-types.d.mts +14 -0
- package/code-tool-types.d.mts.map +1 -0
- package/code-tool-types.d.ts +14 -0
- package/code-tool-types.d.ts.map +1 -0
- package/code-tool-types.js +4 -0
- package/code-tool-types.js.map +1 -0
- package/code-tool-types.mjs +3 -0
- package/code-tool-types.mjs.map +1 -0
- package/code-tool-worker.d.mts +5 -0
- package/code-tool-worker.d.mts.map +1 -0
- package/code-tool-worker.d.ts +5 -0
- package/code-tool-worker.d.ts.map +1 -0
- package/code-tool-worker.js +45 -0
- package/code-tool-worker.js.map +1 -0
- package/code-tool-worker.mjs +40 -0
- package/code-tool-worker.mjs.map +1 -0
- package/code-tool.d.mts +12 -0
- package/code-tool.d.mts.map +1 -0
- package/code-tool.d.ts +12 -0
- package/code-tool.d.ts.map +1 -0
- package/code-tool.js +123 -0
- package/code-tool.js.map +1 -0
- package/code-tool.mjs +120 -0
- package/code-tool.mjs.map +1 -0
- package/compat.d.mts +4 -2
- package/compat.d.mts.map +1 -1
- package/compat.d.ts +4 -2
- package/compat.d.ts.map +1 -1
- package/compat.js +3 -1
- package/compat.js.map +1 -1
- package/compat.mjs +2 -0
- package/compat.mjs.map +1 -1
- package/filtering.d.mts +1 -1
- package/filtering.d.mts.map +1 -1
- package/filtering.d.ts +1 -1
- package/filtering.d.ts.map +1 -1
- package/filtering.js +1 -2
- package/filtering.js.map +1 -1
- package/filtering.mjs +1 -2
- package/filtering.mjs.map +1 -1
- package/headers.d.mts +4 -0
- package/headers.d.mts.map +1 -0
- package/headers.d.ts +4 -0
- package/headers.d.ts.map +1 -0
- package/headers.js +22 -0
- package/headers.js.map +1 -0
- package/headers.mjs +18 -0
- package/headers.mjs.map +1 -0
- package/http.d.mts +5 -0
- package/http.d.mts.map +1 -0
- package/http.d.ts +5 -0
- package/http.d.ts.map +1 -0
- package/http.js +110 -0
- package/http.js.map +1 -0
- package/http.mjs +102 -0
- package/http.mjs.map +1 -0
- package/index.js +13 -8
- package/index.js.map +1 -1
- package/index.mjs +15 -10
- package/index.mjs.map +1 -1
- package/options.d.mts +11 -6
- package/options.d.mts.map +1 -1
- package/options.d.ts +11 -6
- package/options.d.ts.map +1 -1
- package/options.js +134 -15
- package/options.js.map +1 -1
- package/options.mjs +133 -15
- package/options.mjs.map +1 -1
- package/package.json +13 -5
- package/server.d.mts +4 -16
- package/server.d.mts.map +1 -1
- package/server.d.ts +4 -16
- package/server.d.ts.map +1 -1
- package/server.js +49 -27
- package/server.js.map +1 -1
- package/server.mjs +47 -26
- package/server.mjs.map +1 -1
- package/src/code-tool-paths.cts +3 -0
- package/src/code-tool-types.ts +14 -0
- package/src/code-tool-worker.ts +46 -0
- package/src/code-tool.ts +144 -0
- package/src/compat.ts +4 -2
- package/src/filtering.ts +1 -2
- package/src/headers.ts +23 -0
- package/src/http.ts +115 -0
- package/src/index.ts +17 -13
- package/src/options.ts +154 -21
- package/src/server.ts +63 -43
- package/src/stdio.ts +13 -0
- package/src/tools/checkout-sessions/create-checkout-sessions.ts +688 -0
- package/src/tools/index.ts +2 -2
- package/src/tools/payments/create-payments.ts +1 -0
- package/src/tools/payments/list-payments.ts +1 -1
- package/src/tools/products/create-products.ts +1 -0
- package/src/tools/products/update-products.ts +1 -0
- package/src/tools/subscriptions/charge-subscriptions.ts +1 -0
- package/src/tools/subscriptions/create-subscriptions.ts +31 -27
- package/src/tools/subscriptions/update-subscriptions.ts +2 -0
- package/src/tools/webhooks/create-webhooks.ts +3 -1
- package/src/tools/webhooks/headers/retrieve-webhooks-headers.ts +1 -1
- package/src/tools/webhooks/headers/update-webhooks-headers.ts +1 -0
- package/src/tools/webhooks/list-webhooks.ts +1 -1
- package/src/tools/webhooks/retrieve-webhooks.ts +1 -1
- package/src/tools/webhooks/update-webhooks.ts +2 -1
- package/stdio.d.mts +3 -0
- package/stdio.d.mts.map +1 -0
- package/stdio.d.ts +3 -0
- package/stdio.d.ts.map +1 -0
- package/stdio.js +14 -0
- package/stdio.js.map +1 -0
- package/stdio.mjs +10 -0
- package/stdio.mjs.map +1 -0
- package/tools/{your-webhook-url/create-your-webhook-url.d.ts → checkout-sessions/create-checkout-sessions.d.mts} +1 -1
- package/tools/checkout-sessions/create-checkout-sessions.d.mts.map +1 -0
- package/tools/{your-webhook-url/create-your-webhook-url.d.mts → checkout-sessions/create-checkout-sessions.d.ts} +1 -1
- package/tools/checkout-sessions/create-checkout-sessions.d.ts.map +1 -0
- package/tools/checkout-sessions/create-checkout-sessions.js +675 -0
- package/tools/checkout-sessions/create-checkout-sessions.js.map +1 -0
- package/tools/checkout-sessions/create-checkout-sessions.mjs +671 -0
- package/tools/checkout-sessions/create-checkout-sessions.mjs.map +1 -0
- package/tools/index.js +2 -2
- package/tools/index.js.map +1 -1
- package/tools/index.mjs +2 -2
- package/tools/index.mjs.map +1 -1
- package/tools/payments/create-payments.d.mts.map +1 -1
- package/tools/payments/create-payments.d.ts.map +1 -1
- package/tools/payments/create-payments.js +1 -0
- package/tools/payments/create-payments.js.map +1 -1
- package/tools/payments/create-payments.mjs +1 -0
- package/tools/payments/create-payments.mjs.map +1 -1
- package/tools/payments/list-payments.js +1 -1
- package/tools/payments/list-payments.js.map +1 -1
- package/tools/payments/list-payments.mjs +1 -1
- package/tools/payments/list-payments.mjs.map +1 -1
- package/tools/products/create-products.d.mts.map +1 -1
- package/tools/products/create-products.d.ts.map +1 -1
- package/tools/products/create-products.js +1 -0
- package/tools/products/create-products.js.map +1 -1
- package/tools/products/create-products.mjs +1 -0
- package/tools/products/create-products.mjs.map +1 -1
- package/tools/products/update-products.d.mts.map +1 -1
- package/tools/products/update-products.d.ts.map +1 -1
- package/tools/products/update-products.js +1 -0
- package/tools/products/update-products.js.map +1 -1
- package/tools/products/update-products.mjs +1 -0
- package/tools/products/update-products.mjs.map +1 -1
- package/tools/subscriptions/charge-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/charge-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/charge-subscriptions.js +1 -0
- package/tools/subscriptions/charge-subscriptions.js.map +1 -1
- package/tools/subscriptions/charge-subscriptions.mjs +1 -0
- package/tools/subscriptions/charge-subscriptions.mjs.map +1 -1
- package/tools/subscriptions/create-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/create-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/create-subscriptions.js +27 -23
- package/tools/subscriptions/create-subscriptions.js.map +1 -1
- package/tools/subscriptions/create-subscriptions.mjs +27 -23
- package/tools/subscriptions/create-subscriptions.mjs.map +1 -1
- package/tools/subscriptions/update-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/update-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/update-subscriptions.js +2 -0
- package/tools/subscriptions/update-subscriptions.js.map +1 -1
- package/tools/subscriptions/update-subscriptions.mjs +2 -0
- package/tools/subscriptions/update-subscriptions.mjs.map +1 -1
- package/tools/webhooks/create-webhooks.d.mts.map +1 -1
- package/tools/webhooks/create-webhooks.d.ts.map +1 -1
- package/tools/webhooks/create-webhooks.js +3 -1
- package/tools/webhooks/create-webhooks.js.map +1 -1
- package/tools/webhooks/create-webhooks.mjs +3 -1
- package/tools/webhooks/create-webhooks.mjs.map +1 -1
- package/tools/webhooks/headers/retrieve-webhooks-headers.js +1 -1
- package/tools/webhooks/headers/retrieve-webhooks-headers.js.map +1 -1
- package/tools/webhooks/headers/retrieve-webhooks-headers.mjs +1 -1
- package/tools/webhooks/headers/retrieve-webhooks-headers.mjs.map +1 -1
- package/tools/webhooks/headers/update-webhooks-headers.d.mts.map +1 -1
- package/tools/webhooks/headers/update-webhooks-headers.d.ts.map +1 -1
- package/tools/webhooks/headers/update-webhooks-headers.js +1 -0
- package/tools/webhooks/headers/update-webhooks-headers.js.map +1 -1
- package/tools/webhooks/headers/update-webhooks-headers.mjs +1 -0
- package/tools/webhooks/headers/update-webhooks-headers.mjs.map +1 -1
- package/tools/webhooks/list-webhooks.js +1 -1
- package/tools/webhooks/list-webhooks.js.map +1 -1
- package/tools/webhooks/list-webhooks.mjs +1 -1
- package/tools/webhooks/list-webhooks.mjs.map +1 -1
- package/tools/webhooks/retrieve-webhooks.js +1 -1
- package/tools/webhooks/retrieve-webhooks.js.map +1 -1
- package/tools/webhooks/retrieve-webhooks.mjs +1 -1
- package/tools/webhooks/retrieve-webhooks.mjs.map +1 -1
- package/tools/webhooks/update-webhooks.d.mts.map +1 -1
- package/tools/webhooks/update-webhooks.d.ts.map +1 -1
- package/tools/webhooks/update-webhooks.js +2 -1
- package/tools/webhooks/update-webhooks.js.map +1 -1
- package/tools/webhooks/update-webhooks.mjs +2 -1
- package/tools/webhooks/update-webhooks.mjs.map +1 -1
- package/src/tools/your-webhook-url/create-your-webhook-url.ts +0 -1150
- package/tools/your-webhook-url/create-your-webhook-url.d.mts.map +0 -1
- package/tools/your-webhook-url/create-your-webhook-url.d.ts.map +0 -1
- package/tools/your-webhook-url/create-your-webhook-url.js +0 -1139
- package/tools/your-webhook-url/create-your-webhook-url.js.map +0 -1
- package/tools/your-webhook-url/create-your-webhook-url.mjs +0 -1135
- package/tools/your-webhook-url/create-your-webhook-url.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -128,6 +128,45 @@ over time, you can manually enable or disable certain capabilities:
|
|
|
128
128
|
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
## Running remotely
|
|
132
|
+
|
|
133
|
+
Launching the client with `--transport=http` launches the server as a remote server using Streamable HTTP transport. The `--port` setting can choose the port it will run on, and the `--socket` setting allows it to run on a Unix socket.
|
|
134
|
+
|
|
135
|
+
Authorization can be provided via the `Authorization` header using the Bearer scheme.
|
|
136
|
+
|
|
137
|
+
Additionally, authorization can be provided via the following headers:
|
|
138
|
+
| Header | Equivalent client option | Security scheme |
|
|
139
|
+
| ------------------------- | ------------------------ | --------------- |
|
|
140
|
+
| `x-dodo-payments-api-key` | `bearerToken` | API_KEY |
|
|
141
|
+
|
|
142
|
+
A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"dodopayments_api": {
|
|
148
|
+
"url": "http://localhost:3000",
|
|
149
|
+
"headers": {
|
|
150
|
+
"Authorization": "Bearer <auth value>"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
|
|
158
|
+
For example, to exclude specific tools while including others, use the URL:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
http://localhost:3000?client=cursor&capability=tool-name-length%3D40
|
|
168
|
+
```
|
|
169
|
+
|
|
131
170
|
## Importing the tools and server individually
|
|
132
171
|
|
|
133
172
|
```js
|
|
@@ -135,7 +174,7 @@ over time, you can manually enable or disable certain capabilities:
|
|
|
135
174
|
import { server, endpoints, init } from "dodopayments-mcp/server";
|
|
136
175
|
|
|
137
176
|
// import a specific tool
|
|
138
|
-
import
|
|
177
|
+
import createCheckoutSessions from "dodopayments-mcp/tools/checkout-sessions/create-checkout-sessions";
|
|
139
178
|
|
|
140
179
|
// initialize the server and all endpoints
|
|
141
180
|
init({ server, endpoints });
|
|
@@ -160,13 +199,17 @@ const myCustomEndpoint = {
|
|
|
160
199
|
};
|
|
161
200
|
|
|
162
201
|
// initialize the server with your custom endpoints
|
|
163
|
-
init({ server: myServer, endpoints: [
|
|
202
|
+
init({ server: myServer, endpoints: [createCheckoutSessions, myCustomEndpoint] });
|
|
164
203
|
```
|
|
165
204
|
|
|
166
205
|
## Available Tools
|
|
167
206
|
|
|
168
207
|
The following tools are available in this MCP server.
|
|
169
208
|
|
|
209
|
+
### Resource `checkout_sessions`:
|
|
210
|
+
|
|
211
|
+
- `create_checkout_sessions` (`write`):
|
|
212
|
+
|
|
170
213
|
### Resource `payments`:
|
|
171
214
|
|
|
172
215
|
- `create_payments` (`write`):
|
|
@@ -287,7 +330,3 @@ The following tools are available in this MCP server.
|
|
|
287
330
|
|
|
288
331
|
- `retrieve_webhooks_headers` (`read`): Get a webhook by id
|
|
289
332
|
- `update_webhooks_headers` (`write`): Patch a webhook by id
|
|
290
|
-
|
|
291
|
-
### Resource `your_webhook_url`:
|
|
292
|
-
|
|
293
|
-
- `create_your_webhook_url` (`write`):
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.workerPath = void 0;
|
|
5
|
+
exports.workerPath = require.resolve('./code-tool-worker.mjs');
|
|
6
|
+
//# sourceMappingURL=code-tool-paths.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-paths.cjs","sourceRoot":"","sources":["src/code-tool-paths.cts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEzE,QAAA,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-paths.d.cts","sourceRoot":"","sources":["src/code-tool-paths.cts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAA4C,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ClientOptions } from 'dodopayments';
|
|
2
|
+
export type WorkerInput = {
|
|
3
|
+
opts: ClientOptions;
|
|
4
|
+
code: string;
|
|
5
|
+
};
|
|
6
|
+
export type WorkerSuccess = {
|
|
7
|
+
result: unknown | null;
|
|
8
|
+
logLines: string[];
|
|
9
|
+
errLines: string[];
|
|
10
|
+
};
|
|
11
|
+
export type WorkerError = {
|
|
12
|
+
message: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=code-tool-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ClientOptions } from 'dodopayments';
|
|
2
|
+
export type WorkerInput = {
|
|
3
|
+
opts: ClientOptions;
|
|
4
|
+
code: string;
|
|
5
|
+
};
|
|
6
|
+
export type WorkerSuccess = {
|
|
7
|
+
result: unknown | null;
|
|
8
|
+
logLines: string[];
|
|
9
|
+
errLines: string[];
|
|
10
|
+
};
|
|
11
|
+
export type WorkerError = {
|
|
12
|
+
message: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=code-tool-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-types.js","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-types.mjs","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-worker.d.mts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";iBAM0B,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;;AAuCrD,wBAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-worker.d.ts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";iBAM0B,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;;AAuCrD,wBAAyB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const node_util_1 = __importDefault(require("node:util"));
|
|
8
|
+
const dodopayments_1 = require("dodopayments");
|
|
9
|
+
const fetch = async (req) => {
|
|
10
|
+
const { opts, code } = (await req.json());
|
|
11
|
+
const client = new dodopayments_1.DodoPayments({
|
|
12
|
+
...opts,
|
|
13
|
+
});
|
|
14
|
+
const logLines = [];
|
|
15
|
+
const errLines = [];
|
|
16
|
+
const console = {
|
|
17
|
+
log: (...args) => {
|
|
18
|
+
logLines.push(node_util_1.default.format(...args));
|
|
19
|
+
},
|
|
20
|
+
error: (...args) => {
|
|
21
|
+
errLines.push(node_util_1.default.format(...args));
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
try {
|
|
25
|
+
let run_ = async (client) => { };
|
|
26
|
+
eval(`
|
|
27
|
+
${code}
|
|
28
|
+
run_ = run;
|
|
29
|
+
`);
|
|
30
|
+
const result = await run_(client);
|
|
31
|
+
return Response.json({
|
|
32
|
+
result,
|
|
33
|
+
logLines,
|
|
34
|
+
errLines,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
const message = e instanceof Error ? e.message : undefined;
|
|
39
|
+
return Response.json({
|
|
40
|
+
message,
|
|
41
|
+
}, { status: 400, statusText: 'Code execution error' });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.default = { fetch };
|
|
45
|
+
//# sourceMappingURL=code-tool-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-worker.js","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;AAEtF,0DAA6B;AAE7B,+CAA4C;AAE5C,MAAM,KAAK,GAAG,KAAK,EAAE,GAAY,EAAqB,EAAE;IACtD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAgB,CAAC;IACzD,M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odoPayments } from 'dodopayments';
|
|
4
|
+
const fetch = async (req) => {
|
|
5
|
+
const { opts, code } = (await req.json());
|
|
6
|
+
const client = new DodoPayments({
|
|
7
|
+
...opts,
|
|
8
|
+
});
|
|
9
|
+
const logLines = [];
|
|
10
|
+
const errLines = [];
|
|
11
|
+
const console = {
|
|
12
|
+
log: (...args) => {
|
|
13
|
+
logLines.push(util.format(...args));
|
|
14
|
+
},
|
|
15
|
+
error: (...args) => {
|
|
16
|
+
errLines.push(util.format(...args));
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
try {
|
|
20
|
+
let run_ = async (client) => { };
|
|
21
|
+
eval(`
|
|
22
|
+
${code}
|
|
23
|
+
run_ = run;
|
|
24
|
+
`);
|
|
25
|
+
const result = await run_(client);
|
|
26
|
+
return Response.json({
|
|
27
|
+
result,
|
|
28
|
+
logLines,
|
|
29
|
+
errLines,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
const message = e instanceof Error ? e.message : undefined;
|
|
34
|
+
return Response.json({
|
|
35
|
+
message,
|
|
36
|
+
}, { status: 400, statusText: 'Code execution error' });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export default { fetch };
|
|
40
|
+
//# sourceMappingURL=code-tool-worker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-worker.mjs","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,IAAI,MAAM,WAAW;OAErB,EAAE,YAAY,EAAE,MAAM,cAAc;AAE3C,MAAM,KAAK,GAAG,KAAK,EAAE,GAAY,EAAqB,EAAE;IACtD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAgB,CAAC;IACzD,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC;QAC9B,GAAG,IAAI;KACR,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG;QACd,GAAG,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,KAAK,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE;YAC5B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;KACF,CAAC;IACF,IAAI,CAAC;QACH,IAAI,IAAI,GAAG,KAAK,EAAE,MAAW,EAAE,EAAE,GAAE,CAAC,CAAC;QACrC,IAAI,CAAC;QACD,IAAI;;KAEP,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC,IAAI,CAAC;YACnB,MAAM;YACN,QAAQ;YACR,QAAQ;SACe,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,OAAO,QAAQ,CAAC,IAAI,CAClB;YACE,OAAO;SACc,EACvB,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,sBAAsB,EAAE,CACpD,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,KAAK,EAAE,CAAC"}
|
package/code-tool.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Endpoint } from "./tools/types.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* A tool that runs code against a copy of the SDK.
|
|
4
|
+
*
|
|
5
|
+
* Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
|
|
6
|
+
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
|
|
7
|
+
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
|
|
8
|
+
*
|
|
9
|
+
* @param endpoints - The endpoints to include in the list.
|
|
10
|
+
*/
|
|
11
|
+
export declare function codeTool(): Endpoint;
|
|
12
|
+
//# sourceMappingURL=code-tool.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAKO,EAAE,QAAQ,EAA0B;AAQ3C;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAyHnC"}
|
package/code-tool.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Endpoint } from "./tools/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A tool that runs code against a copy of the SDK.
|
|
4
|
+
*
|
|
5
|
+
* Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
|
|
6
|
+
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
|
|
7
|
+
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
|
|
8
|
+
*
|
|
9
|
+
* @param endpoints - The endpoints to include in the list.
|
|
10
|
+
*/
|
|
11
|
+
export declare function codeTool(): Endpoint;
|
|
12
|
+
//# sourceMappingURL=code-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAKO,EAAE,QAAQ,EAA0B;AAQ3C;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAyHnC"}
|
package/code-tool.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.codeTool = codeTool;
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const node_url_1 = require("node:url");
|
|
7
|
+
const deno_http_worker_1 = require("@valtown/deno-http-worker");
|
|
8
|
+
const code_tool_paths_cjs_1 = require("./code-tool-paths.cjs");
|
|
9
|
+
/**
|
|
10
|
+
* A tool that runs code against a copy of the SDK.
|
|
11
|
+
*
|
|
12
|
+
* Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
|
|
13
|
+
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
|
|
14
|
+
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
|
|
15
|
+
*
|
|
16
|
+
* @param endpoints - The endpoints to include in the list.
|
|
17
|
+
*/
|
|
18
|
+
function codeTool() {
|
|
19
|
+
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
20
|
+
const tool = {
|
|
21
|
+
name: 'execute',
|
|
22
|
+
description: 'Runs Typescript code to interact with the API.\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client, and it will be run.\nDo not initialize a client, but instead use the client that you are given as a parameter.\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
|
|
23
|
+
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
24
|
+
};
|
|
25
|
+
const handler = async (client, args) => {
|
|
26
|
+
const baseURLHostname = new URL(client.baseURL).hostname;
|
|
27
|
+
const { code } = args;
|
|
28
|
+
const worker = await (0, deno_http_worker_1.newDenoHTTPWorker)((0, node_url_1.pathToFileURL)(code_tool_paths_cjs_1.workerPath), {
|
|
29
|
+
runFlags: [
|
|
30
|
+
`--node-modules-dir=manual`,
|
|
31
|
+
`--allow-read=code-tool-worker.mjs,${code_tool_paths_cjs_1.workerPath.replace(/([\/\\]node_modules)[\/\\].+$/, '$1')}/`,
|
|
32
|
+
`--allow-net=${baseURLHostname}`,
|
|
33
|
+
// Allow environment variables because instantiating the client will try to read from them,
|
|
34
|
+
// even though they are not set.
|
|
35
|
+
'--allow-env',
|
|
36
|
+
],
|
|
37
|
+
printOutput: true,
|
|
38
|
+
spawnOptions: {
|
|
39
|
+
cwd: (0, node_path_1.dirname)(code_tool_paths_cjs_1.workerPath),
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
try {
|
|
43
|
+
const resp = await new Promise((resolve, reject) => {
|
|
44
|
+
worker.addEventListener('exit', (exitCode) => {
|
|
45
|
+
reject(new Error(`Worker exited with code ${exitCode}`));
|
|
46
|
+
});
|
|
47
|
+
const opts = {
|
|
48
|
+
baseURL: client.baseURL,
|
|
49
|
+
bearerToken: client.bearerToken,
|
|
50
|
+
defaultHeaders: {
|
|
51
|
+
'X-Stainless-MCP': 'true',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
const req = worker.request('http://localhost', {
|
|
55
|
+
headers: {
|
|
56
|
+
'content-type': 'application/json',
|
|
57
|
+
},
|
|
58
|
+
method: 'POST',
|
|
59
|
+
}, (resp) => {
|
|
60
|
+
const body = [];
|
|
61
|
+
resp.on('error', (err) => {
|
|
62
|
+
reject(err);
|
|
63
|
+
});
|
|
64
|
+
resp.on('data', (chunk) => {
|
|
65
|
+
body.push(chunk);
|
|
66
|
+
});
|
|
67
|
+
resp.on('end', () => {
|
|
68
|
+
resolve(new Response(Buffer.concat(body).toString(), {
|
|
69
|
+
status: resp.statusCode ?? 200,
|
|
70
|
+
headers: resp.headers,
|
|
71
|
+
}));
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
const body = JSON.stringify({
|
|
75
|
+
opts,
|
|
76
|
+
code,
|
|
77
|
+
});
|
|
78
|
+
req.write(body, (err) => {
|
|
79
|
+
if (err !== null && err !== undefined) {
|
|
80
|
+
reject(err);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
req.end();
|
|
84
|
+
});
|
|
85
|
+
if (resp.status === 200) {
|
|
86
|
+
const { result, logLines, errLines } = (await resp.json());
|
|
87
|
+
const returnOutput = result === null ? null
|
|
88
|
+
: result === undefined ? null
|
|
89
|
+
: {
|
|
90
|
+
type: 'text',
|
|
91
|
+
text: typeof result === 'string' ? result : JSON.stringify(result),
|
|
92
|
+
};
|
|
93
|
+
const logOutput = logLines.length === 0 ?
|
|
94
|
+
null
|
|
95
|
+
: {
|
|
96
|
+
type: 'text',
|
|
97
|
+
text: logLines.join('\n'),
|
|
98
|
+
};
|
|
99
|
+
const errOutput = errLines.length === 0 ?
|
|
100
|
+
null
|
|
101
|
+
: {
|
|
102
|
+
type: 'text',
|
|
103
|
+
text: 'Error output:\n' + errLines.join('\n'),
|
|
104
|
+
};
|
|
105
|
+
return {
|
|
106
|
+
content: [returnOutput, logOutput, errOutput].filter((block) => block !== null),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
const { message } = (await resp.json());
|
|
111
|
+
throw new Error(message);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
throw e;
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
worker.terminate();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
return { metadata, tool, handler };
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=code-tool.js.map
|
package/code-tool.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAsBtF,4BAyHC;AA7ID,yCAAoC;AACpC,uCAAyC;AAMzC,gEAA8D;AAE9D,+DAAmD;AAEnD;;;;;;;;GAQG;AACH,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MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
package/code-tool.mjs
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import { newDenoHTTPWorker } from '@valtown/deno-http-worker';
|
|
5
|
+
import { workerPath } from './code-tool-paths.cjs';
|
|
6
|
+
/**
|
|
7
|
+
* A tool that runs code against a copy of the SDK.
|
|
8
|
+
*
|
|
9
|
+
* Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
|
|
10
|
+
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
|
|
11
|
+
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
|
|
12
|
+
*
|
|
13
|
+
* @param endpoints - The endpoints to include in the list.
|
|
14
|
+
*/
|
|
15
|
+
export function codeTool() {
|
|
16
|
+
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
17
|
+
const tool = {
|
|
18
|
+
name: 'execute',
|
|
19
|
+
description: 'Runs Typescript code to interact with the API.\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client, and it will be run.\nDo not initialize a client, but instead use the client that you are given as a parameter.\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
|
|
20
|
+
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
21
|
+
};
|
|
22
|
+
const handler = async (client, args) => {
|
|
23
|
+
const baseURLHostname = new URL(client.baseURL).hostname;
|
|
24
|
+
const { code } = args;
|
|
25
|
+
const worker = await newDenoHTTPWorker(pathToFileURL(workerPath), {
|
|
26
|
+
runFlags: [
|
|
27
|
+
`--node-modules-dir=manual`,
|
|
28
|
+
`--allow-read=code-tool-worker.mjs,${workerPath.replace(/([\/\\]node_modules)[\/\\].+$/, '$1')}/`,
|
|
29
|
+
`--allow-net=${baseURLHostname}`,
|
|
30
|
+
// Allow environment variables because instantiating the client will try to read from them,
|
|
31
|
+
// even though they are not set.
|
|
32
|
+
'--allow-env',
|
|
33
|
+
],
|
|
34
|
+
printOutput: true,
|
|
35
|
+
spawnOptions: {
|
|
36
|
+
cwd: dirname(workerPath),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
const resp = await new Promise((resolve, reject) => {
|
|
41
|
+
worker.addEventListener('exit', (exitCode) => {
|
|
42
|
+
reject(new Error(`Worker exited with code ${exitCode}`));
|
|
43
|
+
});
|
|
44
|
+
const opts = {
|
|
45
|
+
baseURL: client.baseURL,
|
|
46
|
+
bearerToken: client.bearerToken,
|
|
47
|
+
defaultHeaders: {
|
|
48
|
+
'X-Stainless-MCP': 'true',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const req = worker.request('http://localhost', {
|
|
52
|
+
headers: {
|
|
53
|
+
'content-type': 'application/json',
|
|
54
|
+
},
|
|
55
|
+
method: 'POST',
|
|
56
|
+
}, (resp) => {
|
|
57
|
+
const body = [];
|
|
58
|
+
resp.on('error', (err) => {
|
|
59
|
+
reject(err);
|
|
60
|
+
});
|
|
61
|
+
resp.on('data', (chunk) => {
|
|
62
|
+
body.push(chunk);
|
|
63
|
+
});
|
|
64
|
+
resp.on('end', () => {
|
|
65
|
+
resolve(new Response(Buffer.concat(body).toString(), {
|
|
66
|
+
status: resp.statusCode ?? 200,
|
|
67
|
+
headers: resp.headers,
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
const body = JSON.stringify({
|
|
72
|
+
opts,
|
|
73
|
+
code,
|
|
74
|
+
});
|
|
75
|
+
req.write(body, (err) => {
|
|
76
|
+
if (err !== null && err !== undefined) {
|
|
77
|
+
reject(err);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
req.end();
|
|
81
|
+
});
|
|
82
|
+
if (resp.status === 200) {
|
|
83
|
+
const { result, logLines, errLines } = (await resp.json());
|
|
84
|
+
const returnOutput = result === null ? null
|
|
85
|
+
: result === undefined ? null
|
|
86
|
+
: {
|
|
87
|
+
type: 'text',
|
|
88
|
+
text: typeof result === 'string' ? result : JSON.stringify(result),
|
|
89
|
+
};
|
|
90
|
+
const logOutput = logLines.length === 0 ?
|
|
91
|
+
null
|
|
92
|
+
: {
|
|
93
|
+
type: 'text',
|
|
94
|
+
text: logLines.join('\n'),
|
|
95
|
+
};
|
|
96
|
+
const errOutput = errLines.length === 0 ?
|
|
97
|
+
null
|
|
98
|
+
: {
|
|
99
|
+
type: 'text',
|
|
100
|
+
text: 'Error output:\n' + errLines.join('\n'),
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
content: [returnOutput, logOutput, errOutput].filter((block) => block !== null),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const { message } = (await resp.json());
|
|
108
|
+
throw new Error(message);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
throw e;
|
|
113
|
+
}
|
|
114
|
+
finally {
|
|
115
|
+
worker.terminate();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return { metadata, tool, handler };
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=code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qBAC9C,CAAC;gBACN,OAAO;oBACL,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC;iBAChF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAgB,CAAC;gBACvD,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
package/compat.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
import { Endpoint } from "./tools.mjs";
|
|
3
4
|
export interface ClientCapabilities {
|
|
4
5
|
topLevelUnions: boolean;
|
|
@@ -9,8 +10,9 @@ export interface ClientCapabilities {
|
|
|
9
10
|
toolNameLength: number | undefined;
|
|
10
11
|
}
|
|
11
12
|
export declare const defaultClientCapabilities: ClientCapabilities;
|
|
12
|
-
export
|
|
13
|
-
export
|
|
13
|
+
export declare const ClientType: z.ZodEnum<["openai-agents", "claude", "claude-code", "cursor", "infer"]>;
|
|
14
|
+
export type ClientType = z.infer<typeof ClientType>;
|
|
15
|
+
export declare const knownClients: Record<Exclude<ClientType, 'infer'>, ClientCapabilities>;
|
|
14
16
|
/**
|
|
15
17
|
* Attempts to parse strings into JSON objects
|
|
16
18
|
*/
|
package/compat.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.d.mts","sourceRoot":"","sources":["src/compat.ts"],"names":[],"mappings":"OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,EAAE,QAAQ,EAAE;AAEnB,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,eAAO,MAAM,yBAAyB,EAAE,kBAOvC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"compat.d.mts","sourceRoot":"","sources":["src/compat.ts"],"names":[],"mappings":"OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,EAAE,CAAC,EAAE,MAAM,KAAK;OAChB,EAAE,QAAQ,EAAE;AAEnB,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,eAAO,MAAM,yBAAyB,EAAE,kBAOvC,CAAC;AAEF,eAAO,MAAM,UAAU,0EAAwE,CAAC;AAChG,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAKpD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAiCjF,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2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HANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
import { Endpoint } from "./tools.js";
|
|
3
4
|
export interface ClientCapabilities {
|
|
4
5
|
topLevelUnions: boolean;
|
|
@@ -9,8 +10,9 @@ export interface ClientCapabilities {
|
|
|
9
10
|
toolNameLength: number | undefined;
|
|
10
11
|
}
|
|
11
12
|
export declare const defaultClientCapabilities: ClientCapabilities;
|
|
12
|
-
export
|
|
13
|
-
export
|
|
13
|
+
export declare const ClientType: z.ZodEnum<["openai-agents", "claude", "claude-code", "cursor", "infer"]>;
|
|
14
|
+
export type ClientType = z.infer<typeof ClientType>;
|
|
15
|
+
export declare const knownClients: Record<Exclude<ClientType, 'infer'>, ClientCapabilities>;
|
|
14
16
|
/**
|
|
15
17
|
* Attempts to parse strings into JSON objects
|
|
16
18
|
*/
|
package/compat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["src/compat.ts"],"names":[],"mappings":"OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,EAAE,QAAQ,EAAE;AAEnB,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,eAAO,MAAM,yBAAyB,EAAE,kBAOvC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["src/compat.ts"],"names":[],"mappings":"OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,EAAE,CAAC,EAAE,MAAM,KAAK;OAChB,EAAE,QAAQ,EAAE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