File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 11import { CodeSearchComponent } from './code-search'
2+ import { SkillComponent } from './skill'
23import { GlobComponent } from './glob'
34import { ListDirectoryComponent } from './list-directory'
45import { ReadDocsComponent } from './read-docs'
@@ -40,6 +41,7 @@ const toolComponentRegistry = new Map<ToolName, ToolComponent>([
4041 // Propose tools reuse the same rendering as their base counterparts
4142 [ 'propose_str_replace' , StrReplaceComponent ] ,
4243 [ 'propose_write_file' , WriteFileComponent ] ,
44+ [ SkillComponent . toolName , SkillComponent ] ,
4345] )
4446
4547/**
Original file line number Diff line number Diff line change 1+ import { SimpleToolCallItem } from './tool-call-item'
2+ import { defineToolComponent } from './types'
3+
4+ import type { ToolRenderConfig } from './types'
5+
6+ /**
7+ * UI component for skill tool.
8+ * Displays the skill name being loaded in a compact format.
9+ */
10+ export const SkillComponent = defineToolComponent ( {
11+ toolName : 'skill' ,
12+
13+ render ( toolBlock ) : ToolRenderConfig {
14+ const input = toolBlock . input as any
15+
16+ const skillName =
17+ typeof input ?. name === 'string' ? input . name . trim ( ) : ''
18+
19+ if ( ! skillName ) {
20+ return { content : null }
21+ }
22+
23+ return {
24+ content : (
25+ < SimpleToolCallItem name = "Load Skill" description = { skillName } />
26+ ) ,
27+ }
28+ } ,
29+ } )
You can’t perform that action at this time.
0 commit comments