@klurien_nova/agent-kit 1.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.
Files changed (69) hide show
  1. package/dist/agent.d.ts +59 -0
  2. package/dist/agent.d.ts.map +1 -0
  3. package/dist/agent.js +133 -0
  4. package/dist/agent.js.map +1 -0
  5. package/dist/client.d.ts +70 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/client.js +139 -0
  8. package/dist/client.js.map +1 -0
  9. package/dist/config.d.ts +8 -0
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/config.js +33 -0
  12. package/dist/config.js.map +1 -0
  13. package/dist/index.d.ts +15 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +21 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/middleware/index.d.ts +13 -0
  18. package/dist/middleware/index.d.ts.map +1 -0
  19. package/dist/middleware/index.js +141 -0
  20. package/dist/middleware/index.js.map +1 -0
  21. package/dist/providers/anthropic.d.ts +8 -0
  22. package/dist/providers/anthropic.d.ts.map +1 -0
  23. package/dist/providers/anthropic.js +113 -0
  24. package/dist/providers/anthropic.js.map +1 -0
  25. package/dist/providers/index.d.ts +4 -0
  26. package/dist/providers/index.d.ts.map +1 -0
  27. package/dist/providers/index.js +5 -0
  28. package/dist/providers/index.js.map +1 -0
  29. package/dist/providers/openai.d.ts +8 -0
  30. package/dist/providers/openai.d.ts.map +1 -0
  31. package/dist/providers/openai.js +125 -0
  32. package/dist/providers/openai.js.map +1 -0
  33. package/dist/tool-registry.d.ts +16 -0
  34. package/dist/tool-registry.d.ts.map +1 -0
  35. package/dist/tool-registry.js +104 -0
  36. package/dist/tool-registry.js.map +1 -0
  37. package/dist/tools/analytics.d.ts +5 -0
  38. package/dist/tools/analytics.d.ts.map +1 -0
  39. package/dist/tools/analytics.js +36 -0
  40. package/dist/tools/analytics.js.map +1 -0
  41. package/dist/tools/discounts.d.ts +6 -0
  42. package/dist/tools/discounts.d.ts.map +1 -0
  43. package/dist/tools/discounts.js +93 -0
  44. package/dist/tools/discounts.js.map +1 -0
  45. package/dist/tools/index.d.ts +9 -0
  46. package/dist/tools/index.d.ts.map +1 -0
  47. package/dist/tools/index.js +21 -0
  48. package/dist/tools/index.js.map +1 -0
  49. package/dist/tools/inventory.d.ts +5 -0
  50. package/dist/tools/inventory.d.ts.map +1 -0
  51. package/dist/tools/inventory.js +73 -0
  52. package/dist/tools/inventory.js.map +1 -0
  53. package/dist/tools/orders.d.ts +6 -0
  54. package/dist/tools/orders.d.ts.map +1 -0
  55. package/dist/tools/orders.js +94 -0
  56. package/dist/tools/orders.js.map +1 -0
  57. package/dist/tools/products.d.ts +8 -0
  58. package/dist/tools/products.d.ts.map +1 -0
  59. package/dist/tools/products.js +190 -0
  60. package/dist/tools/products.js.map +1 -0
  61. package/dist/tools/stores.d.ts +5 -0
  62. package/dist/tools/stores.d.ts.map +1 -0
  63. package/dist/tools/stores.js +28 -0
  64. package/dist/tools/stores.js.map +1 -0
  65. package/dist/types.d.ts +136 -0
  66. package/dist/types.d.ts.map +1 -0
  67. package/dist/types.js +2 -0
  68. package/dist/types.js.map +1 -0
  69. package/package.json +32 -0
@@ -0,0 +1,93 @@
1
+ import { z } from "zod";
2
+ import { api } from "../client.js";
3
+ export const applyDiscount = {
4
+ name: "discounts_apply",
5
+ description: "Apply a percentage discount to a product. Calculates the sale price automatically and preserves the original price. Use this for sales, promotions, and seasonal discounts.",
6
+ schema: z.object({
7
+ slug: z.string().describe("Product slug to apply discount to"),
8
+ percent: z
9
+ .number()
10
+ .min(1)
11
+ .max(99)
12
+ .describe("Discount percentage (e.g., 20 for 20% off)"),
13
+ label: z
14
+ .string()
15
+ .max(50)
16
+ .optional()
17
+ .describe("Optional label for the sale (e.g., 'Summer Sale')"),
18
+ }),
19
+ handler: async ({ slug, percent }) => {
20
+ const { product } = await api.getProduct(slug);
21
+ const discounted = +(product.price * (1 - percent / 100)).toFixed(2);
22
+ const result = await api.applyDiscount(product.id, discounted, product.price);
23
+ const updated = result.product;
24
+ return {
25
+ success: true,
26
+ data: {
27
+ product: updated.name,
28
+ slug: updated.slug,
29
+ originalPrice: product.price,
30
+ salePrice: discounted,
31
+ savings: +(product.price - discounted).toFixed(2),
32
+ percentOff: percent,
33
+ },
34
+ };
35
+ },
36
+ permissions: ["discounts:write"],
37
+ rateLimit: { maxRequests: 30, windowMs: 60000 },
38
+ version: "1.0.0",
39
+ };
40
+ export const removeDiscount = {
41
+ name: "discounts_remove",
42
+ description: "Remove the sale price from a product, restoring it to its original price. Use this when a promotion ends.",
43
+ schema: z.object({
44
+ slug: z.string().describe("Product slug to remove discount from"),
45
+ }),
46
+ handler: async ({ slug }) => {
47
+ const { product } = await api.getProduct(slug);
48
+ const original = product.originalPrice || product.price;
49
+ const result = await api.applyDiscount(product.id, original, 0);
50
+ return {
51
+ success: true,
52
+ data: {
53
+ product: result.product?.name || slug,
54
+ price: original,
55
+ discountRemoved: true,
56
+ },
57
+ };
58
+ },
59
+ permissions: ["discounts:write"],
60
+ rateLimit: { maxRequests: 30, windowMs: 60000 },
61
+ version: "1.0.0",
62
+ };
63
+ export const listDiscounts = {
64
+ name: "discounts_list",
65
+ description: "List all products that currently have active discounts or sale prices. Shows original price, current sale price, and percentage off.",
66
+ schema: z.object({}),
67
+ handler: async () => {
68
+ const data = await api.listProducts({ limit: 200 });
69
+ const discounted = data.items.filter((p) => p.originalPrice && p.originalPrice > p.price);
70
+ return {
71
+ success: true,
72
+ data: {
73
+ count: discounted.length,
74
+ discounts: discounted.map((p) => ({
75
+ id: p.id,
76
+ name: p.name,
77
+ slug: p.slug,
78
+ originalPrice: p.originalPrice,
79
+ currentPrice: p.price,
80
+ percentOff: Math.round((1 - p.price / p.originalPrice) * 100),
81
+ })),
82
+ },
83
+ };
84
+ },
85
+ rateLimit: { maxRequests: 60, windowMs: 60000 },
86
+ version: "1.0.0",
87
+ };
88
+ export const discountTools = [
89
+ applyDiscount,
90
+ removeDiscount,
91
+ listDiscounts,
92
+ ];
93
+ //# sourceMappingURL=discounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discounts.js","sourceRoot":"","sources":["../../src/tools/discounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,6KAA6K;IAC/K,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;QAC9D,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,EAAE,CAAC;aACP,QAAQ,CAAC,4CAA4C,CAAC;QACzD,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,EAAE,CAAC;aACP,QAAQ,EAAE;aACV,QAAQ,CAAC,mDAAmD,CAAC;KACjE,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9E,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAE/B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,IAAI,EAA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a;IACb,cAAc;IACd,aAAa;CACd,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ToolDefinition } from "../types.js";
2
+ export declare const allTools: ToolDefinition[];
3
+ export { productTools } from "./products.js";
4
+ export { orderTools } from "./orders.js";
5
+ export { inventoryTools } from "./inventory.js";
6
+ export { discountTools } from "./discounts.js";
7
+ export { analyticsTools } from "./analytics.js";
8
+ export { storeTools } from "./stores.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,QAAQ,EAAE,cAAc,EAOpC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { productTools } from "./products.js";
2
+ import { orderTools } from "./orders.js";
3
+ import { inventoryTools } from "./inventory.js";
4
+ import { discountTools } from "./discounts.js";
5
+ import { analyticsTools } from "./analytics.js";
6
+ import { storeTools } from "./stores.js";
7
+ export const allTools = [
8
+ ...productTools,
9
+ ...orderTools,
10
+ ...inventoryTools,
11
+ ...discountTools,
12
+ ...analyticsTools,
13
+ ...storeTools,
14
+ ];
15
+ export { productTools } from "./products.js";
16
+ export { orderTools } from "./orders.js";
17
+ export { inventoryTools } from "./inventory.js";
18
+ export { discountTools } from "./discounts.js";
19
+ export { analyticsTools } from "./analytics.js";
20
+ export { storeTools } from "./stores.js";
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,CAAC,MAAM,QAAQ,GAAqB;IACxC,GAAG,YAAY;IACf,GAAG,UAAU;IACb,GAAG,cAAc;IACjB,GAAG,aAAa;IAChB,GAAG,cAAc;IACjB,GAAG,UAAU;CACd,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ToolDefinition } from "../types.js";
2
+ export declare const listInventory: ToolDefinition;
3
+ export declare const updateInventory: ToolDefinition;
4
+ export declare const inventoryTools: ToolDefinition[];
5
+ //# sourceMappingURL=inventory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../../src/tools/inventory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,cA0C3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cA6B7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,EAAqC,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { z } from "zod";
2
+ import { api } from "../client.js";
3
+ export const listInventory = {
4
+ name: "inventory_list",
5
+ description: "View inventory levels across all products. Shows stock count, price, and status. Use lowStock=true to filter for products with stock at or below 5 units that may need restocking.",
6
+ schema: z.object({
7
+ lowStock: z
8
+ .boolean()
9
+ .optional()
10
+ .default(false)
11
+ .describe("If true, only show products with stock ≤ 5"),
12
+ }),
13
+ handler: async ({ lowStock }) => {
14
+ const data = await api.listProducts({ limit: 200 });
15
+ let items = data.items.filter((p) => p.status === "ACTIVE");
16
+ if (lowStock) {
17
+ items = items.filter((p) => p.inventory > 0 && p.inventory <= 5);
18
+ }
19
+ return {
20
+ success: true,
21
+ data: {
22
+ summary: {
23
+ total: items.length,
24
+ inStock: items.filter((p) => p.inventory > 5).length,
25
+ lowStock: items.filter((p) => p.inventory > 0 && p.inventory <= 5).length,
26
+ outOfStock: items.filter((p) => p.inventory === 0).length,
27
+ totalUnits: items.reduce((s, p) => s + p.inventory, 0),
28
+ },
29
+ products: items.map((p) => ({
30
+ id: p.id,
31
+ name: p.name,
32
+ slug: p.slug,
33
+ inventory: p.inventory,
34
+ price: p.price,
35
+ status: p.inventory === 0 ? "out_of_stock" : p.inventory <= 5 ? "low" : "ok",
36
+ })),
37
+ },
38
+ };
39
+ },
40
+ rateLimit: { maxRequests: 60, windowMs: 60000 },
41
+ version: "1.0.0",
42
+ };
43
+ export const updateInventory = {
44
+ name: "inventory_update",
45
+ description: "Update the stock count for a specific product by slug. Use this to restock items, adjust inventory after physical counts, or correct stock levels.",
46
+ schema: z.object({
47
+ slug: z.string().describe("Product slug to update stock for"),
48
+ stock: z
49
+ .number()
50
+ .int()
51
+ .min(0)
52
+ .describe("New stock count (0 = out of stock)"),
53
+ }),
54
+ handler: async ({ slug, stock }) => {
55
+ const { product } = await api.updateProduct(slug, {
56
+ inventory: stock,
57
+ });
58
+ return {
59
+ success: true,
60
+ data: {
61
+ product: product.name,
62
+ slug: product.slug,
63
+ previousInventory: product.inventory,
64
+ newInventory: stock,
65
+ },
66
+ };
67
+ },
68
+ permissions: ["inventory:write"],
69
+ rateLimit: { maxRequests: 60, windowMs: 60000 },
70
+ version: "1.0.0",
71
+ };
72
+ export const inventoryTools = [listInventory, updateInventory];
73
+ //# sourceMappingURL=inventory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../src/tools/inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,oLAAoL;IACtL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CAAC,4CAA4C,CAAC;KAC1D,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QACpD,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC;QAE5D,IAAI,QAAQ,EAAE,CAAC;YACb,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC;QACnE,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;Y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AAe,GAAmB;IAC7C,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,oJAAoJ;IACtJ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC7D,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,oCAAoC,CAAC;KAClD,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QACjC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE;YAChD,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,IAAI;YACb,IAAI,EAAE;gBACJ,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,iBAAiB,EAAE,OAAO,CAAC,SAAS;gBACpC,YAAY,EAAE,KAAK;aACpB;SACF,CAAC;IACJ,CAAC;IACD,WAAW,EAAE,CAAC,iBAAiB,CAAC;IAChC,SAAS,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC/C,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAqB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ToolDefinition } from "../types.js";
2
+ export declare const listOrders: ToolDefinition;
3
+ export declare const getOrder: ToolDefinition;
4
+ export declare const updateOrderStatus: ToolDefinition;
5
+ export declare const orderTools: ToolDefinition[];
6
+ //# sourceMappingURL=orders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/tools/orders.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,UAAU,EAAE,cAmDxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,cAatB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAwB/B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,EAItC,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { z } from "zod";
2
+ import { api } from "../client.js";
3
+ export const listOrders = {
4
+ name: "orders_list",
5
+ description: "List orders from your store. Optionally filter by status (pending, completed, refunded, cancelled). Returns order ID, amount, quantity, status, product name, and buyer info.",
6
+ schema: z.object({
7
+ status: z
8
+ .enum(["pending", "completed", "refunded", "cancelled"])
9
+ .optional()
10
+ .describe("Filter orders by status"),
11
+ limit: z
12
+ .number()
13
+ .min(1)
14
+ .max(500)
15
+ .optional()
16
+ .default(50)
17
+ .describe("Maximum orders to return"),
18
+ }),
19
+ handler: async ({ status, limit }) => {
20
+ const data = await api.listOrders({ status, limit });
21
+ return {
22
+ success: true,
23
+ data: {
24
+ count: data.total,
25
+ orders: data.items.map((o) => ({
26
+ id: o.id,
27
+ amount: o.amount,
28
+ quantity: o.quantity,
29
+ status: o.status,
30
+ createdAt: o.createdAt,
31
+ product: {
32
+ id: o.product?.id,
33
+ name: o.product?.name,
34
+ slug: o.product?.slug,
35
+ },
36
+ buyer: {
37
+ id: o.buyer?.id,
38
+ name: o.buyer?.name,
39
+ email: o.buyer?.email,
40
+ },
41
+ })),
42
+ summary: {
43
+ pending: data.items.filter((o) => o.status === "pending").length,
44
+ completed: data.items.filter((o) => o.status === "completed").length,
45
+ refunded: data.items.filter((o) => o.status === "refunded").length,
46
+ cancelled: data.items.filter((o) => o.status === "cancelled").length,
47
+ },
48
+ },
49
+ };
50
+ },
51
+ rateLimit: { maxRequests: 60, windowMs: 60000 },
52
+ version: "1.0.0",
53
+ };
54
+ export const getOrder = {
55
+ name: "orders_get",
56
+ description: "Get detailed information about a specific order by its ID. Returns full order details including product, buyer, amount, quantity, status, and timeline.",
57
+ schema: z.object({
58
+ id: z.string().describe("Order ID (usually a UUID)"),
59
+ }),
60
+ handler: async ({ id }) => {
61
+ const data = await api.getOrder(id);
62
+ return { success: true, data: data.order };
63
+ },
64
+ rateLimit: { maxRequests: 120, windowMs: 60000 },
65
+ version: "1.0.0",
66
+ };
67
+ export const updateOrderStatus = {
68
+ name: "orders_update_status",
69
+ description: "Update the status of an order. Use this to mark orders as completed (fulfilled), refunded, or cancelled. Cannot revert a completed/refunded/cancelled order back to pending.",
70
+ schema: z.object({
71
+ id: z.string().describe("Order ID to update"),
72
+ status: z
73
+ .enum(["pending", "completed", "refunded", "cancelled"])
74
+ .describe("New status: completed = fulfilled, refunded = money returned, cancelled = order voided"),
75
+ reason: z
76
+ .string()
77
+ .max(500)
78
+ .optional()
79
+ .describe("Optional reason for the status change (e.g., refund reason)"),
80
+ }),
81
+ handler: async ({ id, status }) => {
82
+ const { order } = await api.updateOrderStatus(id, status);
83
+ return { success: true, data: order };
84
+ },
85
+ permissions: ["orders:write"],
86
+ rateLimit: { maxRequests: 30, windowMs: 60000 },
87
+ version: "1.0.0",
88
+ };
89
+ export const orderTools = [
90
+ listOrders,
91
+ getOrder,
92
+ updateOrderStatus,
93
+ ];
94
+ //# sourceMappingURL=orders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orders.js","sourceRoot":"","sources":["../../src/tools/orders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,+KAA+K;IACjL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAA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AAsB;IAC5B,WAAW,EACT,8KAA8K;IAChL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC7C,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;aACvD,QAAQ,CACP,wFAAwF,CACzF;QACH,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,6DAA6D,CAAC;KAC3E,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,GAAG,CAAC,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACxC,CAAC;IACD,WAAW,EAAE,CAAC,cAAc,CAAC;IAC7B,SAAS,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC/C,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAqB;IAC1C,UAAU;IACV,QAAQ;IACR,iBAAiB;CAClB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ToolDefinition } from "../types.js";
2
+ export declare const listProducts: ToolDefinition;
3
+ export declare const getProduct: ToolDefinition;
4
+ export declare const createProduct: ToolDefinition;
5
+ export declare const updateProduct: ToolDefinition;
6
+ export declare const deleteProduct: ToolDefinition;
7
+ export declare const productTools: ToolDefinition[];
8
+ //# sourceMappingURL=products.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/tools/products.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,eAAO,MAAM,YAAY,EAAE,cAyD1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAaxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAiE3B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cA8B3B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAiB3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAAc,EAMxC,CAAC"}
@@ -0,0 +1,190 @@
1
+ import { z } from "zod";
2
+ import { api } from "../client.js";
3
+ const CategorySchema = z.object({
4
+ id: z.string(),
5
+ name: z.string(),
6
+ slug: z.string(),
7
+ });
8
+ export const listProducts = {
9
+ name: "products_list",
10
+ description: "List products in the marketplace with optional filters by category, seller, sort order, and pagination. Returns product name, price, stock, status, and category.",
11
+ schema: z.object({
12
+ category: z
13
+ .string()
14
+ .optional()
15
+ .describe("Filter by category slug (use categories_list to find slugs)"),
16
+ seller: z.string().optional().describe("Filter by seller user ID"),
17
+ sort: z
18
+ .enum(["newest", "price_asc", "price_desc"])
19
+ .optional()
20
+ .describe("Sort order for results"),
21
+ limit: z
22
+ .number()
23
+ .min(1)
24
+ .max(200)
25
+ .optional()
26
+ .default(50)
27
+ .describe("Maximum number of products to return"),
28
+ }),
29
+ handler: async ({ category, seller, sort, limit }) => {
30
+ const params = new URLSearchParams({ limit: String(limit || 50) });
31
+ if (category)
32
+ params.set("category", category);
33
+ if (seller)
34
+ params.set("sellerId", seller);
35
+ if (sort)
36
+ params.set("sort", sort);
37
+ const data = await api.listProducts({
38
+ category,
39
+ sellerId: seller,
40
+ sort,
41
+ limit,
42
+ });
43
+ return {
44
+ success: true,
45
+ data: {
46
+ count: data.total,
47
+ products: data.items.map((p) => ({
48
+ id: p.id,
49
+ name: p.name,
50
+ slug: p.slug,
51
+ price: p.price,
52
+ originalPrice: p.originalPrice,
53
+ inventory: p.inventory,
54
+ status: p.status,
55
+ category: p.category?.name,
56
+ badge: p.badge,
57
+ views: p.views,
58
+ createdAt: p.createdAt,
59
+ })),
60
+ },
61
+ };
62
+ },
63
+ rateLimit: { maxRequests: 60, windowMs: 60000 },
64
+ version: "1.0.0",
65
+ };
66
+ export const getProduct = {
67
+ name: "products_get",
68
+ description: "Get detailed information about a specific product by its URL slug. Returns full product details including description, images, pricing, stock, seller info, and category.",
69
+ schema: z.object({
70
+ slug: z.string().describe("Product slug (the URL-friendly identifier)"),
71
+ }),
72
+ handler: async ({ slug }) => {
73
+ const { product } = await api.getProduct(slug);
74
+ return { success: true, data: product };
75
+ },
76
+ rateLimit: { maxRequests: 120, windowMs: 60000 },
77
+ version: "1.0.0",
78
+ };
79
+ export const createProduct = {
80
+ name: "products_create",
81
+ description: "Create a new product in the marketplace. Requires name, description, price, and category ID (use categories_list to find available categories). Optionally accepts store, inventory count, badge, and images.",
82
+ schema: z.object({
83
+ name: z.string().min(1).max(200).describe("Product name"),
84
+ description: z
85
+ .string()
86
+ .min(1)
87
+ .max(5000)
88
+ .describe("Product description"),
89
+ price: z
90
+ .number()
91
+ .positive()
92
+ .describe("Product price in USD (e.g., 29.99)"),
93
+ category: z.string().describe("Category ID (use categories_list to find)"),
94
+ store: z.string().optional().describe("Store ID to associate the product with"),
95
+ inventory: z
96
+ .number()
97
+ .int()
98
+ .min(0)
99
+ .optional()
100
+ .default(1)
101
+ .describe("Initial stock count"),
102
+ badge: z
103
+ .enum(["hot", "trending", "sale", "new"])
104
+ .optional()
105
+ .describe("Optional product badge"),
106
+ images: z
107
+ .array(z.string().url())
108
+ .optional()
109
+ .describe("Array of image URLs"),
110
+ }),
111
+ handler: async ({ name, description, price, category, store, inventory, badge, images, }) => {
112
+ const { product } = await api.createProduct({
113
+ name,
114
+ description,
115
+ price: String(price),
116
+ categoryId: category,
117
+ storeId: store,
118
+ inventory: inventory || 1,
119
+ badge: badge || undefined,
120
+ images,
121
+ });
122
+ return {
123
+ success: true,
124
+ data: product,
125
+ warnings: [
126
+ !store ? "Product not linked to a store — set one via stores_list" : undefined,
127
+ ].filter((w) => Boolean(w)),
128
+ };
129
+ },
130
+ permissions: ["products:write"],
131
+ rateLimit: { maxRequests: 30, windowMs: 60000 },
132
+ version: "1.0.0",
133
+ };
134
+ export const updateProduct = {
135
+ name: "products_update",
136
+ description: "Update an existing product's price, inventory count, or status. Provide only the fields you want to change.",
137
+ schema: z.object({
138
+ slug: z.string().describe("Product slug to update"),
139
+ price: z.number().positive().optional().describe("New price"),
140
+ inventory: z
141
+ .number()
142
+ .int()
143
+ .min(0)
144
+ .optional()
145
+ .describe("New stock count"),
146
+ status: z
147
+ .enum(["ACTIVE", "DRAFT"])
148
+ .optional()
149
+ .describe("Set to DRAFT to hide, ACTIVE to list"),
150
+ }),
151
+ handler: async ({ slug, price, inventory, status }) => {
152
+ const data = {};
153
+ if (price !== undefined)
154
+ data.price = String(price);
155
+ if (inventory !== undefined)
156
+ data.inventory = inventory;
157
+ if (status)
158
+ data.status = status;
159
+ const { product } = await api.updateProduct(slug, data);
160
+ return { success: true, data: product };
161
+ },
162
+ permissions: ["products:write"],
163
+ rateLimit: { maxRequests: 60, windowMs: 60000 },
164
+ version: "1.0.0",
165
+ };
166
+ export const deleteProduct = {
167
+ name: "products_delete",
168
+ description: "Permanently delete a product from the marketplace by its slug. This action cannot be undone.",
169
+ schema: z.object({
170
+ slug: z.string().describe("Product slug to delete"),
171
+ }),
172
+ handler: async ({ slug }) => {
173
+ await api.deleteProduct(slug);
174
+ return {
175
+ success: true,
176
+ data: { deleted: slug, message: "Product permanently deleted" },
177
+ };
178
+ },
179
+ permissions: ["products:delete"],
180
+ rateLimit: { maxRequests: 20, windowMs: 60000 },
181
+ version: "1.0.0",
182
+ };
183
+ export const productTools = [
184
+ listProducts,
185
+ getProduct,
186
+ createProduct,
187
+ updateProduct,
188
+ deleteProduct,
189
+ ];
190
+ //# sourceMappingURL=products.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.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,GAAmB;IAC3C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,8FAA8F;IAChG,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;KACpD,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAC1B,MAAM,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,6BAA6B,EAAE;SAChE,CAAC;IACJ,CAAC;IACD,WAAW,EAAE,CAAC,iBAAiB,CAAC;IAChC,SAAS,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC/C,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C,YAAY;IACZ,UAAU;IACV,aAAa;IACb,aAAa;IACb,aAAa;CACd,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ToolDefinition } from "../types.js";
2
+ export declare const listStores: ToolDefinition;
3
+ export declare const listCategories: ToolDefinition;
4
+ export declare const storeTools: ToolDefinition[];
5
+ //# sourceMappingURL=stores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../src/tools/stores.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,UAAU,EAAE,cAYxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAY5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,EAAiC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ import { api } from "../client.js";
3
+ export const listStores = {
4
+ name: "stores_list",
5
+ description: "List all stores in the marketplace with their name, rating, product count, and verification status.",
6
+ schema: z.object({}),
7
+ handler: async () => {
8
+ const data = await api.listStores();
9
+ const items = data.stores || [];
10
+ return { success: true, data: items };
11
+ },
12
+ rateLimit: { maxRequests: 60, windowMs: 60000 },
13
+ version: "1.0.0",
14
+ };
15
+ export const listCategories = {
16
+ name: "categories_list",
17
+ description: "List all product categories available in the marketplace. Use this to find category slugs and IDs for filtering products or creating new products.",
18
+ schema: z.object({}),
19
+ handler: async () => {
20
+ const data = await api.listCategories();
21
+ const items = data.categories || [];
22
+ return { success: true, data: items };
23
+ },
24
+ rateLimit: { maxRequests: 60, windowMs: 60000 },
25
+ version: "1.0.0",
26
+ };
27
+ export const storeTools = [listStores, listCategories];
28
+ //# sourceMappingURL=stores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores.js","sourceRoot":"","sources":["../../src/tools/stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,qGAAqG;IACvG,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,OAAO,EAAE,KAAK,IAAI,EAAE;QAClB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;QACpC,MAAM,KAAK,GAAI,IAA+B,CAAC,MAAM,IAAI,EAAE,CAAC;QAC5D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACxC,CAAC;IACD,SAAS,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC/C,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT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