SessionEvent, so a switch on
event.type narrows it. Tool calls carry a normalized detail that says which tool it is and
what it was given, the same for local and cloud sessions:
Tool calls, the same on both agents
The local CLI and the cloud describe tools differently on the wire (typedrawInput and
cognition.ai/inferenceToolName locally; cognition.ai/eventType plus _meta details such as
cognition.ai/command and cognition.ai/fileUpdates on the cloud). ToolCall.detail normalizes
both into one discriminated union — exec, read, write, edit, list_directory,
file_search, mcp, permission_request, ask_user_question, computer_use, report_blocker,
or other — so consumers narrow on detail.tool and never see the difference. computer_use
(added in 0.0.1-beta.2) is Devin driving its browser or desktop on the cloud; detail.actions
lists the typed actions it took (key, type, screenshot, …). The raw rawInput, meta,
toolName and inferenceToolName stay on the call for anything the union does not cover.
Cognition extension notifications
Cognition-specific events (_cognition.ai/* notifications — agent stop causes, context
compaction, connection retries, …) are surfaced as a typed union via session.onExtension:

