Handle export-diagnostics-jsonl IPC from the diagnostics panel.

Forwards filtered JSONL lines to the platform writer and replies with the saved file path for UI toasts.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-23 06:22:22 -04:00
co-authored by Cursor
parent c27ecfa440
commit 1735572f73
+11 -2
View File
@@ -15,11 +15,14 @@ let voiceCaptureTraceWindowBytes = 0
function resetVoiceCaptureTrace () {
voiceCaptureChunkCount = 0
voiceCaptureBytes = 0
displayCaptureFrameCount = 0
voiceCaptureTraceWindowStart = Date.now()
voiceCaptureTraceWindowBytes = 0
}
function resetDisplayCaptureTrace () {
displayCaptureFrameCount = 0
}
function fromBase64 (str) {
if (typeof Buffer !== 'undefined') return Buffer.from(str || '', 'base64')
return b4a.from(str || '', 'base64')
@@ -578,13 +581,14 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
return true
}
if (t === 'start-screen-share') {
resetDisplayCaptureTrace()
await platform.startScreenShare(msg.label)
pushState()
return true
}
if (t === 'stop-screen-share') {
await platform.stopScreenShare()
resetVoiceCaptureTrace()
resetDisplayCaptureTrace()
pushState()
return true
}
@@ -1364,6 +1368,11 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
await platform.setComposeDraft(msg.channelId, msg.text ?? '')
return true
}
if (t === 'export-diagnostics-jsonl') {
const out = platform.writeDiagnosticsJsonl(msg.lines || [])
send({ type: 'diagnostics-jsonl-exported', ...out })
return true
}
if (t === 'mark-all-notifications-read') {
await platform.markAllNotificationsRead()
pushState()