Update project structure and dependencies; add architecture documentation and improve build scripts. Introduce new versioning and permissions for enhanced functionality.

This commit is contained in:
go0p
2026-08-06 15:11:35 +08:00
committed by go0p
parent c8380de521
commit 0371a8b802
113 changed files with 15944 additions and 6556 deletions
+28
View File
@@ -0,0 +1,28 @@
import type { AuditEvent, HandoffReason, HumanHandoff } from '@/types/models';
export const HANDOFF_REASON_LABELS: Record<HandoffReason, string> = {
qr_code: '需要扫码',
mfa: '需要二次验证',
captcha: '需要完成验证码',
device_confirmation: '需要设备确认',
other: '需要人工操作',
};
export const AUDIT_CATEGORY_LABELS: Record<AuditEvent['category'], string> = {
grant: '授权',
bridge: 'Bridge',
capability: '能力调用',
handoff: '人工接管',
settings: '设置',
};
export const AUDIT_OUTCOME_LABELS: Record<AuditEvent['outcome'], string> = {
success: '成功',
denied: '已拒绝',
error: '错误',
cancelled: '已取消',
};
export function waitingHandoff(handoff?: HumanHandoff): HumanHandoff | undefined {
return handoff?.state === 'waiting_for_user' ? handoff : undefined;
}