@@ -52,7 +52,7 @@ import type {
5252 ScheduledTaskId ,
5353 TurnItemId ,
5454} from "@t3tools/contracts" ;
55- import { RunId , ThreadId } from "@t3tools/contracts" ;
55+ import { DEFAULT_CLIENT_SETTINGS , RunId , ThreadId } from "@t3tools/contracts" ;
5656import {
5757 classifyToolActivity ,
5858 collectToolFilePaths ,
@@ -253,12 +253,19 @@ function compactWorkEntryText(value: string): string {
253253 return value . replace ( / \s + / gu, " " ) . trim ( ) ;
254254}
255255
256- export function workEntryRowLabel ( entry : WorkLogPresentationEntry , expanded = false ) : string {
256+ export function workEntryRowLabel (
257+ entry : WorkLogPresentationEntry ,
258+ expanded = false ,
259+ ignoredCommandPrefixes : ReadonlyArray < string > = [ ] ,
260+ ) : string {
257261 if ( expanded && entry . itemType === "reasoning" )
258262 return entry . toolLifecycleStatus === "inProgress" ? "Thinking" : "Thought" ;
259263 const presentation = resolveWorkEntryToolPresentation ( entry ) ;
260264 if ( presentation ) return presentation . displayName ;
261- if ( entry . command ?. trim ( ) ) return compactWorkEntryText ( commandDisplayText ( entry . command ) ) ;
265+ if ( entry . command ?. trim ( ) )
266+ return compactWorkEntryText (
267+ commandDisplayText ( entry . command , expanded ? [ ] : ignoredCommandPrefixes ) ,
268+ ) ;
262269 const action = toolGroupAction ( entry ) ;
263270 const isToolRead = action === "read" && entry . itemType === "dynamic_tool" ;
264271 if ( action === "code-search" || action === "search" ) {
@@ -318,6 +325,7 @@ const presentedActivityGroupsCache = new WeakMap<
318325 readonly activeRunId : RunId | null ;
319326 readonly isWorking : boolean ;
320327 readonly activeTail : boolean ;
328+ readonly ignoredCommandPrefixes : ReadonlyArray < string > ;
321329 readonly rows : ReadonlyArray < ThreadFeedEntry > ;
322330 }
323331> ( ) ;
@@ -854,15 +862,23 @@ function toFeedActivity(
854862 } ;
855863}
856864
857- function singleToolCallLabel ( activity : ThreadFeedActivity , expanded : boolean ) : string {
865+ function singleToolCallLabel (
866+ activity : ThreadFeedActivity ,
867+ expanded : boolean ,
868+ ignoredCommandPrefixes : ReadonlyArray < string > ,
869+ ) : string {
858870 if ( activity . workEntry . itemType === "reasoning" )
859871 return expanded
860872 ? "Thought"
861873 : compactWorkEntryText ( activity . workEntry . detail ?? "" ) || "Thought" ;
862874 const presentation = resolveWorkEntryToolPresentation ( activity . workEntry , "completed" ) ;
863875 if ( presentation ) return presentation . displayName ;
864876 const command = activity . workEntry . command ?. trim ( ) ;
865- return command || activity . summary ;
877+ return command
878+ ? ignoredCommandPrefixes . length > 0
879+ ? commandDisplayText ( command , ignoredCommandPrefixes )
880+ : command
881+ : activity . summary ;
866882}
867883
868884function isEmptyMessage ( entry : RawThreadFeedEntry ) : boolean {
@@ -1238,6 +1254,7 @@ export function deriveThreadFeedPresentation(
12381254 expandedWorkGroupIds : ReadonlySet < string > = new Set ( ) ,
12391255 activeWorkStartedAt : string | null = null ,
12401256 runlessWorkActive = false ,
1257+ ignoredCommandPrefixes : ReadonlyArray < string > = DEFAULT_CLIENT_SETTINGS . ignoredCommandPrefixes ,
12411258) : ThreadFeedEntry [ ] {
12421259 const retainedFeed = feed . filter (
12431260 ( entry ) =>
@@ -1324,6 +1341,7 @@ export function deriveThreadFeedPresentation(
13241341 activeRunId ,
13251342 isWorking ,
13261343 isActiveTailGroup ,
1344+ ignoredCommandPrefixes ,
13271345 ) ;
13281346 }
13291347 }
@@ -1387,6 +1405,7 @@ function appendPresentedFeedEntry(
13871405 activeRunId : RunId | null ,
13881406 isWorking : boolean ,
13891407 activeTail : boolean ,
1408+ ignoredCommandPrefixes : ReadonlyArray < string > ,
13901409) : void {
13911410 if ( entry . type !== "activity-group" ) {
13921411 result . push ( entry ) ;
@@ -1408,13 +1427,22 @@ function appendPresentedFeedEntry(
14081427 cached . activeRunId !== activeRunId ||
14091428 cached . isWorking !== isWorking ||
14101429 cached . activeTail !== activeTail ||
1430+ cached . ignoredCommandPrefixes !== ignoredCommandPrefixes ||
14111431 cached . rows . some (
14121432 ( row ) => row . type === "work-toggle" && expandedWorkGroupIds . has ( row . groupId ) !== row . expanded ,
14131433 )
14141434 ) {
14151435 const rows : ThreadFeedEntry [ ] = [ ] ;
1416- appendActivityGroupRows ( rows , entry , expandedWorkGroupIds , activeRunId , isWorking , activeTail ) ;
1417- cached = { activeRunId, isWorking, activeTail, rows } ;
1436+ appendActivityGroupRows (
1437+ rows ,
1438+ entry ,
1439+ expandedWorkGroupIds ,
1440+ activeRunId ,
1441+ isWorking ,
1442+ activeTail ,
1443+ ignoredCommandPrefixes ,
1444+ ) ;
1445+ cached = { activeRunId, isWorking, activeTail, ignoredCommandPrefixes, rows } ;
14181446 presentedActivityGroupsCache . set ( entry , cached ) ;
14191447 }
14201448 for ( const row of cached . rows ) {
@@ -1429,6 +1457,7 @@ function appendActivityGroupRows(
14291457 activeRunId : RunId | null ,
14301458 isWorking : boolean ,
14311459 activeTail : boolean ,
1460+ ignoredCommandPrefixes : ReadonlyArray < string > ,
14321461) : void {
14331462 const groupAnchorIdByActivityId = new Map < string , string > ( ) ;
14341463 let groupAnchorId : string | null = null ;
@@ -1462,6 +1491,7 @@ function appendActivityGroupRows(
14621491 activeRunId ,
14631492 isWorking ,
14641493 activeTail && isTrailingRun ,
1494+ ignoredCommandPrefixes ,
14651495 ) ;
14661496 groupableRun = [ ] ;
14671497 } ;
@@ -1493,6 +1523,7 @@ function appendToolGroupRows(
14931523 activeRunId : RunId | null ,
14941524 isWorking : boolean ,
14951525 activeTail : boolean ,
1526+ ignoredCommandPrefixes : ReadonlyArray < string > ,
14961527) : void {
14971528 const expanded = expandedWorkGroupIds . has ( groupId ) ;
14981529 const latestActiveActivity = activities . findLast (
@@ -1519,11 +1550,11 @@ function appendToolGroupRows(
15191550 ? latestActivity . lifecycleStatus === "inProgress"
15201551 ? "Thinking"
15211552 : "Thought"
1522- : liveToolActivitySummary ( latestActivity , live )
1553+ : liveToolActivitySummary ( latestActivity , live , ignoredCommandPrefixes )
15231554 : singleActivity !== null &&
15241555 singleActivity . toolLike &&
15251556 toolGroupAction ( singleActivity . workEntry ) !== "edit"
1526- ? singleToolCallLabel ( singleActivity , expanded )
1557+ ? singleToolCallLabel ( singleActivity , expanded , ignoredCommandPrefixes )
15271558 : singleActivity !== null && ! singleActivity . toolLike
15281559 ? singleActivity . workEntry . label
15291560 : groupSummary . summary ;
@@ -1598,7 +1629,11 @@ function appendToolGroupRows(
15981629 } ) ;
15991630}
16001631
1601- function liveToolActivitySummary ( activity : ThreadFeedActivity , presentTense : boolean ) : string {
1632+ function liveToolActivitySummary (
1633+ activity : ThreadFeedActivity ,
1634+ presentTense : boolean ,
1635+ ignoredCommandPrefixes : ReadonlyArray < string > ,
1636+ ) : string {
16021637 const status = liveActivityToolStatus ( activity . lifecycleStatus , presentTense ) ;
16031638 if ( activity . workEntry . itemType === "reasoning" ) {
16041639 return (
@@ -1613,7 +1648,7 @@ function liveToolActivitySummary(activity: ThreadFeedActivity, presentTense: boo
16131648 if ( presentation ) return presentation . displayName ;
16141649 const command = activity . workEntry . command ?. trim ( ) ;
16151650 if ( command ) {
1616- const program = commandProgramName ( command ) ;
1651+ const program = commandProgramName ( command , ignoredCommandPrefixes ) ;
16171652 const verb =
16181653 status === "inProgress"
16191654 ? "Running"
0 commit comments