@@ -52,18 +52,6 @@ function printToolResponseText(response: ToolResponse): void {
5252 }
5353}
5454
55- /**
56- * Get the base tool name without workflow prefix.
57- * For disambiguated tools, strips the workflow prefix.
58- */
59- function getBaseToolName ( cliName : string , workflow : string ) : string {
60- const prefix = `${ workflow } -` ;
61- if ( cliName . startsWith ( prefix ) ) {
62- return cliName . slice ( prefix . length ) ;
63- }
64- return cliName ;
65- }
66-
6755/**
6856 * Format a tool list for display.
6957 */
@@ -74,7 +62,6 @@ export function formatToolList(
7462 const lines : string [ ] = [ ] ;
7563
7664 if ( options . grouped ) {
77- // Group by workflow - show subcommand names
7865 const byWorkflow = new Map < string , typeof tools > ( ) ;
7966 for ( const tool of tools ) {
8067 const existing = byWorkflow . get ( tool . workflow ) ?? [ ] ;
@@ -85,37 +72,28 @@ export function formatToolList(
8572 for ( const workflow of sortedWorkflows ) {
8673 lines . push ( `\n${ workflow } :` ) ;
8774 const workflowTools = byWorkflow . get ( workflow ) ?? [ ] ;
88- // Sort by base name (without prefix)
89- const sortedTools = workflowTools . sort ( ( a , b ) => {
90- const aBase = getBaseToolName ( a . cliName , a . workflow ) ;
91- const bBase = getBaseToolName ( b . cliName , b . workflow ) ;
92- return aBase . localeCompare ( bBase ) ;
93- } ) ;
75+ const sortedTools = workflowTools . sort ( ( a , b ) => a . cliName . localeCompare ( b . cliName ) ) ;
9476
9577 for ( const tool of sortedTools ) {
96- // Show subcommand name (without workflow prefix)
97- const toolName = getBaseToolName ( tool . cliName , tool . workflow ) ;
9878 const statefulMarker = tool . stateful ? ' [stateful]' : '' ;
9979 if ( options . verbose && tool . description ) {
100- lines . push ( ` ${ toolName } ${ statefulMarker } ` ) ;
80+ lines . push ( ` ${ tool . cliName } ${ statefulMarker } ` ) ;
10181 lines . push ( ` ${ tool . description } ` ) ;
10282 } else {
10383 const desc = tool . description ? ` - ${ truncate ( tool . description , 60 ) } ` : '' ;
104- lines . push ( ` ${ toolName } ${ statefulMarker } ${ desc } ` ) ;
84+ lines . push ( ` ${ tool . cliName } ${ statefulMarker } ${ desc } ` ) ;
10585 }
10686 }
10787 }
10888 } else {
109- // Flat list - show full workflow-scoped command
11089 const sortedTools = [ ...tools ] . sort ( ( a , b ) => {
111- const aFull = `${ a . workflow } ${ getBaseToolName ( a . cliName , a . workflow ) } ` ;
112- const bFull = `${ b . workflow } ${ getBaseToolName ( b . cliName , b . workflow ) } ` ;
90+ const aFull = `${ a . workflow } ${ a . cliName } ` ;
91+ const bFull = `${ b . workflow } ${ b . cliName } ` ;
11392 return aFull . localeCompare ( bFull ) ;
11493 } ) ;
11594
11695 for ( const tool of sortedTools ) {
117- const toolName = getBaseToolName ( tool . cliName , tool . workflow ) ;
118- const fullCommand = `${ tool . workflow } ${ toolName } ` ;
96+ const fullCommand = `${ tool . workflow } ${ tool . cliName } ` ;
11997 const statefulMarker = tool . stateful ? ' [stateful]' : '' ;
12098 if ( options . verbose && tool . description ) {
12199 lines . push ( `${ fullCommand } ${ statefulMarker } ` ) ;
0 commit comments