MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / parseHistoryItem

Function parseHistoryItem

cli/src/hooks/use-input-history.ts:16–26  ·  view source on GitHub ↗

* Determine the appropriate input mode and display text for a history item. * Bash commands are stored with '!' prefix, so we detect that and return * the appropriate mode and text to display.

(item: string)

Source from the content-addressed store, hash-verified

14 * the appropriate mode and text to display.
15 */
16function parseHistoryItem(item: string): {
17 mode: InputMode
18 displayText: string
19} {
20 if (item.startsWith('!') && item.length > 1) {
21 // It's a bash command - strip the '!' prefix for display
22 return { mode: 'bash', displayText: item.slice(1) }
23 }
24 // Regular prompt
25 return { mode: 'default', displayText: item }
26}
27
28export const useInputHistory = (
29 inputValue: string,

Callers 1

useInputHistoryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected