docs: document the OpenCode client migration surfaces (OM-179)

Adds JSDoc comments to the functions this branch adds or changes, so the touched-code docstring coverage clears the review threshold. Comments only; no code, formatting or import changes.
This commit is contained in:
Chris Scott committed 2026-11-05 16:32:43 -05:00
1 parent 64e87ba1ea
commit 6297403a41
41 files changed
+691

No files matched your search

@@ -29,6 +29,12 @@ interface NewestPageRead {
const TRANSCRIPT_FALLBACK_POLL_INTERVAL_MS = 5000
/**
* Returns the live transcript for one session: messages, pending tool calls, and status, kept
* current by applying stream events on animation frames and re-reading the newest page whenever
* events are missed or the stream reconnects. `fetchOlder` pages backwards through history, and
* polling stands in while the stream is not healthy.
*/
export function useSessionTranscript(sessionID: string, directory: string) {
const serverId = useOpenCodeServerId()
const isRemoteServer = !isLocalOpenCodeServer(serverId)
@@ -137,6 +143,10 @@ export function useSessionTranscript(sessionID: string, directory: string) {
void readNewestPage().catch(() => undefined)
}
/**
* Applies the events queued since the last frame to the cached transcript and requests a resync
* when the projection reports the cache fell behind.
*/
const flush = () => {
frameRef.current = null
const events = queuedEventsRef.current