{"_id":"@buckeyestudio/toh-web-app","name":"@buckeyestudio/toh-web-app","dist-tags":{"next":"0.1.1-rc.2","latest":"0.1.1-rc.2"},"versions":{"0.1.1-rc.2":{"name":"@buckeyestudio/toh-web-app","description":"The toh browser-surface bundle: the web patch layer over toh-base plus the runtime glue plugin (frontend dist serving, web-surface prompt, bash runtime variables, URL line)","version":"0.1.1-rc.2","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/bundle/web-app"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./startup":{"types":"./lib/types/startup.d.ts","default":"./lib/startup.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./cordis.patch.yml":"./cordis.patch.yml","./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","author":{"name":"buckeyestudio"},"toh":{"bundle":{"patch":"./cordis.patch.yml"}},"dependencies":{"commander":"^15.0.0","open":"^11.0.0","@buckeyestudio/toh-agent-presets":"^0.1.1-rc.2","@buckeyestudio/toh-api-remotes":"^0.1.1-rc.2","@buckeyestudio/toh-client-connection":"^0.1.1-rc.2","@buckeyestudio/toh-app-boot":"^0.1.1-rc.2","@buckeyestudio/toh-client-hmr":"^0.1.1-rc.2","@buckeyestudio/toh-client-locale":"^0.1.1-rc.2","@buckeyestudio/toh-client-modules":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-renderer":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-agent-preset":"^0.1.1-rc.2","@buckeyestudio/toh-client-runtime":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-brand-official":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-commands":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-conversation":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-cordis":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-attachment":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-directory-picker-browse":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-deliverables":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-message-feedback":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-directory-picker-native":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-goal":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-layout":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-model-selection":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-settings-models":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-settings-plugin-inventory":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-permission-presets":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-plan":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-user-questions":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-settings-plugins":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-settings-general":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-sidebar":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-settings":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-skill":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-input-trigger":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-subagent":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-reference":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-theme":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-tool":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-workflow-run":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-jobs":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-workspace":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-trajectory":"^0.1.1-rc.2","@buckeyestudio/toh-cmdline":"^0.1.1-rc.2","@buckeyestudio/toh-code-runtime-worker-thread":"^0.1.1-rc.2","@buckeyestudio/toh-cordis-client-runner":"^0.1.1-rc.2","@buckeyestudio/toh-cordis-host-runner":"^0.1.1-rc.2","@buckeyestudio/toh-host-frontend-static":"^0.1.1-rc.2","@buckeyestudio/toh-web-frontend":"^0.1.1-rc.2","@buckeyestudio/toh-host-directory-picker-auto":"^0.1.1-rc.2","@buckeyestudio/toh-host-apiproxy":"^0.1.1-rc.2","@buckeyestudio/toh-host-directory-picker-browse":"^0.1.1-rc.2","@buckeyestudio/toh-host-directory-picker-native":"^0.1.1-rc.2","@buckeyestudio/toh-host-plugin-inventory":"^0.1.1-rc.2","@buckeyestudio/toh-host-webserver":"^0.1.1-rc.2","@buckeyestudio/toh-file-reference":"^0.1.1-rc.2","@buckeyestudio/toh-file-reference-local":"^0.1.1-rc.2","@buckeyestudio/toh-launch-environment":"^0.1.1-rc.2","@buckeyestudio/toh-session-reference":"^0.1.1-rc.2","@buckeyestudio/toh-message-feedback":"^0.1.1-rc.2","@buckeyestudio/toh-session-projection-cache":"^0.1.1-rc.2","@buckeyestudio/toh-storage":"^0.1.1-rc.2","@buckeyestudio/toh-session-stats":"^0.1.1-rc.2","@buckeyestudio/toh-session-log-export":"^0.1.1-rc.2","@buckeyestudio/toh-storage-domain":"^0.1.1-rc.2","@buckeyestudio/toh-storage-json":"^0.1.1-rc.2","@buckeyestudio/toh-workspace":"^0.1.1-rc.2","@buckeyestudio/toh-subprocess":"^0.1.1-rc.2","@buckeyestudio/schemastery":"^3.18.1"},"peerDependencies":{"@buckeyestudio/cordis-plugin-loader":"^1.0.2","@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/toh-system-prompt":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1","@buckeyestudio/toh-shell-env":"^0.1.1-rc.2"},"devDependencies":{"@buckeyestudio/cordis-plugin-loader":"^1.0.2","@buckeyestudio/toh-shell-env":"^0.1.1-rc.2","@buckeyestudio/toh-system-prompt":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1","@buckeyestudio/toh-invariants":"^0.1.1-rc.2"},"_id":"@buckeyestudio/toh-web-app@0.1.1-rc.2","bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","_integrity":"sha512-ji6C81bdjChkIpECIDP0TgCD8htmfP0eoBwNgIATxTo9LZPSAl7hZXA7ubpgo8KvpobUf+v5T18EfpWO6poqPA==","_resolved":"/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-web-app-0.1.1-rc.2.tgz","_from":"file:/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-web-app-0.1.1-rc.2.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-ji6C81bdjChkIpECIDP0TgCD8htmfP0eoBwNgIATxTo9LZPSAl7hZXA7ubpgo8KvpobUf+v5T18EfpWO6poqPA==","shasum":"98fd86c517579bf1fa2f239df3f585350d5f3188","tarball":"https://registry.npmjs.org/@buckeyestudio/toh-web-app/-/toh-web-app-0.1.1-rc.2.tgz","fileCount":12,"unpackedSize":54285,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDLFbELIosCqWI6KWFMgxFc3Ew9EUq4OqP0+qibvDst3wIgXJiuygA7V2xy+7y12lSRr/rB4oz3qO2dHjMLc5rQanY="}]},"_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-web-app_0.1.1-rc.2_1787489720139_0.4752377562514467"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T12:55:19.960Z","0.1.1-rc.2":"2026-08-23T12:55:20.284Z","modified":"2026-08-23T12:55:20.500Z"},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"description":"The toh browser-surface bundle: the web patch layer over toh-base plus the runtime glue plugin (frontend dist serving, web-surface prompt, bash runtime variables, URL line)","homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/bundle/web-app"},"author":{"name":"buckeyestudio"},"bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"license":"MIT","readme":"# `@buckeyestudio/toh-web-app`\n\n[English](README.md) | 中文\n\ntoh 浏览器表层组合包。[`cordis.patch.yml`](cordis.patch.yml) 叠加在 [`toh-base`](../base/README.zh.md) 之上：设置 coding persona，插入 Web 宿主行（webserver、API 网关、workspace、投影缓存、存储）、浏览器插件名录与始终挂载的客户端插件重载链（[`toh-client-hmr`](../../client/hmr/README.zh.md)，在重建 watcher 改写客户端 bundle 之前保持空闲），并挂载本包的 `web-runtime` 粘合插件（配置为 `{openBrowser, printUrl, surfaceContext, trustedHosts}`）。该插件通过 `@buckeyestudio/toh-web-frontend` 的 exports 解析已构建的前端 dist，只采样一次依赖 bind 的 LAN 信任信息并将其作为 `webRuntime` 提供给浏览器信任栅栏和客户端名录，挂载 [`frontend-static`](../../host/frontend-static/README.zh.md) 回退席位所有者，并在 `surfaceContext` 为 true 时注册 Harness 源码与 Web 表层提示词段落，以及 bash 可见的 `TOH_WEB_URL` 运行时变量。自身 Loader 配置树结算后，它在 `printUrl` 为 true 时打印 `toh web:` URL 行；`openBrowser` 为 true 且继承的 `SSH_CONNECTION` 与 `SSH_TTY` 均为空或不存在时，才会用默认浏览器打开规范宿主机 URL。SSH 启动仍保留 URL 行，但会跳过浏览器交接，因为本地转发地址由 SSH 客户端或编辑器持有。交接前，运行时会打印英文提示 `toh web: opening the default browser; pass --no-open to disable`。短生命周期 Node helper 使用规范的脱敏子进程环境运行受维护的平台 opener。在 Windows 上，helper 会保持存活，直至短生命周期的 PowerShell launcher 退出，因为 `open` 会在 launcher 把 URL 交给 shell 之前、仅在 spawn 时返回；其他平台则在 opener 接受 spawn 后结束。helper 失败时会向 stderr 写入包含原因和手动访问 URL 的诊断，不会停止服务器，且任何路径都不会等待浏览器退出。本组合包还持有应用命令行：普通 `web-startup` 提供方（[`src/startup.ts`](src/startup.ts)）注入 `ctx.cmdlineArgs`（[`toh-cmdline`](../../boot/cmdline/README.zh.md)），解析 `--host`、`--port`、可重复的 `--trusted-host`、`--no-open` 以及应用自己的 `--help`，再提供 `webStartup`；本机启动默认会打开浏览器，`--no-open` 则只对本次调用关闭该行为。它会在发布该服务前拒绝 `--host 0.0.0.0`，因为 CLI 目前有意不支持绑定所有网络接口。由 flag 配置的行会注入该服务，并在惰性配置中直接读取它，因此参数解析完成前不会有任何东西绑定端口，`toh --profile web --help` 也不会启动服务器。[`toh-headless`](../headless/README.zh.md) 是同一 base 之上的同级表层，不挂载本组合包。\n\n## 模型重试默认值\n\nWeb 使用共享的有界 normal 默认值，在首次请求后最多再重试五次符合条件的失败。`deepseek-official` 与由 settings 新增的 pi-ai 路由在省略 `retryPolicy` 时使用该默认值；显式提供方策略仍然优先。Web 不再增加重试专用的组合覆盖，因此非 Web profile 的省略行为与之相同。\n\n## 模型体验\n\n### Harness 源码与 Web 表层上下文\n\n#### 模型看到的内容\n\n当 `surfaceContext` 为 true 时，`harness:source` 段落标明磁盘上的 Harness 实现，但不会声称它就是工作目录；全局段落 `app:web-surface`（顺序 −98）则向模型说明 GUI：规范的本地 URL、「this page」指代什么、更新约定（重载接收端始终开启；无刷新重载还需要 `pnpm run dev:web` watcher），以及不要启动替代服务器的指令。`TOH_WEB_URL` 还会连同描述出现在受管 bash 环境中，每次调用时从运行中的服务器解析。当它为 false 时，这两个段落和该变量都不会注册。\n\n#### Token 影响\n\n每个会话一行源码说明和一段提示词，外加两行受管环境变量；每个进程内保持恒定。\n\n#### KV Cache 影响\n\n该提示词段落位于系统提示词靠前位置，且在进程整个生命周期内稳定（端口是启动期事实），因此不会使跨轮次缓存失效。\n\n## 已知限制与延期工作\n\n- **前端 dist 必须已构建**：对 dist 的 `require.resolve` 在激活时明确报错并给出构建提示；没有从源码直接服务的回退路径。\n- **`lanAddresses` 是启动期快照**：启动后的网卡变化不会重新公告；打印的 LAN URL 始终与配置的信任栅栏一致。\n- **只观测交接启动**：平台 opener 接受 spawn 后即结束观察，但 Windows 会等待其短生命周期 PowerShell launcher 退出；之后的浏览器退出不会上报，已打印 URL 仍是手动访问的回退路径。\n- **SSH 转发持有浏览器 URL**：打印出的规范 URL 指向远端宿主机 loopback 端点；自动交接会被跳过，SSH 客户端或编辑器必须暴露并打开其本地转发地址。\n- **浏览器命令覆盖只能来自启动环境**：被发现的 `.env` 不得设置 `BROWSER`；只有继承值可以抵达会读取该变量的 opener 路径，避免 checkout 为自动交接选择可执行文件。\n","readmeFilename":"README.zh.md","_rev":"1-c747e5062b7e153228a26c3b3f9b1194"}