Archived
feat: support general chat file attachments
This commit is contained in:
+18
-6
@@ -176,14 +176,13 @@ export interface QueuedSessionMessage {
|
||||
}
|
||||
|
||||
/**
|
||||
* A binary attachment carried with a prompt. The wire format mirrors pi's own
|
||||
* `ImageContent` shape (`{ type: "image", data, mimeType }`) so attachments are
|
||||
* fully compatible with the underlying pi coding agent.
|
||||
* A pi-native image attachment carried with a prompt. The wire format mirrors
|
||||
* pi's own `ImageContent` shape (`{ type: "image", data, mimeType }`) so these
|
||||
* attachments are compatible with native multimodal delivery after validation.
|
||||
*/
|
||||
export interface PromptAttachment {
|
||||
/** Kind of attachment. Only images are supported by pi today. */
|
||||
export interface PromptImageAttachment {
|
||||
kind: "image";
|
||||
/** IANA mime type (for example "image/png"). */
|
||||
/** Supported image MIME type (image/png, image/jpeg, image/gif, or image/webp). */
|
||||
mimeType: string;
|
||||
/** Base64-encoded binary payload (no data: URL prefix). */
|
||||
data: string;
|
||||
@@ -191,6 +190,19 @@ export interface PromptAttachment {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/** A general file attachment that must be saved into the workspace before use. */
|
||||
export interface PromptFileAttachment {
|
||||
kind: "file";
|
||||
/** Non-empty IANA MIME type (for example "application/pdf"). */
|
||||
mimeType: string;
|
||||
/** Base64-encoded binary payload (no data: URL prefix). Empty for zero-byte files. */
|
||||
data: string;
|
||||
/** Optional original filename, used for previews and folder-mode filenames. */
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export type PromptAttachment = PromptImageAttachment | PromptFileAttachment;
|
||||
|
||||
/**
|
||||
* How prompt attachments should be delivered to the session.
|
||||
* - "inline": send the binary to pi as native image content (multimodal input).
|
||||
|
||||
Reference in New Issue
Block a user