Rename attachment folder from .pi-web/paste to .pi-web/attachments

Attachments can be pasted, dropped, or uploaded, so 'paste' was too
narrow. Rename the default folder and filename prefix accordingly and
update the changeset reference.
This commit is contained in:
Federico Jaramillo Martinez
2026-06-17 01:02:33 +02:00
parent 81dba2abc9
commit 32d11de38c
6 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -10,7 +10,7 @@ import { resolveParentInsideWorkspace } from "../workspaces/pathSafety.js";
* Default workspace-relative folder used when saving pasted/dropped
* attachments for the agent to read with its own tools.
*/
export const DEFAULT_ATTACHMENT_FOLDER = ".pi-web/paste";
export const DEFAULT_ATTACHMENT_FOLDER = ".pi-web/attachments";
export interface InlineImage {
image: ImageContent;
@@ -42,7 +42,7 @@ export async function attachmentsToInlineImages(attachments: PromptAttachment[])
}
export interface SaveAttachmentsOptions {
/** Workspace-relative folder to write into. Defaults to `.pi-web/paste`. */
/** Workspace-relative folder to write into. Defaults to `.pi-web/attachments`. */
folder?: string;
/** Clock injection for deterministic tests. */
now?: () => Date;
@@ -66,7 +66,7 @@ export async function saveAttachmentsToWorkspace(
const saved: SavedPromptAttachment[] = [];
for (const [index, attachment] of attachments.entries()) {
const bytes = Buffer.from(attachment.data, "base64");
const filename = `paste-${stamp}-${String(index + 1)}.${extensionForImageMimeType(attachment.mimeType)}`;
const filename = `attachment-${stamp}-${String(index + 1)}.${extensionForImageMimeType(attachment.mimeType)}`;
const relativePath = `${folder}/${filename}`;
await writeFile(join(folderTarget, filename), bytes);
saved.push({ path: relativePath, mimeType: attachment.mimeType, size: bytes.byteLength });