feat: add dashboard command

This commit is contained in:
Peter Steinberger
2026-01-12 19:08:29 +00:00
parent 7dc44b04c1
commit bb7397c636
8 changed files with 276 additions and 21 deletions

View File

@@ -233,6 +233,28 @@ export async function openUrl(url: string): Promise<boolean> {
}
}
export async function copyToClipboard(value: string): Promise<boolean> {
const attempts: Array<{ argv: string[] }> = [
{ argv: ["pbcopy"] },
{ argv: ["xclip", "-selection", "clipboard"] },
{ argv: ["wl-copy"] },
{ argv: ["clip.exe"] }, // WSL / Windows
{ argv: ["powershell", "-NoProfile", "-Command", "Set-Clipboard"] },
];
for (const attempt of attempts) {
try {
const result = await runCommandWithTimeout(attempt.argv, {
timeoutMs: 3_000,
input: value,
});
if (result.code === 0 && !result.killed) return true;
} catch {
// keep trying the next fallback
}
}
return false;
}
export async function ensureWorkspaceAndSessions(
workspaceDir: string,
runtime: RuntimeEnv,