@henrylabs/mcp 0.2.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 +201 -0
- package/README.md +255 -0
- 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 +158 -0
- package/code-tool.js.map +1 -0
- package/code-tool.mjs +122 -0
- package/code-tool.mjs.map +1 -0
- package/compat.d.mts +58 -0
- package/compat.d.mts.map +1 -0
- package/compat.d.ts +58 -0
- package/compat.d.ts.map +1 -0
- package/compat.js +387 -0
- package/compat.js.map +1 -0
- package/compat.mjs +378 -0
- package/compat.mjs.map +1 -0
- package/docs-search-tool.d.mts +44 -0
- package/docs-search-tool.d.mts.map +1 -0
- package/docs-search-tool.d.ts +44 -0
- package/docs-search-tool.d.ts.map +1 -0
- package/docs-search-tool.js +43 -0
- package/docs-search-tool.js.map +1 -0
- package/docs-search-tool.mjs +39 -0
- package/docs-search-tool.mjs.map +1 -0
- package/dynamic-tools.d.mts +12 -0
- package/dynamic-tools.d.mts.map +1 -0
- package/dynamic-tools.d.ts +12 -0
- package/dynamic-tools.d.ts.map +1 -0
- package/dynamic-tools.js +135 -0
- package/dynamic-tools.js.map +1 -0
- package/dynamic-tools.mjs +132 -0
- package/dynamic-tools.mjs.map +1 -0
- package/filtering.d.mts +2 -0
- package/filtering.d.mts.map +1 -0
- package/filtering.d.ts +2 -0
- package/filtering.d.ts.map +1 -0
- package/filtering.js +20 -0
- package/filtering.js.map +1 -0
- package/filtering.mjs +13 -0
- package/filtering.mjs.map +1 -0
- 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 +13 -0
- package/headers.js.map +1 -0
- package/headers.mjs +9 -0
- package/headers.mjs.map +1 -0
- package/http.d.mts +9 -0
- package/http.d.mts.map +1 -0
- package/http.d.ts +9 -0
- package/http.d.ts.map +1 -0
- package/http.js +108 -0
- package/http.js.map +1 -0
- package/http.mjs +100 -0
- package/http.mjs.map +1 -0
- package/index.d.mts +3 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +91 -0
- package/index.js.map +1 -0
- package/index.mjs +89 -0
- package/index.mjs.map +1 -0
- package/options.d.mts +20 -0
- package/options.d.mts.map +1 -0
- package/options.d.ts +20 -0
- package/options.d.ts.map +1 -0
- package/options.js +424 -0
- package/options.js.map +1 -0
- package/options.mjs +417 -0
- package/options.mjs.map +1 -0
- package/package.json +216 -0
- package/server.d.mts +35 -0
- package/server.d.mts.map +1 -0
- package/server.d.ts +35 -0
- package/server.d.ts.map +1 -0
- package/server.js +175 -0
- package/server.js.map +1 -0
- package/server.mjs +161 -0
- package/server.mjs.map +1 -0
- 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 +147 -0
- package/src/compat.ts +483 -0
- package/src/docs-search-tool.ts +48 -0
- package/src/dynamic-tools.ts +153 -0
- package/src/filtering.ts +14 -0
- package/src/headers.ts +14 -0
- package/src/http.ts +127 -0
- package/src/index.ts +108 -0
- package/src/options.ts +466 -0
- package/src/server.ts +208 -0
- package/src/stdio.ts +13 -0
- package/src/tools/cart/create-checkout-cart.ts +49 -0
- package/src/tools/cart/items/add-cart-items.ts +93 -0
- package/src/tools/cart/items/clear-cart-items.ts +47 -0
- package/src/tools/cart/items/list-cart-items.ts +47 -0
- package/src/tools/cart/items/remove-cart-items.ts +50 -0
- package/src/tools/checkout/session/confirm-checkout-checkout-session.ts +101 -0
- package/src/tools/checkout/session/create-quote-checkout-session.ts +96 -0
- package/src/tools/checkout/session/list-products-checkout-session.ts +47 -0
- package/src/tools/checkout/session/retrieve-shipping-info-checkout-session.ts +49 -0
- package/src/tools/index.ts +105 -0
- package/src/tools/merchants/check-status-merchants.ts +56 -0
- package/src/tools/merchants/get-shipping-info-merchants.ts +60 -0
- package/src/tools/merchants/list-supported-merchants.ts +52 -0
- package/src/tools/orders/retrieve-status-orders.ts +47 -0
- package/src/tools/products/retrieve-details-products.ts +48 -0
- package/src/tools/products/search-products.ts +78 -0
- package/src/tools/products/variant-check/create-products-variant-check.ts +85 -0
- package/src/tools/products/variant-check/retrieve-status-products-variant-check.ts +50 -0
- package/src/tools/types.ts +103 -0
- package/src/tools/wallet/create-card-collection-wallet.ts +49 -0
- package/src/tools.ts +1 -0
- package/src/tsconfig.json +11 -0
- 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/cart/create-checkout-cart.d.mts +45 -0
- package/tools/cart/create-checkout-cart.d.mts.map +1 -0
- package/tools/cart/create-checkout-cart.d.ts +45 -0
- package/tools/cart/create-checkout-cart.d.ts.map +1 -0
- package/tools/cart/create-checkout-cart.js +44 -0
- package/tools/cart/create-checkout-cart.js.map +1 -0
- package/tools/cart/create-checkout-cart.mjs +40 -0
- package/tools/cart/create-checkout-cart.mjs.map +1 -0
- package/tools/cart/items/add-cart-items.d.mts +45 -0
- package/tools/cart/items/add-cart-items.d.mts.map +1 -0
- package/tools/cart/items/add-cart-items.d.ts +45 -0
- package/tools/cart/items/add-cart-items.d.ts.map +1 -0
- package/tools/cart/items/add-cart-items.js +86 -0
- package/tools/cart/items/add-cart-items.js.map +1 -0
- package/tools/cart/items/add-cart-items.mjs +82 -0
- package/tools/cart/items/add-cart-items.mjs.map +1 -0
- package/tools/cart/items/clear-cart-items.d.mts +45 -0
- package/tools/cart/items/clear-cart-items.d.mts.map +1 -0
- package/tools/cart/items/clear-cart-items.d.ts +45 -0
- package/tools/cart/items/clear-cart-items.d.ts.map +1 -0
- package/tools/cart/items/clear-cart-items.js +42 -0
- package/tools/cart/items/clear-cart-items.js.map +1 -0
- package/tools/cart/items/clear-cart-items.mjs +38 -0
- package/tools/cart/items/clear-cart-items.mjs.map +1 -0
- package/tools/cart/items/list-cart-items.d.mts +45 -0
- package/tools/cart/items/list-cart-items.d.mts.map +1 -0
- package/tools/cart/items/list-cart-items.d.ts +45 -0
- package/tools/cart/items/list-cart-items.d.ts.map +1 -0
- package/tools/cart/items/list-cart-items.js +42 -0
- package/tools/cart/items/list-cart-items.js.map +1 -0
- package/tools/cart/items/list-cart-items.mjs +38 -0
- package/tools/cart/items/list-cart-items.mjs.map +1 -0
- package/tools/cart/items/remove-cart-items.d.mts +45 -0
- package/tools/cart/items/remove-cart-items.d.mts.map +1 -0
- package/tools/cart/items/remove-cart-items.d.ts +45 -0
- package/tools/cart/items/remove-cart-items.d.ts.map +1 -0
- package/tools/cart/items/remove-cart-items.js +45 -0
- package/tools/cart/items/remove-cart-items.js.map +1 -0
- package/tools/cart/items/remove-cart-items.mjs +41 -0
- package/tools/cart/items/remove-cart-items.mjs.map +1 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.d.mts +45 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.d.mts.map +1 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.d.ts +45 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.d.ts.map +1 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.js +94 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.js.map +1 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.mjs +90 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.mjs.map +1 -0
- package/tools/checkout/session/create-quote-checkout-session.d.mts +45 -0
- package/tools/checkout/session/create-quote-checkout-session.d.mts.map +1 -0
- package/tools/checkout/session/create-quote-checkout-session.d.ts +45 -0
- package/tools/checkout/session/create-quote-checkout-session.d.ts.map +1 -0
- package/tools/checkout/session/create-quote-checkout-session.js +91 -0
- package/tools/checkout/session/create-quote-checkout-session.js.map +1 -0
- package/tools/checkout/session/create-quote-checkout-session.mjs +87 -0
- package/tools/checkout/session/create-quote-checkout-session.mjs.map +1 -0
- package/tools/checkout/session/list-products-checkout-session.d.mts +45 -0
- package/tools/checkout/session/list-products-checkout-session.d.mts.map +1 -0
- package/tools/checkout/session/list-products-checkout-session.d.ts +45 -0
- package/tools/checkout/session/list-products-checkout-session.d.ts.map +1 -0
- package/tools/checkout/session/list-products-checkout-session.js +42 -0
- package/tools/checkout/session/list-products-checkout-session.js.map +1 -0
- package/tools/checkout/session/list-products-checkout-session.mjs +38 -0
- package/tools/checkout/session/list-products-checkout-session.mjs.map +1 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.mts +45 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.mts.map +1 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.ts +45 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.ts.map +1 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.js +42 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.js.map +1 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.mjs +38 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.mjs.map +1 -0
- package/tools/index.d.mts +10 -0
- package/tools/index.d.mts.map +1 -0
- package/tools/index.d.ts +10 -0
- package/tools/index.d.ts.map +1 -0
- package/tools/index.js +89 -0
- package/tools/index.js.map +1 -0
- package/tools/index.mjs +82 -0
- package/tools/index.mjs.map +1 -0
- package/tools/merchants/check-status-merchants.d.mts +45 -0
- package/tools/merchants/check-status-merchants.d.mts.map +1 -0
- package/tools/merchants/check-status-merchants.d.ts +45 -0
- package/tools/merchants/check-status-merchants.d.ts.map +1 -0
- package/tools/merchants/check-status-merchants.js +48 -0
- package/tools/merchants/check-status-merchants.js.map +1 -0
- package/tools/merchants/check-status-merchants.mjs +44 -0
- package/tools/merchants/check-status-merchants.mjs.map +1 -0
- package/tools/merchants/get-shipping-info-merchants.d.mts +45 -0
- package/tools/merchants/get-shipping-info-merchants.d.mts.map +1 -0
- package/tools/merchants/get-shipping-info-merchants.d.ts +45 -0
- package/tools/merchants/get-shipping-info-merchants.d.ts.map +1 -0
- package/tools/merchants/get-shipping-info-merchants.js +55 -0
- package/tools/merchants/get-shipping-info-merchants.js.map +1 -0
- package/tools/merchants/get-shipping-info-merchants.mjs +51 -0
- package/tools/merchants/get-shipping-info-merchants.mjs.map +1 -0
- package/tools/merchants/list-supported-merchants.d.mts +45 -0
- package/tools/merchants/list-supported-merchants.d.mts.map +1 -0
- package/tools/merchants/list-supported-merchants.d.ts +45 -0
- package/tools/merchants/list-supported-merchants.d.ts.map +1 -0
- package/tools/merchants/list-supported-merchants.js +47 -0
- package/tools/merchants/list-supported-merchants.js.map +1 -0
- package/tools/merchants/list-supported-merchants.mjs +43 -0
- package/tools/merchants/list-supported-merchants.mjs.map +1 -0
- package/tools/orders/retrieve-status-orders.d.mts +45 -0
- package/tools/orders/retrieve-status-orders.d.mts.map +1 -0
- package/tools/orders/retrieve-status-orders.d.ts +45 -0
- package/tools/orders/retrieve-status-orders.d.ts.map +1 -0
- package/tools/orders/retrieve-status-orders.js +42 -0
- package/tools/orders/retrieve-status-orders.js.map +1 -0
- package/tools/orders/retrieve-status-orders.mjs +38 -0
- package/tools/orders/retrieve-status-orders.mjs.map +1 -0
- package/tools/products/retrieve-details-products.d.mts +45 -0
- package/tools/products/retrieve-details-products.d.mts.map +1 -0
- package/tools/products/retrieve-details-products.d.ts +45 -0
- package/tools/products/retrieve-details-products.d.ts.map +1 -0
- package/tools/products/retrieve-details-products.js +43 -0
- package/tools/products/retrieve-details-products.js.map +1 -0
- package/tools/products/retrieve-details-products.mjs +39 -0
- package/tools/products/retrieve-details-products.mjs.map +1 -0
- package/tools/products/search-products.d.mts +45 -0
- package/tools/products/search-products.d.mts.map +1 -0
- package/tools/products/search-products.d.ts +45 -0
- package/tools/products/search-products.d.ts.map +1 -0
- package/tools/products/search-products.js +73 -0
- package/tools/products/search-products.js.map +1 -0
- package/tools/products/search-products.mjs +69 -0
- package/tools/products/search-products.mjs.map +1 -0
- package/tools/products/variant-check/create-products-variant-check.d.mts +45 -0
- package/tools/products/variant-check/create-products-variant-check.d.mts.map +1 -0
- package/tools/products/variant-check/create-products-variant-check.d.ts +45 -0
- package/tools/products/variant-check/create-products-variant-check.d.ts.map +1 -0
- package/tools/products/variant-check/create-products-variant-check.js +79 -0
- package/tools/products/variant-check/create-products-variant-check.js.map +1 -0
- package/tools/products/variant-check/create-products-variant-check.mjs +75 -0
- package/tools/products/variant-check/create-products-variant-check.mjs.map +1 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.d.mts +45 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.d.mts.map +1 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.d.ts +45 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.d.ts.map +1 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.js +43 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.js.map +1 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.mjs +39 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.mjs.map +1 -0
- package/tools/types.d.mts +51 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +51 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +46 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +42 -0
- package/tools/types.mjs.map +1 -0
- package/tools/wallet/create-card-collection-wallet.d.mts +45 -0
- package/tools/wallet/create-card-collection-wallet.d.mts.map +1 -0
- package/tools/wallet/create-card-collection-wallet.d.ts +45 -0
- package/tools/wallet/create-card-collection-wallet.d.ts.map +1 -0
- package/tools/wallet/create-card-collection-wallet.js +44 -0
- package/tools/wallet/create-card-collection-wallet.js.map +1 -0
- package/tools/wallet/create-card-collection-wallet.mjs +40 -0
- package/tools/wallet/create-card-collection-wallet.mjs.map +1 -0
- package/tools.d.mts +2 -0
- package/tools.d.mts.map +1 -0
- package/tools.d.ts +2 -0
- package/tools.d.ts.map +1 -0
- package/tools.js +18 -0
- package/tools.js.map +1 -0
- package/tools.mjs +2 -0
- package/tools.mjs.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Henry SDK
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# Henry SDK TypeScript MCP Server
|
|
2
|
+
|
|
3
|
+
It is generated with [Stainless](https://www.stainless.com/).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Direct invocation
|
|
8
|
+
|
|
9
|
+
You can run the MCP Server directly via `npx`:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
export HENRY_SDK_API_KEY="My API Key"
|
|
13
|
+
export HENRY_SDK_ACCESS_TOKEN="My Access Token"
|
|
14
|
+
export HENRY_SDK_ENVIRONMENT="production"
|
|
15
|
+
npx -y @henrylabs/mcp@latest
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Via MCP Client
|
|
19
|
+
|
|
20
|
+
There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already
|
|
21
|
+
have a client, consult their documentation to install the MCP server.
|
|
22
|
+
|
|
23
|
+
For clients with a configuration JSON, it might look something like this:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"henrylabs_sdk_api": {
|
|
29
|
+
"command": "npx",
|
|
30
|
+
"args": ["-y", "@henrylabs/mcp", "--client=claude", "--tools=all"],
|
|
31
|
+
"env": {
|
|
32
|
+
"HENRY_SDK_API_KEY": "My API Key",
|
|
33
|
+
"HENRY_SDK_ACCESS_TOKEN": "My Access Token",
|
|
34
|
+
"HENRY_SDK_ENVIRONMENT": "production"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Exposing endpoints to your MCP Client
|
|
42
|
+
|
|
43
|
+
There are two ways to expose endpoints as tools in the MCP server:
|
|
44
|
+
|
|
45
|
+
1. Exposing one tool per endpoint, and filtering as necessary
|
|
46
|
+
2. Exposing a set of tools to dynamically discover and invoke endpoints from the API
|
|
47
|
+
|
|
48
|
+
### Filtering endpoints and tools
|
|
49
|
+
|
|
50
|
+
You can run the package on the command line to discover and filter the set of tools that are exposed by the
|
|
51
|
+
MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's
|
|
52
|
+
context window.
|
|
53
|
+
|
|
54
|
+
You can filter by multiple aspects:
|
|
55
|
+
|
|
56
|
+
- `--tool` includes a specific tool by name
|
|
57
|
+
- `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*`
|
|
58
|
+
- `--operation` includes just read (get/list) or just write operations
|
|
59
|
+
|
|
60
|
+
### Dynamic tools
|
|
61
|
+
|
|
62
|
+
If you specify `--tools=dynamic` to the MCP server, instead of exposing one tool per endpoint in the API, it will
|
|
63
|
+
expose the following tools:
|
|
64
|
+
|
|
65
|
+
1. `list_api_endpoints` - Discovers available endpoints, with optional filtering by search query
|
|
66
|
+
2. `get_api_endpoint_schema` - Gets detailed schema information for a specific endpoint
|
|
67
|
+
3. `invoke_api_endpoint` - Executes any endpoint with the appropriate parameters
|
|
68
|
+
|
|
69
|
+
This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
|
|
70
|
+
of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
|
|
71
|
+
search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
|
|
72
|
+
can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
|
|
73
|
+
you can opt-in to explicit tools, the dynamic tools, or both.
|
|
74
|
+
|
|
75
|
+
See more information with `--help`.
|
|
76
|
+
|
|
77
|
+
All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`).
|
|
78
|
+
|
|
79
|
+
Use `--list` to see the list of available tools, or see below.
|
|
80
|
+
|
|
81
|
+
### Specifying the MCP Client
|
|
82
|
+
|
|
83
|
+
Different clients have varying abilities to handle arbitrary tools and schemas.
|
|
84
|
+
|
|
85
|
+
You can specify the client you are using with the `--client` argument, and the MCP server will automatically
|
|
86
|
+
serve tools and schemas that are more compatible with that client.
|
|
87
|
+
|
|
88
|
+
- `--client=<type>`: Set all capabilities based on a known MCP client
|
|
89
|
+
|
|
90
|
+
- Valid values: `openai-agents`, `claude`, `claude-code`, `cursor`
|
|
91
|
+
- Example: `--client=cursor`
|
|
92
|
+
|
|
93
|
+
Additionally, if you have a client not on the above list, or the client has gotten better
|
|
94
|
+
over time, you can manually enable or disable certain capabilities:
|
|
95
|
+
|
|
96
|
+
- `--capability=<name>`: Specify individual client capabilities
|
|
97
|
+
- Available capabilities:
|
|
98
|
+
- `top-level-unions`: Enable support for top-level unions in tool schemas
|
|
99
|
+
- `valid-json`: Enable JSON string parsing for arguments
|
|
100
|
+
- `refs`: Enable support for $ref pointers in schemas
|
|
101
|
+
- `unions`: Enable support for union types (anyOf) in schemas
|
|
102
|
+
- `formats`: Enable support for format validations in schemas (e.g. date-time, email)
|
|
103
|
+
- `tool-name-length=N`: Set maximum tool name length to N characters
|
|
104
|
+
- Example: `--capability=top-level-unions --capability=tool-name-length=40`
|
|
105
|
+
- Example: `--capability=top-level-unions,tool-name-length=40`
|
|
106
|
+
|
|
107
|
+
### Examples
|
|
108
|
+
|
|
109
|
+
1. Filter for read operations on cards:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
--resource=cards --operation=read
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
2. Exclude specific tools while including others:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
--resource=cards --no-tool=create_cards
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
3. Configure for Cursor client with custom max tool name length:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
--client=cursor --capability=tool-name-length=40
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
4. Complex filtering with multiple criteria:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Running remotely
|
|
134
|
+
|
|
135
|
+
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.
|
|
136
|
+
|
|
137
|
+
Authorization can be provided via the following headers:
|
|
138
|
+
| Header | Equivalent client option | Security scheme |
|
|
139
|
+
| ---------------- | ------------------------ | --------------- |
|
|
140
|
+
| `x-api-key` | `apiKey` | ApiKeyAuth |
|
|
141
|
+
| `x-access-token` | `accessToken` | AccessTokenAuth |
|
|
142
|
+
|
|
143
|
+
A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"henrylabs_sdk_api": {
|
|
149
|
+
"url": "http://localhost:3000",
|
|
150
|
+
"headers": {
|
|
151
|
+
"x-api-key": "My API Key"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
|
|
159
|
+
For example, to exclude specific tools while including others, use the URL:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
http://localhost:3000?client=cursor&capability=tool-name-length%3D40
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Importing the tools and server individually
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
// Import the server, generated endpoints, or the init function
|
|
175
|
+
import { server, endpoints, init } from "@henrylabs/mcp/server";
|
|
176
|
+
|
|
177
|
+
// import a specific tool
|
|
178
|
+
import retrieveDetailsProducts from "@henrylabs/mcp/tools/products/retrieve-details-products";
|
|
179
|
+
|
|
180
|
+
// initialize the server and all endpoints
|
|
181
|
+
init({ server, endpoints });
|
|
182
|
+
|
|
183
|
+
// manually start server
|
|
184
|
+
const transport = new StdioServerTransport();
|
|
185
|
+
await server.connect(transport);
|
|
186
|
+
|
|
187
|
+
// or initialize your own server with specific tools
|
|
188
|
+
const myServer = new McpServer(...);
|
|
189
|
+
|
|
190
|
+
// define your own endpoint
|
|
191
|
+
const myCustomEndpoint = {
|
|
192
|
+
tool: {
|
|
193
|
+
name: 'my_custom_tool',
|
|
194
|
+
description: 'My custom tool',
|
|
195
|
+
inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
|
|
196
|
+
},
|
|
197
|
+
handler: async (client: client, args: any) => {
|
|
198
|
+
return { myResponse: 'Hello world!' };
|
|
199
|
+
})
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// initialize the server with your custom endpoints
|
|
203
|
+
init({ server: myServer, endpoints: [retrieveDetailsProducts, myCustomEndpoint] });
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Available Tools
|
|
207
|
+
|
|
208
|
+
The following tools are available in this MCP server.
|
|
209
|
+
|
|
210
|
+
### Resource `products`:
|
|
211
|
+
|
|
212
|
+
- `retrieve_details_products` (`read`): Retrieve detailed information about a specific product given product ID
|
|
213
|
+
- `search_products` (`write`): Search for products using keyword and passing various filters and criteria
|
|
214
|
+
|
|
215
|
+
### Resource `products.variant_check`:
|
|
216
|
+
|
|
217
|
+
- `create_products_variant_check` (`write`): ! _This endpoint is experimental and unstable. The API contract may change without notice._
|
|
218
|
+
|
|
219
|
+
Creates a request to check if a specific product variant combination is in stock. Returns immediately with a request ID that can be used to poll for results.
|
|
220
|
+
|
|
221
|
+
- `retrieve_status_products_variant_check` (`read`): ! _This endpoint is experimental and unstable. The API contract may change without notice._
|
|
222
|
+
|
|
223
|
+
Poll the status of a variant availability check request. Returns the current status and results if completed.
|
|
224
|
+
|
|
225
|
+
### Resource `cart`:
|
|
226
|
+
|
|
227
|
+
- `create_checkout_cart` (`write`): Generates a hosted checkout URL for the user's cart that can be embedded in an iframe or modal. The page walks the buyer through reviewing the order, entering shipping and payment information, and confirming the purchase.
|
|
228
|
+
|
|
229
|
+
### Resource `cart.items`:
|
|
230
|
+
|
|
231
|
+
- `list_cart_items` (`read`): Get all products from the cart
|
|
232
|
+
- `add_cart_items` (`write`): Adds product data to existing cart or create a new one.
|
|
233
|
+
- `clear_cart_items` (`write`): Delete all products from the cart
|
|
234
|
+
- `remove_cart_items` (`write`): Delete a product from the cart
|
|
235
|
+
|
|
236
|
+
### Resource `checkout.session`:
|
|
237
|
+
|
|
238
|
+
- `confirm_checkout_checkout_session` (`write`): Confirms the checkout session and creates an order
|
|
239
|
+
- `create_quote_checkout_session` (`write`): Creates or updates a checkout session with shipping details and returns pricing metadata plus a session token.
|
|
240
|
+
- `list_products_checkout_session` (`read`): Returns products for the checkout session
|
|
241
|
+
- `retrieve_shipping_info_checkout_session` (`read`): Retrieves the shipping details for the current checkout session.
|
|
242
|
+
|
|
243
|
+
### Resource `orders`:
|
|
244
|
+
|
|
245
|
+
- `retrieve_status_orders` (`read`): Retrieve the status and details of an order given order ID
|
|
246
|
+
|
|
247
|
+
### Resource `wallet`:
|
|
248
|
+
|
|
249
|
+
- `create_card_collection_wallet` (`write`): Returns a modal URL for users to save payment cards. Supports both authenticated and guest card collection
|
|
250
|
+
|
|
251
|
+
### Resource `merchants`:
|
|
252
|
+
|
|
253
|
+
- `check_status_merchants` (`read`): Verifies whether a merchant is supported by checking their domain
|
|
254
|
+
- `get_shipping_info_merchants` (`read`): Retrieve shipping information including shipping tiers and free shipping thresholds for merchants
|
|
255
|
+
- `list_supported_merchants` (`read`): Returns a list of allowlist supported merchants
|
|
@@ -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,CAAC"}
|
|
@@ -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,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ClientOptions } from '@henrylabs/sdk';
|
|
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,gBAAgB;AAE9C,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 '@henrylabs/sdk';
|
|
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,gBAAgB;AAE9C,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 sdk_1 = require("@henrylabs/sdk");
|
|
9
|
+
const fetch = async (req) => {
|
|
10
|
+
const { opts, code } = (await req.json());
|
|
11
|
+
const client = new sdk_1.HenrySDK({
|
|
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,wCAA0C;AAE1C,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,cAAQ,CAAC;QAC1B,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 { HenrySDK } from '@henrylabs/sdk';
|
|
4
|
+
const fetch = async (req) => {
|
|
5
|
+
const { opts, code } = (await req.json());
|
|
6
|
+
const client = new HenrySDK({
|
|
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,QAAQ,EAAE,MAAM,gBAAgB;AAEzC,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,QAAQ,CAAC;QAC1B,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(): Promise<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;AAM3C;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,CA8HlD"}
|