MCPcopy Index your code
hub / github.com/codeaashu/claude-code / endCLIActivity

Method endCLIActivity

src/utils/activityManager.ts:106–125  ·  view source on GitHub ↗

* Stops tracking CLI activity

(operationId: string)

Source from the content-addressed store, hash-verified

104 * Stops tracking CLI activity
105 */
106 endCLIActivity(operationId: string): void {
107 this.activeOperations.delete(operationId)
108
109 if (this.activeOperations.size === 0) {
110 // Last operation ended - CLI becoming inactive
111 // Record the CLI time before switching to inactive
112 const now = this.getNow()
113 const timeSinceLastRecord = (now - this.lastCLIRecordedTime) / 1000
114
115 if (timeSinceLastRecord > 0) {
116 const activeTimeCounter = this.getActiveTimeCounter()
117 if (activeTimeCounter) {
118 activeTimeCounter.add(timeSinceLastRecord, { type: 'cli' })
119 }
120 }
121
122 this.lastCLIRecordedTime = now
123 this.isCLIActive = false
124 }
125 }
126
127 /**
128 * Convenience method to track an async operation automatically (mainly for testing/debugging)

Callers 4

startCLIActivityMethod · 0.95
trackOperationMethod · 0.95
SpinnerWithVerbInnerFunction · 0.80
BriefSpinnerFunction · 0.80

Calls 2

deleteMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected