@tomaspavlin/rohlik-mcp 1.0.6 → 2.0.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 +55 -9
- package/dist/index.js +41 -201
- package/dist/index.js.map +1 -1
- package/dist/rohlik-api.d.ts +9 -1
- package/dist/rohlik-api.d.ts.map +1 -1
- package/dist/rohlik-api.js +147 -1
- package/dist/rohlik-api.js.map +1 -1
- package/dist/tools/account-data.d.ts +23 -0
- package/dist/tools/account-data.d.ts.map +1 -0
- package/dist/tools/account-data.js +83 -0
- package/dist/tools/account-data.js.map +1 -0
- package/dist/tools/announcements.d.ts +23 -0
- package/dist/tools/announcements.d.ts.map +1 -0
- package/dist/tools/announcements.js +61 -0
- package/dist/tools/announcements.js.map +1 -0
- package/dist/tools/cart-management.d.ts +88 -0
- package/dist/tools/cart-management.d.ts.map +1 -0
- package/dist/tools/cart-management.js +136 -0
- package/dist/tools/cart-management.js.map +1 -0
- package/dist/tools/delivery-info.d.ts +23 -0
- package/dist/tools/delivery-info.d.ts.map +1 -0
- package/dist/tools/delivery-info.js +69 -0
- package/dist/tools/delivery-info.js.map +1 -0
- package/dist/tools/delivery-slots.d.ts +23 -0
- package/dist/tools/delivery-slots.d.ts.map +1 -0
- package/dist/tools/delivery-slots.js +55 -0
- package/dist/tools/delivery-slots.js.map +1 -0
- package/dist/tools/index.d.ts +137 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +19 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/order-history.d.ts +28 -0
- package/dist/tools/order-history.d.ts.map +1 -0
- package/dist/tools/order-history.js +62 -0
- package/dist/tools/order-history.js.map +1 -0
- package/dist/tools/premium-info.d.ts +23 -0
- package/dist/tools/premium-info.d.ts.map +1 -0
- package/dist/tools/premium-info.js +84 -0
- package/dist/tools/premium-info.js.map +1 -0
- package/dist/tools/reusable-bags.d.ts +23 -0
- package/dist/tools/reusable-bags.d.ts.map +1 -0
- package/dist/tools/reusable-bags.js +79 -0
- package/dist/tools/reusable-bags.js.map +1 -0
- package/dist/tools/search-products.d.ts +32 -0
- package/dist/tools/search-products.d.ts.map +1 -0
- package/dist/tools/search-products.js +44 -0
- package/dist/tools/search-products.js.map +1 -0
- package/dist/tools/shopping-lists.d.ts +28 -0
- package/dist/tools/shopping-lists.d.ts.map +1 -0
- package/dist/tools/shopping-lists.js +54 -0
- package/dist/tools/shopping-lists.js.map +1 -0
- package/dist/tools/upcoming-orders.d.ts +23 -0
- package/dist/tools/upcoming-orders.d.ts.map +1 -0
- package/dist/tools/upcoming-orders.js +61 -0
- package/dist/tools/upcoming-orders.js.map +1 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { RohlikAPI } from "../rohlik-api.js";
|
|
2
|
+
export declare function createAllTools(createRohlikAPI: () => RohlikAPI): {
|
|
3
|
+
[x: string]: {
|
|
4
|
+
name: string;
|
|
5
|
+
definition: {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: {
|
|
9
|
+
product_name: import("zod").ZodString;
|
|
10
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
11
|
+
favourite_only: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
handler: (args: {
|
|
15
|
+
product_name: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
favourite_only?: boolean;
|
|
18
|
+
}) => Promise<{
|
|
19
|
+
content: {
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}[];
|
|
23
|
+
isError?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
content: {
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
isError: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
} | {
|
|
32
|
+
name: string;
|
|
33
|
+
definition: {
|
|
34
|
+
title: string;
|
|
35
|
+
description: string;
|
|
36
|
+
inputSchema: {
|
|
37
|
+
products: import("zod").ZodArray<import("zod").ZodObject<{
|
|
38
|
+
product_id: import("zod").ZodNumber;
|
|
39
|
+
quantity: import("zod").ZodNumber;
|
|
40
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
41
|
+
product_id: number;
|
|
42
|
+
quantity: number;
|
|
43
|
+
}, {
|
|
44
|
+
product_id: number;
|
|
45
|
+
quantity: number;
|
|
46
|
+
}>, "many">;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
handler: ({ products }: {
|
|
50
|
+
products: Array<{
|
|
51
|
+
product_id: number;
|
|
52
|
+
quantity: number;
|
|
53
|
+
}>;
|
|
54
|
+
}) => Promise<{
|
|
55
|
+
content: {
|
|
56
|
+
type: "text";
|
|
57
|
+
text: string;
|
|
58
|
+
}[];
|
|
59
|
+
isError?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
content: {
|
|
62
|
+
type: "text";
|
|
63
|
+
text: string;
|
|
64
|
+
}[];
|
|
65
|
+
isError: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
} | {
|
|
68
|
+
name: string;
|
|
69
|
+
definition: {
|
|
70
|
+
title: string;
|
|
71
|
+
description: string;
|
|
72
|
+
inputSchema: {};
|
|
73
|
+
};
|
|
74
|
+
handler: () => Promise<{
|
|
75
|
+
content: {
|
|
76
|
+
type: "text";
|
|
77
|
+
text: string;
|
|
78
|
+
}[];
|
|
79
|
+
isError?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
content: {
|
|
82
|
+
type: "text";
|
|
83
|
+
text: string;
|
|
84
|
+
}[];
|
|
85
|
+
isError: boolean;
|
|
86
|
+
}>;
|
|
87
|
+
} | {
|
|
88
|
+
name: string;
|
|
89
|
+
definition: {
|
|
90
|
+
title: string;
|
|
91
|
+
description: string;
|
|
92
|
+
inputSchema: {
|
|
93
|
+
order_field_id: import("zod").ZodString;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
handler: ({ order_field_id }: {
|
|
97
|
+
order_field_id: string;
|
|
98
|
+
}) => Promise<{
|
|
99
|
+
content: {
|
|
100
|
+
type: "text";
|
|
101
|
+
text: string;
|
|
102
|
+
}[];
|
|
103
|
+
isError?: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
content: {
|
|
106
|
+
type: "text";
|
|
107
|
+
text: string;
|
|
108
|
+
}[];
|
|
109
|
+
isError: boolean;
|
|
110
|
+
}>;
|
|
111
|
+
} | {
|
|
112
|
+
name: string;
|
|
113
|
+
definition: {
|
|
114
|
+
title: string;
|
|
115
|
+
description: string;
|
|
116
|
+
inputSchema: {
|
|
117
|
+
shopping_list_id: import("zod").ZodString;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
handler: ({ shopping_list_id }: {
|
|
121
|
+
shopping_list_id: string;
|
|
122
|
+
}) => Promise<{
|
|
123
|
+
content: {
|
|
124
|
+
type: "text";
|
|
125
|
+
text: string;
|
|
126
|
+
}[];
|
|
127
|
+
isError?: undefined;
|
|
128
|
+
} | {
|
|
129
|
+
content: {
|
|
130
|
+
type: "text";
|
|
131
|
+
text: string;
|
|
132
|
+
}[];
|
|
133
|
+
isError: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAM7C,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,SAAS;;;;;;;;;;;;;;iBAUjD,CAAC;0BAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createSearchProductsTool } from "./search-products.js";
|
|
2
|
+
import { createCartManagementTools } from "./cart-management.js";
|
|
3
|
+
import { createShoppingListsTool } from "./shopping-lists.js";
|
|
4
|
+
import { createAccountDataTool } from "./account-data.js";
|
|
5
|
+
export function createAllTools(createRohlikAPI) {
|
|
6
|
+
const searchProducts = createSearchProductsTool(createRohlikAPI);
|
|
7
|
+
const cartTools = createCartManagementTools(createRohlikAPI);
|
|
8
|
+
const shoppingLists = createShoppingListsTool(createRohlikAPI);
|
|
9
|
+
const accountData = createAccountDataTool(createRohlikAPI);
|
|
10
|
+
return {
|
|
11
|
+
[searchProducts.name]: searchProducts,
|
|
12
|
+
[cartTools.addToCart.name]: cartTools.addToCart,
|
|
13
|
+
[cartTools.getCartContent.name]: cartTools.getCartContent,
|
|
14
|
+
[cartTools.removeFromCart.name]: cartTools.removeFromCart,
|
|
15
|
+
[shoppingLists.name]: shoppingLists,
|
|
16
|
+
[accountData.name]: accountData,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,UAAU,cAAc,CAAC,eAAgC;IAC7D,MAAM,cAAc,GAAG,wBAAwB,CAAC,eAAe,CAAC,CAAC;IACjE,MAAM,SAAS,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAC;IAC7D,MAAM,aAAa,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAE3D,OAAO;QACL,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,cAAc;QACrC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS;QAC/C,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,cAAc;QACzD,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,cAAc;QACzD,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa;QACnC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,WAAW;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RohlikAPI } from "../rohlik-api.js";
|
|
3
|
+
export declare function createOrderHistoryTool(createRohlikAPI: () => RohlikAPI): {
|
|
4
|
+
name: string;
|
|
5
|
+
definition: {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: {
|
|
9
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
handler: (args: {
|
|
13
|
+
limit?: number;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
isError?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=order-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-history.d.ts","sourceRoot":"","sources":["../../src/tools/order-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,MAAM,SAAS;;;;;;;;;oBAU7C;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;EAsD3C"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export function createOrderHistoryTool(createRohlikAPI) {
|
|
3
|
+
return {
|
|
4
|
+
name: "get_order_history",
|
|
5
|
+
definition: {
|
|
6
|
+
title: "Get Order History",
|
|
7
|
+
description: "Get your past delivered orders",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
limit: z.number().min(1).max(100).default(10).describe("Maximum number of orders to return (1-100, default: 10)")
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
handler: async (args) => {
|
|
13
|
+
const { limit = 10 } = args;
|
|
14
|
+
try {
|
|
15
|
+
const api = createRohlikAPI();
|
|
16
|
+
const orderHistory = await api.getOrderHistory(limit);
|
|
17
|
+
if (!orderHistory || (Array.isArray(orderHistory) && orderHistory.length === 0)) {
|
|
18
|
+
return {
|
|
19
|
+
content: [
|
|
20
|
+
{
|
|
21
|
+
type: "text",
|
|
22
|
+
text: "No order history found."
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const formatOrder = (order, index) => {
|
|
28
|
+
const orderDate = order.deliveredAt || order.createdAt || 'Unknown date';
|
|
29
|
+
const totalPrice = order.totalPrice || order.price || 'Unknown price';
|
|
30
|
+
const orderNumber = order.orderNumber || order.id || `Order ${index + 1}`;
|
|
31
|
+
const status = order.status || 'Delivered';
|
|
32
|
+
return `${index + 1}. ${orderNumber}
|
|
33
|
+
Date: ${orderDate}
|
|
34
|
+
Total: ${totalPrice} CZK
|
|
35
|
+
Status: ${status}`;
|
|
36
|
+
};
|
|
37
|
+
const orders = Array.isArray(orderHistory) ? orderHistory : [orderHistory];
|
|
38
|
+
const output = `📋 ORDER HISTORY (${orders.length} orders):\n\n${orders.map(formatOrder).join('\n\n')}`;
|
|
39
|
+
return {
|
|
40
|
+
content: [
|
|
41
|
+
{
|
|
42
|
+
type: "text",
|
|
43
|
+
text: output
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: "text",
|
|
53
|
+
text: error instanceof Error ? error.message : String(error)
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
isError: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=order-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-history.js","sourceRoot":"","sources":["../../src/tools/order-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,sBAAsB,CAAC,eAAgC;IACrE,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,UAAU,EAAE;YACV,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,gCAAgC;YAC7C,WAAW,EAAE;gBACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,yDAAyD,CAAC;aAClH;SACF;QACD,OAAO,EAAE,KAAK,EAAE,IAAwB,EAAE,EAAE;YAC1C,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;YAE5B,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;gBAC9B,MAAM,YAAY,GAAG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AAE,CAAC;gBACf,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBAC7D;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RohlikAPI } from "../rohlik-api.js";
|
|
2
|
+
export declare function createPremiumInfoTool(createRohlikAPI: () => RohlikAPI): {
|
|
3
|
+
name: string;
|
|
4
|
+
definition: {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {};
|
|
8
|
+
};
|
|
9
|
+
handler: () => Promise<{
|
|
10
|
+
content: {
|
|
11
|
+
type: "text";
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
isError?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
content: {
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}[];
|
|
20
|
+
isError: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=premium-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"premium-info.d.ts","sourceRoot":"","sources":["../../src/tools/premium-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;EA6FrE"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export function createPremiumInfoTool(createRohlikAPI) {
|
|
2
|
+
return {
|
|
3
|
+
name: "get_premium_info",
|
|
4
|
+
definition: {
|
|
5
|
+
title: "Get Premium Info",
|
|
6
|
+
description: "Get information about your Rohlik Premium subscription",
|
|
7
|
+
inputSchema: {}
|
|
8
|
+
},
|
|
9
|
+
handler: async () => {
|
|
10
|
+
try {
|
|
11
|
+
const api = createRohlikAPI();
|
|
12
|
+
const premiumInfo = await api.getPremiumInfo();
|
|
13
|
+
if (!premiumInfo) {
|
|
14
|
+
return {
|
|
15
|
+
content: [
|
|
16
|
+
{
|
|
17
|
+
type: "text",
|
|
18
|
+
text: "No premium information available."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const formatPremiumInfo = (data) => {
|
|
24
|
+
const sections = [];
|
|
25
|
+
// Premium status
|
|
26
|
+
if (data.isActive !== undefined) {
|
|
27
|
+
sections.push(`⭐ PREMIUM STATUS: ${data.isActive ? 'Active' : 'Inactive'}`);
|
|
28
|
+
}
|
|
29
|
+
// Subscription details
|
|
30
|
+
if (data.subscription) {
|
|
31
|
+
const sub = data.subscription;
|
|
32
|
+
sections.push(`📅 SUBSCRIPTION:
|
|
33
|
+
Type: ${sub.type || 'Unknown'}
|
|
34
|
+
Start: ${sub.startDate || 'Unknown'}
|
|
35
|
+
End: ${sub.endDate || 'Unknown'}
|
|
36
|
+
Price: ${sub.price || 'Unknown'} CZK`);
|
|
37
|
+
}
|
|
38
|
+
// Benefits
|
|
39
|
+
if (data.benefits && Array.isArray(data.benefits)) {
|
|
40
|
+
sections.push(`🎁 BENEFITS:
|
|
41
|
+
${data.benefits.map((benefit) => ` • ${benefit.name || benefit}`).join('\n')}`);
|
|
42
|
+
}
|
|
43
|
+
// Savings
|
|
44
|
+
if (data.totalSavings !== undefined) {
|
|
45
|
+
sections.push(`💰 TOTAL SAVINGS: ${data.totalSavings} CZK`);
|
|
46
|
+
}
|
|
47
|
+
if (data.monthlySavings !== undefined) {
|
|
48
|
+
sections.push(`📊 MONTHLY SAVINGS: ${data.monthlySavings} CZK`);
|
|
49
|
+
}
|
|
50
|
+
// Free delivery info
|
|
51
|
+
if (data.freeDeliveryCount !== undefined) {
|
|
52
|
+
sections.push(`🚚 FREE DELIVERIES USED: ${data.freeDeliveryCount}`);
|
|
53
|
+
}
|
|
54
|
+
// If no structured data, show raw JSON
|
|
55
|
+
if (sections.length === 0) {
|
|
56
|
+
sections.push(`⭐ PREMIUM INFO:\n${JSON.stringify(data, null, 2)}`);
|
|
57
|
+
}
|
|
58
|
+
return sections.join('\n\n');
|
|
59
|
+
};
|
|
60
|
+
const output = formatPremiumInfo(premiumInfo);
|
|
61
|
+
return {
|
|
62
|
+
content: [
|
|
63
|
+
{
|
|
64
|
+
type: "text",
|
|
65
|
+
text: output
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: "text",
|
|
75
|
+
text: error instanceof Error ? error.message : String(error)
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
isError: true
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=premium-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"premium-info.js","sourceRoot":"","sources":["../../src/tools/premium-info.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,eAAgC;IACpE,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,wDAAwD;YACrE,WAAW,EAAE,EAAE;SAChB;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;gBAC9B,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,cAAc,EAAE,CAAC;gBAE/C,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,OAAO;wBACL,OAAO,EAAE;4BACP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AAK,SAAS,EAAE,CAAC;wBACtC,QAAQ,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,cAAc,MAAM,CAAC,CAAC;oBAClE,CAAC;oBAED,qBAAqB;oBACrB,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;wBACzC,QAAQ,CAAC,IAAI,CAAC,4BAA4B,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;oBACtE,CAAC;oBAED,uCAAuC;oBACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBAC1B,QAAQ,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;oBACrE,CAAC;oBAED,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC/B,CAAC,CAAC;gBAEF,MAAM,MAAM,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;gBAE9C,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,MAAM;yBACb;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBAC7D;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RohlikAPI } from "../rohlik-api.js";
|
|
2
|
+
export declare function createReusableBagsTool(createRohlikAPI: () => RohlikAPI): {
|
|
3
|
+
name: string;
|
|
4
|
+
definition: {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {};
|
|
8
|
+
};
|
|
9
|
+
handler: () => Promise<{
|
|
10
|
+
content: {
|
|
11
|
+
type: "text";
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
isError?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
content: {
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}[];
|
|
20
|
+
isError: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=reusable-bags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reusable-bags.d.ts","sourceRoot":"","sources":["../../src/tools/reusable-bags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;EA0FtE"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export function createReusableBagsTool(createRohlikAPI) {
|
|
2
|
+
return {
|
|
3
|
+
name: "get_reusable_bags_info",
|
|
4
|
+
definition: {
|
|
5
|
+
title: "Get Reusable Bags Info",
|
|
6
|
+
description: "Get information about your reusable bags and environmental impact",
|
|
7
|
+
inputSchema: {}
|
|
8
|
+
},
|
|
9
|
+
handler: async () => {
|
|
10
|
+
try {
|
|
11
|
+
const api = createRohlikAPI();
|
|
12
|
+
const bagsInfo = await api.getReusableBagsInfo();
|
|
13
|
+
if (!bagsInfo) {
|
|
14
|
+
return {
|
|
15
|
+
content: [
|
|
16
|
+
{
|
|
17
|
+
type: "text",
|
|
18
|
+
text: "No reusable bags information available."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const formatBagsInfo = (data) => {
|
|
24
|
+
const sections = [];
|
|
25
|
+
// Bag count
|
|
26
|
+
if (data.totalBags !== undefined) {
|
|
27
|
+
sections.push(`♻️ TOTAL REUSABLE BAGS: ${data.totalBags}`);
|
|
28
|
+
}
|
|
29
|
+
// Available bags
|
|
30
|
+
if (data.availableBags !== undefined) {
|
|
31
|
+
sections.push(`📦 AVAILABLE BAGS: ${data.availableBags}`);
|
|
32
|
+
}
|
|
33
|
+
// Bags in use
|
|
34
|
+
if (data.bagsInUse !== undefined) {
|
|
35
|
+
sections.push(`🛍️ BAGS IN USE: ${data.bagsInUse}`);
|
|
36
|
+
}
|
|
37
|
+
// Environmental impact
|
|
38
|
+
if (data.plasticSaved !== undefined) {
|
|
39
|
+
sections.push(`🌍 PLASTIC SAVED: ${data.plasticSaved}g`);
|
|
40
|
+
}
|
|
41
|
+
if (data.co2Saved !== undefined) {
|
|
42
|
+
sections.push(`🌱 CO2 SAVED: ${data.co2Saved}g`);
|
|
43
|
+
}
|
|
44
|
+
// Bag history
|
|
45
|
+
if (data.bagHistory && Array.isArray(data.bagHistory)) {
|
|
46
|
+
sections.push(`📋 BAG HISTORY:
|
|
47
|
+
${data.bagHistory.map((entry, index) => ` ${index + 1}. ${entry.date || 'Unknown date'}: ${entry.action || 'Unknown action'} (${entry.count || 1} bags)`).join('\n')}`);
|
|
48
|
+
}
|
|
49
|
+
// If no structured data, show raw JSON
|
|
50
|
+
if (sections.length === 0) {
|
|
51
|
+
sections.push(`♻️ REUSABLE BAGS INFO:\n${JSON.stringify(data, null, 2)}`);
|
|
52
|
+
}
|
|
53
|
+
return sections.join('\n\n');
|
|
54
|
+
};
|
|
55
|
+
const output = formatBagsInfo(bagsInfo);
|
|
56
|
+
return {
|
|
57
|
+
content: [
|
|
58
|
+
{
|
|
59
|
+
type: "text",
|
|
60
|
+
text: output
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return {
|
|
67
|
+
content: [
|
|
68
|
+
{
|
|
69
|
+
type: "text",
|
|
70
|
+
text: error instanceof Error ? error.message : String(error)
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
isError: true
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=reusable-bags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reusable-bags.js","sourceRoot":"","sources":["../../src/tools/reusable-bags.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAC,eAAgC;IACrE,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,UAAU,EAAE;YACV,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,mEAAmE;YAChF,WAAW,EAAE,EAAE;SAChB;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;gBAC9B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,mBAAmB,EAAE,CAAC;gBAEjD,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,OAAO;wBACL,OAAO,EAAE;4BACP;gCACE,IAAI,EAAE,MAAe;gCACrB,IAAI,EAAE,yCAAyC;6BAChD;yBACF;qBACF,CAAC;gBACJ,CAAC;gBAED,MAAM,cAAc,GAAG,CAAC,IAAS,EAAU,EAAE;oBAC3C,MAAM,QAAQ,GAAa,EAAE,CAAC;oBAE9B,YAAY;oBACZ,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;wBACjC,QAAQ,CAAC,IAAI,CAAC,2BAA2B,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;oBAC7D,CAAC;oBAED,iBAAiB;oBACjB,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;wBACrC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;oBAC5D,CAAC;oBAED,cAAc;oBACd,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EA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E,MAAe;4BACrB,IAAI,EAAE,MAAM;yBACb;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBAC7D;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RohlikAPI } from "../rohlik-api.js";
|
|
3
|
+
export declare function createSearchProductsTool(createRohlikAPI: () => RohlikAPI): {
|
|
4
|
+
name: string;
|
|
5
|
+
definition: {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: {
|
|
9
|
+
product_name: z.ZodString;
|
|
10
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
favourite_only: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
handler: (args: {
|
|
15
|
+
product_name: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
favourite_only?: boolean;
|
|
18
|
+
}) => Promise<{
|
|
19
|
+
content: {
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}[];
|
|
23
|
+
isError?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
content: {
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
isError: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=search-products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-products.d.ts","sourceRoot":"","sources":["../../src/tools/search-products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,MAAM,SAAS;;;;;;;;;;;oBAY/C;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;;;;;;;;EAgC3F"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export function createSearchProductsTool(createRohlikAPI) {
|
|
3
|
+
return {
|
|
4
|
+
name: "search_products",
|
|
5
|
+
definition: {
|
|
6
|
+
title: "Search Products",
|
|
7
|
+
description: "Search for products on Rohlik.cz by name",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
product_name: z.string().min(1, "Product name cannot be empty").describe("The name or search term for the product"),
|
|
10
|
+
limit: z.number().min(1).max(50).default(10).describe("Maximum number of products to return (1-50, default: 10)"),
|
|
11
|
+
favourite_only: z.boolean().default(false).describe("Whether to return only favourite products (default: false)")
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
handler: async (args) => {
|
|
15
|
+
const { product_name, limit = 10, favourite_only = false } = args;
|
|
16
|
+
try {
|
|
17
|
+
const api = createRohlikAPI();
|
|
18
|
+
const results = await api.searchProducts(product_name, limit, favourite_only);
|
|
19
|
+
const output = `Found ${results.length} products:\n\n` +
|
|
20
|
+
results.map(product => `• ${product.name} (${product.brand})\n Price: ${product.price}\n Amount: ${product.amount}\n ID: ${product.id}`).join('\n\n');
|
|
21
|
+
return {
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: "text",
|
|
25
|
+
text: output
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: error instanceof Error ? error.message : String(error)
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
isError: true
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=search-products.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-products.js","sourceRoot":"","sources":["../../src/tools/search-products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,wBAAwB,CAAC,eAAgC;IACvE,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,0CAA0C;YACvD,WAAW,EAAE;gBACX,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,8BAA8B,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;gBACnH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,0DAA0D,CAAC;gBACjH,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,4DAA4D,CAAC;aAClH;SACF;QACD,OAAO,EAAE,KAAK,EAAE,IAAwE,EAAE,EAAE;YAC1F,MAAM,EAAE,YAAY,EAAE,KAAK,GAAG,EAAE,EAAE,cAAc,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC;YAClE,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;gBAC9B,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,YAAY,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;gBAE9E,MAAM,MAAM,GAAG,SAAS,OAAO,CAAC,MAAM,gBAAgB;oBACpD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CACpB,KAAK,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,KAAK,eAAe,OAAO,CAAC,KAAK,eAAe,OAAO,CAAC,MAAM,WAAW,OAAO,CAAC,EAAE,EAAE,CACpH,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAEjB,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,MAAM;yBACb;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBAC7D;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RohlikAPI } from "../rohlik-api.js";
|
|
3
|
+
export declare function createShoppingListsTool(createRohlikAPI: () => RohlikAPI): {
|
|
4
|
+
name: string;
|
|
5
|
+
definition: {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: {
|
|
9
|
+
shopping_list_id: z.ZodString;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
handler: ({ shopping_list_id }: {
|
|
13
|
+
shopping_list_id: string;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
isError?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=shopping-lists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopping-lists.d.ts","sourceRoot":"","sources":["../../src/tools/shopping-lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,MAAM,SAAS;;;;;;;;;oCAU9B;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;EA6CrE"}
|