beautx-cli 1.1.2-beta.1 → 1.1.2-beta.4

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 CHANGED
@@ -128,11 +128,6 @@ beautx-cli panke list [选项]
128
128
 
129
129
  # 查询小美待盘客任务
130
130
  beautx-cli panke task --panke-task-id <任务ID>
131
-
132
- # 查询地产盘客 SOP
133
- beautx-cli panke detail [选项]
134
- --panke-id <盘客SOP ID> # 必填,不能使用待盘客任务ID代替
135
- --include-transcript # 可选,查询录音原文
136
131
  ```
137
132
 
138
133
  ### 小美金句
@@ -234,6 +229,40 @@ beautx-cli portrait-tags [选项]
234
229
  --size <每页条数>
235
230
  ```
236
231
 
232
+ ### 量子数据统计
233
+
234
+ ```bash
235
+ # 到访、成交、关注点、未成交原因、录音执行率
236
+ beautx-cli quantum visit [选项]
237
+ beautx-cli quantum deal [选项]
238
+ beautx-cli quantum focus [选项]
239
+ beautx-cli quantum untraded [选项]
240
+ beautx-cli quantum recording [选项]
241
+
242
+ # 变美计划、特殊接诊、风险、金句、盘客、WangClaw
243
+ beautx-cli quantum plan [选项]
244
+ beautx-cli quantum special [选项]
245
+ beautx-cli quantum risk [选项]
246
+ beautx-cli quantum golden-usage [选项]
247
+ beautx-cli quantum panke [选项]
248
+ beautx-cli quantum wangclaw-usage [选项]
249
+
250
+ # 客户意向等级、团队、员工或周期统计
251
+ beautx-cli quantum intent [选项]
252
+
253
+ # 公共过滤参数
254
+ --project-id <项目ID> # 默认取当前激活项目
255
+ --view <返回视图> # 默认 summary
256
+ --from <开始时间>
257
+ --to <结束时间>
258
+ --date-type <聚合类型> # day/week/month/year/total
259
+ --user-ids <员工ID列表> # 多个 ID 用逗号分隔
260
+ --team-id <团队ID>
261
+ --visit-type <来访类型>
262
+ --page <页码>
263
+ --size <每页条数>
264
+ ```
265
+
237
266
  ### 录音管理
238
267
 
239
268
  ```bash
package/dist/cli.mjs CHANGED
@@ -7637,22 +7637,23 @@ runMain(defineCommand({
7637
7637
  },
7638
7638
  subCommands: {
7639
7639
  config: () => import("./config-BjsUQ9I-.mjs").then((m) => m.default),
7640
- project: () => import("./project-CzpyW67k.mjs").then((m) => m.default),
7640
+ project: () => import("./project-CYVCYuHU.mjs").then((m) => m.default),
7641
7641
  skill: () => import("./skill-BF9S48yu.mjs").then((m) => m.default),
7642
7642
  consultant: () => import("./consultant-vVraua0_.mjs").then((m) => m.default),
7643
7643
  staff: () => import("./staff-IytS68QG.mjs").then((m) => m.default),
7644
7644
  "golden-sentence": () => import("./golden-sentence-Ds-iQpH9.mjs").then((m) => m.default),
7645
- panke: () => import("./panke-Dd52P534.mjs").then((m) => m.default),
7645
+ panke: () => import("./panke-CO--Bv4n.mjs").then((m) => m.default),
7646
7646
  audio: () => import("./audio-DlgPatwd.mjs").then((m) => m.default),
7647
7647
  customer: () => import("./customer-CnAv26d0.mjs").then((m) => m.default),
7648
7648
  visit: () => import("./visit-BsY4-f1r.mjs").then((m) => m.default),
7649
7649
  "beauty-plan": () => import("./beauty-plan-BMR3QbZr.mjs").then((m) => m.default),
7650
7650
  "beauty-plan-reminder": () => import("./beauty-plan-reminder-B7g7RRTs.mjs").then((m) => m.default),
7651
7651
  "deal-analysis": () => import("./deal-analysis-CX4IXbgk.mjs").then((m) => m.default),
7652
- "portrait-tags": () => import("./portrait-tags-C6plwT2N.mjs").then((m) => m.default),
7652
+ "portrait-tags": () => import("./portrait-tags-CCo6uav8.mjs").then((m) => m.default),
7653
+ quantum: () => import("./quantum-FmPay9zw.mjs").then((m) => m.default),
7653
7654
  focus: () => import("./focus-Dx1rT6QE.mjs").then((m) => m.default),
7654
7655
  resistance: () => import("./resistance-BCHM2VZk.mjs").then((m) => m.default),
7655
- qa: () => import("./qa-D3OEsKVK.mjs").then((m) => m.default),
7656
+ qa: () => import("./qa-DtxO4tZJ.mjs").then((m) => m.default),
7656
7657
  kb: () => import("./kb-rsFJm8cU.mjs").then((m) => m.default)
7657
7658
  }
7658
7659
  }));
@@ -6,9 +6,8 @@ var panke_default = defineCommand({
6
6
  description: "盘客只读查询"
7
7
  },
8
8
  subCommands: {
9
- list: () => import("./list-CbKkYLBK.mjs").then((m) => m.default),
10
- detail: () => import("./detail-RW63RcvN.mjs").then((m) => m.default),
11
- task: () => import("./task-CuHDQlRD.mjs").then((m) => m.default)
9
+ list: () => import("./list-7k2QD_SC2.mjs").then((m) => m.default),
10
+ task: () => import("./task-DlTk04im.mjs").then((m) => m.default)
12
11
  }
13
12
  });
14
13
  //#endregion
@@ -6,9 +6,9 @@ var project_default = defineCommand({
6
6
  description: "查询 / 切换激活项目"
7
7
  },
8
8
  subCommands: {
9
- list: () => import("./list-BREF9Ecs.mjs").then((m) => m.default),
10
- use: () => import("./use-C_V8PxFJ.mjs").then((m) => m.default),
11
- current: () => import("./current-DdEW2EWK.mjs").then((m) => m.default)
9
+ list: () => import("./list-CwpxejCd.mjs").then((m) => m.default),
10
+ use: () => import("./use-CZ8xIPrB.mjs").then((m) => m.default),
11
+ current: () => import("./current-s-QVNZmV.mjs").then((m) => m.default)
12
12
  }
13
13
  });
14
14
  //#endregion
@@ -0,0 +1,201 @@
1
+ import { c as requireActiveProject } from "./project-store-DUlIIW51.mjs";
2
+ import { n as writeError, t as formatCliArg } from "./cli.mjs";
3
+ import { n as mcpCall } from "./mcp-client-huLKHRT3.mjs";
4
+ import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CG7OuBep.mjs";
5
+ import { n as writeMcpDataResult } from "./mcp-result-BzDGJUdM.mjs";
6
+ import { i as toLocalDateTime, t as csvToArray } from "./util-BtgWHKWv.mjs";
7
+ import { defineCommand } from "citty";
8
+ //#region src/commands/quantum/query.ts
9
+ const QUANTUM_TOOL_SPECS = [
10
+ {
11
+ commandName: "visit",
12
+ toolName: "beautx-visit-stat",
13
+ description: "医美到访客户统计",
14
+ views: ["summary"]
15
+ },
16
+ {
17
+ commandName: "deal",
18
+ toolName: "beautx-deal-stat",
19
+ description: "医美成交客户统计",
20
+ views: ["summary", "rank"]
21
+ },
22
+ {
23
+ commandName: "focus",
24
+ toolName: "beautx-focus-stat",
25
+ description: "医美客户关注点统计",
26
+ views: ["summary", "rank"]
27
+ },
28
+ {
29
+ commandName: "untraded",
30
+ toolName: "beautx-untraded-stat",
31
+ description: "医美未成交原因统计",
32
+ views: ["summary", "rank"]
33
+ },
34
+ {
35
+ commandName: "recording",
36
+ toolName: "beautx-recording-stat",
37
+ description: "医美录音执行率统计",
38
+ views: ["summary", "rank"]
39
+ },
40
+ {
41
+ commandName: "plan",
42
+ toolName: "beautx-plan-stat",
43
+ description: "变美计划执行统计",
44
+ views: ["summary", "detail"]
45
+ },
46
+ {
47
+ commandName: "special",
48
+ toolName: "beautx-special-stat",
49
+ description: "医美特殊接诊统计",
50
+ views: ["summary", "rank"]
51
+ },
52
+ {
53
+ commandName: "risk",
54
+ toolName: "beautx-risk-stat",
55
+ description: "医美风险触发统计",
56
+ views: ["summary", "rank"]
57
+ },
58
+ {
59
+ commandName: "golden-usage",
60
+ toolName: "golden-usage-stat",
61
+ description: "金句使用统计",
62
+ views: ["summary", "rank"]
63
+ },
64
+ {
65
+ commandName: "panke",
66
+ toolName: "beautx-panke-stat",
67
+ description: "医美盘客执行率统计",
68
+ views: ["summary", "rank"]
69
+ },
70
+ {
71
+ commandName: "wangclaw-usage",
72
+ toolName: "wangclaw-usage-stat",
73
+ description: "WangClaw 使用统计",
74
+ views: ["summary", "rank"]
75
+ },
76
+ {
77
+ commandName: "intent",
78
+ toolName: "intent-stat",
79
+ description: "客户意向统计",
80
+ views: [
81
+ "summary",
82
+ "level",
83
+ "team",
84
+ "user",
85
+ "period"
86
+ ],
87
+ intent: true
88
+ }
89
+ ];
90
+ const commonArgs = {
91
+ ...projectIdCliArg,
92
+ view: {
93
+ type: "string",
94
+ description: "返回视图;各子命令支持范围见 --help"
95
+ },
96
+ from: {
97
+ type: "string",
98
+ description: "开始时间 yyyy-MM-dd HH:mm:ss;默认当天 00:00:00"
99
+ },
100
+ to: {
101
+ type: "string",
102
+ description: "结束时间 yyyy-MM-dd HH:mm:ss;默认次日 00:00:00"
103
+ },
104
+ "date-type": {
105
+ type: "string",
106
+ description: "日期聚合类型:day/week/month/year/total"
107
+ },
108
+ "user-ids": {
109
+ type: "string",
110
+ description: "员工 ID CSV;与当前用户数据权限范围取交集"
111
+ },
112
+ "team-id": {
113
+ type: "string",
114
+ description: "团队 ID"
115
+ },
116
+ "visit-type": {
117
+ type: "string",
118
+ description: "来访类型:first/second/third_more/special/all"
119
+ },
120
+ page: {
121
+ type: "string",
122
+ default: "1",
123
+ description: "页码,从 1 开始"
124
+ },
125
+ size: {
126
+ type: "string",
127
+ default: "10",
128
+ description: "每页条数,最大 10"
129
+ },
130
+ config: {
131
+ type: "string",
132
+ description: "页面卡片配置 JSON,可选"
133
+ },
134
+ format: formatCliArg
135
+ };
136
+ const intentArgs = {
137
+ dimension: {
138
+ type: "string",
139
+ description: "意向数据来源:review/ai"
140
+ },
141
+ "intent-level": {
142
+ type: "string",
143
+ description: "意向级别:A/B/C/D/E"
144
+ },
145
+ direction: {
146
+ type: "string",
147
+ description: "时间轴方向:left/right;view=period 时使用"
148
+ }
149
+ };
150
+ function buildQuantumQueryArgs(args, active, spec) {
151
+ const view = String(args.view || spec.views[0]).trim();
152
+ if (!spec.views.includes(view)) throw new Error(`--view for ${spec.commandName} must be one of: ${spec.views.join(", ")}`);
153
+ return {
154
+ project_id: resolveProjectId(args["project-id"], active),
155
+ view,
156
+ from: toLocalDateTime(args.from),
157
+ to: toLocalDateTime(args.to),
158
+ date_type: args["date-type"],
159
+ user_ids: csvToArray(args["user-ids"]),
160
+ team_id: args["team-id"],
161
+ visit_type: args["visit-type"],
162
+ page: Number(args.page),
163
+ size: Number(args.size),
164
+ config: args.config,
165
+ ...spec.intent ? {
166
+ dimension: args.dimension,
167
+ intent_level: args["intent-level"],
168
+ direction: args.direction
169
+ } : {}
170
+ };
171
+ }
172
+ function createQuantumCommand(spec) {
173
+ return defineCommand({
174
+ meta: {
175
+ name: spec.commandName,
176
+ description: `${spec.description}(${spec.toolName},view=${spec.views.join("|")})`
177
+ },
178
+ args: {
179
+ ...commonArgs,
180
+ ...spec.intent ? intentArgs : {}
181
+ },
182
+ async run({ args }) {
183
+ try {
184
+ const active = await requireActiveProject();
185
+ writeMcpDataResult(await mcpCall(spec.toolName, { arguments: buildQuantumQueryArgs(args, active, spec) }), args.format);
186
+ } catch (err) {
187
+ writeError(err, args.format);
188
+ process.exit(1);
189
+ }
190
+ }
191
+ });
192
+ }
193
+ var quantum_default = defineCommand({
194
+ meta: {
195
+ name: "quantum",
196
+ description: "医美量子数据统计"
197
+ },
198
+ subCommands: Object.fromEntries(QUANTUM_TOOL_SPECS.map((spec) => [spec.commandName, createQuantumCommand(spec)]))
199
+ });
200
+ //#endregion
201
+ export { quantum_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beautx-cli",
3
- "version": "1.1.2-beta.1",
3
+ "version": "1.1.2-beta.4",
4
4
  "description": "Beautx CLI (beautx-cli) — MCP gateway CLI for medical beauty industry",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,44 +0,0 @@
1
- import { c as requireActiveProject } from "./project-store-DUlIIW51.mjs";
2
- import { n as writeError, t as formatCliArg } from "./cli.mjs";
3
- import { n as mcpCall } from "./mcp-client-huLKHRT3.mjs";
4
- import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CG7OuBep.mjs";
5
- import { n as writeMcpDataResult } from "./mcp-result-BzDGJUdM.mjs";
6
- import { defineCommand } from "citty";
7
- //#region src/commands/panke/detail.ts
8
- function buildPankeDetailArgs(args, active) {
9
- const pankeId = String(args["panke-id"] || "").trim();
10
- if (!/^[1-9]\d*$/.test(pankeId)) throw new Error("--panke-id must be a positive SOP ID");
11
- return {
12
- project_id: resolveProjectId(args["project-id"], active),
13
- panke_id: pankeId,
14
- include_transcript: args["include-transcript"] === true
15
- };
16
- }
17
- var detail_default = defineCommand({
18
- meta: {
19
- name: "detail",
20
- description: "按盘客 SOP ID 查询盘客详情"
21
- },
22
- args: {
23
- ...projectIdCliArg,
24
- "panke-id": {
25
- type: "string",
26
- description: "盘客 SOP ID,不能传任务 ID 或事件记录 ID"
27
- },
28
- "include-transcript": {
29
- type: "boolean",
30
- description: "包含录音原文;默认不查询"
31
- },
32
- format: formatCliArg
33
- },
34
- async run({ args }) {
35
- try {
36
- writeMcpDataResult(await mcpCall("panke-detail", { arguments: buildPankeDetailArgs(args, await requireActiveProject()) }), args.format);
37
- } catch (err) {
38
- writeError(err, args.format);
39
- process.exit(1);
40
- }
41
- }
42
- });
43
- //#endregion
44
- export { detail_default as default };
File without changes
File without changes
File without changes
File without changes
File without changes