@henrylabs/mcp 0.4.0 → 0.5.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 +10 -3
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/server.ts +1 -1
- package/src/tools/cart/create-cart-checkout.ts +1 -1
- 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-session.ts +1 -1
- package/src/tools/checkout/session/create-checkout-session.ts +1 -1
- package/src/tools/index.ts +8 -0
- package/src/tools/products/search-products.ts +1 -1
- package/tools/cart/create-cart-checkout.js +1 -1
- package/tools/cart/create-cart-checkout.js.map +1 -1
- package/tools/cart/create-cart-checkout.mjs +1 -1
- package/tools/cart/create-cart-checkout.mjs.map +1 -1
- 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-session.js +1 -1
- package/tools/checkout/session/confirm-checkout-session.js.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.mjs +1 -1
- package/tools/checkout/session/confirm-checkout-session.mjs.map +1 -1
- package/tools/checkout/session/create-checkout-session.js +1 -1
- package/tools/checkout/session/create-checkout-session.js.map +1 -1
- package/tools/checkout/session/create-checkout-session.mjs +1 -1
- package/tools/checkout/session/create-checkout-session.mjs.map +1 -1
- package/tools/index.d.mts.map +1 -1
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js +8 -0
- package/tools/index.js.map +1 -1
- package/tools/index.mjs +8 -0
- package/tools/index.mjs.map +1 -1
- package/tools/products/search-products.js +1 -1
- package/tools/products/search-products.js.map +1 -1
- package/tools/products/search-products.mjs +1 -1
- package/tools/products/search-products.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -212,12 +212,19 @@ The following tools are available in this MCP server.
|
|
|
212
212
|
|
|
213
213
|
### Resource `cart`:
|
|
214
214
|
|
|
215
|
-
- `create_cart_checkout` (`write`)
|
|
215
|
+
- `create_cart_checkout` (`write`): Generates a hosted checkout URL for the user's cart. The page walks the buyer through reviewing the order, entering shipping, payment information, and confirming the purchase.
|
|
216
|
+
|
|
217
|
+
### Resource `cart.items`:
|
|
218
|
+
|
|
219
|
+
- `list_cart_items` (`read`) tags: [hosted]: Get all products from the cart
|
|
220
|
+
- `add_cart_items` (`write`) tags: [hosted]: Adds product data to existing cart or create a new one.
|
|
221
|
+
- `clear_cart_items` (`write`) tags: [hosted]: Delete all products from the cart
|
|
222
|
+
- `remove_cart_items` (`write`) tags: [hosted]: Delete a product from the cart
|
|
216
223
|
|
|
217
224
|
### Resource `checkout.session`:
|
|
218
225
|
|
|
219
|
-
- `confirm_checkout_session` (`write`): Confirms the checkout session and creates an order for the user. Returns an order ID that can be used to view order status
|
|
220
|
-
- `create_checkout_session` (`write`): Creates or updates a checkout session with shipping details and returns pricing metadata plus a session token needed for confirming checkout
|
|
226
|
+
- `confirm_checkout_session` (`write`) tags: [headless]: Confirms the checkout session and creates an order for the user. Returns an order ID that can be used to view order status
|
|
227
|
+
- `create_checkout_session` (`write`) tags: [headless]: Creates or updates a checkout session with shipping details and returns pricing metadata plus a session token needed for confirming checkout
|
|
221
228
|
|
|
222
229
|
### Resource `orders`:
|
|
223
230
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henrylabs/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "The official MCP Server for the Henry SDK API",
|
|
5
5
|
"author": "Henry SDK <lawrence@henry.social>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"fix": "eslint --fix --ext ts,js ."
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@henrylabs/sdk": "^0.
|
|
30
|
+
"@henrylabs/sdk": "^0.5.0",
|
|
31
31
|
"@cloudflare/cabidela": "^0.2.4",
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.11.5",
|
|
33
33
|
"@valtown/deno-http-worker": "^0.0.21",
|
package/server.js
CHANGED
|
@@ -22,7 +22,7 @@ var tools_2 = require("./tools.js");
|
|
|
22
22
|
Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
|
|
23
23
|
const newMcpServer = () => new mcp_js_1.McpServer({
|
|
24
24
|
name: 'henrylabs_sdk_api',
|
|
25
|
-
version: '0.
|
|
25
|
+
version: '0.5.0',
|
|
26
26
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
27
27
|
exports.newMcpServer = newMcpServer;
|
|
28
28
|
// Create server instance
|
package/server.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export { ClientType } from "./compat.mjs";
|
|
|
11
11
|
export { endpoints } from "./tools.mjs";
|
|
12
12
|
export const newMcpServer = () => new McpServer({
|
|
13
13
|
name: 'henrylabs_sdk_api',
|
|
14
|
-
version: '0.
|
|
14
|
+
version: '0.5.0',
|
|
15
15
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
16
16
|
// Create server instance
|
|
17
17
|
export const server = newMcpServer();
|
package/src/server.ts
CHANGED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'cart.items',
|
|
11
|
+
operation: 'write',
|
|
12
|
+
tags: ['hosted'],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/cart/items',
|
|
15
|
+
operationId: 'addCartItems',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'add_cart_items',
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nAdds product data to existing cart or create a new one.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_add_response',\n $defs: {\n item_add_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n added_products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n price: {\n type: 'string'\n },\n productId: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n }\n },\n required: [ 'name',\n 'price',\n 'productId',\n 'quantity'\n ]\n }\n },\n cart_summary: {\n type: 'object',\n properties: {\n total_items: {\n type: 'number'\n },\n total_unique_products: {\n type: 'number'\n }\n },\n required: [ 'total_items',\n 'total_unique_products'\n ]\n },\n updated_products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n addedQuantity: {\n type: 'number'\n },\n name: {\n type: 'string'\n },\n previousQuantity: {\n type: 'number'\n },\n price: {\n type: 'string'\n },\n productId: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n }\n },\n required: [ 'addedQuantity',\n 'name',\n 'previousQuantity',\n 'price',\n 'productId',\n 'quantity'\n ]\n }\n },\n variant_checks: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n productId: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n variantCheckRequestId: {\n type: 'string'\n }\n },\n required: [ 'productId',\n 'status',\n 'variantCheckRequestId'\n ]\n }\n }\n },\n required: [ 'added_products',\n 'cart_summary',\n 'updated_products'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
productsDetails: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
items: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
name: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Product name',
|
|
33
|
+
},
|
|
34
|
+
price: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Product price',
|
|
37
|
+
},
|
|
38
|
+
productLink: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Product link',
|
|
41
|
+
},
|
|
42
|
+
quantity: {
|
|
43
|
+
type: 'number',
|
|
44
|
+
description: 'Quantity',
|
|
45
|
+
},
|
|
46
|
+
affiliateProductLink: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description:
|
|
49
|
+
'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)',
|
|
50
|
+
},
|
|
51
|
+
metadata: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
description: 'Product metadata',
|
|
54
|
+
additionalProperties: true,
|
|
55
|
+
},
|
|
56
|
+
productId: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'Product Id',
|
|
59
|
+
},
|
|
60
|
+
productImageLink: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'Product image link (thumbnail)',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
required: ['name', 'price', 'productLink', 'quantity'],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
'x-user-id': {
|
|
69
|
+
type: 'string',
|
|
70
|
+
},
|
|
71
|
+
checkVariantAvailability: {
|
|
72
|
+
type: 'boolean',
|
|
73
|
+
description:
|
|
74
|
+
'Whether to check variant availability after adding to cart. If true, variant check requests will be created for products with metadata and requestIds returned.',
|
|
75
|
+
},
|
|
76
|
+
jq_filter: {
|
|
77
|
+
type: 'string',
|
|
78
|
+
title: 'jq Filter',
|
|
79
|
+
description:
|
|
80
|
+
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
required: ['productsDetails', 'x-user-id'],
|
|
84
|
+
},
|
|
85
|
+
annotations: {},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
89
|
+
const { jq_filter, ...body } = args as any;
|
|
90
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.add(body)));
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'cart.items',
|
|
11
|
+
operation: 'write',
|
|
12
|
+
tags: ['hosted'],
|
|
13
|
+
httpMethod: 'delete',
|
|
14
|
+
httpPath: '/cart/items',
|
|
15
|
+
operationId: 'deleteAllCartItems',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'clear_cart_items',
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nDelete all products from the cart\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_clear_response',\n $defs: {\n item_clear_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
'x-user-id': {
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
jq_filter: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
title: 'jq Filter',
|
|
31
|
+
description:
|
|
32
|
+
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ['x-user-id'],
|
|
36
|
+
},
|
|
37
|
+
annotations: {
|
|
38
|
+
idempotentHint: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
43
|
+
const { jq_filter, ...body } = args as any;
|
|
44
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.clear(body)));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'cart.items',
|
|
11
|
+
operation: 'read',
|
|
12
|
+
tags: ['hosted'],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/cart/items',
|
|
15
|
+
operationId: 'getCartItems',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'list_cart_items',
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nGet all products from the cart\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_list_response',\n $defs: {\n item_list_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n description: 'Product name'\n },\n price: {\n type: 'string',\n description: 'Product price'\n },\n productLink: {\n type: 'string',\n description: 'Product link'\n },\n quantity: {\n type: 'number',\n description: 'Quantity'\n },\n affiliateProductLink: {\n type: 'string',\n description: 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)'\n },\n metadata: {\n type: 'object',\n description: 'Product metadata',\n additionalProperties: true\n },\n productId: {\n type: 'string',\n description: 'Product Id'\n },\n productImageLink: {\n type: 'string',\n description: 'Product image link (thumbnail)'\n }\n },\n required: [ 'name',\n 'price',\n 'productLink',\n 'quantity'\n ]\n }\n }\n },\n required: [ 'products'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
'x-user-id': {
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
jq_filter: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
title: 'jq Filter',
|
|
31
|
+
description:
|
|
32
|
+
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ['x-user-id'],
|
|
36
|
+
},
|
|
37
|
+
annotations: {
|
|
38
|
+
readOnlyHint: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
43
|
+
const { jq_filter, ...body } = args as any;
|
|
44
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.list(body)));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'cart.items',
|
|
11
|
+
operation: 'write',
|
|
12
|
+
tags: ['hosted'],
|
|
13
|
+
httpMethod: 'delete',
|
|
14
|
+
httpPath: '/cart/items/{productId}',
|
|
15
|
+
operationId: 'deleteCartItem',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'remove_cart_items',
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nDelete a product from the cart\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_remove_response',\n $defs: {\n item_remove_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
productId: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
'x-user-id': {
|
|
29
|
+
type: 'string',
|
|
30
|
+
},
|
|
31
|
+
jq_filter: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
title: 'jq Filter',
|
|
34
|
+
description:
|
|
35
|
+
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ['productId', 'x-user-id'],
|
|
39
|
+
},
|
|
40
|
+
annotations: {
|
|
41
|
+
idempotentHint: true,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
46
|
+
const { productId, jq_filter, ...body } = args as any;
|
|
47
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.remove(productId, body)));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default { metadata, tool, handler };
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'checkout.session',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: [],
|
|
12
|
+
tags: ['headless'],
|
|
13
13
|
httpMethod: 'post',
|
|
14
14
|
httpPath: '/checkout/session/confirm',
|
|
15
15
|
operationId: 'confirmCheckoutSession',
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'checkout.session',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: [],
|
|
12
|
+
tags: ['headless'],
|
|
13
13
|
httpMethod: 'post',
|
|
14
14
|
httpPath: '/checkout/session/quote',
|
|
15
15
|
operationId: 'createCheckoutSessionQuote',
|
package/src/tools/index.ts
CHANGED
|
@@ -7,6 +7,10 @@ export { Metadata, Endpoint, HandlerFunction };
|
|
|
7
7
|
import retrieve_product_details from './products/retrieve-product-details';
|
|
8
8
|
import search_products from './products/search-products';
|
|
9
9
|
import create_cart_checkout from './cart/create-cart-checkout';
|
|
10
|
+
import list_cart_items from './cart/items/list-cart-items';
|
|
11
|
+
import add_cart_items from './cart/items/add-cart-items';
|
|
12
|
+
import clear_cart_items from './cart/items/clear-cart-items';
|
|
13
|
+
import remove_cart_items from './cart/items/remove-cart-items';
|
|
10
14
|
import confirm_checkout_session from './checkout/session/confirm-checkout-session';
|
|
11
15
|
import create_checkout_session from './checkout/session/create-checkout-session';
|
|
12
16
|
import retrieve_status_orders from './orders/retrieve-status-orders';
|
|
@@ -21,6 +25,10 @@ function addEndpoint(endpoint: Endpoint) {
|
|
|
21
25
|
addEndpoint(retrieve_product_details);
|
|
22
26
|
addEndpoint(search_products);
|
|
23
27
|
addEndpoint(create_cart_checkout);
|
|
28
|
+
addEndpoint(list_cart_items);
|
|
29
|
+
addEndpoint(add_cart_items);
|
|
30
|
+
addEndpoint(clear_cart_items);
|
|
31
|
+
addEndpoint(remove_cart_items);
|
|
24
32
|
addEndpoint(confirm_checkout_session);
|
|
25
33
|
addEndpoint(create_checkout_session);
|
|
26
34
|
addEndpoint(retrieve_status_orders);
|
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'search_products',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products using keyword and passing various filters and criteria\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products using keyword and passing various filters and criteria\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.js","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"create-cart-checkout.js","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,0BAA0B;CACxC,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,khCAAkhC;IACphC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iEAAiE;aAC/E;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnG,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.mjs","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAY,mBAAmB,EAAE,MAAM,4BAA4B;AAK1E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"create-cart-checkout.mjs","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE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henrylabs/sdk';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
metadata: Metadata;
|
|
9
|
+
tool: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
name: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
outputSchema?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
type: "object";
|
|
25
|
+
properties?: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
} | undefined;
|
|
28
|
+
required?: string[] | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
annotations?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
readOnlyHint?: boolean | undefined;
|
|
34
|
+
destructiveHint?: boolean | undefined;
|
|
35
|
+
idempotentHint?: boolean | undefined;
|
|
36
|
+
openWorldHint?: boolean | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
_meta?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=add-cart-items.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAoElB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKzF,wBAA2C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Metadata } from '@henrylabs/mcp/tools/types';
|
|
2
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
metadata: Metadata;
|
|
9
|
+
tool: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
name: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
outputSchema?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
type: "object";
|
|
25
|
+
properties?: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
} | undefined;
|
|
28
|
+
required?: string[] | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
annotations?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
readOnlyHint?: boolean | undefined;
|
|
34
|
+
destructiveHint?: boolean | undefined;
|
|
35
|
+
idempotentHint?: boolean | undefined;
|
|
36
|
+
openWorldHint?: boolean | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
_meta?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=add-cart-items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAoElB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAGxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKzF,wBAA2C"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.handler = exports.tool = exports.metadata = void 0;
|
|
5
|
+
const filtering_1 = require("@henrylabs/mcp/filtering");
|
|
6
|
+
const types_1 = require("@henrylabs/mcp/tools/types");
|
|
7
|
+
exports.metadata = {
|
|
8
|
+
resource: 'cart.items',
|
|
9
|
+
operation: 'write',
|
|
10
|
+
tags: ['hosted'],
|
|
11
|
+
httpMethod: 'post',
|
|
12
|
+
httpPath: '/cart/items',
|
|
13
|
+
operationId: 'addCartItems',
|
|
14
|
+
};
|
|
15
|
+
exports.tool = {
|
|
16
|
+
name: 'add_cart_items',
|
|
17
|
+
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nAdds product data to existing cart or create a new one.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_add_response',\n $defs: {\n item_add_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n added_products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n price: {\n type: 'string'\n },\n productId: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n }\n },\n required: [ 'name',\n 'price',\n 'productId',\n 'quantity'\n ]\n }\n },\n cart_summary: {\n type: 'object',\n properties: {\n total_items: {\n type: 'number'\n },\n total_unique_products: {\n type: 'number'\n }\n },\n required: [ 'total_items',\n 'total_unique_products'\n ]\n },\n updated_products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n addedQuantity: {\n type: 'number'\n },\n name: {\n type: 'string'\n },\n previousQuantity: {\n type: 'number'\n },\n price: {\n type: 'string'\n },\n productId: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n }\n },\n required: [ 'addedQuantity',\n 'name',\n 'previousQuantity',\n 'price',\n 'productId',\n 'quantity'\n ]\n }\n },\n variant_checks: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n productId: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n variantCheckRequestId: {\n type: 'string'\n }\n },\n required: [ 'productId',\n 'status',\n 'variantCheckRequestId'\n ]\n }\n }\n },\n required: [ 'added_products',\n 'cart_summary',\n 'updated_products'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
productsDetails: {
|
|
22
|
+
type: 'array',
|
|
23
|
+
items: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
name: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
description: 'Product name',
|
|
29
|
+
},
|
|
30
|
+
price: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Product price',
|
|
33
|
+
},
|
|
34
|
+
productLink: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Product link',
|
|
37
|
+
},
|
|
38
|
+
quantity: {
|
|
39
|
+
type: 'number',
|
|
40
|
+
description: 'Quantity',
|
|
41
|
+
},
|
|
42
|
+
affiliateProductLink: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)',
|
|
45
|
+
},
|
|
46
|
+
metadata: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
description: 'Product metadata',
|
|
49
|
+
additionalProperties: true,
|
|
50
|
+
},
|
|
51
|
+
productId: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'Product Id',
|
|
54
|
+
},
|
|
55
|
+
productImageLink: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'Product image link (thumbnail)',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
required: ['name', 'price', 'productLink', 'quantity'],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
'x-user-id': {
|
|
64
|
+
type: 'string',
|
|
65
|
+
},
|
|
66
|
+
checkVariantAvailability: {
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
description: 'Whether to check variant availability after adding to cart. If true, variant check requests will be created for products with metadata and requestIds returned.',
|
|
69
|
+
},
|
|
70
|
+
jq_filter: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
title: 'jq Filter',
|
|
73
|
+
description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
required: ['productsDetails', 'x-user-id'],
|
|
77
|
+
},
|
|
78
|
+
annotations: {},
|
|
79
|
+
};
|
|
80
|
+
const handler = async (client, args) => {
|
|
81
|
+
const { jq_filter, ...body } = args;
|
|
82
|
+
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.add(body)));
|
|
83
|
+
};
|
|
84
|
+
exports.handler = handler;
|
|
85
|
+
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
86
|
+
//# sourceMappingURL=add-cart-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,8iHAA8iH;IAChjH,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,eAAe,EAAE;gBACf,IAAI,EAAE,OAAO;gBACb,KAAK,EAA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