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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user