feat(agents): 新增云端智能体入口与草稿编辑
This commit is contained in:
28
shared/cloud-agents.ts
Normal file
28
shared/cloud-agents.ts
Normal 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;
|
||||
}
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user