@sea-ecommerce/admin-mcp-server 0.3.0 → 0.3.1
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/dist/derlux-admin-mcp.js +27 -9
- package/package.json +3 -1
- package/skill/SKILL.md +3 -3
- package/skill//345/267/245/345/205/267/345/217/202/346/225/260/345/217/202/350/200/203.md +6 -4
- package/skill//350/277/220/350/220/245/344/272/272/345/221/230/346/211/213/345/206/214/03-/345/225/206/345/223/201/347/256/241/347/220/206.md +16 -1
package/dist/derlux-admin-mcp.js
CHANGED
|
@@ -21841,6 +21841,13 @@ function buildQuery(params) {
|
|
|
21841
21841
|
const sp = new URLSearchParams();
|
|
21842
21842
|
for (const [k, v] of Object.entries(params)) {
|
|
21843
21843
|
if (v === void 0 || v === null || v === "") continue;
|
|
21844
|
+
if (Array.isArray(v)) {
|
|
21845
|
+
for (const item of v) {
|
|
21846
|
+
if (item === void 0 || item === null || item === "") continue;
|
|
21847
|
+
sp.append(`${k}[]`, String(item));
|
|
21848
|
+
}
|
|
21849
|
+
continue;
|
|
21850
|
+
}
|
|
21844
21851
|
sp.set(k, String(v));
|
|
21845
21852
|
}
|
|
21846
21853
|
const s = sp.toString();
|
|
@@ -22894,19 +22901,22 @@ function backupProductContent(productId, locale, status, blocks) {
|
|
|
22894
22901
|
var productTools = [
|
|
22895
22902
|
{
|
|
22896
22903
|
name: "list_products",
|
|
22897
|
-
description:
|
|
22904
|
+
description: '\u67E5\u8BE2\u540E\u53F0\u5546\u54C1\u5217\u8868\uFF0C\u652F\u6301\u6309\u5173\u952E\u8BCD q\u3001\u72B6\u6001 status\u3001handle \u8FC7\u6EE4\u3002\u8FD4\u56DE\u4F53\u542B count\uFF08\u6EE1\u8DB3\u6761\u4EF6\u7684\u603B\u6570\uFF0C\u4E0D\u53D7 limit \u5F71\u54CD\uFF09\u3002status \u53EF\u4F20\u5355\u503C\uFF08"published"\uFF09\u6216\u591A\u4E2A\u503C\u7684\u6570\u7EC4\uFF08["published","draft"]\uFF09\u3002',
|
|
22898
22905
|
schema: {
|
|
22899
22906
|
q: external_exports.string().optional(),
|
|
22900
|
-
status: external_exports.enum(PRODUCT_STATUS).optional(),
|
|
22907
|
+
status: external_exports.union([external_exports.enum(PRODUCT_STATUS), external_exports.array(external_exports.enum(PRODUCT_STATUS)).min(1)]).optional(),
|
|
22901
22908
|
handle: external_exports.string().optional(),
|
|
22902
|
-
limit: external_exports.number().int().positive().max(100).default(20)
|
|
22909
|
+
limit: external_exports.number().int().positive().max(100).default(20),
|
|
22910
|
+
offset: external_exports.number().int().nonnegative().optional()
|
|
22903
22911
|
},
|
|
22904
22912
|
async run(input, { client: client2 }) {
|
|
22913
|
+
const status = input.status === void 0 ? void 0 : Array.isArray(input.status) ? input.status : [input.status];
|
|
22905
22914
|
return client2.listProducts({
|
|
22906
22915
|
q: input.q,
|
|
22907
|
-
status
|
|
22916
|
+
status,
|
|
22908
22917
|
handle: input.handle,
|
|
22909
|
-
limit: input.limit
|
|
22918
|
+
limit: input.limit,
|
|
22919
|
+
offset: input.offset
|
|
22910
22920
|
});
|
|
22911
22921
|
}
|
|
22912
22922
|
},
|
|
@@ -23868,14 +23878,22 @@ translations \u4E3A upsert\uFF08\u540C\u8BED\u8A00\u5408\u5E76\u66F4\u65B0\uFF0C
|
|
|
23868
23878
|
var opsTools = [
|
|
23869
23879
|
{
|
|
23870
23880
|
name: "list_orders",
|
|
23871
|
-
description:
|
|
23881
|
+
description: '\u67E5\u8BE2\u540E\u53F0\u8BA2\u5355\u5217\u8868\uFF0C\u652F\u6301\u5173\u952E\u8BCD q\u3001\u72B6\u6001 status \u8FC7\u6EE4\u3002\u8FD4\u56DE\u4F53\u542B count\uFF08\u6EE1\u8DB3\u6761\u4EF6\u7684\u603B\u6570\uFF0C\u4E0D\u53D7 limit \u5F71\u54CD\uFF09\u3002status \u53EF\u4F20\u5355\u503C\uFF08"pending"\uFF09\u6216\u591A\u4E2A\u503C\u7684\u6570\u7EC4\uFF08["pending","canceled"]\uFF09\u3002',
|
|
23872
23882
|
schema: {
|
|
23873
23883
|
q: external_exports.string().optional(),
|
|
23874
|
-
|
|
23875
|
-
|
|
23884
|
+
// 不写死枚举:后端订单状态集合可能随版本扩展,这里只约束形态(单值 / 非空数组)。
|
|
23885
|
+
status: external_exports.union([external_exports.string(), external_exports.array(external_exports.string()).min(1)]).optional(),
|
|
23886
|
+
limit: external_exports.number().int().positive().max(100).default(20),
|
|
23887
|
+
offset: external_exports.number().int().nonnegative().optional()
|
|
23876
23888
|
},
|
|
23877
23889
|
async run(input, { client: client2 }) {
|
|
23878
|
-
|
|
23890
|
+
const status = input.status === void 0 ? void 0 : Array.isArray(input.status) ? input.status : [input.status];
|
|
23891
|
+
return client2.listOrders({
|
|
23892
|
+
q: input.q,
|
|
23893
|
+
status,
|
|
23894
|
+
limit: input.limit,
|
|
23895
|
+
offset: input.offset
|
|
23896
|
+
});
|
|
23879
23897
|
}
|
|
23880
23898
|
},
|
|
23881
23899
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sea-ecommerce/admin-mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "让运营同学用本地 AI agent(Codex / Workbuddy / Claude / Cursor / CodeBuddy)运营 Medusa 后台的 MCP server。",
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
"build": "node scripts/bundle.mjs",
|
|
18
18
|
"start": "node dist/derlux-admin-mcp.js",
|
|
19
19
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest",
|
|
20
22
|
"gen:skill": "node scripts/gen-skill.mjs",
|
|
21
23
|
"check:skill-drift": "node scripts/gen-skill.mjs --check",
|
|
22
24
|
"prepublishOnly": "node scripts/bundle.mjs && node scripts/gen-skill.mjs --check",
|
package/skill/SKILL.md
CHANGED
|
@@ -80,9 +80,9 @@ description: 运营使用本地 AI agent(derlux-admin MCP server)操作 DERL
|
|
|
80
80
|
| `get_product_content` | 读 | 否 | 直接返回 · 读取商品详情页富内容块(GET /admin/product-contents)。 |
|
|
81
81
|
| `get_translations` | 读 | 否 | 直接返回 · 读取某实体的多语言翻译(GET /admin/translations)——核对商品四语… |
|
|
82
82
|
| `list_collections` | 读 | 否 | 直接返回 · 列出集合(GET /admin/collections),… |
|
|
83
|
-
| `list_orders` | 读 | 否 | 直接返回 ·
|
|
83
|
+
| `list_orders` | 读 | 否 | 直接返回 · 查询后台订单列表,支持关键词 q、状态 status 过滤。 |
|
|
84
84
|
| `list_product_categories` | 读 | 否 | 直接返回 · 查询后台产品分类列表(GET /admin/product-categories)。 |
|
|
85
|
-
| `list_products` | 读 | 否 | 直接返回 ·
|
|
85
|
+
| `list_products` | 读 | 否 | 直接返回 · 查询后台商品列表,支持按关键词 q、状态 status、handle 过滤。 |
|
|
86
86
|
| `list_return_requests` | 读 | 否 | 直接返回 · 查询退货/售后请求列表(自定义端点 /admin/return-requests)。 |
|
|
87
87
|
| `list_sales_channels` | 读 | 否 | 直接返回 · 列出销售渠道(GET /admin/sales-channels)。 |
|
|
88
88
|
| `list_stock_locations` | 读 | 否 | 直接返回 · 列出仓库(Medusa StockLocation)。 |
|
|
@@ -229,7 +229,7 @@ get_translations(reference="product_option_value", reference_id="optval_xxx")
|
|
|
229
229
|
|
|
230
230
|
**修改 / 下架**:`get_product` 确认 id → `update_product` / `deactivate_product`(预览 → 确认)。改价格用 `update_product_prices`,改库存用 `set_product_stock`,补翻译用 `set_translations`。
|
|
231
231
|
|
|
232
|
-
**查询类**:直接调读工具,无需 `confirm
|
|
232
|
+
**查询类**:直接调读工具,无需 `confirm`。统计「有多少 X」时看返回体的 `count`(满足条件的总数,**不受 `limit` 影响**),不要去数 `products.length` / `orders.length`;结果超过 `limit`(上限 100)时用 `offset` 继续翻页,只有 `count` 才是全量口径。`list_products` / `list_orders` 的 `status` 既可传单值(`"published"`)也可传数组(`["published","draft"]`)。
|
|
233
233
|
|
|
234
234
|
## 系统使用问答:检索《运营人员手册》
|
|
235
235
|
|
|
@@ -239,10 +239,11 @@ locale 接受区域码 en-US / zh-CN / ms-MY / id-ID(推荐,与前端一致
|
|
|
239
239
|
## `list_orders`
|
|
240
240
|
|
|
241
241
|
- 类型:读 | 源文件:`src/tools/ops.ts`
|
|
242
|
-
- 参数:`q` / `status` / `limit`
|
|
242
|
+
- 参数:`q` / `status` / `limit` / `offset`
|
|
243
243
|
|
|
244
244
|
```text
|
|
245
|
-
查询后台订单列表,支持关键词 q、状态 status
|
|
245
|
+
查询后台订单列表,支持关键词 q、状态 status 过滤。返回体含 count(满足条件的总数,不受 limit 影响)。' +
|
|
246
|
+
'status 可传单值("pending")或多个值的数组(["pending","canceled"])。
|
|
246
247
|
```
|
|
247
248
|
|
|
248
249
|
## `list_product_categories`
|
|
@@ -257,10 +258,11 @@ locale 接受区域码 en-US / zh-CN / ms-MY / id-ID(推荐,与前端一致
|
|
|
257
258
|
## `list_products`
|
|
258
259
|
|
|
259
260
|
- 类型:读 | 源文件:`src/tools/products.ts`
|
|
260
|
-
- 参数:`q` / `status` / `handle` / `limit`
|
|
261
|
+
- 参数:`q` / `status` / `handle` / `limit` / `offset`
|
|
261
262
|
|
|
262
263
|
```text
|
|
263
|
-
查询后台商品列表,支持按关键词 q、状态 status、handle
|
|
264
|
+
查询后台商品列表,支持按关键词 q、状态 status、handle 过滤。返回体含 count(满足条件的总数,不受 limit 影响)。' +
|
|
265
|
+
'status 可传单值("published")或多个值的数组(["published","draft"])。
|
|
264
266
|
```
|
|
265
267
|
|
|
266
268
|
## `list_return_requests`
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
| 功能 | 入口 |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| 商品列表与新建 | 侧边栏「产品(Products)」 |
|
|
10
|
+
| 按币种快速改价 | 商品详情页右侧「快捷价格管理」卡片 |
|
|
10
11
|
| 系列、分类、标签 | 「产品」下的系列、分类、产品标签 |
|
|
11
12
|
| 页头展示开关 | 目标系列详情页**最下方**的「页头展示」卡片 |
|
|
12
13
|
| 销售渠道 | 「设置」→「销售渠道」 |
|
|
@@ -107,12 +108,26 @@
|
|
|
107
108
|
|
|
108
109
|
| 目的 | 操作 |
|
|
109
110
|
| --- | --- |
|
|
110
|
-
| 改价 |
|
|
111
|
+
| 改价 | 快捷:「快捷价格管理」卡片直接改各币种金额 → 保存调整;精细:「变体」→ 点击变体 → 价格列表按币种修改 → 保存 |
|
|
111
112
|
| 补货 / 减库存 | 点击变体 → 库存页调整数量 → 保存 |
|
|
112
113
|
| 上架 / 下架 | 「属性」→ 编辑 → 状态改为「已发布」或「草稿」→ 保存 |
|
|
113
114
|
|
|
114
115
|
> 下架后前台立即不可见,不影响历史订单;已发布商品的修改即时反映到前台,未见变化可刷新页面。
|
|
115
116
|
|
|
117
|
+
## 操作:按币种快速改价(快捷价格管理)
|
|
118
|
+
|
|
119
|
+
商品详情页右侧「快捷价格管理」卡片按变体列出**已设置价格的币种**,改完金额点「保存调整」即生效。
|
|
120
|
+
|
|
121
|
+
| 规则 | 说明 |
|
|
122
|
+
| --- | --- |
|
|
123
|
+
| 只显示已有价格的币种 | 某变体缺某币种价格时,该行不显示(不做空行占位)。需要**新增**币种价格、维护促销价或区域价,仍走「变体」卡片 |
|
|
124
|
+
| 金额 = 主货币单位 | MYR 899.00 填 `899`,IDR 3200000 填 `3200000`,**不要乘 100** |
|
|
125
|
+
| 小数位随币种 | IDR / VND / JPY / KRW 为 0 位(填小数会报错拦下);MYR / SGD / PHP / THB / USD / EUR 为 2 位 |
|
|
126
|
+
| 只影响改动的行 | 同一变体一次性整体提交,未改动币种的价格保持原值 |
|
|
127
|
+
| 状态提示 | 行内「未保存」= 有改动未提交;保存成功后按钮左侧显示「价格已保存成功。」 |
|
|
128
|
+
|
|
129
|
+
> 同一商品有多个变体时,每个变体各自一张小卡,可分别展开 / 折叠;卡片底部统计「有 N 处修改待保存」。
|
|
130
|
+
|
|
116
131
|
## 操作:调整可售国家
|
|
117
132
|
|
|
118
133
|
1. 打开该商品 →「销售渠道」卡片 → 编辑。
|