DSH / Atlas
2026-10-15implementedarchitecture

Generic Desktop shared-texture API with a shared frame-forwarding package

通用 Desktop 共享纹理 API 与共享的帧转发包

The native Office preview needs textures rendered by a LibreOffice process to reach the Electron renderer without copying pixels, which requires an Electron main-process import and a renderer-side `sharedTexture` consumer. The first design of the Office Preview and Editing bundle let a bundle declare `dsh.bundle.desktop` with `main`, `preload`, and `verify` exports: Desktop imported the bundle's module into the main

English

Problem

The native Office preview needs textures rendered by a LibreOffice process to reach the Electron renderer without copying pixels, which requires an Electron main-process import and a renderer-side sharedTexture consumer. The first design of the Office Preview and Editing bundle let a bundle declare dsh.bundle.desktop with main, preload, and verify exports: Desktop imported the bundle's module into the main process, registered its preload for every frame of the default session, and verified the bundle's native payload with the bundle's own verifier. That selection could only be made at application startup, so enabling or disabling the bundle required a Desktop restart, and the startup selection had to be pinned through loadProfileDirectory, ProfileRuntimeResolution, DSH_DESKTOP_STARTUP_BUNDLES, the plugin manager (restart-required, desktop-only), the package manifest types, and the Web plugin list. Any installed package carrying the declaration could run code in the main process and in a session-wide preload, and Electron's setSharedTextureReceiver is a document singleton, so two such bundles would have overwritten each other.

The correction that followed made frame forwarding a fixed Desktop capability: the Electron main process ran the native receiver (first loaded from the LibreOffice Kit's receiver SDK in the dsh runtime, then built from Kit sources copied into apps/desktop), validated producer metadata, and answered frame-forwarding control messages that carried viewports, generations, and credits. apps/desktop therefore carried protocol that only the Office preview used, its preload exposed frame forwarding rather than textures, a receiver inside Electron Main could not use libuv and needed Electron-compatible builds, and every protocol change required a Desktop release before a Kit release could use it. Copying the Kit's C++ into Desktop added a second claimed origin for one protocol; loading it from the Kit tied every Desktop receiver change to a Kit release. Frame forwarding is also not Office's: other Host plugins will render in native processes of their own, so the receiver, its transport, and its Host service cannot belong to the Office package either, and the Kit is one producer among several.

Electron fixes what Desktop must own. sharedTexture.importSharedTexture runs only in the main process and accepts only a handle local to that process: an IOSurfaceRef on macOS, an NT HANDLE on Windows. sharedTexture.subtle exports an imported texture for a renderer to import, and each reference's release callback runs after the GPU work that used it completes. The managed sendSharedTexture waits at most 1000 ms for the renderer's acknowledgement; when Main then releases its reference, a renderer that was busy for longer imports a destroyed texture and shows an empty frame. Electron has no API that receives a GPU handle from a process outside Chromium, and Node cannot receive Mach messages or duplicate Win32 handles. On macOS, bringing a foreign IOSurface into Main needs native code in Main; on both platforms, carrying a Host-local handle toward Main needs native code in the Host.

Whatever Desktop adds for that consumer is reachable by other code in the same process: a Host service by every Host plugin, a preload object by every script of the document. Two consumers of one texture interface would steal each other's frames, and a consumer that registers while frame forwarding is idle would take the interface over. The Office slideshow also entered window fullscreen through dshDesktop.window.setFullscreen, a Desktop-private API that Office read by duck typing and that Main restored by bookkeeping of its own; every plugin that needs fullscreen, for example a game, would have needed the same window control.

Decision

Desktop owns an internal shared-texture API whose only consumer is frame forwarding, including the hop and ingress addons that open a native channel between the Host and Electron Main and carry Host-local handles across it; no plugin runs code in the Electron main process or a session-wide preload. The frame-forwarding package owns frame forwarding for every Host plugin: the frameForwarding Host service, and the renderer-side views.

Desktop: shared textures

Plugins see frame forwarding only. The shared-texture service definitions live in @deepseek-ai/dsh-shared-texture with separate Host and Client compiler faces. Its root entry (.) defines the abstract Host SharedTexture Cordis service (ctx.sharedTexture), whose claim() grants capabilities, nativeSink, and adapterLuid to one holder until release() or the disposal of the scope that claimed; its ./types entry defines the Cordis-free SharedTextureClientExport, SharedTextureHostExport, and SharedTextureLease shared by Desktop preload and the Client plugin; and its ./client entry is the Client plugin that provides that bridge as the Client ctx.sharedTexture, typed SharedTextureClientExport. web-app mounts the package; its Host entry does nothing. Because Host and Client faces compile with separate tsconfig.{host,client}.json programs, the Host Context declaration never enters a Client program. Desktop Main takes the types of the shared-texture control messages (capabilities and adapter-luid) exchanged over the Host child-process channel from the Desktop Host's own types export (apps/desktop-host/src/types.ts), a private protocol between the two rather than a plugin API, and the hop addon's interfaces stay beside the service that loads it; each side validates every message it receives at runtime (Main's channel, apps/desktop-host/src/shared-texture.ts). The two apps share no package dependency; Main compiles against that export through a TypeScript project reference. Electron Main wires everything through one entry that attaches the shared-texture channel to each Host process and supplies the window and Host cleanups; the channel validates every control request before Main's presenter sees it, and the Host-process lifecycle carries no shared-texture routing.

  • The Desktop Host's sharedTexture service takes Host-local handles and loads the hop addon (native/shared-texture/hop.cc, Node-API 8 only) that Main names in its capabilities on first use. On macOS and Windows the hop opens one native two-way connection to Main's ingress — a pair of Mach ports on macOS, and a duplex message named pipe on Windows where Main duplicates each frame's Host-local NT handle into its own process — and every frame's submission, delivery reply, and settlement travel on that connection while the Host IPC channel carries only capabilities and adapter-luid. Each connection admits at most 128 unsettled requests; losing the connection settles its unsettled requests as invalidated, and the next frame opens a new connection. nativeSink(timeoutMs) returns an opaque napi_external pointing to dsh_shared_texture_sink_v2 (native/shared-texture/shared-texture-sink.h) for same-process native addons; a consumer built for another ABI version refuses it. A frame carries its handle, size, pixel format, metadata, and a delivery deadline that applies in the Host only, and no request identifier. The sink is bound to that connection: present returns DSH_SHARED_TEXTURE_PRESENT_OK when the request left the Host, DSH_SHARED_TEXTURE_PRESENT_REJECTED when it refused only that frame and the sink stays usable, and DSH_SHARED_TEXTURE_PRESENT_DISCONNECTED once the connection was closed or lost, for every later frame too, so the consumer obtains a new sink. Ending a claim that took nativeSink closes that connection and settles its unsettled frames as invalidated. adapterLuid(timeoutMs) returns null outside Windows without asking Main and never opens the native connection; on Windows Main exports one texture from Chromium's compositor, reads its adapter's LUID through the ingress addon, and releases the texture at once. Main keeps the answer until Chromium's GPU process exits or the Host stops, shares one reading among concurrent queries, and keeps no failed reading. The answer is <HighPart>:<LowPart> in lowercase hexadecimal, the text frame forwarding's receiver uses for adapters, or null when Chromium exports no Direct3D 11 compositor texture, DXGI cannot read its adapter, or a cleanup cancelled the reading.
  • Main's ingress (native/shared-texture/ingress.cc) queues at most 32 frames waiting for Main's JavaScript thread and refuses any frame beyond them with no reference kept, so the Host can reuse that texture at once. For each admitted frame, Main's presenter imports the handle and sends the subtle transfer with the Host's metadata unchanged to the product main frame over Desktop's IPC. Main keeps its import until the document reports its own reference, then replies delivered on the native channel; a busy renderer delays that reply — keeping the Host's slot past a delivery timeout until settlement — instead of losing the texture. Main settles every admitted presentation once on the native channel: it replies released after its own release callback and the document's release, which the document sends from its release callback, have both arrived, and invalidated when the document, renderer, GPU process, or GPU release synchronization failed or went away first; a failure reply with no reference kept means Main retained nothing. Main validates the pixel dimensions Electron bounds and parses metadata JSON without interpreting its fields.
  • Main's capabilities reports its process identity to the Desktop Host, which passes only support and a reason to its consumer; on macOS and Windows it also reports the hop addon path and opens one native ingress (Node-API 8 only) for the requesting Host. On macOS (native/shared-texture/ingress-darwin.cc) the ingress is a Mach receive port: it accepts a message only when its audit trailer names the Host process Main spawned, resolves the carried port with IOSurfaceLookupFromMachPort, delivers the Main-local IOSurfaceRef, and replies to the Host's reply port, dropping messages from other processes and oversized messages while the Host's messages keep arriving. On Windows (native/shared-texture/ingress-win32.cc) the ingress is a single-instance duplex message named pipe: it checks GetNamedPipeClientProcessId against that Host process before reading, disconnects any other client, holds a PROCESS_DUP_HANDLE | SYNCHRONIZE handle to the connected Host, and duplicates each frame's NT HANDLE from the Host into Main; the same addon reads, through DXGI, the adapter LUID of a Main-local shared texture for adapter-luid. The ingress lives as long as that Host process: window-level cleanup keeps it, so the Host queries capabilities once per connection and presents every later frame over the native channel without another IPC round trip. An explicit capability query always reaches Main, which reports gpu-compositing-disabled while Chromium composites in software, for example after repeated GPU process crashes. A message from the Host with another protocol version or malformed contents stops the ingress with an error, ending the connection, and the next capability query reopens it.

The application preload exposes dshDesktop.textures to the product main frame only: it imports each transfer, reports the result to Main at once, delivers { frame, metadata, release } to the single document consumer, and releases textures that arrive without one. The shared-texture Client plugin provides globalThis.dshDesktop?.textures as the Client ctx.sharedTexture, so other Client plugins never read globalThis.dshDesktop. Desktop offers the document no window control: a plugin that shows a view fullscreen uses the document's Fullscreen API through frame forwarding, Electron makes the window fullscreen for the document's fullscreen element, and the existing state relay keeps window chrome in step. Main cancels a pending adapter reading, refuses frames arriving during cleanup, settles the textures sent to the document as invalidated, and starts a new document generation when the renderer or GPU process exits, a cross-document navigation commits, or the window closes; a GPU process exit also forgets the compositor adapter, and the ingress closes only when the Host process stops or fails. Main never reports an unobserved reference as released. Cancelled, intercepted, and same-document navigations keep the document's textures, and the document generation fails a capability query that spans a reset during ingress replacement.

Trust model

Main trusts only the Host process it spawned. The macOS ingress drops every message whose audited sender PID differs from the Host's and keeps receiving the Host's; the Windows ingress checks GetNamedPipeClientProcessId before reading, disconnects any other client, and duplicates handles only from that Host process. Producers never communicate with Main, and only Desktop's hop touches the Host-to-Main channel.

Security review has two process boundaries. The Host-to-Main boundary is Desktop's: any code in the Host process can send to Main without the sharedTexture service, so Main's request validation and the ingress PID check are audited as part of Desktop and do not change with frame forwarding. The producer-to-Host boundary is frame forwarding's, recorded in its security semantics. The plugin API is frameForwarding alone; reserving sharedTexture for the exclusive frame-forwarding consumer makes it unsupported for general plugins rather than unreachable, so it is not a security boundary. Both shared-texture surfaces admit one consumer at a time, and frame forwarding takes both while it is loaded: its Host plugin holds the Host sharedTexture claim from load to unload, and its Client consumes Client ctx.sharedTexture from start to disposal, also while no channel is open. Another consumer therefore fails at once instead of taking either interface over when frame forwarding is idle. A claim ends with the scope that took it, so a holder unloaded without releasing cannot keep it.

The frame-forwarding package

@deepseek-ai/dsh-frame-forwarding owns frame forwarding for any Host plugin whose producer speaks its wire protocol.

  • The frame-forwarding workspace keeps the receiver source alongside the plugin that uses its protocol. Desktop builds it directly from the workspace for each macOS and Windows target and ships the binary and build record. The plugin’s npm package excludes the receiver sources and binary. Main resolves the addon's absolute path for the running Desktop and passes it to the Host as --frame-receiver-path. The Host publishes this path through its internal desktopFrameReceiver service. On first use the plugin checks the build record against its own protocol and handshake requirements, then loads the addon in the Host process. The listener and producer handshake for each channel run in the Host process.
  • The Host forwarder owns channels and their producer connections (frame-forwarding channels), the frame and byte budgets, and viewport acknowledgement and replay. When opening a channel, it asks sharedTexture.capabilities(), obtains sharedTexture.nativeSink(), and on Windows reads Chromium's adapter from sharedTexture.adapterLuid() before creating the receiver; every channel asks, because Desktop reads the adapter again after Chromium's GPU process restarts. It attaches the sink to the channel's receiver with attachSink, with a presentation deadline of at most 30000 ms, and updates the receiver's deliverable state via setDeliverable as connections, viewports, and visibility change. In the receiver addon, the C++ Desktop bridge validates producer metadata on the thread that produced the frame, filters frames against that deliverable state, and submits matching frames through dsh_shared_texture_sink_v2 with rx, connectionId, requestId, frameId, generation, revision, width, and height as metadata, so steady-state frames never cross the Host's JavaScript event loop. On on_settled, the bridge returns the frame's credit directly when released; on invalidated, it stops the receiver before releasing the delivery and notifies the forwarder to close the channel as lost. Refused submissions and failed deliveries report presentation-error to the renderer; a submission refused with any result other than DSH_SHARED_TEXTURE_PRESENT_REJECTED detaches that sink, while a rejected frame leaves it attached; without an attached sink, frames arrive in JavaScript as frame events, where the forwarder returns the credit at once, requests a fresh nativeSink, and reattaches it to open channels.
  • The Host plugin is a Typert Remote service: consumers use capabilities, channel, isOpen, and close; the renderer applies viewports through the viewport Remote and follows channel states from the events stream. The Client plugin provides the renderer-side frameForwarding service only when Client ctx.sharedTexture is available; connect(rx) returns a receive channel that consumes ctx.sharedTexture, routes textures by the rx in their metadata, lends each frame to a consumer callback, and releases it when the callback settles. Receive channels also hold the document's fullscreen element, one at a time, and report coverage to the others (frame-forwarding channels). A channel closes with the Cordis scope that opened it.
  • Every consumer bundle inserts frame forwarding as the same row, frame-forwarding, without a config. The Loader keeps one row per id, so consumers enabled together share one instance and its one claim, and disabling one consumer leaves the instance and the other consumers' channels running; deployments tune its limits with a patch targeting that id.

Frame path

LibreOffice (Kit producer holding the channel's TX credential)
   │  Packet protocol: hello / allocate / frame (+ handle) / release / message
   ▼
Host process — frame-forwarding receiver addon + C++ Desktop bridge (attachSink, setDeliverable)
   │  credits, budget, handoff, metadata check, deliverable filter → dsh_shared_texture_sink_v2.present
   ▼
Host process — Desktop shared-texture hop addon (≤ 128 unsettled; Host IPC: capabilities / adapter-luid only)
   │  macOS: Mach port pair (IOSurface port + reply port) ⇄ Main ingress
   │  Windows: duplex message named pipe (Host NT HANDLE; Main DuplicateHandle from Host) ⇄ Main ingress
   ▼
Electron Main — shared-texture ingress addon (delivery queue ≤ 32) + presenter → renderer frame
   │  document import result → delivered reply, Main drops its import; both GPU releases → released
   ▼
Native channel reply (released or invalidated) → hop reader → bridge on_settled returns credit (invalidated stops receiver first → channel lost)

Alternatives considered

Keep the bundle-declared main, preload, and verify exports. This hands every installed bundle main-process and session-wide preload execution for one consumer, duplicates a singleton Electron API across bundles, and forces startup-only activation with its restart plumbing through app-boot, plugin manager, manifest types, and the Web plugin list. Rejected in review.

Keep frame forwarding in Electron Main as a fixed Desktop capability. This was the intermediate decision. It leaves protocol only one plugin uses and a receiver bound to the Electron main process in apps/desktop, couples protocol changes to Desktop releases, and makes the preload API a frame-forwarding API. Its own rejected variants remain rejected for the same reasons: loading the receiver SDK from the Kit installed in the dsh runtime ties every receiver change to a Kit release; libuv completion signalling (uv_async_t) lies outside Node-API's ABI guarantee and would force Electron-exact builds.

Give the Office package its own receiver addon with the hop inside it. Frame forwarding serves every Host plugin that renders natively, not Office alone, and the hop is Desktop's shared-texture mechanism, not frame forwarding's. An Office-owned addon would have to be copied by the next consumer and would make a feature package the owner of Mach and Win32 handle transfer.

Electron's managed sendSharedTexture and setSharedTextureReceiver. Its fixed 1000 ms acknowledgement deadline fails a view whenever the renderer's main thread is busy longer, and keeping Main's import past the deadline still returned the producer's texture before the renderer's GPU work completed. Rejected after real-device stall tests.

Load the plugin's addon into Electron Main through an extension slot. Plugin native code would run in the main process. Loading it in the Host keeps Main's native code fixed to Desktop's ingress addon.

Publish the receiver as prebuilt npm platform packages now. Desktop packaging already runs on each target operating system with a C++ toolchain; platform packages would add four packages, a release workflow, and Windows prebuild CI before the package has a second consumer. Deferred, not rejected.

No native code in Desktop, with pixels copied through the Host. Each frame would copy tens of megabytes and lose the shared-texture path that motivates native preview. It remains a possible fallback for small viewports, not the design.

Let the producer send surfaces directly to Main's ingress. This saves one Mach message per frame but requires Main to authenticate a process it did not spawn and requires the consumer to obtain Main's endpoint before starting the producer. The trust model excludes it; measured hop cost is the condition for revisiting.

Global IOSurface identifiers (IOSurfaceLookup). Deprecated by Apple and readable by every process of the user.

Place the receiver in apps/desktop-host. The Desktop Host would then carry one protocol's native build and service; Desktop Host provides shared textures and the preinstalled receiver’s location. The plugin owns the protocol checks and Node-API bindings.

Keep dshDesktop.window.setFullscreen. It is a Desktop window control per plugin need, read by duck typing, with Main-side restore bookkeeping. Element fullscreen is document-scoped, ends on Escape without plugin code, and tells frame forwarding which channel covers the others.

Give each consumer bundle its own frame-forwarding row. Two instances would compete for the one sharedTexture claim and the one renderer texture subscription; the second would report native rendering unavailable while the first serves only its own consumer.

Insert frame forwarding from the Desktop profile itself. Every Desktop session would load the receiver and hold Desktop's interfaces even with no consumer enabled, and a profile without Desktop-specific rows could not stay shared with Web.

Making the Office Host plugin itself hide the bundle in Web. The plugin needs no profile check: without frameForwarding support it reports unavailable, the Client registers no UI, and the existing PDF and spreadsheet preview remains.

Verification

Desktop specs cover the presenter (one ingress per Host and replacement for another Host, software-compositing detection, the hop addon path and ingress endpoint, the 128-frame limit, Electron import failure without keeping a reference, renderer import results including a busy renderer, a failed import, and a missing GPU sync token, delivery-before-settlement reply ordering, reset invalidating frames sent to the document while keeping the ingress, dispose closing the ingress after abandoning sent frames, ingress failure and reopening, adapter LUID readings kept for their GPU process, shared by concurrent queries, not kept when they fail or a GPU process exit overtakes them, and null outside Windows, and the Main entry answering through its channel), the preload bridge including import reports and the release report after its consumer and the GPU, sent-texture settlement, the shared-texture channel accepting only capability and bounded adapter requests and routing control with the Host identity, generic Host-process channels, declared native package builds, and the shared-texture addon verifier. The Desktop native e2e exchanges real textures between separate Main and Host processes over the built hop and ingress addons from native dsh_shared_texture_sink_v2 threads, covers every reply kind, refuses presentations that cannot leave the Host without sending them, reports sink ABI version 2 so a consumer built for another version refuses it, rejects frames beyond the 32-frame delivery queue at once while Main's JavaScript thread is blocked and resumes afterwards, ignores another process at the endpoint while continuing to serve the registered Host, ends the connection when a send finds Main gone or Main cannot deliver its replies, stops the ingress on another protocol version or malformed requests, enforces hop delivery deadlines while keeping the slot until Main settles, reconnects and settles once on close or Main exit, and reads the adapter LUID of a shared Direct3D 11 texture as the text Host addons derive while reading none from other handles. The built-preload e2e asserts dshDesktop.textures exposes only onFrame and dshDesktop exposes no window control. Desktop Host specs cover the single claim, its end with the claiming scope, including a claim taken inside an effect of that scope as frame forwarding takes it, a release before the scope's disposal that leaves the next holder's claim intact, hop connection reuse and reconnection after disconnect with unsettled frames invalidated, nativeSink closing its connection when the claim that took it ends while claims that never took it settle normally, adapterLuid returning Main's reading or null without opening the native connection, refusing a reading that is not a LUID, reporting Desktop's reason, and timing out while ignoring the late reply, unrelated channel traffic, and pending work rejected on disposal. Frame-forwarding specs cover the forwarder (every Windows channel reading the adapter LUID from Desktop, every channel asking Desktop for its current nativeSink with concurrent requests shared, the sink deadline capped at 30000 ms, refresh when unattached frames reach JavaScript, deliverable-state updates pushed before each viewport is sent, presentation error and invalidation handling, producer connections and handoff, viewport replay, and teardown), the Host service with its claim, channel ownership by the opening scope, and Remote, the receiver loader and its build-record check, the Client mount, the wire adapter with its lifelong texture subscription and fullscreen holder, and receive channels. The Desktop bridge native e2e drives a real producer through the built receiver's C++ sink bridge, covering metadata projection, credit return on release and outside the deliverable state, delivery errors, an invalidated frame's notice followed by stopping its receiver and connection before its release, keeping the sink after a rejected frame and detaching a disconnected one so later frames reach JavaScript, synchronous callbacks inside present, ABI checks that refuse a sink of another magic or of version 1 or 3, settlements after receiver close and collection, and, when Desktop's addons are built, presentation through Desktop's hop sink into Desktop's ingress. The Kit frames e2e drives the installed Kit's LibreOffice producer through the built receiver and the forwarder while an in-process native sink holds every presented frame. The receiver native e2e compiles a fixture producer and drives it through the built receiver across producer processes, protocol and capability mismatches, and shared-budget trimming. The NodeNext declaration check rejects a published package whose public declarations import a private workspace package, which keeps Desktop's types out of frame forwarding's published API. No Session format or model-visible input changes.

Consequences

Preinstalling the receiver lets users install or enable the plugin without a C++ toolchain. Native fixes and receiver protocol updates ship with Desktop. Each plugin version checks the preinstalled receiver and reports it as unavailable if incompatible. Steady-state frames bypass the Host's JavaScript event loop; between Host and Main each frame costs Mach messages on macOS or named-pipe messages and one DuplicateHandle by Main on Windows, never a pixel copy. Texture lifetime spans three processes: Main owns and closes the Windows handles it duplicated from the Host once Electron's GPU work finishes or Host teardown runs, and a Main exit ends the Host and the producer with it. On Windows, Main opens the Host it spawned with PROCESS_DUP_HANDLE | SYNCHRONIZE while the Host never opens Main; a failed open disconnects the pipe and a denied DuplicateHandle replies with a delivery error rather than presenting nothing silently.

Native producer SDK

The native producer interface is still evolving with the Office integration. DSH defers publishing a third-party producer SDK because external plugins could come to depend on C calls that still change with the engine. Reconsider publication once the producer interface has settled. LibreOffice Kit connects through its own engine.

中文

Problem

原生 Office 预览需要把 LibreOffice 进程渲染的纹理不经像素拷贝地送达 Electron renderer,这要求一个 Electron 主进程侧的导入和一个 renderer 侧的 sharedTexture 消费者。“Office 预览编辑”bundle 的第一版设计允许 bundle 通过 dsh.bundle.desktop 声明 main、preload 和 verify 导出:Desktop 把 bundle 的模块导入主进程,为默认 session 的每一个 frame 注册其 preload,并用 bundle 自带的校验器校验其原生载荷。这种选择只能在应用启动时做出,因此启用或关闭该 bundle 必须重启 Desktop,而启动时的选择又必须穿透 loadProfileDirectory、ProfileRuntimeResolution、DSH_DESKTOP_STARTUP_BUNDLES、插件管理器(restart-required、desktop-only)、包清单类型和 Web 插件列表加以钉死。任何带有该声明的已安装包都能在主进程和 session 级 preload 中运行代码;而 Electron 的 setSharedTextureReceiver 是 document 级单例,两个这样的 bundle 会互相覆盖。

随后的修正把帧转发变成 Desktop 的固定能力:Electron 主进程运行原生接收器(先是从 dsh runtime 内的 LibreOffice Kit 接收端 SDK 加载,后来用拷贝进 apps/desktop 的 Kit 源码构建),校验 producer 元数据,并应答携带 viewport、generation 和信用的 frame-forwarding 控制消息。于是 apps/desktop 带着只有 Office 预览使用的协议,其 preload 暴露的是帧转发而不是纹理,位于 Electron Main 内的接收器不能使用 libuv 且需要与 Electron 兼容的构建,而每次协议变更都要先发 Desktop 版本,Kit 版本才能使用。把 Kit 的 C++ 拷进 Desktop 让同一个协议多出第二个自称的来源;从 Kit 加载则把 Desktop 接收器的每次变更绑死在 Kit 发版上。帧转发也不属于 Office:其他 Host 插件将来也会在各自的原生进程中渲染,因此接收器、传输和 Host 服务也不能归 Office 包所有,Kit 只是多个 producer 中的一个。

Electron 决定了 Desktop 必须持有什么。sharedTexture.importSharedTexture 只在主进程运行,且只接受该进程本地的句柄:macOS 上是 IOSurfaceRef,Windows 上是 NT HANDLE。sharedTexture.subtle 导出已导入的纹理供 renderer 导入,每个引用的释放回调在使用它的 GPU 工作完成后运行。托管的 sendSharedTexture 最多等待 renderer 确认 1000 ms;此后 Main 释放自己的引用,忙碌更久的 renderer 会导入一个已销毁的纹理并显示空帧。Electron 没有任何 API 能从 Chromium 之外的进程接收 GPU 句柄,Node 也不能接收 Mach 消息或复制 Win32 句柄。在 macOS 上,把外部 IOSurface 带进 Main 需要 Main 里的原生代码;在两个平台上,把 Host 本地句柄送往 Main 都需要 Host 里的原生代码。

Desktop 为这个消费者新增的任何东西,同一进程中的其他代码也能触达:Host 服务能被每个 Host 插件调用,preload 对象能被文档中的每段脚本调用。同一纹理接口的两个消费者会互相抢走对方的帧,在帧转发空闲时注册的消费者会接管该接口。Office 放映还通过 dshDesktop.window.setFullscreen 进入窗口全屏,这是 Desktop 的私有 API,Office 以鸭子类型读取它,Main 则靠自己的记录来恢复窗口状态;每个需要全屏的插件(例如游戏)都得要同样的窗口控制。

Decision

Desktop 持有一个内部共享纹理 API,其唯一消费者是帧转发,包括在 Host 与 Electron Main 之间建立原生通道并跨通道传递 Host 本地句柄的跳转与 ingress addon;没有任何插件在 Electron 主进程或 session 级 preload 中运行代码。frame-forwarding 包为所有 Host 插件持有帧转发:frameForwarding Host 服务和 renderer 侧视图。

Desktop:共享纹理

插件只看到帧转发。共享纹理服务定义位于 @deepseek-ai/dsh-shared-texture,采用独立的 Host 与 Client 编译面。其根入口(.)定义抽象 Host Cordis 服务 SharedTexture(ctx.sharedTexture),其 claim() 把 capabilities、nativeSink 和 adapterLuid 交给唯一的持有者,直到 release() 或发起认领的作用域被销毁;./types 入口定义不含 Cordis 依赖的 SharedTextureClientExport、SharedTextureHostExport 与 SharedTextureLease,供 Desktop preload 与 Client 插件共用;./client 入口是 Client 插件,把该桥接提供为 Client 侧的 ctx.sharedTexture,类型为 SharedTextureClientExport。web-app 挂载本包,其 Host 入口不做任何事。由于 Host 与 Client 编译面使用各自独立的 tsconfig.{host,client}.json 程序,Host 的 Context 声明不会进入 Client 程序。Desktop Main 从 Desktop Host 自己的 types 导出(apps/desktop-host/src/types.ts)导入两者经 Host 子进程通道交换的 shared-texture 控制消息(capabilities 和 adapter-luid)的类型;这是两者之间的私有协议,不是插件 API,hop addon 的接口留在加载它的服务旁边。两侧各自在运行时校验收到的每条消息(Main 的通道、Host 的服务)。两个应用之间没有包依赖:Main 通过 TypeScript 项目引用编译这组导出。Electron Main 通过一个入口接入全部内容:它把 shared-texture 通道挂到每个 Host 进程上,并提供窗口级和 Host 级清理;通道在 Main 的 presenter 看到请求之前校验每个控制请求,Host 进程生命周期不携带任何 shared-texture 路由。

  • Desktop Host 的 sharedTexture 服务接收 Host 本地句柄,并在首次使用时加载 Main 在其能力中给出的跳转 addon(native/shared-texture/hop.cc,仅依赖 Node-API 8)。macOS 和 Windows 上都由跳转向 Main 的 ingress 打开一条原生双向连接——macOS 上是一对 Mach 端口,Windows 上是双工消息命名管道并由 Main 把每帧的 Host 本地 NT 句柄复制进自己的进程——每帧的提交、送达回执和结算都走这条连接,Host 的 IPC 通道只承载 capabilities 和 adapter-luid。每条连接最多接纳 128 个未结算请求;连接丢失时所有未结算请求按 invalidated 结算,下一帧打开新连接。nativeSink(timeoutMs) 返回一个指向 dsh_shared_texture_sink_v2(native/shared-texture/shared-texture-sink.h)的不透明 napi_external 供同进程原生 addon 使用;按其他 ABI 版本构建的消费者会拒绝它。每帧携带句柄、尺寸、像素格式、元数据和只在 Host 本地生效的送达期限,不带请求标识。sink 归属当前连接:请求已离开 Host 时 present 返回 DSH_SHARED_TEXTURE_PRESENT_OK,只拒绝这一帧且 sink 仍可用时返回 DSH_SHARED_TEXTURE_PRESENT_REJECTED,连接已关闭或丢失时返回 DSH_SHARED_TEXTURE_PRESENT_DISCONNECTED,之后每一帧也都如此,消费者随即取得新的 sink。取过 nativeSink 的认领结束时会关闭该连接并把未结算帧按 invalidated 结算。adapterLuid(timeoutMs) 在 Windows 以外直接返回 null 而不询问 Main,且从不打开原生连接;Windows 上 Main 从 Chromium 合成器导出一张纹理,经 ingress addon 读出其 adapter 的 LUID,并立即释放该纹理。Main 保留这个答案直到 Chromium 的 GPU 进程退出或 Host 停止,并发查询共用一次读取,失败的读取不保留。答案是小写十六进制的 <HighPart>:<LowPart>,与帧转发接收器表示 adapter 的文本一致;Chromium 没有导出 Direct3D 11 合成器纹理、DXGI 读不出其 adapter 或读取被清理取消时为 null。
  • Main 的 ingress(native/shared-texture/ingress.cc)最多排队 32 帧等待 Main 的 JavaScript 线程,超出的帧当场按未保留引用拒绝,Host 可立即复用该纹理。对每一帧获准进入的帧,Main 的 presenter 导入句柄,经 Desktop 的 IPC 把 subtle 传输连同 Host 原样的 metadata 送到产品主 frame。Main 一直持有自己的导入,直到文档报告它已持有自己的引用,再在原生通道上回复 delivered;忙碌的 renderer 只会推迟该回复——即使送达超时也继续保留 Host 的槽位直至结算——而不会丢失纹理。Main 在原生通道上对每次获准的呈现只结算一次:自己的释放回调和文档的释放(文档在其释放回调中发出)都到达后回复 released;文档、renderer、GPU 进程或 GPU 释放同步先行消失或失败时回复 invalidated;不保留引用的失败回复表示 Main 未保留任何引用。Main 校验 Electron 限定的像素尺寸,解析 metadata 的 JSON 而不解释其中的字段。
  • Main 的 capabilities 向 Desktop Host 报告其进程身份,Desktop Host 只把是否支持及原因交给其消费者;macOS 和 Windows 上还报告跳转 addon 路径,并为发出请求的 Host 打开一个仅依赖 Node-API 8 的原生 ingress。macOS 上(native/shared-texture/ingress-darwin.cc)ingress 是 Mach 接收端口:仅当消息的 audit trailer 指向 Main 所启动的 Host 进程时才接受,用 IOSurfaceLookupFromMachPort 解析携带的端口,交付 Main 本地的 IOSurfaceRef 并向 Host 的回复端口应答,同时丢弃其他进程的消息和超长消息而继续接收 Host 的消息。Windows 上(native/shared-texture/ingress-win32.cc)ingress 是单实例双工消息命名管道:读取前先核对 GetNamedPipeClientProcessId 为该 Host 进程并断开任何其他客户端,连接期间持有该 Host 的 PROCESS_DUP_HANDLE | SYNCHRONIZE 句柄,把每帧的 NT HANDLE 从 Host 复制进 Main;同一 addon 还为 adapter-luid 经 DXGI 读取 Main 本地共享纹理的 adapter LUID。ingress 与该 Host 进程同寿命:窗口级清理保留它,因此 Host 每条连接只查询一次能力,之后每一帧都直接经原生通道呈现,无需额外的 IPC 往返。显式的能力查询总会到达 Main;Chromium 改用软件合成时(例如 GPU 进程多次崩溃后),Main 报告 gpu-compositing-disabled。Host 发来的协议版本不符或内容畸形的消息会以错误停止 ingress 并结束连接,下一次能力查询会重新打开它。

应用 preload 仅向产品主 frame 暴露 dshDesktop.textures:它导入每个传输,立即向 Main 报告结果,把 { frame, metadata, release } 交付给唯一的文档消费者,没有消费者时立即释放到达的纹理。共享纹理 Client 插件把 globalThis.dshDesktop?.textures 提供为 Client 侧的 ctx.sharedTexture,因此其他 Client 插件从不读取 globalThis.dshDesktop。Desktop 不向文档提供窗口控制:要全屏显示视图的插件经帧转发使用文档的 Fullscreen API,Electron 为文档的全屏元素让窗口全屏,现有的状态同步让窗口外观随之调整。当 renderer 或 GPU 进程退出、跨文档导航提交或窗口关闭时,Main 取消待完成的 adapter 读取、拒绝清理期间到达的帧、把已发往文档的纹理结算为 invalidated,并开始新的文档代次;GPU 进程退出还会让 Main 忘掉合成器 adapter,只有在 Host 进程停止或失败时才关闭 ingress。Main 从不把未观察到的引用报告为已释放。被取消、被拦截和同文档导航保留文档的纹理,文档代次让跨越 ingress 替换期间发生的 reset 的能力查询失败。

信任模型

Main 只信任自己启动的 Host 进程。macOS ingress 丢弃经 audit 的发送方 PID 与 Host 不同的每条消息,并继续接收 Host 的消息;Windows ingress 在读取前核对 GetNamedPipeClientProcessId,断开任何其他客户端,并只从该 Host 进程复制句柄。producer 永远不与 Main 通信,Host 中只有 Desktop 的跳转接触 Host 到 Main 的通道。

安全审查面对两条进程边界。Host 到 Main 的边界属于 Desktop:Host 进程中的任何代码都能绕过 sharedTexture 服务直接向 Main 发送消息,因此 Main 的请求校验和 ingress 的 PID 检查作为 Desktop 的一部分审计,不随帧转发变化。producer 到 Host 的边界属于帧转发,记录在其安全语义中。插件 API 只有 frameForwarding;将 sharedTexture 保留给独占的帧转发消费者,只让它对普通插件不受支持,而不是不可达,因此它不是安全边界。两侧共享纹理接口同一时间都只接纳一个消费者,帧转发在加载期间占用二者:其 Host 插件从加载到卸载持有 Host 的 sharedTexture 认领,其 Client 从启动到销毁消费 Client 的 ctx.sharedTexture(没有打开的通道时也是如此)。因此其他消费者会立即失败,而不会在帧转发空闲时接管任一接口。认领随发起它的作用域结束,因此未释放就被卸载的持有者无法继续占用它。

帧转发包

@deepseek-ai/dsh-frame-forwarding 为任何 producer 使用其线上协议的 Host 插件持有帧转发。

  • frame-forwarding 工作区将接收器源码与使用其协议的插件放在一起。Desktop 打包时直接从工作区为 macOS 和 Windows 的目标架构编译接收器,并预装二进制文件和构建清单。插件 npm 包不含接收器源码和二进制文件。Desktop 主进程根据当前安装位置或开发目录确定接收器的绝对路径,通过启动参数 --frame-receiver-path 传给 Host。Host 通过内部服务 desktopFrameReceiver 提供这个路径。插件首次使用时按自身要求校验构建清单中的协议版本和握手能力,再在 Host 进程中加载模块。每个通道的监听和与 producer 的握手都在 Host 进程中完成。
  • Host 的 forwarder 持有通道及其 producer 连接(帧转发通道)、帧数与字节预算,以及 viewport 确认与重放。打开通道时,它询问 sharedTexture.capabilities(),取得 sharedTexture.nativeSink(),Windows 上还在创建接收器前通过 sharedTexture.adapterLuid() 读取 Chromium 的 adapter;每个通道都会询问,因为 Chromium 的 GPU 进程重启后 Desktop 会重新读取 adapter。它以 attachSink 把 sink 挂到该通道的接收器上,呈现期限最多 30000 ms,随后随连接、viewport 和可见性变化通过 setDeliverable 更新可交付状态。接收器 addon 内的 C++ Desktop 桥在产生帧的线程上校验 producer 元数据、按该可交付状态过滤帧,并以 rx、connectionId、requestId、frameId、generation、revision、width 和 height 作为元数据经 dsh_shared_texture_sink_v2 提交匹配的帧,稳态帧不经过 Host 的 JavaScript 事件循环。on_settled 回调在正常释放时直接归还帧信用;invalidated 时先停止接收器再释放交付,并通知 forwarder 以 lost 关闭通道。被拒绝的提交和失败的送达向 renderer 报告 presentation-error;以 DSH_SHARED_TEXTURE_PRESENT_REJECTED 之外的结果被拒的提交会解挂该 sink,被拒绝的单帧则保留 sink;未挂载 sink 时帧以 frame 事件到达 JavaScript,forwarder 立即归还信用,重新获取 nativeSink 并挂回各打开的通道。
  • Host 插件是一个 Typert Remote 服务:消费者使用 capabilities、channel、isOpen 和 close;renderer 通过 viewport Remote 应用 viewport,并从 events 流跟随通道状态。Client 插件仅在 Client ctx.sharedTexture 可用时提供 renderer 侧的 frameForwarding 服务;connect(rx) 返回一个接收通道,它消费 ctx.sharedTexture,按元数据中的 rx 路由纹理,把每一帧借给消费者回调,并在回调结束后释放该帧。接收通道还持有文档的全屏元素(同一时间只有一个),并向其他通道报告遮挡(帧转发通道)。通道随打开它的 Cordis 作用域一起关闭。
  • 每个消费者 bundle 都以同一行 frame-forwarding 插入帧转发,且不带 config。Loader 对每个 id 只保留一行,因此同时启用的消费者共享同一个实例及其唯一的认领,关闭其中一个消费者时,该实例和其他消费者的通道继续运行;部署方用针对该 id 的 patch 调整其上限。

帧路径

LibreOffice (Kit producer holding the channel's TX credential)
   │  Packet protocol: hello / allocate / frame (+ handle) / release / message
   ▼
Host process — frame-forwarding receiver addon + C++ Desktop bridge (attachSink, setDeliverable)
   │  credits, budget, handoff, metadata check, deliverable filter → dsh_shared_texture_sink_v2.present
   ▼
Host process — Desktop shared-texture hop addon (≤ 128 unsettled; Host IPC: capabilities / adapter-luid only)
   │  macOS: Mach port pair (IOSurface port + reply port) ⇄ Main ingress
   │  Windows: duplex message named pipe (Host NT HANDLE; Main DuplicateHandle from Host) ⇄ Main ingress
   ▼
Electron Main — shared-texture ingress addon (delivery queue ≤ 32) + presenter → renderer frame
   │  document import result → delivered reply, Main drops its import; both GPU releases → released
   ▼
Native channel reply (released or invalidated) → hop reader → bridge on_settled returns credit (invalidated stops receiver first → channel lost)

Alternatives considered

保留 bundle 声明的 main、preload 和 verify 导出。 这为一个消费者把主进程和 session 级 preload 的执行权交给每个已安装的 bundle,在多个 bundle 间重复一个单例 Electron API,并强制只能在启动时激活,连带穿透 app-boot、插件管理器、清单类型和 Web 插件列表的重启管线。评审中否决。

把帧转发作为 Desktop 的固定能力留在 Electron Main。 这是中间阶段的决定。它把只有一个插件使用的协议和绑定在 Electron 主进程的接收器留在 apps/desktop,把协议变更与 Desktop 发版耦合,并让 preload API 成为帧转发 API。它自身否决过的变体出于同样理由仍被否决:从 dsh runtime 内安装的 Kit 加载接收端 SDK 把每次接收器变更绑在 Kit 发版上;libuv 完成信号(uv_async_t)在 Node-API 的 ABI 保证之外,会迫使按 Electron 精确头文件构建。

让 Office 包自带一个内含跳转的接收器 addon。 帧转发服务于每个原生渲染的 Host 插件,而不只是 Office;跳转是 Desktop 共享纹理的机制,不是帧转发的。Office 自有的 addon 会被下一个消费者再拷一份,并让一个功能包成为 Mach 和 Win32 句柄传递的所有者。

Electron 托管的 sendSharedTexture 和 setSharedTextureReceiver。 它固定的 1000 ms 确认期限会在 renderer 主线程忙碌更久时让视图失败;即使在期限后继续持有 Main 的导入,也仍会在 renderer 的 GPU 工作完成前把 producer 的纹理归还。经真机卡顿测试后否决。

通过扩展槽把插件的 addon 加载进 Electron Main。 插件原生代码会在主进程中运行。在 Host 中加载它,让 Main 的原生代码固定为 Desktop 的 ingress addon。

现在就把接收器作为预构建的 npm 平台包发布。 Desktop 打包已经在每个目标操作系统上带 C++ 工具链运行;在该包有第二个消费者之前,平台包会增加四个包、一条发布流程和 Windows 预构建 CI。推迟,而非否决。

Desktop 不含原生代码,像素经 Host 拷贝。 每帧要拷贝几十 MB,并失去原生预览赖以成立的共享纹理路径。它仍可作为小视口的兜底,不是本设计。

让 producer 直接把 surface 发到 Main 的 ingress。 这每帧省一条 Mach 消息,但要求 Main 鉴别一个不是它启动的进程,并要求消费者在启动 producer 之前拿到 Main 的端点。信任模型排除了它;重新考虑的条件是实测的跳转开销。

全局 IOSurface 标识符(IOSurfaceLookup)。 已被 Apple 弃用,且用户的任何进程都可读取。

把接收器放在 apps/desktop-host。 Desktop Host 将因此背上一个协议的原生构建和服务;Desktop Host 提供共享纹理和预装接收器的位置,协议校验和 Node-API 绑定由插件维护。

保留 dshDesktop.window.setFullscreen。 它是按插件需求增设的 Desktop 窗口控制,以鸭子类型读取,并需要 Main 一侧的恢复记录。元素全屏以文档为范围,按 Escape 即可结束而无需插件代码,并让帧转发知道是哪个通道遮挡了其他通道。

让每个消费者 bundle 各自插入一行帧转发。 两个实例会争夺唯一的 sharedTexture 认领和唯一的 renderer 纹理订阅;第二个实例会报告原生渲染不可用,而第一个只服务自己的消费者。

由 Desktop profile 自身插入帧转发。 即使没有启用任何消费者,每个 Desktop 会话也会加载接收器并占用 Desktop 的接口,而不带 Desktop 专属行的 profile 也无法继续与 Web 共用。

让 Office Host 插件自己在 Web 中隐藏 bundle。 插件不需要 profile 检查:frameForwarding 不受支持时它报告不可用,Client 不注册 UI,现有的 PDF 和表格预览保持不变。

Verification

Desktop 规格测试覆盖 presenter(每个 Host 一个 ingress 并在换 Host 时替换、软件合成检测、跳转 addon 路径与 ingress 端点、128 帧上限、不保留引用的 Electron 导入失败、renderer 导入结果(包括忙碌的 renderer、失败的导入和缺失的 GPU 同步 token)、先送达回复再结算回复的顺序、reset 在保留 ingress 的同时把已发往文档的帧结算为 invalidated、dispose 先放弃已发送的帧再关闭 ingress、ingress 失败与重开、adapter LUID 读取按 GPU 进程保留、并发查询共用、失败或被 GPU 进程退出抢先时不保留、Windows 以外返回 null,以及经通道应答的 Main 入口)、preload 桥接(含导入结果报告,以及消费者和 GPU 用完之后的释放报告)、已发送纹理的结算、shared-texture 通道只接受能力查询与有界 adapter 请求并携带 Host 身份路由控制、通用 Host 进程通道、声明式原生包构建,以及 shared-texture addon 校验器。Desktop 原生 e2e 在独立的 Main 与 Host 进程间经已构建的跳转与 ingress addon 从原生 dsh_shared_texture_sink_v2 线程交换真实纹理,覆盖每种回复类型、无法离开 Host 的呈现不发送即被拒、报告 sink ABI 版本 2 使按其他版本构建的消费者拒绝它、Main 的 JavaScript 线程阻塞时超出 32 帧投递队列的帧当场被拒并在恢复后继续处理、忽略端点上的其他进程并继续服务已注册的 Host、发送时发现 Main 已退出或 Main 无法投递其回复时结束连接、协议版本不符或请求畸形时停止 ingress、执行跳转送达期限的同时保留槽位直至 Main 结算、关闭或 Main 退出后的重连与单次结算,以及把共享 Direct3D 11 纹理的 adapter LUID 读成 Host addon 推导出的文本、其他句柄读不出 adapter。构建产物 preload 的 e2e 断言 dshDesktop.textures 只暴露 onFrame,且 dshDesktop 不暴露窗口控制。Desktop Host 规格测试覆盖唯一的认领、认领随发起它的作用域结束(包括像帧转发那样在该作用域的 effect 中发起的认领)、作用域销毁前的释放不影响下一个持有者的认领、跳转连接复用以及断连时把未结算帧置为 invalidated 并重连、取过 nativeSink 的认领结束时关闭该连接而未取过的认领正常结算、adapterLuid 不打开原生连接即返回 Main 的读取结果或 null、拒绝不是 LUID 的读取结果、报告 Desktop 给出的原因、超时并忽略迟到的回复、无关的通道流量,以及销毁时拒绝待完成的工作。帧转发规格测试覆盖 forwarder(每个 Windows 通道都向 Desktop 读取 adapter LUID、每个通道都向 Desktop 取当前的 nativeSink 且并发请求合并、sink 期限上限 30000 ms、未挂载帧到达 JavaScript 时的刷新、在发出每个 viewport 之前更新可交付状态、呈现错误与失效处理、producer 连接与交接、viewport 重放、拆除)、Host 服务及其认领、由打开方作用域持有的通道和 Remote、接收器加载器及其构建记录检查、Client 挂载、wire 适配(含常驻的纹理订阅与全屏持有者)和接收通道。Desktop 桥原生 e2e 驱动真实 producer 穿过已构建接收器的 C++ sink 桥,覆盖元数据投射、正常释放和处于可交付状态之外时的信用归还、送达错误、被置为失效的帧先发出通知、再停止接收器及其连接后才释放、单帧被拒时保留 sink 而连接断开时解挂 sink 让后续帧到达 JavaScript、present 内同步触发的回调、拒绝其他 magic 或版本 1、3 的 sink 的 ABI 检查、接收器关闭并被垃圾回收后到达的结算,以及在 Desktop 的 addon 已构建时经 Desktop 的跳转 sink 送进 Desktop 的 ingress。Kit 帧 e2e 在进程内原生 sink 扣住每一帧已呈现帧时,驱动已安装 Kit 的 LibreOffice producer 穿过已构建的接收器和 forwarder。接收器原生 e2e 编译测试用 producer,跨 producer 进程、协议与能力不匹配以及共享预算收缩驱动它穿过已构建的接收器。NodeNext 声明检查拒绝公开声明 import 私有 workspace 包的发布包,从而让 Desktop 的类型不进入帧转发的发布 API。无 Session 格式或模型可见输入的变化。

Consequences

插件可以在运行时安装或启用。由 Desktop 预装接收器,可以在没有 C++ 工具链的机器上启用 Office 预览;接收器的协议和原生修复随 Desktop 发版。各版本插件自行校验预装接收器,不兼容时报告不可用。稳态帧绕过 Host 的 JavaScript 事件循环;在 Host 与 Main 之间,每帧在 macOS 上开销为 Mach 消息,在 Windows 上开销为命名管道消息加 Main 执行的一次 DuplicateHandle,没有像素拷贝。纹理生命周期跨越三个进程:Main 自己持有并在 Electron 的 GPU 工作完成或 Host 拆除时关闭它从 Host 复制来的 Windows 句柄,Main 退出会连带结束 Host 和 producer。Windows 上由 Main 以 PROCESS_DUP_HANDLE | SYNCHRONIZE 打开自己启动的 Host,Host 从不打开 Main;打开失败会断开管道,DuplicateHandle 被拒绝会返回送达错误,而不是静默地什么都不呈现。

Native producer SDK

原生 producer 接口仍在随 Office 集成调整。DSH 暂不向第三方发布 producer SDK:现在公开 C 头文件和静态库会让外部插件依赖仍可能变化的调用方式。待接口定型后再决定是否开放。LibreOffice Kit 通过自己的引擎接入。