ai_co_discuss 0.5.2 → 0.5.3
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/.agents/skills/discuss-host/SKILL.md +1 -1
- package/.agents/skills/discuss-host/references/control.md +9 -3
- package/.agents/skills/discuss-host/references/workflow.md +4 -1
- package/.agents/skills/discuss-participant/SKILL.md +3 -2
- package/.agents/skills/discuss-participant/references/interactive-html.md +57 -0
- package/.agents/skills/discuss-participant/references/writing.md +1 -1
- package/.agents/skills/workflow-creator/SKILL.md +10 -2
- package/.agents/skills/workflow-creator/references/model-selection.md +1 -1
- package/backend/free_room.py +101 -11
- package/backend/message_queue.py +1 -1
- package/backend/schema.sql +21 -0
- package/backend/server.py +18 -3
- package/docs/deployment.md +22 -0
- package/docs/en/deployment.md +22 -0
- package/docs/en/guide/external-members.md +1 -1
- package/docs/en/guide/faq.md +6 -2
- package/docs/en/guide/members.md +4 -4
- package/docs/en/guide/rooms.md +12 -4
- package/docs/en/guide/scheduling.md +3 -4
- package/docs/en/guide/workflows.md +6 -3
- package/docs/en/guide/working.md +8 -4
- package/docs/guide/external-members.md +1 -1
- package/docs/guide/faq.md +6 -2
- package/docs/guide/members.md +4 -4
- package/docs/guide/rooms.md +13 -5
- package/docs/guide/scheduling.md +3 -4
- package/docs/guide/workflows.md +6 -3
- package/docs/guide/working.md +8 -4
- package/frontend/locales/en/app.json +51 -1
- package/frontend/locales/en/backend.json +12 -1
- package/frontend/locales/en/core.json +10 -3
- package/frontend/locales/en/discussion.json +13 -2
- package/frontend/locales/en/room.json +37 -2
- package/frontend/locales/en/settings.json +8 -6
- package/gateway/login_page.mjs +77 -9
- package/package.json +3 -3
- package/runner/adapters/index.mjs +10 -0
- package/runner/adapters/profiles.mjs +19 -0
- package/runner/discuss.py +11 -2
- package/runner/discussion_launch.mjs +241 -44
- package/runner/expert_prompts.mjs +1 -2
- package/runner/free_runner.mjs +23 -9
- package/runner/host_permissions.mjs +57 -0
- package/runner/hosting_tunnel.mjs +25 -7
- package/runner/i18n_en.mjs +2 -0
- package/runner/scheduler.mjs +45 -102
- package/runner/session_driver.mjs +3 -4
- package/runner/workflow_flow.mjs +32 -2
- package/runner/workflows.mjs +84 -21
- package/web/admin.js +1 -1
- package/web/app.js +686 -173
- package/web/i18n.js +3 -3
- package/web/markdown.js +2 -2
- package/web/modern.css +1 -1
- package/web/modern.js +60 -60
- package/workflows/story-serial/SKILL.md +7 -5
- package/workflows/story-serial/agents/recorder.md +6 -5
- package/workflows/story-serial/agents/writer.md +1 -1
- package/workflows/story-serial/commands.json +1 -1
- package/workflows/story-serial/templates/README.md +3 -3
- package/workflows/story-serial/templates//344/270/226/347/225/214.md +1 -1
- package/workflows/story-serial/templates//345/267/245/344/275/234/345/217/260.md +3 -3
- package/workflows/story-serial/templates//346/216/222/347/272/277/350/241/250.md +2 -2
- package/workflows/story-serial/templates//346/226/207/351/243/216.md +1 -1
- package/workflows/story-serial/templates//347/212/266/346/200/201//344/270/273/350/247/222.yaml +2 -2
- package/workflows/story-serial/templates//347/212/266/346/200/201//344/272/272/347/211/251.yaml +1 -1
- package/workflows/story-serial/templates//347/212/266/346/200/201//345/210/206/351/233/206/350/256/260/345/275/225.yaml +1 -1
- package/workflows/story-serial/templates//347/212/266/346/200/201//346/215/256/347/202/271.yaml +1 -1
- package/workflows/story-serial/templates//347/212/266/346/200/201//347/211/251/350/265/204.yaml +3 -3
- package/workflows/story-serial/templates//347/212/266/346/200/201//347/272/277/347/264/242.yaml +4 -3
- package/workflows/story-serial/tools//347/212/266/346/200/201/346/243/200/346/237/245.py +81 -7
- package/workflows/story-serial/workflows/revise-episodes/SKILL.md +9 -4
- package/workflows/story-serial/workflows/revise-episodes/flow.json +93 -0
- package/workflows/story-serial/workflows/tidy-docs/SKILL.md +55 -0
- package/workflows/story-serial/workflows/tidy-docs/flow.json +74 -0
- package/workflows/story-serial/workflows/tidy-docs/references//346/226/207/346/241/243/346/240/207/345/207/206.md +97 -0
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"未登录 · 点击登录": "Signed out · Click to sign in",
|
|
6
6
|
"房间导航": "Room navigation",
|
|
7
7
|
"共议": "CoDiscuss",
|
|
8
|
-
"频道工具": "Channel tools",
|
|
9
8
|
"房间视图": "Room views",
|
|
10
9
|
"工作流": "Workflows",
|
|
11
10
|
"新建或导入工作流": "New or import workflow",
|
|
@@ -350,7 +349,6 @@
|
|
|
350
349
|
"消息原文": "Original message",
|
|
351
350
|
"重命名房间": "Rename room",
|
|
352
351
|
"删除房间": "Delete room",
|
|
353
|
-
"管理员账号与界面外观。": "Admin account and appearance.",
|
|
354
352
|
"邀请 AI 一起协作;需要深入讨论时,可在创建时或之后随时开启。": "Invite AI to work together; start a discussion now or any time later when you need to go deeper.",
|
|
355
353
|
"维护话题目标、背景与讨论默认上限。": "Maintain the topic's goal, background and default discussion limits.",
|
|
356
354
|
"保留作者、来源、提交人和引用关系。": "Keeps author, source, submitter and reply links.",
|
|
@@ -477,5 +475,14 @@
|
|
|
477
475
|
"标准": "Standard",
|
|
478
476
|
"紧凑": "Eager",
|
|
479
477
|
"长回答折叠": "Folding long answers",
|
|
480
|
-
"
|
|
478
|
+
"卡片文字大小": "Card text size",
|
|
479
|
+
"小": "Small",
|
|
480
|
+
"中": "Medium",
|
|
481
|
+
"大": "Large",
|
|
482
|
+
"调整消息卡片里正文的字号,只对本设备生效。": "Sets the text size inside message cards. Saved on this device only.",
|
|
483
|
+
"宽松:超过 1.2 屏才折叠,折后保留半屏;标准:超过 0.7 屏折叠;紧凑:超过半屏就折叠,只留开头。按当前屏幕高度计算,只对本设备生效。": "Relaxed folds answers taller than 1.2 screens and keeps half a screen; Standard folds past 0.7 of a screen; Eager folds past half a screen and keeps only the opening. Measured against this screen's height, and saved on this device only.",
|
|
484
|
+
"关联房间互传上限": "Linked-room message limit",
|
|
485
|
+
"关联房间互传条数": "Messages between linked rooms",
|
|
486
|
+
"条": "messages",
|
|
487
|
+
"主持人新建的房间与原房间之间,两边主持人从你上次发言起最多互传几条消息;对本机所有关联房间生效。": "How many messages the hosts of a room and the rooms its host created may pass each other after your last message; applies to every linked room on this computer."
|
|
481
488
|
}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"项目文件 · {value1}/": "Project files · {value1}/",
|
|
57
57
|
"项目文件": "Project files",
|
|
58
58
|
"需要一位由本机唤醒的 AI 主持人": "Requires a host AI managed by the local service",
|
|
59
|
-
"需先在电脑上的“成员与设置 →
|
|
59
|
+
"需先在电脑上的“成员与设置 → 协作设置”勾选主持人权限“工作流”": "Tick the host permission “Workflows” under Members and settings → Collaboration settings on the computer first",
|
|
60
60
|
"工作流": "Workflows",
|
|
61
61
|
"新建 / 修改工作流": "Create / edit workflow",
|
|
62
62
|
"请主持人按 workflow-creator 技能写工作流": "Ask the host to write a workflow using the workflow-creator skill",
|
|
@@ -306,5 +306,16 @@
|
|
|
306
306
|
"换行": "new line",
|
|
307
307
|
"接力在等你回答上方的问题卡;这条消息只发给主持人 {value1}": "The relay is waiting for your answer on the question card above; this message goes only to the host {value1}",
|
|
308
308
|
"接力在等你回答问题卡…": "The relay is waiting for your answer on the question card…",
|
|
309
|
-
"修改注释 {value1} · {value2}": "Editing note {value1} · {value2}"
|
|
309
|
+
"修改注释 {value1} · {value2}": "Editing note {value1} · {value2}",
|
|
310
|
+
"关联房间": "Linked room",
|
|
311
|
+
"打开房间": "Open room",
|
|
312
|
+
"该房间已删除": "That room was deleted",
|
|
313
|
+
"另一房间的主持人经房主凭据在本房间发言;点击打开该房间": "The host of another room spoke here with the owner credential; click to open that room",
|
|
314
|
+
"来自房间「{room}」的主持人 {host}": "From host {host} of room \"{room}\"",
|
|
315
|
+
"已删除的房间": "a deleted room",
|
|
316
|
+
"在消息内展开": "Expand in message",
|
|
317
|
+
"在消息内展开 {name}": "Expand {name} in message",
|
|
318
|
+
"收起 {name} 的预览": "Collapse preview of {name}",
|
|
319
|
+
"HTML 附件超过 2 MiB,请在预览窗口查看源码。": "This HTML attachment is over 2 MiB. Open the preview window to view its source.",
|
|
320
|
+
"打开预览窗口": "Open preview window"
|
|
310
321
|
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
"刷新失败,继续使用当前列表:{value1}": "Refresh failed, keeping the current list: {value1}",
|
|
6
6
|
"管理面板的显示语言": "Display language of this panel",
|
|
7
7
|
"把 {value1} 放到画布": "Place {value1} on the canvas",
|
|
8
|
+
"在画布上定位 {value1}": "Find {value1} on the canvas",
|
|
9
|
+
"已在画布上:点一下定位到它": "Already on the canvas: click to find it",
|
|
8
10
|
"放到画布:示意流程走到这里转去这个子工作流": "Place on the canvas: shows the flow turning to this sub-workflow here",
|
|
9
11
|
"程序固定附加的说明(只读)": "Instructions automatically added by the runner (read-only)",
|
|
10
12
|
"每次唤醒随消息发送;填了专属提示词时,后面另起一段“{heading}”再接它": "Sent with each wake-up message. If a member prompt is set, it follows under a separate “{heading}” heading.",
|
|
@@ -14,6 +16,9 @@
|
|
|
14
16
|
"减少 {step}": "Decrease by {step}",
|
|
15
17
|
"增加 {step}": "Increase by {step}",
|
|
16
18
|
"{count} 段": "{count} notes",
|
|
19
|
+
" · {count} 步": " · {count} steps",
|
|
20
|
+
"{count} 步": "{count} steps",
|
|
21
|
+
"文件改动": "File changes",
|
|
17
22
|
"展开 {count} 段过程说明": "Expand {count} progress notes",
|
|
18
23
|
"{count} 秒": "{count} seconds",
|
|
19
24
|
"{count} 分钟": "{count} minutes",
|
|
@@ -52,7 +57,26 @@
|
|
|
52
57
|
"正在读取过程说明": "Loading progress notes",
|
|
53
58
|
"收起过程说明": "Collapse progress notes",
|
|
54
59
|
"主持人完整权限": "Full host control",
|
|
55
|
-
"
|
|
60
|
+
"主持人权限": "Host permissions",
|
|
61
|
+
"主持人部分权限": "Partial host control",
|
|
62
|
+
"主持人可自行处理问题、持续推进;可只勾选下面的一部分。成员项目权限最高可写。": "The host handles problems and keeps work moving by itself; you can tick only some of the items below. Members get write access to the project at most.",
|
|
63
|
+
"具体权限(已选 {count} / {total})": "Items ({count} of {total} selected)",
|
|
64
|
+
"处理执行问题": "Handle execution problems",
|
|
65
|
+
"停止、插话、重试成员,撤回自己派出的活": "Stop, steer or retry members, and withdraw work it dispatched",
|
|
66
|
+
"调整成员配置": "Adjust member settings",
|
|
67
|
+
"改成员的模型、强度、接入方式、名称与描述": "Change a member's model, effort, client, name and description",
|
|
68
|
+
"改项目权限": "Change project access",
|
|
69
|
+
"在只读与可写之间切换成员的项目权限": "Switch a member's project access between read-only and write",
|
|
70
|
+
"管理成员名单": "Manage the member list",
|
|
71
|
+
"邀请本机已配置的软件(最高可写),暂离、移除、请回成员": "Invite software configured on this computer (write access at most), and send away, remove or bring back members",
|
|
72
|
+
"推进方式": "How work proceeds",
|
|
73
|
+
"调整发言顺序,开启和控制讨论与 Goal,给自己设定时检查": "Change the speaking order, start and control discussions and Goals, and set its own timed check-ins",
|
|
74
|
+
"保存并启用工作流,邀请工作流所需的成员": "Save and enable workflows, and invite the members they need",
|
|
75
|
+
"新建房间": "Create rooms",
|
|
76
|
+
"从本房间新建房间并在其中分派工作;新房间不能再新建房间": "Create rooms from this one and assign work in them; a room created this way cannot create rooms",
|
|
77
|
+
"最多新建": "At most",
|
|
78
|
+
"个房间": "rooms",
|
|
79
|
+
"主持人最多新建的房间数": "The most rooms the host may create",
|
|
56
80
|
"主持人连续派活轮数": "Consecutive assignment rounds",
|
|
57
81
|
"主持人连续派活轮数不限": "Unlimited consecutive assignment rounds",
|
|
58
82
|
"不限": "Unlimited",
|
|
@@ -695,7 +719,6 @@
|
|
|
695
719
|
"标签或一段话都行,Ctrl + Enter 保存": "Tags or a paragraph are fine; Ctrl + Enter to save",
|
|
696
720
|
"留空表示不提供描述": "Leave blank for no description",
|
|
697
721
|
"{value1} 的名称与描述": "{value1}'s name and description",
|
|
698
|
-
"名称只改显示的名字,成员 ID 不变。描述写擅长什么、适合分到什么工作,智能调度和 AI 主持人分派时参考,房间所有成员都能看到。": "The name changes only the display name, not the member ID. Describe strengths and suitable tasks to guide smart scheduling and the AI host. All room members can see it.",
|
|
699
722
|
"{value1} 的描述": "{value1}'s description",
|
|
700
723
|
"例如:擅长前端和交互细节,适合出方案、做评审;大段重构交给别人": "For example: Strong at frontend and interaction details; suitable for proposals and reviews. Assign large refactors to others.",
|
|
701
724
|
"显示名称": "Display name",
|
|
@@ -704,6 +727,18 @@
|
|
|
704
727
|
"存为 {value1} 的默认描述": "Save as the default description for {value1}",
|
|
705
728
|
"复制启动指令(含凭证)": "Copy launch command (with credentials)",
|
|
706
729
|
"名称与描述": "Name and description",
|
|
730
|
+
"双击重命名": "Double-click to rename",
|
|
731
|
+
"编辑 {value1} 的描述": "Edit {value1}'s description",
|
|
732
|
+
"添加描述": "Add description",
|
|
733
|
+
"智能调度和 AI 主持人分派时参考,房间所有成员都能看到": "Used by smart scheduling and the AI host when assigning work; visible to every member of the room",
|
|
734
|
+
"只改显示的名字,成员 ID {value1} 不变": "Only changes the name shown; the member ID {value1} stays",
|
|
735
|
+
"常见分工": "Common kinds of work",
|
|
736
|
+
"出方案": "proposing solutions",
|
|
737
|
+
"做评审": "reviewing",
|
|
738
|
+
"写代码": "writing code",
|
|
739
|
+
"查资料": "research",
|
|
740
|
+
"写文档": "writing docs",
|
|
741
|
+
"测试验收": "testing and acceptance",
|
|
707
742
|
"复制参与说明": "Copy participation instructions",
|
|
708
743
|
"下载私有配置": "Download private configuration",
|
|
709
744
|
"复制凭证文本": "Copy credential text",
|
|
@@ -132,7 +132,6 @@
|
|
|
132
132
|
"{value1}远程执行 {value2}{value3}{value4}": "{value1} ran remotely: {value2}{value3}{value4}",
|
|
133
133
|
"(临时)": "(temporary)",
|
|
134
134
|
"已配对的设备": "Paired devices",
|
|
135
|
-
"新设备须在电脑前扫码配对。": "New devices must scan a pairing code at the computer.",
|
|
136
135
|
"配对这台设备": "Pair this device",
|
|
137
136
|
"扫描电脑本机网页 设置 → 添加设备 的二维码,或输入配对码。": "Scan the QR code under Settings → Add device on the computer's local site, or enter the pairing code.",
|
|
138
137
|
"配对码": "Pairing code",
|
|
@@ -180,8 +179,6 @@
|
|
|
180
179
|
"缺少密钥": "Missing key",
|
|
181
180
|
"已配置": "Configured",
|
|
182
181
|
"检查通过:决策模型已响应": "Check passed: decision model responded",
|
|
183
|
-
"试验:说明目的与依据,由模型权衡;正在打磨,可能判错": "Experimental: explains the purpose and reasoning for the model to weigh; still being refined and may make mistakes",
|
|
184
|
-
"稳定:按固定顺序逐条核对,已通过回归评测": "Stable: checks each rule in a fixed order; passed regression evaluation",
|
|
185
182
|
"接入决策模型,推荐更适合回答的成员,由你一键采纳。": "Connect a decision model to recommend who should answer; accept with one click.",
|
|
186
183
|
"接入决策模型,自动安排插话回应与下一轮发言。": "Connect a decision model to route interjections and schedule the next round automatically.",
|
|
187
184
|
"开启": "Enable",
|
|
@@ -210,8 +207,6 @@
|
|
|
210
207
|
"放弃决策模型的修改": "Discard decision model changes",
|
|
211
208
|
"完成并返回决策模型卡片": "Finish and return to the decision model card",
|
|
212
209
|
"完成": "Done",
|
|
213
|
-
"判断方式": "Decision method",
|
|
214
|
-
"智能调度判断方式": "Smart scheduling decision method",
|
|
215
210
|
"只读": "read-only",
|
|
216
211
|
"可写": "Can write",
|
|
217
212
|
"沿用本次设置": "Use current settings",
|
|
@@ -567,6 +562,7 @@
|
|
|
567
562
|
"子工作流": "Sub-workflow",
|
|
568
563
|
"{value1} 位成员": "{value1} members",
|
|
569
564
|
"进入这个子工作流(也可双击)": "Open this sub-workflow (or double-click)",
|
|
565
|
+
"挂靠:{value1}": "Attached: {value1}",
|
|
570
566
|
"进入": "Open",
|
|
571
567
|
"从画布移除子工作流节点": "Remove sub-workflow node from canvas",
|
|
572
568
|
"按住拖动": "Hold to drag",
|
|
@@ -703,6 +699,8 @@
|
|
|
703
699
|
"已复制 {value1},打开目标文件夹后点“粘贴”": "Copied {value1}. Open the target folder and choose \"Paste\"",
|
|
704
700
|
"已剪切 {value1},打开目标文件夹后点“粘贴”": "Cut {value1}. Open the target folder and choose \"Paste\"",
|
|
705
701
|
"{value1} 超过 20 MB,未上传;更大的文件请给 AI 下载链接或仓库地址": "{value1} is over 20 MB and was not uploaded. For larger files, give an AI member a download link or repository address",
|
|
702
|
+
"已取消上传:离开文件页前未处理同名文件。": "Upload canceled because you left the Files page before choosing what to do with the duplicate name.",
|
|
703
|
+
"{name} 上传失败:{reason}": "{name} failed to upload: {reason}",
|
|
706
704
|
"已上传 {value1} 个文件": "Uploaded {value1} files",
|
|
707
705
|
"下载失败:{value1}": "Download failed: {value1}",
|
|
708
706
|
"已还原到 {value1}/{value2}": "Restored to {value1}/{value2}",
|
|
@@ -733,5 +731,9 @@
|
|
|
733
731
|
"还原": "Restore",
|
|
734
732
|
"回收区是空的": "The recycle bin is empty",
|
|
735
733
|
"{value1} 的操作": "Actions for {value1}",
|
|
736
|
-
"单个文件不能超过 {value1} MB": "Each file must be {value1} MB or less"
|
|
734
|
+
"单个文件不能超过 {value1} MB": "Each file must be {value1} MB or less",
|
|
735
|
+
"房间偏好": "Room preferences",
|
|
736
|
+
"主持人项目权限": "Host's project access",
|
|
737
|
+
"新建房间时,第一位加入的成员(默认主持人)使用的项目权限;该软件不支持所选档位时仍为只读。保存在这台电脑的本机服务里,升级后保留。": "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.",
|
|
738
|
+
"连接本机服务后可设置。": "Available once the local service is connected."
|
|
737
739
|
}
|
package/gateway/login_page.mjs
CHANGED
|
@@ -40,24 +40,93 @@ const THREADS = [
|
|
|
40
40
|
const escape_html = text => String(text).replace(/[&<>"']/g, mark => `&#${mark.charCodeAt(0)};`);
|
|
41
41
|
|
|
42
42
|
const threads_svg = () => THREADS.map(([path, colour, seconds, delay]) => `<path class="thread" d="${path}"/>`
|
|
43
|
-
+ `<path class="pulse" d="${path}" pathLength="100" stroke="${colour}" style="animation-duration:${seconds}s;animation-delay:-${delay}s"/>`).join('');
|
|
43
|
+
+ `<path class="pulse" d="${path}" pathLength="100" stroke="${colour}" style="filter:drop-shadow(0 0 3px ${colour});animation-duration:${seconds}s;animation-delay:-${delay}s"/>`).join('');
|
|
44
|
+
|
|
45
|
+
// Clawd, Claude's pixel mascot, on a 12 × 7 grid with headroom above for its hop. It strolls along the top of the mark,
|
|
46
|
+
// hops, waves and blinks, and shuts its eyes while the password is being typed.
|
|
47
|
+
const CLAWD = `<svg class="pal clawd" viewBox="0 -3 12 10" aria-hidden="true"><path class="clawd-spark" d="M10.4-2.9l.4.9.9.4-.9.4-.4.9-.4-.9-.9-.4.9-.4z"/>`
|
|
48
|
+
+ `<g class="clawd-hop" shape-rendering="crispEdges"><g class="clawd-legs-a"><rect x="2" y="5" width="1" height="2"/><rect x="7" y="5" width="1" height="2"/></g>`
|
|
49
|
+
+ `<g class="clawd-legs-b"><rect x="4" y="5" width="1" height="2"/><rect x="9" y="5" width="1" height="2"/></g>`
|
|
50
|
+
+ `<rect class="pal-arm" x="0" y="2" width="1" height="2"/><rect class="pal-arm pal-wave" x="11" y="2" width="1" height="2"/><rect x="1" y="0" width="10" height="5"/>`
|
|
51
|
+
+ `<rect class="pal-eye pal-eye-left" fill="#2a1810" x="3" y="1" width="1" height="2"/><rect class="pal-eye" fill="#2a1810" x="8" y="1" width="1" height="2"/></g></svg>`;
|
|
52
|
+
|
|
53
|
+
// Two companions for the other auto-wake tools: each is that tool's own mark (the shapes and colours of web/icons)
|
|
54
|
+
// with a pair of eyes. They hide behind our mark and peek over its top edge on the side Clawd has walked away from:
|
|
55
|
+
// the star bobs along with Clawd's hop, the knot wiggles back at its wave. Both duck out of sight while the password
|
|
56
|
+
// is being typed.
|
|
57
|
+
const STAR_SHAPE = 'M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z';
|
|
58
|
+
const STAR_PAL = `<svg class="pal peeker peeker-star" viewBox="0 0 24 24" aria-hidden="true"><defs>`
|
|
59
|
+
+ `<linearGradient id="pal-star-0" gradientUnits="userSpaceOnUse" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"/><stop offset="1" stop-color="#08B962" stop-opacity="0"/></linearGradient>`
|
|
60
|
+
+ `<linearGradient id="pal-star-1" gradientUnits="userSpaceOnUse" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"/><stop offset="1" stop-color="#F94543" stop-opacity="0"/></linearGradient>`
|
|
61
|
+
+ `<linearGradient id="pal-star-2" gradientUnits="userSpaceOnUse" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"/><stop offset=".46" stop-color="#FABC12" stop-opacity="0"/></linearGradient></defs>`
|
|
62
|
+
+ `<path d="${STAR_SHAPE}" fill="#3186FF"/><path d="${STAR_SHAPE}" fill="url(#pal-star-0)"/><path d="${STAR_SHAPE}" fill="url(#pal-star-1)"/><path d="${STAR_SHAPE}" fill="url(#pal-star-2)"/>`
|
|
63
|
+
+ `<rect class="pal-eye pal-eye-left" fill="#0b1f4d" x="9.1" y="10" width="1.6" height="3.2" rx=".3"/><rect class="pal-eye" fill="#0b1f4d" x="13.3" y="10" width="1.6" height="3.2" rx=".3"/></svg>`;
|
|
64
|
+
const KNOT_SHAPE = 'M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z';
|
|
65
|
+
const KNOT_PAL = `<svg class="pal peeker peeker-knot" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><g class="pal-wiggle"><path fill-rule="evenodd" d="${KNOT_SHAPE}"/>`
|
|
66
|
+
+ `<rect class="pal-eye pal-eye-left" x="10.05" y="10.7" width="1.3" height="2.6" rx=".25"/><rect class="pal-eye" x="12.65" y="10.7" width="1.3" height="2.6" rx=".25"/></g></svg>`;
|
|
67
|
+
|
|
68
|
+
// Clawd's 12-second loop walks right, idles, walks back, idles. [from, to] in percent of the loop.
|
|
69
|
+
const CLAWD_WALKS = [[0, 28], [50, 78]];
|
|
70
|
+
const CLAWD_STEP_PERCENT = 2;
|
|
71
|
+
|
|
72
|
+
/** Keyframes lifting one pair of legs on every other step while Clawd walks, and resting them while it idles. */
|
|
73
|
+
const leg_keyframes = (name, lifted_first) => {
|
|
74
|
+
const frames = CLAWD_WALKS.flatMap(([from, to]) => {
|
|
75
|
+
const steps = [];
|
|
76
|
+
for (let percent = from, step = 0; percent < to; percent += CLAWD_STEP_PERCENT, step += 1) {
|
|
77
|
+
steps.push(`${percent}%{transform:${(step % 2 === 0) === lifted_first ? 'translateY(-.6px)' : 'none'}}`);
|
|
78
|
+
}
|
|
79
|
+
return [...steps, `${to}%{transform:none}`];
|
|
80
|
+
});
|
|
81
|
+
return `@keyframes ${name}{${frames.join('')}}`;
|
|
82
|
+
};
|
|
44
83
|
|
|
45
84
|
const STYLE = `
|
|
46
|
-
:root{color-scheme:light;--bg:#f6f6f6;--panel:#ececef;--field:#fff;--line:#d9d9de;--line-strong:#b9b9c2;--text:#1b1c20;--muted:#61636d;--dim:#767885;--accent:#4f51e8;--accent-text:#fff;--danger:#b4243d;--danger-bg:#c4314b14;--thread:#1b1c2014;--shadow:0 16px 40px #1b1c2024}
|
|
47
|
-
:root[data-mode=dark]{color-scheme:dark;--bg:#202127;--panel:#191a1f;--field:#2a2b32;--line:#393a43;--line-strong:#50515c;--text:#f1f2f5;--muted:#a8abb6;--dim:#8d909e;--accent:#8791ff;--accent-text:#14151a;--danger:#ff8a9b;--danger-bg:#ff8a9b18;--thread:#ffffff12;--shadow:0 16px 40px #0007}
|
|
85
|
+
:root{color-scheme:light;--bg:#f6f6f6;--panel:#ececef;--field:#fff;--line:#d9d9de;--line-strong:#b9b9c2;--text:#1b1c20;--muted:#61636d;--dim:#767885;--accent:#4f51e8;--accent-text:#fff;--danger:#b4243d;--danger-bg:#c4314b14;--thread:#1b1c2014;--dot:#1b1c2026;--pal-ink:#0d0d0d;--shadow:0 16px 40px #1b1c2024}
|
|
86
|
+
:root[data-mode=dark]{color-scheme:dark;--bg:#202127;--panel:#191a1f;--field:#2a2b32;--line:#393a43;--line-strong:#50515c;--text:#f1f2f5;--muted:#a8abb6;--dim:#8d909e;--accent:#8791ff;--accent-text:#14151a;--danger:#ff8a9b;--danger-bg:#ff8a9b18;--thread:#ffffff12;--dot:#ffffff1f;--pal-ink:#ffffff;--shadow:0 16px 40px #0007}
|
|
48
87
|
*{box-sizing:border-box}html,body{height:100%}
|
|
49
88
|
body{margin:0;background:var(--bg);color:var(--text);font:15px/1.5 system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;-webkit-font-smoothing:antialiased}
|
|
50
89
|
button,input{font:inherit;color:inherit}
|
|
51
90
|
.entry{min-height:100%;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(420px,1fr)}
|
|
52
91
|
.stage{position:relative;overflow:hidden;background:var(--panel);display:flex;flex-direction:column;justify-content:flex-end;padding:48px 56px}
|
|
92
|
+
.stage::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 50% 50%,color-mix(in srgb,var(--accent) 14%,transparent),transparent 44%),radial-gradient(var(--dot) 1px,transparent 1.5px) 0 0/24px 24px;-webkit-mask-image:radial-gradient(circle at 50% 50%,#000 18%,transparent 72%);mask-image:radial-gradient(circle at 50% 50%,#000 18%,transparent 72%)}
|
|
53
93
|
.threads{position:absolute;inset:0;width:100%;height:100%}
|
|
54
94
|
.thread,.pulse{fill:none;stroke-linecap:round}.thread{stroke:var(--thread);stroke-width:1.5}
|
|
55
|
-
.pulse{stroke-width:
|
|
95
|
+
.pulse{stroke-width:3;stroke-dasharray:12 88;stroke-dashoffset:100;animation:flow linear infinite}
|
|
56
96
|
@keyframes flow{to{stroke-dashoffset:0}}
|
|
57
|
-
.emblem{position:absolute;left:50%;top:50%;width:132px;height:132px;margin:-66px 0 0 -66px;display:grid;place-items:center;border-radius:32px;background:var(--bg);box-shadow:var(--shadow);animation:arrive .8s cubic-bezier(.2,.9,.3,1.2) both}
|
|
97
|
+
.emblem{--stroll:16px;position:absolute;left:50%;top:50%;width:132px;height:132px;margin:-66px 0 0 -66px;display:grid;place-items:center;border-radius:32px;background:var(--bg);box-shadow:var(--shadow),inset 0 0 0 1px var(--line);animation:arrive .8s cubic-bezier(.2,.9,.3,1.2) both}
|
|
98
|
+
.emblem .pal{position:absolute;overflow:visible}
|
|
99
|
+
.emblem .clawd{left:50%;bottom:calc(100% - 1px);width:72px;height:60px;margin-left:-36px;fill:#d97757;animation:clawd-stroll 12s linear infinite}
|
|
100
|
+
.stage{--unit:5px;--half:66px;--aside:34px}
|
|
101
|
+
.peeker{--down:calc(16*var(--unit));position:absolute;overflow:visible;bottom:calc(50% + var(--half) - 4*var(--unit));width:calc(13*var(--unit));height:calc(13*var(--unit))}
|
|
102
|
+
.peeker-star{left:calc(50% - var(--aside) - 6.5*var(--unit));animation:peek-star 12s ease-in-out infinite,peeker-late 1s both}
|
|
103
|
+
.peeker-knot{left:calc(50% + var(--aside) - 6.5*var(--unit));color:var(--pal-ink);animation:peek-knot 12s ease-in-out infinite,peeker-late 1s both}
|
|
104
|
+
.pal-wiggle{transform-box:fill-box;transform-origin:center;animation:pal-wiggle 12s steps(1) infinite}
|
|
105
|
+
@keyframes peeker-late{0%,90%{opacity:0}}
|
|
106
|
+
@keyframes peek-star{0%,25%,54%,100%{transform:translateY(var(--down))}30%,32%,38%,44%,49%{transform:none}35%{transform:translateY(calc(var(--unit)*-1.2))}41%{transform:translateY(calc(var(--unit)*-.8))}}
|
|
107
|
+
@keyframes peek-knot{0%,75%,100%{transform:translateY(var(--down))}80%,96%{transform:none}}
|
|
108
|
+
@keyframes pal-wiggle{0%,83%,87%,91%,95%{transform:none}85%,93%{transform:rotate(-14deg)}89%{transform:rotate(14deg)}}
|
|
109
|
+
.entry:has(#password[type=password]:focus) .peeker{animation:none;transform:translateY(var(--down))}
|
|
110
|
+
.entry:has(#password[type=text]:focus) .peeker{animation:none;transform:translateY(calc(1.5*var(--unit)))}
|
|
111
|
+
.clawd-hop{animation:clawd-hop 12s ease-in-out infinite}
|
|
112
|
+
.clawd-legs-a{animation:clawd-legs-a 12s steps(1) infinite}.clawd-legs-b{animation:clawd-legs-b 12s steps(1) infinite}
|
|
113
|
+
.pal-wave{animation:clawd-wave 12s steps(1) infinite}
|
|
114
|
+
.pal-eye{transform-box:fill-box;transform-origin:center;animation:clawd-blink 4.6s steps(1) infinite}
|
|
115
|
+
.peeker-knot .pal-eye{animation-duration:5.8s}.peeker-star .pal-eye{animation-duration:3.9s}
|
|
116
|
+
.clawd-spark{fill:#fac04a;opacity:0;transform-box:fill-box;transform-origin:center;animation:clawd-spark 12s ease-out infinite}
|
|
117
|
+
@keyframes clawd-stroll{0%{transform:translateX(calc(var(--stroll)*-1))}28%,50%{transform:translateX(var(--stroll))}78%,100%{transform:translateX(calc(var(--stroll)*-1))}}
|
|
118
|
+
@keyframes clawd-hop{0%,32%,38%,44%,100%{transform:none}35%{transform:translateY(-1.6px)}41%{transform:translateY(-1px)}}
|
|
119
|
+
@keyframes clawd-wave{0%,83%,87%,91%,95%{transform:none}85%,89%,93%{transform:translateY(-1px)}}
|
|
120
|
+
@keyframes clawd-blink{0%,98%{transform:none}95%{transform:scaleY(.15)}}
|
|
121
|
+
@keyframes clawd-spark{0%,33%{opacity:0;transform:scale(.3)}36%{opacity:1;transform:none}44%,100%{opacity:0;transform:translateY(-1px) scale(.6)}}
|
|
122
|
+
${leg_keyframes('clawd-legs-a', true)}${leg_keyframes('clawd-legs-b', false)}
|
|
123
|
+
.entry:has(#password:focus) .pal,.entry:has(#password:focus) .pal *{animation-play-state:paused}
|
|
124
|
+
.entry:has(#password[type=password]:focus) .pal-eye,.entry:has(#password[type=text]:focus) .pal-eye-left{animation:none;transform:scaleY(.15)}
|
|
125
|
+
.entry:has(#password[type=password]:focus) .pal-arm{animation:none;transform:translateY(-1px)}
|
|
126
|
+
@media (prefers-reduced-motion:reduce){.pulse,.pal,.pal *,.emblem,.emblem::before,.emblem::after{animation:none!important}}
|
|
58
127
|
.emblem::before,.emblem::after{content:"";position:absolute;inset:0;border-radius:32px;border:1.5px solid var(--accent);opacity:0;animation:ring 4.5s ease-out infinite}
|
|
59
128
|
.emblem::after{animation-delay:2.25s}
|
|
60
|
-
.emblem
|
|
129
|
+
.emblem>svg:not(.pal){width:88px;height:88px}
|
|
61
130
|
@keyframes arrive{from{opacity:0;transform:scale(.72)}}
|
|
62
131
|
@keyframes ring{0%{opacity:.45;transform:scale(1)}70%,100%{opacity:0;transform:scale(1.7)}}
|
|
63
132
|
.logo-light,:root[data-mode=dark] .logo-dark{display:block}.logo-dark,:root[data-mode=dark] .logo-light{display:none}
|
|
@@ -92,8 +161,7 @@ input:hover{border-color:var(--line-strong)}input:focus{border-color:var(--accen
|
|
|
92
161
|
.choices{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:2px;padding:3px;border-radius:9px;background:color-mix(in srgb,var(--text) 7%,transparent)}
|
|
93
162
|
.choices button{height:32px;padding:0 6px;border:0;border-radius:7px;background:none;color:var(--muted);font-size:13px;cursor:pointer;white-space:nowrap}
|
|
94
163
|
.choices button[aria-pressed=true]{background:var(--bg);color:var(--text);font-weight:600;box-shadow:0 1px 3px #0003}
|
|
95
|
-
@media (max-width:860px){.entry{grid-template-columns:1fr;grid-template-rows:auto 1fr}.stage{height:176px;padding:0}.pitch{display:none}.emblem{width:84px;height:84px;margin:-42px 0 0 -42px;border-radius:22px}.emblem::before,.emblem::after{border-radius:22px}.emblem
|
|
96
|
-
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.pulse{stroke-dashoffset:60}}
|
|
164
|
+
@media (max-width:860px){.entry{grid-template-columns:1fr;grid-template-rows:auto 1fr}.stage{height:176px;padding:0}.pitch{display:none}.emblem{width:84px;height:84px;margin:-42px 0 0 -42px;border-radius:22px}.emblem::before,.emblem::after{border-radius:22px}.emblem>svg:not(.pal){width:56px;height:56px}.emblem{--stroll:11px}.emblem .clawd{width:42px;height:35px;margin-left:-21px}.stage{--unit:3px;--half:42px;--aside:21px}.side{place-items:start center;padding:28px 24px 36px}.wordmark{display:none}.settings{position:fixed;right:12px;top:12px}}
|
|
97
165
|
`;
|
|
98
166
|
|
|
99
167
|
// Runs before the first paint, so the page never flashes the other theme or language.
|
|
@@ -139,7 +207,7 @@ export function login_page({ action, refusal = '', name = '' }) {
|
|
|
139
207
|
const notice = refusal ? `<p class="notice" role="alert">${ICON.alert}<span ${text(refusal)}</span></p>` : '';
|
|
140
208
|
return `<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
|
141
209
|
<title>${zh.page_title}</title><script>${EARLY_SCRIPT}</script><style>${STYLE}</style></head><body><main class="entry">
|
|
142
|
-
<section class="stage"><svg class="threads" viewBox="0 0 800 900" preserveAspectRatio="xMidYMid slice" aria-hidden="true">${threads_svg()}</svg
|
|
210
|
+
<section class="stage"><svg class="threads" viewBox="0 0 800 900" preserveAspectRatio="xMidYMid slice" aria-hidden="true">${threads_svg()}</svg>${STAR_PAL}${KNOT_PAL}<div class="emblem" aria-hidden="true">${CLAWD}${logos}</div>
|
|
143
211
|
<div class="pitch"><h2 ${text('tagline')}</h2><p ${text('tagline_detail')}</p></div></section>
|
|
144
212
|
<section class="side"><div class="settings"><button id="settings-button" class="icon-button" type="button" aria-expanded="false" aria-controls="settings-menu" data-label="settings" aria-label="${zh.settings}" title="${zh.settings}">${ICON.settings}</button>
|
|
145
213
|
<div id="settings-menu" class="menu" hidden><fieldset><legend ${text('language')}</legend><div class="choices"><button type="button" data-locale="zh-CN">简体中文</button><button type="button" data-locale="en">English</button></div></fieldset>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai_co_discuss",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"bin": {
|
|
5
5
|
"codiscuss": "runner/codiscuss.mjs"
|
|
6
6
|
},
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"deploy": "npm run build && wrangler pages deploy --branch main --commit-dirty=true",
|
|
20
20
|
"deploy:pages": "npm run deploy",
|
|
21
21
|
"test": "npm run test:python && npm run test:js",
|
|
22
|
-
"test:python": "python -m unittest discover -s tests -p test_*.py",
|
|
23
|
-
"test:js": "node --test tests/test_*.mjs",
|
|
22
|
+
"test:python": "node scripts/test_env.mjs python -m unittest discover -s tests -p test_*.py",
|
|
23
|
+
"test:js": "node scripts/test_env.mjs node --test tests/test_*.mjs",
|
|
24
24
|
"test:install": "node --test tests/test_setup.mjs tests/test_local.mjs tests/test_package.mjs"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
@@ -175,6 +175,16 @@ export async function branch_session(profile, session_id, executions, { always =
|
|
|
175
175
|
return branch(profile, session_id, executions.map(execution_marker), { always, env, home, spawn_process });
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
/**
|
|
179
|
+
* The model and effort a delivery with this profile asks the software for, '' where it asks for none: an App chooses
|
|
180
|
+
* its model in its own chat, and software without effort levels takes none. What actually ran is `session_settings`.
|
|
181
|
+
*/
|
|
182
|
+
export function chosen_settings(profile) {
|
|
183
|
+
const facts = adapter_profile(profile?.adapter);
|
|
184
|
+
if (!facts || facts.kind === 'app') return { model: '', effort: '' };
|
|
185
|
+
return { model: String(profile.model || ''), effort: facts.efforts ? String(profile.effort || '') : '' };
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
/**
|
|
179
189
|
* The model and effort a session last ran with, read from the software's own session store; no AI turn is started.
|
|
180
190
|
* These are each software's internal formats, so anything unreadable yields empty strings rather than an error.
|
|
@@ -178,6 +178,25 @@ export function same_session_family(left, right) {
|
|
|
178
178
|
return Boolean(a && b && left !== right && a.session_family === b.session_family);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
/**
|
|
182
|
+
* The project access a member takes over from another, as when it becomes the host in its place: the highest level its
|
|
183
|
+
* own software offers that does not exceed the other's, and never below what it has now. Levels rank in ALL_ACCESS
|
|
184
|
+
* order, so software with fewer levels lands on the nearest one beneath (自动 becomes 可写 where 自动 is not offered)
|
|
185
|
+
* without a table of software pairs. Access the runner does not set (an App, a taken-over session's `own`) is neither
|
|
186
|
+
* given nor taken.
|
|
187
|
+
* @param {{adapter: string, project_access: string}} member - the member taking over, with its present access.
|
|
188
|
+
* @param {{adapter: string, project_access: string}} source - the member whose access is taken over.
|
|
189
|
+
* @returns {string} the member's access afterwards; its present one when nothing changes.
|
|
190
|
+
*/
|
|
191
|
+
export function inherited_access(member, source) {
|
|
192
|
+
const rank = level => ALL_ACCESS.indexOf(level);
|
|
193
|
+
const offered = ADAPTER_PROFILES[member.adapter]?.access_levels;
|
|
194
|
+
const limit = ADAPTER_PROFILES[source.adapter]?.access_levels ? rank(source.project_access) : -1;
|
|
195
|
+
if (!offered || rank(member.project_access) < 0 || limit < 0) return member.project_access;
|
|
196
|
+
const reachable = offered.filter(level => rank(level) <= limit && rank(level) > rank(member.project_access));
|
|
197
|
+
return reachable.sort((left, right) => rank(right) - rank(left))[0] || member.project_access;
|
|
198
|
+
}
|
|
199
|
+
|
|
181
200
|
/** The adapters serving one platform, in table order; a model API serves every platform. */
|
|
182
201
|
export function platform_adapters(platform) {
|
|
183
202
|
return ADAPTER_IDS.filter(id => ADAPTER_PROFILES[id].platform === platform || ADAPTER_PROFILES[id].platform === '');
|
package/runner/discuss.py
CHANGED
|
@@ -37,6 +37,9 @@ READ_ONLY_HEADER = "X-Discussion-Read-Only"
|
|
|
37
37
|
CROSS_ROOM_READ_PATH = re.compile(r"/api/rooms(?:/[^/]+(?:/.*)?)?|/r/[^/]+(?:/.*)?")
|
|
38
38
|
MAX_TEXT_LENGTH = 32000
|
|
39
39
|
MAX_SUMMARY_LENGTH = 1000
|
|
40
|
+
# An inline `message post --body` is for a one- or two-sentence reply: it cannot carry line breaks, so a longer answer
|
|
41
|
+
# given this way loses its Markdown layout and reaches the room as one paragraph (2026-11-20 user: refuse it).
|
|
42
|
+
MAX_INLINE_BODY_LENGTH = 200
|
|
40
43
|
MAX_BRIEF_LENGTH = 1600
|
|
41
44
|
MAX_MEMBER_HANDLE = 80
|
|
42
45
|
PARTICIPANTS = ("用户", "Codex", "Claude", "Antigravity", "DeepSeek", "Qwen", "Grok", "OpenAI", "Custom")
|
|
@@ -66,6 +69,8 @@ ROOM_LIST_FIELDS = ("id", "title", "goal", "message_count", "latest_id", "create
|
|
|
66
69
|
# A posted message echoes only what proves where it landed; the full text stays one `message view` away.
|
|
67
70
|
RECEIPT_FIELDS = ("id", "author", "kind", "execution_id", "request_message_id", "reply_to", "submission_id",
|
|
68
71
|
"created_at", "summary", "proactive")
|
|
72
|
+
# Shown with every post receipt: members otherwise repeat the whole answer in their own window, paying for it twice.
|
|
73
|
+
RECEIPT_NOTE = "正文已送达房间。在当前会话只回一句(如“已提交 #编号”),不要复述正文。"
|
|
69
74
|
# Arguments a task credential binds; `schema` reports them as required only when no bound credential is used.
|
|
70
75
|
CREDENTIAL_FIELDS = {"room": "room", "actor": "member", "execution": "execution_id"}
|
|
71
76
|
EXIT_CODES = {"0": "成功", "1": "HTTP/API 错误", "2": "参数或输入错误",
|
|
@@ -700,6 +705,9 @@ def split_summary_header(text):
|
|
|
700
705
|
def message_text_and_summary(args):
|
|
701
706
|
"""Read body and summary; a body file may hold the summary in its header instead of `--summary(-file)`."""
|
|
702
707
|
body = text_field(args, "body") or ""
|
|
708
|
+
if getattr(args, "body_file", None) is None and len(body.strip()) > MAX_INLINE_BODY_LENGTH:
|
|
709
|
+
raise CliError(f"--body 只用于不超过 {MAX_INLINE_BODY_LENGTH} 字的短答;较长的回答写成 Markdown 草稿"
|
|
710
|
+
"(分段、标题或列表),用 --body-file 草稿 提交")
|
|
703
711
|
summary = text_field(args, "summary")
|
|
704
712
|
if getattr(args, "body_file", None) is not None:
|
|
705
713
|
header, rest = split_summary_header(body)
|
|
@@ -1451,12 +1459,13 @@ def project_result(value, plan, site):
|
|
|
1451
1459
|
return inline_attachments(value)
|
|
1452
1460
|
if plan.view == "message_receipt" and isinstance(value.get("receipt"), dict):
|
|
1453
1461
|
# The service's own receipt, the same one API members get (spec #3262 item 4).
|
|
1454
|
-
return {**{key: item for key, item in value.items() if key not in ("message", "receipt")},
|
|
1462
|
+
return {**{key: item for key, item in value.items() if key not in ("message", "receipt")},
|
|
1463
|
+
"message": value["receipt"], "note": RECEIPT_NOTE}
|
|
1455
1464
|
if plan.view == "message_receipt" and isinstance(value.get("message"), dict):
|
|
1456
1465
|
message = value["message"]
|
|
1457
1466
|
receipt = {**select_fields(message, RECEIPT_FIELDS), "text_chars": len(message.get("text") or ""),
|
|
1458
1467
|
"attachments": len(message.get("attachments") or [])}
|
|
1459
|
-
return {**{key: item for key, item in value.items() if key != "message"}, "message": receipt}
|
|
1468
|
+
return {**{key: item for key, item in value.items() if key != "message"}, "message": receipt, "note": RECEIPT_NOTE}
|
|
1460
1469
|
return value
|
|
1461
1470
|
|
|
1462
1471
|
|