CH4ACKO3/dsh-render-engine--packages-syntax-highlight0

@ch4acko3/dsh-syntax-highlight

Structured syntax highlighting service for DeepSeek Harness Web plugins

包名
@ch4acko3/dsh-syntax-highlight
版本
0.1.0
许可证
MIT
最近更新
2026年8月21日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CH4ACKO3/dsh-render-engine#8401d60319cc256b73167e14460c12cec647db4f&path:packages/syntax-highlight

@ch4acko3/dsh-syntax-highlight

A browser-side Cordis service that converts the shared ctx.shiki output into a stable token model for DeepSeek Harness plugins.

export const inject = ['syntaxHighlighter']

export function apply(ctx) {
  const result = ctx.syntaxHighlighter.highlight({
    code: 'const answer = 42',
    language: 'ts',
  })
  console.log(result.lines)
}

Unknown or absent language hints return plain tokens instead of throwing. The result's lineEndings field preserves the source's original LF, CRLF, or CR separators.