ai_co_discuss 0.5.41 → 0.5.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 写法:正文里的 `visual` 代码块
6
6
 
7
- 在回答正文里写一个信息串恰好为 `visual` 的围栏代码块,内容是一份自包含的 HTML(完整文档或片段都行)。网页在代码块所在位置直接显示并运行它,外面由房间加一圈淡边框和少量内边距与正文区分,高度随内容;页面自己不要再画外框和底色。右上角有房间的工具按钮:电脑上悬停时浮在页面右上角约 150×32px 的范围,不放必须随时看得到或点得到的东西;手机上是常显的“…”和收起,骑在上边框上,不遮挡页面。手机上同样就地显示。
7
+ 在回答正文里写一个信息串恰好为 `visual` 的围栏代码块,内容是一份自包含的 HTML(完整文档或片段都行)。网页在代码块所在位置直接显示并运行它,外面由房间加一圈淡边框和少量内边距与正文区分,高度随内容;页面自己不要再画外框和底色。右上角有房间的工具按钮:电脑上悬停时浮在页面右上角约 150×32px 的范围,不放必须随时看得到或点得到的东西;手机上工具是框内单独的第一行(名称在左,“…”和收起在右上角),在页面上方、不遮挡页面。手机上同样就地显示。
8
8
 
9
9
  ````markdown
10
10
  前面写引出它的话。
@@ -47,7 +47,7 @@ When viewing a project image through the relay on another device, supported imag
47
47
  “File changes” below an answer shows the number of changed files and lines added or removed. Lists of five files or fewer open by default. Select the file count to open a longer list. Read-only visitors can see the list, but only the room owner can view patches.
48
48
 
49
49
  - **Add or remove directories.** A room supports one primary directory and up to eight additional directories. After creating a room, open the “Room” tab at the top of the room and find “Project folder”. Add or remove additional directories there. Changes apply from each member’s next run and do not interrupt a session. A primary directory cannot be changed after it is set. If the room was created without one, you can set it once in the same section. Members can access all room directories subject to their individual project permissions.
50
- - **Open Files.** In the tabs at the top of the room, select “Files” to browse directories, file sizes, and modification times. Switch between the primary and additional directories at the top. A project directory is required. The back and forward buttons at the left of the path bar move between the places you visited (folders, the project list, the recycle bin); on a computer, the mouse side buttons do the same. Phones show only the back button. On a phone you can also swipe anywhere on the page: swipe right to go back and left to go forward. In a file preview, swiping right closes the file and returns to its folder (swiping left does nothing there; image and media previews keep their own gestures). The “Icon view” button at the top right lays the folder out as tiles, with thumbnails for PNG, JPG, and WebP images; “List view” switches back. Thumbnails are made by the computer and currently only on Windows; other images and files show their icons.
50
+ - **Open Files.** In the tabs at the top of the room, select “Files” to browse directories, file sizes, and modification times. Switch between the primary and additional directories at the top. A project directory is required. The back and forward buttons at the left of the path bar move between the places you visited (folders, the project list, the recycle bin); on a computer, the mouse side buttons do the same. Phones show only the back button. On a phone you can also swipe anywhere on the page: swipe right to go back and left to go forward. In a file preview, swiping right closes the file and returns to its folder; while you swipe, a “Collapse” corner appears at the bottom right, and letting go there collapses the preview just like the collapse button or pulling it down, with the file kept open (swiping left does nothing there; image and media previews keep their own gestures). The “Icon view” button at the top right lays the folder out as tiles, with thumbnails for PNG, JPG, and WebP images; “List view” switches back. Thumbnails are made by the computer and currently only on Windows; other images and files show their icons.
51
51
  - **Preview files.** Select a file to open its floating preview. Supported previews include plain text, code, rendered Markdown, static HTML with a source view, zoomable and rotatable images, audio and video with speed and full-screen controls, CSV tables, subtitle timelines (SRT, VTT, ASS, LRC), read-only Word, Excel, PowerPoint and PDF, Premiere project XML, and zip archives listed like a folder, where selecting a file inside opens it in a new tab. Images in Markdown display inline the way message images do; select one to zoom. Paths are accepted as common editors accept them: relative paths, project paths starting with `/`, absolute paths inside the room's project directories (such as `D:\Project\art\a.png` or `file:///D:/Project/art/a.png`), and web addresses. Files outside the room's project directories are not read. Images load as you scroll near them; landscape images fill the width and portrait images fit the window height. Other devices get a copy the computer compressed. Opening a ZIP attachment or project file loads the directory first. Select an entry to read it (up to 64 MiB), or choose “Download” to save the archive.
52
52
  - **Tabs, split view, and collapse.** Open multiple files and switch between tabs. Use the preview controls to split the view on the right or use “File location” to return to the containing folder. HTML previews also offer “Open in new tab”. Select “Collapse” in the title bar to keep the preview as a floating button in the corner. It restores the same file and scroll position when you return to the room. Close it to clear the preview.
53
53
  - **Quote and annotate.** Select text in a Markdown preview or a member’s answer and choose “Add to conversation”. Enter a note and press Enter. The source is marked with a number and the composer shows the number of notes. On a computer, open the notes list, choose “Edit annotation”, and drag the bottom-right corner of the editor to resize it. Sending the message adds a file path and line number, the member and message ID, or for a message attachment its message ID and attachment ID. An `@` inside a quote does not wake a member.
@@ -99,7 +99,7 @@ A page a member delivers can go to a public address, `https://<id>.bimcanvas.com
99
99
 
100
100
  1. Under the answer, select the rocket button, “Deploy as website”, on an HTML file card. A whole folder a member prepared with `codiscuss site stage` (such as a built `dist/`) shows as a “Ready to deploy” card; select “Deploy as website” on it.
101
101
  2. The confirmation lists the file count, size and any files that look like they contain keys or tokens; those are left out by default. Select “Deploy”. The new version goes live only after every file is uploaded; if the upload fails, the live version stays as it was.
102
- 3. Once live, the card shows the address to copy or open; its “…” menu renews for 7 days, rolls back to the previous version or revokes the site. “Published” in the sidebar lists every live website.
102
+ 3. Once live, the card shows the address to copy or open; its “…” menu renews for 1, 3 or 7 days from now, rolls back to the previous version or revokes the site. “Published” in the sidebar lists every live website.
103
103
 
104
104
  To have a member put its work online directly, say “deploy” or “publish as a website” in your message; otherwise members only prepare it and upload nothing.
105
105
 
@@ -45,7 +45,7 @@
45
45
  回答下方的“文件改动”显示已修改的文件数和增删行数。改动不超过 5 个文件时默认展开,超过时点击文件数查看清单。可读房间的访客也能看清单,只有房主能看补丁。
46
46
 
47
47
  - **增删项目目录**:一个房间可有 1 个主项目目录和最多 8 个其他项目目录。建房后打开顶部“房间”页,在“项目目录”区域可增删其他目录,保存后从各成员下一次执行起生效,不中断会话。主目录设置后不能更改;建房时未设的,可在同一行补设一次。成员按各自项目权限读写全部目录。
48
- - **打开“文件”页**:房间顶部的标签栏点“文件”,浏览目录、文件大小与修改时间,上方可切换主目录与其他项目目录。浏览文件需要已设置项目目录。路径栏最左边的返回、前进按钮可在走过的位置(文件夹、项目列表、回收区)间来回,电脑上也可用鼠标侧键;手机上只显示返回。手机上在页面任意位置左右滑动也可以:手指向右滑是返回,向左滑是前进;在文件预览里向右滑会关闭文件,回到它所在的文件夹(预览里向左滑不起作用,图片和音视频预览保留它们自己的手势)。右上角的“图标视图”按钮把列表换成图标排列,PNG、JPG、WebP 图片显示缩略图,再点“列表视图”换回;缩略图由这台电脑生成,目前只在 Windows 电脑上有,其他图片和文件显示图标。
48
+ - **打开“文件”页**:房间顶部的标签栏点“文件”,浏览目录、文件大小与修改时间,上方可切换主目录与其他项目目录。浏览文件需要已设置项目目录。路径栏最左边的返回、前进按钮可在走过的位置(文件夹、项目列表、回收区)间来回,电脑上也可用鼠标侧键;手机上只显示返回。手机上在页面任意位置左右滑动也可以:手指向右滑是返回,向左滑是前进;在文件预览里向右滑会关闭文件,回到它所在的文件夹;滑动时右下角会出现“收起”,手指松在那里则把预览收起,与点“收起预览”按钮或下拉收起相同,文件保持打开(预览里向左滑不起作用,图片和音视频预览保留它们自己的手势)。右上角的“图标视图”按钮把列表换成图标排列,PNG、JPG、WebP 图片显示缩略图,再点“列表视图”换回;缩略图由这台电脑生成,目前只在 Windows 电脑上有,其他图片和文件显示图标。
49
49
  - **预览文件**:点击文件打开悬浮预览,支持纯文本、代码、Markdown 渲染、HTML 静态渲染并可切换源码;图片可缩放、旋转;音视频带倍速与全屏直接播放;CSV 显示为表格,字幕(SRT、VTT、ASS、LRC)显示为时间轴;Word、Excel、PowerPoint 与 PDF 只读预览;Premiere 工程显示其 XML;zip 压缩包像文件夹一样列出其中的文件夹与文件,点击其中的文件在新标签中预览。Markdown 中的图片与消息里的图片显示方式相同,在正文中直接显示,点击可放大查看。支持常见编辑器的写法:相对路径、以 `/` 开头的项目内路径、房间项目目录内的绝对路径(如 `D:\项目\插图\a.png`、`file:///D:/项目/插图/a.png`)与网络地址;房间项目目录之外的文件不会读取。滚动到附近才载入,横图铺满宽度、竖图按窗口高度显示;在其他设备上看到的是电脑压缩过的版本。打开房间附件或项目中的 ZIP 时先显示目录,点包内文件才读取内容。单个文件最多预览 64 MiB,也可以点“下载”保存整个压缩包。
50
50
  - **多标签、分屏与收起**:可同时打开多个文件以标签切换,在预览栏切换为右侧分屏、或点“文件位置”回到所在文件夹。HTML 预览还可以“在新标签页打开”。点标题栏“收起”缩成内容区角落的悬浮按钮,切到其他房间后点它即可回到原文件与滚动位置,关闭才清空。
51
51
  - **摘录批注**:在 Markdown 预览或成员回答正文中选中文字点“添加到对话”,可输入批注并回车,原文标出编号,输入框上方显示“N 条注释”。在电脑上,打开注释列表,点“修改批注”,可拖动编辑框右下角调整宽高。发送时自动附带文件路径+行号、成员+消息编号,或消息附件所属的消息编号与附件 ID,引用中的 `@` 不会唤醒成员。
@@ -99,7 +99,7 @@
99
99
 
100
100
  1. 回答下方的 HTML 文件卡片上点火箭按钮“部署为网站”;成员用 `codiscuss site stage` 准备好的整个目录(如构建出的 `dist/`)会显示为“待部署”卡片,点“部署为网站”。
101
101
  2. 确认框列出文件数、大小和疑似含密钥或令牌的文件,这些文件默认排除;点“部署”。全部文件传完才切到新版本,中途失败时线上旧版不受影响。
102
- 3. 上线后卡片显示网址,可复制、打开;“…”里可续期 7 天、回滚到上一版或撤销。左栏“已发布”列出所有在线网站。
102
+ 3. 上线后卡片显示网址,可复制、打开;“…”里可续期(从现在起 1、3 或 7 天)、回滚到上一版或撤销。左栏“已发布”列出所有在线网站。
103
103
 
104
104
  想让成员做完直接上线,在消息里明确说“部署”或“发布成网站”;没说时成员只准备、不上传。
105
105
 
@@ -610,7 +610,7 @@
610
610
  "已续期,{time} 前有效": "Renewed, live until {time}",
611
611
  "已回滚到上一版": "Rolled back to the previous version",
612
612
  "网站已撤销,地址立即失效": "Website revoked; the address no longer works",
613
- "续期 7 天": "Renew for 7 days",
613
+ "续期网站 {value1}": "Renew website {value1}",
614
614
  "回滚到上一版": "Roll back to the previous version",
615
615
  "撤销网站": "Revoke website",
616
616
  "待部署 · {count} 个文件 · {size}": "Ready to deploy · {count} files · {size}",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.5.41",
3
+ "version": "0.5.42",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -703,7 +703,7 @@ export default {
703
703
  "未知的站点命令:{command}": "Unknown site command: {command}",
704
704
  "站点不属于当前房间": "This site does not belong to the current room",
705
705
  "站点诊断须使用凭据绑定的房间和网站": "Site diagnostics must use the room and server bound to the credential",
706
- "AI CoDiscuss 网站部署\n\n注意:发布到公网须有用户在本房间的明确授权;未经用户明确要求发布时,仅使用 stage 在本机预检登记。\n\n用法:\n codiscuss site stage (--dir 目录 | --file 文件.html) [--room 房间] [--title 标题] [--exclude 路径]\n codiscuss site publish (--dir 目录 | --file 文件.html | --stage 编号) [--site 站点编号] [--room 房间] [--title 标题] [--exclude 路径]\n codiscuss site list [--room 房间]\n codiscuss site diagnose <站点编号> [--room 房间]\n codiscuss site renew <站点编号> [--room 房间]\n codiscuss site rollback <站点编号> [--version 版本号] [--room 房间]\n codiscuss site revoke <站点编号> [--room 房间]\n\n选项:\n --access-file FILE 任务凭据文件(默认读取 DISCUSS_ACCESS_FILE)\n --room ROOM 房间编号(凭据绑定时自动补齐)\n --url SITE 本机/房间网站地址(凭据绑定时自动补齐)\n --dir PATH 要发布的本机构建目录\n --file PATH 要发布的单个 HTML 文件\n --stage ID 对已预检的待部署编号执行发布\n --site ID 更新已有 10 位站点编号\n --title TEXT 站点标题\n --exclude PATH 排除的相对文件路径(可重复传多次)\n --version N 回滚目标版本号(省略则回滚到上一版)\n --json 以 JSON 输出(默认)\n -h, --help 显示帮助\n": "AI CoDiscuss Website Deployment\n\nNotice: publishing to the public internet requires explicit user authorization in this room; without it, only run `stage` for local preflight.\n\nUsage:\n codiscuss site stage (--dir DIR | --file FILE.html) [--room ROOM] [--title TITLE] [--exclude PATH]\n codiscuss site publish (--dir DIR | --file FILE.html | --stage ID) [--site SITE_ID] [--room ROOM] [--title TITLE] [--exclude PATH]\n codiscuss site list [--room ROOM]\n codiscuss site diagnose <SITE_ID> [--room ROOM]\n codiscuss site renew <SITE_ID> [--room ROOM]\n codiscuss site rollback <SITE_ID> [--version N] [--room ROOM]\n codiscuss site revoke <SITE_ID> [--room ROOM]\n\nOptions:\n --access-file FILE Task credential file (defaults to DISCUSS_ACCESS_FILE)\n --room ROOM Room ID (auto-filled when bound by credential)\n --url SITE Local/room site URL (auto-filled when bound by credential)\n --dir PATH Local build directory to deploy\n --file PATH Single HTML file to deploy\n --stage ID Publish a previously staged record\n --site ID Update an existing 10-character site ID\n --title TEXT Site title\n --exclude PATH Relative file path to exclude (repeatable)\n --version N Target version for rollback (defaults to previous version)\n --json Output JSON (default)\n -h, --help Show help\n",
706
+ "AI CoDiscuss 网站部署\n\n注意:发布到公网须有用户在本房间的明确授权;未经用户明确要求发布时,仅使用 stage 在本机预检登记。\n\n用法:\n codiscuss site stage (--dir 目录 | --file 文件.html) [--room 房间] [--title 标题] [--exclude 路径]\n codiscuss site publish (--dir 目录 | --file 文件.html | --stage 编号) [--site 站点编号] [--room 房间] [--title 标题] [--exclude 路径]\n codiscuss site list [--room 房间]\n codiscuss site diagnose <站点编号> [--room 房间]\n codiscuss site renew <站点编号> [--days 1|3|7] [--room 房间]\n codiscuss site rollback <站点编号> [--version 版本号] [--room 房间]\n codiscuss site revoke <站点编号> [--room 房间]\n\n选项:\n --access-file FILE 任务凭据文件(默认读取 DISCUSS_ACCESS_FILE)\n --room ROOM 房间编号(凭据绑定时自动补齐)\n --url SITE 本机/房间网站地址(凭据绑定时自动补齐)\n --dir PATH 要发布的本机构建目录\n --file PATH 要发布的单个 HTML 文件\n --stage ID 对已预检的待部署编号执行发布\n --site ID 更新已有 10 位站点编号\n --title TEXT 站点标题\n --exclude PATH 排除的相对文件路径(可重复传多次)\n --version N 回滚目标版本号(省略则回滚到上一版)\n --days N 续期天数,从现在起算(1、3 或 7,默认 7)\n --json 以 JSON 输出(默认)\n -h, --help 显示帮助\n": "AI CoDiscuss Website Deployment\n\nNotice: publishing to the public internet requires explicit user authorization in this room; without it, only run `stage` for local preflight.\n\nUsage:\n codiscuss site stage (--dir DIR | --file FILE.html) [--room ROOM] [--title TITLE] [--exclude PATH]\n codiscuss site publish (--dir DIR | --file FILE.html | --stage ID) [--site SITE_ID] [--room ROOM] [--title TITLE] [--exclude PATH]\n codiscuss site list [--room ROOM]\n codiscuss site diagnose <SITE_ID> [--room ROOM]\n codiscuss site renew <SITE_ID> [--days 1|3|7] [--room ROOM]\n codiscuss site rollback <SITE_ID> [--version N] [--room ROOM]\n codiscuss site revoke <SITE_ID> [--room ROOM]\n\nOptions:\n --access-file FILE Task credential file (defaults to DISCUSS_ACCESS_FILE)\n --room ROOM Room ID (auto-filled when bound by credential)\n --url SITE Local/room site URL (auto-filled when bound by credential)\n --dir PATH Local build directory to deploy\n --file PATH Single HTML file to deploy\n --stage ID Publish a previously staged record\n --site ID Update an existing 10-character site ID\n --title TEXT Site title\n --exclude PATH Relative file path to exclude (repeatable)\n --version N Target version for rollback (defaults to previous version)\n --days N Days to renew for, counted from now (1, 3 or 7; default 7)\n --json Output JSON (default)\n -h, --help Show help\n",
707
707
  "未知子命令:{sub};运行 codiscuss site --help 查看用法": "Unknown subcommand: {sub}; run `codiscuss site --help` for usage",
708
708
  "本次运行已收窄,不能使用 share-card 命令": "This run is restricted and cannot use the share-card command",
709
709
  "凭据文件不存在:{path}": "Credential file does not exist: {path}",
@@ -865,9 +865,10 @@ export async function site_command(home, command, input = {}, { fetcher = fetch,
865
865
  }
866
866
 
867
867
  if (command === 'site-renew') {
868
- const res = await worker_api(origin, `/api/sites/${site_id}/renew`, {
869
- method: 'POST', token: identity.device_token, body: {}, fetcher,
870
- });
868
+ const body = input.days !== undefined ? { days: Number(input.days) } : {};
869
+ // Renewing is idempotent, so a dropped connection (ECONNRESET through a proxy) is retried once.
870
+ const renew = () => worker_api(origin, `/api/sites/${site_id}/renew`, { method: 'POST', token: identity.device_token, body, fetcher });
871
+ const res = await renew().catch(error => (error.code === 'network_error' ? renew() : Promise.reject(error)));
871
872
  if (conn.room_id && conn.site) {
872
873
  await room_api_request(conn.site, `/api/rooms/${encodeURIComponent(conn.room_id)}/sites`, {
873
874
  method: 'POST',
@@ -933,7 +934,7 @@ const SITE_CLI_HELP = () => t(`AI CoDiscuss 网站部署
933
934
  codiscuss site publish (--dir 目录 | --file 文件.html | --stage 编号) [--site 站点编号] [--room 房间] [--title 标题] [--exclude 路径]
934
935
  codiscuss site list [--room 房间]
935
936
  codiscuss site diagnose <站点编号> [--room 房间]
936
- codiscuss site renew <站点编号> [--room 房间]
937
+ codiscuss site renew <站点编号> [--days 1|3|7] [--room 房间]
937
938
  codiscuss site rollback <站点编号> [--version 版本号] [--room 房间]
938
939
  codiscuss site revoke <站点编号> [--room 房间]
939
940
 
@@ -948,6 +949,7 @@ const SITE_CLI_HELP = () => t(`AI CoDiscuss 网站部署
948
949
  --title TEXT 站点标题
949
950
  --exclude PATH 排除的相对文件路径(可重复传多次)
950
951
  --version N 回滚目标版本号(省略则回滚到上一版)
952
+ --days N 续期天数,从现在起算(1、3 或 7,默认 7)
951
953
  --json 以 JSON 输出(默认)
952
954
  -h, --help 显示帮助
953
955
  `);
@@ -978,6 +980,7 @@ export async function site_cli(args, { home = service_home(), fetcher = fetch }
978
980
  title: { type: 'string' },
979
981
  exclude: { type: 'string', multiple: true },
980
982
  version: { type: 'string' },
983
+ days: { type: 'string' },
981
984
  'sites-origin': { type: 'string' },
982
985
  json: { type: 'boolean' },
983
986
  help: { type: 'boolean', short: 'h' },
@@ -1015,6 +1018,7 @@ export async function site_cli(args, { home = service_home(), fetcher = fetch }
1015
1018
  title: values.title || undefined,
1016
1019
  exclude: values.exclude || undefined,
1017
1020
  version: values.version !== undefined ? Number(values.version) : undefined,
1021
+ days: values.days !== undefined ? Number(values.days) : undefined,
1018
1022
  sites_origin: values['sites-origin'] || undefined,
1019
1023
  };
1020
1024
  try {
package/web/app.js CHANGED
@@ -654,8 +654,8 @@ const ROOM_RELAY_PATH = /^\/api\/(rooms|folders|revisions|sites|analytics)(\/|\?
654
654
  // out of time failed the whole file, which then started over from its first part (2026-11-17: a 12 MiB recording
655
655
  // arrived on the fifth try, after 72 parts had been sent for nothing).
656
656
  const RELAY_UPLOAD_PART_BYTES = 128 * 1024;
657
- // Parts in flight at once: each pays a round trip through the relay to the computer, and two overlap it.
658
- const RELAY_UPLOAD_PARALLEL = 2;
657
+ // Four parts overlap relay round trips, with at most 512 KiB of original data in flight per file.
658
+ const RELAY_UPLOAD_PARALLEL = 4;
659
659
  // How long (ms) the relay waits for the computer to take one part; the page allows this plus its margin, which also
660
660
  // covers sending the part over a slow network.
661
661
  const RELAY_UPLOAD_WAIT_MS = 30000;
@@ -5720,8 +5720,8 @@ async function relay_upload(path, data, on_progress) {
5720
5720
  }
5721
5721
  };
5722
5722
  await Promise.all(Array.from({ length: Math.min(RELAY_UPLOAD_PARALLEL, queue.length) }, send));
5723
- if (failure) throw failure;
5724
5723
  if (finished) { relay_uploads.delete(data); return finished; }
5724
+ if (failure) throw failure;
5725
5725
  if (missing) for (const index of missing) upload.done.delete(index);
5726
5726
  else relay_uploads.set(data, upload = { path, total, id: crypto.randomUUID(), done: new Set() });
5727
5727
  }
@@ -5766,7 +5766,8 @@ async function encode_thumbnail(source, file) {
5766
5766
  * The site keeps the first copy any participant's page sends; a page without the right to send one is refused quietly.
5767
5767
  */
5768
5768
  function store_attachment_thumbnail(file, source) {
5769
- if (SHARE || file.thumbnail_url || thumbnail_attempts.has(file.id) || !/^image\/(png|jpeg|webp)$/.test(file.content_type || "")
5769
+ // The sending card's local preview has no room-scoped attachment yet.
5770
+ if (SHARE || !file.room_id || !file.id || file.thumbnail_url || thumbnail_attempts.has(file.id) || !/^image\/(png|jpeg|webp)$/.test(file.content_type || "")
5770
5771
  || !(Number(file.size) > THUMBNAIL_MIN_BYTES)) return;
5771
5772
  thumbnail_attempts.add(file.id);
5772
5773
  thumbnail_chain = thumbnail_chain.then(async () => {