MCPcopy Create free account
hub / github.com/Noumena-Network/code / formatStopHookSpinnerSuffix

Function formatStopHookSpinnerSuffix

src/screens/replMessageSignals.ts:371–399  ·  view source on GitHub ↗
(
  state: StopHookExecutionState,
  isLoading: boolean,
)

Source from the content-addressed store, hash-verified

369}
370
371function formatStopHookSpinnerSuffix(
372 state: StopHookExecutionState,
373 isLoading: boolean,
374): string | null {
375 if (!isLoading || !state.toolUseID || state.total === 0 || state.hasSummary) {
376 return null
377 }
378
379 if (state.customMessage) {
380 return state.total === 1
381 ? `${state.customMessage}…`
382 : `${state.customMessage}… ${state.completedCount}/${state.total}`
383 }
384
385 const hookType = state.hookEvent === 'SubagentStop' ? 'subagent stop' : 'stop'
386
387 if (isInternalBuild()) {
388 const cmd = state.commands[state.completedCount]
389 const label = cmd ? ` '${truncateToWidth(cmd, 40)}'` : ''
390
391 return state.total === 1
392 ? `running ${hookType} hook${label}`
393 : `running ${hookType} hook${label}… ${state.completedCount}/${state.total}`
394 }
395
396 return state.total === 1
397 ? `running ${hookType} hook`
398 : `running stop hooks… ${state.completedCount}/${state.total}`
399}
400
401function isStopHookProgressMessage(
402 message: Message,

Callers 2

withSignalsFunction · 0.85

Calls 2

isInternalBuildFunction · 0.85
truncateToWidthFunction · 0.85

Tested by

no test coverage detected