@@ -252,7 +252,11 @@ import type { SessionPhase, Thread } from "../../types";
252252import type { PendingUserInputDraftAnswer } from "../../pendingUserInput" ;
253253import type { PendingApproval , PendingUserInput } from "../../session-logic" ;
254254import { deriveLatestContextWindowSnapshot } from "../../lib/contextWindow" ;
255- import { formatProviderSkillDisplayName } from "@t3tools/client-runtime/providerSkills" ;
255+ import {
256+ formatProviderSkillDisplayName ,
257+ getProviderSlashCommandsForSlashMenu ,
258+ getProviderSkillsForSlashMenu ,
259+ } from "@t3tools/client-runtime/providerSkills" ;
256260import { searchProviderSkills } from "../../providerSkillSearch" ;
257261import { useMediaQuery } from "../../hooks/useMediaQuery" ;
258262import type { ReviewCommentContext } from "../../reviewCommentContext" ;
@@ -1107,30 +1111,33 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
11071111 ] as const )
11081112 : [ ] ) ,
11091113 ] satisfies ReadonlyArray < Extract < ComposerCommandItem , { type : "slash-command" } > > ;
1110- const providerSlashCommandItems = ( selectedProviderStatus ?. slashCommands ?? [ ] ) . map (
1111- ( command ) => ( {
1112- id : `provider-slash-command:${ selectedProvider } :${ command . name } ` ,
1113- type : "provider-slash-command" as const ,
1114- provider : selectedProvider ,
1115- command,
1116- label : `/${ command . name } ` ,
1117- description : command . description ?? command . input ?. hint ?? "Run provider command" ,
1118- } ) ,
1114+ const slashMenuSkills = getProviderSkillsForSlashMenu (
1115+ selectedProviderStatus ?. skills ?? [ ] ,
1116+ settings . showSkillsInSlashMenu ,
11191117 ) ;
1118+ const providerSlashCommandItems = getProviderSlashCommandsForSlashMenu (
1119+ selectedProviderStatus ?. slashCommands ?? [ ] ,
1120+ slashMenuSkills ,
1121+ ) . map ( ( command ) => ( {
1122+ id : `provider-slash-command:${ selectedProvider } :${ command . name } ` ,
1123+ type : "provider-slash-command" as const ,
1124+ provider : selectedProvider ,
1125+ command,
1126+ label : `/${ command . name } ` ,
1127+ description : command . description ?? command . input ?. hint ?? "Run provider command" ,
1128+ } ) ) ;
11201129 const query = composerTrigger . query . trim ( ) . toLowerCase ( ) ;
1121- const skillItems = ( selectedProviderStatus ?. skills ?? [ ] )
1122- . filter ( ( skill ) => skill . enabled )
1123- . map ( ( skill ) => ( {
1124- id : `skill:${ selectedProvider } :${ skill . name } ` ,
1125- type : "skill" as const ,
1126- provider : selectedProvider ,
1127- skill,
1128- label : `skill:${ skill . name } ` ,
1129- description :
1130- skill . shortDescription ??
1131- skill . description ??
1132- ( skill . scope ? `${ skill . scope } skill` : "" ) ,
1133- } ) ) ;
1130+ const skillItems = slashMenuSkills . map ( ( skill ) => ( {
1131+ id : `skill:${ selectedProvider } :${ skill . name } ` ,
1132+ type : "skill" as const ,
1133+ provider : selectedProvider ,
1134+ skill,
1135+ label : `/skill:${ skill . name } ` ,
1136+ description :
1137+ skill . shortDescription ??
1138+ skill . description ??
1139+ ( skill . scope ? `${ skill . scope } skill` : "" ) ,
1140+ } ) ) ;
11341141 const slashCommandItems = [
11351142 ...builtInSlashCommandItems ,
11361143 ...providerSlashCommandItems ,
@@ -1159,6 +1166,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
11591166 planModeUiEnabled ,
11601167 selectedProvider ,
11611168 selectedProviderStatus ,
1169+ settings . showSkillsInSlashMenu ,
11621170 workspaceEntries . entries ,
11631171 ] ) ;
11641172
0 commit comments