feat: add memindadm runtime policy for agent code runs (Phase 1.5)

Persist code-run gates in admin DB and expose them via /auth/status so H5 can honor runtime policy without VITE rebuilds.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-23 21:33:27 +08:00
parent 13f5c740a1
commit 239c41f935
12 changed files with 639 additions and 43 deletions
+2
View File
@@ -42,6 +42,7 @@ import type {
} from '../types';
import { normalizeConversationMessages, normalizeUserMessageForApi } from '../utils/message';
import type { AgentRunCreateOptions, AgentRunValidation } from '../utils/agentRunMode';
import { applyAgentCodeRunClientPolicy } from '../utils/agentRunMode';
import {
API,
ApiError,
@@ -319,6 +320,7 @@ export async function checkAuth(): Promise<AuthStatus> {
return { authenticated: false };
}
if (status.authenticated) resetUnauthorizedGuard();
applyAgentCodeRunClientPolicy(status.agentCodeRun ?? null);
if (status.authenticated && status.mode === 'user' && !status.capabilities) {
try {
const me = await getMe();