beautx-cli 1.0.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.
Files changed (44) hide show
  1. package/README.md +282 -0
  2. package/dist/analyze-D4-U3EMZ.mjs +67 -0
  3. package/dist/api-CLlWvZ6D.mjs +56 -0
  4. package/dist/audio-BVEMBKjq.mjs +15 -0
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.mjs +34 -0
  7. package/dist/config-JuoIzFRK.mjs +14 -0
  8. package/dist/consultant-Cw1YwwtS.mjs +11 -0
  9. package/dist/content-Yo_WIT7q.mjs +46 -0
  10. package/dist/current-Bxh7Kreq.mjs +24 -0
  11. package/dist/customer-ClOadzRU.mjs +11 -0
  12. package/dist/doc-Ct90pWPu.mjs +15 -0
  13. package/dist/env-callback-B0J77QAo.mjs +349 -0
  14. package/dist/env-vars-CXEHR_mk.mjs +231 -0
  15. package/dist/fields-k9uXoI1-.mjs +70 -0
  16. package/dist/focus-DjNe5aAC.mjs +11 -0
  17. package/dist/format-CUmIaybA.mjs +7253 -0
  18. package/dist/get-Bvvpjak0.mjs +32 -0
  19. package/dist/kb-O5-Jsef7.mjs +14 -0
  20. package/dist/list-BfwcxhuB.mjs +51 -0
  21. package/dist/list-BtTJth6J.mjs +82 -0
  22. package/dist/list-CQ0BANsf.mjs +72 -0
  23. package/dist/list-CjvUJxab.mjs +40 -0
  24. package/dist/list-D5PQ9UFX.mjs +64 -0
  25. package/dist/list-DHuUNbzL.mjs +57 -0
  26. package/dist/list-Du1j8C6e.mjs +67 -0
  27. package/dist/list-Dyo2l4T0.mjs +82 -0
  28. package/dist/list-LLKHw4PC.mjs +82 -0
  29. package/dist/mcp-args-CYOCdClW.mjs +31 -0
  30. package/dist/mcp-client-CiA9h1aX.mjs +260 -0
  31. package/dist/mcp-result-BIkVZJmx.mjs +62 -0
  32. package/dist/project-access-DsvRpcxJ.mjs +274 -0
  33. package/dist/project-i7Ff3qdR.mjs +15 -0
  34. package/dist/project-store-DXTSwGKR.mjs +55 -0
  35. package/dist/qa-BYv1cNLv.mjs +48 -0
  36. package/dist/resistance-TNgE3tbY.mjs +11 -0
  37. package/dist/rolldown-runtime-YLnNgb9a.mjs +35 -0
  38. package/dist/search-Cq5goTou.mjs +67 -0
  39. package/dist/summary-DPEcAZs9.mjs +74 -0
  40. package/dist/text-BcZKHHRe.mjs +39 -0
  41. package/dist/use-BUuilhDM.mjs +39 -0
  42. package/dist/util-CztO5pc3.mjs +46 -0
  43. package/dist/visit-nsou1UG-.mjs +14 -0
  44. package/package.json +44 -0
@@ -0,0 +1,32 @@
1
+ import { n as mcpCall } from "./mcp-client-CiA9h1aX.mjs";
2
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
3
+ import { n as writeMcpDataResult } from "./mcp-result-BIkVZJmx.mjs";
4
+ import { defineCommand } from "citty";
5
+ //#region src/commands/kb/doc/get.ts
6
+ /**
7
+ * `wangai-cli kb doc get <doc-id>` — document metadata via MCP.
8
+ */
9
+ var get_default = defineCommand({
10
+ meta: {
11
+ name: "get",
12
+ description: "知识库文档元数据"
13
+ },
14
+ args: {
15
+ docId: {
16
+ type: "positional",
17
+ required: true,
18
+ description: "文档 ID(MCP doc_id)"
19
+ },
20
+ format: formatCliArg
21
+ },
22
+ async run({ args }) {
23
+ try {
24
+ writeMcpDataResult(await mcpCall("kb-doc-get", { arguments: { doc_id: String(args.docId) } }), args.format);
25
+ } catch (err) {
26
+ writeError(err, args.format);
27
+ process.exit(1);
28
+ }
29
+ }
30
+ });
31
+ //#endregion
32
+ export { get_default as default };
@@ -0,0 +1,14 @@
1
+ import { defineCommand } from "citty";
2
+ //#region src/commands/kb/index.ts
3
+ var kb_default = defineCommand({
4
+ meta: {
5
+ name: "kb",
6
+ description: "知识库检索与文档查询"
7
+ },
8
+ subCommands: {
9
+ search: () => import("./search-Cq5goTou.mjs").then((m) => m.default),
10
+ doc: () => import("./doc-Ct90pWPu.mjs").then((m) => m.default)
11
+ }
12
+ });
13
+ //#endregion
14
+ export { kb_default as default };
@@ -0,0 +1,51 @@
1
+ import { n as mcpCall } from "./mcp-client-CiA9h1aX.mjs";
2
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
3
+ import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CYOCdClW.mjs";
4
+ import { n as writeMcpDataResult } from "./mcp-result-BIkVZJmx.mjs";
5
+ import { i as requireActiveProject } from "./project-store-DXTSwGKR.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/consultant/list.ts
8
+ /**
9
+ * `wangai-cli consultant list` — list consultants via MCP gateway.
10
+ */
11
+ var list_default = defineCommand({
12
+ meta: {
13
+ name: "list",
14
+ description: "查询有权限的置业顾问列表(按当前激活楼盘)"
15
+ },
16
+ args: {
17
+ ...projectIdCliArg,
18
+ page: {
19
+ type: "string",
20
+ default: "1",
21
+ description: "页码(MCP schema;当前后端返回全量列表)"
22
+ },
23
+ size: {
24
+ type: "string",
25
+ default: "20",
26
+ description: "每页条数(MCP schema)"
27
+ },
28
+ format: formatCliArg
29
+ },
30
+ async run({ args }) {
31
+ try {
32
+ const active = await requireActiveProject();
33
+ writeMcpDataResult(await mcpCall("consultant-list", { arguments: {
34
+ project_id: resolveProjectId(args["project-id"], active),
35
+ page: Number(args.page),
36
+ size: Number(args.size)
37
+ } }), args.format, (data) => {
38
+ const list = Array.isArray(data) ? data : [];
39
+ return {
40
+ consultants: list,
41
+ count: list.length
42
+ };
43
+ });
44
+ } catch (err) {
45
+ writeError(err, args.format);
46
+ process.exit(1);
47
+ }
48
+ }
49
+ });
50
+ //#endregion
51
+ export { list_default as default };
@@ -0,0 +1,82 @@
1
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
2
+ import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CYOCdClW.mjs";
3
+ import { t as mcpCallPage } from "./mcp-result-BIkVZJmx.mjs";
4
+ import { i as requireActiveProject } from "./project-store-DXTSwGKR.mjs";
5
+ import { r as toLocalDateTime, t as csvToArray } from "./util-CztO5pc3.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/focus/list.ts
8
+ /**
9
+ * `wangai-cli focus list` — page customer 关注点 tags via MCP gateway.
10
+ */
11
+ var list_default = defineCommand({
12
+ meta: {
13
+ name: "list",
14
+ description: "客户关注点标签分页查询(visit_time DESC)"
15
+ },
16
+ args: {
17
+ ...projectIdCliArg,
18
+ "visit-ids": {
19
+ type: "string",
20
+ description: "CSV → MCP visit_ids"
21
+ },
22
+ "audio-ids": {
23
+ type: "string",
24
+ description: "CSV → MCP audio_ids"
25
+ },
26
+ "wang-id": {
27
+ type: "string",
28
+ description: "客户 wang_id"
29
+ },
30
+ category: {
31
+ type: "string",
32
+ description: "一级分类 LIKE"
33
+ },
34
+ classification: {
35
+ type: "string",
36
+ description: "二级分类 LIKE"
37
+ },
38
+ from: {
39
+ type: "string",
40
+ description: "来访时间下限(MCP from)"
41
+ },
42
+ to: {
43
+ type: "string",
44
+ description: "来访时间上限(MCP to)"
45
+ },
46
+ page: {
47
+ type: "string",
48
+ default: "1"
49
+ },
50
+ size: {
51
+ type: "string",
52
+ default: "10"
53
+ },
54
+ format: formatCliArg
55
+ },
56
+ async run({ args }) {
57
+ try {
58
+ const active = await requireActiveProject();
59
+ await mcpCallPage("focus-list", {
60
+ project_id: resolveProjectId(args["project-id"], active),
61
+ visit_ids: csvToArray(args["visit-ids"]),
62
+ audio_ids: csvToArray(args["audio-ids"]),
63
+ wang_id: args["wang-id"],
64
+ category: args.category,
65
+ classification: args.classification,
66
+ from: toLocalDateTime(args.from),
67
+ to: toLocalDateTime(args.to),
68
+ page: Number(args.page),
69
+ size: Number(args.size)
70
+ }, args.format, {
71
+ itemsKey: "focusTags",
72
+ defaultPage: Number(args.page),
73
+ defaultSize: Number(args.size)
74
+ });
75
+ } catch (err) {
76
+ writeError(err, args.format);
77
+ process.exit(1);
78
+ }
79
+ }
80
+ });
81
+ //#endregion
82
+ export { list_default as default };
@@ -0,0 +1,72 @@
1
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
2
+ import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CYOCdClW.mjs";
3
+ import { t as mcpCallPage } from "./mcp-result-BIkVZJmx.mjs";
4
+ import { i as requireActiveProject } from "./project-store-DXTSwGKR.mjs";
5
+ import { n as mergeUserIds, r as toLocalDateTime, t as csvToArray } from "./util-CztO5pc3.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/audio/list.ts
8
+ /**
9
+ * `wangai-cli audio list` — page audio metadata via MCP gateway.
10
+ */
11
+ var list_default = defineCommand({
12
+ meta: {
13
+ name: "list",
14
+ description: "录音元数据分页查询(按时间范围 + 可选顾问过滤)"
15
+ },
16
+ args: {
17
+ ...projectIdCliArg,
18
+ from: {
19
+ type: "string",
20
+ required: true,
21
+ description: "录音开始时间下限(MCP from),yyyy-MM-dd HH:mm:ss"
22
+ },
23
+ to: {
24
+ type: "string",
25
+ required: true,
26
+ description: "录音结束时间上限(MCP to),同 from 格式"
27
+ },
28
+ "user-id": {
29
+ type: "string",
30
+ description: "单顾问 user-id 过滤(MCP userIdList)"
31
+ },
32
+ "user-id-list": {
33
+ type: "string",
34
+ description: "CSV: u1,u2,u3 多顾问"
35
+ },
36
+ page: {
37
+ type: "string",
38
+ default: "1",
39
+ description: "页码(MCP page)"
40
+ },
41
+ size: {
42
+ type: "string",
43
+ default: "10",
44
+ description: "每页条数(MCP size)"
45
+ },
46
+ format: formatCliArg
47
+ },
48
+ async run({ args }) {
49
+ try {
50
+ const active = await requireActiveProject();
51
+ const mergedUserIds = mergeUserIds(args["user-id"], csvToArray(args["user-id-list"]));
52
+ const toolArgs = {
53
+ project_id: resolveProjectId(args["project-id"], active),
54
+ from: toLocalDateTime(args.from),
55
+ to: toLocalDateTime(args.to),
56
+ page: Number(args.page),
57
+ size: Number(args.size)
58
+ };
59
+ if (mergedUserIds) toolArgs.user_id_list = mergedUserIds;
60
+ await mcpCallPage("audio-list", toolArgs, args.format, {
61
+ itemsKey: "audios",
62
+ defaultPage: Number(args.page),
63
+ defaultSize: Number(args.size)
64
+ });
65
+ } catch (err) {
66
+ writeError(err, args.format);
67
+ process.exit(1);
68
+ }
69
+ }
70
+ });
71
+ //#endregion
72
+ export { list_default as default };
@@ -0,0 +1,40 @@
1
+ import { n as mcpCall } from "./mcp-client-CiA9h1aX.mjs";
2
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
3
+ import { i as tenantIdCliArg, n as resolveProjectId, r as resolveTenantId, t as projectIdCliArg } from "./mcp-args-CYOCdClW.mjs";
4
+ import { n as writeMcpDataResult } from "./mcp-result-BIkVZJmx.mjs";
5
+ import { i as requireActiveProject } from "./project-store-DXTSwGKR.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/kb/doc/list.ts
8
+ /**
9
+ * `wangai-cli kb doc list` — list knowledge-base documents for active tenant+project.
10
+ */
11
+ var list_default = defineCommand({
12
+ meta: {
13
+ name: "list",
14
+ description: "知识库文档列表(tenant_id + project_id 必填)"
15
+ },
16
+ args: {
17
+ ...tenantIdCliArg,
18
+ ...projectIdCliArg,
19
+ title: {
20
+ type: "string",
21
+ description: "标题关键字(可选)"
22
+ },
23
+ format: formatCliArg
24
+ },
25
+ async run({ args }) {
26
+ try {
27
+ const active = await requireActiveProject();
28
+ writeMcpDataResult(await mcpCall("kb-doc-list", { arguments: {
29
+ tenant_id: resolveTenantId(args["tenant-id"], active),
30
+ project_id: resolveProjectId(args["project-id"], active),
31
+ title: args.title
32
+ } }), args.format);
33
+ } catch (err) {
34
+ writeError(err, args.format);
35
+ process.exit(1);
36
+ }
37
+ }
38
+ });
39
+ //#endregion
40
+ export { list_default as default };
@@ -0,0 +1,64 @@
1
+ import { c as readCredentials, d as resolveEndpoints, i as isEnvInjectedByHost, l as readEnv, r as credentialStatus, t as ENV_KEYS } from "./env-vars-CXEHR_mk.mjs";
2
+ import { a as debugLogPath, o as isVerboseDebugEnabled } from "./env-callback-B0J77QAo.mjs";
3
+ import { n as writeError, r as writeResult, t as formatCliArg } from "./format-CUmIaybA.mjs";
4
+ import { n as isProjectSwitchAllowed, r as loadActiveProject } from "./project-store-DXTSwGKR.mjs";
5
+ import { defineCommand } from "citty";
6
+ //#region src/commands/config/list.ts
7
+ /**
8
+ * `wangai-cli config list` — agent-facing env diagnostics (secrets redacted).
9
+ */
10
+ var list_default = defineCommand({
11
+ meta: {
12
+ name: "list",
13
+ description: "列出当前配置(脱敏,含凭据过期时间)"
14
+ },
15
+ args: { format: formatCliArg },
16
+ async run({ args }) {
17
+ try {
18
+ const endpoints = resolveEndpoints();
19
+ const creds = readCredentials();
20
+ const accessView = credentialStatus(creds);
21
+ const refreshConfigured = Boolean(creds.refreshToken);
22
+ const active = await loadActiveProject();
23
+ writeResult({
24
+ env: endpoints.env,
25
+ deploymentEnvManagedByHost: true,
26
+ envInjectedByHost: isEnvInjectedByHost(),
27
+ projectUseAllowed: isProjectSwitchAllowed(),
28
+ gatewayUrl: endpoints.gatewayUrl,
29
+ authUrl: endpoints.authUrl,
30
+ callbackBaseUrl: endpoints.callbackBaseUrl,
31
+ urlProfileSource: "src/core/endpoints.ts",
32
+ configSource: "environment",
33
+ credentialsManagedBy: "host",
34
+ credentials: {
35
+ accessToken: accessView,
36
+ refreshToken: { configured: refreshConfigured }
37
+ },
38
+ user: {
39
+ userId: readEnv(ENV_KEYS.USER_ID) || null,
40
+ userName: readEnv(ENV_KEYS.USER_NAME) || null
41
+ },
42
+ activeProject: active ? {
43
+ configured: true,
44
+ tenantId: active.tenantId,
45
+ tenantName: active.tenantName,
46
+ projectId: active.projectId,
47
+ projectName: active.projectName,
48
+ source: active.source
49
+ } : { configured: false },
50
+ xbAppId: readEnv(ENV_KEYS.XB_APP_ID) || null,
51
+ debugLog: {
52
+ path: debugLogPath(),
53
+ errorsAlwaysLogged: true,
54
+ verboseTracing: isVerboseDebugEnabled()
55
+ }
56
+ }, args.format);
57
+ } catch (err) {
58
+ writeError(err, args.format);
59
+ process.exit(1);
60
+ }
61
+ }
62
+ });
63
+ //#endregion
64
+ export { list_default as default };
@@ -0,0 +1,57 @@
1
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
2
+ import { t as mcpCallPage } from "./mcp-result-BIkVZJmx.mjs";
3
+ import { defineCommand } from "citty";
4
+ //#region src/commands/project/list.ts
5
+ /**
6
+ * `wangai-cli project list` — tenant + project roster via MCP gateway.
7
+ */
8
+ var list_default = defineCommand({
9
+ meta: {
10
+ name: "list",
11
+ description: "列出当前租户下有权限的项目(分页,含行业)"
12
+ },
13
+ args: {
14
+ keyword: {
15
+ type: "string",
16
+ description: "租户名/项目名包含模糊过滤(大小写不敏感,仅过滤当前页)"
17
+ },
18
+ page: {
19
+ type: "string",
20
+ default: "1"
21
+ },
22
+ size: {
23
+ type: "string",
24
+ default: "20"
25
+ },
26
+ format: formatCliArg
27
+ },
28
+ async run({ args }) {
29
+ try {
30
+ const kw = args.keyword?.trim().toLowerCase();
31
+ await mcpCallPage("project-list", {
32
+ page: Number(args.page),
33
+ size: Number(args.size)
34
+ }, args.format, {
35
+ itemsKey: "projects",
36
+ defaultPage: Number(args.page),
37
+ defaultSize: Number(args.size),
38
+ mapItems: (rows) => {
39
+ const flat = rows.map((row) => ({
40
+ tenantId: String(row.tenantId ?? ""),
41
+ tenantName: row.tenantName ?? "",
42
+ projectId: String(row.estateId ?? ""),
43
+ projectName: row.estateName ?? "",
44
+ industry: row.industry ?? ""
45
+ }));
46
+ if (!kw) return flat;
47
+ return flat.filter((e) => e.projectName.toLowerCase().includes(kw) || e.tenantName.toLowerCase().includes(kw));
48
+ }
49
+ });
50
+ } catch (err) {
51
+ writeError(err, args.format);
52
+ process.exit(1);
53
+ }
54
+ }
55
+ });
56
+ //#endregion
57
+ export { list_default as default };
@@ -0,0 +1,67 @@
1
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
2
+ import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CYOCdClW.mjs";
3
+ import { t as mcpCallPage } from "./mcp-result-BIkVZJmx.mjs";
4
+ import { i as requireActiveProject } from "./project-store-DXTSwGKR.mjs";
5
+ import { r as toLocalDateTime } from "./util-CztO5pc3.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/visit/list.ts
8
+ /**
9
+ * `wangai-cli visit list` — page customer visits via MCP gateway.
10
+ */
11
+ var list_default = defineCommand({
12
+ meta: {
13
+ name: "list",
14
+ description: "客户来访分页查询(每条已含 audios 录音列表)"
15
+ },
16
+ args: {
17
+ ...projectIdCliArg,
18
+ "customer-id": {
19
+ type: "string",
20
+ description: "客户 wang_id(MCP customerId)"
21
+ },
22
+ "customer-name": {
23
+ type: "string",
24
+ description: "客户姓名 LIKE(MCP customerName)"
25
+ },
26
+ from: {
27
+ type: "string",
28
+ description: "来访时间下限(MCP from)"
29
+ },
30
+ to: {
31
+ type: "string",
32
+ description: "来访时间上限(MCP to)"
33
+ },
34
+ page: {
35
+ type: "string",
36
+ default: "1"
37
+ },
38
+ size: {
39
+ type: "string",
40
+ default: "10"
41
+ },
42
+ format: formatCliArg
43
+ },
44
+ async run({ args }) {
45
+ try {
46
+ const active = await requireActiveProject();
47
+ await mcpCallPage("visit-list", {
48
+ project_id: resolveProjectId(args["project-id"], active),
49
+ customer_id: args["customer-id"],
50
+ customer_name: args["customer-name"],
51
+ from: toLocalDateTime(args.from),
52
+ to: toLocalDateTime(args.to),
53
+ page: Number(args.page),
54
+ size: Number(args.size)
55
+ }, args.format, {
56
+ itemsKey: "visits",
57
+ defaultPage: Number(args.page),
58
+ defaultSize: Number(args.size)
59
+ });
60
+ } catch (err) {
61
+ writeError(err, args.format);
62
+ process.exit(1);
63
+ }
64
+ }
65
+ });
66
+ //#endregion
67
+ export { list_default as default };
@@ -0,0 +1,82 @@
1
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
2
+ import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CYOCdClW.mjs";
3
+ import { t as mcpCallPage } from "./mcp-result-BIkVZJmx.mjs";
4
+ import { i as requireActiveProject } from "./project-store-DXTSwGKR.mjs";
5
+ import { r as toLocalDateTime, t as csvToArray } from "./util-CztO5pc3.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/resistance/list.ts
8
+ /**
9
+ * `wangai-cli resistance list` — page customer 抗性点 tags via MCP gateway.
10
+ */
11
+ var list_default = defineCommand({
12
+ meta: {
13
+ name: "list",
14
+ description: "客户抗性点标签分页查询(visit_time DESC)"
15
+ },
16
+ args: {
17
+ ...projectIdCliArg,
18
+ "visit-ids": {
19
+ type: "string",
20
+ description: "CSV → MCP visit_ids"
21
+ },
22
+ "audio-ids": {
23
+ type: "string",
24
+ description: "CSV → MCP audio_ids"
25
+ },
26
+ "wang-id": {
27
+ type: "string",
28
+ description: "客户 wang_id"
29
+ },
30
+ category: {
31
+ type: "string",
32
+ description: "一级分类 LIKE"
33
+ },
34
+ classification: {
35
+ type: "string",
36
+ description: "二级分类 LIKE"
37
+ },
38
+ from: {
39
+ type: "string",
40
+ description: "来访时间下限(MCP from)"
41
+ },
42
+ to: {
43
+ type: "string",
44
+ description: "来访时间上限(MCP to)"
45
+ },
46
+ page: {
47
+ type: "string",
48
+ default: "1"
49
+ },
50
+ size: {
51
+ type: "string",
52
+ default: "10"
53
+ },
54
+ format: formatCliArg
55
+ },
56
+ async run({ args }) {
57
+ try {
58
+ const active = await requireActiveProject();
59
+ await mcpCallPage("resistance-list", {
60
+ project_id: resolveProjectId(args["project-id"], active),
61
+ visit_ids: csvToArray(args["visit-ids"]),
62
+ audio_ids: csvToArray(args["audio-ids"]),
63
+ wang_id: args["wang-id"],
64
+ category: args.category,
65
+ classification: args.classification,
66
+ from: toLocalDateTime(args.from),
67
+ to: toLocalDateTime(args.to),
68
+ page: Number(args.page),
69
+ size: Number(args.size)
70
+ }, args.format, {
71
+ itemsKey: "resistanceTags",
72
+ defaultPage: Number(args.page),
73
+ defaultSize: Number(args.size)
74
+ });
75
+ } catch (err) {
76
+ writeError(err, args.format);
77
+ process.exit(1);
78
+ }
79
+ }
80
+ });
81
+ //#endregion
82
+ export { list_default as default };
@@ -0,0 +1,82 @@
1
+ import { n as writeError, t as formatCliArg } from "./format-CUmIaybA.mjs";
2
+ import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-CYOCdClW.mjs";
3
+ import { t as mcpCallPage } from "./mcp-result-BIkVZJmx.mjs";
4
+ import { i as requireActiveProject } from "./project-store-DXTSwGKR.mjs";
5
+ import { r as toLocalDateTime } from "./util-CztO5pc3.mjs";
6
+ import { defineCommand } from "citty";
7
+ //#region src/commands/customer/list.ts
8
+ /**
9
+ * `wangai-cli customer list` — page customer profiles via MCP gateway.
10
+ */
11
+ var list_default = defineCommand({
12
+ meta: {
13
+ name: "list",
14
+ description: "客户画像分页查询(按顾问 / 客户名 / 画像 / 时间)"
15
+ },
16
+ args: {
17
+ ...projectIdCliArg,
18
+ "user-id": {
19
+ type: "string",
20
+ description: "置业顾问 userId"
21
+ },
22
+ "user-name": {
23
+ type: "string",
24
+ description: "置业顾问姓名 LIKE"
25
+ },
26
+ "customer-name": {
27
+ type: "string",
28
+ description: "客户姓名 LIKE"
29
+ },
30
+ "customer-phone": {
31
+ type: "string",
32
+ description: "客户手机号 LIKE"
33
+ },
34
+ portrait: {
35
+ type: "string",
36
+ description: "画像关键词 LIKE(dynamic_tags)"
37
+ },
38
+ from: {
39
+ type: "string",
40
+ description: "最后来访时间下限(MCP from)"
41
+ },
42
+ to: {
43
+ type: "string",
44
+ description: "最后来访时间上限(MCP to)"
45
+ },
46
+ page: {
47
+ type: "string",
48
+ default: "1"
49
+ },
50
+ size: {
51
+ type: "string",
52
+ default: "10"
53
+ },
54
+ format: formatCliArg
55
+ },
56
+ async run({ args }) {
57
+ try {
58
+ const active = await requireActiveProject();
59
+ await mcpCallPage("customer-list", {
60
+ project_id: resolveProjectId(args["project-id"], active),
61
+ user_id: args["user-id"],
62
+ user_name: args["user-name"],
63
+ customer_name: args["customer-name"],
64
+ customer_phone: args["customer-phone"],
65
+ portrait: args.portrait,
66
+ from: toLocalDateTime(args.from),
67
+ to: toLocalDateTime(args.to),
68
+ page: Number(args.page),
69
+ size: Number(args.size)
70
+ }, args.format, {
71
+ itemsKey: "customers",
72
+ defaultPage: Number(args.page),
73
+ defaultSize: Number(args.size)
74
+ });
75
+ } catch (err) {
76
+ writeError(err, args.format);
77
+ process.exit(1);
78
+ }
79
+ }
80
+ });
81
+ //#endregion
82
+ export { list_default as default };
@@ -0,0 +1,31 @@
1
+ import { l as readEnv, t as ENV_KEYS } from "./env-vars-CXEHR_mk.mjs";
2
+ //#region src/core/mcp-args.ts
3
+ /**
4
+ * Shared MCP argument helpers — align CLI flags with BFF tool schemas.
5
+ *
6
+ * Schemas are mirrored from wangai-mcp-bff {@code McpToolRegistry}; when BFF
7
+ * changes, update {@link MCP_TOOL_SCHEMAS} (future: fetch tools/list).
8
+ */
9
+ /** Optional override of active project (snake_case {@code project_id} in MCP body). */
10
+ const projectIdCliArg = { "project-id": {
11
+ type: "string",
12
+ description: "项目 ID(MCP 参数 project_id);默认取当前激活项目"
13
+ } };
14
+ /** Optional override of tenant (snake_case {@code tenant_id} in MCP body). */
15
+ const tenantIdCliArg = { "tenant-id": {
16
+ type: "string",
17
+ description: "租户 ID(MCP 参数 tenant_id);默认取 TENANT_ID 环境变量或激活项目"
18
+ } };
19
+ function resolveProjectId(cliProjectId, active) {
20
+ const id = cliProjectId?.trim();
21
+ return id && id.length > 0 ? id : active.projectId;
22
+ }
23
+ function resolveTenantId(cliTenantId, active) {
24
+ const id = cliTenantId?.trim();
25
+ if (id && id.length > 0) return id;
26
+ const fromEnv = readEnv(ENV_KEYS.TENANT_ID);
27
+ if (fromEnv) return fromEnv;
28
+ return active.tenantId;
29
+ }
30
+ //#endregion
31
+ export { tenantIdCliArg as i, resolveProjectId as n, resolveTenantId as r, projectIdCliArg as t };