feat(app): the bot browser's window on a virtual monitor to share in Discord

- features.browserShare (봇용 크롬창 화면공유 선택 표시, off by default) and a driver card on the
  features screen: the Virtual Display Driver 25.7.23 (MIT, SignPath-signed) ships in
  display-driver/ (hash-checked by package.sh); install and uninstall run jarvis.exe elevated
  once (--display-driver), settings in %ProgramData%\JarvisBot\display-driver, another
  program's copy of the driver is left alone
- the monitor is on the desktop only while the bot browser uses it, at the rightmost real
  monitor's bottom-right corner; the stop closes Chrome first, then takes the monitor off
- Chrome starts with no window and the app opens it over CDP in the background, so it never
  takes the focus; the window is a tool window (no Alt+Tab, no taskbar button), fills the
  monitor's work area and keeps drawing when covered; without a monitor it runs headless with
  the reason on the dashboard
- Chrome runs with --do-not-de-elevate on Windows: started by an app running as administrator
  it restarted itself as the user and the app lost hold of it
- checked on the win-ci Windows VM from install to uninstall (focus kept while typing, no
  taskbar button, no Chrome left, nothing left after uninstall) and on Linux with a real Chrome

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 02:43:32 +09:00
parent 56212c06dc
commit 1bd7defbb4
17 changed files with 884 additions and 43 deletions

View File

@@ -385,6 +385,28 @@ async function tokenCard() {
} }, "확인 후 저장")), out);
}
/** The virtual monitor's driver for "봇용 크롬창 화면공유 선택 표시" (Windows only). */
async function displayDriverCard() {
const st = await api("display_driver_status");
if (!st.supported) return null;
const label = h("span");
const btn = h("button", { class: "btn" });
const show = (s) => {
label.textContent = s.installed ? "설치됨" : s.other ? "다른 프로그램의 같은 드라이버가 있어 쓰지 않습니다" : "설치되지 않음";
btn.textContent = s.installed ? "드라이버 제거" : "드라이버 설치";
btn.disabled = s.other;
btn.onclick = async () => {
btn.disabled = true;
try { show(await api(s.installed ? "display_driver_uninstall" : "display_driver_install")); toast("완료했습니다"); }
catch (e) { fail(e); show(await api("display_driver_status")); }
};
};
show(st);
return h("div", { class: "card" }, h("h2", {}, "가상 모니터 드라이버"),
h("p", { class: "small muted" }, "봇용 크롬창을 실제 모니터에는 보이지 않는 가상 모니터에 두어, 디스코드 화면 공유의 \"화면\" 탭에서 고를 수 있게 합니다. 설치할 때 관리자 권한과 Windows의 장치 소프트웨어 설치 확인(SignPath Foundation)을 한 번 묻습니다."),
h("div", { class: "row" }, label, btn));
}
// ---- dashboard ----------------------------------------------------------------------------------
/** The header with the start/stop buttons; rebuilt only when the state changes, so a click is not
@@ -543,7 +565,7 @@ async function show(name) {
if (name === "logs") { const l = logsScreen(); screen.replaceChildren(l.view); ticker = setInterval(l.tick, 1000); return; }
const titles = { bot: "봇", channels: "채널·호출", chat: "채팅 채널", memory: "대화 기억", model: "모델", features: "기능",
collect: "백그라운드 수집" };
const extra = name === "bot" ? await tokenCard() : null;
const extra = name === "bot" ? await tokenCard() : name === "features" ? await displayDriverCard() : null;
const view = await settingsScreen(name, titles[name], extra);
if (name === "collect") view.append(await collectResults());
if (my === gen) screen.replaceChildren(view);