@kevisual/cnb 0.0.49 → 0.0.50
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/dist/npc.js +12 -4
- package/package.json +1 -1
package/dist/npc.js
CHANGED
|
@@ -68162,7 +68162,7 @@ var getIssuesLabels = async () => {
|
|
|
68162
68162
|
console.error("获取 Issue 详情失败", res);
|
|
68163
68163
|
return [];
|
|
68164
68164
|
};
|
|
68165
|
-
var main = async ({ exit }) => {
|
|
68165
|
+
var main = async ({ exit, question }) => {
|
|
68166
68166
|
const repoInfoEnv = useRepoInfoEnv();
|
|
68167
68167
|
const commentEnv = useCommentEnv();
|
|
68168
68168
|
const issueEnv = useIssueEnv();
|
|
@@ -68194,7 +68194,7 @@ var main = async ({ exit }) => {
|
|
|
68194
68194
|
},
|
|
68195
68195
|
{
|
|
68196
68196
|
role: "user",
|
|
68197
|
-
content: commentEnv.commentBody || pickIssueEnv.issueDescription || "无"
|
|
68197
|
+
content: question || commentEnv.commentBody || pickIssueEnv.issueDescription || "无"
|
|
68198
68198
|
}
|
|
68199
68199
|
];
|
|
68200
68200
|
writeToProcess("输入消息:");
|
|
@@ -68223,16 +68223,24 @@ app.route({
|
|
|
68223
68223
|
metadata: {
|
|
68224
68224
|
tags: ["notInNpcAgent"],
|
|
68225
68225
|
args: {
|
|
68226
|
-
needExit: zod_default.boolean().optional().describe("是否需要在执行完成后退出进程")
|
|
68226
|
+
needExit: zod_default.boolean().optional().describe("是否需要在执行完成后退出进程"),
|
|
68227
|
+
owner: zod_default.string().optional().describe("用户名称")
|
|
68227
68228
|
}
|
|
68228
68229
|
}
|
|
68229
68230
|
}).define(async (ctx) => {
|
|
68230
68231
|
const needExit = ctx.args.needExit ?? true;
|
|
68232
|
+
const owner = ctx.args.owner || "";
|
|
68231
68233
|
const exit = (code) => {
|
|
68232
68234
|
if (needExit) {
|
|
68233
68235
|
process.exit(code);
|
|
68234
68236
|
}
|
|
68235
68237
|
};
|
|
68236
|
-
|
|
68238
|
+
const buildUserNickName = useKey("CNB_BUILD_USER_NICKNAME");
|
|
68239
|
+
let admins = owner.split(",").map((item) => item.trim());
|
|
68240
|
+
if (owner && admins.includes(buildUserNickName)) {
|
|
68241
|
+
await main({ exit });
|
|
68242
|
+
} else {
|
|
68243
|
+
await main({ exit, question: `你是${owner}的专属助手,请生成一条评论,说明你不具备其他用户能访问的能力。同时你需要提示说明,fork当前仓库后,即可成为你的专属助手` });
|
|
68244
|
+
}
|
|
68237
68245
|
}).addTo(app);
|
|
68238
68246
|
parse12({ app, description: "CNB控制台命令行工具", parse: true });
|