Class TurnInputMonitor
Monitors keystrokes during an agent turn to support:
- Double-tap ESC to cancel the current turn
- Type-ahead steering — type and press Enter to queue a follow-up message
Keystroke capture is silent (intercept: true) so it doesn't interleave with streaming output. Queued steering messages are processed after the current turn completes.
public sealed class TurnInputMonitor : IDisposable
- Inheritance
-
TurnInputMonitor
- Implements
- Inherited Members
Constructors
TurnInputMonitor(CancellationToken, TimeSpan?)
public TurnInputMonitor(CancellationToken appToken, TimeSpan? doubleTapWindow = null)
Parameters
appTokenCancellationTokendoubleTapWindowTimeSpan?
Properties
SteeringMessage
The steering message typed and submitted (Enter) during the turn, or null.
public string? SteeringMessage { get; }
Property Value
Token
Token that becomes cancelled on double-ESC or Ctrl+C.
public CancellationToken Token { get; }
Property Value
Methods
CancelTurn()
Cancel this turn from an external source (e.g. Ctrl+C handler).
public void CancelTurn()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()