@puyinkai/wow-xiaobao-cli 0.0.0-stage → 1.0.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.
- package/README.md +42 -2
- package/dist/add-Da4a88Dn.mjs +21 -0
- package/dist/admin-nr9IIF2K.mjs +14 -0
- package/dist/alerts-DjMCQESW.mjs +71 -0
- package/dist/analyze-BJATzFtI.mjs +67 -0
- package/dist/api-C1s2co2-.mjs +113 -0
- package/dist/audio-BYm3m77S.mjs +15 -0
- package/dist/auth-JZ34ksvF.mjs +14 -0
- package/dist/beautx-D5y2iytj.mjs +16 -0
- package/dist/call-BfT4uEa7.mjs +67 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +47 -0
- package/dist/config-DipFfMio.mjs +11 -0
- package/dist/config-DqUxKQ3m.mjs +131 -0
- package/dist/consultant-CJ0tH11c.mjs +11 -0
- package/dist/current-Di1OImPn.mjs +33 -0
- package/dist/customer-Bpfdfh0U.mjs +15 -0
- package/dist/date-C9LQUbfA.mjs +21 -0
- package/dist/deal-analysis-Q4GMijIy.mjs +10 -0
- package/dist/detail-Df2eLTSN.mjs +69 -0
- package/dist/detail-k-zGzX4n.mjs +71 -0
- package/dist/diff-DkyjJG49.mjs +21 -0
- package/dist/doc-content-DlRfFk_V.mjs +54 -0
- package/dist/doc-e7Hu-v3F.mjs +42 -0
- package/dist/docs-C2ukQfbY.mjs +41 -0
- package/dist/fields-CNQUQ3BI.mjs +49 -0
- package/dist/focus-BNA14pxJ.mjs +11 -0
- package/dist/follow-BYYbUVCh.mjs +15 -0
- package/dist/format-bDFUVuDQ.mjs +622 -0
- package/dist/get-ZFU7CjqO.mjs +61 -0
- package/dist/headers-Dy5gROBB.mjs +11 -0
- package/dist/intent-DF8cH6nw.mjs +63 -0
- package/dist/json-CXENUkN_.mjs +13 -0
- package/dist/kb-n84Hl0uL.mjs +16 -0
- package/dist/last-7-days-WPinYIJi.mjs +5 -0
- package/dist/list-BVk58WIy.mjs +30 -0
- package/dist/list-BwhH-ZlP.mjs +87 -0
- package/dist/list-CJx_zclT.mjs +68 -0
- package/dist/list-CL5W1jMc.mjs +75 -0
- package/dist/list-Cb2q7k36.mjs +36 -0
- package/dist/list-Cl0VBo_Z.mjs +71 -0
- package/dist/list-D27lkRNJ.mjs +86 -0
- package/dist/list-D7iMacYA.mjs +71 -0
- package/dist/list-DTiXpPZF.mjs +38 -0
- package/dist/list-Dv2BGPQa.mjs +71 -0
- package/dist/list-KTc5uu5P.mjs +86 -0
- package/dist/now-Rn6gT4Bn.mjs +9 -0
- package/dist/panke-_HDbr3xq.mjs +14 -0
- package/dist/plan-c3BW0aCB.mjs +10 -0
- package/dist/portrait-BopNLEQX.mjs +14 -0
- package/dist/portrait-tags-Dhwy6-6U.mjs +10 -0
- package/dist/project-CIOk-2wk.mjs +15 -0
- package/dist/project-store-B-2rqrgM.mjs +63 -0
- package/dist/qa-CxQZgKRF.mjs +59 -0
- package/dist/quantum-BSlMUFk6.mjs +178 -0
- package/dist/range-BsL08fkP.mjs +18 -0
- package/dist/resistance-CzbXP4Mj.mjs +11 -0
- package/dist/sales-report-BbNoueUk.mjs +65 -0
- package/dist/score-CVu51n3k.mjs +5 -0
- package/dist/score-yakz2AnG.mjs +5 -0
- package/dist/search-kLJrFOVI.mjs +70 -0
- package/dist/service-score-CiIxFGJ8.mjs +91 -0
- package/dist/shared-BCf9YDEa.mjs +11 -0
- package/dist/shared-COOwe14d.mjs +87 -0
- package/dist/shared-CdUFV4rc.mjs +277 -0
- package/dist/staff-DasX8vTs.mjs +14 -0
- package/dist/staff-client-B3hnEyNi.mjs +59 -0
- package/dist/status-BFJYeL2I.mjs +24 -0
- package/dist/subtract-wUG7Jzdu.mjs +21 -0
- package/dist/summary-Dgt4Wm5k.mjs +79 -0
- package/dist/summary-DtLL_XW3.mjs +60 -0
- package/dist/text-Dj9OFG5s.mjs +44 -0
- package/dist/this-month-BsrOeTBH.mjs +5 -0
- package/dist/this-week-tCzGJfrf.mjs +5 -0
- package/dist/today-Br-4_qMr.mjs +9 -0
- package/dist/today-CqrcQCGQ.mjs +5 -0
- package/dist/today-so-far-CSGFhwkN.mjs +5 -0
- package/dist/token-store-BGLVc825.mjs +33 -0
- package/dist/token-usage-BK5JIJKx.mjs +97 -0
- package/dist/tomorrow-DYhV_kGk.mjs +9 -0
- package/dist/use-89I-jHty.mjs +61 -0
- package/dist/util-BuoFIeLS.mjs +46 -0
- package/dist/visit-ChOnvK8M.mjs +16 -0
- package/dist/visit-evaluate-BnxsFnQc.mjs +9 -0
- package/dist/weekday-7aGLxWaZ.mjs +14 -0
- package/dist/whoami-Ci6-uJJd.mjs +51 -0
- package/dist/yesterday-BzT2U1_f.mjs +9 -0
- package/dist/yesterday-DgYoUKYd.mjs +5 -0
- package/package.json +35 -4
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { defineCommand } from "citty";
|
|
6
|
+
//#region src/commands/customer/intent.ts
|
|
7
|
+
/** 最新一次已完成 AI 判定的只读详情,客户 wangId 全程保留字符串。 */
|
|
8
|
+
var intent_default = defineCommand({
|
|
9
|
+
meta: {
|
|
10
|
+
name: "intent",
|
|
11
|
+
description: "客户最新 AI 意向等级、评分、理由、判定时间、跟进建议及触发数据源"
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
"customer-id": {
|
|
15
|
+
type: "string",
|
|
16
|
+
required: true,
|
|
17
|
+
description: "客户 wangId"
|
|
18
|
+
},
|
|
19
|
+
"api-base": { type: "string" },
|
|
20
|
+
format: {
|
|
21
|
+
type: "string",
|
|
22
|
+
default: "json"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
async run({ args }) {
|
|
26
|
+
try {
|
|
27
|
+
const id = args["customer-id"];
|
|
28
|
+
if (!/^[1-9]\d*$/.test(id) || BigInt(id) > 9223372036854775807n) {
|
|
29
|
+
writeError({
|
|
30
|
+
code: "BAD_ARGUMENT",
|
|
31
|
+
message: "customer-id 必须为有效正整数 wangId"
|
|
32
|
+
}, args.format);
|
|
33
|
+
process.exit(2);
|
|
34
|
+
}
|
|
35
|
+
const result = await xbApiFetch(resolveConfig({ apiBase: args["api-base"] }), "POST", "/ai-open/customers/intent", {
|
|
36
|
+
headers: tenantProjectHeaders(await requireActiveProject()),
|
|
37
|
+
body: { customerId: id }
|
|
38
|
+
});
|
|
39
|
+
const envelope = result.data;
|
|
40
|
+
if (!result.ok || !envelope || typeof envelope !== "object" || String(envelope.code) !== "0") throw {
|
|
41
|
+
code: "API_ERROR",
|
|
42
|
+
status: result.status,
|
|
43
|
+
message: envelope?.msg ?? "客户 AI 意向查询失败",
|
|
44
|
+
body: result.data
|
|
45
|
+
};
|
|
46
|
+
if (typeof envelope.data === "string") throw {
|
|
47
|
+
code: "ACCESS_DENIED",
|
|
48
|
+
message: envelope.data
|
|
49
|
+
};
|
|
50
|
+
const detail = envelope.data;
|
|
51
|
+
if (!detail || !["available", "not_analyzed"].includes(String(detail.status)) || detail.status === "available" && (!detail.latestAiResult || typeof detail.latestAiResult !== "object")) throw {
|
|
52
|
+
code: "API_ERROR",
|
|
53
|
+
message: "客户 AI 意向返回数据不完整"
|
|
54
|
+
};
|
|
55
|
+
writeResult(result, args.format);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
writeError(err, args.format);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
export { intent_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/core/json.ts
|
|
2
|
+
/**
|
|
3
|
+
* 保留 JSON 中超出安全整数范围的整数字面量;从原文取值,避免 Number 已经舍入或序列化改值。
|
|
4
|
+
* 小数、科学计数法和安全范围内的整数仍按数字处理。Node 22+ 提供 reviver context.source。
|
|
5
|
+
*/
|
|
6
|
+
function parseJsonPreservingIntegers(text) {
|
|
7
|
+
return JSON.parse(text, (_key, value, context) => {
|
|
8
|
+
if (typeof value === "number" && !Number.isSafeInteger(value) && context?.source && /^-?\d+$/.test(context.source)) return context.source;
|
|
9
|
+
return value;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { parseJsonPreservingIntegers as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
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-kLJrFOVI.mjs").then((m) => m.default),
|
|
10
|
+
docs: () => import("./docs-C2ukQfbY.mjs").then((m) => m.default),
|
|
11
|
+
doc: () => import("./doc-e7Hu-v3F.mjs").then((m) => m.default),
|
|
12
|
+
"doc-content": () => import("./doc-content-DlRfFk_V.mjs").then((m) => m.default)
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { kb_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { t as defineRangePresetCommand } from "./shared-BCf9YDEa.mjs";
|
|
2
|
+
//#region src/commands/date/range/last-7-days.ts
|
|
3
|
+
var last_7_days_default = defineRangePresetCommand("last-7-days", "最近 7 天(含今天):from=6 天前 00:00,to=明天 00:00");
|
|
4
|
+
//#endregion
|
|
5
|
+
export { last_7_days_default as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { n as fetchStaffTools } from "./staff-client-B3hnEyNi.mjs";
|
|
6
|
+
import { defineCommand } from "citty";
|
|
7
|
+
//#region src/commands/staff/list.ts
|
|
8
|
+
var list_default = defineCommand({
|
|
9
|
+
meta: {
|
|
10
|
+
name: "list",
|
|
11
|
+
description: "查看当前开放的员工工具"
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
"api-base": { type: "string" },
|
|
15
|
+
format: {
|
|
16
|
+
type: "string",
|
|
17
|
+
default: "json"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
async run({ args }) {
|
|
21
|
+
try {
|
|
22
|
+
writeResult({ tools: (await fetchStaffTools(resolveConfig({ apiBase: args["api-base"] }), tenantProjectHeaders(await requireActiveProject()))).filter((tool) => tool.name.startsWith("staff-")) }, args.format);
|
|
23
|
+
} catch (err) {
|
|
24
|
+
writeError(err, args.format);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { list_default as default };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { r as toLocalDateTime } from "./util-BuoFIeLS.mjs";
|
|
6
|
+
import { defineCommand } from "citty";
|
|
7
|
+
//#region src/commands/customer/list.ts
|
|
8
|
+
/**
|
|
9
|
+
* `wow-xiaobao customer list` — page customer profiles via
|
|
10
|
+
* POST /ai-open/customers/page.
|
|
11
|
+
*
|
|
12
|
+
* Mirrors openclaw-xiaobao xiaobao_list_customers. Filters: consultant id/name,
|
|
13
|
+
* customer name/phone (LIKE), portrait keyword (LIKE on dynamic_tags JSON),
|
|
14
|
+
* last-visit time range. Sorted by last_visit_time DESC.
|
|
15
|
+
*/
|
|
16
|
+
var list_default = defineCommand({
|
|
17
|
+
meta: {
|
|
18
|
+
name: "list",
|
|
19
|
+
description: "客户画像分页查询(按顾问 / 客户名 / 画像 / 时间)"
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
"user-id": {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "置业顾问 user-id 精确过滤"
|
|
25
|
+
},
|
|
26
|
+
"user-name": {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "置业顾问姓名 LIKE 模糊"
|
|
29
|
+
},
|
|
30
|
+
"customer-name": {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "客户姓名 LIKE 模糊"
|
|
33
|
+
},
|
|
34
|
+
"customer-phone": {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "客户手机号 LIKE 模糊(可能脱敏)"
|
|
37
|
+
},
|
|
38
|
+
portrait: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "画像关键词,在 dynamic_tags JSON 文本上 LIKE 模糊(如\"高意向\"/\"价格\")"
|
|
41
|
+
},
|
|
42
|
+
from: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "最后来访时间下限(含)"
|
|
45
|
+
},
|
|
46
|
+
to: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "最后来访时间上限(不含)"
|
|
49
|
+
},
|
|
50
|
+
page: {
|
|
51
|
+
type: "string",
|
|
52
|
+
default: "1"
|
|
53
|
+
},
|
|
54
|
+
size: {
|
|
55
|
+
type: "string",
|
|
56
|
+
default: "10"
|
|
57
|
+
},
|
|
58
|
+
"api-base": { type: "string" },
|
|
59
|
+
format: {
|
|
60
|
+
type: "string",
|
|
61
|
+
default: "toon"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
async run({ args }) {
|
|
65
|
+
try {
|
|
66
|
+
writeResult(await xbApiFetch(resolveConfig({ apiBase: args["api-base"] }), "POST", "/ai-open/customers/page", {
|
|
67
|
+
headers: tenantProjectHeaders(await requireActiveProject()),
|
|
68
|
+
body: {
|
|
69
|
+
userId: args["user-id"],
|
|
70
|
+
userName: args["user-name"],
|
|
71
|
+
customerName: args["customer-name"],
|
|
72
|
+
customerPhone: args["customer-phone"],
|
|
73
|
+
portrait: args.portrait,
|
|
74
|
+
fromDate: toLocalDateTime(args.from),
|
|
75
|
+
toDate: toLocalDateTime(args.to),
|
|
76
|
+
page: Number(args.page),
|
|
77
|
+
size: Number(args.size)
|
|
78
|
+
}
|
|
79
|
+
}), args.format);
|
|
80
|
+
} catch (err) {
|
|
81
|
+
writeError(err, args.format);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
|
+
export { list_default as default };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { defineCommand } from "citty";
|
|
6
|
+
//#region src/commands/panke/list.ts
|
|
7
|
+
/** 查询已有盘客数据,业务 ID 全程保留字符串。 */
|
|
8
|
+
var list_default = defineCommand({
|
|
9
|
+
meta: {
|
|
10
|
+
name: "list",
|
|
11
|
+
description: "客户盘客记录列表(普通 / 语音 / 查看,无分页)"
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
"customer-id": {
|
|
15
|
+
type: "string",
|
|
16
|
+
required: true,
|
|
17
|
+
description: "客户 wangId"
|
|
18
|
+
},
|
|
19
|
+
"visit-id": {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "按每条盘客实际关联的来访 ID 筛选"
|
|
22
|
+
},
|
|
23
|
+
"api-base": { type: "string" },
|
|
24
|
+
format: {
|
|
25
|
+
type: "string",
|
|
26
|
+
default: "json"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
async run({ args }) {
|
|
30
|
+
try {
|
|
31
|
+
if ([args["customer-id"], args["visit-id"]].filter((id) => id !== void 0).some((id) => !/^[1-9]\d*$/.test(id) || BigInt(id) > 9223372036854775807n)) {
|
|
32
|
+
writeError({
|
|
33
|
+
code: "BAD_ARGUMENT",
|
|
34
|
+
message: "ID 必须为有效的正整数,且不能超过 Java Long 范围"
|
|
35
|
+
}, args.format);
|
|
36
|
+
process.exit(2);
|
|
37
|
+
}
|
|
38
|
+
const result = await xbApiFetch(resolveConfig({ apiBase: args["api-base"] }), "POST", "/ai-open/panke/list", {
|
|
39
|
+
headers: tenantProjectHeaders(await requireActiveProject()),
|
|
40
|
+
body: {
|
|
41
|
+
customerId: args["customer-id"],
|
|
42
|
+
visitId: args["visit-id"]
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const envelope = result.data;
|
|
46
|
+
if (!result.ok || !envelope || typeof envelope !== "object" || String(envelope.code) !== "0") throw {
|
|
47
|
+
code: "API_ERROR",
|
|
48
|
+
status: result.status,
|
|
49
|
+
message: envelope?.msg ?? "盘客查询失败",
|
|
50
|
+
body: result.data
|
|
51
|
+
};
|
|
52
|
+
if (typeof envelope.data === "string") throw {
|
|
53
|
+
code: "ACCESS_DENIED",
|
|
54
|
+
message: envelope.data
|
|
55
|
+
};
|
|
56
|
+
if (!Array.isArray(envelope.data)) throw {
|
|
57
|
+
code: "API_ERROR",
|
|
58
|
+
message: "盘客返回数据不完整"
|
|
59
|
+
};
|
|
60
|
+
writeResult(result, args.format);
|
|
61
|
+
} catch (err) {
|
|
62
|
+
writeError(err, args.format);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { list_default as default };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { n as mergeUserIds, r as toLocalDateTime, t as csvToArray } from "./util-BuoFIeLS.mjs";
|
|
6
|
+
import { defineCommand } from "citty";
|
|
7
|
+
//#region src/commands/audio/list.ts
|
|
8
|
+
/**
|
|
9
|
+
* `wow-xiaobao audio list` — page audio metadata via POST /ai-open/audio/page.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors openclaw-xiaobao xiaobao_list_audio. Returns audio metadata only
|
|
12
|
+
* (audioId / fileId / startTime / endTime / duration / sale info / fileUrl).
|
|
13
|
+
* Transcript text comes from `wow-xiaobao audio text <audio-id>`.
|
|
14
|
+
*/
|
|
15
|
+
var list_default = defineCommand({
|
|
16
|
+
meta: {
|
|
17
|
+
name: "list",
|
|
18
|
+
description: "录音元数据分页查询(按时间范围 + 可选顾问过滤)"
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
from: {
|
|
22
|
+
type: "string",
|
|
23
|
+
required: true,
|
|
24
|
+
description: "录音开始时间,yyyy-MM-dd HH:mm:ss(或 ISO,自动转换)"
|
|
25
|
+
},
|
|
26
|
+
to: {
|
|
27
|
+
type: "string",
|
|
28
|
+
required: true,
|
|
29
|
+
description: "录音结束时间,同 from 格式"
|
|
30
|
+
},
|
|
31
|
+
"user-id": {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "单顾问 user-id 过滤"
|
|
34
|
+
},
|
|
35
|
+
"user-id-list": {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "CSV: u1,u2,u3 多顾问"
|
|
38
|
+
},
|
|
39
|
+
page: {
|
|
40
|
+
type: "string",
|
|
41
|
+
default: "1"
|
|
42
|
+
},
|
|
43
|
+
size: {
|
|
44
|
+
type: "string",
|
|
45
|
+
default: "10"
|
|
46
|
+
},
|
|
47
|
+
"api-base": { type: "string" },
|
|
48
|
+
format: {
|
|
49
|
+
type: "string",
|
|
50
|
+
default: "toon"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
async run({ args }) {
|
|
54
|
+
try {
|
|
55
|
+
const config = resolveConfig({ apiBase: args["api-base"] });
|
|
56
|
+
const active = await requireActiveProject();
|
|
57
|
+
const mergedUserIds = mergeUserIds(args["user-id"], csvToArray(args["user-id-list"]));
|
|
58
|
+
writeResult(await xbApiFetch(config, "POST", "/ai-open/audio/page", {
|
|
59
|
+
headers: tenantProjectHeaders(active),
|
|
60
|
+
body: {
|
|
61
|
+
fromDate: toLocalDateTime(args.from),
|
|
62
|
+
toDate: toLocalDateTime(args.to),
|
|
63
|
+
userIdList: mergedUserIds,
|
|
64
|
+
page: Number(args.page),
|
|
65
|
+
size: Number(args.size)
|
|
66
|
+
}
|
|
67
|
+
}), args.format);
|
|
68
|
+
} catch (err) {
|
|
69
|
+
writeError(err, args.format);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { list_default as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { defineCommand } from "citty";
|
|
6
|
+
//#region src/commands/consultant/list.ts
|
|
7
|
+
/**
|
|
8
|
+
* `wow-xiaobao consultant list` — list consultants the current user is
|
|
9
|
+
* authorised to view in the active project.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors openclaw-xiaobao xiaobao_list_consultants: GET /ai-open/consultants
|
|
12
|
+
* with tenant/project headers from active-project store.
|
|
13
|
+
*/
|
|
14
|
+
var list_default = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "list",
|
|
17
|
+
description: "查询有权限的置业顾问列表(按当前激活项目)"
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
"api-base": { type: "string" },
|
|
21
|
+
format: {
|
|
22
|
+
type: "string",
|
|
23
|
+
default: "toon"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
async run({ args }) {
|
|
27
|
+
try {
|
|
28
|
+
writeResult(await xbApiFetch(resolveConfig({ apiBase: args["api-base"] }), "GET", "/ai-open/consultants", { headers: tenantProjectHeaders(await requireActiveProject()) }), args.format);
|
|
29
|
+
} catch (err) {
|
|
30
|
+
writeError(err, args.format);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { list_default as default };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { r as toLocalDateTime } from "./util-BuoFIeLS.mjs";
|
|
6
|
+
import { defineCommand } from "citty";
|
|
7
|
+
//#region src/commands/visit/list.ts
|
|
8
|
+
/**
|
|
9
|
+
* `wow-xiaobao visit list` — page customer visits via POST /ai-open/visits/page.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors openclaw-xiaobao xiaobao_list_visits. Each visit already carries an
|
|
12
|
+
* `audios` array (audioId / fileId / startTime / duration / signed fileUrl),
|
|
13
|
+
* so no need to call `audio list` separately for a visit's recordings.
|
|
14
|
+
*/
|
|
15
|
+
var list_default = defineCommand({
|
|
16
|
+
meta: {
|
|
17
|
+
name: "list",
|
|
18
|
+
description: "客户来访分页查询(每条已含 audios 录音列表)"
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
"customer-id": {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "客户 ID(wang_id)精确过滤,优于 customer-name"
|
|
24
|
+
},
|
|
25
|
+
"customer-name": {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "客户姓名 LIKE 模糊(触发后端 JOIN,慢于 customer-id)"
|
|
28
|
+
},
|
|
29
|
+
from: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "来访时间下限(含)"
|
|
32
|
+
},
|
|
33
|
+
to: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "来访时间上限(不含)"
|
|
36
|
+
},
|
|
37
|
+
page: {
|
|
38
|
+
type: "string",
|
|
39
|
+
default: "1"
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
type: "string",
|
|
43
|
+
default: "10"
|
|
44
|
+
},
|
|
45
|
+
"api-base": { type: "string" },
|
|
46
|
+
format: {
|
|
47
|
+
type: "string",
|
|
48
|
+
default: "toon"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
async run({ args }) {
|
|
52
|
+
try {
|
|
53
|
+
writeResult(await xbApiFetch(resolveConfig({ apiBase: args["api-base"] }), "POST", "/ai-open/visits/page", {
|
|
54
|
+
headers: tenantProjectHeaders(await requireActiveProject()),
|
|
55
|
+
body: {
|
|
56
|
+
customerId: args["customer-id"],
|
|
57
|
+
customerName: args["customer-name"],
|
|
58
|
+
fromDate: toLocalDateTime(args.from),
|
|
59
|
+
toDate: toLocalDateTime(args.to),
|
|
60
|
+
page: Number(args.page),
|
|
61
|
+
size: Number(args.size)
|
|
62
|
+
}
|
|
63
|
+
}), args.format);
|
|
64
|
+
} catch (err) {
|
|
65
|
+
writeError(err, args.format);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { list_default as default };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { r as toLocalDateTime, t as csvToArray } from "./util-BuoFIeLS.mjs";
|
|
6
|
+
import { defineCommand } from "citty";
|
|
7
|
+
//#region src/commands/focus/list.ts
|
|
8
|
+
/**
|
|
9
|
+
* `wow-xiaobao focus list` — page customer 关注点 (focus) tags via
|
|
10
|
+
* POST /ai-open/customer-focus/page. Mirrors openclaw-xiaobao tool.
|
|
11
|
+
*
|
|
12
|
+
* Focus = 客户主动表达的关心(学区/户型/价格优惠/配套等)。每条 tag 已带
|
|
13
|
+
* customer / userInfo / audio + value_str + text_fragment。
|
|
14
|
+
*/
|
|
15
|
+
var list_default = defineCommand({
|
|
16
|
+
meta: {
|
|
17
|
+
name: "list",
|
|
18
|
+
description: "客户关注点标签分页查询(visit_time DESC)"
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
"visit-ids": {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "CSV: 来访 ID 列表 IN 过滤"
|
|
24
|
+
},
|
|
25
|
+
"customer-ids": {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "CSV: 客户 ID(wang_id)列表 IN 过滤"
|
|
28
|
+
},
|
|
29
|
+
"audio-ids": {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "CSV: 录音 ID 列表 IN 过滤"
|
|
32
|
+
},
|
|
33
|
+
category: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "一级分类 LIKE 模糊(如\"户型\"/\"价格\"/\"环境\")"
|
|
36
|
+
},
|
|
37
|
+
classification: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "二级分类 LIKE 模糊(如\"户型因素\"/\"位置因素\")"
|
|
40
|
+
},
|
|
41
|
+
from: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "来访时间下限(含)"
|
|
44
|
+
},
|
|
45
|
+
to: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "来访时间上限(不含)"
|
|
48
|
+
},
|
|
49
|
+
page: {
|
|
50
|
+
type: "string",
|
|
51
|
+
default: "1"
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
type: "string",
|
|
55
|
+
default: "10"
|
|
56
|
+
},
|
|
57
|
+
"api-base": { type: "string" },
|
|
58
|
+
format: {
|
|
59
|
+
type: "string",
|
|
60
|
+
default: "toon"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
async run({ args }) {
|
|
64
|
+
try {
|
|
65
|
+
writeResult(await xbApiFetch(resolveConfig({ apiBase: args["api-base"] }), "POST", "/ai-open/customer-focus/page", {
|
|
66
|
+
headers: tenantProjectHeaders(await requireActiveProject()),
|
|
67
|
+
body: {
|
|
68
|
+
visitIds: csvToArray(args["visit-ids"]),
|
|
69
|
+
customerIds: csvToArray(args["customer-ids"]),
|
|
70
|
+
audioIds: csvToArray(args["audio-ids"]),
|
|
71
|
+
category: args.category,
|
|
72
|
+
classification: args.classification,
|
|
73
|
+
fromDate: toLocalDateTime(args.from),
|
|
74
|
+
toDate: toLocalDateTime(args.to),
|
|
75
|
+
page: Number(args.page),
|
|
76
|
+
size: Number(args.size)
|
|
77
|
+
}
|
|
78
|
+
}), args.format);
|
|
79
|
+
} catch (err) {
|
|
80
|
+
writeError(err, args.format);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
//#endregion
|
|
86
|
+
export { list_default as default };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { r as toLocalDateTime, t as csvToArray } from "./util-BuoFIeLS.mjs";
|
|
6
|
+
import { defineCommand } from "citty";
|
|
7
|
+
//#region src/commands/follow/list.ts
|
|
8
|
+
/**
|
|
9
|
+
* `wow-xiaobao follow list` — 旺跟进明细分页。
|
|
10
|
+
*
|
|
11
|
+
* 每条 = 一次跟进动作(电话/短信/微信/企微…,含通话时长、消息条数)。
|
|
12
|
+
* 聚合统计卡片(summary/rank/team/time)走 `quantum follow`;
|
|
13
|
+
* 电话/微信指标汇总走 `follow summary`。调 POST /ai-open/follows/page。
|
|
14
|
+
*/
|
|
15
|
+
var list_default = defineCommand({
|
|
16
|
+
meta: {
|
|
17
|
+
name: "list",
|
|
18
|
+
description: "旺跟进明细分页(谁/何时/以什么方式跟进了哪个客户)"
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
"user-ids": {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "CSV: 跟进人 userId 过滤;不传按当前授权范围"
|
|
24
|
+
},
|
|
25
|
+
"customer-ids": {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "CSV: 客户 wang_id 过滤"
|
|
28
|
+
},
|
|
29
|
+
from: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "开始时间(含)"
|
|
32
|
+
},
|
|
33
|
+
to: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "结束时间(不含)"
|
|
36
|
+
},
|
|
37
|
+
page: {
|
|
38
|
+
type: "string",
|
|
39
|
+
default: "1"
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
type: "string",
|
|
43
|
+
default: "10"
|
|
44
|
+
},
|
|
45
|
+
"api-base": { type: "string" },
|
|
46
|
+
format: {
|
|
47
|
+
type: "string",
|
|
48
|
+
default: "toon"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
async run({ args }) {
|
|
52
|
+
try {
|
|
53
|
+
writeResult(await xbApiFetch(resolveConfig({ apiBase: args["api-base"] }), "POST", "/ai-open/follows/page", {
|
|
54
|
+
headers: tenantProjectHeaders(await requireActiveProject()),
|
|
55
|
+
body: {
|
|
56
|
+
userIds: csvToArray(args["user-ids"]),
|
|
57
|
+
customerIds: csvToArray(args["customer-ids"]),
|
|
58
|
+
fromDate: toLocalDateTime(args.from),
|
|
59
|
+
toDate: toLocalDateTime(args.to),
|
|
60
|
+
page: Number(args.page),
|
|
61
|
+
size: Number(args.size)
|
|
62
|
+
}
|
|
63
|
+
}), args.format);
|
|
64
|
+
} catch (err) {
|
|
65
|
+
writeError(err, args.format);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { list_default as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { n as xbApiFetch, t as resolveConfig } from "./config-DqUxKQ3m.mjs";
|
|
2
|
+
import { n as requireActiveProject } from "./project-store-B-2rqrgM.mjs";
|
|
3
|
+
import { t as tenantProjectHeaders } from "./headers-Dy5gROBB.mjs";
|
|
4
|
+
import { n as writeResult, t as writeError } from "./format-bDFUVuDQ.mjs";
|
|
5
|
+
import { defineCommand } from "citty";
|
|
6
|
+
//#region src/commands/portrait/list.ts
|
|
7
|
+
/**
|
|
8
|
+
* `wow-xiaobao portrait list` — 画像字段清单(中文名 + 分档枚举)。
|
|
9
|
+
*
|
|
10
|
+
* 返回本项目可用的画像字段(fieldNames + fields[].values 分档),
|
|
11
|
+
* 供 `portrait get <field>` 使用。调 POST /ai-open/portraits/fields。
|
|
12
|
+
*/
|
|
13
|
+
var list_default = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: "list",
|
|
16
|
+
description: "画像字段清单(中文名,供 portrait get 使用)"
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
"api-base": { type: "string" },
|
|
20
|
+
format: {
|
|
21
|
+
type: "string",
|
|
22
|
+
default: "toon"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
async run({ args }) {
|
|
26
|
+
try {
|
|
27
|
+
writeResult(await xbApiFetch(resolveConfig({ apiBase: args["api-base"] }), "POST", "/ai-open/portraits/fields", {
|
|
28
|
+
headers: tenantProjectHeaders(await requireActiveProject()),
|
|
29
|
+
body: {}
|
|
30
|
+
}), args.format);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
writeError(err, args.format);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { list_default as default };
|