吸收数字员工管理端低风险动作闭环

This commit is contained in:
baiyanyun
2026-06-12 21:17:51 +08:00
parent be901ee112
commit b3f21adecb
27 changed files with 1186 additions and 11 deletions

View File

@@ -1149,6 +1149,38 @@ function checkDigitalPolicySchedulerWorkbenches() {
console.log("[DigitalEmployeeCheck] policy center and scheduler workbench hooks OK");
}
function checkDigitalAdminActionLoop() {
console.log("\n[DigitalEmployeeCheck] Verify admin action pull/apply loop hooks");
const syncServicePath = path.join(packageRoot, "src", "main", "services", "digitalEmployee", "syncService.ts");
const ipcPath = path.join(packageRoot, "src", "main", "ipc", "digitalEmployeeHandlers.ts");
const preloadPath = path.join(packageRoot, "src", "preload", "webviewPerfBridge.ts");
const adapterPath = path.join(packageRoot, "embedded", "sgrobot-digital", "src", "lib", "qimingclawAdapter.ts");
const apiPath = path.join(packageRoot, "embedded", "sgrobot-digital", "src", "lib", "api.ts");
const syncService = fs.readFileSync(syncServicePath, "utf8");
const ipc = fs.readFileSync(ipcPath, "utf8");
const preload = fs.readFileSync(preloadPath, "utf8");
const adapter = fs.readFileSync(adapterPath, "utf8");
const api = fs.readFileSync(apiPath, "utf8");
const requiredSnippets = [
[syncService, "pullAndApplyDigitalEmployeeAdminActions", "admin action pull service"],
[syncService, "admin_action_applied", "admin action applied event"],
[syncService, "admin_action_rejected", "admin action rejected event"],
[syncService, "admin_action_failed", "admin action failed event"],
[syncService, "cleanup_file_batch", "high risk cleanup rejection guard"],
[ipc, "digitalEmployee:pullAdminActions", "admin action IPC"],
[preload, "pullAdminActions", "admin action preload bridge"],
[adapter, "/api/digital-employee/admin/actions/pull", "admin action adapter endpoint"],
[api, "pullAdminActions", "embedded admin action API helper"],
];
const missing = requiredSnippets
.filter(([content, snippet]) => !content.includes(snippet))
.map(([, , label]) => label);
if (missing.length > 0) {
throw new Error(`Missing admin action loop hooks: ${missing.join(", ")}`);
}
console.log("[DigitalEmployeeCheck] admin action pull/apply loop hooks OK");
}
function checkLocalDatabaseSchema() {
console.log("\n[DigitalEmployeeCheck] Verify local SQLite digital schema");
const dbPath = path.join(os.homedir(), ".qimingclaw", "qimingclaw.db");
@@ -1207,6 +1239,7 @@ function main() {
checkDigitalMemoryGovernanceAudit();
checkDigitalOpsNotificationReportWorkbenches();
checkDigitalPolicySchedulerWorkbenches();
checkDigitalAdminActionLoop();
checkLocalDatabaseSchema();
console.log("\n[DigitalEmployeeCheck] All checks passed");
} catch (error) {