Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

757 B
Raw Blame
import { cli, Strategy } from '@jackwener/opencli/registry';
import { formatDate, mubuPost } from './utils.js';

cli({
  site: 'mubu',
  name: 'recent',
    access: 'read',
  description: '最近编辑的幕布文档',
  domain: 'mubu.com',
  strategy: Strategy.COOKIE,
  args: [
    { name: 'limit', type: 'int', default: 20, help: '最多显示条数' },
  ],
  columns: ['id', 'name', 'updated'],
  func: async (page, kwargs) => {
    const limit = kwargs.limit;

    await page.goto('https://mubu.com/app');

    const data = await mubuPost(page, '/list/get', { folderId: 'recent' });

    return (data.documents ?? []).slice(0, limit).map((doc) => ({
      id: doc.id,
      name: doc.name,
      updated: formatDate(doc.updateTime),
    }));
  },
});