ai_co_discuss 0.5.24 → 0.5.25

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.
@@ -52,8 +52,8 @@ TIMELINE_EXECUTIONS = 100
52
52
  # The event log page reads at most this many room events per call, newest first when paging back.
53
53
  ROOM_EVENT_PAGE = 500
54
54
  # Where the cards of a request (aliased `r`) sit: the room's latest message when it was made (`request_layout`). The
55
- # notice telling the host its own execution failed (`host_failed:<execution>`) takes over that failed card's place and
56
- # start, so the page shows the wake-up there instead of a new card.
55
+ # notice telling the host its own execution failed (`host_failed:<execution>`) stays under the same anchor message as
56
+ # the failed execution, while ordering chronologically below it by its own start time.
57
57
  HOST_FAILED_SQL = """(SELECT CAST(substr(w.key,13) AS INTEGER) FROM free_host_wakes w WHERE r.purpose='notice'
58
58
  AND w.room_id=r.room_id AND w.message_id=r.message_id AND w.key LIKE 'host_failed:%' LIMIT 1)"""
59
59
  LAYOUT_AFTER_SQL = f"""COALESCE((SELECT MAX(l.after_message_id) FROM member_requests f JOIN request_layout l ON l.request_id=f.id
@@ -61,20 +61,9 @@ LAYOUT_AFTER_SQL = f"""COALESCE((SELECT MAX(l.after_message_id) FROM member_requ
61
61
  (SELECT after_message_id FROM request_layout WHERE request_id=r.id),r.message_id)"""
62
62
 
63
63
 
64
- def layout_at_sql(execution_id_sql):
65
- """When the work behind request `r` started for execution `execution_id_sql`.
66
-
67
- Only the first execution on a `host_failed:<id>` wake-up takes over the failed host execution's start time; a retry
68
- of that wake-up starts at its own `created_at` so the new card follows the failed card chronologically.
69
- """
70
- return f"""COALESCE(
71
- CASE WHEN NOT EXISTS(SELECT 1 FROM retried_requests rr WHERE rr.request_id=r.id AND rr.execution_id<{execution_id_sql})
72
- THEN (SELECT created_at FROM member_executions WHERE id={HOST_FAILED_SQL}) END,
73
- (SELECT created_at FROM member_executions WHERE id={execution_id_sql}))"""
74
-
75
-
76
- # When the work behind a request (aliased `r`) started, ordering cards under the same message: its execution's start.
77
- LAYOUT_AT_SQL = layout_at_sql("r.execution_id")
64
+ # When the work behind a request (aliased `r`) started, ordering cards under the same message: its execution's own start
65
+ # time (including `host_failed:<id>` wake-ups, so the failed card stays visible and the wake-up follows below it).
66
+ LAYOUT_AT_SQL = "(SELECT created_at FROM member_executions WHERE id=r.execution_id)"
78
67
  # Rounds used and the owner's additions in the room's recent chains, for "第 2/3 轮"; parameter: the room.
79
68
  # A round is a host dispatch (a batch) or a continue the host asked for (`free_host_wakes` with a `continue:` key); a
80
69
  # relay's later steps in the same pass (`free_relay_steps`) ride on its first, so a whole pass is one round.
@@ -1045,8 +1034,7 @@ def recent_executions(connection, room_id, span=None):
1045
1034
  AND w.message_id IN (SELECT message_id FROM member_requests WHERE execution_id=e.id
1046
1035
  UNION SELECT r.message_id FROM retried_requests rr JOIN member_requests r ON r.id=rr.request_id WHERE rr.execution_id=e.id)
1047
1036
  LIMIT 1) AS replaces_execution_id,
1048
- (SELECT MIN({layout_at_sql("e.id")}) FROM member_requests r WHERE r.execution_id=e.id
1049
- OR r.id IN (SELECT request_id FROM retried_requests WHERE execution_id=e.id)) AS layout_at,
1037
+ e.created_at AS layout_at,
1050
1038
  (SELECT COUNT(*) FROM execution_notes WHERE execution_id=e.id) AS note_count,
1051
1039
  (SELECT COUNT(*) FROM execution_segments WHERE source='free' AND execution_id=e.id
1052
1040
  AND phase IN ('command','tool','editing')) AS step_count,
@@ -3,7 +3,7 @@
3
3
  import json
4
4
  from collections import defaultdict
5
5
 
6
- from .free_room import LAYOUT_AFTER_SQL, layout_at_sql, member_events, require_member, require_owner_or_host
6
+ from .free_room import LAYOUT_AFTER_SQL, member_events, require_member, require_owner_or_host
7
7
 
8
8
 
9
9
  TRACE_PAGE = 50
@@ -138,8 +138,7 @@ def trace_executions(connection, room_id, reader, execution_ids, messages):
138
138
  row = connection.execute(f"""SELECT e.id AS execution_id,e.member_id,e.status,e.created_at,
139
139
  (SELECT MAX({LAYOUT_AFTER_SQL}) FROM member_requests r WHERE r.execution_id=e.id
140
140
  OR r.id IN (SELECT request_id FROM retried_requests WHERE execution_id=e.id)) AS layout_after,
141
- (SELECT MIN({layout_at_sql("e.id")}) FROM member_requests r WHERE r.execution_id=e.id
142
- OR r.id IN (SELECT request_id FROM retried_requests WHERE execution_id=e.id)) AS layout_at,
141
+ e.created_at AS layout_at,
143
142
  t.attempt,t.retry_at,t.stopped,f.failure_class
144
143
  FROM member_executions e LEFT JOIN execution_retries t ON t.execution_id=e.id
145
144
  LEFT JOIN execution_failures f ON f.execution_id=e.id
@@ -51,6 +51,8 @@ While your computer is on and its local service is running, paired phones and ta
51
51
 
52
52
  ## Things to keep in mind
53
53
 
54
+ Phones support portrait layout only. Tablets support both portrait and landscape.
55
+
54
56
  - **Rooms are unavailable when the computer is offline:** If the computer is off, asleep, or its local service is stopped, the room list shows **Rooms (computer offline)** or **Rooms (computer not connected)**. It reconnects when the computer comes back online.
55
57
  - **Timed-out requests are not resent automatically:** If the computer does not respond in time, the page says “Result unconfirmed.”. Check the room to see whether the action took effect before trying again.
56
58
  - **Some changes require the computer:** Changing software executable paths, browsing outside Saved projects, and adding a new device must be done at the computer.
@@ -34,8 +34,8 @@ You can create or import a ZIP file or folder with the “+” on the Workflows
34
34
 
35
35
  - **Ask the host in a room:** Enable “Full host control,” then describe the division of work you want. You can also type / and choose “Create / edit workflow” under platform skills. The host uses the skill to create SKILL.md, role cards, and a canvas, validates them, saves, and enables the workflow. By default, it saves to the room’s main project when there is one, or to the global library otherwise. Ask the host to save it globally if you plan to reuse it across projects.
36
36
  - **Ask an AI in an external session:** In a Claude Code or Codex session with the CoDiscuss skills installed, ask it to create or edit a workflow with workflow-creator. It validates a folder with codiscuss launch workflow-check --dir <directory>. After you approve, it saves the workflow with codiscuss launch workflow-save --dir <directory>. If the library already has that ID, the save is refused unless it explicitly overwrites (--overwrite) or names the revision it read (--revision). For a project workflow, pass `--scope project --project <folder>` when validating and saving.
37
- - **Where workflows are stored.** Global workflows are available across projects and live in `~/.codiscuss/workflows/<id>/`. A project workflow lives in `<project-root>/.codiscuss/workflows/<id>/` and is available in rooms that use that project folder. In the sidebar, “Workflows” lists workflows under “Current project” before “Global”. Open a workflow to see its project name at the top of the editor. A room without a project shows global workflows only.
38
- - **Choose where to save.** Open “+” and select the new or import action for the destination, such as “New global workflow” or “New in project ‘name’”. The editor header shows “Global” or “Project · name”, with a “Read-only” badge where applicable. You can open workflows from read-only projects and copy them to the global library.
37
+ - **Where workflows are stored.** Global workflows are available across projects and live in `~/.codiscuss/workflows/<id>/`. A project workflow lives in `<project-root>/.codiscuss/workflows/<id>/` and is available in rooms that use that project folder. In the sidebar, “Workflows” lists workflows under “Current project” before “Global”. On desktop, open a workflow to see its project name at the top of the editor. A room without a project shows global workflows only.
38
+ - **Choose where to save.** Open “+” and select the new or import action for the destination, such as “New global workflow” or “New in project ‘name’”. On desktop, the editor header shows “Global” or “Project · name”, with a “Read-only” badge where applicable. You can open workflows from read-only projects and copy them to the global library.
39
39
  - **Move, copy, or export.** Open the project workflow’s “…” menu and choose “Move to global” or “Copy to global”. Moving requires a writable source, updates the current room’s binding, and is refused if the global library already has the same ID. Copying keeps the original. Use “Copy to current project” to copy a global workflow when there is one writable project. If several are writable, choose the matching “Copy to project ‘name’” action. Choose “Export” to download a ZIP. The export notice lists files skipped because they were too large or were not text.
40
40
 
41
41
  ### 4. The canvas and SKILL.md
@@ -52,6 +52,8 @@ npm 安装默认提供本机站点,没有随包可直接使用的公共线上
52
52
 
53
53
  ## 要注意什么
54
54
 
55
+ 手机端仅支持竖屏布局。平板可横屏或竖屏使用。
56
+
55
57
  - **电脑离线时看不到房间**:电脑关机、休眠或本机服务未运行时,手机目录标题会显示“协作房间(电脑离线)”或“协作房间(电脑未连接)”;电脑恢复在线后页面自动重连。
56
58
  - **超时不自动重发**:电脑没及时答复时,页面会提示“结果待确认”,不会自动重发;先看房间确认是否已生效。
57
59
  - **只能在电脑上改的项**:软件可执行路径、常用项目范围之外的目录、以及添加新设备,都只能在电脑前操作。
@@ -34,8 +34,8 @@
34
34
 
35
35
  - **在房间里让主持人建**:打开“主持人完整权限”后,直接对主持人说你要什么分工(或说“把这个房间的做法存成工作流”),也可以在输入框打 `/` 选平台技能里的“新建 / 修改工作流”。主持人会调用 `workflow-creator` 生成 `SKILL.md`、角色卡片与画布,校验通过后保存并启用。房间有主项目时默认保存到主项目,否则保存到全局。需要跨项目使用时,可以明确请主持人保存到全局。
36
36
  - **在外部 AI 对话里建**:在任意已装好共议技能的 Claude Code / Codex 窗口,请它按 `workflow-creator` 技能为你新建或修改工作流。它先用 `codiscuss launch workflow-check --dir <目录>` 校验,待你确认后用 `codiscuss launch workflow-save --dir <目录>` 保存。库里已有同 ID 的工作流时,须明确选择覆盖(`--overwrite`)或带上读取时的修订号(`--revision`),否则不会保存。校验与保存项目工作流时,都加上 `--scope project --project <项目目录>`。
37
- - **存在哪里**。全局工作流可跨项目使用,位于 `~/.codiscuss/workflows/<ID>/`。项目工作流位于 `<项目根目录>/.codiscuss/workflows/<ID>/`,可在使用该目录的房间里选用。左栏“工作流”先显示“当前项目”下的工作流,再显示“全局”。可在编辑器顶部查看所属项目。没有项目的房间只显示全局工作流。
38
- - **选择保存位置**。点“+”后按目标位置选择新建或导入项,例如“新建全局工作流”或“新建到项目「项目名」”。编辑器顶部显示“全局”或“项目 · 项目名”,只读项目另标“只读”。只读项目的工作流可以打开查看或复制到全局。
37
+ - **存在哪里**。全局工作流可跨项目使用,位于 `~/.codiscuss/workflows/<ID>/`。项目工作流位于 `<项目根目录>/.codiscuss/workflows/<ID>/`,可在使用该目录的房间里选用。左栏“工作流”先显示“当前项目”下的工作流,再显示“全局”。桌面布局可在编辑器顶部查看所属项目。没有项目的房间只显示全局工作流。
38
+ - **选择保存位置**。点“+”后按目标位置选择新建或导入项,例如“新建全局工作流”或“新建到项目「项目名」”。桌面布局的编辑器顶部显示“全局”或“项目 · 项目名”,只读项目另标“只读”。只读项目的工作流可以打开查看或复制到全局。
39
39
  - **移动、复制与导出**。打开项目工作流的“…”菜单,选择“移至全局”或“复制到全局”。移动要求源项目可写,成功后当前房间的绑定也随之更新。若全局已有同 ID,移动会被拒绝。复制会保留原件。全局工作流可用“复制到本项目”复制到唯一的可写项目。有多个可写项目时,点对应的“复制到项目「项目名」”。点“导出”下载工作流压缩包,导出提示会列出因格式或大小跳过的文件。
40
40
 
41
41
  ### 4. 画布与 `SKILL.md` 的分工
@@ -849,6 +849,7 @@
849
849
  "额度已用尽,预计 {value1} 恢复;给它发新消息会立即再试": "Out of quota, expected back at {value1}; a new message to it is tried at once",
850
850
  "保存(Enter)": "Save (Enter)",
851
851
  "已重试,新的执行接在下方": "Retried; the new run follows below",
852
+ "已自动唤醒处理,新的执行接在下方": "Host woken automatically; the new run follows below",
852
853
  "已修改 {count} 个文件": "Edited {count} files",
853
854
  "其他改动 {count} 个文件": "{count} other changed files",
854
855
  "这次执行运行过命令,这些文件在执行期间有变化,但无法确认是它改的,也可能来自其他窗口或成员。": "This run used commands and these files changed meanwhile, but it can't be confirmed that it changed them. They may come from another window or member.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.5.24",
3
+ "version": "0.5.25",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },