Files
deepseek-harness/packages/host
ZiyaZhang 8fb6c2bd69 refactor(web): open produced files through the Host, not over HTTP
Scope decision: previews for a browser that is not on the Host machine are
not supported. With that settled, host.openPath answers the supported case
completely — a file:// document in a real browser has full page capabilities
and no reach into /api — and the HTTP serving this branch had built answered
only the unsupported one.

Removed: the /f route and its listener, the workspace-file URL shape,
ApiProxy.workspaceRootOf, ConnectionHandle.fileUrl, and the port published
into the index page.

Kept, and finished:
- the produced-files row a turn ends with, derived from mutation locations;
- the path link now reads as a link at rest, not only on hover — the reported
  "I can't open what it made" was this, sitting on a working capability;
- the Host opener prefers the default BROWSER for .html/.htm/.xhtml/.svg, so
  a developer who binds .html to an editor still gets a rendered page
  (macOS via the LaunchServices https handler, Linux via $BROWSER, every
  failure falling back to the default application).

The retired designs and their measurements stay in the Agent Note, including
why same-origin serving was unsafe and why the sandbox that fixed it broke
the pages invisibly.
2026-08-01 03:15:54 -07:00
..

host/ — web-GUI host half

English | 中文

The host side of the dsh web GUI: the API gateway every client shape shares, and the plain HTTP server it rides on. The browser side lives in client/; the composed application is apps/cli serving apps/web. All product packages.

Package Role ctx key
apiproxy/ The shared API gateway: the zero-Node TS wire contract (src/api/), the fetch carrier pair (toFetchHandler host-side, AbstractApiClient client-side), and the host implementation over ctx.agents/ctx.workspace ctx.apiProxy
webserver/ Plain HTTP route-registration carrier: node:http server listening on activation; routes register as named exact/prefix handlers ctx.httpServer
directory-picker/ Workspace-directory picking seam: discriminated native/browse capability the gateway's picker RPCs delegate to ctx.directoryPicker
directory-picker-native/ Dual-face native interaction: OS-chooser backend (osascript / PowerShell / Zenity+KDialog, host-display only) + the browser half filling ui-workspace's directory-flow slots (registers ctx.directoryPicker)
directory-picker-browse/ Dual-face browse interaction: listing/creation primitives over Node stdlib (remote-capable) + the browser half rendering the in-app Select Workspace Directory dialog (registers ctx.directoryPicker)
directory-picker-auto/ Adaptive chooser: resolves the host's situation once at boot (bind host, SSH, display) and mounts the matching dual-face backend as an in-memory Loader entry (mounts a backend row)

apiproxy is transport-agnostic by design — it registers no routes; carriers wrap ctx.apiProxy themselves. The HTTP carrier route (with its /api browser-trust fence) is mounted by client/connection's node half, which is why that package lives in the client group: it owns both ends of the wire.