port goose2 chat attachments into goose (#8534)

Signed-off-by: tulsi <tulsi@block.xyz>
This commit is contained in:
tulsi
2026-04-14 14:26:43 -07:00
committed by GitHub
parent 8e04d7c8be
commit 210ef52d81
38 changed files with 2142 additions and 356 deletions
+24
View File
@@ -6,6 +6,18 @@ export interface FileTreeEntry {
kind: "file" | "directory";
}
export interface AttachmentPathInfo {
name: string;
path: string;
kind: "file" | "directory";
mimeType?: string | null;
}
export interface ImageAttachmentPayload {
base64: string;
mimeType: string;
}
export async function getHomeDir(): Promise<string> {
return invoke("get_home_dir");
}
@@ -33,3 +45,15 @@ export async function listDirectoryEntries(
): Promise<FileTreeEntry[]> {
return invoke("list_directory_entries", { path });
}
export async function inspectAttachmentPaths(
paths: string[],
): Promise<AttachmentPathInfo[]> {
return invoke("inspect_attachment_paths", { paths });
}
export async function readImageAttachment(
path: string,
): Promise<ImageAttachmentPayload> {
return invoke("read_image_attachment", { path });
}
@@ -1,8 +1,11 @@
{
"attachments": {
"alt": "Attachment {{index}}",
"dropToAttach": "Drop images to attach",
"remove": "Remove image",
"chooseFilesDialogTitle": "Choose files to attach",
"chooseFoldersDialogTitle": "Choose folders to attach",
"dropToAttach": "Drop files or folders to attach",
"open": "Open attachment {{name}}",
"remove": "Remove attachment",
"view": "View attachment {{index}}"
},
"context": {
@@ -141,6 +144,9 @@
},
"toolbar": {
"agent": "Agent",
"attach": "Attach",
"attachFile": "File",
"attachFolder": "Folder",
"chooseAgentModel": "Choose agent and model",
"chooseProject": "Choose a project",
"chooseProvider": "Choose a provider",
@@ -1,8 +1,11 @@
{
"attachments": {
"alt": "Adjunto {{index}}",
"dropToAttach": "Suelta imágenes para adjuntarlas",
"remove": "Eliminar imagen",
"chooseFilesDialogTitle": "Elegir archivos para adjuntar",
"chooseFoldersDialogTitle": "Elegir carpetas para adjuntar",
"dropToAttach": "Suelta archivos o carpetas para adjuntarlos",
"open": "Abrir adjunto {{name}}",
"remove": "Eliminar adjunto",
"view": "Ver adjunto {{index}}"
},
"context": {
@@ -141,6 +144,9 @@
},
"toolbar": {
"agent": "Agente",
"attach": "Adjuntar",
"attachFile": "Archivo",
"attachFolder": "Carpeta",
"chooseAgentModel": "Elegir agente y modelo",
"chooseProject": "Elegir un proyecto",
"chooseProvider": "Elegir un proveedor",
+30 -3
View File
@@ -1,9 +1,35 @@
export interface PastedImage {
base64: string;
export type ChatAttachmentKind = "image" | "file" | "directory";
export interface ChatImageAttachmentDraft {
id: string;
kind: "image";
name: string;
path?: string;
mimeType: string;
objectUrl: string;
base64: string;
previewUrl: string;
}
export interface ChatFileAttachmentDraft {
id: string;
kind: "file";
name: string;
path?: string;
mimeType?: string;
}
export interface ChatDirectoryAttachmentDraft {
id: string;
kind: "directory";
name: string;
path: string;
}
export type ChatAttachmentDraft =
| ChatImageAttachmentDraft
| ChatFileAttachmentDraft
| ChatDirectoryAttachmentDraft;
// Message roles
export type MessageRole = "user" | "assistant" | "system";
@@ -97,6 +123,7 @@ export interface MessageAttachment {
name: string;
path?: string;
url?: string;
mimeType?: string;
}
export interface MessageChip {