/ clis / doubao / meeting-summary.js
meeting-summary.js
 1  import { cli, Strategy } from '@jackwener/opencli/registry';
 2  import { DOUBAO_DOMAIN, openMeetingPanel, getMeetingSummary, getMeetingChapters, parseDoubaoConversationId, } from './utils.js';
 3  export const meetingSummaryCommand = cli({
 4      site: 'doubao',
 5      name: 'meeting-summary',
 6      description: 'Get meeting summary and chapters from a Doubao conversation',
 7      domain: DOUBAO_DOMAIN,
 8      strategy: Strategy.COOKIE,
 9      browser: true,
10      navigateBefore: false,
11      args: [
12          { name: 'id', required: true, positional: true, help: 'Conversation ID (numeric or full URL)' },
13          { name: 'chapters', required: false, help: 'Also include AI chapters', default: 'false' },
14      ],
15      columns: ['Section', 'Content'],
16      func: async (page, kwargs) => {
17          const conversationId = parseDoubaoConversationId(kwargs.id);
18          const includeChapters = kwargs.chapters === 'true' || kwargs.chapters === true;
19          const opened = await openMeetingPanel(page, conversationId);
20          if (!opened) {
21              return [{ Section: 'Error', Content: 'No meeting card found in this conversation.' }];
22          }
23          const summary = await getMeetingSummary(page);
24          const result = [];
25          if (summary) {
26              result.push({ Section: 'Summary', Content: summary });
27          }
28          if (includeChapters) {
29              const chapters = await getMeetingChapters(page);
30              if (chapters) {
31                  result.push({ Section: 'Chapters', Content: chapters });
32              }
33          }
34          if (result.length === 0) {
35              return [{ Section: 'Info', Content: 'Meeting panel opened but no content found yet. Try again.' }];
36          }
37          return result;
38      },
39  });