feat(agents): 新增云端智能体入口与草稿编辑

This commit is contained in:
2026-09-10 16:00:37 +08:00
parent 927a85fa22
commit 46fbae9dec
21 changed files with 921 additions and 17 deletions

28
shared/cloud-agents.ts Normal file
View File

@@ -0,0 +1,28 @@
export const CLOUD_AGENTS_PATH = '/api/cloud-agents';
export interface CloudAgentDraft {
slug: string;
name: string;
purpose: string;
system_prompt: string;
draft_revision: number;
updated_at: string;
}
export interface CloudAgentPage {
agents: CloudAgentDraft[];
next_cursor: string | null;
}
export interface CreateCloudAgent {
operation_id: string;
name: string;
purpose: string;
}
export interface SaveCloudAgentDraft {
expected_revision: number;
name: string;
purpose: string;
system_prompt: string;
}

View File

@@ -2,6 +2,7 @@ export const MODULE_ACCESS_KEYS = [
'programming',
'design',
'robot',
'cloud_agents',
] as const;
export type ModuleAccessKey = typeof MODULE_ACCESS_KEYS[number];
@@ -12,6 +13,7 @@ export const DEFAULT_MODULE_ACCESS: ModuleAccess = {
programming: true,
design: true,
robot: true,
cloud_agents: true,
};
export function normalizeModuleAccess(value: unknown): ModuleAccess {
@@ -23,5 +25,6 @@ export function normalizeModuleAccess(value: unknown): ModuleAccess {
programming: typeof record.programming === 'boolean' ? record.programming : true,
design: typeof record.design === 'boolean' ? record.design : true,
robot: typeof record.robot === 'boolean' ? record.robot : true,
cloud_agents: typeof record.cloud_agents === 'boolean' ? record.cloud_agents : true,
};
}