1- import { type EnvironmentId , type MessageId , type TurnId } from "@t3tools/contracts" ;
1+ import {
2+ type EnvironmentId ,
3+ type MessageId ,
4+ type ServerProviderSkill ,
5+ type TurnId ,
6+ } from "@t3tools/contracts" ;
27import {
38 createContext ,
49 memo ,
@@ -60,6 +65,7 @@ import {
6065 formatInlineTerminalContextLabel ,
6166 textContainsInlineTerminalContextLabels ,
6267} from "./userMessageTerminalContexts" ;
68+ import { SkillInlineText } from "./SkillInlineText" ;
6369import { formatWorkspaceRelativePath } from "../../filePathDisplay" ;
6470
6571// ---------------------------------------------------------------------------
@@ -75,6 +81,7 @@ interface TimelineRowSharedState {
7581 markdownCwd : string | undefined ;
7682 resolvedTheme : "light" | "dark" ;
7783 workspaceRoot : string | undefined ;
84+ skills : ReadonlyArray < Pick < ServerProviderSkill , "name" | "displayName" > > ;
7885 activeThreadEnvironmentId : EnvironmentId ;
7986 onRevertUserMessage : ( messageId : MessageId ) => void ;
8087 onImageExpand : ( preview : ExpandedImagePreview ) => void ;
@@ -93,6 +100,7 @@ const TimelineRowCtx = createContext<TimelineRowSharedState>(null!);
93100const TimelineRowActivityCtx = createContext < TimelineRowActivityState > ( null ! ) ;
94101const TIMELINE_LIST_HEADER = < div className = "h-3 sm:h-4" /> ;
95102const TIMELINE_LIST_FOOTER = < div className = "h-3 sm:h-4" /> ;
103+ const EMPTY_TIMELINE_SKILLS : ReadonlyArray < Pick < ServerProviderSkill , "name" | "displayName" > > = [ ] ;
96104
97105// ---------------------------------------------------------------------------
98106// Props (public API)
@@ -119,6 +127,7 @@ interface MessagesTimelineProps {
119127 resolvedTheme : "light" | "dark" ;
120128 timestampFormat : TimestampFormat ;
121129 workspaceRoot : string | undefined ;
130+ skills ?: ReadonlyArray < Pick < ServerProviderSkill , "name" | "displayName" > > ;
122131 onIsAtEndChange : ( isAtEnd : boolean ) => void ;
123132}
124133
@@ -147,6 +156,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
147156 resolvedTheme,
148157 timestampFormat,
149158 workspaceRoot,
159+ skills = EMPTY_TIMELINE_SKILLS ,
150160 onIsAtEndChange,
151161} : MessagesTimelineProps ) {
152162 const rawRows = useMemo (
@@ -202,6 +212,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
202212 markdownCwd,
203213 resolvedTheme,
204214 workspaceRoot,
215+ skills,
205216 activeThreadEnvironmentId,
206217 onRevertUserMessage,
207218 onImageExpand,
@@ -213,6 +224,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
213224 markdownCwd ,
214225 resolvedTheme ,
215226 workspaceRoot ,
227+ skills ,
216228 activeThreadEnvironmentId ,
217229 onRevertUserMessage ,
218230 onImageExpand ,
@@ -357,6 +369,7 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message"
357369 < UserMessageBody
358370 text = { displayedUserMessage . visibleText }
359371 terminalContexts = { terminalContexts }
372+ skills = { ctx . skills }
360373 />
361374 ) }
362375 < div className = "mt-1.5 flex items-center justify-end gap-2" >
@@ -405,6 +418,7 @@ function AssistantTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "mess
405418 text = { messageText }
406419 cwd = { ctx . markdownCwd }
407420 isStreaming = { Boolean ( row . message . streaming ) }
421+ skills = { ctx . skills }
408422 />
409423 < AssistantChangedFilesSection
410424 turnSummary = { row . assistantTurnDiffSummary }
@@ -744,6 +758,7 @@ const UserMessageTerminalContextInlineLabel = memo(
744758const UserMessageBody = memo ( function UserMessageBody ( props : {
745759 text : string ;
746760 terminalContexts : ParsedTerminalContextEntry [ ] ;
761+ skills : ReadonlyArray < Pick < ServerProviderSkill , "name" | "displayName" > > ;
747762} ) {
748763 if ( props . terminalContexts . length > 0 ) {
749764 const hasEmbeddedInlineLabels = textContainsInlineTerminalContextLabels (
@@ -766,7 +781,7 @@ const UserMessageBody = memo(function UserMessageBody(props: {
766781 if ( matchIndex > cursor ) {
767782 inlineNodes . push (
768783 < span key = { `user-terminal-context-inline-before:${ context . header } :${ cursor } ` } >
769- { props . text . slice ( cursor , matchIndex ) }
784+ < SkillInlineText text = { props . text . slice ( cursor , matchIndex ) } skills = { props . skills } />
770785 </ span > ,
771786 ) ;
772787 }
@@ -783,7 +798,7 @@ const UserMessageBody = memo(function UserMessageBody(props: {
783798 if ( cursor < props . text . length ) {
784799 inlineNodes . push (
785800 < span key = { `user-message-terminal-context-inline-rest:${ cursor } ` } >
786- { props . text . slice ( cursor ) }
801+ < SkillInlineText text = { props . text . slice ( cursor ) } skills = { props . skills } />
787802 </ span > ,
788803 ) ;
789804 }
@@ -811,7 +826,11 @@ const UserMessageBody = memo(function UserMessageBody(props: {
811826 }
812827
813828 if ( props . text . length > 0 ) {
814- inlineNodes . push ( < span key = "user-message-terminal-context-inline-text" > { props . text } </ span > ) ;
829+ inlineNodes . push (
830+ < span key = "user-message-terminal-context-inline-text" >
831+ < SkillInlineText text = { props . text } skills = { props . skills } />
832+ </ span > ,
833+ ) ;
815834 } else if ( inlinePrefix . length === 0 ) {
816835 return null ;
817836 }
@@ -829,7 +848,7 @@ const UserMessageBody = memo(function UserMessageBody(props: {
829848
830849 return (
831850 < div className = "whitespace-pre-wrap wrap-break-word text-sm leading-relaxed text-foreground" >
832- { props . text }
851+ < SkillInlineText text = { props . text } skills = { props . skills } />
833852 </ div >
834853 ) ;
835854} ) ;
0 commit comments