9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
39 lines
1.8 KiB
JavaScript
39 lines
1.8 KiB
JavaScript
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
import { DOUBAO_DOMAIN, openMeetingPanel, getMeetingTranscript, parseDoubaoConversationId, triggerTranscriptDownload, } from './utils.js';
|
|
export const meetingTranscriptCommand = cli({
|
|
site: 'doubao',
|
|
name: 'meeting-transcript',
|
|
access: 'read',
|
|
description: 'Get or download the meeting transcript from a Doubao conversation',
|
|
domain: DOUBAO_DOMAIN,
|
|
strategy: Strategy.COOKIE,
|
|
browser: true,
|
|
siteSession: 'persistent',
|
|
navigateBefore: false,
|
|
args: [
|
|
{ name: 'id', required: true, positional: true, help: 'Conversation ID (numeric or full URL)' },
|
|
{ name: 'download', required: false, help: 'Trigger browser file download instead of reading text', default: 'false' },
|
|
],
|
|
columns: ['Section', 'Content'],
|
|
func: async (page, kwargs) => {
|
|
const conversationId = parseDoubaoConversationId(kwargs.id);
|
|
const shouldDownload = kwargs.download === 'true' || kwargs.download === true;
|
|
const opened = await openMeetingPanel(page, conversationId);
|
|
if (!opened) {
|
|
return [{ Section: 'Error', Content: 'No meeting card found in this conversation.' }];
|
|
}
|
|
if (shouldDownload) {
|
|
const ok = await triggerTranscriptDownload(page);
|
|
if (!ok) {
|
|
return [{ Section: 'Error', Content: 'Failed to trigger transcript download.' }];
|
|
}
|
|
return [{ Section: 'Download', Content: 'Transcript download triggered in browser. Check your Downloads folder.' }];
|
|
}
|
|
const transcript = await getMeetingTranscript(page);
|
|
if (!transcript) {
|
|
return [{ Section: 'Info', Content: 'No transcript content found. The meeting may not have a text record.' }];
|
|
}
|
|
return [{ Section: 'Transcript', Content: transcript }];
|
|
},
|
|
});
|