Skip to content

nimterm/events

This page is generated from the module’s exported API and ## documentation comments.

Generic UI events, aligned with nimgent’s normalized lifecycle semantics.

UiAction = object
sourceId*: string
targetId*: string
kind*: string
value*: string
index*: int
cancelled*: bool

View source

ApprovalChoice = object
id*: string
key*: string
label*: string

View source

UiMouseKind = enum
umNone, umPress, umRelease, umDrag, umScroll

View source

UiMouseButton = enum
umbNone, umbLeft, umbMiddle, umbRight

View source

AgentUiEventKind = enum
ueRunStarted, ueStepStarted, ueTextDelta, ueThinkingDelta, ueToolCalled,
ueApprovalRequired, ueToolOutputDelta, ueToolResult, ueStepFinished,
ueRunFinished, ueError

View source

AgentUiEvent = object
kind*: AgentUiEventKind
runId*: string
sessionId*: string
turnId*: string
step*: int
prompt*: string
model*: string
text*: string
toolId*: string
toolName*: string
toolInput*: JsonNode
toolOutput*: string
isError*: bool
durationMs*: int
error*: string
approvalChoices*: seq[ApprovalChoice]
cancelChoiceId*: string

View source

UiEventKind = enum
uiNone, uiKey, uiMouse, uiFocus, uiError, uiResize, uiTimer, uiAgent, uiQuit

View source

UiEvent = object
kind*: UiEventKind
key*: Key
text*: string
x*: int
y*: int
mouse*: UiMouseKind
button*: UiMouseButton
shift*: bool
alt*: bool
ctrl*: bool
scrollDelta*: int
focused*: bool
sourceId*: string
error*: string
cancelled*: bool
width*: int
height*: int
timerId*: string
agent*: AgentUiEvent

View source

proc agentEvent(event: AgentUiEvent): UiEvent {.raises: [], tags: [],
forbids: [].}

Returns: UiEvent.

Name Type Default
event AgentUiEvent

View source

proc quitEvent(): UiEvent {.raises: [], tags: [], forbids: [].}

Returns: UiEvent.

View source