完善客户端模块与工作区能力
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-13 19:45:30 +08:00
parent 0148b91a15
commit 22add3f01f
97 changed files with 4756 additions and 3226 deletions

15
shared/agent-session.ts Normal file
View File

@@ -0,0 +1,15 @@
export type AgentSessionMessageRole = 'user' | 'assistant';
export type AgentSessionMessage = {
id?: string;
role: AgentSessionMessageRole;
created_at?: string;
text: string;
};
export type AgentSessionData = {
project_id: string;
session_id: string;
updated_at: string;
messages: AgentSessionMessage[];
};

View File

@@ -61,6 +61,8 @@ export type DesignConversationSummary = {
conversationId: string;
workspaceId: string;
title: string;
/** A compact preview for history navigation; full messages are loaded on selection. */
latestMessagePreview?: string | null;
turnRevision: number;
phase: DesignWorkspacePhase;
brief: DesignBrief;

View File

@@ -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;