65 lines
1.4 KiB
TypeScript
65 lines
1.4 KiB
TypeScript
export interface AttachedFileMeta {
|
|
fileName: string;
|
|
mimeType: string;
|
|
fileSize: number;
|
|
preview: string | null;
|
|
filePath?: string;
|
|
source?: 'user-upload' | 'tool-result' | 'message-ref';
|
|
}
|
|
|
|
export interface ContentBlockSource {
|
|
type: string;
|
|
media_type?: string;
|
|
data?: string;
|
|
url?: string;
|
|
}
|
|
|
|
export interface ContentBlock {
|
|
type: 'text' | 'image' | 'thinking' | 'tool_use' | 'tool_result' | 'toolCall' | 'toolResult';
|
|
text?: string;
|
|
thinking?: string;
|
|
source?: ContentBlockSource;
|
|
data?: string;
|
|
mimeType?: string;
|
|
id?: string;
|
|
name?: string;
|
|
input?: unknown;
|
|
arguments?: unknown;
|
|
content?: string | ContentBlock[];
|
|
}
|
|
|
|
export type RawMessageRole = 'user' | 'assistant' | 'system' | 'toolresult' | 'tool_result';
|
|
|
|
export interface RawMessage {
|
|
role: RawMessageRole;
|
|
content: string | ContentBlock[];
|
|
timestamp?: number;
|
|
id?: string;
|
|
toolCallId?: string;
|
|
toolName?: string;
|
|
details?: unknown;
|
|
isError?: boolean;
|
|
question?: string[];
|
|
toolCall?: Record<string, unknown> | null;
|
|
_attachedFiles?: AttachedFileMeta[];
|
|
}
|
|
|
|
export interface ToolStatus {
|
|
id?: string;
|
|
toolCallId?: string;
|
|
name: string;
|
|
status: 'running' | 'completed' | 'error';
|
|
durationMs?: number;
|
|
summary?: string;
|
|
updatedAt: number;
|
|
}
|
|
|
|
export interface ChatSession {
|
|
key: string;
|
|
label?: string;
|
|
displayName?: string;
|
|
thinkingLevel?: string;
|
|
model?: string;
|
|
updatedAt?: number;
|
|
}
|