refactor(ui): isolate session components (#33670)

This commit is contained in:
Victor Navarro 2026-06-24 16:56:09 +02:00 committed by GitHub
commit 04c1730c90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
126 changed files with 294 additions and 142 deletions

View file

@ -0,0 +1,14 @@
import type { FilePart } from "@opencode-ai/sdk/v2"
export function attached(part: FilePart) {
return part.url.startsWith("data:")
}
export function inline(part: FilePart) {
if (attached(part)) return false
return part.source?.text?.start !== undefined && part.source?.text?.end !== undefined
}
export function kind(part: FilePart) {
return part.mime.startsWith("image/") ? "image" : "file"
}