支持在会话输入框直接进行文件/图片的拖拽和粘贴

This commit is contained in:
xintaofei
2026-03-08 10:54:06 +08:00
parent 68e2c7f989
commit 7a4cbcb73e
24 changed files with 1335 additions and 78 deletions

View File

@@ -60,6 +60,12 @@ export type MessageRole = "user" | "assistant" | "system" | "tool"
export type ContentBlock =
| { type: "text"; text: string }
| {
type: "image"
data: string
mime_type: string
uri?: string | null
}
| {
type: "tool_use"
tool_use_id: string | null
@@ -304,8 +310,27 @@ export type ConnectionStatus =
| "disconnected"
| "error"
export interface PromptCapabilitiesInfo {
image: boolean
audio: boolean
embedded_context: boolean
}
export type PromptInputBlock =
| { type: "text"; text: string }
| {
type: "image"
data: string
mime_type: string
uri?: string | null
}
| {
type: "resource"
uri: string
mime_type?: string | null
text?: string | null
blob?: string | null
}
| {
type: "resource_link"
uri: string
@@ -430,6 +455,11 @@ export type AcpEvent =
type: "selectors_ready"
connection_id: string
}
| {
type: "prompt_capabilities"
connection_id: string
prompt_capabilities: PromptCapabilitiesInfo
}
| {
type: "mode_changed"
connection_id: string