- Archive dormant apps (daemon, desktop, native, tui) and superseded packages/server into repos/ for reference - Archive 21 dead web components (chat page shell, work-os cluster, strays) into repos/web/; keep reused message-rendering primitives in components/chat - Merge @code/work-os into @code/primitives; work.ts absorbed via ./work subpath and barrel export; update all four importers - Add docs/futures.md tracking audio/video (blocked at Flue + provider), web layout cleanup, and message rendering quality - Repoint dev:zopu script to @code/agents (the live Flue server) - Note repos/ reference-code convention in AGENTS.md
35 lines
810 B
TypeScript
35 lines
810 B
TypeScript
import { BrowserWindow, Updater } from "electrobun/bun";
|
|
|
|
const DEV_SERVER_PORT = 5173;
|
|
const DEV_SERVER_URL = `http://localhost:${DEV_SERVER_PORT}`;
|
|
|
|
async function getMainViewUrl(): Promise<string> {
|
|
const channel = await Updater.localInfo.channel();
|
|
if (channel === "dev") {
|
|
try {
|
|
await fetch(DEV_SERVER_URL, { method: "HEAD" });
|
|
console.log(`HMR enabled: Using web dev server at ${DEV_SERVER_URL}`);
|
|
return DEV_SERVER_URL;
|
|
} catch {
|
|
console.log("Web dev server not running. Run dev:hmr for live reload.");
|
|
}
|
|
}
|
|
|
|
return "views://mainview/index.html";
|
|
}
|
|
|
|
const url = await getMainViewUrl();
|
|
|
|
new BrowserWindow({
|
|
title: "code",
|
|
url,
|
|
frame: {
|
|
width: 1280,
|
|
height: 820,
|
|
x: 120,
|
|
y: 120,
|
|
},
|
|
});
|
|
|
|
console.log("Electrobun desktop shell started.");
|