ai_co_discuss 0.5.18 → 0.5.19

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.
@@ -59,7 +59,7 @@ You can also send a message from the blank home page to create a room and send i
59
59
 
60
60
  Either way, readers see the room’s **Messages** and **Runs** views from the beginning, as they look here: cards and run details open; each time **Runs** is opened it replays the session from the start, and “End replay” returns to the final state. The other tabs, such as **Private**, **Room** and **Files**, are dimmed and show only a sample; but nothing can be sent or changed, and the page shows the room as it was when it was made. Private chats, the event log, scheduling decisions, refused actions, queued messages, paths on this computer, session IDs and credentials are left out, as are retracted or rewound messages; failure reasons read only “Run failed”, and the room’s project folders are rewritten in message text as paths inside the project. The rest of the message text is shared as written, so check it before sending.
61
61
 
62
- Attachments are left out by default, and attachment tags in messages read “not included in the share”. When the room has attachments, the confirmation offers “Include attachments”: ticked, every attachment (images, videos, web pages, documents and so on) goes into the page as it is, for readers to view and download; project files a member’s answer delivered (the file cards under the answer) come along too, as attachments of that answer. Text attachments are checked for keys and local folders too; the contents of images, videos and other files cannot be checked, so look through them yourself. A share link carries the attachments the page can preview — images, audio, video, PDF, Word/Excel/PowerPoint (docx, xlsx, pptx), text and code, zip archives, and web pages — for readers to open right in the page; scripts that run on a double click, such as js, bat and ps1, go with .txt added to their names. Programs and old doc/xls/ppt files stay off the share site and their messages read “not included in the share”, while a downloaded web page file still carries them. Web page attachments run on the share page as they do in the room, and demos a member’s answer refers to show inside the message; they run in an isolated frame that cannot read the share page, send requests or submit forms. Select “Filter files” to choose attachments by type or individually. The filters expand automatically above 300 MB. Files appear newest message first; choose “By size” to find large files. Each file shows the message number, sender, time and size. Click its name or “Preview” and close the preview to continue selecting. Published links allow 5 MB of text plus up to 300 MB of attachments, with a 100 MB limit per file. The computer’s background service prepares and uploads the share even if you lock your phone, close the page or switch to another paired device. Under “Shared”, open “Share jobs” to review a draft, check uploaded files and bytes, cancel, retry or adjust attachments. Completed jobs offer the share card, a copy-link button and dismissal. When the service is offline, keep the browser page open until the transfer finishes. A downloaded web page file carries at most 100 MB of attachments. If the room changes before download, review the updated contents in the confirmation dialog.
62
+ Attachments are left out by default, and attachment tags in messages read “not included in the share”. When the room has attachments, the confirmation offers “Include attachments”: ticked, every attachment (images, videos, web pages, documents and so on) goes into the page as it is, for readers to view and download; project files a member’s answer delivered (the file cards under the answer) come along too, as attachments of that answer. Text attachments are checked for keys and local folders too; the contents of images, videos and other files cannot be checked, so look through them yourself. A share link carries the attachments the page can preview — images, audio, video, PDF, Word/Excel/PowerPoint (docx, xlsx, pptx), text and code, zip archives, and web pages — for readers to open right in the page; scripts that run on a double click, such as js, bat and ps1, go with .txt added to their names. Programs and old doc/xls/ppt files stay off the share site and their messages read “not included in the share”, while a downloaded web page file still carries them. Web page attachments run on the share page as they do in the room, and demos a member’s answer refers to show inside the message; they run in an isolated frame that cannot read the share page, send requests or submit forms. Select “Filter files” to choose attachments by type or individually. The filters expand automatically above 300 MB. Files appear newest message first. Each file shows the message number, sender, time and size. Click its name or “Preview” and close the preview to continue selecting. Published links allow 5 MB of text plus up to 300 MB of attachments, with a 100 MB limit per file. The computer’s background service prepares and uploads the share even if you lock your phone, close the page or switch to another paired device. Under “Shared”, open “Share jobs” to review a draft, check uploaded files and bytes, cancel, retry or adjust attachments. Completed jobs offer the share card, a copy-link button and dismissal. When the service is offline, keep the browser page open until the transfer finishes. A downloaded web page file carries at most 100 MB of attachments. If the room changes before download, review the updated contents in the confirmation dialog.
63
63
  - **Import rooms.** In directory options or a folder menu, select “Import rooms” and choose a ZIP. Review the preview and confirm the rooms to import. A room marked “Already exists; skipped” is left as is. On the same computer, invite members back to resume their sessions. Claude Code members switch to manual connection on import. Re-register them from their original window to avoid splitting the session. Imported discussion history is kept, but discussions are not restarted and members are not woken automatically.
64
64
  - **Branch from a message.** In an AI message menu, select “Branch from here” to create a room containing the history through that message. Connections that support session branching resume from the branched session in the new room. The original room is kept.
65
65
  - **Let the host create rooms.** With “Create rooms” ticked in “Host permissions”, the host can move part of the work into a new room. Members use only software configured on this computer, with read-only project access by default and at most write. The project folder must be the original room’s folder or a folder inside it. Unless you name another host, the new room is hosted by the same expert as the original host. Each room gets a “Linked room” card; select “Open room” to go to the other one. The new room takes your default host permissions, except that it cannot create rooms. A room can create a limited number of rooms (3 by default, adjustable in “Host permissions”). The hosts of two linked rooms can speak in each other’s room; those messages are labelled “From host … of room "…"” and wake the other room like your own messages. There is no limit by default. To cap it, set “Linked-room message limit” under “Advanced settings” in the new-room form (it applies to every linked room on this computer); counting from your last message in either room, messages beyond it are refused until you send a message.
@@ -59,7 +59,7 @@
59
59
 
60
60
  两种方式看到的都是这个房间的“消息”和“执行”两页,从头阅读,外观与本机一致,卡片和执行详情都能点开;每次进入“执行”都会从头自动回放协作过程,点“结束回放”回到最终状态。“私聊”“房间”“文件”等标签灰显,只展示示意。但不能发消息或做任何操作;内容停在生成那一刻。私聊、事件记录、调度决策、被拒操作、排队消息、本机路径、会话编号与凭据不会写进去,已撤回或回退的消息也不带;失败原因只写“执行失败”,房间项目目录在正文里改写成项目内的相对路径。消息正文其余部分原样公开,发出前请核对。
61
61
 
62
- 附件默认不带,消息里的附件标记显示为“未包含在分享中”。房间有附件时,确认框里有“包含附件”,勾选后所有附件(图片、视频、网页、文档等)原样放进分享页,读者可以查看和下载;成员回答里交付的项目文件(回答下方的文件卡片)也会作为该条回答的附件一起带上。文本类附件会一并检查疑似密钥和本机目录;图片、视频等文件的内容程序查不了,请自己核对。发布链接带上页面能预览的附件:图片、音视频、PDF、Word/Excel/PowerPoint(docx、xlsx、pptx)、文本与代码、zip 压缩包和网页,读者在分享页里直接打开;js、bat、ps1 等双击就会运行的脚本改名为 .txt 后带上。程序和旧版 doc/xls/ppt 不放到分享站,消息里显示“未包含在分享中”,下载的网页文件仍会带上。网页附件在分享页里照常运行,成员回答里引用的演示直接显示在消息中;它在隔离的框架里运行,读不到分享页,也不能联网请求或提交表单。勾选后点“筛选附件”可按类型或逐个选择;合计超过 300 MB 时筛选自动展开。文件按最新消息在前排列,也可切换“按大小”。每项显示消息编号、发送者、时间及大小,点文件名或“预览”核对内容,关闭预览即可继续勾选。发布时文字最多 5 MB,每个附件最多 100 MB、附件合计最多 300 MB。电脑上的常驻服务负责整理和上传,手机锁屏、关闭页面或换一台已配对设备都可以继续。在左侧“已分享”的“分享任务”里可以打开确认、查看已传文件数和字节数、取消、重试或调整附件。完成后可查看分享卡、复制链接或清除任务记录。常驻服务未运行时由浏览器处理,此时须保持页面打开。网页文件最多带 100 MB 附件。下载前房间内容若有更新,会重新显示确认框。
62
+ 附件默认不带,消息里的附件标记显示为“未包含在分享中”。房间有附件时,确认框里有“包含附件”,勾选后所有附件(图片、视频、网页、文档等)原样放进分享页,读者可以查看和下载;成员回答里交付的项目文件(回答下方的文件卡片)也会作为该条回答的附件一起带上。文本类附件会一并检查疑似密钥和本机目录;图片、视频等文件的内容程序查不了,请自己核对。发布链接带上页面能预览的附件:图片、音视频、PDF、Word/Excel/PowerPoint(docx、xlsx、pptx)、文本与代码、zip 压缩包和网页,读者在分享页里直接打开;js、bat、ps1 等双击就会运行的脚本改名为 .txt 后带上。程序和旧版 doc/xls/ppt 不放到分享站,消息里显示“未包含在分享中”,下载的网页文件仍会带上。网页附件在分享页里照常运行,成员回答里引用的演示直接显示在消息中;它在隔离的框架里运行,读不到分享页,也不能联网请求或提交表单。勾选后点“筛选附件”可按类型或逐个选择;合计超过 300 MB 时筛选自动展开。文件按最新消息在前排列。每项显示消息编号、发送者、时间及大小,点文件名或“预览”核对内容,关闭预览即可继续勾选。发布时文字最多 5 MB,每个附件最多 100 MB、附件合计最多 300 MB。电脑上的常驻服务负责整理和上传,手机锁屏、关闭页面或换一台已配对设备都可以继续。在左侧“已分享”的“分享任务”里可以打开确认、查看已传文件数和字节数、取消、重试或调整附件。完成后可查看分享卡、复制链接或清除任务记录。常驻服务未运行时由浏览器处理,此时须保持页面打开。网页文件最多带 100 MB 附件。下载前房间内容若有更新,会重新显示确认框。
63
63
  - **导入房间**:目录选项或文件夹菜单 → “导入房间”,选择 ZIP 文件,在预览中确认要导入的房间;标为“已存在,跳过”的房间会保留原样。在同一台电脑导入后,请回成员会续接原会话(Claude Code 成员会改为手动接入,请回后在原窗口重新注册,避免会话分叉)。导入保留历史讨论记录,不会自动继续原讨论或重新唤醒成员。
64
64
  - **从某条消息分支**:AI 发言菜单 → “从这里分支”,新建一个保留截至该条发言记录的房间。支持会话分叉的接入方式会在新房间续接分叉后的会话;原房间保留。
65
65
  - **让主持人新建房间**:在“主持人权限”里勾选“新建房间”后,主持人可以把一部分工作拆到新房间:成员只用本机已配置的软件,项目权限默认只读、最高可写,项目目录只能是原房间的目录或其子目录;你没指定时由与原主持人同款的专家主持。两个房间各留一张“关联房间”卡片,点“打开房间”互相跳转。新房间的主持人权限按你的默认设置,但不能再新建房间;一个房间可新建的数量有上限(默认 3 个,可在“主持人权限”里调整)。两个关联房间的主持人可以互相发言,这些消息标注“来自房间「…」的主持人 …”,按你的消息唤醒对方房间;默认不限条数;担心两边来回不停,可在新建房间面板“高级设置”里设“关联房间互传上限”(对本机所有关联房间生效),从你上次在任一房间发言算起超过这个条数会被拒绝,你发一条消息即可让它们继续。
@@ -471,10 +471,12 @@
471
471
  "消息、卡片、执行时间线与过程说明,停在此刻;读者只能看,不能操作。": "Messages, cards, the run timeline and progress notes, as they are now. Readers can look but not change anything.",
472
472
  "不含私聊、事件记录、调度决策、排队消息、会话与凭据;本机用户目录写作 ~,项目目录写成相对路径,失败原因只写“执行失败”。": "Private chats, the event log, scheduling decisions, queued messages, sessions and credentials are left out; home folders are written as ~, project folders as paths inside the project, and failure reasons read only “Run failed”.",
473
473
  "包含附件({count} 个,共 {size})": "Include attachments ({count}, {size} in all)",
474
+ "包含附件(已选 {selected}/{count} 个,共 {size})": "Include attachments ({selected}/{count} selected, {size} in all)",
474
475
  "附件原样公开。文本类附件已一并检查;图片、视频和其他文件的内容程序查不了,请自己核对。": "Attachments are published as they are. Text attachments were checked too; the contents of images, videos and other files cannot be checked, so look through them yourself.",
475
476
  "不包含时,消息里的附件标记显示为“未包含在分享中”。": "Without them, attachment tags in messages read “not included in the share”.",
476
477
  "正在检查文本类附件…": "Checking text attachments…",
477
478
  "{kind} {count} 个 · {size}": "{kind} · {count} · {size}",
479
+ "{kind} {selected}/{count} 个 · {size}": "{kind} · {selected}/{count} · {size}",
478
480
  "已选 {size};发布链接最多带 300 MB 附件(单个 100 MB),网页文件最多 100 MB。": "{size} selected; a share link carries at most 300 MB of attachments (100 MB per file), and a web page file at most 100 MB.",
479
481
  "文本与代码": "Text and code",
480
482
  "逐个选择": "Choose files",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.5.18",
3
+ "version": "0.5.19",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -2,11 +2,9 @@
2
2
  import { AsyncLocalStorage } from 'node:async_hooks';
3
3
  import { randomUUID } from 'node:crypto';
4
4
  import { createReadStream, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, unlinkSync, watch } from 'node:fs';
5
- import https from 'node:https';
6
5
  import { runInNewContext } from 'node:vm';
7
6
  import { join } from 'node:path';
8
7
  import { Readable } from 'node:stream';
9
- import { pipeline } from 'node:stream/promises';
10
8
  import { setTimeout as delay } from 'node:timers/promises';
11
9
  import { site_fetch } from './entry_client.mjs';
12
10
  import { atomic_json } from './files.mjs';
@@ -120,23 +118,45 @@ function snapshot(job, payload, selection) {
120
118
  return { draft, files, bytes, body };
121
119
  }
122
120
 
121
+ const UPLOAD_ATTEMPTS = 3;
122
+ const UPLOAD_RETRY_BASE_MS = 250;
123
+
124
+ function format_network_error(error) {
125
+ const cause = error?.cause?.message;
126
+ if (!cause || String(error.message || '').includes(cause)) return error;
127
+ return Object.assign(new Error(`${error.message}: ${cause}`), { status: error.status, permanent: error.permanent });
128
+ }
129
+
130
+ function is_retryable(error, signal) {
131
+ return !signal.aborted && !error?.permanent && (!error?.status || error.status === 429 || error.status >= 500);
132
+ }
133
+
123
134
  async function send_snapshot(path, method, body, token, signal) {
124
- return (await checked(await fetch(SHARE_SITE + path, { method, body: JSON.stringify(body), redirect: 'error', signal,
125
- headers: { 'Content-Type':'application/json', ...(token ? { Authorization:'Bearer ' + token } : {}) } }))).json();
135
+ for (let attempt = 1; ; attempt++) {
136
+ try {
137
+ const response = await fetch(SHARE_SITE + path, { method, body: JSON.stringify(body), redirect: 'error', signal,
138
+ headers: { 'Content-Type':'application/json', ...(token ? { Authorization:'Bearer ' + token } : {}) } });
139
+ return (await checked(response)).json();
140
+ } catch (raw) {
141
+ const error = format_network_error(raw);
142
+ if (attempt >= 2 || !is_retryable(error, signal)) throw error;
143
+ await delay(attempt * UPLOAD_RETRY_BASE_MS, undefined, { signal });
144
+ }
145
+ }
126
146
  }
127
147
 
128
- /** Pipe one selected file with backpressure; completion requires both the outgoing stream and its HTTP receipt. */
148
+ /** Stream one selected file via fetch (reusing undici's pooled TLS/proxy transport). */
129
149
  async function send_file(url, headers, source, signal) {
130
- const req = https.request(url, { method:'PUT', headers, signal });
131
- const receipt = new Promise((resolve, reject) => {
132
- req.once('error', reject);
133
- req.once('response', response => {
134
- response.resume();
135
- if (response.statusCode >= 200 && response.statusCode < 300) resolve();
136
- else reject(new Error(t('上传分享附件失败(HTTP {status})', { status: response.statusCode })));
137
- });
138
- });
139
- await Promise.all([receipt, pipeline(Readable.from(source), req, { signal })]);
150
+ const normalized = Object.fromEntries(Object.entries(headers).map(([key, value]) => [key, String(value)]));
151
+ let response;
152
+ try {
153
+ response = await fetch(url, { method: 'PUT', headers: normalized, body: Readable.toWeb(Readable.from(source)),
154
+ duplex: 'half', redirect: 'error', signal });
155
+ } catch (error) {
156
+ throw format_network_error(error);
157
+ }
158
+ await response.body?.cancel().catch(() => {});
159
+ if (!response.ok) throw Object.assign(new Error(t('上传分享附件失败(HTTP {status})', { status: response.status })), { status: response.status });
140
160
  }
141
161
 
142
162
  async function publish(config, job, plan, signal, transport, update) {
@@ -154,22 +174,31 @@ async function publish(config, job, plan, signal, transport, update) {
154
174
  await local_read(config, route, signal, { link }).then(r => r.json());
155
175
  const group = new AbortController(), active = AbortSignal.any([signal, group.signal]);
156
176
  await core.share_parallel(plan.files, SHARE_UPLOAD_CONCURRENCY, async file => {
157
- try {
158
- const input = await file_source(config, file, active);
159
- async function* measured() {
160
- let size = 0;
161
- for await (const chunk of input) {
162
- active.throwIfAborted(); size += chunk.length;
163
- if (size > file.size) throw new Error(t('附件大小已变化,请重新整理分享'));
164
- yield chunk;
165
- update(0, chunk.length);
177
+ for (let attempt = 1; ; attempt++) {
178
+ let sent = 0;
179
+ try {
180
+ const input = await file_source(config, file, active);
181
+ async function* measured() {
182
+ let size = 0;
183
+ for await (const chunk of input) {
184
+ active.throwIfAborted(); size += chunk.length;
185
+ if (size > file.size) throw Object.assign(new Error(t('附件大小已变化,请重新整理分享')), { permanent: true });
186
+ yield chunk;
187
+ sent += chunk.length;
188
+ update(0, chunk.length);
189
+ }
190
+ if (size !== file.size) throw Object.assign(new Error(t('附件大小已变化,请重新整理分享')), { permanent: true });
166
191
  }
167
- if (size !== file.size) throw new Error(t('附件大小已变化,请重新整理分享'));
192
+ await transport.file(SHARE_SITE + '/api/shares/' + link.share_id + '/files/' + file.id + '?revision=' + result.revision,
193
+ { Authorization: 'Bearer ' + link.manage_token, 'Content-Type': file.site_type, 'Content-Length': file.size }, measured(), active);
194
+ update(1, 0);
195
+ break;
196
+ } catch (error) {
197
+ if (sent) update(0, -sent);
198
+ if (attempt >= UPLOAD_ATTEMPTS || !is_retryable(error, active)) { group.abort(error); throw error; }
199
+ await delay(attempt * UPLOAD_RETRY_BASE_MS, undefined, { signal: active });
168
200
  }
169
- await transport.file(SHARE_SITE + '/api/shares/' + link.share_id + '/files/' + file.id + '?revision=' + result.revision,
170
- { Authorization: 'Bearer ' + link.manage_token, 'Content-Type': file.site_type, 'Content-Length': file.size }, measured(), active);
171
- update(1, 0);
172
- } catch (error) { group.abort(error); throw error; }
201
+ }
173
202
  });
174
203
  const card = core.share_card(plan.draft, link);
175
204
  return { url: link.url, expires_at: link.expires_at, updated, card: { ...card, question: card.question.slice(0, 600), outcome: card.outcome.slice(0, 600) } };
@@ -257,9 +257,10 @@ export function create_share_core({ t, display_name, collapse_visual_fences, is_
257
257
  entry.files.push({ ...file, name: file.file_name, included: !draft.left_files?.has(file.route) });
258
258
  }
259
259
  return [...SHARE_FILE_KINDS.map(([kind]) => kind), "text"].filter(kind => kinds.has(kind)).map(kind => {
260
- const entry = kinds.get(kind), taken = entry.files.filter(file => file.included).length;
260
+ const entry = kinds.get(kind), chosen = entry.files.filter(file => file.included);
261
+ const selected_count = chosen.length, selected_bytes = chosen.reduce((sum, file) => sum + file.size, 0);
261
262
  entry.files.sort((a, b) => b.message_id - a.message_id);
262
- return { ...entry, included: taken === entry.count ? true : taken ? "indeterminate" : false };
263
+ return { ...entry, selected_count, selected_bytes, included: selected_count === entry.count ? true : selected_count ? "indeterminate" : false };
263
264
  });
264
265
  }
265
266
 
package/web/app.js CHANGED
@@ -265,9 +265,10 @@ function create_share_core({ t, display_name, collapse_visual_fences, is_text_at
265
265
  entry.files.push({ ...file, name: file.file_name, included: !draft.left_files?.has(file.route) });
266
266
  }
267
267
  return [...SHARE_FILE_KINDS.map(([kind]) => kind), "text"].filter(kind => kinds.has(kind)).map(kind => {
268
- const entry = kinds.get(kind), taken = entry.files.filter(file => file.included).length;
268
+ const entry = kinds.get(kind), chosen = entry.files.filter(file => file.included);
269
+ const selected_count = chosen.length, selected_bytes = chosen.reduce((sum, file) => sum + file.size, 0);
269
270
  entry.files.sort((a, b) => b.message_id - a.message_id);
270
- return { ...entry, included: taken === entry.count ? true : taken ? "indeterminate" : false };
271
+ return { ...entry, selected_count, selected_bytes, included: selected_count === entry.count ? true : selected_count ? "indeterminate" : false };
271
272
  });
272
273
  }
273
274
 
@@ -7723,11 +7724,12 @@ function view_snapshot() {
7723
7724
  prompt: state.device.prompt ? { title: state.device.prompt.title, description: state.device.prompt.description, confirm_label: state.device.prompt.confirm_label } : null },
7724
7725
  share: SHARE ? { exported_at: SHARE.exported_at, home: SHARE_HOME } : null,
7725
7726
  managed_share_jobs: [...managed_share_jobs.values()].sort((a,b) => b.created_at.localeCompare(a.created_at)),
7726
- share_tasks: Object.fromEntries([...share_tasks].map(([id, draft]) => [id, { phase: draft.phase, upload: draft.upload ? { ...draft.upload } : null }])),
7727
+ share_tasks: Object.fromEntries([...share_tasks].filter(([, draft]) => !draft.managed_id).map(([id, draft]) => [id, { phase: draft.phase, upload: draft.upload ? { ...draft.upload } : null }])),
7727
7728
  share_draft: share_draft ? { room_id: share_draft.room_id, title: share_draft.title, phase: share_draft.phase || "ready",
7728
7729
  spots: [...share_draft.spots || [], ...share_draft.include_files ? share_draft.file_spots || [] : []],
7729
7730
  files: { count: share_draft.files?.length || 0, bytes: (share_draft.files || []).reduce((total, file) => total + file.size, 0), included: Boolean(share_draft.include_files),
7730
7731
  kinds: share_draft.files ? share_file_kinds(share_draft) : [], carried: share_carried_files(share_draft, false).reduce((total, file) => total + file.size, 0),
7732
+ carried_count: share_carried_files(share_draft, false).length,
7731
7733
  site_left_out: (share_draft.files || []).filter(file => !file.site_type).map(file => file.file_name) },
7732
7734
  days: share_draft.days || SHARE_DEFAULT_DAYS, linked: Boolean(share_draft.linked || share_link(share_draft.room_id)), link: share_draft.link || null, upload: share_draft.upload ? { ...share_draft.upload } : null } : null,
7733
7735
  share_links: SHARE ? {} : share_links(), share_days: SHARE_DAYS,
@@ -8093,8 +8095,9 @@ function remember_share_job(job, announce) {
8093
8095
  managed_share_jobs.set(job.id, job);
8094
8096
  if (job.result && job.phase === "published") show_share_link(job.room_id, job.result);
8095
8097
  const draft = share_tasks.get(job.room_id);
8096
- if (draft?.managed_id === job.id && !["failed","cancelled"].includes(job.phase)) {
8097
- draft.phase = job.phase; draft.upload = job.progress; draft.link = job.result;
8098
+ if (draft?.managed_id === job.id) {
8099
+ if (["failed", "cancelled"].includes(job.phase)) share_tasks.delete(job.room_id);
8100
+ else { draft.phase = job.phase; draft.upload = job.progress; draft.link = job.result; }
8098
8101
  }
8099
8102
  if (announce && prior?.phase !== job.phase) {
8100
8103
  const open = { label: job.phase === "published" ? t("查看分享卡") : t("打开分享"), onClick: () => share_job_action({ op: "open", job }) };