File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,12 @@ export function phase(label: string, sub?: string) {
3939// ─── Tool call — compact, no full paths ──────────────────────────────────────
4040export function toolCall ( name : string , input : Record < string , string > ) {
4141 const arg = input . file_path ?? input . directory ?? Object . values ( input ) [ 0 ] ?? "" ;
42- // show only the last 2 path segments to keep it readable
43- const short = arg . split ( "/" ) . slice ( - 2 ) . join ( "/" ) ;
42+ const isPath = arg . startsWith ( "/" ) || arg . startsWith ( "./" ) || arg . startsWith ( "../" ) || / ^ [ a - z A - Z ] : [ / \\ ] / . test ( arg ) || ( arg . includes ( "/" ) && ! / \s / . test ( arg ) ) ;
43+ const display = isPath
44+ ? arg . split ( "/" ) . slice ( - 2 ) . join ( "/" )
45+ : arg . length > 60 ? `${ arg . slice ( 0 , 57 ) } …` : arg ;
4446 const color = name === "write_file" ? `${ GR } ` : `${ D } ` ;
45- console . log ( ` ${ color } ↳ ${ name . padEnd ( 12 ) } ${ short } ${ R } ` ) ;
47+ console . log ( ` ${ color } ↳ ${ name . padEnd ( 12 ) } ${ display } ${ R } ` ) ;
4648}
4749
4850// ─── File item (dry-run / update list) ───────────────────────────────────────
You can’t perform that action at this time.
0 commit comments