fix: file sizes from PowerShell, quoted mentions, dedupe and BOM
Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
1 parent
761a80004a
commit
1ed04fe9be
5 files changed
+339
-94
No files matched your search
@@ -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}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user