fix: file sizes from PowerShell, quoted mentions, dedupe and BOM

Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
FactorandOvis Fast committed 2026-11-19 11:40:40 +01:00
1 parent 761a80004a
commit 1ed04fe9be
5 files changed
+339 -94

No files matched your search

+6 -1
View File
@@ -79,13 +79,18 @@ export function validateMany(files) {
/**
* The mention of an attachment - the path as the agent sees it.
*
* A path with whitespace in it is quoted - `@"/a b/c.png"` - or the agent
* would read only the part up to the first space; any other path stays bare
* (`@/a/c.png`). `removeMention` takes out exactly the form built here.
*
* @param {string} path - the path on the agent's machine
* @returns {string} the mention, or nothing when there is no path
*/
export function mention(path) {
if (typeof path !== "string") return "";
const clean = path.trim();
return clean === "" ? "" : `@${clean}`;
if (clean === "") return "";
return /\s/.test(clean) ? `@"${clean}"` : `@${clean}`;
}
/**