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.
This commit is contained in:
@@ -15,9 +15,6 @@ import type { SettingsApi } from './settings.ts'
|
||||
import type { CredentialsApi } from './credentials.ts'
|
||||
import type { LlmApi } from './llm.ts'
|
||||
import type { ClientResponse, RpcReceipt } from './rpc.ts'
|
||||
// The merge-free types subpath: api/ is imported from the browser lane, where
|
||||
// the host session service must not merge over the client runtime's own.
|
||||
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
||||
|
||||
/** Root interface of the unified API surface. New client-request domain = one new file pair + one field here + one map row. */
|
||||
export interface ApiProxy {
|
||||
@@ -33,17 +30,6 @@ export interface ApiProxy {
|
||||
llm: LlmApi
|
||||
/** Response entry for server-requests (client-response, echoing their rpcId); not a domain method (four-quadrant model). */
|
||||
respond(message: ClientResponse): Promise<RpcReceipt>
|
||||
/**
|
||||
* The directory a Session's files may be read from — the same `cwd` the
|
||||
* session summaries carry, in non-envelope form for an in-process reader.
|
||||
* Not a domain method: it has no wire face, because a browser learns a
|
||||
* Session's cwd from `sessions.view` and a file it may read from the web
|
||||
* transport's own `/f` route, never by asking for a host path.
|
||||
* @param sessionId - the Session to locate.
|
||||
* @returns its absolute working directory, or `undefined` when this host
|
||||
* serves no such Session. Resolving one never resumes an agent.
|
||||
*/
|
||||
workspaceRootOf(sessionId: SessionId): Promise<string | undefined>
|
||||
}
|
||||
|
||||
// ---- Domain interfaces and payload entities ----
|
||||
@@ -63,9 +49,6 @@ export type { CredentialsApi, CredentialView } from './credentials.ts'
|
||||
export type { ConfigurableProviderView, LlmApi } from './llm.ts'
|
||||
export type { ApprovalResponsePayload } from './approvals.ts'
|
||||
|
||||
// ---- Workspace-file URL shape (the transport's byte-carrying half) ----
|
||||
export { FILES_PATH, workspaceFileSegments, workspaceFileUrl, parseWorkspaceFilePath } from './files.ts'
|
||||
export type { WorkspaceFileTarget } from './files.ts'
|
||||
export type { QuestionResponsePayload } from './questions.ts'
|
||||
|
||||
// ---- Message layer: narrow forms (domain-signature view) ----
|
||||
|
||||
Reference in New Issue
Block a user