dodopayments-mcp 1.50.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.
Files changed (146) hide show
  1. package/README.md +6 -6
  2. package/code-tool-paths.cjs +6 -0
  3. package/code-tool-paths.cjs.map +1 -0
  4. package/code-tool-paths.d.cts +2 -0
  5. package/code-tool-paths.d.cts.map +1 -0
  6. package/code-tool-types.d.mts +14 -0
  7. package/code-tool-types.d.mts.map +1 -0
  8. package/code-tool-types.d.ts +14 -0
  9. package/code-tool-types.d.ts.map +1 -0
  10. package/code-tool-types.js +4 -0
  11. package/code-tool-types.js.map +1 -0
  12. package/code-tool-types.mjs +3 -0
  13. package/code-tool-types.mjs.map +1 -0
  14. package/code-tool-worker.d.mts +5 -0
  15. package/code-tool-worker.d.mts.map +1 -0
  16. package/code-tool-worker.d.ts +5 -0
  17. package/code-tool-worker.d.ts.map +1 -0
  18. package/code-tool-worker.js +45 -0
  19. package/code-tool-worker.js.map +1 -0
  20. package/code-tool-worker.mjs +40 -0
  21. package/code-tool-worker.mjs.map +1 -0
  22. package/code-tool.d.mts +12 -0
  23. package/code-tool.d.mts.map +1 -0
  24. package/code-tool.d.ts +12 -0
  25. package/code-tool.d.ts.map +1 -0
  26. package/code-tool.js +123 -0
  27. package/code-tool.js.map +1 -0
  28. package/code-tool.mjs +120 -0
  29. package/code-tool.mjs.map +1 -0
  30. package/compat.d.mts +2 -2
  31. package/compat.d.mts.map +1 -1
  32. package/compat.d.ts +2 -2
  33. package/compat.d.ts.map +1 -1
  34. package/compat.js +1 -1
  35. package/compat.js.map +1 -1
  36. package/compat.mjs +1 -1
  37. package/compat.mjs.map +1 -1
  38. package/headers.d.mts +1 -1
  39. package/headers.d.mts.map +1 -1
  40. package/headers.d.ts +1 -1
  41. package/headers.d.ts.map +1 -1
  42. package/headers.js.map +1 -1
  43. package/headers.mjs.map +1 -1
  44. package/http.d.mts +1 -2
  45. package/http.d.mts.map +1 -1
  46. package/http.d.ts +1 -2
  47. package/http.d.ts.map +1 -1
  48. package/http.js +1 -1
  49. package/http.js.map +1 -1
  50. package/http.mjs +1 -1
  51. package/http.mjs.map +1 -1
  52. package/index.js +2 -2
  53. package/index.js.map +1 -1
  54. package/index.mjs +2 -2
  55. package/index.mjs.map +1 -1
  56. package/options.d.mts +6 -5
  57. package/options.d.mts.map +1 -1
  58. package/options.d.ts +6 -5
  59. package/options.d.ts.map +1 -1
  60. package/options.js +18 -27
  61. package/options.js.map +1 -1
  62. package/options.mjs +18 -27
  63. package/options.mjs.map +1 -1
  64. package/package.json +7 -2
  65. package/server.d.mts +3 -16
  66. package/server.d.mts.map +1 -1
  67. package/server.d.ts +3 -16
  68. package/server.d.ts.map +1 -1
  69. package/server.js +42 -24
  70. package/server.js.map +1 -1
  71. package/server.mjs +43 -24
  72. package/server.mjs.map +1 -1
  73. package/src/code-tool-paths.cts +3 -0
  74. package/src/code-tool-types.ts +14 -0
  75. package/src/code-tool-worker.ts +46 -0
  76. package/src/code-tool.ts +144 -0
  77. package/src/compat.ts +2 -2
  78. package/src/headers.ts +1 -2
  79. package/src/http.ts +1 -6
  80. package/src/index.ts +2 -2
  81. package/src/options.ts +26 -34
  82. package/src/server.ts +54 -37
  83. package/src/stdio.ts +3 -4
  84. package/src/tools/checkout-sessions/create-checkout-sessions.ts +688 -0
  85. package/src/tools/index.ts +2 -2
  86. package/src/tools/subscriptions/create-subscriptions.ts +30 -27
  87. package/src/tools/subscriptions/update-subscriptions.ts +1 -0
  88. package/src/tools/webhooks/create-webhooks.ts +1 -1
  89. package/src/tools/webhooks/list-webhooks.ts +1 -1
  90. package/src/tools/webhooks/retrieve-webhooks.ts +1 -1
  91. package/src/tools/webhooks/update-webhooks.ts +1 -1
  92. package/stdio.d.mts +1 -2
  93. package/stdio.d.mts.map +1 -1
  94. package/stdio.d.ts +1 -2
  95. package/stdio.d.ts.map +1 -1
  96. package/stdio.js +2 -2
  97. package/stdio.js.map +1 -1
  98. package/stdio.mjs +3 -3
  99. package/stdio.mjs.map +1 -1
  100. package/tools/{your-webhook-url/create-your-webhook-url.d.ts → checkout-sessions/create-checkout-sessions.d.mts} +1 -1
  101. package/tools/checkout-sessions/create-checkout-sessions.d.mts.map +1 -0
  102. package/tools/{your-webhook-url/create-your-webhook-url.d.mts → checkout-sessions/create-checkout-sessions.d.ts} +1 -1
  103. package/tools/checkout-sessions/create-checkout-sessions.d.ts.map +1 -0
  104. package/tools/checkout-sessions/create-checkout-sessions.js +675 -0
  105. package/tools/checkout-sessions/create-checkout-sessions.js.map +1 -0
  106. package/tools/checkout-sessions/create-checkout-sessions.mjs +671 -0
  107. package/tools/checkout-sessions/create-checkout-sessions.mjs.map +1 -0
  108. package/tools/index.js +2 -2
  109. package/tools/index.js.map +1 -1
  110. package/tools/index.mjs +2 -2
  111. package/tools/index.mjs.map +1 -1
  112. package/tools/subscriptions/create-subscriptions.d.mts.map +1 -1
  113. package/tools/subscriptions/create-subscriptions.d.ts.map +1 -1
  114. package/tools/subscriptions/create-subscriptions.js +26 -23
  115. package/tools/subscriptions/create-subscriptions.js.map +1 -1
  116. package/tools/subscriptions/create-subscriptions.mjs +26 -23
  117. package/tools/subscriptions/create-subscriptions.mjs.map +1 -1
  118. package/tools/subscriptions/update-subscriptions.d.mts.map +1 -1
  119. package/tools/subscriptions/update-subscriptions.d.ts.map +1 -1
  120. package/tools/subscriptions/update-subscriptions.js +1 -0
  121. package/tools/subscriptions/update-subscriptions.js.map +1 -1
  122. package/tools/subscriptions/update-subscriptions.mjs +1 -0
  123. package/tools/subscriptions/update-subscriptions.mjs.map +1 -1
  124. package/tools/webhooks/create-webhooks.js +1 -1
  125. package/tools/webhooks/create-webhooks.js.map +1 -1
  126. package/tools/webhooks/create-webhooks.mjs +1 -1
  127. package/tools/webhooks/create-webhooks.mjs.map +1 -1
  128. package/tools/webhooks/list-webhooks.js +1 -1
  129. package/tools/webhooks/list-webhooks.js.map +1 -1
  130. package/tools/webhooks/list-webhooks.mjs +1 -1
  131. package/tools/webhooks/list-webhooks.mjs.map +1 -1
  132. package/tools/webhooks/retrieve-webhooks.js +1 -1
  133. package/tools/webhooks/retrieve-webhooks.js.map +1 -1
  134. package/tools/webhooks/retrieve-webhooks.mjs +1 -1
  135. package/tools/webhooks/retrieve-webhooks.mjs.map +1 -1
  136. package/tools/webhooks/update-webhooks.js +1 -1
  137. package/tools/webhooks/update-webhooks.js.map +1 -1
  138. package/tools/webhooks/update-webhooks.mjs +1 -1
  139. package/tools/webhooks/update-webhooks.mjs.map +1 -1
  140. package/src/tools/your-webhook-url/create-your-webhook-url.ts +0 -1152
  141. package/tools/your-webhook-url/create-your-webhook-url.d.mts.map +0 -1
  142. package/tools/your-webhook-url/create-your-webhook-url.d.ts.map +0 -1
  143. package/tools/your-webhook-url/create-your-webhook-url.js +0 -1141
  144. package/tools/your-webhook-url/create-your-webhook-url.js.map +0 -1
  145. package/tools/your-webhook-url/create-your-webhook-url.mjs +0 -1137
  146. package/tools/your-webhook-url/create-your-webhook-url.mjs.map +0 -1
package/README.md CHANGED
@@ -174,7 +174,7 @@ http://localhost:3000?client=cursor&capability=tool-name-length%3D40
174
174
  import { server, endpoints, init } from "dodopayments-mcp/server";
175
175
 
176
176
  // import a specific tool
177
- import createPayments from "dodopayments-mcp/tools/payments/create-payments";
177
+ import createCheckoutSessions from "dodopayments-mcp/tools/checkout-sessions/create-checkout-sessions";
178
178
 
179
179
  // initialize the server and all endpoints
180
180
  init({ server, endpoints });
@@ -199,13 +199,17 @@ const myCustomEndpoint = {
199
199
  };
200
200
 
201
201
  // initialize the server with your custom endpoints
202
- init({ server: myServer, endpoints: [createPayments, myCustomEndpoint] });
202
+ init({ server: myServer, endpoints: [createCheckoutSessions, myCustomEndpoint] });
203
203
  ```
204
204
 
205
205
  ## Available Tools
206
206
 
207
207
  The following tools are available in this MCP server.
208
208
 
209
+ ### Resource `checkout_sessions`:
210
+
211
+ - `create_checkout_sessions` (`write`):
212
+
209
213
  ### Resource `payments`:
210
214
 
211
215
  - `create_payments` (`write`):
@@ -326,7 +330,3 @@ The following tools are available in this MCP server.
326
330
 
327
331
  - `retrieve_webhooks_headers` (`read`): Get a webhook by id
328
332
  - `update_webhooks_headers` (`write`): Patch a webhook by id
329
-
330
- ### Resource `your_webhook_url`:
331
-
332
- - `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,2 @@
1
+ export declare const workerPath: string;
2
+ //# sourceMappingURL=code-tool-paths.d.cts.map
@@ -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,4 @@
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
+ //# sourceMappingURL=code-tool-types.js.map
@@ -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,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export {};
3
+ //# sourceMappingURL=code-tool-types.mjs.map
@@ -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,5 @@
1
+ declare const _default: {
2
+ fetch: (req: Request) => Promise<Response>;
3
+ };
4
+ export default _default;
5
+ //# sourceMappingURL=code-tool-worker.d.mts.map
@@ -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,5 @@
1
+ declare const _default: {
2
+ fetch: (req: Request) => Promise<Response>;
3
+ };
4
+ export default _default;
5
+ //# sourceMappingURL=code-tool-worker.d.ts.map
@@ -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,MAAM,MAAM,GAAG,IAAI,2BAAY,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,mBAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,KAAK,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE;YAC5B,QAAQ,CAAC,IAAI,CAAC,mBAAI,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,kBAAe,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,40 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import util from 'node:util';
3
+ import { DodoPayments } 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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,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"}
@@ -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
@@ -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,SAAgB,QAAQ;IACtB,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EACT,khCAAkhC;QACphC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC1E,CAAC;IAEF,MAAM,OAAO,GAAG,KAAK,EAAE,MAAoB,EAAE,IAAa,EAAE,EAAE;QAC5D,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QACzD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAwB,CAAC;QAE1C,MAAM,MAAM,GAAG,MAAM,IAAA,oCAAiB,EAAC,IAAA,wBAAa,EAAC,gCAAU,CAAC,EAAE;YAChE,QAAQ,EAAE;gBACR,2BAA2B;gBAC3B,qCAAqC,gCAAU,CAAC,OAAO,CAAC,+BAA+B,EAAE,IAAI,CAAC,GAAG;gBACjG,eAAe,eAAe,EAAE;gBAChC,2FAA2F;gBAC3F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MAAM,KAAK,CAAC,CAAC,CAAC;oBACrB,IAAI;oBACN,CAAC,CAAC;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;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/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-tool.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,OAAO,EAAE,MAAM,WAAW;OAC5B,EAAE,aAAa,EAAE,MAAM,UAAU;OAMjC,EAAE,iBAAiB,EAAE,MAAM,2BAA2B;OAEtD,EAAE,UAAU,EAAE,MAAM,uBAAuB;AAElD;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ;IACtB,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;I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AM,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
@@ -10,9 +10,9 @@ export interface ClientCapabilities {
10
10
  toolNameLength: number | undefined;
11
11
  }
12
12
  export declare const defaultClientCapabilities: ClientCapabilities;
13
- export declare const ClientType: z.ZodEnum<["openai-agents", "claude", "claude-code", "cursor"]>;
13
+ export declare const ClientType: z.ZodEnum<["openai-agents", "claude", "claude-code", "cursor", "infer"]>;
14
14
  export type ClientType = z.infer<typeof ClientType>;
15
- export declare const knownClients: Record<ClientType, ClientCapabilities>;
15
+ export declare const knownClients: Record<Exclude<ClientType, 'infer'>, ClientCapabilities>;
16
16
  /**
17
17
  * Attempts to parse strings into JSON objects
18
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,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,iEAA+D,CAAC;AACvF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAKpD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAiC/D,CAAC;AAEF;;GAEG;AACH,wBAAgB,i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IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAwCzF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAyCvD;AAED,iBAAS,YAAY,CACnB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAChC,OAAO,GAAE,GAAG,CAAC,MAAM,CAAa,GAC/B,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CA6B5B;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAazD;AAoED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CA0C1D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,GAAG,UAAU,CAkCxF;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,QAAQ,EAAE,EACrB,YAAY,EAAE,kBAAkB,GAC/B,QAAQ,EAAE,CAiEZ"}
package/compat.d.ts CHANGED
@@ -10,9 +10,9 @@ export interface ClientCapabilities {
10
10
  toolNameLength: number | undefined;
11
11
  }
12
12
  export declare const defaultClientCapabilities: ClientCapabilities;
13
- export declare const ClientType: z.ZodEnum<["openai-agents", "claude", "claude-code", "cursor"]>;
13
+ export declare const ClientType: z.ZodEnum<["openai-agents", "claude", "claude-code", "cursor", "infer"]>;
14
14
  export type ClientType = z.infer<typeof ClientType>;
15
- export declare const knownClients: Record<ClientType, ClientCapabilities>;
15
+ export declare const knownClients: Record<Exclude<ClientType, 'infer'>, ClientCapabilities>;
16
16
  /**
17
17
  * Attempts to parse strings into JSON objects
18
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,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,iEAA+D,CAAC;AACvF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAKpD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAiC/D,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2BAwB/F;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC,GAAG,EAAE,MAAM,G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5B;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAazD;AAoED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CA0C1D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,GAAG,UAAU,CAkCxF;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,QAAQ,EAAE,EACrB,YAAY,EAAE,kBAAkB,GAC/B,QAAQ,EAAE,CAiEZ"}
package/compat.js CHANGED
@@ -18,7 +18,7 @@ exports.defaultClientCapabilities = {
18
18
  formats: true,
19
19
  toolNameLength: undefined,
20
20
  };
21
- exports.ClientType = zod_1.z.enum(['openai-agents', 'claude', 'claude-code', 'cursor']);
21
+ exports.ClientType = zod_1.z.enum(['openai-agents', 'claude', 'claude-code', 'cursor', 'infer']);
22
22
  // Client presets for compatibility
23
23
  // Note that these could change over time as models get better, so this is
24
24
  // a best effort.