description: "Session-authorized Office conversion returned as PDF bytes for Client previews."
kind: "package-reference"
@deepseek-ai/dsh-api-document-render-controller
English | 中文
Summary
Open an Office file from a Session and receive its rendered PDF. Source file access follows the ordinary workspace-file policy, and conversion does not activate an Agent or append Session events.
Table of Contents
Use this package
The Web bundle mounts this controller as document-render-controller beside workspaceFiles and documentRender. The controller has no configuration. Its documentRender.render Remote accepts a Session identity, a DOC, DOCX, XLS, XLSX, PPT, or PPTX path, and foreground or background priority; the shared Session lookup derives the workspace root on the Host.
Understand the implementation
Implementation internals — click to expand
The controller probes ordinary read access with a one-byte `workspaceFiles.readBytes` call and confirms the source version through `workspaceFiles.stat`, then supplies a deferred `workspaceFiles.readAllBounded` callback to the renderer. Admission precedes source allocation; the callback checks metadata after reading to reject concurrent source changes. A bounded-read size failure also rechecks source identity, reporting `source-changed` when the current source identity differs. Cached responses repeat the read probe and metadata check. The result carries base64 PDF bytes, original absolute path/version, and renderer generation. The `generation()` Remote lets Clients invalidate PDFs after renderer replacement. Other source-read failures pass through; conversion failures expose a classified reason without engine diagnostics. Cancellation releases this reader’s interest; the renderer retains active capacity until actual work settles. Controller unload joins its outstanding requests. No runtime invariant companion is published because results are transient and have no independently persisted state.
Further Exploration
Model Experience
None, as this package serves previews without model-facing tools, messages, or Session events.
KV Cache effect
None; preview operations do not construct or modify model requests.
Known Limitations and Deferred Work
- Complete source reads also obey
workspaceFiles.maxFileBytes; increasing the renderer input limit alone does not increase the read allowance.
Dev Note
Working context for maintainers — click to expand
None.