feat: add support for claude pro and max plans (#327)

This commit is contained in:
jnjpng
2025-12-19 16:26:41 -08:00
committed by GitHub
parent 8c5618ec36
commit f9bffaed81
11 changed files with 1750 additions and 2 deletions

View File

@@ -4,6 +4,43 @@ import { existsSync, readFileSync, statSync } from "node:fs";
import { basename, extname, isAbsolute, resolve } from "node:path";
import { allocateImage } from "./pasteRegistry";
/**
* Copy text to system clipboard
* Returns true if successful, false otherwise
*/
export function copyToClipboard(text: string): boolean {
try {
if (process.platform === "darwin") {
execFileSync("pbcopy", [], { input: text, encoding: "utf8" });
return true;
} else if (process.platform === "win32") {
execFileSync("clip", [], { input: text, encoding: "utf8" });
return true;
} else {
// Linux - try xclip first, then xsel
try {
execFileSync("xclip", ["-selection", "clipboard"], {
input: text,
encoding: "utf8",
});
return true;
} catch {
try {
execFileSync("xsel", ["--clipboard", "--input"], {
input: text,
encoding: "utf8",
});
return true;
} catch {
return false;
}
}
}
} catch {
return false;
}
}
const IMAGE_EXTS = new Set([
".png",
".jpg",