{"_id":"@buckeyestudio/toh-desktop","name":"@buckeyestudio/toh-desktop","dist-tags":{"next":"0.1.1-rc.2","latest":"0.1.1-rc.2"},"versions":{"0.1.1-rc.2":{"name":"@buckeyestudio/toh-desktop","description":"Desktop container app: one Electron window around the toh web surface; the main process spawns the built toh web backend on a loopback port and loads its URL line","version":"0.1.1-rc.2","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"apps/desktop"},"type":"module","main":"lib/main.js","exports":{".":{"types":"./lib/types/main.d.ts","default":"./lib/main.js"},"./backend":{"types":"./lib/types/backend.d.ts","default":"./lib/backend.js"},"./package.json":"./package.json"},"license":"MIT","dependencies":{"@buckeyestudio/toh":"^0.1.1-rc.2"},"devDependencies":{"electron":"^43.4.1"},"scripts":{"build":"tsdown","start":"electron ."},"_id":"@buckeyestudio/toh-desktop@0.1.1-rc.2","bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","_integrity":"sha512-eDH9YezGpHEm6Tz0SiY956zGhcChEptCNlSshq6R75gy5osxjMpY8IzgzDtGZn656Nm+yhxmL4bVHEQ7XyHJ6A==","_resolved":"/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-desktop-0.1.1-rc.2.tgz","_from":"file:/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-desktop-0.1.1-rc.2.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-eDH9YezGpHEm6Tz0SiY956zGhcChEptCNlSshq6R75gy5osxjMpY8IzgzDtGZn656Nm+yhxmL4bVHEQ7XyHJ6A==","shasum":"79b27e256cc281262442fa574294ecda5a4f257d","tarball":"https://registry.npmjs.org/@buckeyestudio/toh-desktop/-/toh-desktop-0.1.1-rc.2.tgz","fileCount":9,"unpackedSize":16611,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDZ6sCdgYHpr0UGNb17rp/M1IyfDSEvGYdkRBvjWsgcgAIhAN+UHVgtMA+CpDhMk+84nzc8FiJcH/aI82TIo0iA7ww1"}]},"_npmUser":{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"},"directories":{},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/toh-desktop_0.1.1-rc.2_1787489777656_0.1981766025458147"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T12:56:17.523Z","0.1.1-rc.2":"2026-08-23T12:56:17.808Z","modified":"2026-08-23T12:56:18.081Z"},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"description":"Desktop container app: one Electron window around the toh web surface; the main process spawns the built toh web backend on a loopback port and loads its URL line","homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"apps/desktop"},"bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"license":"MIT","readme":"# `@buckeyestudio/toh-desktop`\n\n[English](README.md) | 中文\n\n桌面容器应用：用一个 Electron 窗口承载 Harness Web GUI。其主进程挑选一个空闲回环端口，在其上启动构建好的 `toh web` 后端，等待该端口响应 HTTP，再在窗口中加载它；关闭窗口即停止整个后端进程树。\n\n## 运行\n\n生产运行需要先完成构建产物。在仓库根目录执行：\n\n```sh\npnpm run build\npnpm --filter @buckeyestudio/toh-desktop exec electron .\n```\n\n应用拒绝并发第二个实例：再次启动只会聚焦已有窗口，而不会启动第二个后端。\n\n## 组成方式\n\n| 模块 | 职责 |\n|---|---|\n| [`src/main.ts`](src/main.ts) | Electron 主进程：窗口生命周期、单实例锁、导航防护、致命错误对话框。 |\n| [`src/backend.ts`](src/backend.ts) | 挑选空闲的 127.0.0.1 端口，以普通 Node（Loader 的模块解析需要原生 Node 语义）运行 `apps/cli` 构建出的 `lib/bin.js`，参数为 `--profile web --port <端口> --no-open`；通过轮询 HTTP 服务确认就绪，并在退出时负责进程树终止。 |\n\n就绪判断是对后端服务的 HTTP 探测，而不是读取其标准输出：GUI 子进程的管道式标准输出会干扰 CLI 的模块解析，探测也让启动与后端的 `printUrl` 组合解耦。渲染层保留普通浏览器传输（对 `/api` 网关的回环 HTTP 加 SSE）；没有 preload 桥接，除 `toh web` 已绑定的 127.0.0.1 监听外也没有额外的监听面。跨源导航会被拒绝，新窗口请求转交默认浏览器。\n\n## 已知限制与延后工作\n\n- 尚无打包与分发（无安装器、无捆绑运行时）：应用从已构建的检出目录运行，需要 PATH 中有 `node` 来启动后端，并要求 Harness 所需的各工具可用。\n","readmeFilename":"README.zh.md","_rev":"1-8d7a1f4d842559ff71641e8481b03688"}