feat: add system disclosure policy gate
Memind CI / Test, build, and release guards (pull_request) Successful in 3m14s

This commit is contained in:
john
2026-07-23 22:53:15 +08:00
parent ba6cc10f08
commit 205b5fd8be
20 changed files with 1585 additions and 2 deletions
+34
View File
@@ -177,12 +177,46 @@ export type CreateWechatNotificationPayload = {
channels?: Array<'web' | 'wechat'>;
};
export type SystemDisclosureMode = 'off' | 'shadow' | 'enforce';
export type SystemDisclosurePolicyConfig = {
enabled: boolean;
mode: SystemDisclosureMode;
refusalText: string;
productNames: string[];
selfReferences: string[];
categories: Record<string, boolean>;
};
export type SystemDisclosurePolicyState = {
config: SystemDisclosurePolicyConfig;
policyVersion: number;
updatedBy: string | null;
updatedAt: number | null;
source: string;
refreshedAt?: number | null;
lastRefreshError?: string | null;
};
// ─── Summary ──────────────────────────────────────────────────────────────────
export async function fetchAdminSummary() {
return adminFetch<{ summary: AdminSummary }>('/admin-api/summary');
}
// ─── Trust & Policy ───────────────────────────────────────────────────────────
export async function fetchSystemDisclosurePolicy() {
return adminFetch<SystemDisclosurePolicyState>('/admin-api/system-disclosure-policy/config');
}
export async function updateSystemDisclosurePolicy(config: SystemDisclosurePolicyConfig) {
return adminFetch<SystemDisclosurePolicyState>('/admin-api/system-disclosure-policy/config', {
method: 'PUT',
body: JSON.stringify({ config }),
});
}
// ─── Users ────────────────────────────────────────────────────────────────────
export async function fetchAdminUsers(params: {