Skip to main content
J

dsh-obsidian-wikilinks

joeyredfield/dsh-obsidian-wikilinks

Linkifies Obsidian wiki targets and space-containing Markdown link paths in chat transcripts: resolves the note in the session workspace, opens it in the sidebar Markdown preview, or in the default app with Cmd-click.

Install

dsh plugin --profile web add github:joeyredfield/dsh-obsidian-wikilinks

README

npm license: MIT

Turn [[wiki links]] in DeepSeek Harness chat transcripts into blue, clickable links that open the matching note. Bare Markdown links whose path contains spaces, which CommonMark refuses to parse, get the same treatment.

English | 中文

  • Click → opens the note in the right sidebar Markdown preview (frontmatter renders as a field table).
  • ⌘ / Ctrl / Alt + click → hands the file to the system default app — Obsidian, if it owns .md.
  • Hover shows the resolved absolute path. Links that cannot be resolved get a red dashed style and a “note not found” tooltip instead of failing silently.

Resolution rules

[[target]] is parsed the Obsidian way:

  1. drop the |alias, #heading and ^block parts;
  2. try target as a path, then retry with .md appended — both [[notes/foo]] and [[notes/foo.md]] work;
  3. still unresolved? one workspace search by file name, and the first .md hit wins;
  4. relative targets resolve against the session workspace root; absolute paths are used as-is.

![[image]] is an Obsidian embed, not a note link, and is left untouched.

A CommonMark link destination cannot contain a space unless it is wrapped in <...>, so [label](学习/Agent 与自动化/笔记.md) is not a link at all — the whole [...](...) stays plain text, and even DSH's own file-link button never runs. This plugin catches that shape too: the label becomes the blue link and the destination is resolved exactly like a wiki target.

  • [上下文工程](学习/ai相关/Agent 与自动化/上下文工程.md) → 上下文工程, blue and clickable
  • [Label](<path with spaces.md>) and [Label](path%20with%20spaces.md) are valid Markdown, so DSH renders them itself — left alone
  • external targets (https://, mailto:), images and ![[embeds]] are never rewritten

Install

Published on npm — plain JavaScript, no build step.

From the plugin market: open Plugins → Plugin Market and search for obsidian-wikilinks.

From a terminal:

dsh plugin --profile <profile> add dsh-obsidian-wikilinks

For local development, install the checkout by link instead:

# profile package.json: add to dependencies and to dsh.profile.bundles
"dsh-obsidian-wikilinks": "link:/path/to/dsh-obsidian-wikilinks"

Refresh the web page once (⌘R) after installing.

Why DOM decoration

DSH has no inline-Markdown extension point. In the shipped renderer the plain-text branch of an AST node returns the raw string, and only inline code is handed to fileMentions; the conversation.chat.markdown.fence slot wraps fenced code blocks only; replacing the conversation.chat.node assistant step would mean reimplementing the whole AssistantNodeView. So the plugin post-processes text:

  • it registers a hidden anchor on the conversation.chat.turnTail slot (the only per-turn seat that hands a session-scoped component both sessionId and openFile);
  • closest('[data-chat-flow]') finds the transcript flow root, and each flow root gets one MutationObserver, shared per root and reference-counted so it disconnects when the last turn unmounts;
  • only text nodes inside [data-text-interaction-source] are decorated (settled messages), skipping [data-streaming], code, pre, a, button, svg and anything already decorated;
  • mutations are batched into a requestAnimationFrame.

Limitations

  • Messages are decorated once they settle; during streaming the text stays plain.
  • Chat transcripts only — the sidebar note preview and the composer input are untouched.
  • A rare React re-render race can leave one line undecorated until the view repaints; switching sessions or reloading restores it.
  • No settings UI. To make a plain click open Obsidian instead, flip the external check in activate() in client.js.

License

MIT

Related plugins