MCPcopy
hub / github.com/codeaashu/claude-code / getSearchReadSummaryText

Function getSearchReadSummaryText

src/utils/collapseReadSearch.ts:961–1066  ·  view source on GitHub ↗
(
  searchCount: number,
  readCount: number,
  isActive: boolean,
  replCount: number = 0,
  memoryCounts?: {
    memorySearchCount: number
    memoryReadCount: number
    memoryWriteCount: number
    teamMemorySearchCount?: number
    teamMemoryReadCount?: number
    teamMemoryWriteCount?: number
  },
  listCount: number = 0,
)

Source from the content-addressed store, hash-verified

959 * @returns Summary text like "Searching for 3 patterns, reading 2 files, REPL'd 5 times…"
960 */
961export function getSearchReadSummaryText(
962 searchCount: number,
963 readCount: number,
964 isActive: boolean,
965 replCount: number = 0,
966 memoryCounts?: {
967 memorySearchCount: number
968 memoryReadCount: number
969 memoryWriteCount: number
970 teamMemorySearchCount?: number
971 teamMemoryReadCount?: number
972 teamMemoryWriteCount?: number
973 },
974 listCount: number = 0,
975): string {
976 const parts: string[] = []
977
978 // Memory operations first
979 if (memoryCounts) {
980 const { memorySearchCount, memoryReadCount, memoryWriteCount } =
981 memoryCounts
982 if (memoryReadCount > 0) {
983 const verb = isActive
984 ? parts.length === 0
985 ? 'Recalling'
986 : 'recalling'
987 : parts.length === 0
988 ? 'Recalled'
989 : 'recalled'
990 parts.push(
991 `${verb} ${memoryReadCount} ${memoryReadCount === 1 ? 'memory' : 'memories'}`,
992 )
993 }
994 if (memorySearchCount > 0) {
995 const verb = isActive
996 ? parts.length === 0
997 ? 'Searching'
998 : 'searching'
999 : parts.length === 0
1000 ? 'Searched'
1001 : 'searched'
1002 parts.push(`${verb} memories`)
1003 }
1004 if (memoryWriteCount > 0) {
1005 const verb = isActive
1006 ? parts.length === 0
1007 ? 'Writing'
1008 : 'writing'
1009 : parts.length === 0
1010 ? 'Wrote'
1011 : 'wrote'
1012 parts.push(
1013 `${verb} ${memoryWriteCount} ${memoryWriteCount === 1 ? 'memory' : 'memories'}`,
1014 )
1015 }
1016 // Team memory operations
1017 if (feature('TEAMMEM') && teamMemOps) {
1018 teamMemOps.appendTeamMemorySummaryParts(memoryCounts, isActive, parts)

Callers 3

extractLastToolInfoFunction · 0.85

Calls 2

featureFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected