ai_co_discuss 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/.agents/skills/discuss-host/SKILL.md +1 -1
  2. package/.agents/skills/discuss-host/references/control.md +9 -3
  3. package/.agents/skills/discuss-host/references/workflow.md +4 -1
  4. package/.agents/skills/discuss-participant/SKILL.md +3 -2
  5. package/.agents/skills/discuss-participant/references/interactive-html.md +93 -0
  6. package/.agents/skills/discuss-participant/references/writing.md +1 -1
  7. package/.agents/skills/workflow-creator/SKILL.md +10 -2
  8. package/.agents/skills/workflow-creator/references/model-selection.md +1 -1
  9. package/backend/free_room.py +123 -12
  10. package/backend/message_queue.py +1 -1
  11. package/backend/schema.sql +27 -0
  12. package/backend/server.py +76 -4
  13. package/docs/deployment.md +22 -0
  14. package/docs/en/deployment.md +22 -0
  15. package/docs/en/guide/admin.md +4 -3
  16. package/docs/en/guide/external-members.md +1 -1
  17. package/docs/en/guide/faq.md +11 -6
  18. package/docs/en/guide/members.md +4 -4
  19. package/docs/en/guide/rooms.md +14 -4
  20. package/docs/en/guide/scheduling.md +3 -4
  21. package/docs/en/guide/workflows.md +6 -3
  22. package/docs/en/guide/working.md +9 -5
  23. package/docs/guide/admin.md +4 -3
  24. package/docs/guide/external-members.md +1 -1
  25. package/docs/guide/faq.md +11 -6
  26. package/docs/guide/members.md +4 -4
  27. package/docs/guide/rooms.md +15 -5
  28. package/docs/guide/scheduling.md +3 -4
  29. package/docs/guide/workflows.md +6 -3
  30. package/docs/guide/working.md +9 -5
  31. package/frontend/locales/en/admin.json +33 -2
  32. package/frontend/locales/en/app.json +107 -1
  33. package/frontend/locales/en/backend.json +15 -1
  34. package/frontend/locales/en/core.json +14 -3
  35. package/frontend/locales/en/discussion.json +18 -2
  36. package/frontend/locales/en/room.json +37 -2
  37. package/frontend/locales/en/settings.json +13 -6
  38. package/gateway/gateway.mjs +11 -0
  39. package/gateway/login_page.mjs +77 -9
  40. package/package.json +3 -3
  41. package/runner/adapters/index.mjs +10 -0
  42. package/runner/adapters/profiles.mjs +23 -0
  43. package/runner/admin_cli.mjs +21 -5
  44. package/runner/admin_panel.mjs +64 -19
  45. package/runner/discuss.py +11 -2
  46. package/runner/discussion_launch.mjs +241 -44
  47. package/runner/discussion_local.mjs +2 -1
  48. package/runner/discussion_service.mjs +15 -7
  49. package/runner/discussion_skills.mjs +8 -0
  50. package/runner/expert_prompts.mjs +1 -2
  51. package/runner/files.mjs +17 -2
  52. package/runner/free_runner.mjs +23 -9
  53. package/runner/host_permissions.mjs +57 -0
  54. package/runner/hosting_tunnel.mjs +25 -7
  55. package/runner/i18n_en.mjs +39 -1
  56. package/runner/instance_recovery.mjs +78 -0
  57. package/runner/os_users.mjs +6 -1
  58. package/runner/relay_channel.mjs +121 -30
  59. package/runner/relay_health.mjs +100 -0
  60. package/runner/relay_health_text.mjs +44 -0
  61. package/runner/remote_launch.mjs +24 -14
  62. package/runner/scheduler.mjs +45 -102
  63. package/runner/session_driver.mjs +3 -4
  64. package/runner/workflow_flow.mjs +32 -2
  65. package/runner/workflows.mjs +84 -21
  66. package/web/admin.css +1 -1
  67. package/web/admin.js +3 -3
  68. package/web/app.js +974 -194
  69. package/web/backup.js +1 -1
  70. package/web/i18n.js +4 -4
  71. package/web/markdown.js +2 -2
  72. package/web/modern.css +1 -1
  73. package/web/modern.js +78 -63
  74. package/workflows/story-serial/SKILL.md +7 -5
  75. package/workflows/story-serial/agents/recorder.md +6 -5
  76. package/workflows/story-serial/agents/writer.md +1 -1
  77. package/workflows/story-serial/commands.json +1 -1
  78. package/workflows/story-serial/templates/README.md +3 -3
  79. package/workflows/story-serial/templates//344/270/226/347/225/214.md +1 -1
  80. package/workflows/story-serial/templates//345/267/245/344/275/234/345/217/260.md +3 -3
  81. package/workflows/story-serial/templates//346/216/222/347/272/277/350/241/250.md +2 -2
  82. package/workflows/story-serial/templates//346/226/207/351/243/216.md +1 -1
  83. package/workflows/story-serial/templates//347/212/266/346/200/201//344/270/273/350/247/222.yaml +2 -2
  84. package/workflows/story-serial/templates//347/212/266/346/200/201//344/272/272/347/211/251.yaml +1 -1
  85. 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
  86. package/workflows/story-serial/templates//347/212/266/346/200/201//346/215/256/347/202/271.yaml +1 -1
  87. package/workflows/story-serial/templates//347/212/266/346/200/201//347/211/251/350/265/204.yaml +3 -3
  88. package/workflows/story-serial/templates//347/212/266/346/200/201//347/272/277/347/264/242.yaml +4 -3
  89. package/workflows/story-serial/tools//347/212/266/346/200/201/346/243/200/346/237/245.py +81 -7
  90. package/workflows/story-serial/workflows/revise-episodes/SKILL.md +9 -4
  91. package/workflows/story-serial/workflows/revise-episodes/flow.json +93 -0
  92. package/workflows/story-serial/workflows/tidy-docs/SKILL.md +55 -0
  93. package/workflows/story-serial/workflows/tidy-docs/flow.json +74 -0
  94. package/workflows/story-serial/workflows/tidy-docs/references//346/226/207/346/241/243/346/240/207/345/207/206.md +97 -0
@@ -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
- "主持人可自行处理问题、持续推进:打断、插话、重试成员,换模型,邀请、移除成员,调整发言顺序,开启讨论与 Goal,保存并启用工作流;成员项目权限最高可写。": "Let the host keep work moving: interrupt, steer and retry members, change models, invite or remove members, reorder speakers, start discussions and Goals, and save and enable workflows. Member project access is limited to read-only or can write.",
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",
@@ -9,6 +9,9 @@
9
9
  "未运行": "Not running",
10
10
  "未安装": "Not installed",
11
11
  "跟随通用": "Use general voice",
12
+ "各 AI": "Per AI",
13
+ "已单独设置 {value1} 个": "{value1} set individually",
14
+ "全部跟随通用": "All use the general voice",
12
15
  "正在试听:{value1}。听不到声音时,请检查这台设备的音量和声音输出(耳机或音箱)": "Playing preview: {value1}. If you cannot hear it, check this device's volume and audio output (headphones or speakers).",
13
16
  "语音": "Speech",
14
17
  "朗读与语音输入": "Read aloud and voice input",
@@ -132,7 +135,6 @@
132
135
  "{value1}远程执行 {value2}{value3}{value4}": "{value1} ran remotely: {value2}{value3}{value4}",
133
136
  "(临时)": "(temporary)",
134
137
  "已配对的设备": "Paired devices",
135
- "新设备须在电脑前扫码配对。": "New devices must scan a pairing code at the computer.",
136
138
  "配对这台设备": "Pair this device",
137
139
  "扫描电脑本机网页 设置 → 添加设备 的二维码,或输入配对码。": "Scan the QR code under Settings → Add device on the computer's local site, or enter the pairing code.",
138
140
  "配对码": "Pairing code",
@@ -180,8 +182,6 @@
180
182
  "缺少密钥": "Missing key",
181
183
  "已配置": "Configured",
182
184
  "检查通过:决策模型已响应": "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
185
  "接入决策模型,推荐更适合回答的成员,由你一键采纳。": "Connect a decision model to recommend who should answer; accept with one click.",
186
186
  "接入决策模型,自动安排插话回应与下一轮发言。": "Connect a decision model to route interjections and schedule the next round automatically.",
187
187
  "开启": "Enable",
@@ -210,8 +210,6 @@
210
210
  "放弃决策模型的修改": "Discard decision model changes",
211
211
  "完成并返回决策模型卡片": "Finish and return to the decision model card",
212
212
  "完成": "Done",
213
- "判断方式": "Decision method",
214
- "智能调度判断方式": "Smart scheduling decision method",
215
213
  "只读": "read-only",
216
214
  "可写": "Can write",
217
215
  "沿用本次设置": "Use current settings",
@@ -564,9 +562,12 @@
564
562
  "做什么": "Action",
565
563
  "主持人在这里做什么": "What the host does here",
566
564
  "删除主持人节点": "Delete host node",
565
+ "再点一次删除主持人节点": "Press again to delete the host node",
566
+ "再点一次,从画布移除子工作流节点": "Press again to remove the sub-workflow node from the canvas",
567
567
  "子工作流": "Sub-workflow",
568
568
  "{value1} 位成员": "{value1} members",
569
569
  "进入这个子工作流(也可双击)": "Open this sub-workflow (or double-click)",
570
+ "挂靠:{value1}": "Attached: {value1}",
570
571
  "进入": "Open",
571
572
  "从画布移除子工作流节点": "Remove sub-workflow node from canvas",
572
573
  "按住拖动": "Hold to drag",
@@ -703,6 +704,8 @@
703
704
  "已复制 {value1},打开目标文件夹后点“粘贴”": "Copied {value1}. Open the target folder and choose \"Paste\"",
704
705
  "已剪切 {value1},打开目标文件夹后点“粘贴”": "Cut {value1}. Open the target folder and choose \"Paste\"",
705
706
  "{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",
707
+ "已取消上传:离开文件页前未处理同名文件。": "Upload canceled because you left the Files page before choosing what to do with the duplicate name.",
708
+ "{name} 上传失败:{reason}": "{name} failed to upload: {reason}",
706
709
  "已上传 {value1} 个文件": "Uploaded {value1} files",
707
710
  "下载失败:{value1}": "Download failed: {value1}",
708
711
  "已还原到 {value1}/{value2}": "Restored to {value1}/{value2}",
@@ -733,5 +736,9 @@
733
736
  "还原": "Restore",
734
737
  "回收区是空的": "The recycle bin is empty",
735
738
  "{value1} 的操作": "Actions for {value1}",
736
- "单个文件不能超过 {value1} MB": "Each file must be {value1} MB or less"
739
+ "单个文件不能超过 {value1} MB": "Each file must be {value1} MB or less",
740
+ "房间偏好": "Room preferences",
741
+ "主持人项目权限": "Host's project access",
742
+ "新建房间时,第一位加入的成员(默认主持人)使用的项目权限;该软件不支持所选档位时仍为只读。保存在这台电脑的本机服务里,升级后保留。": "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.",
743
+ "连接本机服务后可设置。": "Available once the local service is connected."
737
744
  }
@@ -18,6 +18,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
18
18
  import { parseArgs } from 'node:util';
19
19
 
20
20
  import { ENTRY_KEY_PATTERN, verified_connection } from '../runner/entry_client.mjs';
21
+ import { clear_instance_flag, read_os_users } from '../runner/os_users.mjs';
21
22
  import { create_direct } from './direct.mjs';
22
23
  import { login_page } from './login_page.mjs';
23
24
 
@@ -106,6 +107,13 @@ export function read_accounts(data) {
106
107
  return existsSync(path) ? JSON.parse(readFileSync(path, 'utf8')) : {};
107
108
  }
108
109
 
110
+ /** Remember an explicit start or stop for hosted instances that run as the owner. */
111
+ export function set_instance_wanted(data, name, wanted) {
112
+ const accounts = read_accounts(data), account = accounts[name];
113
+ if (!account || account.instance_wanted === wanted) return;
114
+ write_json(accounts_path(data), { ...accounts, [name]: { ...account, instance_wanted: wanted } });
115
+ }
116
+
109
117
  function write_json(path, value) {
110
118
  mkdirSync(dirname(path), { recursive: true });
111
119
  const draft = `${path}.${process.pid}.tmp`;
@@ -492,6 +500,9 @@ export function create_gateway({ data, now = Date.now }) {
492
500
  /** Run `codiscuss local start|stop` against one account's service directory and wait for it. */
493
501
  function run_instance(data, name, command) {
494
502
  if (!read_accounts(data)[name]) throw new Error(`账号不存在:${name}`);
503
+ if (read_os_users(data)[name]) {
504
+ if (command === 'stop') clear_instance_flag(name);
505
+ } else set_instance_wanted(data, name, command === 'start');
495
506
  const child = spawn(process.execPath, [LOCAL_SCRIPT, command, '--json'], { stdio: 'inherit', windowsHide: true,
496
507
  env: { ...process.env, DISCUSS_SERVICE_HOME: instance_home(data, name) } });
497
508
  return new Promise((done, fail) => {
@@ -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:2.5;stroke-dasharray:14 86;stroke-dashoffset:100;animation:flow linear infinite}
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 svg{width:88px;height:88px}
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 svg{width:56px;height:56px}.side{place-items:start center;padding:28px 24px 36px}.wordmark{display:none}.settings{position:fixed;right:12px;top:12px}}
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><div class="emblem" aria-hidden="true">${logos}</div>
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.2",
3
+ "version": "0.5.4",
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.
@@ -119,6 +119,10 @@ export const ADAPTER_PROFILES = {
119
119
  windows_command: 'codiscuss',
120
120
  // Confined by --restricted --safe-mode --tools and dontAsk (claude_lockdown); a taken-over manual member keeps its own window.
121
121
  capabilities: { delivery: PROCESS, rewind: 'cut', project: true, access_env: true, chat: true, resume: true, images: true, capture: FINAL_REMARK, tool_lockdown: true },
122
+ // The card shows only Claude's text between tool calls, not its thinking; without this rule it wrote one line per
123
+ // five to fourteen calls, often in English (2026-11-21 session record).
124
+ task_rules: () => '多步任务中,转入新的一段工作时(如读完代码开始修改、改完开始验证)先用一句话说明再继续:'
125
+ + '用户等待时网页卡片只显示这些话,看不到你的思考。用请求者的语言写,即使代码和工具输出是英文;一句即可,不打断手头的工作。',
122
126
  },
123
127
  antigravity_cli: {
124
128
  platform: 'Antigravity', label: 'Antigravity CLI', kind: 'cli', location: 'executable', fields: ['project_id', 'project_name'],
@@ -178,6 +182,25 @@ export function same_session_family(left, right) {
178
182
  return Boolean(a && b && left !== right && a.session_family === b.session_family);
179
183
  }
180
184
 
185
+ /**
186
+ * The project access a member takes over from another, as when it becomes the host in its place: the highest level its
187
+ * own software offers that does not exceed the other's, and never below what it has now. Levels rank in ALL_ACCESS
188
+ * order, so software with fewer levels lands on the nearest one beneath (自动 becomes 可写 where 自动 is not offered)
189
+ * without a table of software pairs. Access the runner does not set (an App, a taken-over session's `own`) is neither
190
+ * given nor taken.
191
+ * @param {{adapter: string, project_access: string}} member - the member taking over, with its present access.
192
+ * @param {{adapter: string, project_access: string}} source - the member whose access is taken over.
193
+ * @returns {string} the member's access afterwards; its present one when nothing changes.
194
+ */
195
+ export function inherited_access(member, source) {
196
+ const rank = level => ALL_ACCESS.indexOf(level);
197
+ const offered = ADAPTER_PROFILES[member.adapter]?.access_levels;
198
+ const limit = ADAPTER_PROFILES[source.adapter]?.access_levels ? rank(source.project_access) : -1;
199
+ if (!offered || rank(member.project_access) < 0 || limit < 0) return member.project_access;
200
+ const reachable = offered.filter(level => rank(level) <= limit && rank(level) > rank(member.project_access));
201
+ return reachable.sort((left, right) => rank(right) - rank(left))[0] || member.project_access;
202
+ }
203
+
181
204
  /** The adapters serving one platform, in table order; a model API serves every platform. */
182
205
  export function platform_adapters(platform) {
183
206
  return ADAPTER_IDS.filter(id => ADAPTER_PROFILES[id].platform === platform || ADAPTER_PROFILES[id].platform === '');
@@ -20,6 +20,7 @@ import { fileURLToPath } from 'node:url';
20
20
  import { parseArgs } from 'node:util';
21
21
  import { data_home, entry_settings, entry_status, stop_entry } from '../gateway/gateway.mjs';
22
22
  import { local_status } from './discussion_local.mjs';
23
+ import { relay_health_text } from './relay_health_text.mjs';
23
24
  import { stop_tunnel } from './hosting_tunnel.mjs';
24
25
  import { launcher_path } from './launcher.mjs';
25
26
  import { running_elevated } from './os_users.mjs';
@@ -43,7 +44,7 @@ export const HELP = t(`用法:codiscuss admin <命令> [参数](与管理面
43
44
  update [check] 检查更新;不带 check 时安装最新版(面板未运行时先启动)并等待每一步结果
44
45
 
45
46
  本机
46
- status [--full] 概览:服务、版本、开机自启、登录入口、托管账号;--full 输出面板的完整状态
47
+ status [--full] 概览:服务、中转状态、版本、开机自启、登录入口、托管账号;--full 输出面板的完整状态
47
48
  service start|stop|restart 只启停共议服务(网站与讨论服务)
48
49
  autostart on|off 登录 Windows 时自动启动
49
50
 
@@ -51,6 +52,7 @@ export const HELP = t(`用法:codiscuss admin <命令> [参数](与管理面
51
52
  site status 本地网页与线上网站的地址
52
53
  site connect <接入码|站点> [绑定令牌] 绑定线上网站(管理员外出、邀请外部专家用);在部署该网站的电脑上只填站点即可
53
54
  site disconnect 解绑线上网站,已配对的设备不能再连到这台电脑
55
+ site reconnect 立即重连已绑定网站的中转
54
56
 
55
57
  登录入口与访问方式(需打开托管管理)
56
58
  entry start|stop 启动或停止登录入口
@@ -80,7 +82,7 @@ API 密钥、技能、工作流、系统提示词(目标同上)
80
82
  key list <目标> / key add <目标> --base-url <地址> --key <密钥> / key remove <目标> <编号>
81
83
  skill library / skill import <文件夹或.zip> / skill delete <名>
82
84
  skill list <目标> / skill install <目标> <名>... / skill remove <目标> <名>...
83
- workflow list <目标> / workflow install <目标>
85
+ workflow list <目标> / workflow install <目标> / workflow update <目标>
84
86
  prompt get <目标> / prompt set <目标> --file <文件> [--group <键>] 管理员的提示词按组保存(见 prompt get)
85
87
  prompt default get / prompt default set --file <文件> 新托管账号的默认系统提示词
86
88
 
@@ -232,6 +234,7 @@ async function workflow_command(call, [action, who]) {
232
234
  const base = is_owner(need(who, t('目标'))) ? 'owner/workflows' : `accounts/${who}/workflows`;
233
235
  if (action === 'list') return call(base);
234
236
  if (action === 'install') return call(`${base}/install`, {});
237
+ if (action === 'update') return call(`${base}/update`, {});
235
238
  throw new Error(HELP);
236
239
  }
237
240
 
@@ -349,6 +352,7 @@ async function site_command(call, [action, first, second]) {
349
352
  }
350
353
  if (action === 'connect') return call('site/connect', { site: need(first, t('站点')), setup_key: second || '' });
351
354
  if (action === 'disconnect') return call('site/disconnect', {});
355
+ if (action === 'reconnect') return call('site/reconnect', {});
352
356
  throw new Error(HELP);
353
357
  }
354
358
 
@@ -370,11 +374,11 @@ function summary(state) {
370
374
  const tunnel = entry?.tunnel ? (entry.tunnel.connected ? t('已连接') : entry.tunnel.running ? t('连接中') : t('未运行')) : undefined;
371
375
  return { hosting: state.hosting, version: state.version, autostart: state.autostart,
372
376
  service: { running: service.running, url: service.url, version: service.version, error: service.error || undefined },
373
- online_site: state.online_site || undefined,
377
+ online_site: state.online_site || undefined, relay_health: state.relay_health || undefined,
374
378
  ...(state.hosting ? {
375
379
  entry: entry && { running: entry.running, relay_enabled: entry.relay_enabled, tunnel_enabled: entry.tunnel_enabled, address: entry.address || undefined, tunnel, problem: entry.relay?.problem || undefined },
376
380
  runtime: state.clis,
377
- accounts: state.accounts.map(item => ({ name: item.name, isolated: Boolean(item.os_user), protected: item.protected, running: item.running, disabled: item.disabled })),
381
+ accounts: state.accounts.map(item => ({ name: item.name, isolated: Boolean(item.os_user), protected: item.protected, running: item.running, disabled: item.disabled, last_restart: item.last_restart })),
378
382
  } : {}) };
379
383
  }
380
384
 
@@ -415,8 +419,20 @@ export async function admin_cli(args, { client = panel_client, print = text => p
415
419
  const commands = {
416
420
  status: async () => {
417
421
  const { login_methods: _methods, providers: _providers, ...state } = await call('state');
422
+ if (state.online_site) {
423
+ const { label, detail } = relay_health_text(state.online_site, state.relay_health, t);
424
+ state.relay_health = { state: 'unknown', ...state.relay_health, label, detail };
425
+ }
418
426
  // The state leaves out the entry's checks over the network; they are asked apart.
419
- if (state.hosting) state.entry = await call('entry');
427
+ if (state.hosting) {
428
+ state.entry = await call('entry');
429
+ for (const account of state.accounts) {
430
+ const restart = account.last_restart;
431
+ if (restart) account.last_restart = { at: new Date(restart.at).toISOString(), result: restart.result,
432
+ reason: t(restart.reason.template, restart.reason.params), blocked: restart.blocked,
433
+ error: restart.error && t(restart.error.template, restart.error.params) };
434
+ }
435
+ }
420
436
  return values.full ? state : summary(state);
421
437
  },
422
438
  service: () => call(`service/${need(rest[0], 'start|stop|restart')}`, {}),