MCPcopy Create free account
hub / github.com/diillson/chatcli / NewInputGuard

Function NewInputGuard

cli/coder/input_guard.go:51–60  ·  view source on GitHub ↗

NewInputGuard constructs a guard with sensible defaults. A nil logger is replaced with a no-op logger so callers in non-logged paths don't crash.

(logger *zap.Logger)

Source from the content-addressed store, hash-verified

49// NewInputGuard constructs a guard with sensible defaults. A nil logger is
50// replaced with a no-op logger so callers in non-logged paths don't crash.
51func NewInputGuard(logger *zap.Logger) *InputGuard {
52 if logger == nil {
53 logger = zap.NewNop()
54 }
55 return &InputGuard{
56 logger: logger,
57 debounceWindow: DefaultIntentDebounce,
58 flushTTYFn: flushTTYInput,
59 }
60}
61
62// WithDebounceWindow overrides the post-mount debounce duration. A value of
63// zero or negative disables debouncing entirely (useful for unit tests).

Calls

no outgoing calls