fix(desktop): route Bot Mode group-chat Markdown through the plugin SDK

Follow-up to the cherry-picked fix for #88391: the bare `streamdown` import
broke the plugin's side-load contract (vm-harness tests and the legacy-sdk
tmpdir loader can't resolve bare specifiers, and the runtime plugin door only
maps @hermes/plugin-sdk and react). Export Streamdown from the SDK instead,
feature-detect it in plugin.js like SkillsView/McpTab (plain-text fallback on
older desktops), and fix the indentation at the render site.
This commit is contained in:
Teknium
2026-08-17 11:18:59 -07:00
parent cf2d28a2ff
commit 577f5cf207
2 changed files with 6 additions and 3 deletions
@@ -16,7 +16,6 @@
*/
import * as sdk from '@hermes/plugin-sdk'
import { Streamdown } from 'streamdown'
import {
atom,
Button,
@@ -68,6 +67,7 @@ import { jsx, jsxs } from 'react/jsx-runtime'
const { McpTab, ToolsetConfigPanel } = sdk
// Keep optional exports feature-detected; test harnesses may strip the SDK namespace.
const SkillsView = typeof sdk === 'undefined' ? undefined : sdk.SkillsView
const Streamdown = typeof sdk === 'undefined' ? undefined : sdk.Streamdown
const ID = 'hermes-bots'
const ROSTER_KEY = [ID, 'roster']
@@ -6492,8 +6492,8 @@ function GroupChatWorkspace({ group, members }) {
]
}),
jsx('div', {
className: 'text-xs text-(--ui-text-secondary) [&_p]:mb-1 [&_p:last-child]:mb-0',
children: jsx(Streamdown, { children: entry.text })
className: 'text-xs text-(--ui-text-secondary) [&_p]:mb-1 [&_p:last-child]:mb-0',
children: Streamdown ? jsx(Streamdown, { children: entry.text }) : entry.text
})
]
}, `${entry.at}:${index}`)
+3
View File
@@ -633,3 +633,6 @@ export { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
/** Plugin-local reactive state (share between a trigger and its panel, poll
* loops, cross-component signals) — the same primitive `host.state` uses. */
export { atom, computed } from 'nanostores'
/** Markdown renderer (same pipeline core chat surfaces use) so plugins render
* message text as a preview instead of raw Markdown source. */
export { Streamdown } from 'streamdown'