Something went wrong. Try again.
fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
Something went wrong. Try again.
585 B · 22 lines
TypeScript
1234567891011121314151617181920212223import { createRequire } from "module";
export type ClipboardModule = { setText: (text: string) => Promise<void>; hasImage: () => boolean; getImageBinary: () => Promise<Array<number>>;};
const require = createRequire(import.meta.url);let clipboard: ClipboardModule | null = null;
const hasDisplay = process.platform !== "linux" || Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
if (!process.env.TERMUX_VERSION && hasDisplay) { try { clipboard = require("@mariozechner/clipboard") as ClipboardModule; } catch { clipboard = null; }}
export { clipboard };