ai_co_discuss 0.6.11 → 0.6.12

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
@@ -6507,6 +6507,31 @@ def dispatch_chain_record(connection, source, events):
6507
6507
  "tokens": tokens, "retried": retried, "host_versions": chain_host_versions(connection, execution_ids)}
6508
6508
 
6509
6509
 
6510
+ def dispatch_review_activity(connection, window):
6511
+ """Count owner activity by its own timestamp, even on a previously reviewed chain."""
6512
+ start, end = window
6513
+ rooms = connection.execute("""WITH bounds AS (
6514
+ SELECT julianday(?) AS start_day, julianday(?) AS end_day
6515
+ ), activity AS (
6516
+ SELECT e.room_id,json_extract(e.data,'$.operation') AS operation
6517
+ FROM room_events e, bounds b WHERE e.kind='dispatch.user_intervention'
6518
+ AND e.at > ROUND((b.start_day-2440587.5)*86400000)
6519
+ AND e.at <= ROUND((b.end_day-2440587.5)*86400000)
6520
+ UNION ALL
6521
+ SELECT m.room_id,f.rating FROM dispatch_feedback f JOIN messages m ON m.id=f.message_id, bounds b
6522
+ WHERE julianday(f.created_at)>b.start_day AND julianday(f.created_at)<=b.end_day
6523
+ UNION ALL
6524
+ SELECT m.room_id,'redirect' FROM messages m, bounds b
6525
+ WHERE julianday(m.created_at)>b.start_day AND julianday(m.created_at)<=b.end_day
6526
+ AND EXISTS(SELECT 1 FROM dispatch_withdrawals w WHERE w.redirect_message_id=m.id)
6527
+ )
6528
+ SELECT a.room_id,a.operation,COUNT(*) AS count FROM activity a
6529
+ JOIN room_directory d ON d.room_id=a.room_id AND d.system_kind=''
6530
+ WHERE a.operation IN ('stop','retract','rewind','redirect','good','bad')
6531
+ GROUP BY a.room_id,a.operation""", (start, end))
6532
+ return {"records": [dict(row) for row in rooms]}
6533
+
6534
+
6510
6535
  def list_dispatch_chains(connection, after, room_id=None, window=(None, None)):
6511
6536
  """Page current task chains by the globally ordered initiating message ID."""
6512
6537
  if not connection.in_transaction:
@@ -8400,7 +8425,8 @@ class DiscussionHandler(BaseHTTPRequestHandler):
8400
8425
  if self.has_explicit_room_token:
8401
8426
  with closing(connect_db(self.server.database)) as connection:
8402
8427
  require_owner(connection, payload.get("room_id", ""), self.headers.get("X-Discussion-Token", ""))
8403
- if command == "settings" and isinstance(payload.get("experience"), dict) and payload["experience"].get("action") == "expiry":
8428
+ if (command == "settings" and isinstance(payload.get("experience"), dict)
8429
+ and payload["experience"].get("action") not in ("list", "dispatches")):
8404
8430
  if self.has_explicit_room_token or self.read_only_request() or any(self.headers.get(header) is not None for header in
8405
8431
  (ACTING_MEMBER_HEADER, PROPOSAL_ACTING_MEMBER_HEADER)):
8406
8432
  raise PermissionError(Text('需要管理员登录'))
@@ -9287,6 +9313,8 @@ class DiscussionHandler(BaseHTTPRequestHandler):
9287
9313
  or not (self.admin_session(connection) or analytics_view and self.bridged)):
9288
9314
  raise AdminError(Text('需要登录管理员账号'), 401)
9289
9315
  view = params.get("view", "chains" if analytics_view else "messages")
9316
+ if view == "review-activity" and not analytics_view:
9317
+ return self.respond(dispatch_review_activity(connection, (params.get("from"), params.get("to"))))
9290
9318
  after = int(params.get("after", 0))
9291
9319
  if view not in ("messages", "chains") or not 0 <= after < 2**63:
9292
9320
  raise ValueError(Text('派活记录的视图或游标无效'))
@@ -54,17 +54,17 @@ Use “History” to bring context from an existing local AI conversation into a
54
54
  - **Model and reasoning effort.** Set these on the back of a member card when creating a room or inviting a member. In an existing room, open **Room → Members and settings** in the tabs at the top of the room and find the member. Change the model or effort, or select “Refresh list” to fetch the catalog again. The slider labels each available level and highlights the current one. “Default” lets the software choose. If effort cannot be adjusted, the same area explains why. Changes take effect on the next run. Software that offers speed tiers (such as Codex CLI) also lets you choose “Speed” in the same place (“Default”, “Standard”, “Fast”, and “Ultrafast”). Options unavailable for the selected model are disabled. Switching models clears an unsupported tier, and “Reset to defaults” returns to the software’s native setting. For app connections, choose the model and effort in the app itself. Where supported, you can switch between CLI and app connections here. A manually connected member that is now woken by this computer shows “Existing session” next to its connection. It keeps its original session’s project access, but you can still change its model and effort here. While its own window is open, tasks go straight into that window and run with the window’s model; this setting applies once the window is closed. Until a change has been used, the model field shows the model that last ran followed by “(set to …, applies from the next run)” or “(set to …, applies once its own window is closed)”.
55
55
  - **Display name and role description.** Open the member menu in the right sidebar and select “Name and description”. When adding a member, use the name and description button on the card. On cards that flip, these settings are on the back. Change the room display name and role description. Inside a room there are quicker ways: double-click a member’s name in the right sidebar or on the members and settings page to rename it in place (Enter or clicking elsewhere saves, Esc cancels). Member rows in the right sidebar do not show descriptions: point at a member with the mouse and its member card floats out on the left with the description and an “Edit name and description” button; on a phone or tablet, tap the member row and the menu that opens shows the description at the top. In the editor, click a common kind of work to add it. The host and smart scheduling use the description to route work. You can also save it as the app’s default description.
56
56
  - **Private prompt.** When creating a room or inviting, flip the member card and select “Expert prompt” on its back. For a member already in the room, open **Room → Members and settings** at the top of the room, find the member, and select “Expert prompt” in the buttons at the bottom of its card. Write instructions for this member alone, such as “Start with the conclusion”; they apply from its next wake-up. This does not change its permissions. A member from a workflow shows its prompt read-only; change it in the workflow. Manually started and external members have no private prompt.
57
- - **Notes for the host, all members or one platform.** These all live on the “Experience” page below MOSS in the sidebar (the former **Settings → System prompts** moved here; Settings keeps one “Moved to Experience” row that jumps here). The page has a column of pages on the left (a row on top when narrow): “Overview” holds the daily review card, everything waiting for you (grouped by source, each marked “Prompt” or “Workflow”) and the 5 latest log entries; the four “Prompts” pages are described next; “Workflow ideas” lists only workflow suggestions and how they were handled, with “View draft” opening the Workflows page; “Log” holds every review. “Preview”: pick a host on a model or a platform’s members to see the parts it reads, in the order the program sends them, each marked with its source and a link to where it is edited; a room’s host strategy, member card notes and workflows are not shown. “Host”: rules for the host, its dispatch strategy. Add, edit, enable, disable or remove them; new rules and all changes go to MOSS for review, handwritten wording that passes unchanged goes live automatically, and AI suggestions, rewrites and merges still need your approval. Up to 20 rules can be enabled, with up to 4,000 characters each, and “Cited in n dispatches” lists the dispatches that cited a rule. Short-term rules show the days left (in warning color on the last day); “End date” in “⋯” changes the date or makes the rule long-term, taking effect at once without a MOSS check. “Members”: “All members” goes to every member this computer wakes, and each platform’s text (Claude, Codex, Gemini and so on) goes to every member on that platform, including a host on it and preset and workflow experts; use “Add” to choose who, and “⋯” to “Edit” or “Clear”. “Built-in” is described below, and “Log” is the review log. Select the rule under “Based on” on a dispatch to open it, or “Not right” to propose a change. These notes come before the private prompt and apply from the next wake-up; the software’s own CLAUDE.md and AGENTS.md are not changed. From the command line, use `codiscuss launch prompts` (`preview` for the preview).
57
+ - **Notes for the host, all members or one platform.** These all live on the “Experience” page below MOSS in the sidebar (the former **Settings → System prompts** moved here; Settings keeps one “Moved to Experience” row that jumps here). The page has a column of pages on the left (a row on top when narrow): “Overview” holds the daily review card, everything waiting for you (grouped by source, each marked “Prompt” or “Workflow”) and the 5 latest log entries; the four “Prompts” pages are described next; “Workflow ideas” lists only workflow suggestions and how they were handled, with “View draft” opening the Workflows page; “Log” holds every review. “Preview” at the top right of “Host” and “Members” opens a side panel: choose a role (host or member), then a model or platform, to see the parts it reads, in the order the program sends them, each marked with its source and a link to where it is edited; a room’s host strategy, member card notes and workflows are not shown. “Host”: rules for the host, its dispatch strategy. Add, edit, enable, disable or remove them; direct edits by the owner take effect immediately without going through MOSS. Up to 20 rules can be enabled, with up to 4,000 characters each, and “Cited in n dispatches” lists the dispatches that cited a rule. Short-term rules show the days left (in warning color on the last day); “End date” in “⋯” changes the date or makes the rule long-term, taking effect at once without a MOSS check. “Members”: “All members” goes to every member this computer wakes, and each platform’s text (Claude, Codex, Gemini and so on) goes to every member on that platform, including a host on it and preset and workflow experts; use “Add” to choose who, and “⋯” to “Edit” or “Clear”. “Built-in” is described below, and “Log” is the review log. Select the rule under “Based on” on a dispatch to open it, or “Not right” to propose a change. These notes come before the private prompt and apply from the next wake-up; the software’s own CLAUDE.md and AGENTS.md are not changed. From the command line, use `codiscuss launch prompts` (`preview` for the preview).
58
58
  - The top of “Experience” is MOSS’s “Daily review” card: when it runs, and when it last ran with what it found (if the latest run did not happen or MOSS has not written back yet, it says so and why, in orange). Select the avatar or “Chat with MOSS” to open MOSS, select “Last run …” to jump to that report, and use the gear to turn “Daily review” on or off; select the large time beside “Time” to open the wheel in place and select it again to close and save, with no separate save button (it follows the display time zone in Settings, shown below). Under “Look at”, turn the “Stepped in often”, “Went well”, “Cost the most” and “Used rules” angles on or off (keep at least one; the program picks up to 6 rooms from the dispatch records); rooms in “Pinned rooms” are always looked at in the next review and then cleared, and you can also choose “Add to next review” in a room’s menu; tick rooms to skip in “Skipped rooms”; under “Suggest”, turn “Experience” and “Workflows” on or off (keep at least one). “Review now” runs once right away without using up today’s scheduled run. Each change saves on its own, and these settings still apply to “Review now” when the schedule is off. Without MOSS set up the card shows “Set up MOSS”. MOSS reviews the rooms you stepped in most each day.
59
- - For a rule suggested below a host reply, choose “Go ahead” to send your original words to MOSS for review, or “No thanks” to dismiss it. While it runs the row says “Checking”. Open “Experience” from the result. The host still prepares workflow drafts.
60
- - In “Waiting for you”, expand a rule to see the before and after, or select “View the full organized draft”. Select “Activate” to confirm. If there is a “Conflict”, compare the rules and the scenario, then choose “Replace”, “Keep both”, or “Discard”. When keeping both, explain when each applies and select “Submit for review”. Select “Retry” after a check fails. Without MOSS set up, rules show “Not checked”; handwritten ones offer “Enable” and are marked “Unreviewed” when active.
59
+ - For a rule suggested below a host reply, choose “Go ahead” to add your original words to the candidates, or “No thanks” to dismiss it. The host still prepares workflow drafts.
60
+ - In “Waiting for you”, expand candidates to compare the original and suggested wording. Select candidates to include them, then submit them together. Your own suggestions start selected. MOSS checks and merges the whole batch, which takes effect together when there are no conflicts. If there is a conflict, choose which rule to keep for each pair and resubmit, or put the batch back. If MOSS is not configured, the selected changes apply as written. You can undo the batch until another ledger edit. Candidates waiting seven days move to the log and can be restored.
61
61
  - Below are three tabs. “Rules” groups rules by origin into “Written by you”, “Learned from reviews” and “Settled”, with “Add” beside “Written by you”. Expand “Sources” on a rule and select “Remove this source” to withdraw one; the rule menu has “Edit”, “Discuss this with MOSS”, “Make durable” and “Delete”, and a settled rule no longer shows its sources. “What the host reads” shows MOSS’s current organized text, where the small number after a sentence is the position of the rule it rests on and opens that rule; without one the host receives the enabled rules one by one. Each row in “Review log” shows the outcome and opens where it happened, and a MOSS review expands to the items it raised. The “Experience” row in the MOSS window’s right panel leads back here.
62
- - Daily reviews are grouped by report. Select the group title or summary to expand the report in place, or the jump icon on the right (“In MOSS”) to open the original. After opening a source message from Experience, use the return button at the bottom to restore your tab and reading position, or select × to stay in the room. You can still choose if the room takes too long to load. Under each waiting rule, labels such as “New” sit on the left and “Activate” and “⋯” on the right.
62
+ - Daily reviews are grouped by report. Select the group title or summary to expand the report in place. It stays open after being marked as read. Select the title again to collapse it, or use the jump icon on the right (“In MOSS”) to open the original. After opening a source message from Experience, use the return button at the bottom to restore your tab and reading position, or select × to stay in the room. You can still choose if the room takes too long to load. Under each waiting rule, labels such as “New” sit on the left and the selection button and “⋯” on the right.
63
63
  - A scheduled MOSS review, and the host’s answer to “/Summarize lessons”, have a “Results of this review” section that only you can see. It shows each item and its current status. Select the row to open the corresponding item.
64
64
  - After stopping, withdrawing, or rewinding, select “Add a reason” if it appears on the card. On a dispatch card, open its actions menu and select “Add a reason for withdrawing or reassigning”. The reason is optional. Once saved, it appears on the original card, and you can edit it from the same action.
65
- - Type “/” in a room and choose “Summarize lessons”. Add a focus to cover only that topic. The host can submit up to five suggestions and replies with the counts, categories, and review link. After MOSS checks them, review them under “Awaiting confirmation” in Experience. Dispatch rules can be added, edited, or removed. Rules with an explicit deadline turn off automatically and remain in the history. Confirming a room strategy appends it to that room. Use the Workflows page to follow up on an approved workflow suggestion.
65
+ - Type “/” in a room and choose “Summarize lessons”. Add a focus to cover only that topic. The host can submit up to five suggestions and replies with the counts, categories, and review link. Review the candidates under “Awaiting confirmation” in Experience before submitting them for a merge. Dispatch rules can be added, edited, or removed. Rules with an explicit deadline turn off automatically and remain in the history. Confirming a room strategy appends it to that room. Use the Workflows page to follow up on an approved workflow suggestion.
66
66
  - To change a deadline, run `codiscuss launch experience expiry --id ID --at ISO` with a time zone. Use `--clear` instead of `--at ISO` to remove the deadline. Changing a deadline does not re-enable a disabled rule.
67
- - Use `codiscuss launch experience list` to inspect rules. Pass a JSON file containing `text` with `add|edit --file FILE`. Use `--id ID` with `edit|remove|enable|disable|accept|reject`. The legacy `launch prompts get/set host` command addresses the migrated global paragraph. Additions and edits go to MOSS for review. Run `launch experience list` to check their progress. Only when MOSS is not configured can the owner explicitly enable their own draft with `launch experience direct-enable --id ID`. AI suggestions cannot use this fallback.
67
+ - Use `codiscuss launch experience list` to inspect rules. Pass a JSON file containing `text` with `add|edit --file FILE`. Use `--id ID` with `edit|remove|enable|disable|accept|reject`. The legacy `launch prompts get/set host` command addresses the migrated global paragraph. Direct edits take effect immediately. To create a candidate, use `launch experience suggest --file JSON`. Read `entries_revision` with `list`, include it and the candidate `ids` in a JSON file, and run `launch experience merge --file JSON`. Undo with `undo-merge --id ID`.
68
68
  - **Manage host model rules.** “Host rules” in the Experience page’s “Built-in” tab lists the program’s rules for hosts on each model. Turn each on or off; “⋯” has “Edit”, “Reset” (changed rules are marked “Edited”) and “Write another”. “Write another” starts a rule of your own, kept under “By model” at the bottom of the “Host” tab, where you can turn it on or off, edit or delete it. “Fixed rules · Read-only” lists what the program always adds for each software; open a row to see the original text. Rules stay on this computer and can be managed from paired devices. They apply from the next execution of a matching host model, including its effort variants. If the software’s last successful model catalog on this computer does not list a returning member’s model, refresh the catalog or choose a listed model before bringing the member back.
69
69
  - **Host strategy for a room.** Keep long-term model preferences and routing habits in the global “Host” system prompt, and use “Host strategy” under **How to work (optional)** when creating a room or under **Room → Collaboration settings** in an existing ordinary room to tune a specific room’s pacing and review effort. Choose from built-in “Balanced”, “Fast”, “Thorough”, and “Save tokens” presets (“Balanced” by default, following your global host prompt) or any personal strategy saved on this computer. Select “Edit” to customize it for the current room or save it as a personal strategy for reuse across rooms; in the expanded editor, select “×” on a personal strategy chip to remove it. Editing or deleting a personal strategy does not alter rooms already running. Only the room owner can change a room’s host strategy; changes apply from the host’s next run without interrupting active work and are available on paired devices as well. From the command line, use `codiscuss room host-strategy` and `codiscuss launch strategies`.
70
70
 
@@ -122,6 +122,6 @@ Manage the Steward, Direct messages, and group windows separately. Open the wind
122
122
  - The “MOSS” section in “Analytics” shows task and project rooms created, work sent to existing rooms, rework, missing reports, work brought back to the main conversation, and run counts and durations. It also shows how often notification channels sent a queued-message acknowledgment.
123
123
  - For terminal use, see [Command Line](cli.md#platform-steward).
124
124
 
125
- Daily review in Experience appears in the MOSS duty list and can be removed there. After sleep, shutdown, or a service outage, it catches up only the latest missed review, with at most one run per calendar day in the schedule’s time zone. The brief goes through the duty’s delivery channel. It starts with the conclusion and shows the review window in the time zone saved in the review settings. For an unread review, select “Report” or “In MOSS” in “Experience”. The “Results of this review” section under the scheduled report shows whether each suggestion is checking, awaiting confirmation, or in conflict. Choose any of four review lenses: more interventions, went well, higher cost, or cited experience. The first two are selected by default. CoDiscuss picks up to six rooms in total. Rooms you pin are included in addition to those six, and their pins clear when the review is recorded successfully. A room cannot be both pinned and excluded. You can turn experience and workflow suggestions off independently. Each review looks back to the last successfully recorded review, up to seven days. The first review covers 24 hours. “Run review now” does not count toward the daily schedule. Scheduled reviews skip rooms summarized in the last seven days unless a new dispatch followed the summary or you pinned the room.
125
+ Daily review in Experience appears in the MOSS duty list and can be removed there. After sleep, shutdown, or a service outage, it catches up only the latest missed review, with at most one run per calendar day in the schedule’s time zone. The brief goes through the duty’s delivery channel. It starts with the conclusion and shows the review window in the time zone saved in the review settings. For an unread review, select “Report” or “In MOSS” in “Experience”. The “Results of this review” section under the scheduled report lists the candidates. They do not change live rules until you select and submit them. Choose any of four review lenses: more interventions, went well, higher cost, or cited experience. The first two are selected by default. CoDiscuss picks up to six rooms in total. Rooms you pin are included in addition to those six, and their pins clear when the review is recorded successfully. A room cannot be both pinned and excluded. You can turn experience and workflow suggestions off independently. Each review looks back to the last successfully recorded review, up to seven days. The first check looks back 24 hours. A scheduled review wakes MOSS only if there are at least three new task chains with dispatches, you intervened or rated a dispatch, or you pinned a room. If activity is below the threshold, it skips the run, keeps the accumulated activity for next time, and does not count it as a failure. MOSS can also record why it has no suggestions. “Run review now” bypasses this threshold and does not count toward the daily schedule. Scheduled reviews skip rooms summarized in the last seven days unless a new dispatch followed the summary or you pinned the room.
126
126
 
127
127
  From the CLI, run `codiscuss launch experience review status|on|off|set|run`. For example, `codiscuss launch experience review set --workflow off --lenses smooth` looks for what went well without suggesting workflows. Set the schedule with `--at HH:MM` and `--timezone IANA`. If no time zone has been set, it uses the computer’s system time zone.
@@ -54,17 +54,17 @@
54
54
  - **改模型与思考强度**:新建房间或邀请时在成员卡背面设置;已有房间在顶部“房间”页 → “成员与设置”里找到该成员,调整模型、思考强度,或点“刷新列表”重新读取模型列表(更改从下一次执行生效)。弹窗的滑条会标出可选档位并高亮当前档,“默认”表示由软件决定;不能调整时会在同一位置说明原因。支持速度档位的软件(如 Codex CLI)可在同一处调整“速度”(“默认”“标准”“Fast”“Ultrafast”;所选模型不支持的档位置灰,切模型会自动清空不兼容的档位,“恢复默认”回到软件原生设置)。App 接入的成员在原 App 聊天里选模型与强度,网页不覆盖。支持切换入口的软件也可在这里切换 CLI 与 App。由手动接入转为本机唤醒的成员,“接入”后会标“接管已有会话”:它的项目权限沿用原会话,模型与思考强度同样可以在这里改;但它自己的窗口开着时,任务会直接发进那个窗口,用的是窗口里的模型,关掉窗口后才按这里的设置运行。改过还没用上时,模型一栏在上次实际所用的模型后标“(设置为 …,下次生效)”或“(设置为 …,它自己的窗口关闭后生效)”。
55
55
  - **改显示名与分工描述**:右栏 → 成员菜单 → “名称与描述”(建房或邀请时点成员卡的名称与描述按钮,可翻面的卡片在背面设置),修改房间里的“显示名称”和分工说明。在房间里还有更快的入口:双击右栏或“成员与设置”页里的成员名称直接改名(Enter 或点别处保存,Esc 取消)。右栏的成员行不显示描述:鼠标指向某位成员,左侧浮出它的成员卡片,显示描述,并可点“编辑名称与描述”;手机、平板上点一下成员行,弹出的菜单顶部显示描述。编辑框里可点常见分工快速填入。分工说明会发给主持人和智能调度,帮助更准确地派活,也可存为该软件的默认描述。
56
56
  - **设专属提示词**:建房或邀请时翻开成员卡,点背面的“专属提示词”按钮;已在房间里的成员,在顶部“房间”页 → “成员与设置”里找到该成员,点卡片下方的“专属提示词”按钮。写下只发给这位成员的要求(例如“回答先给结论”),从下一次唤醒起生效。专属提示词不改变权限;来自工作流的成员只读,要到工作流里改。手动启动和外部成员没有专属提示词。
57
- - **给主持人、所有成员或某个平台写提示**:都在左栏 MOSS 下方的“经验”页(原“设置 → 系统提示词”已移到这里,设置里只留一行“已移到经验”的跳转)。页面左边一列导航(窄屏时收到顶部一排):“总览”是每日复盘状态卡、全部待你确认(按来源分组,每条标“提示词”或“工作流”)和最近 5 条记录;“提示词”一组四行如下;“工作流建议”只列工作流类建议和已处理结果,点“查看草稿”到工作流页改;“记录”是全部复盘记录。“预览”选一个对象(某模型的主持人或某平台的成员),按程序实际发送的顺序列出它读到的各段,每段标明来源,点右上角跳到对应位置去改,房间里选的主持策略、成员卡片上的提示和工作流另算;“主持人”是给主持人的经验(调度策略),添加、编辑、启停、删除,新增和修改先交 MOSS 检查,你手写的原文通过且未被改写会自动生效,AI 建议、改写和合并仍须确认,总计最多启用 20 条,每条最多 4000 字,“n 次派活引用”点开列出引用过它的派活,短期经验显示“还剩 n 天”(最后一天变警告色),“⋯”里的“期限”可改到期日或“改成长期”,改期限立即生效、不经 MOSS 检查,也不会重新启用已停用的经验;“成员”里“所有成员”一段发给本机唤醒的全部成员,各平台一段(Claude、Codex、Gemini 等)发给用该平台的全部成员,包括同平台的主持人、预设和工作流里的专家,点“添加”选对象,“⋯”里可“编辑”“清空”;“内置”见下一条;“记录”是复盘记录。派活卡“派活依据”一行可点进对应经验,点“这条不对”可提交修改。这些提示排在专属提示词之前,从下一次唤醒起生效;不修改各软件自己的 CLAUDE.md、AGENTS.md。命令行用 `codiscuss launch prompts`(`preview` 查看预览)。
57
+ - **给主持人、所有成员或某个平台写提示**:都在左栏 MOSS 下方的“经验”页(原“设置 → 系统提示词”已移到这里,设置里只留一行“已移到经验”的跳转)。页面左边一列导航(窄屏时收到顶部一排):“总览”是每日复盘状态卡、全部待你确认(按来源分组,每条标“提示词”或“工作流”)和最近 5 条记录;“提示词”一组四行如下;“工作流建议”只列工作流类建议和已处理结果,点“查看草稿”到工作流页改;“记录”是全部复盘记录。“主持人”“成员”页右上角的“预览”打开侧边面板:先选身份(主持人或成员),再选模型或平台,按程序实际发送的顺序列出它读到的各段,每段标明来源,点右上角跳到对应位置去改,房间里选的主持策略、成员卡片上的提示和工作流另算;“主持人”是给主持人的经验(调度策略),添加、编辑、启停、删除,房主直接编辑立即生效,不经 MOSS,总计最多启用 20 条,每条最多 4000 字,“n 次派活引用”点开列出引用过它的派活,短期经验显示“还剩 n 天”(最后一天变警告色),“⋯”里的“期限”可改到期日或“改成长期”,改期限立即生效、不经 MOSS 检查,也不会重新启用已停用的经验;“成员”里“所有成员”一段发给本机唤醒的全部成员,各平台一段(Claude、Codex、Gemini 等)发给用该平台的全部成员,包括同平台的主持人、预设和工作流里的专家,点“添加”选对象,“⋯”里可“编辑”“清空”;“内置”见下一条;“记录”是复盘记录。派活卡“派活依据”一行可点进对应经验,点“这条不对”可提交修改。这些提示排在专属提示词之前,从下一次唤醒起生效;不修改各软件自己的 CLAUDE.md、AGENTS.md。命令行用 `codiscuss launch prompts`(`preview` 查看预览)。
58
58
  - “经验”页顶部是 MOSS 的“每日复盘”卡:显示每天几点、上次复盘的时间和结果(最近一次没跑成或还在等 MOSS 写回时,改为用橙色写明时间和原因),点头像或“和 MOSS 聊”打开 MOSS,点“上次……”跳到那次汇报,齿轮里开关“每日复盘”;点“时间”右侧的大号时刻在原处展开滚轮,再点一次收起并保存,不需要另点保存(按“设置”里的显示时区计算,下方写明当前时区)。“看什么”里可开关“介入多的”“做得好的”“花得多的”“用过经验的”四个角度(至少留一个,程序按派活记录挑房间,合计最多 6 个);“指定的房间”下次复盘一定看、看过就清掉,也可以在房间菜单里点“加入下次复盘”;“不看的房间”里勾选要跳过的房间;“提什么”里分别开关“经验”和“工作流”(至少留一个);“立即复盘”马上跑一次,不占当天的定时。每项改完即保存,关掉定时后这些设置仍对“立即复盘”生效。没配置 MOSS 时这里显示“配置 MOSS”。MOSS 每天复盘你介入较多的房间。
59
- - 主持人回答下出现“想记下”时,点“去做”把原话交给 MOSS 检查,点“不用”忽略。回交前会显示“检查中”,有结果后从原处点进“经验”。工作流意图仍由主持人准备。
60
- - 在“待你确认”展开待确认的经验,查看修改前后或点“查看整理稿全文”,再点“生效”。若显示“有冲突”,查看新旧原文和冲突场景,然后选“替换”“都保留”或“放弃”。选“都保留”时,写明各自的适用场景并点“提交检查”。“检查失败”时可点“重试”。没配置 MOSS 时条目显示“未检查”,手写条目可点“启用”,生效后标记“未经整理”。
59
+ - 主持人回答下出现“想记下”时,点“去做”把有依据的原话放入待选候选,点“不用”忽略。工作流意图仍由主持人准备。
60
+ - 在“待你确认”展开候选查看原文和建议,再点“采纳”勾选。你写的候选默认勾选。点“提交”才把选中的条目交给 MOSS 合并,无冲突时一起生效,可查看整段对比。遇到冲突时选择每处留下哪一句,再提交或放回。没配置 MOSS 时照原样应用。只有合并后没有再改过账本,才能整批撤销。七天未处理的候选进入“记录”,可放回。
61
61
  - 页面下方有三个标签:“经验”按来源分为“你写的”“从复盘学到的”“已沉淀”,“添加”在“你写的”一组的右侧;每条可展开“出处”,每处可点“撤掉这处依据”,菜单里有“编辑”“和 MOSS 聊这条”“沉淀”“删除”,沉淀后不再显示出处。“主持人读到的”显示 MOSS 当前的整理稿,句尾的小编号是这句依据的经验在列表里的序号,点了跳到那条,没有可用整理稿时主持人按条收到启用的经验。“复盘记录”每行显示结果,可点到原处,MOSS 的复盘可展开看当次提出的条目。MOSS 窗口右栏的“经验”一行也能回到这里。
62
- - 每日复盘按组显示。点组标题或摘要在原处展开报告,点右侧的跳转图标(“MOSS 记录”)到原汇报。从经验页打开来源消息后,可点底部的“返回「经验」”回到原标签和阅读位置,或点 × 留在房间。房间加载超时也可自行选择。每条待确认的经验下方一行,左边是“新增”等标签,右边是“生效”和“⋯”。
62
+ - 每日复盘按组显示。点组标题或摘要在原处展开报告,标记已读后仍保持展开,再点标题即可收起。点右侧的跳转图标(“MOSS 记录”)到原汇报。从经验页打开来源消息后,可点底部的“返回「经验」”回到原标签和阅读位置,或点 × 留在房间。房间加载超时也可自行选择。每条待确认的经验下方一行,左边是“新增”等标签,右边是勾选用的“采纳”和“⋯”。
63
63
  - MOSS 的定时复盘汇报下方,以及主持人回答“/总结经验”的那条回答下方,有“本次产出”(只有你看得到)。每项显示内容和当前状态,点整行打开对应条目。
64
64
  - 停止、撤回或回退后,如果卡片显示“补记原因”,可点开填写。在派活卡的“更多操作”菜单里选“补充撤回或改派原因”。原因选填,保存后可在原卡片看到,再点同一入口即可修改。
65
- - 在房间输入“/”,选择“总结经验”。可加方向,只总结这个方向。主持人最多提五条,房间回答只列条数、类别和确认链接。建议先经 MOSS 检查,再到经验页“待你确认”处理。调度经验可新增、修改或删除。明确截止时间的短期经验到期自动停用,记录仍保留。确认房间策略建议会追加到对应房间,工作流建议确认后到工作流页处理。
65
+ - 在房间输入“/”,选择“总结经验”。可加方向,只总结这个方向。主持人最多提五条,房间回答只列条数、类别和确认链接。建议直接进入经验页“待你确认”,由你勾选并批量提交。调度经验可新增、修改或删除。明确截止时间的短期经验到期自动停用,记录仍保留。确认房间策略建议会追加到对应房间,工作流建议确认后到工作流页处理。
66
66
  - 命令行改期限用 `codiscuss launch experience expiry --id ID --at ISO`,时间须带时区。用 `--clear` 代替 `--at ISO` 可改成长期。
67
- - 命令行用 `codiscuss launch experience list` 查看,`add|edit --file FILE` 读取含 `text` 的 JSON;`edit|remove|enable|disable|accept|reject` 用 `--id ID` 指定条目或建议。`launch prompts get/set host` 仅操作旧提示词迁移的全局条目。新增和编辑先交 MOSS 检查;`launch experience list` 可查看待入库状态。只有未配置 MOSS 时,房主才可用 `launch experience direct-enable --id ID` 明确启用自己写的待入库条目,AI 建议不能走这一步。
67
+ - 命令行用 `codiscuss launch experience list` 查看,`add|edit --file FILE` 读取含 `text` 的 JSON;`edit|remove|enable|disable|accept|reject` 用 `--id ID` 指定条目或建议。`launch prompts get/set host` 仅操作旧提示词迁移的全局条目。直接编辑即时生效。用 `launch experience suggest --file JSON` 添加候选。用 `list` 读取 `entries_revision`,把它和候选 `ids` 一起写进 JSON,再用 `launch experience merge --file JSON` 提交;用 `undo-merge --id ID` 撤销合并。
68
68
  - **管理主持模型规则**:经验页“内置”标签的“主持规则”列出程序给各模型主持人的规则,可开关,“⋯”里可“编辑”“重置”(改过的标“已改”)、“另写一条”;“另写一条”写的是你自己的规则,放在“主持人”标签最下面的“按模型”一组,可开关、编辑、删除。“固定规则 · 只读”是程序给各软件固定附加的规则,点开可看原文。规则保存在本机,已配对设备也可管理,从匹配模型的主持人下一次执行起生效,包括该模型的思考强度变体。请回成员时,若本机软件上次成功读取的模型目录未列出该模型,请先刷新目录或换成可用模型,再请回。
69
69
  - **设定房间的主持策略**:经验页“主持人”标签里的经验适合写长期的模型搭配与选人偏好;若想按房间单独控制推进节奏与审查投入,可在新建房间“协作方式(可选)”或已有普通房间“房间”页 → “协作设置”的“主持策略”一行选择内置的“均衡”“求快”“深入”“省 Token”四档,或选用自己保存的本机个人策略(默认“均衡”直接沿用全局主持人提示词)。点右侧“编辑”可为当前房间临时自定义,也可在编辑区“存为个人策略”跨房间复用,展开态下点个人策略胶囊上的“×”即可删除;修改或删除个人策略不影响已在运行中的房间。主持策略只能由房主修改,从主持人下一次接活起生效、不打断进行中的执行,已配对设备与本机对等可用。命令行用 `codiscuss room host-strategy` 与 `codiscuss launch strategies`。
70
70
 
@@ -120,6 +120,6 @@ MOSS 在群里等你答复时,你可以引用那条提问或 @ MOSS。有智
120
120
  - 在“统计”的“MOSS”一节,可看新建任务房间和项目房间、委派给已有房间、返工、未回报、改回主对话,以及执行次数和时长。这里也会显示通知渠道发送的排队回执次数。
121
121
  - 使用命令行时,见[命令行](cli.md#平台主理人)。
122
122
 
123
- 经验页的“每日复盘”是定时职责,能在 MOSS 职责列表里删除。电脑睡眠、关机或服务停止而错过时,恢复后只补跑最近一次,按计划时区每天最多一次。简报沿用职责的渠道,第一行写结论,范围用保存复盘设置时的显示时区。未读复盘在“经验”页可点“报告”或“MOSS 记录”,定时汇报下方的“本次产出”会显示建议的入库状态,如检查中、待确认或有冲突。复盘可从介入多、做得好、花得多、用过经验四个角度多选,默认前两个。程序最多挑六个房间,另可指定下次必看的房间,成功写回复盘后清掉本次指定。排除的房间不能同时指定,也可分别关闭经验或工作流建议。范围从上次成功写回的复盘算起,最多回看 7 天,首次只看 24 小时。“立即复盘”不占当天的定时复盘。定时复盘默认跳过最近七天已做过房间总结、且之后没有新派活的房间;指定房间仍会纳入。
123
+ 经验页的“每日复盘”是定时职责,能在 MOSS 职责列表里删除。电脑睡眠、关机或服务停止而错过时,恢复后只补跑最近一次,按计划时区每天最多一次。简报沿用职责的渠道,第一行写结论,范围用保存复盘设置时的显示时区。未读复盘在“经验”页可点“报告”或“MOSS 记录”,定时汇报下方的“本次产出”会显示本次提出的候选,勾选提交前不会改动规则。复盘可从介入多、做得好、花得多、用过经验四个角度多选,默认前两个。程序最多挑六个房间,另可指定下次必看的房间,成功写回复盘后清掉本次指定。排除的房间不能同时指定,也可分别关闭经验或工作流建议。范围从上次成功写回复盘算起,最多回看 7 天。首次检查回看 24 小时。新派活任务链满 3 条、有你的停止、撤回、回退、改派或评价,或指定了下次必看的房间,定时复盘才唤醒 MOSS。活动不足时跳过,下次继续累计,不算失败。MOSS 醒来但没有值得提的,也可说明原因并不提建议。“立即复盘”不受门槛限制,也不占当天定时。定时复盘默认跳过最近七天已做过房间总结、且之后没有新派活的房间;指定房间仍会纳入。
124
124
 
125
125
  命令行用 `codiscuss launch experience review status|on|off|set|run`。例如 `codiscuss launch experience review set --workflow off --lenses smooth` 只看做得好的房间且不建议工作流。可用 `--at HH:MM`、`--timezone IANA` 设置计划时间,没指定过时区时按电脑系统时区。
@@ -1290,5 +1290,56 @@
1290
1290
  "{count} 条待确认": "{count} waiting",
1291
1291
  "最近": "Recent",
1292
1292
  "已处理": "Handled",
1293
- "还没有工作流建议。": "No workflow ideas yet."
1293
+ "还没有工作流建议。": "No workflow ideas yet.",
1294
+ "看主持人实际读到的全文": "See everything the host reads",
1295
+ "看成员实际读到的全文": "See everything members read",
1296
+ "身份": "Role",
1297
+ "采纳后立即生效": "Takes effect as soon as you accept",
1298
+ "采纳": "Accept",
1299
+ "MOSS 复查中": "MOSS rechecking",
1300
+ "MOSS 没有完成合并。": "MOSS didn't finish the merge.",
1301
+ "等待 MOSS 超时。": "Timed out waiting for MOSS.",
1302
+ "规则在合并时变了,请重试。": "The rules changed during the merge. Try again.",
1303
+ "没有送到 MOSS,请检查软件登录或额度。": "It didn't reach MOSS. Check the software's sign-in or quota.",
1304
+ "还没有配置 MOSS。": "MOSS isn't set up yet.",
1305
+ "合并中 · {count} 条": "Merging · {count}",
1306
+ "已生效 · {count} 条": "In effect · {count}",
1307
+ "有冲突 · 没有生效": "Conflict · not applied",
1308
+ "没合并成": "Merge failed",
1309
+ "一般几十秒,可以先去做别的": "Usually tens of seconds; carry on meanwhile",
1310
+ "{time} · 主持人下次被唤醒起读到": "{time} · the host reads it from its next wake-up",
1311
+ "有几处和现有规则说法相反": "Some points contradict the current rules",
1312
+ "整批退回,这几条回到列表": "Undo the whole batch; these go back to the list",
1313
+ "之后又改过,不能整批撤销": "Changed since, so the batch can't be undone",
1314
+ "改了 {count} 句": "{count} changed",
1315
+ "加了 {count} 句": "{count} added",
1316
+ "删了 {count} 句": "{count} removed",
1317
+ "其余 {count} 句没变 · 全文": "{count} unchanged · full text",
1318
+ "合并前": "Before",
1319
+ "合并后": "After",
1320
+ "候选": "Candidate",
1321
+ "现在的规则": "Current rule",
1322
+ "放回": "Put back",
1323
+ "再提交": "Resubmit",
1324
+ "明天收起": "Tucked away tomorrow",
1325
+ "已选": "Chosen",
1326
+ "原文": "Original",
1327
+ "理由": "Reason",
1328
+ "建议改为": "Suggested",
1329
+ "上一批处理完才能再提交": "Wait for the last batch to finish",
1330
+ "还没选": "Nothing chosen",
1331
+ "已选 {count} 条 · 交给 MOSS 合并后生效": "{count} chosen · in effect after MOSS merges",
1332
+ "已选 {count} 条 · 原样加入,不合并": "{count} chosen · added as is, no merge",
1333
+ "改动": "Changes",
1334
+ "MOSS 合并 · {count} 条 · 已生效": "MOSS merge · {count} · in effect",
1335
+ "MOSS 合并 · {count} 条 · 已撤销": "MOSS merge · {count} · undone",
1336
+ "合并前:{text}": "Before: {text}",
1337
+ "合并后:{text}": "After: {text}",
1338
+ "你改了“{text}”": "You changed “{text}”",
1339
+ "改前:{text}": "Before: {text}",
1340
+ "改后:{text}": "After: {text}",
1341
+ "{text} · 没采纳": "{text} · not taken",
1342
+ "7 天没处理,收起 {count} 条": "Untouched for 7 days, {count} tucked away",
1343
+ "{date} 没有新活动,跳过": "{date} nothing new, skipped",
1344
+ "新任务链 {chains} 条,介入 {interventions} 次,不到唤醒门槛": "{chains} new task chains, {interventions} interventions: below the wake threshold"
1294
1345
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.6.11",
3
+ "version": "0.6.12",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -133,7 +133,8 @@ function role_tools(context) {
133
133
  { action: TEXT, room_id: TEXT, message_id: NUMBER, review_id: NUMBER, text: TEXT, scope: TEXT, id: TEXT, remove: { type: 'boolean' }, after: NUMBER, view: TEXT,
134
134
  attempt: TEXT, entries_revision: TEXT, outcome: TEXT, merge_into: TEXT,
135
135
  sections: { type: 'object', properties: { requirements: { type: 'array', items: TEXT }, delegation: { type: 'array', items: TEXT }, progress: { type: 'array', items: TEXT } } },
136
- conflicts: { type: 'array', items: { type: 'object', properties: { id: TEXT, scenario: TEXT } } },
136
+ rules: { type: 'array', items: { type: 'object', properties: { id: TEXT, text: TEXT, merge_ids: { type: 'array', items: TEXT } } } },
137
+ conflicts: { type: 'array', items: { type: 'object', properties: { id: TEXT, left_id: TEXT, right_id: TEXT, scenario: TEXT } } },
137
138
  kind: TEXT, workflow: TEXT, update: TEXT, extra_sources: { type: 'array', items: { type: 'object', properties: { room_id: TEXT, message_id: NUMBER } } } }, ['action']));
138
139
  if (context.experience_access) tools.push(tool('propose_experience', t('建议须引用本房间的用户消息或派活记录。房主主动总结时,先核实来源,再提交发起消息编号与建议列表。'),
139
140
  { message_id: NUMBER, text: TEXT, scope: TEXT, id: TEXT, action: TEXT, stage: TEXT, intent: TEXT, complete: { type: 'boolean' }, kind: TEXT, workflow: TEXT,
@@ -42,7 +42,7 @@ import { stt_part } from './stt.mjs';
42
42
  import { image_check, image_settings, MODEL_ID, native_image_platforms, room_image, save_image_settings, validate_image_limits } from './image_service.mjs';
43
43
  import { open_project } from './adapters/api_files.mjs';
44
44
  import { redact_media_text, run_image_tool } from './adapters/api_images.mjs';
45
- import { active_suggestions, admission_view, change_managed_experience, experiences, has_expired_entries, legacy_text, normalize_experience_expiry, queue_legacy_experience } from './host_experience.mjs';
45
+ import { active_suggestions, admission_view, change_managed_experience, experience_suggestions, experiences, has_expired_entries, legacy_text, needs_experience_maintenance, normalize_experience_expiry, set_legacy_experience } from './host_experience.mjs';
46
46
  import { access_levels, BUILTIN_EXPERT_PRESETS, BUILTIN_HOST_STRATEGIES, CODEX_IMAGE_PRESET, MAX_EXPERT_PROMPT, PROJECT_ACCESS } from './expert_prompts.mjs';
47
47
  import { acquire_lock, api, check_extra_directories, DiscussionStore, overlapping_directories, room_media_fields, service_drafts, validate_config } from './discussion_runner.mjs';
48
48
  import { room_video, save_video_settings, validate_video_limits, video_check, video_settings } from './video_service.mjs';
@@ -229,6 +229,13 @@ const help_text = () => `用法:codiscuss launch settings [--file FILE]
229
229
  [--at HH:MM] [--timezone IANA] [--rule on|off] [--workflow on|off]
230
230
  [--lenses friction,smooth,costly,used_rules] [--exclude-rooms ROOM1,ROOM2] [--pin-rooms ROOM1,ROOM2]
231
231
  ${t('所有经验均为全局。添加或编辑时,JSON 文件填 text。')}
232
+ codiscuss launch experience suggest --file JSON [--id EXISTING_ID]
233
+ codiscuss launch experience select --file JSON
234
+ codiscuss launch experience merge --file JSON
235
+ codiscuss launch experience retry-merge --id BATCH_ID --file JSON
236
+ codiscuss launch experience undo-merge|release-merge --id BATCH_ID
237
+ codiscuss launch experience restore-candidate --id CANDIDATE_ID
238
+ ${t('先用 experience list 读取账本版本;merge 的 JSON 填 ids 与 entries_revision。')}
232
239
  codiscuss launch experience expiry --id ID (--at ISO | --clear)
233
240
  ${t('只修改期限,不重新启用已停用的经验。')}
234
241
  codiscuss launch experience confirm|resolve|direct-enable|retry|revoke-source|distill --id ID [--file JSON]
@@ -1537,11 +1544,11 @@ function experience_view(home, state) {
1537
1544
  } finally { db.close(); }
1538
1545
  }
1539
1546
  const review = experience_review_status(home);
1540
- return { revision: state.revision || 0, ...admission_view(state, review.configured), entries: state.entries.map(item => ({ ...item, scope: 'global', ...usage.find(row => row.experience_id === item.id) })), suggestions: active_suggestions(state).map(item => ({ ...item, scope: 'global' })), reviews: state.reviews || [], history: state.history || [], seen_reviews: state.seen_reviews || [], review };
1547
+ return { revision: state.revision || 0, ...admission_view(state, review.configured), entries: state.entries.map(item => ({ ...item, scope: 'global', ...usage.find(row => row.experience_id === item.id) })), suggestions: experience_suggestions(state).map(item => ({ ...item, scope: 'global' })), reviews: state.reviews || [], history: state.history || [], seen_reviews: state.seen_reviews || [], review };
1541
1548
  }
1542
1549
 
1543
1550
  function has_expired_experience(state) {
1544
- return has_expired_entries(state) || active_suggestions(state).length !== state.suggestions.length;
1551
+ return has_expired_entries(state) || needs_experience_maintenance(state) || active_suggestions(state).length !== state.suggestions.length;
1545
1552
  }
1546
1553
 
1547
1554
  const EXPERIENCE_DISPATCH_DEFAULT = 30;
@@ -1951,7 +1958,10 @@ async function moss_admission(home, current, access, input) {
1951
1958
  write_admission(home, { ...input, action: 'admission-refresh' });
1952
1959
  return { superseded: true };
1953
1960
  }
1954
- return { job: fresh, entries: state.entries, organized: view.organized, entries_revision: view.entries_revision };
1961
+ const batch = state.admissions.find(row => row.id === fresh.id);
1962
+ const merge = batch.operation === 'merge' ? { staged_entries: batch.staged_entries,
1963
+ candidates: experience_suggestions(state).filter(row => batch.candidate_ids.includes(row.id)) } : {};
1964
+ return { job: fresh, entries: state.entries, organized: view.organized, entries_revision: view.entries_revision, ...merge };
1955
1965
  }
1956
1966
  const updated = write_admission(home, input);
1957
1967
  return { job: admission_view(updated).admissions.find(row => row.id === job.id) };
@@ -1961,7 +1971,7 @@ async function moss_admission(home, current, access, input) {
1961
1971
  export async function deliver_experience_admission(home, deliver = steward_command) {
1962
1972
  const settings = launch_settings(home);
1963
1973
  let state = experiences(settings);
1964
- if (has_expired_entries(state)) state = save_launch_settings(home, { experience: { action: 'list' } }).host_experience;
1974
+ if (has_expired_experience(state)) state = save_launch_settings(home, { experience: { action: 'list' } }).host_experience;
1965
1975
  const view = admission_view(state);
1966
1976
  if (view.admissions.some(row => row.status === 'checking' && row.submitted_at)) return;
1967
1977
  const job = view.admissions.find(row => row.status === 'checking' && !row.submitted_at);
@@ -2122,7 +2132,7 @@ export function save_launch_settings(home, input, steward_patch = null, update_s
2122
2132
  if (Object.hasOwn(prompts || {}, 'host') || input.experience) {
2123
2133
  settings.host_experience = experiences(previous);
2124
2134
  const expired = has_expired_experience(settings.host_experience);
2125
- if (Object.hasOwn(prompts || {}, 'host')) queue_legacy_experience(settings.host_experience, prompts.host);
2135
+ if (Object.hasOwn(prompts || {}, 'host')) set_legacy_experience(settings.host_experience, prompts.host);
2126
2136
  if (input[review_policy]) {
2127
2137
  verify_review_suggestion(previous, input[review_policy].input, input[review_policy].snapshot);
2128
2138
  verify_review_evidence(previous, input[review_policy]);