Table of Contents

Class TurnInputMonitor

Namespace
JD.AI.Agent
Assembly
JD.AI.dll

Monitors keystrokes during an agent turn to support:

  1. Double-tap ESC to cancel the current turn
  2. 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

appToken CancellationToken
doubleTapWindow TimeSpan?

Properties

SteeringMessage

The steering message typed and submitted (Enter) during the turn, or null.

public string? SteeringMessage { get; }

Property Value

string

Token

Token that becomes cancelled on double-ESC or Ctrl+C.

public CancellationToken Token { get; }

Property Value

CancellationToken

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()