ai_co_discuss 0.5.8 → 0.5.10

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.
Files changed (49) hide show
  1. package/.agents/skills/discuss-host/references/workflow.md +1 -0
  2. package/.agents/skills/workflow-creator/SKILL.md +21 -1
  3. package/backend/free_room.py +3 -0
  4. package/docs/en/guide/cli.md +1 -1
  5. package/docs/en/guide/faq.md +1 -1
  6. package/docs/en/guide/rooms.md +5 -5
  7. package/docs/en/guide/workflows.md +1 -0
  8. package/docs/guide/cli.md +1 -1
  9. package/docs/guide/faq.md +1 -1
  10. package/docs/guide/rooms.md +5 -5
  11. package/docs/guide/workflows.md +1 -0
  12. package/frontend/locales/en/app.json +1 -1
  13. package/frontend/locales/en/backend.json +6 -1
  14. package/frontend/locales/en/core.json +11 -5
  15. package/frontend/locales/en/settings.json +68 -1
  16. package/package.json +1 -1
  17. package/runner/adapters/antigravity_cli.mjs +10 -4
  18. package/runner/adapters/claude.mjs +11 -7
  19. package/runner/adapters/codex_cli.mjs +3 -1
  20. package/runner/adapters/common.mjs +37 -6
  21. package/runner/adapters/profiles.mjs +3 -1
  22. package/runner/discussion_launch.mjs +397 -5
  23. package/runner/discussion_service.mjs +2 -1
  24. package/runner/expert_prompts.mjs +4 -2
  25. package/runner/free_runner.mjs +11 -4
  26. package/runner/workflows.mjs +238 -42
  27. package/web/admin.js +1 -1
  28. package/web/app.js +25 -2
  29. package/web/backup.js +1 -1
  30. package/web/i18n.js +2 -2
  31. package/web/modern.css +1 -1
  32. package/web/modern.js +59 -59
  33. package/workflows/story-serial/flow.json +2 -2
  34. package/workflows/story-serial/workflows/jack-sparrow/SKILL.md +2 -2
  35. package/workflows/story-serial/workflows/jack-sparrow/agents/{jack_sparrow.md → jack_sparrow/jack_sparrow.md} +5 -3
  36. package/workflows/story-serial/workflows/jack-sparrow/agents/jack_sparrow/skills/coastal-sailing/SKILL.md +14 -0
  37. package/workflows/story-serial/workflows/luke-nichols/SKILL.md +2 -2
  38. package/workflows/story-serial/workflows/luke-nichols/agents/{luke_nichols.md → luke_nichols/luke_nichols.md} +5 -3
  39. package/workflows/story-serial/workflows/luke-nichols/agents/luke_nichols/skills/cold-survival/SKILL.md +14 -0
  40. package/workflows/story-serial/workflows/jack-sparrow/references//347/233/256/345/275/225.md +0 -10
  41. package/workflows/story-serial/workflows/luke-nichols/references//347/233/256/345/275/225.md +0 -10
  42. /package/workflows/story-serial/workflows/jack-sparrow/{references → agents/jack_sparrow/skills/coastal-sailing/references}/catamaran-and-crew.md +0 -0
  43. /package/workflows/story-serial/workflows/jack-sparrow/{references → agents/jack_sparrow/skills/coastal-sailing/references}/emergency-and-navigation.md +0 -0
  44. /package/workflows/story-serial/workflows/jack-sparrow/{references → agents/jack_sparrow/skills/coastal-sailing/references}/resources-and-systems.md +0 -0
  45. /package/workflows/story-serial/workflows/jack-sparrow/{references → agents/jack_sparrow/skills/coastal-sailing/references}/weather-and-anchoring.md +0 -0
  46. /package/workflows/story-serial/workflows/luke-nichols/{references → agents/luke_nichols/skills/cold-survival/references}/fire-and-fuel.md +0 -0
  47. /package/workflows/story-serial/workflows/luke-nichols/{references → agents/luke_nichols/skills/cold-survival/references}/luke-videos.md +0 -0
  48. /package/workflows/story-serial/workflows/luke-nichols/{references → agents/luke_nichols/skills/cold-survival/references}/shelter-and-warmth.md +0 -0
  49. /package/workflows/story-serial/workflows/luke-nichols/{references → agents/luke_nichols/skills/cold-survival/references}/travel-and-ice.md +0 -0
@@ -14,6 +14,7 @@
14
14
 
15
15
  - **步骤与挂靠**:`workflow.stages` 是主线的步骤(编号与名称),子工作流带 `attach` 的就是挂在这几步上、在这一步额外做的事,没有 `attach` 的是独立子工作流。走到主线某一步时,看有没有挂在这一步的子工作流,按它的 `description` 判断这次用不用。两者都是软约束,以 SKILL.md 的文字为准。
16
16
  - **同一张卡片请多位成员**:一张卡片要由几位成员分别担任(如一位人物一位成员)时,用 `<cli> launch workflow-join --card 卡片ID --label 显示名 …` 逐位请进,显示名只在本房间有效、不能和别的成员重复;同一张卡片下已有这个显示名的离开成员会请回它的原会话,所以同一个人物始终用同一个显示名。只请离其中一位用 `<cli> launch workflow-leave --member 显示名 …`;`--sub` 请离子工作流的全部成员。`workflow.members` 里同一张卡片会出现多条,按显示名区分。
17
+ - **带技能的专家**:卡片是文件夹、带自己的技能时,任务里 workflow 的卡片信息带 `skills`(技能名)。程序会把这位专家在工作流里的 skills 目录写进他自己的任务,并只对这个目录放开写权限;派活时不必再抄路径,他查到的新知识自己写进去。其他成员拿不到这个路径。他写技能不改变工作流的修订号,你保存工作流也不会冲掉这些技能。
17
18
 
18
19
  ## 保存与启用
19
20
 
@@ -69,9 +69,29 @@ description: AI CoDiscuss 工作流的创建与修改技能。用户要把房间
69
69
  - `workflows/<子工作流ID>/SKILL.md` 的头信息:`name`(= 文件夹名,规则同工作流 ID)、`description`(必填,最多 500 字,写清做什么、什么时候用)、可选 `metadata` 下的 `label`(显示名);正文最多 20,000 字。最多 10 个,不再嵌套。
70
70
  - 它的卡片放在它自己的 `agents/` 下,格式与主线卡片相同;卡片 ID 在整个工作流里(含主线和各子工作流)不能重复。启用工作流时只请进主线卡片,这些卡片由主持人用子工作流时请进、用完请离。同一张卡片可以由主持人按不同显示名请进多位成员(例如一位人物一位成员),所以“一人一角”的卡片只写一张,不必按席位复制成甲、乙、丙。示意图 `flow.json` 也放在它自己的文件夹里,可以画它自己的卡片,也可以画参与其中的主线卡片(节点写主线的卡片 ID,不另建卡片)。主线的示意图用 `{"id": "sub_1", "type": "sub", "sub": "<子工作流ID>"}` 节点标出转去子工作流的地方;子工作流的示意图里不能再放这种节点。
71
71
  - 它的脚本放在它自己的文件夹里(如 `scripts/`),在它的 SKILL.md 里按相对路径写;要给 API 成员运行,照常在根目录 `commands.json` 登记,路径写 `{workflow}/workflows/<子工作流ID>/scripts/…`。
72
- - 工作流文件夹对成员只读:子工作流要积累的东西(知识库、缓存)写到项目文件夹或本机服务目录下,不写进自己的文件夹。
72
+ - 工作流文件夹对成员只读:子工作流要积累的东西(缓存、中间结果)写到项目文件夹或本机服务目录下,不写进自己的文件夹;唯一的例外是下面“带技能的专家”自己的 skills。
73
73
  - 子工作流用文件夹保存(`workflow-save --dir`)或在工作流页编辑;粘贴草稿不带子工作流,用草稿保存时已有的子工作流原样保留。
74
74
 
75
+ ### 带技能的专家
76
+
77
+ 领域顾问这类专家要积累自己的知识:卡片只写他是谁、交什么、怎么审,知识是他自己的一组技能。这样的专家写成文件夹,放在卡片原本的位置(主线或子工作流的 `agents/` 下):
78
+
79
+ ```text
80
+ agents/
81
+ writer.md 普通专家:一个文件
82
+ luke_nichols/ 带技能的专家:一个文件夹
83
+ luke_nichols.md 定义,格式和普通卡片文件完全相同
84
+ skills/
85
+ cold-survival/ 一条技能
86
+ SKILL.md Agent Skills 头信息:name 等于文件夹名、description 写这条管什么
87
+ references/ 资料
88
+ ```
89
+
90
+ - 两种写法只差技能:文件夹名、定义文件名都是卡片 ID;同一个卡片 ID 不能既有文件又有文件夹。随启用工作流请进还是用子工作流时请进,照旧由它放在主线还是子工作流决定。技能名的写法同工作流 ID,一条技能一个文件夹。
91
+ - **读写**:程序把这位专家的 `skills/` 写进担任者的任务(`knowledge_directory`),只对这个目录放开写权限;工作流的其他部分,包括他自己的定义文件和别的专家的技能,照旧不能写。卡片里写明先读各条 `SKILL.md` 的描述、用到哪条读哪条、新知识写进对应技能的 references、可以新建技能,以及知识的纪律(出处与查证状态、只收通用知识)。
92
+ - **保存**:专家写技能不改变工作流的修订号;网页和命令行的普通保存、主持人草稿都原样保留这些技能。只有明确的整份覆盖(`workflow-save --overwrite`)和导入成新工作流时,才用文件夹里带的技能替换。删掉这张卡片、整份覆盖替换技能、删除整个工作流时,程序先把它的文件夹备份到服务目录的 backups 下。用户也可以在工作流页“专家配置”的“技能”里直接查看和修改,不经过工作流保存。
93
+ - **导出导入**:`codiscuss launch expert-export --workflow <ID> --card <卡片ID> --dir <目录>` 导出的就是这个文件夹(没有技能的卡片导出一个 md)。`codiscuss launch expert-import --from <md 或文件夹> --workflow <ID> [--sub <子工作流ID>]` 把专家包放进工作流或子工作流的 `agents/`;卡片 ID 已存在时拒绝,不替换。不带 `--workflow` 时导入成面板预设(见下)。
94
+ - **面板上的专家各是各的**:面板预设的技能在本机服务目录 `experts/<ID>/skills/`,和工作流里的互不共用。专家配置里“存为面板预设”会把技能复制过去;本机已有时默认保留,选择替换才覆盖(原来的先备份)。`expert-import` 导入面板预设时同名预设要加 `--overwrite-preset`,已有技能要加 `--replace-knowledge` 才替换。
75
95
  ### 步骤与挂靠
76
96
 
77
97
  步骤和挂靠都是软约束:程序只画出来、告诉主持人、校验编号,主持人照 SKILL.md 的文字执行。
@@ -3013,6 +3013,9 @@ def fire_host_checkin(connection, room_id):
3013
3013
 
3014
3014
  def inbox(connection, room_id, token):
3015
3015
  """List what the runner should deliver or reconcile; owner credential only."""
3016
+ # A deleted room answers 404, not 403: its credential went with it, and the runner tells deletion apart by this.
3017
+ if not connection.execute("SELECT 1 FROM rooms WHERE id=?", (room_id,)).fetchone():
3018
+ raise LookupError(Text("房间不存在"))
3016
3019
  require_owner(connection, room_id, token)
3017
3020
  begin_write(connection)
3018
3021
  enforce_session_limits(connection, room_id)
@@ -53,7 +53,7 @@ The local site stores rooms and serves the web interface. The discussion service
53
53
 
54
54
  ### Backups, export, and import
55
55
 
56
- Export or import room ZIP files in the web app. Use the room menu’s **Export conversation**, the directory menu’s **Export all rooms** and **Import rooms…**. See [Room directory and setup](rooms.md#5-export-import-and-branch-rooms). For a separately deployed Python service, stop writes, then back up the SQLite database and its sibling `<database-name>.attachments/` directory. See [the deployment guide](../deployment.md#python).
56
+ Export or import room ZIP files in the web app. Use the room menu’s **Export conversation**, the directory menu’s **Export all rooms** and **Import rooms**. See [Room directory and setup](rooms.md#5-export-import-and-branch-rooms). For a separately deployed Python service, stop writes, then back up the SQLite database and its sibling `<database-name>.attachments/` directory. See [the deployment guide](../deployment.md#python).
57
57
 
58
58
  ### Local administration over SSH
59
59
 
@@ -43,7 +43,7 @@ Yes. New room sessions run independently of conversations you open in your IDE o
43
43
 
44
44
  ### 9. Where is my data, and how do I move it to another computer?
45
45
 
46
- The default service directory is `~/.codiscuss`. It holds the website database (`local/discuss.sqlite3`), settings, keys, presets, and workflows. Rooms created without a project folder use `~/.codiscuss-workspace` for their files. Use **Export conversation** or **Export all rooms** to create a room backup ZIP. On the other computer, select **Import rooms…**. To move a workflow, copy its folder from `~/.codiscuss/workflows/`.
46
+ The default service directory is `~/.codiscuss`. It holds the website database (`local/discuss.sqlite3`), settings, keys, presets, and workflows. Rooms created without a project folder use `~/.codiscuss-workspace` for their files. Use **Export conversation** or **Export all rooms** to create a room backup ZIP. On the other computer, select **Import rooms**. To move a workflow, copy its folder from `~/.codiscuss/workflows/`.
47
47
 
48
48
  ### 10. What happens if the computer shuts down, sleeps, or loses internet access?
49
49
 
@@ -29,8 +29,8 @@ You can also send a message from the blank home page to create a room and send i
29
29
  - **Sort rooms.** Open the directory options in the top-right corner. Choose “Manual order” (drag items or use the arrow keys) or “Recent activity”.
30
30
  - **Folders.** Select “New folder” to group rooms by project. A folder can have a default project directory, which is used for new rooms created inside it. Its menu offers “Edit”, “Move up”, “Move down”, “Archive folder”, and “Remove folder”. You can remove just the folder or delete its rooms as well.
31
31
  - **Room actions.** Open a room’s menu to “Rename”, “Edit topic”, “Move to folder”, “Copy reading link”, “Refresh messages”, “Archive room”, or “Destroy room”. “Edit topic” and “Refresh messages” apply to the currently open room.
32
- - **Destroy a room.** Select “Destroy room” in the room’s menu. The dialog lists what is deleted and what is kept. You can first select “Export package” to download a copy with messages, private chats, attachments, a “讨论记录.html” page that opens with a double click, and the files members wrote in their draft folders (in “草稿”; beyond 50 MB only their names are listed). After “Destroy now”, the room’s records, attachments, the AI sessions its members started in this room, and its run files and drafts are deleted from this computer, and the dialog marks each item “Deleted and checked”. Once every item is checked, the room dissolves into particles and a notice shows what was removed. Project files are not deleted. Sessions taken over from your own windows or shared with other rooms are kept. Content already sent to model providers stays under their policies and cannot be deleted from here. A published share page is taken down first. If an item cannot be removed yet, the room stays dimmed in the sidebar and you can select “Retry” in the dialog. Files in members’ draft folders are deleted with the room; export the package first if you need them.
33
- - **Destruction records and destroying all rooms.** Open “…” at the top right of the room list and select “Destruction records…” to see what each destruction deleted and kept (the room name is cleared once it finishes). Select “Retry” on an unfinished one. “Destroy all rooms” at the bottom asks you to type a confirmation word, then destroys every room, archived ones included, one by one; project files are kept. A hosted account running as its own Windows user then also deletes every conversation in its AI software and the preferences the AI remembered, keeping logins. “Export all rooms” leaves drafts out; export rooms one at a time to include them.
32
+ - **Destroy a room.** Select “Destroy room” in the room’s menu. The dialog lists what is deleted and what is kept. You can first select “Export package” to download a copy with messages, private chats, attachments, a “讨论记录.html” page that opens with a double click, and the files members wrote in their draft folders (in “草稿”; beyond 50 MB only their names are listed). After “Destroy now” and then “Destroy” in “Confirm destroying again” (every way of destroying asks twice), the room’s records, attachments, the AI sessions its members started in this room, and its run files and drafts are deleted from this computer, and the dialog marks each item “Deleted and checked”. Once every item is checked, the room dissolves into particles and a notice shows what was removed. Project files are not deleted. Sessions taken over from your own windows or shared with other rooms are kept. Content already sent to model providers stays under their policies and cannot be deleted from here. A published share page is taken down first. If an item cannot be removed yet, the room stays dimmed in the sidebar and you can select “Retry” in the dialog. Files in members’ draft folders are deleted with the room; export the package first if you need them.
33
+ - **Destruction records and destroying all rooms.** Open “…” at the top right of the room list and select “Destruction records” to see what each destruction deleted and kept (the room name is cleared once it finishes). Select “Retry” on an unfinished one. “Destroy all rooms” at the bottom asks you to type a confirmation word, then destroys every room, archived ones included, one by one; project files are kept. A hosted account running as its own Windows user then also deletes every conversation in its AI software and the preferences the AI remembered, keeping logins. “Export all rooms” leaves drafts out; export rooms one at a time to include them.
34
34
  - **Auto-destroy.** Choose it under “Advanced settings” when creating a room, or later in the “Room” tab at the top of the room, set “Auto-destroy” to destroy the room after 1, 7, or 30 days without activity; the time left is shown beside it. The count starts when you set it and restarts with each new message or private chat. Archived rooms, rooms with members at work or queued work, an open question for you, or a published share page are not destroyed automatically. The page warns once when less than a day is left, and again after a room is destroyed. The default is “Keep”.
35
35
  - **Restore or clear archived rooms.** Open “Archived”. Filter by keyword or whether rooms contain messages. Select “Restore” to return a room to the active list. To delete one permanently, select “Delete for good” and confirm. “Delete all” applies to the current filtered results.
36
36
 
@@ -53,14 +53,14 @@ You can also send a message from the blank home page to create a room and send i
53
53
  ### 5. Export, import, and branch rooms
54
54
 
55
55
  - **Export a backup.** A room’s “Export conversation” menu item creates a ZIP containing the room’s messages, discussion history, and attachments. Use a folder menu to “Export folder”, or directory options to “Export all rooms”. Export on the computer running the local service. The archive includes member software settings and session identifiers. The original software’s session history must still be present on that computer to resume a session.
56
- - **Share as a web page.** In a room’s menu, select “Share as web page…”. The room is read and cleaned first; the confirmation lists what is included and left out, and anything that looks like a key, a folder on this computer or contact details, with its message number and nearby text. After checking, choose one:
56
+ - **Share as a web page.** In a room’s menu, select “Share”. The room is read and cleaned first; the confirmation lists what is included and left out, and anything that looks like a key, a folder on this computer or contact details, with its message number and nearby text. After checking, choose one:
57
57
  - “Download web page” gives you a single `.html` file that opens in any browser. Once sent, it cannot expire or be taken back.
58
- - “Publish link” uploads it to the official share site and copies the link. Choose whether it expires in 1, 3 or 7 days; it is deleted when it expires. “Shared” then appears below the room list, listing every live share link with its time left, to copy, open, renew (same content, a new lifetime from now) or revoke. The room’s menu also offers “Copy share link” and “Revoke share link”, and “Share as web page…” again offers “Update link” to show the latest content. Links are kept with the room on the computer, so paired phones and tablets can manage them too. Rooms over 5 MB after cleaning need the web page file instead.
58
+ - “Publish link” uploads it to the official share site and copies the link. Choose whether it expires in 1, 3 or 7 days; it is deleted when it expires. “Shared” then appears below the room list, listing every live share link with its time left, to copy, open, renew (same content, a new lifetime from now) or revoke. The room’s menu also offers “Copy share link” and “Revoke share link”, and “Share” again offers “Update link” to show the latest content. Links are kept with the room on the computer, so paired phones and tablets can manage them too. Rooms over 5 MB after cleaning need the web page file instead.
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
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. 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, 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. Archives, 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. Attachments count toward the 5 MB limit for share links; above it, untick them or use the web page file. A web page file carries at most 100 MB of attachments.
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.
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.
66
66
 
@@ -44,6 +44,7 @@ Select a workflow on the Workflows page. The canvas opens in the center, and its
44
44
  - **The host follows SKILL.md:** The skill file defines order, parallel work, when to return to the host, and when to revise. The host follows those written instructions. When workflow-creator creates or edits a workflow, it updates the canvas to reflect the skill file.
45
45
  - **Steps and attached sub-workflows:** The canvas can group nodes into steps, shown as named dashed frames that list the sub-workflows attached to each step. Steps and attachments live in flow.json and in each sub-workflow's SKILL.md (workflow-creator maintains them). Like the canvas they are only a diagram; the host still decides from SKILL.md whether to use a sub-workflow at that step.
46
46
  - **Several members for one card:** The host can bring in several members for the same card under different display names, for example one member per character. A display name applies to this room only, and asking for the same name again brings back the same member with its own session.
47
+ - **Experts with skills:** A workflow expert can be a folder instead of a file: agents/<card-id>/ holds its definition <card-id>.md (the same format as a card file) and skills/<skill>/, each skill a SKILL.md plus references/. The member playing that card may read and write its own skills while the rest of the workflow stays read-only; its writing does not change the workflow’s revision, and ordinary saves from the page or the command line keep the skills as they are; only an explicit overwrite or an import replaces them with the folder’s. Exporting the expert gives exactly that folder. In “Experts”, every expert with skills, in the main flow or a sub-workflow, is listed under Advisors, marked with where it sits; its “Skills” section below the definition shows each skill’s SKILL.md and references to view and edit, and lets you create or delete skills and reference files. These edits are written to the expert’s folder at once, without saving the workflow or changing its revision; a file the expert changed meanwhile is refused with a reload offered, never overwritten. “Add skill” on another expert writes its first skill’s name and description; after you save the workflow it becomes a folder with skills. “Import expert package” below the list puts an md, zip or folder into the main flow or the sub-workflow open on the canvas. Removing an expert with skills, replacing its skills by an overwrite, or deleting the workflow first backs its folder up into backups in the service folder. codiscuss launch expert-import --from <path> --workflow <id> [--sub <sub-workflow-id>] puts an expert package into a workflow and refuses a card ID that exists. A panel expert has skills of its own in experts/<id>/skills/ in the service folder, never shared with a workflow’s; “Save as preset” in “Experts” copies them there; skills already on this computer are kept, and the notice offers to replace them with the workflow’s. On the new-room panel, a card added from a preset has a “Skills” button on its back for its own skills in the service folder. If a preset of that name exists, choose “Replace the preset of this name” to replace it; skills already there are kept. In the page, “Import / export experts” under “添加 AI” on the new-room panel imports an .md, a zip or a folder and exports any preset; “Export” in a workflow’s “Experts” exports the current card as saved. Without skills you get one md, otherwise a zip. On import, a preset of the same name asks you to “Replace” or cancel; skills already on this computer are kept unless you choose “Use the imported one (the current one is backed up)”; ignored files and access lowered to read-only are listed. On the command line, codiscuss launch expert-export exports an expert and codiscuss launch expert-import imports one as a preset; an existing preset or skills are never replaced silently. When an expert names software this computer has not set up, or a model missing from this computer’s list for that software, the import still succeeds and its notice says so; the panel button is then greyed (software) or the card is marked “… is not available here and cannot run” (model), and starting a room or inviting it is refused until the software is set up or the model changed to a listed one (empty means the software default). Only a model list already read here counts: no list yet, a failed read or no model at all is never flagged, and Claude’s list, being only its model picker, never blocks.
47
48
 
48
49
  ### 5. “Full host control” and workflows
49
50
 
package/docs/guide/cli.md CHANGED
@@ -53,7 +53,7 @@
53
53
 
54
54
  ### 备份、导出与导入
55
55
 
56
- 房间的 ZIP 导出与导入在网页端完成(见[房间目录与建房](rooms.md#5-导出导入与分支房间)):房间菜单 → “导出对话”、目录选项 → “导出全部房间”和“导入房间…”。独立部署 Python 服务时,停止写入后直接备份 SQLite 数据库与同级 `<数据库文件名>.attachments/` 目录(见[部署指南](../deployment.md#python-服务))。
56
+ 房间的 ZIP 导出与导入在网页端完成(见[房间目录与建房](rooms.md#5-导出导入与分支房间)):房间菜单 → “导出对话”、目录选项 → “导出全部房间”和“导入房间”。独立部署 Python 服务时,停止写入后直接备份 SQLite 数据库与同级 `<数据库文件名>.attachments/` 目录(见[部署指南](../deployment.md#python-服务))。
57
57
 
58
58
  ### 远程 / SSH 本机管理
59
59
 
package/docs/guide/faq.md CHANGED
@@ -33,7 +33,7 @@
33
33
  可以。程序新建的房间会话独立运行,不会干扰你平时在 IDE 或终端里开的新对话。如果你用“历史会话”续接了一个旧对话,CLI 软件会把它复制成新会话运行,原窗口不受影响(原软件里也看不到房间记录);Codex App 则直接复用该原聊天,不要同时在两边往同一个聊天里发指令。
34
34
 
35
35
  9. **所有数据存在电脑哪里?换电脑怎么迁移?**
36
- 默认保存在 `~/.codiscuss`(本机网站数据库在 `~/.codiscuss/local/discuss.sqlite3`,还有本机配置、密钥、预设与工作流);不选项目目录时房间文件在 `~/.codiscuss-workspace`。迁移单个或多个房间可用网页“导出对话” / “导出全部房间”导出 ZIP,在新电脑用“导入房间…”恢复;工作流可直接复制 `~/.codiscuss/workflows/` 里的对应文件夹。
36
+ 默认保存在 `~/.codiscuss`(本机网站数据库在 `~/.codiscuss/local/discuss.sqlite3`,还有本机配置、密钥、预设与工作流);不选项目目录时房间文件在 `~/.codiscuss-workspace`。迁移单个或多个房间可用网页“导出对话” / “导出全部房间”导出 ZIP,在新电脑用“导入房间”恢复;工作流可直接复制 `~/.codiscuss/workflows/` 里的对应文件夹。
37
37
 
38
38
  10. **电脑关机、休眠或断网后,进行中的任务、Goal 和手机端会怎样?**
39
39
  关机或休眠会中断本机执行。仅断网时,本机服务可能仍在运行,但手机无法经线上站点访问,依赖模型网络连接的任务也会受影响。重新开机并启动服务后,授权期内的手机会自动重连,无需重新配对;已中断的任务不会自动重跑,先查看房间里的回答或失败卡再决定是否重试。
@@ -29,8 +29,8 @@
29
29
  - **排序**:点目录右上角选项,在“手动排序”(拖动或用上下方向键调序)和“最近发言”之间切换。
30
30
  - **文件夹**:点“新建文件夹”按项目归集房间,可为文件夹设置默认项目目录,之后在该文件夹里建房会自动带入。点文件夹菜单可“编辑”、“上移”、“下移”、“存档文件夹”或“移除文件夹”(可选择仅移除文件夹,或连同其中房间一并删除)。
31
31
  - **房间操作**:点房间右侧菜单,可以“重命名”、“编辑议题”、“移至文件夹”、“复制阅读入口”、“刷新消息”、“存档房间”或“销毁房间”。“编辑议题”和“刷新消息”用于当前打开的房间。
32
- - **销毁房间**:在房间菜单点“销毁房间”。确认框列出会删除和保留的内容,可先点“导出资料包”下载一份:含消息、私聊、附件、可双击打开的“讨论记录.html”,以及成员写在草稿目录里的文件(“草稿”文件夹,超过 50 MB 的部分只列出文件名)。点“立即销毁”后,这台电脑上的房间记录、附件、成员在本房间新建的 AI 会话记录、运行文件和草稿会被删除,确认框逐项显示“已删除并复查”。全部核验通过后,房间化成粒子消散,右下角显示删除了多少。项目文件不会删除;沿用你原有窗口的会话、与其他房间共用的会话会保留;已发给模型服务商的内容按其政策保留,无法从这里删除。房间发布过分享网页时,销毁前会先撤销它。某项暂时没删掉时,房间会变暗留在左栏,可在确认框点“重试”。成员草稿目录里的文件会随房间删除,需要的先导出资料包。
33
- - **销毁记录与销毁全部房间**:点左栏房间目录右上角“…”里的“销毁记录…”,查看每次销毁删除了什么、保留了什么(房间名在完成后清除),未完成的可点“重试”。底部“销毁全部房间”须输入“销毁全部”确认,会逐个销毁全部房间(含已存档),项目文件保留;以独立 Windows 用户运行的托管账号随后还会删除各 AI 软件里的全部会话记录和 AI 记住的偏好,登录信息保留。“导出全部房间”不含草稿,需要草稿请逐个房间导出。
32
+ - **销毁房间**:在房间菜单点“销毁房间”。确认框列出会删除和保留的内容,可先点“导出资料包”下载一份:含消息、私聊、附件、可双击打开的“讨论记录.html”,以及成员写在草稿目录里的文件(“草稿”文件夹,超过 50 MB 的部分只列出文件名)。点“立即销毁”,再在“再次确认销毁”里点“确认销毁”后(所有销毁入口都要这样确认两次),这台电脑上的房间记录、附件、成员在本房间新建的 AI 会话记录、运行文件和草稿会被删除,确认框逐项显示“已删除并复查”。全部核验通过后,房间化成粒子消散,右下角显示删除了多少。项目文件不会删除;沿用你原有窗口的会话、与其他房间共用的会话会保留;已发给模型服务商的内容按其政策保留,无法从这里删除。房间发布过分享网页时,销毁前会先撤销它。某项暂时没删掉时,房间会变暗留在左栏,可在确认框点“重试”。成员草稿目录里的文件会随房间删除,需要的先导出资料包。
33
+ - **销毁记录与销毁全部房间**:点左栏房间目录右上角“…”里的“销毁记录”,查看每次销毁删除了什么、保留了什么(房间名在完成后清除),未完成的可点“重试”。底部“销毁全部房间”须输入“销毁全部”确认,会逐个销毁全部房间(含已存档),项目文件保留;以独立 Windows 用户运行的托管账号随后还会删除各 AI 软件里的全部会话记录和 AI 记住的偏好,登录信息保留。“导出全部房间”不含草稿,需要草稿请逐个房间导出。
34
34
  - **自动销毁**:新建房间时在“高级设置”里选,或之后在房间顶部的“房间”页,把“自动销毁”设为无活动 1 天、7 天或 30 天后销毁,旁边显示还剩多久;从设定时起算,房间里有新消息或私聊会重新计时;已存档、有成员在工作或排队、有待你回答的提问、发布着分享网页的房间不会自动销毁。剩余不足一天时网页会提示一次,销毁后也会提示。默认“长期保留”。
35
35
  - **恢复与清理存档**:打开“已存档”,按关键词或有无消息筛选,对选中房间点“恢复”放回活跃列表,单个房间点“彻底删除”并确认;“全部删除”针对当前筛选结果。
36
36
 
@@ -53,14 +53,14 @@
53
53
  ### 5. 导出、导入与分支房间
54
54
 
55
55
  - **导出备份**:房间菜单 → “导出对话”将当前房间的消息、历次讨论与附件打包为 ZIP;文件夹菜单 → “导出文件夹”;目录选项 → “导出全部房间”。在运行本机服务的电脑上导出,备份会附带成员的软件配置与会话标识。要续接会话,原软件的会话记录仍须保存在电脑上。
56
- - **分享为网页**:房间菜单 → “分享为网页…”。程序先读取并整理房间,确认框里列出包含与不包含的内容,以及找到的疑似密钥、本机目录或联系方式(标出消息编号和前后文),核对后选一种方式:
56
+ - **分享为网页**:房间菜单 → “分享”。程序先读取并整理房间,确认框里列出包含与不包含的内容,以及找到的疑似密钥、本机目录或联系方式(标出消息编号和前后文),核对后选一种方式:
57
57
  - “下载网页文件”:得到一个单独的 `.html` 文件,用浏览器直接打开即可,发出去后无法过期或撤回。
58
- - “发布链接”:上传到官方分享站,得到一个链接并自动复制,选 1、3 或 7 天后过期,到期自动删除。之后左侧房间列表下方出现“已分享”,列出所有有效的分享链接和剩余时间,可以复制、打开、续期(内容不变,有效期从现在重新计算)或撤销;房间菜单里也有“复制分享链接”“撤销分享链接”,再次“分享为网页…”可“更新链接”换成最新内容。链接跟着房间保存在电脑上,已配对的手机和平板也能管理;整理后超过 5 MB 的房间请改用网页文件。
58
+ - “发布链接”:上传到官方分享站,得到一个链接并自动复制,选 1、3 或 7 天后过期,到期自动删除。之后左侧房间列表下方出现“已分享”,列出所有有效的分享链接和剩余时间,可以复制、打开、续期(内容不变,有效期从现在重新计算)或撤销;房间菜单里也有“复制分享链接”“撤销分享链接”,再次“分享”可“更新链接”换成最新内容。链接跟着房间保存在电脑上,已配对的手机和平板也能管理;整理后超过 5 MB 的房间请改用网页文件。
59
59
 
60
60
  两种方式看到的都是这个房间的“消息”和“执行”两页,从头阅读,外观与本机一致,卡片和执行详情都能点开;每次进入“执行”都会从头自动回放协作过程,点“结束回放”回到最终状态。“私聊”“房间”“文件”等标签灰显,只展示示意。但不能发消息或做任何操作;内容停在生成那一刻。私聊、事件记录、调度决策、被拒操作、排队消息、本机路径、会话编号与凭据不会写进去,已撤回或回退的消息也不带;失败原因只写“执行失败”,房间项目目录在正文里改写成项目内的相对路径。消息正文其余部分原样公开,发出前请核对。
61
61
 
62
62
  附件默认不带,消息里的附件标记显示为“未包含在分享中”。房间有附件时,确认框里有“包含附件”,勾选后所有附件(图片、视频、网页、文档等)原样放进分享页,读者可以查看和下载。文本类附件会一并检查疑似密钥和本机目录;图片、视频等文件的内容程序查不了,请自己核对。发布链接带上页面能预览的附件:图片、音视频、PDF、Word/Excel/PowerPoint(docx、xlsx、pptx)、文本与代码和网页,读者在分享页里直接打开;js、bat、ps1 等双击就会运行的脚本改名为 .txt 后带上。压缩包、程序和旧版 doc/xls/ppt 不放到分享站,消息里显示“未包含在分享中”,下载的网页文件仍会带上。网页附件在分享页里照常运行,成员回答里引用的演示直接显示在消息中;它在隔离的框架里运行,读不到分享页,也不能联网请求或提交表单。附件计入发布链接 5 MB 的上限,超过时取消勾选或改用网页文件;网页文件最多带 100 MB 附件。
63
- - **导入房间**:目录选项或文件夹菜单 → “导入房间…”,选择 ZIP 文件,在预览中确认要导入的房间;标为“已存在,跳过”的房间会保留原样。在同一台电脑导入后,请回成员会续接原会话(Claude Code 成员会改为手动接入,请回后在原窗口重新注册,避免会话分叉)。导入保留历史讨论记录,不会自动继续原讨论或重新唤醒成员。
63
+ - **导入房间**:目录选项或文件夹菜单 → “导入房间”,选择 ZIP 文件,在预览中确认要导入的房间;标为“已存在,跳过”的房间会保留原样。在同一台电脑导入后,请回成员会续接原会话(Claude Code 成员会改为手动接入,请回后在原窗口重新注册,避免会话分叉)。导入保留历史讨论记录,不会自动继续原讨论或重新唤醒成员。
64
64
  - **从某条消息分支**:AI 发言菜单 → “从这里分支”,新建一个保留截至该条发言记录的房间。支持会话分叉的接入方式会在新房间续接分叉后的会话;原房间保留。
65
65
  - **让主持人新建房间**:在“主持人权限”里勾选“新建房间”后,主持人可以把一部分工作拆到新房间:成员只用本机已配置的软件,项目权限默认只读、最高可写,项目目录只能是原房间的目录或其子目录;你没指定时由与原主持人同款的专家主持。两个房间各留一张“关联房间”卡片,点“打开房间”互相跳转。新房间的主持人权限按你的默认设置,但不能再新建房间;一个房间可新建的数量有上限(默认 3 个,可在“主持人权限”里调整)。两个关联房间的主持人可以互相发言,这些消息标注“来自房间「…」的主持人 …”,按你的消息唤醒对方房间;默认不限条数;担心两边来回不停,可在新建房间面板“高级设置”里设“关联房间互传上限”(对本机所有关联房间生效),从你上次在任一房间发言算起超过这个条数会被拒绝,你发一条消息即可让它们继续。
66
66
 
@@ -44,6 +44,7 @@
44
44
  - **主持人按 `SKILL.md` 派活**:谁先谁后、哪些成员并行、什么时候交回主持人把关、什么条件返工,都由 `SKILL.md` 写明并由主持人照做。用 `workflow-creator` 生成或修改工作流时,AI 会按 `SKILL.md` 同步更新画布。
45
45
  - **步骤分组与挂靠**:画布可以把节点分成几个步骤,显示为带名字的虚线框,框上标出挂在这一步的子工作流。步骤和挂靠写在 `flow.json` 与子工作流的 `SKILL.md` 里(由 `workflow-creator` 维护),和画布一样只是示意,主持人仍按 `SKILL.md` 判断这一步用不用。
46
46
  - **一张卡片请多位成员**:同一张卡片可以由主持人按不同显示名请进多位成员,例如每位人物一位成员;显示名只在本房间有效,同一个名字请回的是原来那位成员和它的会话。
47
+ - **带技能的专家**:工作流里的专家可以是一个文件夹而不是一个文件:`agents/<卡片ID>/` 里放定义 `<卡片ID>.md`(和普通卡片文件同一格式)和 `skills/<技能名>/`,每条技能一份 `SKILL.md` 加 `references/`。担任这张卡片的成员可以读写自己的 skills,工作流的其他部分照旧只读;他写技能不改变工作流的修订号,网页和命令行的普通保存都原样保留这些技能,只有整份覆盖和导入会用文件夹里带的替换。导出这位专家得到的就是这个文件夹。在“专家配置”里,带技能的专家不论在主线还是子工作流,都归在“顾问”一组,条目上标着他属于哪里;选中后在定义下面的“技能”里可以查看和修改每条技能的 SKILL.md 和资料,新建、删除技能和资料文件。这些修改直接写进专家的文件夹,不用保存工作流,也不改工作流的修订号;专家同时改过的文件会拒绝保存并提示重新载入,不会被覆盖。普通专家上点“添加技能”写下第一条技能的名字和描述,保存工作流后它就变成带技能的文件夹。列表下方的“导入专家包”把一个 md、压缩包或文件夹放进主线或画布当前所在的子工作流。删掉一位带技能的专家、整份覆盖替换了技能、删除整个工作流时,原来的文件夹会先备份到服务目录的 backups 下。命令行 `codiscuss launch expert-import --from <路径> --workflow <ID> [--sub <子工作流ID>]` 把专家包放进工作流,卡片 ID 已存在时拒绝。面板上的专家各有一份技能,在本机服务目录 `experts/<ID>/skills/`,和工作流里的不共用;在“专家配置”里把卡片“存为面板预设”时会复制过去,同名预设已存在时要点“覆盖同名预设”才会替换;本机已有这位专家的技能时默认保留,提示后可点“用工作流里的技能替换本机的”。新建房间面板上,来自预设的专家卡片背面有“技能”按钮,查看和修改的是本机服务目录里的那份。网页上,新建房间面板“添加 AI”下方的“导入导出专家”可以导入 .md、压缩包或文件夹,也可以导出任一预设;工作流“专家配置”里的“导出”导出当前卡片(已保存的版本)。没有技能下载一个 md,有技能下载一个压缩包。导入时同名预设会让你选“覆盖”或“取消”;本机已有这位专家的技能时默认保留本机的,可选“用导入的替换(原来的会备份)”;被忽略的文件和被降为只读的权限会在提示里列出。命令行同样可以:`codiscuss launch expert-export` 导出,`codiscuss launch expert-import` 导入成面板预设;同名预设和已有的技能都不会被静默替换。专家带着的软件本机没有配置,或者本机这个软件的模型列表里没有他写的模型时,导入照样成功,提示里会说明;这时面板上的按钮变灰(软件)或卡片上标出“本机没有……,不能调用”(模型),建房和请进都会被拒,配好软件、或把模型改成列表里的(留空即用软件默认)之后恢复。是否“没有”只看本机已经读到的模型列表:还没读过列表、读取失败或没写模型都不算;Claude 的列表只是它的模型选单,不据此拦。
47
48
 
48
49
  ### 5. “主持人完整权限”与工作流的关系
49
50
 
@@ -406,7 +406,7 @@
406
406
  "消息仍在排队,输入框里是副本,发送前请先删除排队中的原消息": "The message is still queued and the composer holds a copy. Delete the queued original before sending.",
407
407
  "未能确认这条排队消息的状态,内容已保留在输入框,请确认未发出后再发送": "Couldn't confirm this queued message's status. Its text is kept in the composer. Check that it wasn't sent before sending it again.",
408
408
  "请先登录": "Please sign in",
409
- "分享为网页…": "Share as web page…",
409
+ "分享": "Share",
410
410
  "用自己的 AI 开一个房间": "Start a room with your own AIs",
411
411
  "{title} · AI CoDiscuss": "{title} · AI CoDiscuss",
412
412
  "这是只读的分享页面,不能修改房间": "This is a read-only shared page; the room cannot be changed here",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "面板上已有预设「{name}」;要用这张卡片替换它,请明确选择覆盖": "The panel already has a preset “{name}”; choose to replace it explicitly to use this card",
2
3
  "工作流「{id}」已被修改,请重新载入后再保存": "Workflow “{id}” was changed since you loaded it; reload it before saving",
3
4
  "工作流库里已有「{id}」;要整份覆盖它,请明确选择覆盖": "The library already has “{id}”; choose to overwrite it explicitly to replace it",
4
5
  "尚未绑定线上网站": "No online site is bound yet",
@@ -846,5 +847,9 @@
846
847
  "分享链接格式不正确": "The share link is not in the expected format",
847
848
  "清理结果格式无效": "The cleanup report is not in the expected format",
848
849
  "自动销毁只能设为 {choices} 天(0 为不自动销毁)": "Auto-destroy can only be set to {choices} days (0 keeps the room)",
849
- "这个房间发布过分享链接,请先撤销分享链接再销毁": "This room has a published share link; revoke it before destroying the room"
850
+ "这个房间发布过分享链接,请先撤销分享链接再销毁": "This room has a published share link; revoke it before destroying the room",
851
+ "技能文件 {path} 在你读取之后变了(专家可能刚写过),请重新载入后再改": "The skill file {path} changed after you read it (the expert may have just written it); reload before changing it",
852
+ "工作流「{id}」里已有卡片 {card};不会替换它,要换请先删掉原卡片": "The workflow “{id}” already has the card {card}; it is not replaced: delete that card first to change it",
853
+ "导入的内容须正好有一个专家定义 .md,现有 {count} 个": "The import must hold exactly one expert definition .md; it has {count}",
854
+ "{name} 的模型 {model} 不在本机这个软件的模型列表里,不能调用:请在专家配置或卡片背面把模型改成列表里的(或留空用软件默认),或在模型下拉旁刷新列表后再试": "The model {model} of {name} is not in this computer’s list for its software, so it cannot run: pick a listed model (or leave it empty for the software default) in Experts or on the card’s back, or refresh the list beside the model menu and try again"
850
855
  }
@@ -75,7 +75,7 @@
75
75
  "对话排列方式": "Sort conversations",
76
76
  "手动排序": "Manual order",
77
77
  "最近发言": "Recent activity",
78
- "导入房间…": "Import rooms…",
78
+ "导入房间": "Import rooms",
79
79
  "导出全部房间": "Export all rooms",
80
80
  "全部房间": "All rooms",
81
81
  "刚刚": "just now",
@@ -362,7 +362,6 @@
362
362
  "纯白界面 · 中性灰阶 · 清晰阅读": "White · neutral greys · easy reading",
363
363
  "搜索已存档房间": "Search archived rooms",
364
364
  "筛选房间内容": "Filter rooms",
365
- "全部删除": "Delete all",
366
365
  "已存档房间列表": "Archived room list",
367
366
  "恢复": "Restore",
368
367
  "仅移除文件夹": "Remove folder only",
@@ -394,7 +393,6 @@
394
393
  "讨论未结束时,上限不可在此修改。": "Limits can't be changed here while a discussion is running.",
395
394
  "{count} 条消息": "{count} messages",
396
395
  "仅移除「{name}」时,房间变为未分组,所有消息和存档状态都会保留。": "Removing only “{name}” leaves its rooms ungrouped; all messages and archive states are kept.",
397
- "连同 {count} 个房间删除": "Delete with {count} rooms",
398
396
  "存档「{name}」中的 {count} 个房间,文件夹保留。存档后可在侧栏「已存档」中查阅与恢复;尚未收束的讨论会暂停。": "Archives the {count} rooms in “{name}” and keeps the folder. Archived rooms can be viewed and restored under “Archived” in the sidebar; unfinished discussions are paused.",
399
397
  "移除主目录 {path}": "Remove main folder {path}",
400
398
  "用户原文": "Original request",
@@ -505,7 +503,7 @@
505
503
  "立即销毁": "Destroy now",
506
504
  "这个房间发布过分享网页,销毁前会先撤销。": "This room has a published share page; it is taken down before the room is destroyed.",
507
505
  "资料包含消息、私聊和附件,不含成员写在草稿目录里、没有发进房间的文件;需要的先让成员发进房间或存进项目目录。": "The package has messages, private chats and attachments, but not files members wrote in their draft folders and never posted; ask members to post them or save them to the project folder first.",
508
- "销毁记录…": "Destruction records…",
506
+ "销毁记录": "Destruction records",
509
507
  "销毁记录": "Destruction records",
510
508
  "查看销毁回执:删除了什么、保留了什么;未完成的可以重试。": "See each destruction's receipt: what was deleted and what was kept. Retry any that are unfinished.",
511
509
  "你评过的调度记录 {count} 条": "{count} scheduling decisions you rated",
@@ -526,5 +524,13 @@
526
524
  "将销毁当前列表中的 {count} 个房间:记录、附件、成员的 AI 会话与草稿都会删除,分享网页会先撤销,项目文件保留,无法撤销。需要留底请先导出。": "The {count} rooms in this list will be destroyed: records, attachments, members' AI sessions and drafts are deleted, share pages are taken down first, and project files are kept. This cannot be undone; export first to keep a copy.",
527
525
  "销毁 {name}": "Destroy {name}",
528
526
  "销毁「{name}」:记录、附件、成员的 AI 会话与草稿都会删除,分享网页会先撤销,项目文件保留,无法撤销。": "Destroy “{name}”: records, attachments, members' AI sessions and drafts are deleted, share pages are taken down first, and project files are kept. This cannot be undone.",
529
- "也可以连同其中的 {count} 个房间一起销毁:记录、附件、成员的 AI 会话与草稿都会删除,项目文件保留,无法撤销。": "You can also destroy its {count} rooms: records, attachments, members' AI sessions and drafts are deleted, and project files are kept. This cannot be undone."
527
+ "也可以连同其中的 {count} 个房间一起销毁:记录、附件、成员的 AI 会话与草稿都会删除,项目文件保留,无法撤销。": "You can also destroy its {count} rooms: records, attachments, members' AI sessions and drafts are deleted, and project files are kept. This cannot be undone.",
528
+ "正在销毁 {count} 个房间:逐项删除并复查后,房间会逐个消散并给出回执;也可在“销毁记录”里查看。": "Destroying {count} rooms: once each item is deleted and checked, the rooms dissolve one by one with a receipt each; see them also in “Destruction records”.",
529
+ "连同 {count} 个房间销毁": "Destroy with its {count} rooms",
530
+ "再次确认销毁": "Confirm destroying again",
531
+ "销毁后,这 {count} 个房间的消息、附件、成员的 AI 会话记录与草稿都会被删除,数据将永久丢失,无法恢复。确定要销毁吗?": "Destroying deletes the messages, attachments, members' AI sessions and drafts of these {count} rooms. The data is lost for good and cannot be recovered. Destroy them?",
532
+ "确认销毁": "Destroy",
533
+ "销毁": "Destroy",
534
+ "返回": "Back",
535
+ "销毁后,这个房间的消息、附件、成员的 AI 会话记录与草稿都会被删除,数据将永久丢失,无法恢复。确定要销毁吗?": "Destroying deletes this room's messages, attachments, members' AI sessions and drafts. The data is lost for good and cannot be recovered. Destroy it?"
530
536
  }
@@ -568,6 +568,25 @@
568
568
  "{value1} 位成员": "{value1} members",
569
569
  "进入这个子工作流(也可双击)": "Open this sub-workflow (or double-click)",
570
570
  "挂靠:{value1}": "Attached: {value1}",
571
+ "已存为面板预设「{value1}」": "Saved as preset “{value1}”",
572
+ "先保存工作流": "Save the workflow first",
573
+ "存的是已保存的版本;先保存这页的修改": "This saves the saved version; save this page's changes first",
574
+ "覆盖同名预设": "Replace the preset of this name",
575
+ "存为面板预设": "Save as preset",
576
+ "导入专家(.md)": "Import expert (.md)",
577
+ "导入专家(压缩包)": "Import expert (zip)",
578
+ "导入专家(文件夹)": "Import expert (folder)",
579
+ "导出「{value1}」": "Export “{value1}”",
580
+ "已导入专家「{value1}」": "Imported expert “{value1}”",
581
+ "它要求的项目权限“{value1}”已降为只读,需要时在预设里改": "The project access it asked for (“{value1}”) was lowered to read-only; change it in the preset if needed",
582
+ "已忽略:{value1}": "Ignored: {value1}",
583
+ "导入导出专家": "Import / export experts",
584
+ "本机已有这位专家的知识库,已保留本机的": "This computer already has this expert’s knowledge; it was kept",
585
+ "覆盖": "Replace",
586
+ "用导入的替换(原来的会备份)": "Use the imported one (the current one is backed up)",
587
+ "保留本机的": "Keep this computer’s",
588
+ "没有找到专家定义的 .md 文件": "No expert definition (.md) was found",
589
+ "导出": "Export",
571
590
  "工作流库里已有同 ID 的工作流,保存会整份覆盖它": "The library already has a workflow with this ID; saving replaces it entirely",
572
591
  "工作流已被修改,请重新载入": "The workflow was changed elsewhere; reload it",
573
592
  "覆盖保存": "Save and replace",
@@ -750,5 +769,53 @@
750
769
  "房间偏好": "Room preferences",
751
770
  "主持人项目权限": "Host's project access",
752
771
  "新建房间时,第一位加入的成员(默认主持人)使用的项目权限;该软件不支持所选档位时仍为只读。保存在这台电脑的本机服务里,升级后保留。": "The project access the first member added to a new room (the host by default) starts with. If its software doesn't support the chosen level, it stays read-only. Saved in this computer's local service and kept across updates.",
753
- "连接本机服务后可设置。": "Available once the local service is connected."
772
+ "连接本机服务后可设置。": "Available once the local service is connected.",
773
+ "技能:这位预设专家自己读写的知识,存在本机服务目录": "Skills: knowledge this preset expert reads and writes itself, kept in the local service folder",
774
+ "预设「{value1}」的技能,存在本机服务目录,和工作流里的同名专家互不共用。": "Skills of the preset “{value1}”, kept in the local service folder and never shared with an expert of the same name in a workflow.",
775
+ "技能名只能用小写英文和数字,可用单个连字符连接,1—40 位": "A skill name uses lowercase letters and digits, joined by single hyphens, 1–40 characters",
776
+ "请写一句描述:这条技能管什么": "Write one sentence on what this skill covers",
777
+ "文件名不合法": "Invalid file name",
778
+ "已删除技能 {value1},原来的文件夹已移到服务目录的 backups 下": "Deleted the skill {value1}; its folder was moved to backups in the service folder",
779
+ "这位专家自己读写的知识;这里的修改直接写入,不需要保存工作流": "Knowledge this expert reads and writes itself; changes here are written at once, without saving the workflow",
780
+ "重新载入技能": "Reload skills",
781
+ "新建技能": "New skill",
782
+ "专家刚改过技能,你看到的不是最新内容。": "The expert just changed its skills; what you see is not the latest.",
783
+ "技能名,如 cold-survival": "Skill name, e.g. cold-survival",
784
+ "技能名": "Skill name",
785
+ "一句描述:这条技能管什么": "One sentence: what this skill covers",
786
+ "技能描述": "Skill description",
787
+ "还没有技能。": "No skills yet.",
788
+ "确认删除技能": "Confirm deleting the skill",
789
+ "删除技能 {value1}": "Delete the skill {value1}",
790
+ "删除整条技能;原来的文件夹会移到服务目录的 backups 下": "Delete the whole skill; its folder is moved to backups in the service folder",
791
+ "确认删除": "Confirm delete",
792
+ "删除文件 {value1}": "Delete the file {value1}",
793
+ "references 下的文件名,如 fire.md": "File name under references, e.g. fire.md",
794
+ "资料文件名": "Reference file name",
795
+ "新建资料文件": "New reference file",
796
+ "不是文本或超过大小上限,不能在这里查看和修改。": "Not text or over the size limit; it cannot be viewed or edited here.",
797
+ "顾问": "Advisors",
798
+ "已存为面板预设「{value1}」;本机已有这位专家的技能,已保留本机的": "Saved as the panel preset “{value1}”; this computer already has skills for this expert, so they were kept",
799
+ ";本机原来的技能已备份": "; the skills this computer had were backed up",
800
+ "已添加技能;保存工作流后生效,这张卡片会变成带技能的文件夹": "Skill added; once you save the workflow, this card becomes a folder with skills",
801
+ "保存工作流后才能编辑技能": "Save the workflow before editing its skills",
802
+ "专家包(.md)": "Expert package (.md)",
803
+ "专家包(压缩包)": "Expert package (zip)",
804
+ "专家包(文件夹)": "Expert package (folder)",
805
+ "它要求的项目权限“{value1}”已降为只读,需要时在这里改": "The project access it asked for, “{value1}”, was lowered to read-only; change it here if needed",
806
+ "先保存这页的修改": "Save this page’s changes first",
807
+ "放进「{value1}」": "Into “{value1}”",
808
+ "导入专家包": "Import expert package",
809
+ "存为新建房间面板上的预设专家;带技能时把技能复制到本机,之后两边各管各的": "Save as a preset expert on the new-room panel; its skills are copied to this computer, and from then on each copy is separate",
810
+ "用工作流里的技能替换本机的(原来的会备份)": "Replace this computer’s skills with the workflow’s (the current ones are backed up)",
811
+ "导出这位专家:没有技能是一个 md,有技能是一个压缩包(取工作流里的技能)": "Export this expert: one md without skills, otherwise a zip (with the workflow’s skills)",
812
+ "添加技能": "Add skill",
813
+ "给这位专家一组自己读写的技能;保存工作流后它变成带技能的文件夹,归到“顾问”": "Give this expert skills it reads and writes itself; after saving the workflow it becomes a folder with skills, listed under Advisors",
814
+ "本机未配置它的软件,点它的按钮去配置后才能加入": "Its software is not set up on this computer; click its button to set it up before adding it",
815
+ "本机这个软件没有模型 {value1},加入后在卡片背面改成列表里的模型并“更新预设”": "This computer’s software has no model {value1}; after adding it, pick a listed model on the card’s back and “Update preset”",
816
+ "本机没有 {value1},不能调用;在背面改模型": "{value1} is not available here and cannot run; change the model on the back",
817
+ "本机未配置它的软件,配置好或在这里换成本机已配置的软件之前不能调用": "Its software is not set up on this computer; it cannot run until you set it up or switch it here to software that is",
818
+ "本机这个软件没有模型 {value1},改成列表里的模型之前不能调用": "This computer’s software has no model {value1}; it cannot run until you pick a listed model",
819
+ "本机没有模型 {value1}": "Model {value1} is not available here",
820
+ "本机的 {value1} 没有模型 {value2},不能调用:在下面“模型”里改成列表里的(或用软件默认),改完保存": "{value1} on this computer has no model {value2}, so it cannot run: pick a listed model (or the software default) under “Model” below, then save"
754
821
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -11,7 +11,7 @@ import { fileURLToPath } from 'node:url';
11
11
  import { DatabaseSync } from 'node:sqlite';
12
12
  import { atomic_json } from '../files.mjs';
13
13
  import { cli_delivery } from './cli.mjs';
14
- import { DENIAL_FIELD, EDIT_TOOLS, json_line, launch_directory, MAX_DENIALS, model_entry, MODEL_PATTERN, not_sent, page_sessions, project_directory,
14
+ import { carve_protected, DENIAL_FIELD, EDIT_TOOLS, json_line, launch_directory, MAX_DENIALS, model_entry, MODEL_PATTERN, not_sent, page_sessions, project_directory,
15
15
  prompt_title, query_catalog, read_json, remove_session_files, same_path, shell_written_paths, TASK_SUBCOMMANDS, trim_preview } from './common.mjs';
16
16
 
17
17
  // agy stores its generation settings as protobuf; field 28 (tag bytes 0xe2 0x01) holds the model actually used.
@@ -251,11 +251,17 @@ function agy_project_grants(config, task, folders, user_home) {
251
251
  const write_rule = directory => `write_file(${resolve(directory).replaceAll('\\', '/')})`;
252
252
  // 全放开 also allows commands outside agy's sandbox and MCP tools; deny rules are still written, but bypass may override them.
253
253
  const full = config.project_access === 'full';
254
- return { allow: [agy_rule(), write_rule(task.draft_directory),
254
+ // The expert's own knowledge is written like its drafts, whatever its project access: a protected folder holding it
255
+ // (its workflow) is denied entry by entry around it, since agy's deny wins over allow.
256
+ const denied = carve_protected(protected_paths, task.knowledge_directory).map(item => item.path);
257
+ if (task.knowledge_directory && denied.some(directory => within_directory(directory, task.knowledge_directory))) {
258
+ throw new Error('agy 知识库目录不能位于只读项目、运行目录、技能或 .gemini 配置目录中,未交付讨论任务');
259
+ }
260
+ return { allow: [agy_rule(), write_rule(task.draft_directory), ...(task.knowledge_directory ? [write_rule(task.knowledge_directory)] : []),
255
261
  ...(config.project_access === 'read' ? [] : [...projects.map(write_rule), 'command(*)']), ...(full ? ['unsandboxed_command(*)'] : []),
256
262
  // Grants the owner allowed from a refused operation on the page.
257
263
  ...(config.allowed_tools || [])],
258
- deny: [...new Set(protected_paths.map(write_rule)), ...(full ? [] : ['mcp(*)'])] };
264
+ deny: [...new Set(denied.map(write_rule)), ...(full ? [] : ['mcp(*)'])] };
259
265
  }
260
266
 
261
267
  /**
@@ -346,7 +352,7 @@ function invocation(config, binding, task, user_home) {
346
352
  const extra = (project ? project.directories : (task.extra_directories || []).map(item => item.path))
347
353
  .filter(directory => !same_path(directory, cwd));
348
354
  // Only the member's own runtime folder: the runtime directory holds every member's credential (凭据文件隔离).
349
- const added = unique_paths([task.member_directory, task.draft_directory, ...task.skill_directories,
355
+ const added = unique_paths([task.member_directory, task.draft_directory, task.tool_lockdown ? '' : task.knowledge_directory, ...task.skill_directories,
350
356
  ...agy_skill_directories(user_home), ...extra]);
351
357
  const args = ['--output-format', 'stream-json', '--print-timeout', '0',
352
358
  ...added.flatMap(directory => ['--add-dir', directory])];
@@ -11,7 +11,7 @@ import { connect } from 'node:net';
11
11
  import { homedir } from 'node:os';
12
12
  import { dirname, join, resolve } from 'node:path';
13
13
  import { runs_commands } from '../expert_prompts.mjs';
14
- import { bind_access, cli_max_run_ms, cli_timeout_reason, DENIAL_FIELD, EDIT_TOOLS, edge_entries, launch_directory, log_entries, marked, MAX_DENIALS, model_entry, json_line,
14
+ import { bind_access, carve_protected, cli_max_run_ms, cli_timeout_reason, DENIAL_FIELD, EDIT_TOOLS, edge_entries, launch_directory, log_entries, marked, MAX_DENIALS, model_entry, json_line,
15
15
  clock_reset_at, newest_record, not_sent, page_sessions, preview_messages, project_directory, prompt_text, prompt_title, query_catalog,
16
16
  remove_session_files, same_path, TASK_SUBCOMMANDS, tree_killable, typed_prompt, watch_events, shell_written_paths } from './common.mjs';
17
17
 
@@ -182,17 +182,19 @@ export function claude_rule_path(directory) {
182
182
  export function claude_permissions(config, task) {
183
183
  const extras = task.extra_directories || [];
184
184
  // Only the member's own runtime folder: the runtime directory holds every member's credential (凭据文件隔离).
185
- const added = [task.member_directory, task.draft_directory, ...task.skill_directories, ...extras.map(item => item.path)].filter(Boolean);
185
+ // The expert's own knowledge (`task.knowledge_directory`) is edited like its drafts, whatever its project access.
186
+ const added = [task.member_directory, task.draft_directory, task.knowledge_directory, ...task.skill_directories, ...extras.map(item => item.path)].filter(Boolean);
186
187
  // A headless run cannot ask for approval: 自动 and a taken-over manual member use auto mode, as the original window
187
188
  // does, and 全放开 skips every check; the website commands and drafts stay pre-approved either way.
188
189
  if (['own', 'auto', 'full'].includes(config.project_access)) {
189
190
  const commands = TASK_SUBCOMMANDS.flatMap(command => [`Bash(codiscuss ${command} *)`, `PowerShell(codiscuss ${command} *)`]);
190
191
  return ['--permission-mode', config.project_access === 'full' ? 'bypassPermissions' : 'auto', '--add-dir', ...added, '--allowedTools',
191
- ...commands, `Edit(${claude_rule_path(task.draft_directory)}/**)`, ...(config.allowed_tools || []), ...edit_denial(task)];
192
+ ...commands, ...[task.draft_directory, task.knowledge_directory].filter(Boolean).map(directory => `Edit(${claude_rule_path(directory)}/**)`),
193
+ ...(config.allowed_tools || []), ...edit_denial(task)];
192
194
  }
193
195
  const commands = runs_commands(config, extras) ? ['Bash', 'PowerShell']
194
196
  : TASK_SUBCOMMANDS.flatMap(command => [`Bash(codiscuss ${command} *)`, `PowerShell(codiscuss ${command} *)`]);
195
- const writable = [task.draft_directory, ...(runs_commands(config, extras)
197
+ const writable = [task.draft_directory, ...(task.knowledge_directory ? [task.knowledge_directory] : []), ...(runs_commands(config, extras)
196
198
  ? [project_directory(config), ...extras.filter(item => item.access === 'write').map(item => item.path)].filter(Boolean) : [])];
197
199
  return ['--add-dir', ...added, '--allowedTools',
198
200
  ...commands, ...writable.map(directory => `Edit(${claude_rule_path(directory)}/**)`), ...(config.allowed_tools || []), ...edit_denial(task)];
@@ -231,12 +233,14 @@ export function claude_lockdown_env(task, env = process.env, home = homedir()) {
231
233
 
232
234
  /**
233
235
  * Skill folders (the shared skills and an enabled workflow) are read, never edited, and so are the room's project
234
- * directories this member may only read. This stops Claude's own edit tools only; a command the member may run can
235
- * still write there, and Windows has no native sandbox to prevent it.
236
+ * directories this member may only read; an expert's own skills inside them are carved out (carve_protected), each
237
+ * other entry denied by itself, a folder with `/**` and a file by its path. This stops Claude's own edit tools only; a
238
+ * command the member may run can still write there, and Windows has no native sandbox to prevent it.
236
239
  */
237
240
  function edit_denial(task) {
238
241
  const read_only = (task.extra_directories || []).filter(item => item.access === 'read').map(item => item.path);
239
- return ['--disallowedTools', ...[...task.skill_directories, ...read_only].map(directory => `Edit(${claude_rule_path(directory)}/**)`)];
242
+ const denied = carve_protected([...task.skill_directories, ...read_only], task.knowledge_directory);
243
+ return ['--disallowedTools', ...denied.map(({ path, directory }) => `Edit(${claude_rule_path(path)}${directory ? '/**' : ''})`)];
240
244
  }
241
245
 
242
246
  /** What Claude's stream-json events say the agent is doing, which tool it starts, and text it wrote to the user. */
@@ -96,7 +96,9 @@ export function codex_permissions(config, task, platform = process.platform) {
96
96
  // Codex 0.169 on Windows writes it to disk as a lasting DENY for the CodexSandboxUsers group that every Codex sandbox
97
97
  // shares, which then locks other Codex members out of their own folders (tested 2026-11-15, 凭据文件隔离), so none
98
98
  // is added (必 10, review M3).
99
- const filesystem = { ':root': 'read', ...extras, [drafts]: 'write' };
99
+ // The expert's own knowledge is writable like its drafts, whatever its project access.
100
+ const knowledge = task.knowledge_directory ? { [resolve(task.knowledge_directory).replaceAll('\\', '/')]: 'write' } : {};
101
+ const filesystem = { ':root': 'read', ...extras, [drafts]: 'write', ...knowledge };
100
102
  const rules = Object.entries(filesystem).map(([path, access]) => `${JSON.stringify(path)}=${JSON.stringify(access)}`).join(',');
101
103
  const profile = `{extends=${JSON.stringify(base)},filesystem={${rules}},network={enabled=true}}`;
102
104
  // The Windows sandbox account cannot write the user's TEMP, so PowerShell starts in ConstrainedLanguage and Codex's
@@ -1,7 +1,7 @@
1
1
  /** Parts every software adapter shares: running programs, ending process trees, reading session logs and model catalogs. */
2
- import { spawn, spawnSync } from 'node:child_process';
3
- import { closeSync, existsSync, fstatSync, openSync, readFileSync, readSync, rmSync } from 'node:fs';
4
- import { resolve } from 'node:path';
2
+ import { spawn } from 'node:child_process';
3
+ import { closeSync, existsSync, fstatSync, lstatSync, openSync, readdirSync, readFileSync, readSync, rmSync } from 'node:fs';
4
+ import { isAbsolute, join, relative, resolve } from 'node:path';
5
5
  import { tmpdir } from 'node:os';
6
6
  import { createInterface } from 'node:readline';
7
7
  import { TASK_SUBCOMMANDS } from '../expert_prompts.mjs';
@@ -69,6 +69,33 @@ export function same_path(left, right) {
69
69
  return normalize(left) === normalize(right);
70
70
  }
71
71
 
72
+ /**
73
+ * Folders a member may not write, with its own knowledge (`keep`) carved out (user 2026-11-22: an expert's skills live
74
+ * in its card's folder inside the workflow, which stays protected). A folder holding `keep` is replaced by every entry
75
+ * beside the path down to it, as they are on disk now, so deny rules, which win over allow rules in Claude Code and
76
+ * agy, still cover the rest; an entry created later beside that path is not covered. Returns `{ path, directory }`.
77
+ */
78
+ export function carve_protected(paths, keep) {
79
+ const result = [];
80
+ for (const path of paths.filter(Boolean)) {
81
+ const rest = keep ? relative(resolve(path), resolve(keep)) : '';
82
+ if (!rest || rest === '..' || rest.startsWith(`..${process.platform === 'win32' ? '\\' : '/'}`) || isAbsolute(rest)) {
83
+ result.push({ path, directory: true });
84
+ continue;
85
+ }
86
+ let current = resolve(path);
87
+ for (const segment of rest.split(/[\\/]/)) {
88
+ let names = [];
89
+ try { names = readdirSync(current); } catch { break; }
90
+ for (const name of names.filter(item => !same_path(join(current, item), join(current, segment)))) {
91
+ result.push({ path: join(current, name), directory: lstatSync(join(current, name)).isDirectory() });
92
+ }
93
+ current = join(current, segment);
94
+ }
95
+ }
96
+ return result;
97
+ }
98
+
72
99
  /** The participant's discussion project directory; workdir is the legacy field name. */
73
100
  export function project_directory(config) { return config.cwd || config.workdir || ''; }
74
101
 
@@ -82,12 +109,16 @@ export function read_json(path) { return existsSync(path) ? JSON.parse(readFileS
82
109
 
83
110
  /**
84
111
  * Windows leaves a killed process's descendants running, so a stopped Claude turn kept its tool commands working.
85
- * End the whole tree there; elsewhere, or when taskkill cannot run, use the plain kill.
112
+ * End the whole tree there; elsewhere, or when taskkill cannot run or fails, use the plain kill. taskkill runs without
113
+ * being waited for: a service stopping many rooms would otherwise block on each tree in turn and miss its stop deadline.
86
114
  */
87
- export function kill_process_tree(child, plain_kill, platform = process.platform, run = spawnSync) {
115
+ export function kill_process_tree(child, plain_kill, platform = process.platform, run = spawn) {
88
116
  if (platform === 'win32' && child.pid && child.exitCode === null && child.signalCode === null) {
89
117
  try {
90
- if (run('taskkill', ['/PID', String(child.pid), '/T', '/F'], { windowsHide: true, timeout: CALL_TIMEOUT_MS }).status === 0) return true;
118
+ const killer = run('taskkill', ['/PID', String(child.pid), '/T', '/F'], { windowsHide: true, stdio: 'ignore' });
119
+ killer.once('error', () => plain_kill());
120
+ killer.once('exit', code => { if (code !== 0) plain_kill(); });
121
+ return true;
91
122
  } catch { /* Fall through to the plain kill. */ }
92
123
  }
93
124
  return plain_kill();