The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor: drop the shared subpath export, keeping package.json untouched
Brooklyn Nicholsone682a9c0a749
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/slash.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/slash.tsindex 5bfccf1be7a..ccbdac0c408 100644--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/slash.ts+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/slash.ts@@ -1,6 +1,6 @@import { type MutableRefObject, useCallback, useRef } from 'react'-import { dispatchDisplayText } from '@hermes/shared'+import { skillInvocationText } from '@hermes/shared'import { getProfiles } from '@/hermes'import type { Translations } from '@/i18n'@@ -268,8 +268,10 @@ export function useSlashCommand(deps: SlashCommandDeps) {// A skill/bundle dispatch's `message` is the expanded skill body —// model-facing scaffolding. Never render it; the bubble shows the- // invocation instead.- const displayText = dispatchDisplayText('display' in dispatch ? dispatch.display : undefined, message)+ // invocation the gateway projected, or one read from the payload+ // when the backend is older than this app.+ const projected = 'display' in dispatch ? dispatch.display?.trim() : ''+ const displayText = projected || skillInvocationText(message) || undefined// Gate on the TARGET session's own busy state, not the foreground// view's — see isTargetSessionBusy. `busyRef` mirrors whatever chatdiff --git a/apps/shared/package.json b/apps/shared/package.jsonindex e3482d8a466..2a2f46ef73d 100644--- a/apps/shared/package.json+++ b/apps/shared/package.json@@ -8,7 +8,6 @@"./billing": "./src/billing-types.ts","./billing-policy": "./src/billing-policy.ts","./charge-settlement": "./src/charge-settlement.ts",- "./skill-scaffold": "./src/skill-scaffold.ts","./skin": "./src/skin.ts"},"types": "./src/index.ts",diff --git a/apps/shared/src/index.ts b/apps/shared/src/index.tsindex 2339c97716f..391a3715bd2 100644--- a/apps/shared/src/index.ts+++ b/apps/shared/src/index.ts@@ -44,7 +44,7 @@ export {JsonRpcGatewayClient,type WebSocketLike} from './json-rpc-gateway'-export { dispatchDisplayText, skillInvocationText } from './skill-scaffold'+export { skillInvocationText } from './skill-scaffold'export {type HermesSkin,SKIN_BRANDING_TOKENS,diff --git a/apps/shared/src/skill-scaffold.ts b/apps/shared/src/skill-scaffold.tsindex a06ce3d567a..fffae405b2a 100644--- a/apps/shared/src/skill-scaffold.ts+++ b/apps/shared/src/skill-scaffold.ts@@ -67,12 +67,3 @@ export function skillInvocationText(text: string): null | string {return instruction ? `${label} ${instruction.replace(/\s+/g, ' ')}` : label}--/**- * What a skill/bundle dispatch should render as. Prefers the gateway's own- * projection; falls back to reading the payload for an older gateway that- * doesn't send one. Undefined for an ordinary send, which renders as written.- */-export function dispatchDisplayText(display: string | undefined, message: string): string | undefined {- return display?.trim() || skillInvocationText(message) || undefined-}diff --git a/ui-tui/src/app/createSlashHandler.ts b/ui-tui/src/app/createSlashHandler.tsindex 9a50f77b617..f0d38257e26 100644--- a/ui-tui/src/app/createSlashHandler.ts+++ b/ui-tui/src/app/createSlashHandler.ts@@ -1,5 +1,3 @@-import { dispatchDisplayText } from '@hermes/shared/skill-scaffold'-import { parseSlashCommand } from '../domain/slash.js'import type { SlashExecResponse } from '../gatewayTypes.js'import { asCommandDispatch, rpcErrorMessage } from '../lib/rpc.js'@@ -107,10 +105,13 @@ export function createSlashHandler(ctx: SlashHandlerContext): (cmd: string) => b}// A skill/bundle dispatch's `message` is the expanded skill body —- // model-facing scaffolding. The transcript shows the invocation instead;- // an ordinary send has no projection and goes through unchanged.+ // model-facing scaffolding. `display` is the invocation the gateway+ // projected; the transcript shows that instead. An ordinary send has no+ // projection and goes through unchanged. No client-side fallback here:+ // the TUI spawns its gateway from this same checkout, so the two can't+ // version-skew (unlike the desktop, which can meet an older backend).const sendDispatch = (display: string | undefined, message: string) => {- const shown = dispatchDisplayText(display, message)+ const shown = display?.trim()return shown ? send(message, true, shown) : send(message)}