File-reference discovery contract and shared @file grammar
$ dsh plugin --profile web add npm:@deepseek-ai/dsh-file-referenceRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
English | 中文
File-reference discovery seam and browser-safe @file grammar shared by host-backed user interfaces. ctx.fileReferences.list(agent, query, signal) returns path-only file or directory candidates for the addressed agent; concrete providers own namespace access, ranking, caching, and invalidation. The same contract is remotely callable as the unary fileReferences/list Remote method (@Remote on the Service Definition, cancelled through the reserved trailing signal), so browser consumers call ctx.remote.fileReferences.list without an API Proxy route.
activeAtToken() recognizes an @path or open @"path with spaces token only at the start of input or after whitespace, so email-like text does not open completion. formatFileMention() emits the matching prompt spelling, appends / to directory candidates, preserves an explicitly opened quote, and rejects control characters or embedded quotes that the editor grammar cannot represent safely.
Selecting a candidate does not read or attach file contents. The exported FILE_REFERENCE_PROMPT is stable guidance that a provider may install when the addressed agent can call read.
Indirectly, through @deepseek-ai/dsh-file-reference-local, which conditionally contributes this package's stable file-reference guidance.
The interface and grammar add no request tokens themselves; a provider-owned prompt section determines cache behavior.
read implementation.