merge: feature/page-data-dev-aider into main

Bring in Page Data Aider dev loop, adm code-run policy UI, and customer order demo.
Keep system disclosure policy and agent code-run admin wiring side by side.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-24 14:42:25 +08:00
39 changed files with 3295 additions and 47 deletions
+78
View File
@@ -358,3 +358,81 @@ export async function resumeWechatDigest(id: string) {
method: 'POST',
});
}
// ─── Agent Code Run ───────────────────────────────────────────────────────────
export type AgentCodeRunConfigShape = {
codeRun: {
enabled: boolean;
clientEnabled: boolean;
generalAutodetect: boolean;
requireValidation: boolean;
userAllowlist: string[];
taskTypeAllowlist: string[];
};
pageDataDev: {
autodetect: boolean;
};
meta: {
notes: string;
};
};
export type AgentCodeRunAdminConfig = {
config: AgentCodeRunConfigShape;
updatedAt: number | null;
updatedBy: string | null;
source: string;
envOverrideActive: boolean;
};
export type AgentCodeRunRuntimeState = {
source: string;
updatedAt: number | null;
updatedBy: string | null;
config: AgentCodeRunConfigShape;
policy: {
source: string;
enabled: boolean;
clientEnabled: boolean;
generalAutodetect: boolean;
requireValidation: boolean;
pageDataDevAutodetect: boolean;
userAllowlist: string[];
taskTypeAllowlist: string[];
};
envOverrideActive: boolean;
};
export async function fetchAgentCodeRunConfig() {
return adminFetch<AgentCodeRunAdminConfig>('/admin-api/agent-code-run/config');
}
export async function fetchAgentCodeRunRuntime() {
return adminFetch<AgentCodeRunRuntimeState>('/admin-api/agent-code-run/runtime');
}
export async function patchAgentCodeRunConfig(body: { config: AgentCodeRunConfigShape }) {
return adminFetch<AgentCodeRunAdminConfig>('/admin-api/agent-code-run/config', {
method: 'PATCH',
body: JSON.stringify(body),
});
}
export type AgentCodeRunHistoryRow = {
id: string;
userId: string;
requestId: string;
status: string;
taskType: string;
executor: string | null;
errorMessage: string | null;
createdAt: number | null;
updatedAt: number | null;
};
export async function fetchAgentCodeRunHistory(limit = 50) {
return adminFetch<{ runs: AgentCodeRunHistoryRow[]; limit: number }>(
`/admin-api/agent-code-run/runs?limit=${limit}`,
);
}