feat(files): open markdown, HTML, and PDF files outside the workspace (#9140)

Co-authored-by: Claude Code <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Code authored and GitHub committed 2026-09-01 19:31:55 -07:00
1 parent f2a914b858
commit f46a709ee4
26 files changed
+394 -89

No files matched your search

+16 -7
View File
@@ -28,22 +28,31 @@ managed relay connectivity:
The desktop bootstrap credential and command-line administrative bootstrap
credentials additionally grant `access:read access:write relay:write`.
## Host file access
Clients with `orchestration:read` can read files anywhere the environment's server account can
read, following the environment-wide authorization model rather than introducing per-project
filesystem permissions. `projects.readFile` accepts an absolute path and returns the text of that
host file; only workspace-relative paths pass its root check, and `projects.writeFile` never
accepts an absolute path. Clients use this to show files an agent wrote outside the workspace, such
as a report in a temp directory, read-only.
## Media preview access
Clients with `orchestration:read` can request a `media-file` URL through `assets.createUrl` for
supported images and videos anywhere the environment's server account can read. A thread ID
supplies the workspace for relative paths; absolute paths refer to the environment host, not the
client. This follows the environment-wide authorization model rather than introducing per-project
filesystem permissions.
supported images, videos, HTML, and PDF files anywhere the environment's server account can read.
A thread ID supplies the workspace for relative paths; absolute paths refer to the environment
host, not the client.
[`AssetAccess.ts`](../../apps/server/src/assets/AssetAccess.ts) resolves symlinks, requires a regular
file, and validates the resolved file's literal extension. It opens the file and signs its canonical
path and device/inode identity for one hour. The token grants access to that exact file, not adjacent
files or its containing directory. Serving rechecks the canonical path, media type, and opened
descriptor's identity, then streams full or partial responses from that descriptor. Replacing a
file atomically requires a freshly signed URL; editing it in place does not. The existing workspace
boundary still applies to HTML, PDF, and other workspace previews. Uploaded attachments keep their
separate asset resource.
file atomically requires a freshly signed URL; editing it in place does not. Because the token names
one file, an HTML document served this way cannot load sibling assets; the directory-scoped
`workspace-file` resource remains the route for HTML inside the workspace. Uploaded attachments keep
their separate asset resource.
Signed asset URLs are bearer credentials. Anyone who obtains a URL and can reach the environment
can fetch that file until it expires. Clients should copy the authored reference, not the temporary
+9
View File
@@ -94,6 +94,15 @@ have a cached copy. Supported video formats and codecs depend on the browser or
Bare paths in ordinary prose and paths inside code blocks stay text. Raw HTML `<video>` tags
are not supported; use the Markdown embed syntax above.
## Files outside the workspace
When an agent links to a file it wrote outside the workspace, such as a Markdown report in
`/tmp`, select the link to open it in the file viewer. The viewer shows the file read-only, with
rendered Markdown available as usual; it cannot edit files outside the workspace. HTML and PDF
files outside the workspace open the same way as ones inside it, including the integrated browser
where it is available. Because such a file is served on its own, an HTML page outside the workspace
cannot load scripts, styles, or images from files beside it.
## Changing projects
On web and desktop, changing the project from a new thread keeps the current environment when that