beautx-cli 1.1.2-beta.3 → 1.1.2

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
@@ -229,6 +229,40 @@ beautx-cli portrait-tags [选项]
229
229
  --size <每页条数>
230
230
  ```
231
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
+
232
266
  ### 录音管理
233
267
 
234
268
  ```bash
package/dist/cli.mjs CHANGED
@@ -7638,20 +7638,21 @@ runMain(defineCommand({
7638
7638
  subCommands: {
7639
7639
  config: () => import("./config-BjsUQ9I-.mjs").then((m) => m.default),
7640
7640
  project: () => import("./project-CYVCYuHU.mjs").then((m) => m.default),
7641
- skill: () => import("./skill-Dg_uKK57.mjs").then((m) => m.default),
7641
+ skill: () => import("./skill-BF9S48yu.mjs").then((m) => m.default),
7642
7642
  consultant: () => import("./consultant-vVraua0_.mjs").then((m) => m.default),
7643
- staff: () => import("./staff-B01SCGHo.mjs").then((m) => m.default),
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
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
- visit: () => import("./visit-BGT8Z7L1.mjs").then((m) => m.default),
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
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
- resistance: () => import("./resistance-3jX1cR7U.mjs").then((m) => m.default),
7655
+ resistance: () => import("./resistance-BCHM2VZk.mjs").then((m) => m.default),
7655
7656
  qa: () => import("./qa-DtxO4tZJ.mjs").then((m) => m.default),
7656
7657
  kb: () => import("./kb-rsFJm8cU.mjs").then((m) => m.default)
7657
7658
  }
@@ -1,7 +1,7 @@
1
1
  import { c as requireActiveProject } from "./project-store-DUlIIW51.mjs";
2
2
  import { n as writeError, r as writeResult, t as formatCliArg } from "./cli.mjs";
3
3
  import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CG7OuBep.mjs";
4
- import { i as skillInstallGrant, r as resolveSkillInstallDir, t as downloadSkillPackage } from "./skill-client-CO5xWb95.mjs";
4
+ import { i as skillInstallGrant, r as resolveSkillInstallDir, t as downloadSkillPackage } from "./skill-client-BfpXlgLz.mjs";
5
5
  import { defineCommand } from "citty";
6
6
  //#region src/commands/skill/install.ts
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { c as requireActiveProject } from "./project-store-DUlIIW51.mjs";
2
2
  import { n as writeError, r as writeResult, t as formatCliArg } from "./cli.mjs";
3
3
  import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CG7OuBep.mjs";
4
- import { a as skillList } from "./skill-client-CO5xWb95.mjs";
4
+ import { a as skillList } from "./skill-client-BfpXlgLz.mjs";
5
5
  import { defineCommand } from "citty";
6
6
  //#region src/commands/skill/list.ts
7
7
  /**
@@ -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 };
@@ -5,7 +5,7 @@ var resistance_default = defineCommand({
5
5
  name: "resistance",
6
6
  description: "客户抗性点标签分页查询"
7
7
  },
8
- subCommands: { list: () => import("./list-DOB8pYHM.mjs").then((m) => m.default) }
8
+ subCommands: { list: () => import("./list-D9JQwZD52.mjs").then((m) => m.default) }
9
9
  });
10
10
  //#endregion
11
11
  export { resistance_default as default };
@@ -6,9 +6,9 @@ var skill_default = defineCommand({
6
6
  description: "Skill 中心:列表 / 安装 / 上传(REST,沙箱双凭证)"
7
7
  },
8
8
  subCommands: {
9
- list: () => import("./list-CiGnPRMu.mjs").then((m) => m.default),
10
- install: () => import("./install-9POQGm3C.mjs").then((m) => m.default),
11
- upload: () => import("./upload-DK6MjBpn.mjs").then((m) => m.default)
9
+ list: () => import("./list-CXbqmTos.mjs").then((m) => m.default),
10
+ install: () => import("./install-7SB-izr2.mjs").then((m) => m.default),
11
+ upload: () => import("./upload-CZDRAlaG.mjs").then((m) => m.default)
12
12
  }
13
13
  });
14
14
  //#endregion
@@ -5,7 +5,7 @@ var staff_default = defineCommand({
5
5
  name: "staff",
6
6
  description: "员工能力查询"
7
7
  },
8
- subCommands: { "capability-profile": () => import("./capability-profile-DpFSQBi4.mjs").then((m) => m.default) }
8
+ subCommands: { "capability-profile": () => import("./capability-profile-VWZEzTJY.mjs").then((m) => m.default) }
9
9
  });
10
10
  //#endregion
11
11
  export { staff_default as default };
@@ -1,5 +1,5 @@
1
1
  import { n as writeError, r as writeResult, t as formatCliArg } from "./cli.mjs";
2
- import { n as putSkillZip, o as skillUploadConfirm, s as skillUploadInitiate } from "./skill-client-CO5xWb95.mjs";
2
+ import { n as putSkillZip, o as skillUploadConfirm, s as skillUploadInitiate } from "./skill-client-BfpXlgLz.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  import { readFile } from "node:fs/promises";
5
5
  //#region src/commands/skill/upload.ts
@@ -6,8 +6,8 @@ var visit_default = defineCommand({
6
6
  description: "客户来访查询"
7
7
  },
8
8
  subCommands: {
9
- list: () => import("./list-BVbHFk3E2.mjs").then((m) => m.default),
10
- summary: () => import("./summary-Kqoanp4I.mjs").then((m) => m.default)
9
+ list: () => import("./list-CuJXGJvc.mjs").then((m) => m.default),
10
+ summary: () => import("./summary-D4vO6NHy.mjs").then((m) => m.default)
11
11
  }
12
12
  });
13
13
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beautx-cli",
3
- "version": "1.1.2-beta.3",
3
+ "version": "1.1.2",
4
4
  "description": "Beautx CLI (beautx-cli) — MCP gateway CLI for medical beauty industry",
5
5
  "type": "module",
6
6
  "bin": {
File without changes
File without changes