ai_co_discuss 0.5.37 → 0.5.39

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.
package/backend/server.py CHANGED
@@ -4108,8 +4108,9 @@ class DiscussionHandler(BaseHTTPRequestHandler):
4108
4108
  payload = {"site": site}
4109
4109
  if command == "room-config" and "participants" in payload:
4110
4110
  return self.save_local_room_configuration(command, payload)
4111
- # The computer's own page plays a project media file straight from disk by a ticket, with ranges for seeking.
4112
- if command == "room-media" and not self.bridge_origin:
4111
+ # The computer's own page plays a project media file straight from disk by a ticket, with ranges for seeking;
4112
+ # a thumbnail comes back whole, as to another device.
4113
+ if command == "room-media" and not self.bridge_origin and payload.get("thumbnail") is not True:
4113
4114
  return self.issue_media_ticket(payload)
4114
4115
  # A connected website's page is another device's entry: it gets the same limits as the relay.
4115
4116
  return self.run_local_command(command, payload, remote=bool(self.bridge_origin) and command != "machine-link")
@@ -162,6 +162,8 @@ if __name__ == "__main__":
162
162
  decoded = Path(directory) / "decoded.png"
163
163
  decode_system_webp(path, decoded)
164
164
  path = decoded
165
- result = encode_preview(path, width, height, 1440, project=True)
165
+ # The longest side asked for: 1440 for the preview, smaller for the file page's thumbnails.
166
+ side = int(sys.argv[1]) if len(sys.argv) > 1 and sys.argv[1].isdigit() else 1440
167
+ result = encode_preview(path, width, height, max(64, min(side, 1440)), project=True)
166
168
  if result and len(result) < os.fstat(sys.stdin.fileno()).st_size:
167
169
  sys.stdout.buffer.write(result)
@@ -47,11 +47,11 @@ 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.
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. Relative project images in Markdown display inline. 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.
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 “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
+ - **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.
54
- - **Manage project files.** Select “Project” at the start of the path bar to open your projects and drafts. Use the top controls to create folders and upload files (up to 20 MB each). File menus offer “Download” (“Download folder” for a folder, packed as a ZIP), “Rename”, “Copy”, “Cut”, and “Delete”. Paste into the destination folder. Deleted files and replaced versions go to “Recycle bin” for 30 days, where they can be restored. In source view, the pencil button edits text files up to 1 MB. Project and draft roots, and folders currently used as room project directories, cannot be renamed, moved, or deleted.
54
+ - **Manage project files.** Select “Project” at the start of the path bar to open your projects and drafts. Use the top controls to create folders and upload files (up to 20 MB each). File menus offer “Download” (“Download folder” for a folder, packed as a ZIP), “Rename”, “Copy”, “Cut”, and “Delete”. Paste into the destination folder. Deleted files and replaced versions go to “Recycle bin” for 30 days, where they can be restored (“More actions” → “Recycle bin” at the top right; “Refresh” is there too, though the list refreshes itself). In source view, the pencil button edits text files up to 1 MB. Project and draft roots, and folders currently used as room project directories, cannot be renamed, moved, or deleted.
55
55
 
56
56
  ### 4. Send and view attachments
57
57
 
@@ -45,11 +45,11 @@
45
45
  回答下方的“文件改动”显示已修改的文件数和增删行数。改动不超过 5 个文件时默认展开,超过时点击文件数查看清单。可读房间的访客也能看清单,只有房主能看补丁。
46
46
 
47
47
  - **增删项目目录**:一个房间可有 1 个主项目目录和最多 8 个其他项目目录。建房后打开顶部“房间”页,在“项目目录”区域可增删其他目录,保存后从各成员下一次执行起生效,不中断会话。主目录设置后不能更改;建房时未设的,可在同一行补设一次。成员按各自项目权限读写全部目录。
48
- - **打开“文件”页**:房间顶部的标签栏点“文件”,浏览目录、文件大小与修改时间,上方可切换主目录与其他项目目录。浏览文件需要已设置项目目录。
49
- - **预览文件**:点击文件打开悬浮预览,支持纯文本、代码、Markdown 渲染、HTML 静态渲染并可切换源码;图片可缩放、旋转;音视频带倍速与全屏直接播放;CSV 显示为表格,字幕(SRT、VTT、ASS、LRC)显示为时间轴;Word、Excel、PowerPoint 与 PDF 只读预览;Premiere 工程显示其 XML;zip 压缩包像文件夹一样列出其中的文件夹与文件,点击其中的文件在新标签中预览。Markdown 中用相对路径引用的项目图片会直接显示。 打开房间附件或项目中的 ZIP 时先显示目录,点包内文件才读取内容。单个文件最多预览 64 MiB,也可以点“下载”保存整个压缩包。
48
+ - **打开“文件”页**:房间顶部的标签栏点“文件”,浏览目录、文件大小与修改时间,上方可切换主目录与其他项目目录。浏览文件需要已设置项目目录。右上角的“图标视图”按钮把列表换成图标排列,PNG、JPG、WebP 图片显示缩略图,再点“列表视图”换回;缩略图由这台电脑生成,目前只在 Windows 电脑上有,其他图片和文件显示图标。
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,引用中的 `@` 不会唤醒成员。
52
- - **整理文件**:点路径栏最前面的“项目”,可以打开你所有的项目和草稿。上方按钮用于新建文件夹和上传文件(单个不超过 20 MB);每行的菜单里有“下载”(文件夹为“下载文件夹”,打包成 ZIP)、“重命名”、“复制”、“剪切”、“删除”,复制或剪切后到目标文件夹点“粘贴”。删除的文件和被替换掉的旧版放进“回收区”,保留 30 天,可以还原。在源码视图点铅笔按钮可以编辑文本文件(不超过 1 MB)。项目、草稿文件夹本身,以及房间正在用作项目目录的文件夹,都不能改名、移动或删除。
52
+ - **整理文件**:点路径栏最前面的“项目”,可以打开你所有的项目和草稿。上方按钮用于新建文件夹和上传文件(单个不超过 20 MB);每行的菜单里有“下载”(文件夹为“下载文件夹”,打包成 ZIP)、“重命名”、“复制”、“剪切”、“删除”,复制或剪切后到目标文件夹点“粘贴”。删除的文件和被替换掉的旧版放进“回收区”,保留 30 天,可以还原(右上角“更多操作”→“回收区”;“刷新”也在这里,平时列表会自动刷新)。在源码视图点铅笔按钮可以编辑文本文件(不超过 1 MB)。项目、草稿文件夹本身,以及房间正在用作项目目录的文件夹,都不能改名、移动或删除。
53
53
 
54
54
  ### 4. 发送与查看附件
55
55
 
@@ -462,7 +462,7 @@
462
462
  "共议数据": "CoDiscuss data",
463
463
  "正在统计存储占用…": "Measuring storage usage…",
464
464
  "读取存储占用失败:{reason}": "Could not read storage usage: {reason}",
465
- "本机 .codiscuss 数据已占 {used}(不含语音模型),接近 {limit} 上限(预警线 {warn})。请及时清理临时文件或旧草稿。": "Local .codiscuss data uses {used}, excluding speech models. It is nearing the {limit} limit, with a warning threshold of {warn}. Clear temporary files or old drafts.",
465
+ "本机 .codiscuss 数据已占 {used},接近 {limit} 上限(预警线 {warn})。请及时清理临时文件或旧草稿。": "Local .codiscuss data uses {used} and is nearing the {limit} limit (warning at {warn}). Clear temporary files or old drafts.",
466
466
  "本机 .codiscuss 数据": "Local .codiscuss data",
467
467
  "{used} / {limit}": "{used} / {limit}",
468
468
  "超过 {limit} 文件上限": "File limit of {limit} exceeded",
@@ -487,7 +487,7 @@
487
487
  "已清理 {count} 个临时目录": "Cleared {count} temporary folders.",
488
488
  "存储上限通过定期采样检查(有执行时每 2 秒查磁盘余量、每 30 秒扫描占用),并非文件系统写入层硬拦截,无法保证磁盘绝不写满。": "Storage limits are enforced by periodic sampling (disk space every 2s and folder size every 30s while runs are active), not by a filesystem write-layer hard quota, so they cannot guarantee the drive will never fill.",
489
489
  "存储占用已超过上限或磁盘剩余空间低于安全线,新的派活已暂停。房间被拦截时请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 清理旧草稿,或清理下方临时文件;房间记录与附件需手动销毁旧房间。": "New runs are paused because storage exceeded a limit or disk free space fell below the safety reserve. While a room is blocked, run $codiscuss-draft-cleanup in an AI chat outside the room to clean old drafts, or clear temporary files below; room records and attachments are reclaimed by destroying old rooms.",
490
- "本机 .codiscuss 数据已占 {used}(不含语音模型),接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或清理临时文件。": "Local .codiscuss data uses {used} (excluding speech models), approaching the {limit} limit (warning at {warn}). Run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files.",
490
+ "本机 .codiscuss 数据已占 {used},接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或清理临时文件。": "Local .codiscuss data uses {used}, approaching the {limit} limit (warning at {warn}). Run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files.",
491
491
  "有 {count} 处目录或文件因权限无法读取(例如沙箱创建的目录),未计入配额,清理按钮也无法删除;磁盘安全线仍会保护系统盘。": "{count} folders or files could not be read due to permissions (such as sandbox-created directories). They are excluded from quotas and cannot be removed by the clean button; the disk safety reserve still protects the drive.",
492
492
  "{count} 处不可读": "{count} unreadable",
493
493
  "草稿合计 {draft} / {draft_limit} · 房间记录与附件 {local}(不含语音模型)": "Drafts {draft} / {draft_limit} · Room records & attachments {local} (excluding speech models)",
@@ -646,7 +646,7 @@
646
646
  "{count} 个文件 · {size}": "{count} files · {size}",
647
647
  "第 {version} 版 · {count} 个文件 · {size}": "Version {version} · {count} files · {size}",
648
648
  "{time} 到期": "expires {time}",
649
- "本机 .codiscuss 数据已占 {used}(不含语音模型),接近 {limit} 上限,请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或清理临时文件。": "Local .codiscuss data uses {used} (excluding speech models), approaching the {limit} limit. Run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files.",
649
+ "本机 .codiscuss 数据已占 {used},接近 {limit} 上限,请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或清理临时文件。": "Local .codiscuss data uses {used}, approaching the {limit} limit. Run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files.",
650
650
  "固定「{value1}」": "Pinning “{value1}”",
651
651
  "取消固定「{value1}」": "Unpinning “{value1}”"
652
652
  }
@@ -480,6 +480,9 @@
480
480
  "正在读取项目目录": "Loading project folder",
481
481
  "重新读取目录": "Reload folder",
482
482
  "此文件夹为空": "This folder is empty",
483
+ "列表视图": "List view",
484
+ "返回文件夹": "Back to folder",
485
+ "图标视图": "Icon view",
483
486
  "{value1} 项": "{value1} items",
484
487
  ",已显示 {value1} 项": "; {value1} shown",
485
488
  "正在排版 Word 文档…": "Laying out Word document…",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.5.37",
3
+ "version": "0.5.39",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -742,9 +742,12 @@ export const REMOTE_MEDIA_MAX_BYTES = 64 * 1024 * 1024;
742
742
  const PROJECT_PREVIEW_SLOTS = 12;
743
743
  const PROJECT_PREVIEW_CONCURRENCY = 2;
744
744
  const PROJECT_PREVIEW_MAX = 8 * 1024 * 1024;
745
+ // The file page's icon view: the longest side of an image's thumbnail, and how many of them the computer keeps.
746
+ const PROJECT_THUMBNAIL_SIDE = 256;
747
+ const PROJECT_THUMBNAIL_SLOTS = 400;
745
748
 
746
749
  /** Keep completed previews in an LRU; queued and running versions share a promise until encoding finishes. */
747
- export function project_preview_reader(probe) {
750
+ export function project_preview_reader(probe, slots = PROJECT_PREVIEW_SLOTS) {
748
751
  const cached = new Map(), pending = new Map(), waiting = [];
749
752
  let python, running = 0;
750
753
  async function generate(home, key, encode) {
@@ -755,7 +758,7 @@ export function project_preview_reader(probe) {
755
758
  const bytes = await encode(await python);
756
759
  if (bytes) {
757
760
  cached.set(key, bytes);
758
- if (cached.size > PROJECT_PREVIEW_SLOTS) cached.delete(cached.keys().next().value);
761
+ if (cached.size > slots) cached.delete(cached.keys().next().value);
759
762
  }
760
763
  return bytes;
761
764
  } catch { return null; }
@@ -778,13 +781,14 @@ export function project_preview_reader(probe) {
778
781
  }
779
782
 
780
783
  const project_preview_bytes = project_preview_reader(home => detect_python(local_settings(home).python));
784
+ const project_thumbnail_bytes = project_preview_reader(home => detect_python(local_settings(home).python), PROJECT_THUMBNAIL_SLOTS);
781
785
 
782
- async function encode_project_preview(preview_python, file) {
786
+ async function encode_project_preview(preview_python, file, side = 1440) {
783
787
  const script = join(import.meta.dirname, '..', 'backend', 'windows_thumbnail.py');
784
788
  const fd = openSync(file, 'r');
785
789
  let child;
786
790
  try {
787
- child = spawn(preview_python, ['-I', '-B', script], {
791
+ child = spawn(preview_python, ['-I', '-B', script, String(side)], {
788
792
  windowsHide: true, timeout: 15000, stdio: [fd, 'pipe', 'ignore'], cwd: dirname(script),
789
793
  });
790
794
  } finally { closeSync(fd); }
@@ -809,12 +813,18 @@ async function encode_project_preview(preview_python, file) {
809
813
  */
810
814
  export async function room_media(home, raw, { trust = false, parts = false } = {}) {
811
815
  const { input, config } = await member_room_context(home, raw, { trust });
816
+ // A Markdown file may name an image by its absolute path on this computer: it is read from the room directory holding
817
+ // it. `/…` is such a path where one exists (macOS, Linux), otherwise a path from the project folder, as editors take it.
818
+ const named = String(input.path || '');
819
+ if (/^([a-zA-Z]:[\\/]|\\\\)/.test(named)) Object.assign(input, absolute_room_path(config, named, win32));
820
+ else if (named.startsWith('/')) Object.assign(input, (process.platform !== 'win32' && absolute_room_path(config, named, posix, false)) || { path: named.replace(/^\/+/, '') });
812
821
  const root = input.root ?? 0;
813
822
  const offset = input.offset ?? 0;
814
823
  const directory = files_root(home, config, root);
815
824
  if (!Number.isSafeInteger(offset) || offset < 0) throw new Error('文件读取位置无效');
816
825
  // `download` reads any regular file for saving, not only the kinds the preview shows.
817
826
  const { file, ...media } = project_media(directory, input.path, { download: input.download === true });
827
+ if (input.thumbnail === true) return { room_id: input.room_id, root, ...media, ...await project_thumbnail(home, directory, input.path, file, media) };
818
828
  // The folder goes to the computer's own website alone, for a page opened in a tab (it never reaches a page).
819
829
  if (!parts) return { room_id: input.room_id, root, ...media, file, directory };
820
830
  if (media.size > REMOTE_MEDIA_MAX_BYTES) {
@@ -844,6 +854,37 @@ export async function room_media(home, raw, { trust = false, parts = false } = {
844
854
  return { room_id: input.room_id, root, ...media, total: media.size, offset, data: part.toString('base64') };
845
855
  }
846
856
 
857
+ /**
858
+ * `{ root, path }` of an absolute path (`paths`: node's win32 or posix) inside one of the room's directories; elsewhere
859
+ * refused, or null when not `required`.
860
+ */
861
+ function absolute_room_path(config, path, paths, required = true) {
862
+ const target = paths.resolve(path);
863
+ for (const [root, directory] of room_directories(config).entries()) {
864
+ const inside = paths.relative(paths.resolve(directory), target);
865
+ if (inside && !inside.startsWith('..') && !paths.isAbsolute(inside)) return { root, path: inside.replaceAll('\\', '/') };
866
+ }
867
+ if (!required) return null;
868
+ throw new Error('图片不在房间的项目目录内,无法读取');
869
+ }
870
+
871
+ /**
872
+ * The small copy of one project image the file page's icon view shows, made on this computer for both its own page and
873
+ * another device: `{ data, content_type }` (base64, whole), or `{ data: null }` where none can be made (not a PNG, JPEG
874
+ * or WebP, not Windows, an image too large to decode), and the page keeps the file's icon.
875
+ */
876
+ async function project_thumbnail(home, directory, path, file, media) {
877
+ if (process.platform !== 'win32' || !/^image\/(png|jpeg|webp)$/.test(media.content_type)) return { data: null };
878
+ const key = createHash('sha256').update(JSON.stringify([file, media.version, `${PROJECT_THUMBNAIL_SIDE}-v1`])).digest('hex');
879
+ const bytes = await project_thumbnail_bytes(home, key, python => {
880
+ const ready = project_media(directory, path);
881
+ if (ready.file !== file || ready.version !== media.version) return null;
882
+ return encode_project_preview(python, file, PROJECT_THUMBNAIL_SIDE);
883
+ });
884
+ if (!bytes || bytes.length > PAGE_PART_BYTES) return { data: null };
885
+ return { content_type: bytes[0] === 0xff ? 'image/jpeg' : 'image/png', data: bytes.toString('base64') };
886
+ }
887
+
847
888
  /** `room-media` asked for by another device, answered inside the relay's own process in parts. */
848
889
  export async function remote_room_media(home, input) {
849
890
  assert_shared_home(home);
@@ -750,12 +750,12 @@ export default {
750
750
  "本房间草稿占用 {used},超过 {limit} 上限(目录 drafts/{room}),已停止派活。房间被拦截时请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 清理可重建副本,或在管理面板“存储”页清理临时文件。": "This room's drafts use {used}, exceeding the {limit} limit (folder drafts/{room}). Dispatching has stopped. While the room is blocked, run $codiscuss-draft-cleanup in an AI chat outside the room to remove rebuildable copies, or clear temporary files in the management panel Storage tab.",
751
751
  "全机草稿占用 {used},超过 {limit} 上限(目录 drafts/),已停止派活。请运行 $codiscuss-draft-cleanup 清理旧草稿后再继续。": "Total drafts use {used}, exceeding the {limit} limit (folder drafts/). Dispatching has stopped. Run $codiscuss-draft-cleanup to clean old drafts before continuing.",
752
752
  "全机草稿占用 {used},超过 {limit} 上限(目录 drafts/),已停止派活。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 清理旧草稿,或在管理面板“存储”页清理临时文件。": "Total drafts use {used}, exceeding the {limit} limit (folder drafts/). Dispatching has stopped. Run $codiscuss-draft-cleanup in an AI chat outside the room to clean old drafts, or clear temporary files in the management panel Storage tab.",
753
- "本机 .codiscuss 数据占用 {used}(不含语音模型),超过 {limit} 上限,已停止派活。请运行 $codiscuss-draft-cleanup 或 codiscuss service clean 清理旧草稿与旧房间后再继续。": "Local .codiscuss data uses {used} (excluding speech models), exceeding the {limit} limit. Dispatching has stopped. Run $codiscuss-draft-cleanup or codiscuss service clean to remove old drafts and rooms before continuing.",
754
- "本机 .codiscuss 数据占用 {used}(不含语音模型;草稿 {draft},房间记录与附件 {local}),超过 {limit} 上限,已停止派活。房间记录与附件不会自动删除,请先销毁不需要的旧房间;清理旧草稿请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup。": "Local .codiscuss data uses {used} (excluding speech models; drafts {draft}, room records and attachments {local}), exceeding the {limit} limit. Dispatching has stopped. Room records and attachments are never deleted automatically—destroy old rooms you no longer need; to clean old drafts, run $codiscuss-draft-cleanup in an AI chat outside the room.",
755
- "本机 .codiscuss 数据占用 {used}(不含语音模型;草稿 {draft}),超过 {limit} 上限,已停止派活。清理旧草稿请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup,或在管理面板“存储”页清理临时文件;若由房间记录与附件占满,请销毁旧房间。": "Local .codiscuss data uses {used} (excluding speech models; drafts {draft}), exceeding the {limit} limit. Dispatching has stopped. To clean old drafts, run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files in the management panel Storage tab; if room records and attachments fill the limit, destroy old rooms.",
756
- "本机 .codiscuss 数据已占 {used}(不含语音模型),接近 {limit} 上限(预警线 {warn})。建议运行 $codiscuss-draft-cleanup 或 codiscuss service clean 及时清理。": "Local .codiscuss data uses {used} (excluding speech models), approaching the {limit} limit (warning at {warn}). Run $codiscuss-draft-cleanup or codiscuss service clean to free space.",
757
- "本机 .codiscuss 数据已占 {used}(不含语音模型,另有 {unreadable} 处因权限无法读取未计入),接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或在管理面板“存储”页清理临时文件。": "Local .codiscuss data uses {used} (excluding speech models; {unreadable} unreadable entries excluded), approaching the {limit} limit (warning at {warn}). Run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files in the management panel Storage tab.",
758
- "本机 .codiscuss 数据已占 {used}(不含语音模型),接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或在管理面板“存储”页清理临时文件。": "Local .codiscuss data uses {used} (excluding speech models), approaching the {limit} limit (warning at {warn}). Run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files in the management panel Storage tab.",
753
+ "本机 .codiscuss 数据占用 {used},超过 {limit} 上限,已停止派活。请运行 $codiscuss-draft-cleanup 或 codiscuss service clean 清理旧草稿与旧房间后再继续。": "Local .codiscuss data uses {used}, exceeding the {limit} limit. Dispatching has stopped. Run $codiscuss-draft-cleanup or codiscuss service clean to remove old drafts and rooms before continuing.",
754
+ "本机 .codiscuss 数据占用 {used}(草稿 {draft},房间记录与附件 {local}),超过 {limit} 上限,已停止派活。房间记录与附件不会自动删除,请先销毁不需要的旧房间;清理旧草稿请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup。": "Local .codiscuss data uses {used} (drafts {draft}, room records and attachments {local}), exceeding the {limit} limit. Dispatching has stopped. Room records and attachments are never deleted automatically—destroy old rooms you no longer need; to clean old drafts, run $codiscuss-draft-cleanup in an AI chat outside the room.",
755
+ "本机 .codiscuss 数据占用 {used}(草稿 {draft}),超过 {limit} 上限,已停止派活。清理旧草稿请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup,或在管理面板“存储”页清理临时文件;若由房间记录与附件占满,请销毁旧房间。": "Local .codiscuss data uses {used} (drafts {draft}), exceeding the {limit} limit. Dispatching has stopped. To clean old drafts, run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files in the management panel Storage tab; if room records and attachments fill the limit, destroy old rooms.",
756
+ "本机 .codiscuss 数据已占 {used},接近 {limit} 上限(预警线 {warn})。建议运行 $codiscuss-draft-cleanup 或 codiscuss service clean 及时清理。": "Local .codiscuss data uses {used}, approaching the {limit} limit (warning at {warn}). Run $codiscuss-draft-cleanup or codiscuss service clean to free space.",
757
+ "本机 .codiscuss 数据已占 {used}(另有 {unreadable} 处因权限无法读取未计入),接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或在管理面板“存储”页清理临时文件。": "Local .codiscuss data uses {used} ({unreadable} unreadable entries excluded), approaching the {limit} limit (warning at {warn}). Run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files in the management panel Storage tab.",
758
+ "本机 .codiscuss 数据已占 {used},接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或在管理面板“存储”页清理临时文件。": "Local .codiscuss data uses {used}, approaching the {limit} limit (warning at {warn}). Run $codiscuss-draft-cleanup in an AI chat outside the room or clear temporary files in the management panel Storage tab.",
759
759
  "磁盘余量下降后复扫发现不可读项增至 {count} 处,已暂停派活,下次扫描将重新判断。": "After free disk space dropped, the number of unreadable entries rose to {count}. Dispatch is paused until the next scan reassesses usage.",
760
760
  "本房间草稿已用 {used}(上限 {limit}),达到 80%,已暂停向无法确认可停止的成员派活。请先清理本房间草稿。": "Room drafts use {used} of {limit}, reaching the 80% threshold. New runs without confirmed stop support are paused. Clear room drafts first.",
761
761
  "无法检查本机存储与磁盘空间,已暂停派活({reason})。请检查 .codiscuss 目录权限或稍后重试。": "Could not check local storage or disk space; dispatching is paused ({reason}). Check permissions on .codiscuss or retry shortly.",
@@ -358,10 +358,10 @@ export function block_reason(snapshot, room_key = '', disk = null, options = {})
358
358
  if (Number(snapshot.total_bytes || 0) > home_limit) {
359
359
  const local_bytes = Number(snapshot.local_bytes || 0);
360
360
  if (local_bytes > 0) {
361
- return t('本机 .codiscuss 数据占用 {used}(不含语音模型;草稿 {draft},房间记录与附件 {local}),超过 {limit} 上限,已停止派活。房间记录与附件不会自动删除,请先销毁不需要的旧房间;清理旧草稿请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup。',
361
+ return t('本机 .codiscuss 数据占用 {used}(草稿 {draft},房间记录与附件 {local}),超过 {limit} 上限,已停止派活。房间记录与附件不会自动删除,请先销毁不需要的旧房间;清理旧草稿请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup。',
362
362
  { used: format_bytes(snapshot.total_bytes), draft: format_bytes(snapshot.draft_bytes), local: format_bytes(local_bytes), limit: format_bytes(home_limit) }, locale);
363
363
  }
364
- return t('本机 .codiscuss 数据占用 {used}(不含语音模型;草稿 {draft}),超过 {limit} 上限,已停止派活。清理旧草稿请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup,或在管理面板“存储”页清理临时文件;若由房间记录与附件占满,请销毁旧房间。',
364
+ return t('本机 .codiscuss 数据占用 {used}(草稿 {draft}),超过 {limit} 上限,已停止派活。清理旧草稿请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup,或在管理面板“存储”页清理临时文件;若由房间记录与附件占满,请销毁旧房间。',
365
365
  { used: format_bytes(snapshot.total_bytes), draft: format_bytes(snapshot.draft_bytes), limit: format_bytes(home_limit) }, locale);
366
366
  }
367
367
  if (snapshot.uncertain_growth && !options.running) {
@@ -387,10 +387,10 @@ export function warn_reason(snapshot, options = {}) {
387
387
  if (!snapshot || Number(snapshot.total_bytes || 0) < home_warn) return '';
388
388
  const unreadable = Number(snapshot.unreadable || 0);
389
389
  if (unreadable > 0) {
390
- return t('本机 .codiscuss 数据已占 {used}(不含语音模型,另有 {unreadable} 处因权限无法读取未计入),接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或在管理面板“存储”页清理临时文件。',
390
+ return t('本机 .codiscuss 数据已占 {used}(另有 {unreadable} 处因权限无法读取未计入),接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或在管理面板“存储”页清理临时文件。',
391
391
  { used: format_bytes(snapshot.total_bytes), unreadable, limit: format_bytes(home_limit), warn: format_bytes(home_warn) }, locale);
392
392
  }
393
- return t('本机 .codiscuss 数据已占 {used}(不含语音模型),接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或在管理面板“存储”页清理临时文件。',
393
+ return t('本机 .codiscuss 数据已占 {used},接近 {limit} 上限(预警线 {warn})。请在房间外的 AI 对话中运行 $codiscuss-draft-cleanup 或在管理面板“存储”页清理临时文件。',
394
394
  { used: format_bytes(snapshot.total_bytes), limit: format_bytes(home_limit), warn: format_bytes(home_warn) }, locale);
395
395
  }
396
396