Leans on the Agent SDK rather than hand-rolling a subprocess, which buys most of
this adapter outright:
- query() streaming-input loop — typed SDKMessages, native image input, cancel
through an AbortController
- includePartialMessages — token-level streaming into the overlay
- PreToolUse hooks — robust before/after diff capture at the point of the write
- createSdkMcpServer + tool() — a get_element_context tool exposing the selection
- outputFormat with a JSON schema — a typed { summary, filesChanged, followUps }
- enableFileCheckpointing + rewindFiles — native undo