From 577f5cf207c3b4f6f5f0518ffe13aa92f90a3583 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 17 Aug 2026 11:18:59 -0700 Subject: [PATCH] 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. --- apps/desktop/src/plugins/hermes-bots/plugin.js | 6 +++--- apps/desktop/src/sdk/index.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/plugins/hermes-bots/plugin.js b/apps/desktop/src/plugins/hermes-bots/plugin.js index 8e6600aa25..b3d7c1d06b 100644 --- a/apps/desktop/src/plugins/hermes-bots/plugin.js +++ b/apps/desktop/src/plugins/hermes-bots/plugin.js @@ -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}`) diff --git a/apps/desktop/src/sdk/index.ts b/apps/desktop/src/sdk/index.ts index 25e231aee8..af75b6a7b3 100644 --- a/apps/desktop/src/sdk/index.ts +++ b/apps/desktop/src/sdk/index.ts @@ -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'