beautx-cli 1.0.7-beta.1 → 1.0.8
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 +0 -30
- package/dist/{analyze-CcsdZtz9.mjs → analyze-Cq-Hmoqp.mjs} +5 -5
- package/dist/{api-B5nQypBz.mjs → api-jIGM86TK.mjs} +1 -1
- package/dist/{audio-DVH0I5Zh.mjs → audio-p2QCYFdq.mjs} +3 -3
- package/dist/{beauty-plan-Cd88u5h0.mjs → beauty-plan-CgSmAhn8.mjs} +3 -3
- package/dist/cli.mjs +18 -33
- package/dist/{config-BOuRZAk1.mjs → config-DAVi_CuD.mjs} +3 -3
- package/dist/{consultant-C1uiuItn.mjs → consultant-CPecFRiS.mjs} +1 -1
- package/dist/{content-CpFANyPe.mjs → content-Bq_jEIl6.mjs} +2 -2
- package/dist/{current--kwV_-9S.mjs → current-D4fh-53q.mjs} +1 -1
- package/dist/{customer-Chl1bGg9.mjs → customer-DWG47eAT.mjs} +1 -1
- package/dist/{deal-analysis-Bf6TwBmH.mjs → deal-analysis-Cn2wCaoU.mjs} +3 -3
- package/dist/{doc-BtwmuoPs.mjs → doc-DwxREqki.mjs} +3 -3
- package/dist/{fields-MsjROq8O.mjs → fields-BGogOrgD.mjs} +3 -3
- package/dist/{focus-CM6mZYRj.mjs → focus-BE8BT835.mjs} +1 -1
- package/dist/{get-Z_hTyubv.mjs → get-BKCE22jj.mjs} +2 -2
- package/dist/{kb-CjQXEOY5.mjs → kb-BsiBl_ul.mjs} +2 -2
- package/dist/{list-D809kN14.mjs → list-BUYSLNqZ.mjs} +1 -3
- package/dist/{list-CGJa9z3d.mjs → list-BYLk3sNv.mjs} +4 -4
- package/dist/{list-CJiei-hu.mjs → list-BcYy7Ejx.mjs} +4 -4
- package/dist/{list-B84PLHzp.mjs → list-BmVWcUI7.mjs} +1 -1
- package/dist/{list-CDi3ySyx.mjs → list-BzmkW4Iq.mjs} +4 -4
- package/dist/{list-BSR3H7_0.mjs → list-Cnz5CuQB.mjs} +4 -4
- package/dist/{list-BT0_KdNZ.mjs → list-Cs1kF7EB.mjs} +4 -4
- package/dist/{list-C0wn72hg.mjs → list-DJscF_8M.mjs} +4 -4
- package/dist/{list-C6imhAfi.mjs → list-DVy4Czfy.mjs} +4 -4
- package/dist/{mcp-args-B8InvGQc.mjs → mcp-args-DK3IGaO1.mjs} +1 -1
- package/dist/{mcp-client-aS31KU6J.mjs → mcp-client-BTZH22b5.mjs} +3 -3
- package/dist/{mcp-result-Bl71pkOt.mjs → mcp-result-De_0PPlD.mjs} +1 -1
- package/dist/{portrait-tags-BYded-6k.mjs → portrait-tags-I57TgDAx.mjs} +3 -3
- package/dist/{project-DSO_7ofq.mjs → project-K-HkeM57.mjs} +3 -3
- package/dist/project-access-Bf87OLJP.mjs +2 -0
- package/dist/{project-access-DlypxnQF.mjs → project-access-pTN7ry15.mjs} +2 -3
- package/dist/project-store-DDVZ7T4t.mjs +2 -0
- package/dist/{project-store-D0UuLan2.mjs → project-store-Dl35JzZr.mjs} +207 -2
- package/dist/{qa-CqUiXIZn.mjs → qa-gAtF6cSk.mjs} +5 -5
- package/dist/{resistance-DiDDixVq.mjs → resistance-DGU99Bwi.mjs} +1 -1
- package/dist/{search-sjRwA-la.mjs → search-C16CzRep.mjs} +5 -5
- package/dist/{summary-C7lrTImW.mjs → summary-DgpSsQh9.mjs} +4 -4
- package/dist/{text-BZo7B8mz.mjs → text-BIIl7PmC.mjs} +4 -4
- package/dist/{use-DQ_M0FOH.mjs → use-D_HBqdev.mjs} +2 -2
- package/dist/{visit-CxAYV6z6.mjs → visit-DnUPj-8i.mjs} +2 -2
- package/dist/{visit-evaluate-BTKqc8fd.mjs → visit-evaluate-DM7oCk6R.mjs} +3 -3
- package/dist/{visit-query-args-BLwj26s6.mjs → visit-query-args-BD3Dw-9F.mjs} +2 -2
- package/package.json +1 -1
- package/dist/env-vars-Dinhf5lt.mjs +0 -212
- package/dist/install-DP9xV1rY.mjs +0 -50
- package/dist/list-BNZV4wei.mjs +0 -77
- package/dist/project-access-Cq8d1YTo.mjs +0 -2
- package/dist/project-store-CYuTFefu.mjs +0 -2
- package/dist/skill-DBpgezPV.mjs +0 -15
- package/dist/skill-client-D4_QGDkj.mjs +0 -171
- package/dist/upload-D4wSmRqs.mjs +0 -76
- /package/dist/{doctor-DuGxP40X.mjs → doctor-RwDPp4y3.mjs} +0 -0
- /package/dist/{util-BtgWHKWv.mjs → util-Bko-nm_R.mjs} +0 -0
package/dist/list-BNZV4wei.mjs
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
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 };
|
package/dist/skill-DBpgezPV.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
//#region src/commands/skill/index.ts
|
|
3
|
-
var skill_default = defineCommand({
|
|
4
|
-
meta: {
|
|
5
|
-
name: "skill",
|
|
6
|
-
description: "Skill 中心:列表 / 安装 / 上传(REST,沙箱双凭证)"
|
|
7
|
-
},
|
|
8
|
-
subCommands: {
|
|
9
|
-
list: () => import("./list-BNZV4wei.mjs").then((m) => m.default),
|
|
10
|
-
install: () => import("./install-DP9xV1rY.mjs").then((m) => m.default),
|
|
11
|
-
upload: () => import("./upload-D4wSmRqs.mjs").then((m) => m.default)
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
//#endregion
|
|
15
|
-
export { skill_default as default };
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { l as requireUserId, p as ConfigInvalidError, u as resolveEndpoints } from "./env-vars-Dinhf5lt.mjs";
|
|
2
|
-
import { d as buildSandboxProof, f as requireSandboxSecrets, p as requireTenantId, u as WANGCLAW_AUTH_HEADER } from "./cli.mjs";
|
|
3
|
-
import { createWriteStream } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { createHash } from "node:crypto";
|
|
6
|
-
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
7
|
-
import { pipeline } from "node:stream/promises";
|
|
8
|
-
import { Readable } from "node:stream";
|
|
9
|
-
//#region src/core/skill-client.ts
|
|
10
|
-
/**
|
|
11
|
-
* Skill BFF REST client.
|
|
12
|
-
*
|
|
13
|
-
* Skill catalog/package operations intentionally do not use MCP. They call
|
|
14
|
-
* the Skill BFF /out API with the sandbox dual-secret proof:
|
|
15
|
-
*
|
|
16
|
-
* query: tenantId + userId
|
|
17
|
-
* X-Wangclaw-Authorization:
|
|
18
|
-
* base64url(SANDBOX_TENANT_SECRET:SANDBOX_USER_SECRET)
|
|
19
|
-
*/
|
|
20
|
-
const SUCCESS_CODE = "0";
|
|
21
|
-
function resolveSkillInstallDir() {
|
|
22
|
-
return process.env.SKILL_INSTALL_DIR?.trim() || "/home/wuying/jvscrew/.wangai-cli/skills";
|
|
23
|
-
}
|
|
24
|
-
function skillBffBaseUrl(endpoints) {
|
|
25
|
-
const override = process.env.SKILL_BFF_URL?.trim();
|
|
26
|
-
if (override) return override.replace(/\/$/, "");
|
|
27
|
-
return endpoints.skillBffUrl.replace(/\/$/, "");
|
|
28
|
-
}
|
|
29
|
-
function authQuery() {
|
|
30
|
-
const tenantId = requireTenantId();
|
|
31
|
-
const userId = requireUserId();
|
|
32
|
-
const { tenantSecret, userSecret } = requireSandboxSecrets();
|
|
33
|
-
return {
|
|
34
|
-
tenantId,
|
|
35
|
-
userId,
|
|
36
|
-
proof: buildSandboxProof(tenantSecret, userSecret)
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function buildUrl(path, extraQuery) {
|
|
40
|
-
const endpoints = resolveEndpoints();
|
|
41
|
-
const { tenantId, userId } = authQuery();
|
|
42
|
-
const url = new URL(path, `${skillBffBaseUrl(endpoints)}/`);
|
|
43
|
-
url.searchParams.set("tenantId", tenantId);
|
|
44
|
-
url.searchParams.set("userId", userId);
|
|
45
|
-
for (const [key, value] of Object.entries(extraQuery ?? {})) if (value != null && value !== "") url.searchParams.set(key, value);
|
|
46
|
-
return url;
|
|
47
|
-
}
|
|
48
|
-
async function skillFetch(method, path, opts) {
|
|
49
|
-
const { proof } = authQuery();
|
|
50
|
-
const url = buildUrl(path, opts?.query);
|
|
51
|
-
const headers = {
|
|
52
|
-
[WANGCLAW_AUTH_HEADER]: proof,
|
|
53
|
-
Accept: "application/json"
|
|
54
|
-
};
|
|
55
|
-
let body;
|
|
56
|
-
if (opts?.body !== void 0) {
|
|
57
|
-
headers["Content-Type"] = "application/json";
|
|
58
|
-
body = JSON.stringify(opts.body);
|
|
59
|
-
}
|
|
60
|
-
let response;
|
|
61
|
-
try {
|
|
62
|
-
response = await fetch(url, {
|
|
63
|
-
method,
|
|
64
|
-
headers,
|
|
65
|
-
body,
|
|
66
|
-
signal: AbortSignal.timeout(3e4)
|
|
67
|
-
});
|
|
68
|
-
} catch (err) {
|
|
69
|
-
throw new ConfigInvalidError(`Skill BFF 请求失败: ${err instanceof Error ? err.message : String(err)}`, "检查网络以及 /api/wc-skill/out/skills 服务是否可用");
|
|
70
|
-
}
|
|
71
|
-
const text = await response.text();
|
|
72
|
-
let envelope;
|
|
73
|
-
try {
|
|
74
|
-
envelope = JSON.parse(text);
|
|
75
|
-
} catch {
|
|
76
|
-
throw new Error(`Skill BFF 返回非 JSON(HTTP ${response.status}): ${text.slice(0, 200)}`);
|
|
77
|
-
}
|
|
78
|
-
if (!response.ok || String(envelope.code) !== SUCCESS_CODE) {
|
|
79
|
-
const message = envelope.msg || envelope.error || text.slice(0, 200);
|
|
80
|
-
throw new Error(`Skill BFF ${method} ${path} 失败: [${envelope.code ?? response.status}] ${message}`);
|
|
81
|
-
}
|
|
82
|
-
return envelope.data;
|
|
83
|
-
}
|
|
84
|
-
async function skillList(type, projectId) {
|
|
85
|
-
const pid = projectId?.trim();
|
|
86
|
-
if ((type === "tenant" || type === "project" || !type) && !pid) throw new Error(type ? `skill list --type ${type} 需要 projectId(可传 --project-id,或先 project use)` : "skill list 需要 projectId(可传 --project-id,或先 project use)");
|
|
87
|
-
return await skillFetch("GET", "out/skills", { query: {
|
|
88
|
-
type,
|
|
89
|
-
projectId: pid
|
|
90
|
-
} }) ?? [];
|
|
91
|
-
}
|
|
92
|
-
async function skillInstallGrant(skillId, projectId) {
|
|
93
|
-
const id = String(skillId).trim();
|
|
94
|
-
if (!/^\d+$/.test(id)) throw new Error("skill install 仅支持数字 id");
|
|
95
|
-
const pid = projectId?.trim();
|
|
96
|
-
if (!pid) throw new Error("skill install 需要 projectId(可传 --project-id,或先 project use)");
|
|
97
|
-
return skillFetch("GET", `out/skills/${encodeURIComponent(id)}/package`, { query: { projectId: pid } });
|
|
98
|
-
}
|
|
99
|
-
async function skillUploadInitiate(body) {
|
|
100
|
-
const ownerType = (body?.ownerType?.trim() || "personal").toLowerCase();
|
|
101
|
-
if (ownerType !== "personal" && ownerType !== "tenant" && ownerType !== "project") throw new Error("ownerType 仅支持 personal | tenant | project");
|
|
102
|
-
const projectId = body?.projectId?.trim();
|
|
103
|
-
if (ownerType === "project" && !projectId) throw new Error("ownerType=project 需要 projectId");
|
|
104
|
-
const payload = {
|
|
105
|
-
ownerType,
|
|
106
|
-
projectId
|
|
107
|
-
};
|
|
108
|
-
if (body?.skillId != null && String(body.skillId).trim() !== "") payload.skillId = String(body.skillId).trim();
|
|
109
|
-
return skillFetch("POST", "out/skills/uploads/initiate", { body: payload });
|
|
110
|
-
}
|
|
111
|
-
async function skillUploadConfirm(body) {
|
|
112
|
-
return skillFetch("POST", "out/skills/uploads/confirm", { body });
|
|
113
|
-
}
|
|
114
|
-
/** PUT the zip to the presigned upload URL returned by initiate. */
|
|
115
|
-
async function putSkillZip(uploadUrl, zipBytes, uploadHeaders) {
|
|
116
|
-
const headers = {
|
|
117
|
-
"Content-Type": "application/zip",
|
|
118
|
-
...uploadHeaders ?? {}
|
|
119
|
-
};
|
|
120
|
-
let response;
|
|
121
|
-
try {
|
|
122
|
-
response = await fetch(uploadUrl, {
|
|
123
|
-
method: "PUT",
|
|
124
|
-
headers,
|
|
125
|
-
body: zipBytes,
|
|
126
|
-
signal: AbortSignal.timeout(6e4)
|
|
127
|
-
});
|
|
128
|
-
} catch (err) {
|
|
129
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
130
|
-
throw new Error(`上传 Skill 包失败: ${detail}`);
|
|
131
|
-
}
|
|
132
|
-
if (!response.ok) {
|
|
133
|
-
const text = await response.text().catch(() => "");
|
|
134
|
-
throw new Error(`OSS PUT 失败 (${response.status}): ${text.slice(0, 200) || response.statusText}`);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
async function downloadSkillPackage(grant, installDir = resolveSkillInstallDir()) {
|
|
138
|
-
const skillDir = join(installDir, String(grant.skillId));
|
|
139
|
-
await mkdir(skillDir, { recursive: true });
|
|
140
|
-
const zipPath = join(skillDir, "package.zip");
|
|
141
|
-
let response;
|
|
142
|
-
try {
|
|
143
|
-
response = await fetch(grant.downloadUrl, { signal: AbortSignal.timeout(6e4) });
|
|
144
|
-
} catch (err) {
|
|
145
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
146
|
-
throw new Error(`下载 Skill 包失败: ${detail}`);
|
|
147
|
-
}
|
|
148
|
-
if (!response.ok || !response.body) throw new Error(`下载 Skill 包失败(HTTP ${response.status})`);
|
|
149
|
-
await pipeline(Readable.fromWeb(response.body), createWriteStream(zipPath));
|
|
150
|
-
if (grant.checksum) {
|
|
151
|
-
const bytes = await readFile(zipPath);
|
|
152
|
-
const actual = createHash("sha256").update(bytes).digest("hex");
|
|
153
|
-
if (actual.toLowerCase() !== grant.checksum.toLowerCase()) {
|
|
154
|
-
await rm(zipPath, { force: true });
|
|
155
|
-
throw new Error(`checksum 不匹配: expected ${grant.checksum}, got ${actual}`);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
await writeFile(join(skillDir, "meta.json"), JSON.stringify({
|
|
159
|
-
skillId: grant.skillId,
|
|
160
|
-
name: grant.name,
|
|
161
|
-
version: grant.version,
|
|
162
|
-
checksum: grant.checksum,
|
|
163
|
-
installedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
164
|
-
}, null, 2));
|
|
165
|
-
return {
|
|
166
|
-
skillDir,
|
|
167
|
-
zipPath
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
//#endregion
|
|
171
|
-
export { skillList as a, skillInstallGrant as i, putSkillZip as n, skillUploadConfirm as o, resolveSkillInstallDir as r, skillUploadInitiate as s, downloadSkillPackage as t };
|
package/dist/upload-D4wSmRqs.mjs
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { n as writeError, r as writeResult, t as formatCliArg } from "./cli.mjs";
|
|
2
|
-
import { n as putSkillZip, o as skillUploadConfirm, s as skillUploadInitiate } from "./skill-client-D4_QGDkj.mjs";
|
|
3
|
-
import { defineCommand } from "citty";
|
|
4
|
-
import { readFile } from "node:fs/promises";
|
|
5
|
-
//#region src/commands/skill/upload.ts
|
|
6
|
-
/**
|
|
7
|
-
* `beautx-cli skill upload <zip>` — initiate → PUT OSS → confirm.
|
|
8
|
-
*/
|
|
9
|
-
var upload_default = defineCommand({
|
|
10
|
-
meta: {
|
|
11
|
-
name: "upload",
|
|
12
|
-
description: "上传本地 Skill zip(init → PUT → confirm)"
|
|
13
|
-
},
|
|
14
|
-
args: {
|
|
15
|
-
path: {
|
|
16
|
-
type: "positional",
|
|
17
|
-
description: "本地 .zip 路径(需包含 SKILL.md)",
|
|
18
|
-
required: true
|
|
19
|
-
},
|
|
20
|
-
type: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description: "personal(默认)| tenant | project",
|
|
23
|
-
default: "personal"
|
|
24
|
-
},
|
|
25
|
-
"project-id": {
|
|
26
|
-
type: "string",
|
|
27
|
-
description: "项目 ID;type=project 时必填;type=tenant 时可选写入 skill.project_id"
|
|
28
|
-
},
|
|
29
|
-
"skill-id": {
|
|
30
|
-
type: "string",
|
|
31
|
-
description: "已有 Skill ID:替换该 Skill 包;不传则新建"
|
|
32
|
-
},
|
|
33
|
-
tags: {
|
|
34
|
-
type: "string",
|
|
35
|
-
description: "可选 tags JSON 数组字符串,如 '[\"a\",\"b\"]'"
|
|
36
|
-
},
|
|
37
|
-
format: formatCliArg
|
|
38
|
-
},
|
|
39
|
-
async run({ args }) {
|
|
40
|
-
try {
|
|
41
|
-
const type = args.type?.trim().toLowerCase() || "personal";
|
|
42
|
-
if (type !== "personal" && type !== "tenant" && type !== "project") throw new Error("type 仅支持 personal | tenant | project");
|
|
43
|
-
const projectId = args["project-id"]?.trim();
|
|
44
|
-
if (type === "project" && !projectId) throw new Error("type=project 需要 --project-id");
|
|
45
|
-
const zipBytes = await readFile(args.path.trim());
|
|
46
|
-
let skillId;
|
|
47
|
-
if (args["skill-id"]?.trim()) {
|
|
48
|
-
const raw = args["skill-id"].trim();
|
|
49
|
-
if (!/^\d+$/.test(raw)) throw new Error("skill-id 必须为数字");
|
|
50
|
-
skillId = raw;
|
|
51
|
-
}
|
|
52
|
-
const uploadToken = await skillUploadInitiate({
|
|
53
|
-
skillId,
|
|
54
|
-
ownerType: type,
|
|
55
|
-
projectId
|
|
56
|
-
});
|
|
57
|
-
await putSkillZip(uploadToken.uploadUrl, zipBytes, uploadToken.uploadHeaders);
|
|
58
|
-
const skill = await skillUploadConfirm({
|
|
59
|
-
uploadToken: uploadToken.token,
|
|
60
|
-
tags: args.tags?.trim() || void 0
|
|
61
|
-
});
|
|
62
|
-
writeResult({
|
|
63
|
-
skillId: skill.id,
|
|
64
|
-
name: skill.name,
|
|
65
|
-
version: skill.version,
|
|
66
|
-
status: skill.status,
|
|
67
|
-
ownerType: skill.ownerType
|
|
68
|
-
}, args.format);
|
|
69
|
-
} catch (err) {
|
|
70
|
-
writeError(err, args.format);
|
|
71
|
-
process.exit(1);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
//#endregion
|
|
76
|
-
export { upload_default as default };
|
|
File without changes
|
|
File without changes
|