beautx-cli 1.0.6 → 1.0.7-beta.1
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 +44 -15
- package/dist/{analyze-0SATHpUC.mjs → analyze-CcsdZtz9.mjs} +5 -5
- package/dist/{api-D3JyDoiw.mjs → api-B5nQypBz.mjs} +2 -2
- package/dist/{audio-BfNibfXF.mjs → audio-DVH0I5Zh.mjs} +3 -3
- package/dist/{beauty-plan-DQl_OJNK.mjs → beauty-plan-Cd88u5h0.mjs} +4 -4
- package/dist/cli.mjs +7651 -19
- package/dist/config-BOuRZAk1.mjs +15 -0
- package/dist/{consultant-DbYBzHqQ.mjs → consultant-C1uiuItn.mjs} +1 -1
- package/dist/{content-BTHG2DCs.mjs → content-CpFANyPe.mjs} +3 -3
- package/dist/{current-BDH1xER9.mjs → current--kwV_-9S.mjs} +3 -3
- package/dist/{customer-D04eXm64.mjs → customer-Chl1bGg9.mjs} +1 -1
- package/dist/{deal-analysis-Dpg9VGjK.mjs → deal-analysis-Bf6TwBmH.mjs} +4 -4
- package/dist/{doc-CWgdZ_Eh.mjs → doc-BtwmuoPs.mjs} +3 -3
- package/dist/doctor-DuGxP40X.mjs +37 -0
- package/dist/{env-vars-CXEHR_mk.mjs → env-vars-Dinhf5lt.mjs} +21 -40
- package/dist/{fields-D-iEk93w.mjs → fields-MsjROq8O.mjs} +4 -4
- package/dist/{focus-BMcnVGqT.mjs → focus-CM6mZYRj.mjs} +1 -1
- package/dist/{get-BLdqZ3XJ.mjs → get-Z_hTyubv.mjs} +3 -3
- package/dist/install-DP9xV1rY.mjs +50 -0
- package/dist/{kb-BPy6E_uX.mjs → kb-CjQXEOY5.mjs} +2 -2
- package/dist/{list-C73pWNBd.mjs → list-B84PLHzp.mjs} +2 -2
- package/dist/list-BNZV4wei.mjs +77 -0
- package/dist/{list-DyePBi8K.mjs → list-BSR3H7_0.mjs} +4 -4
- package/dist/{list-DqXRvhfS.mjs → list-BT0_KdNZ.mjs} +5 -5
- package/dist/{list-BMbWa85R.mjs → list-C0wn72hg.mjs} +4 -4
- package/dist/{list-DIvD8BvI.mjs → list-C6imhAfi.mjs} +4 -4
- package/dist/{list-Ck_kx-iC.mjs → list-CDi3ySyx.mjs} +5 -5
- package/dist/{list-JL2fmylz.mjs → list-CGJa9z3d.mjs} +4 -4
- package/dist/{list-CB7YZTB4.mjs → list-CJiei-hu.mjs} +4 -4
- package/dist/list-D809kN14.mjs +85 -0
- package/dist/{mcp-args-CYOCdClW.mjs → mcp-args-B8InvGQc.mjs} +1 -1
- package/dist/{mcp-client-OuKd8iir.mjs → mcp-client-aS31KU6J.mjs} +37 -76
- package/dist/{mcp-result-B5HHO7ap.mjs → mcp-result-Bl71pkOt.mjs} +2 -2
- package/dist/{portrait-tags-DRQi5JcR.mjs → portrait-tags-BYded-6k.mjs} +4 -4
- package/dist/{project-CEmZCvSp.mjs → project-DSO_7ofq.mjs} +3 -3
- package/dist/project-access-Cq8d1YTo.mjs +2 -0
- package/dist/{project-access-O-VSqqVC.mjs → project-access-DlypxnQF.mjs} +21 -30
- package/dist/project-store-CYuTFefu.mjs +2 -0
- package/dist/project-store-D0UuLan2.mjs +219 -0
- package/dist/{qa-B7WbwUts.mjs → qa-CqUiXIZn.mjs} +5 -5
- package/dist/{resistance-FtBtoEDl.mjs → resistance-DiDDixVq.mjs} +1 -1
- package/dist/{search-BuMtyCiU.mjs → search-sjRwA-la.mjs} +5 -5
- package/dist/skill-DBpgezPV.mjs +15 -0
- package/dist/skill-client-D4_QGDkj.mjs +171 -0
- package/dist/{summary-Cg79V9oz.mjs → summary-C7lrTImW.mjs} +4 -4
- package/dist/{text-CGOU6uh9.mjs → text-BZo7B8mz.mjs} +5 -5
- package/dist/upload-D4wSmRqs.mjs +76 -0
- package/dist/{use-Bzhvb9I3.mjs → use-DQ_M0FOH.mjs} +8 -6
- package/dist/{visit-vaoFdiLr.mjs → visit-CxAYV6z6.mjs} +2 -2
- package/dist/{visit-evaluate-BQIyxZeM.mjs → visit-evaluate-BTKqc8fd.mjs} +4 -4
- package/dist/{visit-query-args-CDDQ9JJ8.mjs → visit-query-args-BLwj26s6.mjs} +2 -2
- package/package.json +1 -1
- package/dist/config-C8aqUXV7.mjs +0 -14
- package/dist/env-callback-CIXEvt0i.mjs +0 -349
- package/dist/format-9T59sVxH.mjs +0 -7253
- package/dist/list-FCCClcl-.mjs +0 -64
- package/dist/project-store-DHqT0-nk.mjs +0 -55
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
//#region src/commands/config/index.ts
|
|
3
|
+
var config_default = defineCommand({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "config",
|
|
6
|
+
description: "沙箱配置:list 只读诊断;doctor 自检;fields 客户字段字典"
|
|
7
|
+
},
|
|
8
|
+
subCommands: {
|
|
9
|
+
list: () => import("./list-D809kN14.mjs").then((m) => m.default),
|
|
10
|
+
doctor: () => import("./doctor-DuGxP40X.mjs").then((m) => m.default),
|
|
11
|
+
fields: () => import("./fields-MsjROq8O.mjs").then((m) => m.default)
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { config_default as default };
|
|
@@ -5,7 +5,7 @@ var consultant_default = defineCommand({
|
|
|
5
5
|
name: "consultant",
|
|
6
6
|
description: "查询有权限的顾问列表"
|
|
7
7
|
},
|
|
8
|
-
subCommands: { list: () => import("./list-
|
|
8
|
+
subCommands: { list: () => import("./list-BT0_KdNZ.mjs").then((m) => m.default) }
|
|
9
9
|
});
|
|
10
10
|
//#endregion
|
|
11
11
|
export { consultant_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { n as
|
|
3
|
-
import { n as writeMcpDataResult } from "./mcp-result-
|
|
1
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
2
|
+
import { n as mcpCall } from "./mcp-client-aS31KU6J.mjs";
|
|
3
|
+
import { n as writeMcpDataResult } from "./mcp-result-Bl71pkOt.mjs";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
//#region src/commands/kb/doc/content.ts
|
|
6
6
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, r as writeResult, t as formatCliArg } from "./cli.mjs";
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
//#region src/commands/project/current.ts
|
|
5
5
|
/**
|
|
6
|
-
* `beautx-cli project current` — show the currently active project
|
|
6
|
+
* `beautx-cli project current` — show the currently active project (QCA current-project).
|
|
7
7
|
*/
|
|
8
8
|
var current_default = defineCommand({
|
|
9
9
|
meta: {
|
|
@@ -5,7 +5,7 @@ var customer_default = defineCommand({
|
|
|
5
5
|
name: "customer",
|
|
6
6
|
description: "客户画像分页查询"
|
|
7
7
|
},
|
|
8
|
-
subCommands: { list: () => import("./list-
|
|
8
|
+
subCommands: { list: () => import("./list-C0wn72hg.mjs").then((m) => m.default) }
|
|
9
9
|
});
|
|
10
10
|
//#endregion
|
|
11
11
|
export { customer_default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as visitBatchQueryCliArgs, t as buildVisitBatchQueryArgs } from "./visit-query-args-
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError } from "./cli.mjs";
|
|
3
|
+
import { t as mcpCallPage } from "./mcp-result-Bl71pkOt.mjs";
|
|
4
|
+
import { n as visitBatchQueryCliArgs, t as buildVisitBatchQueryArgs } from "./visit-query-args-BLwj26s6.mjs";
|
|
5
5
|
import { defineCommand } from "citty";
|
|
6
6
|
//#region src/commands/deal-analysis/index.ts
|
|
7
7
|
/**
|
|
@@ -6,9 +6,9 @@ var doc_default = defineCommand({
|
|
|
6
6
|
description: "知识库文档列表 / 元数据 / 全文"
|
|
7
7
|
},
|
|
8
8
|
subCommands: {
|
|
9
|
-
list: () => import("./list-
|
|
10
|
-
get: () => import("./get-
|
|
11
|
-
content: () => import("./content-
|
|
9
|
+
list: () => import("./list-CDi3ySyx.mjs").then((m) => m.default),
|
|
10
|
+
get: () => import("./get-Z_hTyubv.mjs").then((m) => m.default),
|
|
11
|
+
content: () => import("./content-CpFANyPe.mjs").then((m) => m.default)
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
//#endregion
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { c as runPreflight, n as writeError, r as writeResult, t as formatCliArg } from "./cli.mjs";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
//#region src/commands/config/doctor.ts
|
|
4
|
+
/**
|
|
5
|
+
* `beautx-cli config doctor` — manual preflight (presence only; never prints secrets).
|
|
6
|
+
*/
|
|
7
|
+
var doctor_default = defineCommand({
|
|
8
|
+
meta: {
|
|
9
|
+
name: "doctor",
|
|
10
|
+
description: "自检:检查 Host env 与当前项目/AT 是否已就绪(只报存在性,不打印密钥)"
|
|
11
|
+
},
|
|
12
|
+
args: { format: formatCliArg },
|
|
13
|
+
async run({ args }) {
|
|
14
|
+
const format = typeof args.format === "string" ? args.format : void 0;
|
|
15
|
+
try {
|
|
16
|
+
const report = await runPreflight();
|
|
17
|
+
writeResult({
|
|
18
|
+
ok: report.ok,
|
|
19
|
+
checks: report.checks.map((c) => ({
|
|
20
|
+
id: c.id,
|
|
21
|
+
ok: c.ok,
|
|
22
|
+
...c.ok ? {} : {
|
|
23
|
+
code: c.code,
|
|
24
|
+
message: c.message,
|
|
25
|
+
hint: c.hint
|
|
26
|
+
}
|
|
27
|
+
}))
|
|
28
|
+
}, format);
|
|
29
|
+
if (!report.ok) process.exit(1);
|
|
30
|
+
} catch (err) {
|
|
31
|
+
writeError(err, format);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { doctor_default as default };
|
|
@@ -12,45 +12,29 @@ var MissingGatewayError = class extends Error {
|
|
|
12
12
|
};
|
|
13
13
|
var MissingAccessTokenError = class extends Error {
|
|
14
14
|
code = "MISSING_ACCESS_TOKEN";
|
|
15
|
-
hint = "
|
|
15
|
+
hint = "向 /out/v2/mcp-token 借 AT 失败:确认沙箱已注入 SANDBOX_*_SECRET,且 PC/App 已完成 MCP 凭证初始化";
|
|
16
16
|
constructor() {
|
|
17
17
|
super("缺少 MCP access token");
|
|
18
18
|
this.name = "MissingAccessTokenError";
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
var MissingRefreshTokenError = class extends Error {
|
|
22
|
-
code = "MISSING_REFRESH_TOKEN";
|
|
23
|
-
hint = "由 Host 在沙箱启动或 QA 开始时注入 REFRESH_TOKEN";
|
|
24
|
-
constructor() {
|
|
25
|
-
super("缺少 refresh_token");
|
|
26
|
-
this.name = "MissingRefreshTokenError";
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
21
|
var AccessTokenExpiredError = class extends Error {
|
|
30
22
|
code = "ACCESS_TOKEN_EXPIRED";
|
|
31
|
-
hint = "
|
|
23
|
+
hint = "重新调用 CLI(会向 Token Broker 借新 AT),或先在 PC/App 登录刷新凭证仓";
|
|
32
24
|
constructor() {
|
|
33
25
|
super("MCP access token 已过期");
|
|
34
26
|
this.name = "AccessTokenExpiredError";
|
|
35
27
|
}
|
|
36
28
|
};
|
|
37
|
-
var
|
|
38
|
-
code = "
|
|
39
|
-
hint = "
|
|
40
|
-
constructor(detail) {
|
|
41
|
-
super(detail ?? "refresh_token 续期失败");
|
|
42
|
-
this.name = "RefreshFailedError";
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var EnvCallbackFailedError = class extends Error {
|
|
46
|
-
code = "ENV_CALLBACK_FAILED";
|
|
47
|
-
hint = "Host 回调写 env 失败,请检查 USER_ID、TENANT_ID 与沙箱回调服务是否可用";
|
|
29
|
+
var CurrentProjectFailedError = class extends Error {
|
|
30
|
+
code = "CURRENT_PROJECT_FAILED";
|
|
31
|
+
hint = "读写当前项目失败,请检查 TENANT_ID、USER_ID 与 /out/v2/current-project 服务是否可用";
|
|
48
32
|
status;
|
|
49
33
|
upstreamCode;
|
|
50
34
|
details;
|
|
51
35
|
constructor(message, options) {
|
|
52
36
|
super(message);
|
|
53
|
-
this.name = "
|
|
37
|
+
this.name = "CurrentProjectFailedError";
|
|
54
38
|
this.status = options?.status;
|
|
55
39
|
this.upstreamCode = options?.upstreamCode;
|
|
56
40
|
this.details = options?.details;
|
|
@@ -75,12 +59,14 @@ const PROFILES = {
|
|
|
75
59
|
test: {
|
|
76
60
|
gatewayUrl: "https://mcp.test.wangxiaobao.com",
|
|
77
61
|
authUrl: "https://mcp-auth.test.wangxiaobao.com",
|
|
78
|
-
callbackBaseUrl: "https://wangke.test.wangxiaobao.com"
|
|
62
|
+
callbackBaseUrl: "https://wangke.test.wangxiaobao.com",
|
|
63
|
+
skillBffUrl: "https://wangke.test.wangxiaobao.com/api/wc-skill"
|
|
79
64
|
},
|
|
80
65
|
prod: {
|
|
81
66
|
gatewayUrl: `https://mcp.wangxiaobao.com`,
|
|
82
67
|
authUrl: `https://mcp-auth.wangxiaobao.com`,
|
|
83
|
-
callbackBaseUrl: `https://wangke.wangxiaobao.com
|
|
68
|
+
callbackBaseUrl: `https://wangke.wangxiaobao.com`,
|
|
69
|
+
skillBffUrl: "https://wangke.wangxiaobao.com/api/wc-skill"
|
|
84
70
|
}
|
|
85
71
|
};
|
|
86
72
|
function isProfileUrlConfigured(url) {
|
|
@@ -120,8 +106,13 @@ const ENV_KEYS = {
|
|
|
120
106
|
MCP_TOKEN: "MCP_TOKEN",
|
|
121
107
|
REFRESH_TOKEN: "REFRESH_TOKEN",
|
|
122
108
|
EXPIRES_TIMES: "EXPIRES_TIMES",
|
|
109
|
+
SESSION_ID: "SESSION_ID",
|
|
123
110
|
XB_APP_ID: "XB_APP_ID",
|
|
124
|
-
ENV: "ENV"
|
|
111
|
+
ENV: "ENV",
|
|
112
|
+
/** 沙箱只读:创建模板时注入,用于 Token Broker 等敏感请求 */
|
|
113
|
+
SANDBOX_TENANT_SECRET: "SANDBOX_TENANT_SECRET",
|
|
114
|
+
/** 沙箱只读:创建用户时注入 */
|
|
115
|
+
SANDBOX_USER_SECRET: "SANDBOX_USER_SECRET"
|
|
125
116
|
};
|
|
126
117
|
/** Refresh when remaining lifetime is below this threshold (ms). */
|
|
127
118
|
const REFRESH_BUFFER_MS = 12e4;
|
|
@@ -149,11 +140,13 @@ function isEnvInjectedByHost() {
|
|
|
149
140
|
function resolveEndpoints() {
|
|
150
141
|
const env = resolveDeploymentEnv();
|
|
151
142
|
const profile = PROFILES[env];
|
|
143
|
+
const skillBffOverride = process.env.SKILL_BFF_URL?.trim();
|
|
152
144
|
return {
|
|
153
145
|
env,
|
|
154
146
|
gatewayUrl: profile.gatewayUrl,
|
|
155
147
|
authUrl: profile.authUrl,
|
|
156
|
-
callbackBaseUrl: profile.callbackBaseUrl
|
|
148
|
+
callbackBaseUrl: profile.callbackBaseUrl,
|
|
149
|
+
skillBffUrl: skillBffOverride || profile.skillBffUrl
|
|
157
150
|
};
|
|
158
151
|
}
|
|
159
152
|
function assertEndpointsValid(endpoints) {
|
|
@@ -162,21 +155,9 @@ function assertEndpointsValid(endpoints) {
|
|
|
162
155
|
}
|
|
163
156
|
function requireUserId() {
|
|
164
157
|
const userId = readEnv(ENV_KEYS.USER_ID);
|
|
165
|
-
if (!userId) throw new ConfigInvalidError("缺少 USER_ID 环境变量", "由
|
|
158
|
+
if (!userId) throw new ConfigInvalidError("缺少 USER_ID 环境变量", "由 QCA 在沙箱启动时注入 USER_ID");
|
|
166
159
|
return userId;
|
|
167
160
|
}
|
|
168
|
-
function readActiveProject() {
|
|
169
|
-
const projectId = readEnv(ENV_KEYS.ESTATE_ID);
|
|
170
|
-
if (!projectId) return null;
|
|
171
|
-
return {
|
|
172
|
-
tenantId: readEnv(ENV_KEYS.TENANT_ID),
|
|
173
|
-
tenantName: readEnv(ENV_KEYS.TENANT_NAME),
|
|
174
|
-
projectId,
|
|
175
|
-
projectName: readEnv(ENV_KEYS.ESTATE_NAME),
|
|
176
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
177
|
-
source: "env"
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
161
|
function readCredentials() {
|
|
181
162
|
const accessToken = readEnv(ENV_KEYS.MCP_TOKEN) || null;
|
|
182
163
|
const refreshToken = readEnv(ENV_KEYS.REFRESH_TOKEN) || null;
|
|
@@ -228,4 +209,4 @@ function isTokenExpired(expiresAt) {
|
|
|
228
209
|
return expiresAt != null && expiresAt <= Date.now();
|
|
229
210
|
}
|
|
230
211
|
//#endregion
|
|
231
|
-
export {
|
|
212
|
+
export { isTokenExpired as a, readEnv as c, syncProcessEnv as d, AccessTokenExpiredError as f, MissingGatewayError as g, MissingAccessTokenError as h, isEnvInjectedByHost as i, requireUserId as l, CurrentProjectFailedError as m, assertEndpointsValid as n, needsRefresh as o, ConfigInvalidError as p, credentialStatus as r, readCredentials as s, ENV_KEYS as t, resolveEndpoints as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
4
|
+
import { t as mcpCallPage } from "./mcp-result-Bl71pkOt.mjs";
|
|
5
5
|
import { defineCommand } from "citty";
|
|
6
6
|
//#region src/commands/config/fields.ts
|
|
7
7
|
/**
|
|
@@ -5,7 +5,7 @@ var focus_default = defineCommand({
|
|
|
5
5
|
name: "focus",
|
|
6
6
|
description: "客户关注点标签分页查询"
|
|
7
7
|
},
|
|
8
|
-
subCommands: { list: () => import("./list-
|
|
8
|
+
subCommands: { list: () => import("./list-CGJa9z3d.mjs").then((m) => m.default) }
|
|
9
9
|
});
|
|
10
10
|
//#endregion
|
|
11
11
|
export { focus_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { n as
|
|
3
|
-
import { n as writeMcpDataResult } from "./mcp-result-
|
|
1
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
2
|
+
import { n as mcpCall } from "./mcp-client-aS31KU6J.mjs";
|
|
3
|
+
import { n as writeMcpDataResult } from "./mcp-result-Bl71pkOt.mjs";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
//#region src/commands/kb/doc/get.ts
|
|
6
6
|
/**
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, r as writeResult, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
4
|
+
import { i as skillInstallGrant, r as resolveSkillInstallDir, t as downloadSkillPackage } from "./skill-client-D4_QGDkj.mjs";
|
|
5
|
+
import { defineCommand } from "citty";
|
|
6
|
+
//#region src/commands/skill/install.ts
|
|
7
|
+
/**
|
|
8
|
+
* `beautx-cli skill install <id>` — request a package grant and download it.
|
|
9
|
+
*/
|
|
10
|
+
var install_default = defineCommand({
|
|
11
|
+
meta: {
|
|
12
|
+
name: "install",
|
|
13
|
+
description: "按 Skill ID 下载安装包到本地(默认使用当前激活项目做权限判定)"
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
id: {
|
|
17
|
+
type: "positional",
|
|
18
|
+
description: "Skill 数字 ID",
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
dir: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: `安装目录(默认 ${resolveSkillInstallDir()},可用 SKILL_INSTALL_DIR 覆盖)`
|
|
24
|
+
},
|
|
25
|
+
...projectIdCliArg,
|
|
26
|
+
format: formatCliArg
|
|
27
|
+
},
|
|
28
|
+
async run({ args }) {
|
|
29
|
+
try {
|
|
30
|
+
const active = await requireActiveProject();
|
|
31
|
+
const projectId = resolveProjectId(args["project-id"], active);
|
|
32
|
+
const grant = await skillInstallGrant(args.id, projectId);
|
|
33
|
+
const { skillDir, zipPath } = await downloadSkillPackage(grant, args.dir?.trim() || resolveSkillInstallDir());
|
|
34
|
+
writeResult({
|
|
35
|
+
skillId: grant.skillId,
|
|
36
|
+
name: grant.name,
|
|
37
|
+
version: grant.version,
|
|
38
|
+
checksum: grant.checksum,
|
|
39
|
+
skillDir,
|
|
40
|
+
zipPath,
|
|
41
|
+
projectId
|
|
42
|
+
}, args.format);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
writeError(err, args.format);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { install_default as default };
|
|
@@ -6,8 +6,8 @@ var kb_default = defineCommand({
|
|
|
6
6
|
description: "知识库检索与文档查询"
|
|
7
7
|
},
|
|
8
8
|
subCommands: {
|
|
9
|
-
search: () => import("./search-
|
|
10
|
-
doc: () => import("./doc-
|
|
9
|
+
search: () => import("./search-sjRwA-la.mjs").then((m) => m.default),
|
|
10
|
+
doc: () => import("./doc-BtwmuoPs.mjs").then((m) => m.default)
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as writeError, t as formatCliArg } from "./
|
|
2
|
-
import { t as mcpCallPage } from "./mcp-result-
|
|
1
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
2
|
+
import { t as mcpCallPage } from "./mcp-result-Bl71pkOt.mjs";
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
//#region src/commands/project/list.ts
|
|
5
5
|
/**
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, r as writeResult, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
4
|
+
import { a as skillList } from "./skill-client-D4_QGDkj.mjs";
|
|
5
|
+
import { defineCommand } from "citty";
|
|
6
|
+
//#region src/commands/skill/list.ts
|
|
7
|
+
/**
|
|
8
|
+
* `beautx-cli skill list` — list visible Skill packages from the Skill BFF.
|
|
9
|
+
*/
|
|
10
|
+
function groupByOwnerType(items) {
|
|
11
|
+
return {
|
|
12
|
+
personal: items.filter((item) => item.ownerType === "personal"),
|
|
13
|
+
tenant: items.filter((item) => item.ownerType === "tenant"),
|
|
14
|
+
project: items.filter((item) => item.ownerType === "project"),
|
|
15
|
+
other: items.filter((item) => item.ownerType !== "personal" && item.ownerType !== "tenant" && item.ownerType !== "project")
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
var list_default = defineCommand({
|
|
19
|
+
meta: {
|
|
20
|
+
name: "list",
|
|
21
|
+
description: "列出可见 Skill(按归属类型分组;默认使用当前激活项目)"
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
type: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "personal | tenant | project;不传则按归属类型分组输出"
|
|
27
|
+
},
|
|
28
|
+
...projectIdCliArg,
|
|
29
|
+
format: formatCliArg
|
|
30
|
+
},
|
|
31
|
+
async run({ args }) {
|
|
32
|
+
try {
|
|
33
|
+
const raw = args.type?.trim().toLowerCase();
|
|
34
|
+
let type;
|
|
35
|
+
if (raw === "personal" || raw === "tenant" || raw === "project") type = raw;
|
|
36
|
+
else if (raw) throw new Error("type 仅支持 personal | tenant | project");
|
|
37
|
+
const active = await requireActiveProject();
|
|
38
|
+
const projectId = resolveProjectId(args["project-id"], active);
|
|
39
|
+
const items = await skillList(type, projectId);
|
|
40
|
+
if (type) {
|
|
41
|
+
writeResult({
|
|
42
|
+
items,
|
|
43
|
+
total: items.length,
|
|
44
|
+
type,
|
|
45
|
+
projectId
|
|
46
|
+
}, args.format);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const grouped = groupByOwnerType(items);
|
|
50
|
+
writeResult({
|
|
51
|
+
projectId,
|
|
52
|
+
personal: {
|
|
53
|
+
items: grouped.personal,
|
|
54
|
+
total: grouped.personal.length
|
|
55
|
+
},
|
|
56
|
+
tenant: {
|
|
57
|
+
items: grouped.tenant,
|
|
58
|
+
total: grouped.tenant.length
|
|
59
|
+
},
|
|
60
|
+
project: {
|
|
61
|
+
items: grouped.project,
|
|
62
|
+
total: grouped.project.length
|
|
63
|
+
},
|
|
64
|
+
...grouped.other.length ? { other: {
|
|
65
|
+
items: grouped.other,
|
|
66
|
+
total: grouped.other.length
|
|
67
|
+
} } : {},
|
|
68
|
+
total: items.length
|
|
69
|
+
}, args.format);
|
|
70
|
+
} catch (err) {
|
|
71
|
+
writeError(err, args.format);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
//#endregion
|
|
77
|
+
export { list_default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
4
|
+
import { t as mcpCallPage } from "./mcp-result-Bl71pkOt.mjs";
|
|
5
5
|
import { i as toLocalDateTime, r as mergeUserIds, t as csvToArray } from "./util-BtgWHKWv.mjs";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
//#region src/commands/audio/list.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as writeError, t as formatCliArg } from "./
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as mcpCall } from "./mcp-client-aS31KU6J.mjs";
|
|
4
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
5
|
+
import { n as writeMcpDataResult } from "./mcp-result-Bl71pkOt.mjs";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
//#region src/commands/consultant/list.ts
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
4
|
+
import { t as mcpCallPage } from "./mcp-result-Bl71pkOt.mjs";
|
|
5
5
|
import { i as toLocalDateTime } from "./util-BtgWHKWv.mjs";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
//#region src/commands/customer/list.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
4
|
+
import { t as mcpCallPage } from "./mcp-result-Bl71pkOt.mjs";
|
|
5
5
|
import { i as toLocalDateTime, t as csvToArray } from "./util-BtgWHKWv.mjs";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
//#region src/commands/resistance/list.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as writeError, t as formatCliArg } from "./
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as mcpCall } from "./mcp-client-aS31KU6J.mjs";
|
|
4
|
+
import { i as tenantIdCliArg, n as resolveProjectId, r as resolveTenantId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
5
|
+
import { n as writeMcpDataResult } from "./mcp-result-Bl71pkOt.mjs";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
//#region src/commands/kb/doc/list.ts
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
4
|
+
import { t as mcpCallPage } from "./mcp-result-Bl71pkOt.mjs";
|
|
5
5
|
import { i as toLocalDateTime, t as csvToArray } from "./util-BtgWHKWv.mjs";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
//#region src/commands/focus/list.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
1
|
+
import { c as requireActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
2
|
+
import { n as writeError, t as formatCliArg } from "./cli.mjs";
|
|
3
|
+
import { n as resolveProjectId, t as projectIdCliArg } from "./mcp-args-B8InvGQc.mjs";
|
|
4
|
+
import { t as mcpCallPage } from "./mcp-result-Bl71pkOt.mjs";
|
|
5
5
|
import { i as toLocalDateTime } from "./util-BtgWHKWv.mjs";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
7
|
//#region src/commands/visit/list.ts
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { c as readEnv, i as isEnvInjectedByHost, r as credentialStatus, s as readCredentials, t as ENV_KEYS, u as resolveEndpoints } from "./env-vars-Dinhf5lt.mjs";
|
|
2
|
+
import { a as isProjectSwitchAllowed, o as loadActiveProject } from "./project-store-D0UuLan2.mjs";
|
|
3
|
+
import { n as writeError, o as debugLogPath, r as writeResult, s as isVerboseDebugEnabled, t as formatCliArg } from "./cli.mjs";
|
|
4
|
+
import { defineCommand } from "citty";
|
|
5
|
+
//#region src/core/mask-env.ts
|
|
6
|
+
/**
|
|
7
|
+
* Mask env / secret values for agent-facing diagnostics.
|
|
8
|
+
* len <= 4 → as-is; else stars for the hidden prefix + last 4 chars.
|
|
9
|
+
* Never returns the full secret when length > 4.
|
|
10
|
+
*/
|
|
11
|
+
function maskEnvValue(value) {
|
|
12
|
+
const v = value?.trim() ?? "";
|
|
13
|
+
if (!v) return null;
|
|
14
|
+
if (v.length <= 4) return v;
|
|
15
|
+
return "*".repeat(v.length - 4) + v.slice(-4);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/commands/config/list.ts
|
|
19
|
+
/**
|
|
20
|
+
* `beautx-cli config list` — agent-facing env diagnostics (secrets redacted).
|
|
21
|
+
*/
|
|
22
|
+
var list_default = defineCommand({
|
|
23
|
+
meta: {
|
|
24
|
+
name: "list",
|
|
25
|
+
description: "列出当前配置(脱敏:星号+后四位;含凭据过期时间)"
|
|
26
|
+
},
|
|
27
|
+
args: { format: formatCliArg },
|
|
28
|
+
async run({ args }) {
|
|
29
|
+
try {
|
|
30
|
+
const endpoints = resolveEndpoints();
|
|
31
|
+
const creds = readCredentials();
|
|
32
|
+
const accessView = credentialStatus(creds);
|
|
33
|
+
const refreshConfigured = Boolean(creds.refreshToken);
|
|
34
|
+
const active = await loadActiveProject();
|
|
35
|
+
writeResult({
|
|
36
|
+
env: maskEnvValue(endpoints.env) ?? endpoints.env,
|
|
37
|
+
deploymentEnvManagedByHost: true,
|
|
38
|
+
envInjectedByHost: isEnvInjectedByHost(),
|
|
39
|
+
projectUseAllowed: isProjectSwitchAllowed(),
|
|
40
|
+
gatewayUrl: endpoints.gatewayUrl,
|
|
41
|
+
authUrl: endpoints.authUrl,
|
|
42
|
+
callbackBaseUrl: endpoints.callbackBaseUrl,
|
|
43
|
+
skillBffUrl: endpoints.skillBffUrl,
|
|
44
|
+
urlProfileSource: "src/core/endpoints.ts",
|
|
45
|
+
configSource: "environment",
|
|
46
|
+
credentialsManagedBy: "host",
|
|
47
|
+
credentials: {
|
|
48
|
+
accessToken: accessView,
|
|
49
|
+
refreshToken: { configured: refreshConfigured },
|
|
50
|
+
sandboxTenantSecret: {
|
|
51
|
+
configured: Boolean(readEnv(ENV_KEYS.SANDBOX_TENANT_SECRET)),
|
|
52
|
+
preview: maskEnvValue(readEnv(ENV_KEYS.SANDBOX_TENANT_SECRET))
|
|
53
|
+
},
|
|
54
|
+
sandboxUserSecret: {
|
|
55
|
+
configured: Boolean(readEnv(ENV_KEYS.SANDBOX_USER_SECRET)),
|
|
56
|
+
preview: maskEnvValue(readEnv(ENV_KEYS.SANDBOX_USER_SECRET))
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
user: {
|
|
60
|
+
userId: maskEnvValue(readEnv(ENV_KEYS.USER_ID)),
|
|
61
|
+
userName: maskEnvValue(readEnv(ENV_KEYS.USER_NAME))
|
|
62
|
+
},
|
|
63
|
+
activeProject: active ? {
|
|
64
|
+
configured: true,
|
|
65
|
+
tenantId: maskEnvValue(active.tenantId),
|
|
66
|
+
tenantName: maskEnvValue(active.tenantName),
|
|
67
|
+
projectId: maskEnvValue(active.projectId),
|
|
68
|
+
projectName: maskEnvValue(active.projectName),
|
|
69
|
+
source: active.source
|
|
70
|
+
} : { configured: false },
|
|
71
|
+
xbAppId: maskEnvValue(readEnv(ENV_KEYS.XB_APP_ID)),
|
|
72
|
+
debugLog: {
|
|
73
|
+
path: debugLogPath(),
|
|
74
|
+
errorsAlwaysLogged: true,
|
|
75
|
+
verboseTracing: isVerboseDebugEnabled()
|
|
76
|
+
}
|
|
77
|
+
}, args.format);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
writeError(err, args.format);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
//#endregion
|
|
85
|
+
export { list_default as default };
|