@puyinkai/xiaobao-cli 0.2.1 → 0.4.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 (49) hide show
  1. package/README.md +7 -3
  2. package/dist/admin-BzMFazEa.mjs +14 -0
  3. package/dist/{api-DtFEKH3I.mjs → api-ChuNquZJ.mjs} +5 -5
  4. package/dist/{api-client-CDNjkArS.mjs → api-client-ifJHc7hu.mjs} +2 -2
  5. package/dist/{audio-DhEiStuy.mjs → audio-CeNKUqeU.mjs} +2 -2
  6. package/dist/{auth-BYWDBat3.mjs → auth-CdWYrfte.mjs} +3 -3
  7. package/dist/cli.mjs +15 -13
  8. package/dist/{consultant-DvH6ezCT.mjs → consultant-CO9zaJ7I.mjs} +1 -1
  9. package/dist/{current-gZDEGEmi.mjs → current-BYpcshKV.mjs} +2 -2
  10. package/dist/{customer-BtAtJyM8.mjs → customer-COMf1yZb.mjs} +1 -1
  11. package/dist/{doc--iAF-laM.mjs → doc-NfMyo-fF.mjs} +5 -5
  12. package/dist/{doc-content-CqDVEgwX.mjs → doc-content-BKaZ016e.mjs} +5 -5
  13. package/dist/{docs-C_sC8m3F.mjs → docs-CheVzIbW.mjs} +5 -5
  14. package/dist/{focus-BmLvFWII.mjs → focus-AWSxlbBZ.mjs} +1 -1
  15. package/dist/{format-CvKe7-yU.mjs → format-HWx3JWdS.mjs} +1 -1
  16. package/dist/{kb-B9IY8-fu.mjs → kb-DkSAvuBG.mjs} +4 -4
  17. package/dist/{list-CiBpxZFs.mjs → list-BbU4R0_z.mjs} +5 -5
  18. package/dist/{list-DbReQZE2.mjs → list-BxWqQllQ2.mjs} +6 -6
  19. package/dist/{list-CZVU6EVq.mjs → list-CMFp28Dm.mjs} +6 -6
  20. package/dist/{list-DW4Sk-76.mjs → list-Czym-Sla.mjs} +3 -3
  21. package/dist/{list-DDGGG2p2.mjs → list-D7Fmqk0G.mjs} +6 -6
  22. package/dist/{list-VJImXOzy.mjs → list-QIEQgIb3.mjs} +6 -6
  23. package/dist/{list-DmBz_8dR.mjs → list-bBAaEvT7.mjs} +6 -6
  24. package/dist/{login-B5e9tJbS.mjs → login-DYAlK1aL.mjs} +3 -3
  25. package/dist/{logout-Dz_FFIRP.mjs → logout-S3GMy_ns.mjs} +3 -3
  26. package/dist/{project-C2fvEuDl.mjs → project-CiltZzqF.mjs} +3 -3
  27. package/dist/{qa-C2TSTS-m.mjs → qa-DDzTuZ8K.mjs} +5 -5
  28. package/dist/quantum-CgAcmQAL.mjs +183 -0
  29. package/dist/{resistance-BxOZNWbb.mjs → resistance-YwKC91E0.mjs} +1 -1
  30. package/dist/sales-report-XQ_Oy9ht.mjs +70 -0
  31. package/dist/{search-CBWh8yKE.mjs → search-CxOFpH18.mjs} +6 -6
  32. package/dist/{summary-CAm-WDNF.mjs → summary-CfbHddby.mjs} +6 -6
  33. package/dist/{text-bgoI1KC-.mjs → text-R3KjyXSK.mjs} +5 -5
  34. package/dist/token-usage-BDnEMHvB.mjs +102 -0
  35. package/dist/{use-xbTXVwXb.mjs → use-DgCwov4y.mjs} +2 -2
  36. package/dist/{visit-LX3B_OgE.mjs → visit-Beb2o8zF.mjs} +2 -2
  37. package/dist/{whoami-BMAFa4es.mjs → whoami-H8AdUnQY.mjs} +2 -2
  38. package/package.json +1 -1
  39. package/skills/wangxiaobao-admin-sales-report/SKILL.md +54 -0
  40. package/skills/wangxiaobao-admin-token-usage/SKILL.md +53 -0
  41. package/skills/wangxiaobao-knowledge-base/SKILL.md +1 -1
  42. package/skills/wangxiaobao-quantum-stats/SKILL.md +76 -0
  43. package/skills/wangxiaobao-quantum-stats/references/quantum-metrics.md +43 -0
  44. package/skills/wangxiaobao-shared/SKILL.md +6 -1
  45. /package/dist/{device-flow-D6JVcEap.mjs → device-flow-DC1kqcmR.mjs} +0 -0
  46. /package/dist/{headers-DSnR4sjk.mjs → headers-Dy5gROBB.mjs} +0 -0
  47. /package/dist/{project-store-CKVJa54T.mjs → project-store-CudTRvbA.mjs} +0 -0
  48. /package/dist/{token-store-CXizLE2_.mjs → token-store-BB7n-fwJ.mjs} +0 -0
  49. /package/dist/{util-CaPQBlNa.mjs → util-pyTg7qwY.mjs} +0 -0
package/README.md CHANGED
@@ -55,6 +55,9 @@ xiaobao-cli audio list --from "2026-05-01 00:00:00" --to "2026-05-02 00:00:00" -
55
55
  | `kb docs [--title]` | 新增 · 知识库文档列表 |
56
56
  | `kb doc <doc-id>` | 新增 · 知识库文档详情 |
57
57
  | `kb doc-content <doc-id> [--offset] [--limit]` | 新增 · 知识库文档正文分页 |
58
+ | `quantum <metric> [--view] [--visit-type] …` | 新增 · 量子看板 / KPI 统计(20 指标) |
59
+ | `admin sales-report --from --to [--by project\|zone]` | 新增 · 公司经营数据 出库/回款(super-admin,独立白名单) |
60
+ | `admin token-usage --from --to [--model] …` | 新增 · LLM token 用量(super-admin,独立白名单) |
58
61
  | `api <METHOD> <path>` | `xiaobao_api` |
59
62
 
60
63
  ## 通用 flags
@@ -82,9 +85,10 @@ xiaobao-cli audio list --from "2026-05-01 00:00:00" --to "2026-05-02 00:00:00" -
82
85
  ## skill 配套
83
86
 
84
87
  `skills/` 目录下的 SKILL.md 跟 cli 同包发布,跟 openclaw-xiaobao 那边镜像,
85
- 只是调用从 plugin tool invoke 改为 shell out `xiaobao-cli ...`。本次新增
86
- `wangxiaobao-visit-summary-query`(来访接待总结)与 `wangxiaobao-knowledge-base`(知识库)
87
- 两个 skill;`wangxiaobao-quick-qa` 的问数底层由 fast-responder 切换为 sql-agent。
88
+ 只是调用从 plugin tool invoke 改为 shell out `xiaobao-cli ...`。近期新增
89
+ `wangxiaobao-visit-summary-query`(来访接待总结)、`wangxiaobao-knowledge-base`(知识库)
90
+ `wangxiaobao-quantum-stats`(量子看板 / KPI 统计,含 `references/quantum-metrics.md`);
91
+ `wangxiaobao-quick-qa` 的问数底层由 fast-responder 切换为 sql-agent。
88
92
 
89
93
  ## License
90
94
 
@@ -0,0 +1,14 @@
1
+ import { defineCommand } from "citty";
2
+ //#region src/commands/admin/index.ts
3
+ var admin_default = defineCommand({
4
+ meta: {
5
+ name: "admin",
6
+ description: "super-admin 经营报表:公司经营数据(出库/回款)/ LLM token 用量(独立白名单)"
7
+ },
8
+ subCommands: {
9
+ "sales-report": () => import("./sales-report-XQ_Oy9ht.mjs").then((m) => m.default),
10
+ "token-usage": () => import("./token-usage-BDnEMHvB.mjs").then((m) => m.default)
11
+ }
12
+ });
13
+ //#endregion
14
+ export { admin_default as default };
@@ -1,8 +1,8 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { t as loadActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { t as loadActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
6
  import { defineCommand } from "citty";
7
7
  //#region src/commands/api.ts
8
8
  /**
@@ -1,5 +1,5 @@
1
- import { r as refreshToken } from "./device-flow-D6JVcEap.mjs";
2
- import { a as isAccessTokenValid, l as writeToken, s as readToken } from "./token-store-CXizLE2_.mjs";
1
+ import { r as refreshToken } from "./device-flow-DC1kqcmR.mjs";
2
+ import { a as isAccessTokenValid, l as writeToken, s as readToken } from "./token-store-BB7n-fwJ.mjs";
3
3
  //#region src/core/api-client.ts
4
4
  /**
5
5
  * HTTP client for wangxiaobao open API endpoints.
@@ -6,8 +6,8 @@ var audio_default = defineCommand({
6
6
  description: "录音元数据分页 / 单条文本查询"
7
7
  },
8
8
  subCommands: {
9
- list: () => import("./list-CZVU6EVq.mjs").then((m) => m.default),
10
- text: () => import("./text-bgoI1KC-.mjs").then((m) => m.default)
9
+ list: () => import("./list-CMFp28Dm.mjs").then((m) => m.default),
10
+ text: () => import("./text-R3KjyXSK.mjs").then((m) => m.default)
11
11
  }
12
12
  });
13
13
  //#endregion
@@ -6,9 +6,9 @@ var auth_default = defineCommand({
6
6
  description: "OAuth 登录 / 身份查询 / 登出(device flow)"
7
7
  },
8
8
  subCommands: {
9
- login: () => import("./login-B5e9tJbS.mjs").then((m) => m.default),
10
- whoami: () => import("./whoami-BMAFa4es.mjs").then((m) => m.default),
11
- logout: () => import("./logout-Dz_FFIRP.mjs").then((m) => m.default)
9
+ login: () => import("./login-DYAlK1aL.mjs").then((m) => m.default),
10
+ whoami: () => import("./whoami-H8AdUnQY.mjs").then((m) => m.default),
11
+ logout: () => import("./logout-S3GMy_ns.mjs").then((m) => m.default)
12
12
  }
13
13
  });
14
14
  //#endregion
package/dist/cli.mjs CHANGED
@@ -8,8 +8,8 @@ import { defineCommand, runMain } from "citty";
8
8
  * xiaobao-cli entrypoint.
9
9
  *
10
10
  * Capabilities mapped from the openclaw-xiaobao plugin to CLI subcommands,
11
- * plus visit-summary and knowledge-base queries — all proxied through
12
- * ai-open → wang-ai-mcp. See README for the full command map.
11
+ * plus visit-summary, knowledge-base and quantum KPI stats — all proxied
12
+ * through ai-open → wang-ai-mcp. See README for the full command map.
13
13
  */
14
14
  const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
15
15
  runMain(defineCommand({
@@ -19,17 +19,19 @@ runMain(defineCommand({
19
19
  description: "旺小宝 CLI — host-agnostic 业务数据 / 问数 / 来访总结 / 知识库 能力 (openclaw-xiaobao plugin 的 CLI 等价物)"
20
20
  },
21
21
  subCommands: {
22
- auth: () => import("./auth-BYWDBat3.mjs").then((m) => m.default),
23
- project: () => import("./project-C2fvEuDl.mjs").then((m) => m.default),
24
- consultant: () => import("./consultant-DvH6ezCT.mjs").then((m) => m.default),
25
- audio: () => import("./audio-DhEiStuy.mjs").then((m) => m.default),
26
- customer: () => import("./customer-BtAtJyM8.mjs").then((m) => m.default),
27
- visit: () => import("./visit-LX3B_OgE.mjs").then((m) => m.default),
28
- focus: () => import("./focus-BmLvFWII.mjs").then((m) => m.default),
29
- resistance: () => import("./resistance-BxOZNWbb.mjs").then((m) => m.default),
30
- qa: () => import("./qa-C2TSTS-m.mjs").then((m) => m.default),
31
- kb: () => import("./kb-B9IY8-fu.mjs").then((m) => m.default),
32
- api: () => import("./api-DtFEKH3I.mjs").then((m) => m.default)
22
+ auth: () => import("./auth-CdWYrfte.mjs").then((m) => m.default),
23
+ project: () => import("./project-CiltZzqF.mjs").then((m) => m.default),
24
+ consultant: () => import("./consultant-CO9zaJ7I.mjs").then((m) => m.default),
25
+ audio: () => import("./audio-CeNKUqeU.mjs").then((m) => m.default),
26
+ customer: () => import("./customer-COMf1yZb.mjs").then((m) => m.default),
27
+ visit: () => import("./visit-Beb2o8zF.mjs").then((m) => m.default),
28
+ focus: () => import("./focus-AWSxlbBZ.mjs").then((m) => m.default),
29
+ resistance: () => import("./resistance-YwKC91E0.mjs").then((m) => m.default),
30
+ qa: () => import("./qa-DDzTuZ8K.mjs").then((m) => m.default),
31
+ kb: () => import("./kb-DkSAvuBG.mjs").then((m) => m.default),
32
+ quantum: () => import("./quantum-CgAcmQAL.mjs").then((m) => m.default),
33
+ admin: () => import("./admin-BzMFazEa.mjs").then((m) => m.default),
34
+ api: () => import("./api-ChuNquZJ.mjs").then((m) => m.default)
33
35
  }
34
36
  }));
35
37
  //#endregion
@@ -5,7 +5,7 @@ var consultant_default = defineCommand({
5
5
  name: "consultant",
6
6
  description: "查询有权限的置业顾问列表"
7
7
  },
8
- subCommands: { list: () => import("./list-CiBpxZFs.mjs").then((m) => m.default) }
8
+ subCommands: { list: () => import("./list-BbU4R0_z.mjs").then((m) => m.default) }
9
9
  });
10
10
  //#endregion
11
11
  export { consultant_default as default };
@@ -1,5 +1,5 @@
1
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
2
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
2
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/commands/project/current.ts
5
5
  /**
@@ -5,7 +5,7 @@ var customer_default = defineCommand({
5
5
  name: "customer",
6
6
  description: "客户画像分页查询"
7
7
  },
8
- subCommands: { list: () => import("./list-DDGGG2p2.mjs").then((m) => m.default) }
8
+ subCommands: { list: () => import("./list-D7Fmqk0G.mjs").then((m) => m.default) }
9
9
  });
10
10
  //#endregion
11
11
  export { customer_default as default };
@@ -1,8 +1,8 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
6
  import { defineCommand } from "citty";
7
7
  //#region src/commands/kb/doc.ts
8
8
  /**
@@ -1,8 +1,8 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
6
  import { defineCommand } from "citty";
7
7
  //#region src/commands/kb/doc-content.ts
8
8
  /**
@@ -1,8 +1,8 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
6
  import { defineCommand } from "citty";
7
7
  //#region src/commands/kb/docs.ts
8
8
  /**
@@ -5,7 +5,7 @@ var focus_default = defineCommand({
5
5
  name: "focus",
6
6
  description: "客户关注点标签分页查询"
7
7
  },
8
- subCommands: { list: () => import("./list-VJImXOzy.mjs").then((m) => m.default) }
8
+ subCommands: { list: () => import("./list-QIEQgIb3.mjs").then((m) => m.default) }
9
9
  });
10
10
  //#endregion
11
11
  export { focus_default as default };
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/@toon-format+toon@2.2.0/node_modules/@toon-format/toon/dist/index.mjs
1
+ //#region ../../../node_modules/.pnpm/@toon-format+toon@2.2.0/node_modules/@toon-format/toon/dist/index.mjs
2
2
  const NULL_LITERAL = "null";
3
3
  const DEFAULT_DELIMITER = {
4
4
  comma: ",",
@@ -6,10 +6,10 @@ var kb_default = defineCommand({
6
6
  description: "项目知识库:语义检索 / 文档列表 / 文档详情 / 文档正文分页"
7
7
  },
8
8
  subCommands: {
9
- search: () => import("./search-CBWh8yKE.mjs").then((m) => m.default),
10
- docs: () => import("./docs-C_sC8m3F.mjs").then((m) => m.default),
11
- doc: () => import("./doc--iAF-laM.mjs").then((m) => m.default),
12
- "doc-content": () => import("./doc-content-CqDVEgwX.mjs").then((m) => m.default)
9
+ search: () => import("./search-CxOFpH18.mjs").then((m) => m.default),
10
+ docs: () => import("./docs-CheVzIbW.mjs").then((m) => m.default),
11
+ doc: () => import("./doc-NfMyo-fF.mjs").then((m) => m.default),
12
+ "doc-content": () => import("./doc-content-BKaZ016e.mjs").then((m) => m.default)
13
13
  }
14
14
  });
15
15
  //#endregion
@@ -1,8 +1,8 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
6
  import { defineCommand } from "citty";
7
7
  //#region src/commands/consultant/list.ts
8
8
  /**
@@ -1,9 +1,9 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
6
- import { r as toLocalDateTime } from "./util-CaPQBlNa.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { r as toLocalDateTime } from "./util-pyTg7qwY.mjs";
7
7
  import { defineCommand } from "citty";
8
8
  //#region src/commands/visit/list.ts
9
9
  /**
@@ -1,9 +1,9 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
6
- import { n as mergeUserIds, r as toLocalDateTime, t as csvToArray } from "./util-CaPQBlNa.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { n as mergeUserIds, r as toLocalDateTime, t as csvToArray } from "./util-pyTg7qwY.mjs";
7
7
  import { defineCommand } from "citty";
8
8
  //#region src/commands/audio/list.ts
9
9
  /**
@@ -1,6 +1,6 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  //#region src/commands/project/list.ts
6
6
  /**
@@ -1,9 +1,9 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
6
- import { r as toLocalDateTime } from "./util-CaPQBlNa.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { r as toLocalDateTime } from "./util-pyTg7qwY.mjs";
7
7
  import { defineCommand } from "citty";
8
8
  //#region src/commands/customer/list.ts
9
9
  /**
@@ -1,9 +1,9 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
6
- import { r as toLocalDateTime, t as csvToArray } from "./util-CaPQBlNa.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { r as toLocalDateTime, t as csvToArray } from "./util-pyTg7qwY.mjs";
7
7
  import { defineCommand } from "citty";
8
8
  //#region src/commands/focus/list.ts
9
9
  /**
@@ -1,9 +1,9 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
6
- import { r as toLocalDateTime, t as csvToArray } from "./util-CaPQBlNa.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { r as toLocalDateTime, t as csvToArray } from "./util-pyTg7qwY.mjs";
7
7
  import { defineCommand } from "citty";
8
8
  //#region src/commands/resistance/list.ts
9
9
  /**
@@ -1,6 +1,6 @@
1
- import { a as resolveConfig, n as pollForToken, r as refreshToken, t as initiateDeviceAuthorization } from "./device-flow-D6JVcEap.mjs";
2
- import { a as isAccessTokenValid, c as writePendingAuth, l as writeToken, n as clearPendingAuth, o as readPendingAuth, r as clearToken, s as readToken, t as NoPendingAuthError } from "./token-store-CXizLE2_.mjs";
3
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig, n as pollForToken, r as refreshToken, t as initiateDeviceAuthorization } from "./device-flow-DC1kqcmR.mjs";
2
+ import { a as isAccessTokenValid, c as writePendingAuth, l as writeToken, n as clearPendingAuth, o as readPendingAuth, r as clearToken, s as readToken, t as NoPendingAuthError } from "./token-store-BB7n-fwJ.mjs";
3
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  //#region src/commands/auth/login.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { a as resolveConfig, i as revokeRefreshToken } from "./device-flow-D6JVcEap.mjs";
2
- import { n as clearPendingAuth, r as clearToken, s as readToken } from "./token-store-CXizLE2_.mjs";
3
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig, i as revokeRefreshToken } from "./device-flow-DC1kqcmR.mjs";
2
+ import { n as clearPendingAuth, r as clearToken, s as readToken } from "./token-store-BB7n-fwJ.mjs";
3
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  //#region src/commands/auth/logout.ts
6
6
  /**
@@ -6,9 +6,9 @@ var project_default = defineCommand({
6
6
  description: "查询 / 切换激活项目"
7
7
  },
8
8
  subCommands: {
9
- list: () => import("./list-DW4Sk-76.mjs").then((m) => m.default),
10
- use: () => import("./use-xbTXVwXb.mjs").then((m) => m.default),
11
- current: () => import("./current-gZDEGEmi.mjs").then((m) => m.default)
9
+ list: () => import("./list-Czym-Sla.mjs").then((m) => m.default),
10
+ use: () => import("./use-DgCwov4y.mjs").then((m) => m.default),
11
+ current: () => import("./current-BYpcshKV.mjs").then((m) => m.default)
12
12
  }
13
13
  });
14
14
  //#endregion
@@ -1,8 +1,8 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
6
  import { defineCommand } from "citty";
7
7
  //#region src/commands/qa.ts
8
8
  /**
@@ -0,0 +1,183 @@
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { r as toLocalDateTime, t as csvToArray } from "./util-pyTg7qwY.mjs";
7
+ import { defineCommand } from "citty";
8
+ //#region src/commands/quantum.ts
9
+ /**
10
+ * `xiaobao-cli quantum <metric>` — 旺小宝量子看板 / 预聚合 KPI 统计.
11
+ *
12
+ * 一个通用命令覆盖全部量子指标(visit / visit-ongoing / visit-realtime / follow /
13
+ * job-performance / work-quality / visit-timer / usage-data / resistance-point /
14
+ * speech-sale / demand-data / hot-words / risk / special-visit / month-report /
15
+ * deal / intent / pin-talk / demand-card / rhetoric)。它们共用同一套入参,靠
16
+ * `--view` / `--mode` 区分子视图。调 POST /ai-open/quantum/<metric>。
17
+ *
18
+ * 各指标支持哪些 view / 需要哪些参数,见 wangxiaobao-quantum-stats skill。
19
+ */
20
+ const num = (v) => v != null ? Number(v) : void 0;
21
+ const numList = (v) => csvToArray(v)?.map(Number);
22
+ var quantum_default = defineCommand({
23
+ meta: {
24
+ name: "quantum",
25
+ description: "量子看板 / KPI 统计(metric 见 quantum-stats skill;--view/--mode 区分子视图)"
26
+ },
27
+ args: {
28
+ metric: {
29
+ type: "positional",
30
+ required: true,
31
+ description: "指标端点:visit / deal / intent / pin-talk / demand-card / visit-timer 等"
32
+ },
33
+ view: {
34
+ type: "string",
35
+ description: "视图:summary|rank|team|time|user|... 随 metric 而定"
36
+ },
37
+ mode: {
38
+ type: "string",
39
+ description: "模式:page|count(visit-ongoing)、query|find(month-report)"
40
+ },
41
+ role: {
42
+ type: "string",
43
+ description: "角色:consultant|manager(usage-data)"
44
+ },
45
+ agg: {
46
+ type: "string",
47
+ description: "接访时长 metric:total|avg(visit-timer)"
48
+ },
49
+ from: {
50
+ type: "string",
51
+ description: "开始时间(默认当天 00:00:00)"
52
+ },
53
+ to: {
54
+ type: "string",
55
+ description: "结束时间(默认次日 00:00:00)"
56
+ },
57
+ "date-type": {
58
+ type: "string",
59
+ description: "day|week|month|year|total"
60
+ },
61
+ page: { type: "string" },
62
+ size: { type: "string" },
63
+ offset: { type: "string" },
64
+ "team-id": {
65
+ type: "string",
66
+ description: "团队 ID(team 视图下钻)"
67
+ },
68
+ "time-type": { type: "string" },
69
+ "visit-type": {
70
+ type: "string",
71
+ description: "first|second|third_more|special|all"
72
+ },
73
+ "deal-status": {
74
+ type: "string",
75
+ description: "CSV: 成交状态列表(deal)"
76
+ },
77
+ "model-id": {
78
+ type: "string",
79
+ description: "销讲/挖需模型 ID(pin-talk/demand-card)"
80
+ },
81
+ "dimension-id": {
82
+ type: "string",
83
+ description: "维度 ID(view=dimension|speech 下钻)"
84
+ },
85
+ "speech-id": {
86
+ type: "string",
87
+ description: "话术 ID(view=speech)"
88
+ },
89
+ config: {
90
+ type: "string",
91
+ description: "卡片 config JSON(一般不传)"
92
+ },
93
+ "stat-dimension": {
94
+ type: "string",
95
+ description: "visit_times|customer_num、follow_times|customer_num"
96
+ },
97
+ "intent-dimension": {
98
+ type: "string",
99
+ description: "review|ai(intent)"
100
+ },
101
+ "risk-dimension": {
102
+ type: "string",
103
+ description: "all|effective|review|invalid(risk)"
104
+ },
105
+ "intent-level": {
106
+ type: "string",
107
+ description: "A|B|C|D|E(intent view=user|period)"
108
+ },
109
+ direction: {
110
+ type: "string",
111
+ description: "left|right(intent view=period 翻页)"
112
+ },
113
+ "interval-start": {
114
+ type: "string",
115
+ description: "接访时长分桶起点分钟(visit-timer view=team|date 必填)"
116
+ },
117
+ "interval-end": {
118
+ type: "string",
119
+ description: "接访时长分桶终点分钟(visit-timer view=team|date 必填)"
120
+ },
121
+ "usage-data-type": {
122
+ type: "string",
123
+ description: "usage-data rank 指标"
124
+ },
125
+ "user-ids": {
126
+ type: "string",
127
+ description: "CSV: 显式 userIds 数据范围"
128
+ },
129
+ "api-base": { type: "string" },
130
+ "auth-base": { type: "string" },
131
+ format: {
132
+ type: "string",
133
+ default: "toon"
134
+ }
135
+ },
136
+ async run({ args }) {
137
+ try {
138
+ const config = resolveConfig({
139
+ apiBase: args["api-base"],
140
+ authBase: args["auth-base"]
141
+ });
142
+ const active = await requireActiveProject();
143
+ const metric = String(args.metric);
144
+ writeResult(await xbApiFetch(config, "POST", `/ai-open/quantum/${encodeURIComponent(metric)}`, {
145
+ headers: tenantProjectHeaders(active),
146
+ body: {
147
+ view: args.view,
148
+ mode: args.mode,
149
+ role: args.role,
150
+ metric: args.agg,
151
+ startTime: toLocalDateTime(args.from),
152
+ endTime: toLocalDateTime(args.to),
153
+ dateType: args["date-type"],
154
+ page: num(args.page),
155
+ size: num(args.size),
156
+ offset: num(args.offset),
157
+ teamId: num(args["team-id"]),
158
+ timeType: args["time-type"],
159
+ visitType: args["visit-type"],
160
+ dealStatus: numList(args["deal-status"]),
161
+ modelId: num(args["model-id"]),
162
+ dimensionId: num(args["dimension-id"]),
163
+ speechId: num(args["speech-id"]),
164
+ config: args.config,
165
+ statDimension: args["stat-dimension"],
166
+ intentDimension: args["intent-dimension"],
167
+ riskDimension: args["risk-dimension"],
168
+ intentLevel: args["intent-level"],
169
+ direction: args.direction,
170
+ intervalStart: num(args["interval-start"]),
171
+ intervalEnd: num(args["interval-end"]),
172
+ usageDataType: args["usage-data-type"],
173
+ userIds: numList(args["user-ids"])
174
+ }
175
+ }), args.format);
176
+ } catch (err) {
177
+ writeError(err, args.format);
178
+ process.exit(1);
179
+ }
180
+ }
181
+ });
182
+ //#endregion
183
+ 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-DmBz_8dR.mjs").then((m) => m.default) }
8
+ subCommands: { list: () => import("./list-bBAaEvT7.mjs").then((m) => m.default) }
9
9
  });
10
10
  //#endregion
11
11
  export { resistance_default as default };
@@ -0,0 +1,70 @@
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { t as loadActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/admin/sales-report.ts
8
+ /**
9
+ * `xiaobao-cli admin sales-report` — 旺小宝公司经营数据(出库 / 回款)。
10
+ *
11
+ * super-admin 能力:按项目组(type 1,默认)或战区(type 2)返回指定日期区间的
12
+ * 出库金额(outStockAmount)与回款/入库金额(receiveAmount)。数据来自内网金蝶
13
+ * 报表,经 ai-open `POST /super-admin/sales-report` 代理;访问由独立白名单控制
14
+ * (空名单 = 全拒),不在名单会收到引导文案。
15
+ *
16
+ * 公司级数据:不要求激活项目(有激活项目则顺带传 tenant headers)。
17
+ */
18
+ var sales_report_default = defineCommand({
19
+ meta: {
20
+ name: "sales-report",
21
+ description: "公司经营数据:出库/回款金额,按 项目组(project) 或 战区(zone) 分组(独立白名单)"
22
+ },
23
+ args: {
24
+ from: {
25
+ type: "string",
26
+ required: true,
27
+ description: "开始日期 yyyy-MM-dd(闭区间)"
28
+ },
29
+ to: {
30
+ type: "string",
31
+ required: true,
32
+ description: "结束日期 yyyy-MM-dd(闭区间)"
33
+ },
34
+ by: {
35
+ type: "string",
36
+ default: "project",
37
+ description: "分组维度:project=项目组(type 1,默认) / zone=战区(type 2)"
38
+ },
39
+ "api-base": { type: "string" },
40
+ "auth-base": { type: "string" },
41
+ format: {
42
+ type: "string",
43
+ default: "toon"
44
+ }
45
+ },
46
+ async run({ args }) {
47
+ try {
48
+ const config = resolveConfig({
49
+ apiBase: args["api-base"],
50
+ authBase: args["auth-base"]
51
+ });
52
+ const by = String(args.by);
53
+ if (by !== "project" && by !== "zone") throw new Error(`--by 仅支持 project 或 zone,收到: ${by}`);
54
+ const active = await loadActiveProject();
55
+ writeResult(await xbApiFetch(config, "POST", "/ai-open/super-admin/sales-report", {
56
+ headers: active ? tenantProjectHeaders(active) : void 0,
57
+ body: {
58
+ startDate: args.from,
59
+ endDate: args.to,
60
+ type: by === "zone" ? 2 : 1
61
+ }
62
+ }), args.format);
63
+ } catch (err) {
64
+ writeError(err, args.format);
65
+ process.exit(1);
66
+ }
67
+ }
68
+ });
69
+ //#endregion
70
+ export { sales_report_default as default };
@@ -1,9 +1,9 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
6
- import { t as csvToArray } from "./util-CaPQBlNa.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { t as csvToArray } from "./util-pyTg7qwY.mjs";
7
7
  import { defineCommand } from "citty";
8
8
  //#region src/commands/kb/search.ts
9
9
  /**
@@ -1,9 +1,9 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
6
- import { r as toLocalDateTime } from "./util-CaPQBlNa.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { r as toLocalDateTime } from "./util-pyTg7qwY.mjs";
7
7
  import { defineCommand } from "citty";
8
8
  //#region src/commands/visit/summary.ts
9
9
  /**
@@ -1,8 +1,8 @@
1
- import { a as resolveConfig } from "./device-flow-D6JVcEap.mjs";
2
- import { t as xbApiFetch } from "./api-client-CDNjkArS.mjs";
3
- import { n as requireActiveProject } from "./project-store-CKVJa54T.mjs";
4
- import { t as tenantProjectHeaders } from "./headers-DSnR4sjk.mjs";
5
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { n as requireActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
6
  import { defineCommand } from "citty";
7
7
  //#region src/commands/audio/text.ts
8
8
  /**
@@ -0,0 +1,102 @@
1
+ import { a as resolveConfig } from "./device-flow-DC1kqcmR.mjs";
2
+ import { t as xbApiFetch } from "./api-client-ifJHc7hu.mjs";
3
+ import { t as loadActiveProject } from "./project-store-CudTRvbA.mjs";
4
+ import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
5
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/admin/token-usage.ts
8
+ /**
9
+ * `xiaobao-cli admin token-usage` — 旺小宝 LLM token 用量汇总。
10
+ *
11
+ * super-admin 能力:返回指定日期区间(闭区间)的输入 / 输出 / 总量 tokens,可按
12
+ * 模型、供应商、API Key、接入点、标签、状态过滤。数据来自内网 AI Portal,经
13
+ * ai-open `POST /super-admin/token-usage` 代理;访问由独立白名单控制(空名单 =
14
+ * 全拒),不在名单会收到引导文案。
15
+ *
16
+ * 公司级数据:不要求激活项目(有激活项目则顺带传 tenant headers)。
17
+ */
18
+ var token_usage_default = defineCommand({
19
+ meta: {
20
+ name: "token-usage",
21
+ description: "LLM token 用量:输入/输出/总量,可按模型/供应商/Key 过滤(独立白名单)"
22
+ },
23
+ args: {
24
+ from: {
25
+ type: "string",
26
+ required: true,
27
+ description: "开始日期 yyyy-MM-dd(闭区间)"
28
+ },
29
+ to: {
30
+ type: "string",
31
+ required: true,
32
+ description: "结束日期 yyyy-MM-dd(闭区间)"
33
+ },
34
+ model: {
35
+ type: "string",
36
+ description: "模型过滤,如 gpt-4.1-mini"
37
+ },
38
+ provider: {
39
+ type: "string",
40
+ description: "供应商过滤,如 openai"
41
+ },
42
+ upstream: {
43
+ type: "string",
44
+ description: "上游过滤"
45
+ },
46
+ "api-key": {
47
+ type: "string",
48
+ description: "API Key 过滤"
49
+ },
50
+ endpoint: {
51
+ type: "string",
52
+ description: "接入点过滤"
53
+ },
54
+ "tag-key": {
55
+ type: "string",
56
+ description: "标签 key"
57
+ },
58
+ "tag-value": {
59
+ type: "string",
60
+ description: "标签 value"
61
+ },
62
+ status: {
63
+ type: "string",
64
+ description: "状态过滤,如 error(只看失败请求)"
65
+ },
66
+ "api-base": { type: "string" },
67
+ "auth-base": { type: "string" },
68
+ format: {
69
+ type: "string",
70
+ default: "toon"
71
+ }
72
+ },
73
+ async run({ args }) {
74
+ try {
75
+ const config = resolveConfig({
76
+ apiBase: args["api-base"],
77
+ authBase: args["auth-base"]
78
+ });
79
+ const active = await loadActiveProject();
80
+ writeResult(await xbApiFetch(config, "POST", "/ai-open/super-admin/token-usage", {
81
+ headers: active ? tenantProjectHeaders(active) : void 0,
82
+ body: {
83
+ startDate: args.from,
84
+ endDate: args.to,
85
+ model: args.model,
86
+ provider: args.provider,
87
+ upstream: args.upstream,
88
+ apiKey: args["api-key"],
89
+ endpoint: args.endpoint,
90
+ tagKey: args["tag-key"],
91
+ tagValue: args["tag-value"],
92
+ status: args.status
93
+ }
94
+ }), args.format);
95
+ } catch (err) {
96
+ writeError(err, args.format);
97
+ process.exit(1);
98
+ }
99
+ }
100
+ });
101
+ //#endregion
102
+ export { token_usage_default as default };
@@ -1,5 +1,5 @@
1
- import { r as saveActiveProject } from "./project-store-CKVJa54T.mjs";
2
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { r as saveActiveProject } from "./project-store-CudTRvbA.mjs";
2
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/commands/project/use.ts
5
5
  /**
@@ -6,8 +6,8 @@ var visit_default = defineCommand({
6
6
  description: "客户来访分页查询 / 来访接待总结"
7
7
  },
8
8
  subCommands: {
9
- list: () => import("./list-DbReQZE2.mjs").then((m) => m.default),
10
- summary: () => import("./summary-CAm-WDNF.mjs").then((m) => m.default)
9
+ list: () => import("./list-BxWqQllQ2.mjs").then((m) => m.default),
10
+ summary: () => import("./summary-CfbHddby.mjs").then((m) => m.default)
11
11
  }
12
12
  });
13
13
  //#endregion
@@ -1,5 +1,5 @@
1
- import { i as decodeJwtPayload, s as readToken } from "./token-store-CXizLE2_.mjs";
2
- import { n as writeResult, t as writeError } from "./format-CvKe7-yU.mjs";
1
+ import { i as decodeJwtPayload, s as readToken } from "./token-store-BB7n-fwJ.mjs";
2
+ import { n as writeResult, t as writeError } from "./format-HWx3JWdS.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/commands/auth/whoami.ts
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puyinkai/xiaobao-cli",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "旺小宝 CLI — host-agnostic 业务数据 / 问数 / 来访总结 / 知识库 能力 (openclaw-xiaobao plugin 的 CLI 等价物)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: wangxiaobao-admin-sales-report
3
+ version: 0.1.0
4
+ description: "旺小宝公司经营数据查询(super-admin,独立白名单):按日期区间返回 出库金额(outStockAmount) 与 回款/入库金额(receiveAmount),按 项目组(--by project,默认) 或 战区(--by zone) 分组。只读。高频命令: xiaobao-cli admin sales-report --from <yyyy-MM-dd> --to <yyyy-MM-dd> [--by project|zone]。何时用:用户问 公司业绩/经营数据/出库/回款/入库金额/各项目组业绩/各战区业绩/业绩排名/某月做了多少。注:独立白名单控制(与其它命令的白名单无关),返回引导文案时原样告知用户并停止;不需要激活项目;两个维度出库合计存在口径差,汇报须注明口径。"
5
+ metadata:
6
+ requires:
7
+ bins: ["xiaobao-cli"]
8
+ cliHelp: "xiaobao-cli admin sales-report --help"
9
+ ---
10
+
11
+ # 旺小宝公司经营数据(出库 / 回款)
12
+
13
+ > **CRITICAL** —— 跑命令前 MUST 先用 Read tool 读取 [`../wangxiaobao-shared/SKILL.md`](../wangxiaobao-shared/SKILL.md)(登录 / 输出协议 / 错误码 等通用约定)。
14
+
15
+ `xiaobao-cli admin sales-report` 查询公司级经营数据(数据源:内网金蝶报表,经 ai-open 代理)。
16
+
17
+ ## 执行前必读
18
+ - **super-admin 能力,独立白名单**:与其它命令的白名单**互相独立**,且**名单为空 = 全拒**。若返回 `data: "不在白名单中,若有需求请联系19136123281"`,**原样告知用户并停止,不要重试**。
19
+ - 需要登录(token),**不需要激活项目**。
20
+ - 日期为**闭区间**(`--from 2026-07-01 --to 2026-07-31` 含首尾两天),格式 `yyyy-MM-dd`。
21
+ - 只读,不写文件。
22
+
23
+ ## 快速索引
24
+ | 用户意图 | 命令 |
25
+ | --- | --- |
26
+ | 某月各项目组业绩 | `admin sales-report --from 2026-07-01 --to 2026-07-31`(默认 --by project) |
27
+ | 某月各战区业绩 | `admin sales-report --from ... --to ... --by zone` |
28
+ | 两个维度都要 | 调两次(--by project + --by zone),并注意口径差(见下) |
29
+ | 时间说法(本月/上月/最近 7 天) | 换算成 from/to 再调 |
30
+
31
+ ## 核心约束与坑(来自实测)
32
+ 1. **出库 vs 回款口径**:`outStockAmount` = 出库,`receiveAmount` = 回款(入库)。
33
+ 2. **两个维度合计对不上是数据源特性不是 bug**:入库合计两维度一致,但**出库合计恒是项目组 > 战区**(每月差 0.4~3.6 万,部分出库单归得到项目组归不到战区)。**汇报公司总业绩必须注明口径**(建议用项目组口径)。
34
+ 3. **负数是正常的**:出库可为负(退货/红字冲销),如实呈现,不要过滤。
35
+ 4. **返回 0 不等于失败**:未来区间、无业务区间正常返回 0;先确认区间合理再下结论。
36
+ 5. **日期写反**:ai-open 已拦截(返回 400 "startDate 不能晚于 endDate"),不会再静默返回全 0。
37
+
38
+ ## 响应字段
39
+ ```jsonc
40
+ { "code": "0", "data": {
41
+ "totalReceiveAmount": 7546423.51, // 回款(入库)合计
42
+ "totalOutStockAmount": 7809705.90, // 出库合计
43
+ "data": [ // 按出库金额降序(接口原序)
44
+ { "name": "人脸识别项目组",
45
+ "values": { "receiveAmount": 4102679.69, "outStockAmount": 4176741.33 } }
46
+ ] } }
47
+ ```
48
+ CLI 再包一层 → 读 `resp.data.data.*`。展示时给出 名称 / 回款 / 出库 / 出库占比,负数保留。
49
+
50
+ ## 常见错误
51
+ - **`data` 是"不在白名单中…"文案** → 原样转告用户,停止(联系 19136123281 开通)。
52
+ - **401** → `auth login --no-wait --force` 重登。
53
+ - **400 日期问题** → 检查 yyyy-MM-dd 格式与 from<=to。
54
+ - **全 0** → 先确认区间是否合理(未来区间/无业务),不要报"接口挂了"。
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: wangxiaobao-admin-token-usage
3
+ version: 0.1.0
4
+ description: "旺小宝 LLM token 用量查询(super-admin,独立白名单):按日期区间返回 输入(promptTokens)/输出(completionTokens)/总量(totalTokens) tokens,可按 模型/供应商/API Key/接入点/标签/状态 过滤。只读。高频命令: xiaobao-cli admin token-usage --from <yyyy-MM-dd> --to <yyyy-MM-dd> [--model <m>] [--provider <p>]。何时用:用户问 token 用量/token 消耗/用了多少 token/AI 用量统计/某模型或某供应商的用量/成本核算输入数据。注:独立白名单控制,返回引导文案时原样告知并停止;不需要激活项目;数据从 2026-04 起;日期闭区间;按月对比=逐月调多次。"
5
+ metadata:
6
+ requires:
7
+ bins: ["xiaobao-cli"]
8
+ cliHelp: "xiaobao-cli admin token-usage --help"
9
+ ---
10
+
11
+ # 旺小宝 LLM Token 用量
12
+
13
+ > **CRITICAL** —— 跑命令前 MUST 先用 Read tool 读取 [`../wangxiaobao-shared/SKILL.md`](../wangxiaobao-shared/SKILL.md)(登录 / 输出协议 / 错误码 等通用约定)。
14
+
15
+ `xiaobao-cli admin token-usage` 查询公司级 LLM token 用量(数据源:内网 AI Portal,经 ai-open 代理)。
16
+
17
+ ## 执行前必读
18
+ - **super-admin 能力,独立白名单**:与其它命令的白名单**互相独立**,且**名单为空 = 全拒**。若返回 `data: "不在白名单中,若有需求请联系19136123281"`,**原样告知用户并停止,不要重试**。
19
+ - 需要登录(token),**不需要激活项目**。
20
+ - 日期为**闭区间**,格式 `yyyy-MM-dd`。
21
+ - 只读,不写文件。
22
+
23
+ ## 快速索引
24
+ | 用户意图 | 命令 |
25
+ | --- | --- |
26
+ | 某月总用量 | `admin token-usage --from 2026-07-01 --to 2026-07-31` |
27
+ | 只看某模型 / 供应商 | `--model gpt-4.1-mini` / `--provider openai` |
28
+ | 只看某 Key / 接入点 | `--api-key <KEY>` / `--endpoint <EP>` |
29
+ | 按标签 | `--tag-key team --tag-value ai` |
30
+ | 只看失败请求 | `--status error` |
31
+ | 按月对比 | 逐月调多次(每月一个 from/to),自己汇总 |
32
+
33
+ ## 核心约束与坑(来自实测)
34
+ 1. **数据从 2026-04 开始**:更早区间一律返回 0——那是没数据,不是查询出错。
35
+ 2. **闭区间**:`--from 2026-07-01 --to 2026-07-31` 含首尾两天。
36
+ 3. **当天数据仍在增长**:含今天的区间两次调用结果会有差异;做对账用截至昨天的区间。
37
+ 4. **接口返回整区间汇总,无分页**:要按月/按天拆分就按段多次调用(按天拆一年 = 300+ 次,不要这么干,按月拆)。
38
+ 5. 筛选条件可任意组合。
39
+
40
+ ## 响应字段
41
+ ```jsonc
42
+ { "code": "0", "data": {
43
+ "promptTokens": 296215003449, // 输入
44
+ "completionTokens": 34882240321, // 输出
45
+ "totalTokens": 331097243770 } } // 总量
46
+ ```
47
+ CLI 再包一层 → 读 `resp.data.data.*`。大数字建议换算(如 331.10 B)展示。
48
+
49
+ ## 常见错误
50
+ - **`data` 是"不在白名单中…"文案** → 原样转告用户,停止(联系 19136123281 开通)。
51
+ - **401** → `auth login --no-wait --force` 重登。
52
+ - **查 2026-04 之前区间得 0** → 说明"无数据",不要说成"没用量/接口挂了"。
53
+ - **含今天的区间数字对不上** → 正常,当天数据在涨;对账用截至昨天。
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: wangxiaobao-knowledge-base
3
3
  version: 0.1.0
4
- description: "旺小宝项目知识库:语义检索项目知识 chunk(kb search)、列文档(kb docs)、看文档详情(kb doc)、分页读文档正文(kb doc-content)。search/docs 按当前激活项目隔离;doc/doc-content 按 docId 直取。只读、无副作用。高频命令: xiaobao-cli kb search '<query>' [--k N]; xiaobao-cli kb docs [--title <kw>]; xiaobao-cli kb doc <doc-id>; xiaobao-cli kb doc-content <doc-id> [--offset N] [--limit N]。何时用:用户问项目资料/楼盘知识/销售政策/户型文档/物料/知识库里有没有讲过X/某文档具体写了啥/帮我查下资料。注:search 返回 chunk 不是全文,要逐段读全文用 doc-content 翻页(看 hasMore 续翻);k 默认 5 上限 20"
4
+ description: "旺小宝项目知识库:语义检索项目知识 chunk(kb search)、列文档(kb docs)、看文档详情(kb doc)、分页读文档正文(kb doc-content)。search/docs 按当前激活项目隔离;doc/doc-content 按 docId 直取。只读、无副作用。高频命令: xiaobao-cli kb search '<query>' [--k N]; xiaobao-cli kb docs [--title <kw>]; xiaobao-cli kb doc <doc-id>; xiaobao-cli kb doc-content <doc-id> [--offset N] [--limit N]。何时用:用户问项目资料/楼盘知识/销售政策/户型文档/物料/知识库里有没有讲过X/某文档具体写了啥/帮我查下资料。注:search 返回 chunk 不是全文,要逐段读全文用 doc-content 翻页(看 hasMore 续翻);k 默认 5 上限 20;要业务数据问数走 quick-qa,不是这里。"
5
5
  metadata:
6
6
  requires:
7
7
  bins: ["xiaobao-cli"]
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: wangxiaobao-quantum-stats
3
+ version: 0.1.0
4
+ description: "旺小宝量子看板 / 预聚合 KPI 统计:来访/跟进/成交/意向/工作表现/接访时长/使用数据/抗性点/话术卖点/挖需/销售热词/风控/特殊来访/月报/销讲执行率/挖需执行率/说辞 等 20 类指标,按 项目/团队/顾问/时间 多视图下钻。只读、无副作用。高频命令: xiaobao-cli quantum <metric> [--view <v>] [--from <d>] [--to <d>] [--team-id <id>] [--visit-type first|second|third_more|special]。何时用:用户问 今天/本周来访多少组、来访排名、各团队来访/成交/意向对比、销冠成交、意向A级分布、录音覆盖率/盘客率、平均接待时长、销讲执行率、挖需率、风控触发次数、销售热词、月报 等 看板/KPI/排名/占比/团队对比 类问题。注:指标多、每个支持的 view 不同,跑前先读 references/quantum-metrics.md;跨指标坑:特殊到访组数用 `quantum visit --visit-type special`(不是 special-visit)、团队均值 MUST `--view team` 禁手算。要问一句话开放式业务问题走 wangxiaobao-quick-qa。"
5
+ metadata:
6
+ requires:
7
+ bins: ["xiaobao-cli"]
8
+ cliHelp: "xiaobao-cli quantum --help"
9
+ ---
10
+
11
+ # 旺小宝量子统计(量子看板 / 预聚合 KPI)
12
+
13
+ > **CRITICAL** —— 跑命令前 MUST 先用 Read tool 读取 [`../wangxiaobao-shared/SKILL.md`](../wangxiaobao-shared/SKILL.md)(安装 / 登录 / 选项目 / 错误码 / 输出协议)。
14
+ > **强烈建议** 再读 [`references/quantum-metrics.md`](references/quantum-metrics.md) —— 20 个指标各支持哪些 view/mode、需要哪些参数都在那里;跑前对照选对 `metric + view`,避免选错卡片或漏必填参数。
15
+
16
+ `xiaobao-cli quantum <metric> [--view ...]` 一个命令覆盖全部量子指标(对应 H5 量子看板各卡片)。它们**共用一套入参**,靠 `--view` / `--mode` 区分子视图。
17
+
18
+ ## 执行前必读
19
+ - 有效 token + **激活项目**(见 shared;缺失返回 `NO_ACTIVE_PROJECT`)
20
+ - **数据权限**:不传 `--user-ids` 时后端按当前用户的 管理者/个人 范围自动解析
21
+ - **时间**默认当天 `00:00:00 ~ 次日 00:00:00`;跨天/周/月用 `--from/--to` + `--date-type`
22
+ - 只读、**不要**写文件
23
+
24
+ ## 快速索引:用户意图 → metric + view
25
+ | 用户问法 | 命令 |
26
+ | --- | --- |
27
+ | 今天/本周来访多少组、来访趋势 | `quantum visit`(`--view summary` / `time`) |
28
+ | 来访排名 / 各顾问来访 | `quantum visit --view rank`(或 `team`) |
29
+ | 首访/复访/三访+/特殊到访 组数 | `quantum visit --visit-type first\|second\|third_more\|special` |
30
+ | 各团队 来访/成交/意向 对比 | `quantum <visit\|deal\|intent> --view team` |
31
+ | 成交统计 / 销冠 | `quantum deal`(`--view status/user/team/period`) |
32
+ | 意向级别分布 / A 级客户 | `quantum intent --view level`(或 `user` + `--intent-level A`) |
33
+ | 录音覆盖率 / 盘客率 | `quantum job-performance`(`--view audio_rate/panke_rate/team`) |
34
+ | 平均接待时长 / 服务分 | `quantum work-quality --view team`(团队均值禁手算) |
35
+ | 接访时长分桶下钻 | `quantum visit-timer`(team/date 须 `--interval-start/--interval-end`) |
36
+ | 销讲执行率 | `quantum pin-talk`(`--view summary/team/user/...`) |
37
+ | 挖需执行率 / 团队最高挖需率 | `quantum demand-card`(团队最高用 `--view team`) |
38
+ | 风控触发 | `quantum risk`(`--risk-dimension all/effective`) |
39
+ | 销售热词 | `quantum hot-words` |
40
+ | 月报 | `quantum month-report --mode query` |
41
+
42
+ (完整 20 指标 + 各 view/参数见 [`references/quantum-metrics.md`](references/quantum-metrics.md))
43
+
44
+ ## 核心约束(跨指标坑,务必遵守)
45
+ 1. **特殊到访组数/排名** 用 `quantum visit --visit-type special`,**不是** `quantum special-visit`(后者是「有效/无效标签卡」,语义不同)。
46
+ 2. **团队均值类**(某团队平均接待时长 / 服务分 / 挖需率 / 成交率…)**MUST 用 `--view team`**,禁止取 `user` 视图自己手算平均。
47
+ 3. **团队最高挖需率** → `quantum demand-card --view team`。
48
+ 4. **首访/复访/三访+** → `--visit-type first|second|third_more`(不传 ≠ 已选某 Tab,可能混合或未过滤)。
49
+ 5. **客户数维度** → `--stat-dimension customer_num`(来访默认 `visit_times`、跟进默认 `follow_times`;别一看到「客户数」就误用)。
50
+ 6. **意向复核后数据** → `--intent-dimension review`(默认 `ai`)。
51
+ 7. **visit-timer 的 team/date 下钻** → 必填 `--interval-start/--interval-end`(分桶:0/30/60/120 → 30/60/120/1000 分钟)。
52
+
53
+ ## 响应
54
+ 统一 `Result<Object>`,`data` 结构**随 metric/view 变化**(列表 / 嵌套 / 汇总都可能)。CLI 再包一层 → 读 `resp.data.data`。**按实际返回展示,不要假设固定结构、不要硬解析**。默认 `--format toon` 省 token;要严格 JSON 加 `--format json`。
55
+
56
+ ## 使用场景示例
57
+ ```bash
58
+ # 今天各顾问来访排名(首访)
59
+ xiaobao-cli quantum visit --view rank --visit-type first
60
+ # 各团队成交对比
61
+ xiaobao-cli quantum deal --view team
62
+ # 意向 A 级客户按顾问
63
+ xiaobao-cli quantum intent --view user --intent-level A --intent-dimension review
64
+ # 本周录音覆盖率(各团队)
65
+ xiaobao-cli quantum job-performance --view team --from "2026-06-09 00:00:00" --to "2026-06-16 00:00:00" --date-type week
66
+ # 接访时长 30~60 分钟档 各团队
67
+ xiaobao-cli quantum visit-timer --view team --interval-start 30 --interval-end 60
68
+ ```
69
+
70
+ ## 常见错误与排查
71
+ - **`NO_ACTIVE_PROJECT`** → 跑 `wangxiaobao-switch-project`
72
+ - **401 / token 过期** → `auth login --no-wait --force` 重登
73
+ - **400 / 缺参数**(如 visit-timer team 缺 interval、intent team 缺 intent-level)→ 对照 references 补齐必填
74
+ - **未知 metric(404)** → 端点名拼错,照 references 的 metric 列表
75
+ - **空数据** → 时间窗内无数据,或当前账号无该范围权限(不是 bug)
76
+ - **该用开放式问数** → 一句话业务问题(「客户主要疑虑是啥」)走 `wangxiaobao-quick-qa`,量子是结构化看板 KPI
@@ -0,0 +1,43 @@
1
+ # 量子统计指标清单(quantum-metrics)
2
+
3
+ `xiaobao-cli quantum <metric> [flags]` → `POST /ai-open/quantum/<metric>`。20 个 metric **共用同一套入参**,靠 `--view` / `--mode` 区分子视图,统一返回 `Result<Object>`(结构随 metric/view 变)。默认时间 = 当天。
4
+
5
+ ## 共享参数
6
+ - `--from` / `--to`:`yyyy-MM-dd HH:mm:ss`,默认当天 `00:00:00 ~ 次日`
7
+ - `--date-type`:`day|week|month|year|total`(默认 day)
8
+ - `--user-ids`:CSV 显式数据范围;不传按 管理者/个人 自动解析
9
+ - `--team-id`:团队 ID(部分 metric 的 scope)
10
+ - `--page` / `--size`:分页(默认 1 / 20)
11
+ - `--visit-type`:`first|second|third_more|special|all`(来访维度 Tab)
12
+
13
+ ## 20 个指标
14
+ | metric | 说明 | view / mode | 关键参数 |
15
+ | --- | --- | --- | --- |
16
+ | `visit` | 来访统计 | view: `summary`(默认)`\|rank\|team\|time` | `--stat-dimension visit_times`(默认)`\|customer_num`;`--visit-type first\|second\|third_more\|special` |
17
+ | `visit-ongoing` | 接待中接访 | mode: `page`(默认)`\|count` | — |
18
+ | `visit-realtime` | 实时看板 | view: `trend`(默认)`\|resistance\|resistance_list\|deal` | — |
19
+ | `follow` | 跟进统计 | view: `summary\|rank\|team\|time` | `--stat-dimension follow_times`(默认)`\|customer_num`;`--visit-type` 同 visit |
20
+ | `job-performance` | 工作表现(录音/盘客率) | view: `summary\|panke_rate\|audio_rate\|rank\|user\|team\|time` | `team`=各团队录音/盘客率 |
21
+ | `work-quality` | 工作质量(接待时长/服务分) | view: `summary\|user\|team\|date` | 团队均值 **MUST** `view=team`(禁 user 手算) |
22
+ | `visit-timer` | 接访时长 | view: `summary\|team\|user\|date` | `--agg total`(默认)`\|avg`;`team/date` 须 `--interval-start/--interval-end`(分桶 0/30/60/120 → 30/60/120/1000);`summary`=全项目 4 分桶;`user`=逐顾问平均分钟 |
23
+ | `usage-data` | 使用数据 | view: `summary\|rank\|time\|team` | `--role consultant`(默认)`\|manager`(仅影响 summary 展示);`--usage-data-type daily_time_avg\|review_audio\|learning_times\|customer_comment\|share_audio\|audio_comment`(rank 指标) |
24
+ | `resistance-point` | 抗性点 | view: `distribution`(默认)`\|detail_texts\|detail_total` | — |
25
+ | `speech-sale` | 话术卖点 | view: `summary\|user` | — |
26
+ | `demand-data` | 挖需统计(DataStat) | view: `summary\|user` | — |
27
+ | `hot-words` | 销售热词 | view: `summary\|user\|dimensions` | — |
28
+ | `risk` | 风控 | view: `summary`(风控点列表)`\|user\|total`(触发总次数) | `--risk-dimension all`(默认)`\|effective\|review\|invalid`(仅有效= effective) |
29
+ | `special-visit` | 特殊来访标签卡(有效/无效 visitLabel 分布) | view: `summary\|user` | ⚠️ H5「特殊到访组数/排名」**不用这个**,用 `visit --visit-type special` |
30
+ | `month-report` | 月报 | mode: `query`(默认)`\|find` | — |
31
+ | `deal` | 成交统计 | view: `status`(默认)`\|team\|user\|period` | `team`=各团队 count/total/rate;`--deal-status` 默认 `1,2,3` |
32
+ | `intent` | 意向统计 | view: `level`(默认,全项目级别分布)`\|team\|user\|period` | `team/user/period` 须 `--intent-level A\|B\|C\|D\|E`;`--intent-dimension review\|ai`(默认 ai);`--direction left\|right`(period 翻页) |
33
+ | `pin-talk` | 销讲执行率 | view: `summary\|visit_status\|team\|user\|dimension\|speech\|models` | `--visit-type first\|second\|third_more`;`--model-id/--dimension-id/--speech-id` 下钻 |
34
+ | `demand-card` | 挖需执行率卡片 | view: `summary\|visit_status\|team\|user\|dimension\|speech` | `--visit-type first\|second\|third_more\|all`;团队最高挖需率用 `--view team` |
35
+ | `rhetoric` | 说辞统计 | 无 view(默认汇总) | — |
36
+
37
+ ## 跨指标坑(重复强调)
38
+ - 特殊到访组数/排名 → `visit --visit-type special`,不是 `special-visit`。
39
+ - 团队均值/占比(接待时长、服务分、挖需率、成交率、意向占比)→ 对应 metric 的 `--view team`,别手算。
40
+ - 团队最高挖需率 → `demand-card --view team`。
41
+ - 首访/复访/三访+ → `--visit-type first|second|third_more`。
42
+ - 「客户数」口径 → `--stat-dimension customer_num`(默认是 visit_times / follow_times)。
43
+ - 意向复核后 → `--intent-dimension review`(默认 ai)。
@@ -156,7 +156,7 @@ openclaw 的副本(保留 plugin session 完整性)。`auth logout` 例外
156
156
  ## 数据权限隔离
157
157
 
158
158
  `audio list` / `customer list` / `visit list` / `visit summary` / `focus list` /
159
- `resistance list` / `consultant list` / `qa` 所有业务命令的后端都按**当前登录用户的授权范围**过滤数据:
159
+ `resistance list` / `consultant list` / `qa` / `quantum` 所有业务命令的后端都按**当前登录用户的授权范围**过滤数据:
160
160
 
161
161
  - 普通顾问:只看自己名下
162
162
  - 团队长:看本团队
@@ -169,6 +169,11 @@ openclaw 的副本(保留 plugin session 完整性)。`auth logout` 例外
169
169
  返回该项目知识,不按顾问授权范围细分;`kb doc` / `kb doc-content` 按 docId 直取。
170
170
  知识库面向全项目,不存在"看不到别人名下"的概念。
171
171
 
172
+ **例外 —— `admin *`(super-admin 经营报表)**:`admin sales-report` / `admin token-usage`
173
+ 是**公司级**数据(经营出库/回款、LLM token 用量),**不需要激活项目**,且走**独立白名单**
174
+ (与上面按顾问授权的隔离无关;名单为空 = 全拒)。不在名单会收到
175
+ `data: "不在白名单中,若有需求请联系19136123281"` —— 原样转告用户并停止,不要重试。
176
+
172
177
  > 后端链路:上述命令统一经 `ai-open`(公网开放层 / 鉴权)代理到内网业务层
173
178
  > `wang-ai-mcp`,对调用方透明,命令用法不变。
174
179
 
File without changes