MCPcopy Create free account
hub / github.com/JordanCoin/codemap / showSessionProgress

Function showSessionProgress

cmd/hooks.go:1052–1079  ·  view source on GitHub ↗

showSessionProgress shows files edited so far in this session

(root string)

Source from the content-addressed store, hash-verified

1050
1051// showSessionProgress shows files edited so far in this session
1052func showSessionProgress(root string) {
1053 state := watch.ReadState(root)
1054 if state == nil || len(state.RecentEvents) == 0 {
1055 return
1056 }
1057
1058 // Count unique files and unique hub files edited
1059 filesEdited := make(map[string]bool)
1060 hubFiles := make(map[string]bool)
1061 for _, e := range state.RecentEvents {
1062 filesEdited[e.Path] = true
1063 if e.IsHub {
1064 hubFiles[e.Path] = true
1065 }
1066 }
1067 hubEdits := len(hubFiles)
1068
1069 if len(filesEdited) == 0 {
1070 return
1071 }
1072
1073 fmt.Println()
1074 fmt.Printf("📊 Session so far: %d files edited", len(filesEdited))
1075 if hubEdits > 0 {
1076 fmt.Printf(", %d hub edits", hubEdits)
1077 }
1078 fmt.Println()
1079}
1080
1081// hookPreCompact saves hub state before context compaction
1082func hookPreCompact(root string) error {

Callers 2

TestShowSessionProgressFunction · 0.85
hookPromptSubmitFunction · 0.85

Calls 1

ReadStateFunction · 0.92

Tested by 1

TestShowSessionProgressFunction · 0.68