Refine skill and CLI for business-user centric experience

This commit is contained in:
gitea committed 2026-09-20 11:41:36 +08:00
1 parent 7bbddd7aba
commit b5e6cc0282
8 files changed
+484 -581

No files matched your search

+14 -3
View File
@@ -22,6 +22,7 @@ export interface TenantDoctorDiagnosis {
sourceType: string;
boundCorpId?: string;
boundCorpRole?: "prodParent" | "testTarget";
boundCorpRoleDescription?: string;
};
summary: {
totalChecks: number;
@@ -58,6 +59,11 @@ export async function diagnoseTenantContract(
const environment = corp.environment === "test" ? "test" : "production";
const boundCorpId = environment === "test" ? corp.prodCorpId : corp.testCorpId;
const boundCorpRole = environment === "test" ? "prodParent" : "testTarget";
const boundCorpRoleDescription = boundCorpId
? environment === "test"
? "已绑定生产母企业 (上游配置与样本源)"
: "已绑定测试靶场 (下游隔离演练环境)"
: undefined;
// 1. Auth & Admin Probe
let userDetail: any = null;
@@ -78,6 +84,8 @@ export async function diagnoseTenantContract(
userId: userDetail.id,
userName: userDetail.name,
isAdmin: true,
permissionLevel: "超级管理员(具备完整操作权限)",
tenantName: tenantDetail?.name,
tenantSlug: tenantDetail?.tenantSlug,
permissions: userDetail.permissions
}
@@ -92,6 +100,8 @@ export async function diagnoseTenantContract(
userId: userDetail.id,
userName: userDetail.name,
isAdmin: false,
permissionLevel: "普通用户(部分管理配置受限)",
tenantName: tenantDetail?.name,
permissions: userDetail.permissions
},
recommendation: "建议使用具有管理权限的企业主账号执行规则修改与集成发布"
@@ -301,7 +311,7 @@ export async function diagnoseTenantContract(
name: "测试环境配对契约",
status: "pass",
summary: `测试租户已绑定生产母企业「${boundCorpId}」,具备样本拉取与配置同步能力`,
details: { environment, boundCorpId, boundCorpRole }
details: { environment, boundCorpId, boundCorpRole, boundCorpRoleDescription }
});
} else {
checks.push({
@@ -320,7 +330,7 @@ export async function diagnoseTenantContract(
name: "生产环境安全隔离契约",
status: "pass",
summary: `生产企业已绑定沙箱测试靶场「${boundCorpId}」,回归测试将严格限制在靶场中运行`,
details: { environment, boundCorpId, boundCorpRole }
details: { environment, boundCorpId, boundCorpRole, boundCorpRoleDescription }
});
} else {
checks.push({
@@ -356,7 +366,8 @@ export async function diagnoseTenantContract(
environment,
sourceType: corp.source?.type ?? "native",
boundCorpId,
boundCorpRole
boundCorpRole,
boundCorpRoleDescription
},
summary: {
totalChecks: checks.length,