fix(web): guide clickable file references

This commit is contained in:
ZiyaZhang
2026-08-12 05:07:47 -07:00
parent 66c6059ca8
commit 1ca6f68b17
17 changed files with 130 additions and 37 deletions

View File

@@ -1,9 +1,28 @@
/**
* Deliverables plugin, node half. Pure UI plugin: the empty apply exists so
* the plugin appears in the host cordis.yml / Loader; the browser half ships
* via exports["./client"], discovered through the package.json dsh.client
* declaration.
* Deliverables plugin, node half. Registers the response-format guidance that
* lets the browser half recognize final-response file references. The browser
* half ships via exports["./client"], discovered through the package.json
* dsh.client declaration.
*/
/** Host plugin body — no host-side behavior for this surface plugin. */
export function apply(): void {}
import type { Context } from '@deepseek-ai/cordis'
import type {} from '@deepseek-ai/dsh-system-prompt'
/** Services required for the model guidance paired with the browser renderer. */
export const inject = ['systemPrompt']
/** Stable final-response guidance owned by the matching renderer. */
const FILE_REFERENCE_PROMPT = 'When you successfully create or modify files, mention the primary outputs in your final response. '
+ 'To make those and any other changed-file references clickable in Web, format them as Markdown inline code using the exact file-tool path, or a basename when unique among the files changed in that turn.'
/**
* Register model guidance for the file-reference renderer shipped by this package.
* @param ctx - host context carrying the system-prompt registry.
*/
export function apply(ctx: Context): void {
ctx.systemPrompt.section({
name: 'ui:deliverable-file-references',
order: 190,
text: FILE_REFERENCE_PROMPT,
})
}

View File

@@ -15,10 +15,9 @@ export const name = 'client-ui-deliverables-invariant'
export const inject = ['invariants']
/**
* No runtime invariant: one slot registration and one dictionary
* registration, both effect-owned with disposal proven by the HMR-safety
* spec — the plugin emits no cordis events and owns no cross-plugin mutable
* state.
* No runtime invariant: the prompt section, slot, dictionary, event
* definition, and optional service registrations are effect-owned with
* disposal proven by their plugin specs; this package owns no mutable state.
*/
const install: InvariantInstaller = () => {}