feat(aipro): translate JSON output field names to Chinese in scopes and rules commands
This commit is contained in:
1 parent
b0149ed32d
commit
7e39d95b36
2 files changed
+9
-8
No files matched your search
+8
-7
@@ -147,8 +147,8 @@ export async function runAiProCli(rawArgs: string[]): Promise<{ stdout: string;
|
||||
});
|
||||
|
||||
const scopes = repo.listScopes().map((s) => ({
|
||||
index: s.index,
|
||||
scope: s.scope,
|
||||
索引号: s.index,
|
||||
适用场景: s.scope,
|
||||
}));
|
||||
return { stdout: JSON.stringify(scopes, null, 2) + "\n", stderr: "", exitCode: 0 };
|
||||
}
|
||||
@@ -297,7 +297,7 @@ export async function runAiProCli(rawArgs: string[]): Promise<{ stdout: string;
|
||||
};
|
||||
}
|
||||
|
||||
const rulesMap = new Map<number, { code: number; text: string }>();
|
||||
const rulesMap = new Map<number, { 编号: number; 适用场景: string; 规则明细: string }>();
|
||||
const notFound: number[] = [];
|
||||
|
||||
for (const idx of uniqueIndexes) {
|
||||
@@ -309,8 +309,9 @@ export async function runAiProCli(rawArgs: string[]): Promise<{ stdout: string;
|
||||
for (const r of detail.rules) {
|
||||
if (!rulesMap.has(r.code)) {
|
||||
rulesMap.set(r.code, {
|
||||
code: r.code,
|
||||
text: r.body,
|
||||
编号: r.code,
|
||||
适用场景: detail.scope,
|
||||
规则明细: r.body,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -324,8 +325,8 @@ export async function runAiProCli(rawArgs: string[]): Promise<{ stdout: string;
|
||||
};
|
||||
}
|
||||
|
||||
// 按照 code 顺序平铺规则 (形态 1)
|
||||
const flattenedRules = Array.from(rulesMap.values()).sort((a, b) => a.code - b.code);
|
||||
// 按照 编号 顺序平铺规则
|
||||
const flattenedRules = Array.from(rulesMap.values()).sort((a, b) => a.编号 - b.编号);
|
||||
|
||||
repo.logAiProAction({
|
||||
action: "rules",
|
||||
|
||||
@@ -697,7 +697,7 @@ export interface CreateAiProLogInput {
|
||||
documentSn?: string | null;
|
||||
operator?: string | null;
|
||||
args?: string | null;
|
||||
status: "SUCCESS" | "BLOCKED" | "ERROR";
|
||||
status?: "SUCCESS" | "BLOCKED" | "ERROR";
|
||||
decision?: ApprovalDecision | null;
|
||||
summary?: string | null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user