File tree Expand file tree Collapse file tree
apps/sim/lib/copilot/tools/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,24 +49,24 @@ describe('resolveToolDisplay', () => {
4949 ) . toBe ( 'Read RET XYZ' )
5050 } )
5151
52- it ( 'formats docs corpus reads as Section /page' , ( ) => {
52+ it ( 'formats docs corpus reads as section /page' , ( ) => {
5353 expect (
5454 resolveToolDisplay ( ReadTool . id , ClientToolCallState . success , {
5555 path : 'docs/workflows/blocks/agent.mdx' ,
5656 } ) ?. text
57- ) . toBe ( 'Read Workflows /agent' )
57+ ) . toBe ( 'Read workflows /agent' )
5858
5959 expect (
6060 resolveToolDisplay ( ReadTool . id , ClientToolCallState . executing , {
6161 path : 'docs/integrations/gmail.mdx' ,
6262 } ) ?. text
63- ) . toBe ( 'Reading Integrations /gmail' )
63+ ) . toBe ( 'Reading integrations /gmail' )
6464
6565 expect (
6666 resolveToolDisplay ( ReadTool . id , ClientToolCallState . error , {
6767 path : 'docs/getting-started.mdx' ,
6868 } ) ?. text
69- ) . toBe ( 'Attempted to read Getting -started' )
69+ ) . toBe ( 'Attempted to read getting -started' )
7070 } )
7171
7272 it ( 'decodes percent-encoded VFS path segments for display' , ( ) => {
Original file line number Diff line number Diff line change @@ -145,20 +145,16 @@ function describeFileReadTarget(segments: string[]): string {
145145}
146146
147147/**
148- * Labels a docs/ corpus read as `<Section >/<page>` (e.g. `Workflows /agent` for
149- * docs/workflows/blocks/agent.mdx). Top-level pages show just their capitalized
150- * name (e.g. `Getting -started` for docs/getting-started.mdx).
148+ * Labels a docs/ corpus read as `<section >/<page>` (e.g. `workflows /agent` for
149+ * docs/workflows/blocks/agent.mdx). Top-level pages show just their name (e.g.
150+ * `getting -started` for docs/getting-started.mdx).
151151 */
152152function describeDocsReadTarget ( segments : string [ ] ) : string {
153153 const rest = segments . slice ( 1 )
154154 if ( rest . length === 0 ) return 'docs'
155155 const leaf = stripExtension ( rest [ rest . length - 1 ] )
156- if ( rest . length === 1 ) return capitalizeFirst ( leaf )
157- return `${ capitalizeFirst ( rest [ 0 ] ) } /${ leaf } `
158- }
159-
160- function capitalizeFirst ( value : string ) : string {
161- return value . charAt ( 0 ) . toUpperCase ( ) + value . slice ( 1 )
156+ if ( rest . length === 1 ) return leaf
157+ return `${ rest [ 0 ] } /${ leaf } `
162158}
163159
164160function getLeafResourceSegment ( segments : string [ ] ) : string {
You can’t perform that action at this time.
0 commit comments