完善客户端模块与工作区能力
This commit is contained in:
@@ -19,6 +19,7 @@ export type ProjectAgentResponsibility = {
|
||||
export type ProjectAgentConfig = {
|
||||
id: string;
|
||||
avatarId: string;
|
||||
avatarDataUrl?: string;
|
||||
roleName: string;
|
||||
name: string;
|
||||
builtIn: boolean;
|
||||
@@ -33,6 +34,16 @@ export type ProjectAgentConfig = {
|
||||
updatedAt?: string;
|
||||
};
|
||||
|
||||
export const MAX_PROJECT_AGENT_AVATAR_DATA_URL_LENGTH = 800_000;
|
||||
|
||||
const PROJECT_AGENT_AVATAR_DATA_URL_PATTERN = /^data:image\/(?:webp|png|jpeg);base64,[A-Za-z0-9+/]+={0,2}$/u;
|
||||
|
||||
export function isProjectAgentAvatarDataUrl(value: unknown): value is string {
|
||||
return typeof value === 'string'
|
||||
&& value.length <= MAX_PROJECT_AGENT_AVATAR_DATA_URL_LENGTH
|
||||
&& PROJECT_AGENT_AVATAR_DATA_URL_PATTERN.test(value);
|
||||
}
|
||||
|
||||
export type ProjectConfig = {
|
||||
schemaVersion: 1;
|
||||
projectType: ProjectType;
|
||||
|
||||
Reference in New Issue
Block a user