Observe a note enhancement
Returns an operation snapshot using the caller’s existing note-edit authorization.
With operation_id, observe that operation; an unknown ID returns 404.
Without it, observe the latest operation, or an idle snapshot when none exists.
Accept: application/json returns the current snapshot. With
Accept: text/event-stream, each enhancement event’s JSON data has the
GetNoteEnhancementResponse schema. The stream subscribes before reading and
replaying the latest snapshot, then sends ordered full accumulated HTML snapshots.
Content replaces the previous preview; it is never a text delta. Compare
both operation_id and sequence, because sequences restart for each operation.
SSE IDs are <operation_id>:<sequence>; reconnect always replays the latest
full snapshot, so retaining an event ID is not required.
The stream without an operation ID remains open to observe subsequent operations
and their durable terminal state. content is only a preview while running.
Only a completed snapshot’s ai_note confirms that the result has been saved.
operation_id to read a specific operation; omit it for the latest operation, or idle when none exists.
Accept: application/json returns {enhancement: ...}. Accept: text/event-stream opens an authenticated stream of enhancement events with the same JSON wrapper. Subscribe before starting an enhancement to show progress in an open editor. The stream replays the latest snapshot when reconnecting and, without operation_id, continues observing later operations.
Each content is the full accumulated HTML preview: replace the previous preview rather than appending it. Compare operation_id and sequence together because the sequence restarts for each operation. SSE event IDs use <operation_id>:<sequence>.
Statuses are idle, running, completed, and failed. A running preview is not saved; only completed with ai_note confirms the durable result. On failure, keep the previous saved content and read the latest note before retrying. See start enhancement and CLI status commands.