ai_co_discuss 0.4.88 → 0.4.90

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.
@@ -1122,6 +1122,17 @@ CREATE TABLE IF NOT EXISTS local_machines (
1122
1122
  seen_at INTEGER NOT NULL DEFAULT 0,
1123
1123
  created_at INTEGER NOT NULL
1124
1124
  );
1125
+ -- One-time binding tokens a bound computer issues for a hosted account on itself (10 minutes, hash only); a computer
1126
+ -- bound this way is that computer's child and cannot issue tokens of its own (2026-11-19, #5494).
1127
+ CREATE TABLE IF NOT EXISTS machine_setup (
1128
+ token_hash TEXT PRIMARY KEY,
1129
+ parent_id TEXT NOT NULL REFERENCES local_machines(id) ON DELETE CASCADE,
1130
+ created_at INTEGER NOT NULL
1131
+ );
1132
+ CREATE TABLE IF NOT EXISTS machine_parents (
1133
+ machine_id TEXT PRIMARY KEY REFERENCES local_machines(id) ON DELETE CASCADE,
1134
+ parent_id TEXT NOT NULL REFERENCES local_machines(id) ON DELETE CASCADE
1135
+ );
1125
1136
  -- A room launch submitted from a device without the local service; the paired computer claims and runs it.
1126
1137
  -- The request (with the room's new credentials) is cleared once the launch finishes or fails.
1127
1138
  CREATE TABLE IF NOT EXISTS remote_launches (
@@ -175,7 +175,7 @@ npx wrangler deploy --config deploy/entry.wrangler.jsonc
175
175
  "vars": { "ENTRY_URL": "https://codiscuss-entry.<账号子域>.workers.dev" }
176
176
  ```
177
177
 
178
- 接入一台托管电脑:在你(部署线上站点的电脑)的管理面板“概览 → 登录入口 → 托管账号入口”选“线上网站”,展开“生成接入码”,填部署配置路径与站点地址后生成(需已登录 wrangler;一次性,再生成会让未用过的作废);把接入码发给托管电脑,粘贴到它的同一个窗口点“接入并开启”,它会绑定站点、取得入口地址、启动所需服务并开启线上网站(已开启的自有域名不受影响,两者可同时使用)。面板给出的链接带电脑编号(`?m=…`),发给使用者即可。使用者的请求经入口 Worker 和中转到达这台电脑的登录入口,登录、会话与入口保护都在电脑上;Cloudflare 能看到这些往来内容(与自有域名隧道相同),每个页面的请求都计入 Workers 免费额度。
178
+ 接入一台托管电脑:在你(部署线上站点的电脑)的管理面板“概览 → 本机 → 线上网站”点“生成接入码”,填部署配置路径与站点地址后生成(需已登录 wrangler;一次性,再生成会让未用过的作废);把接入码发给托管电脑,在它的“本机 → 线上网站”点“绑定”粘贴,再到“登录入口 → 托管账号入口”打开“经线上网站中转”的开关,它会取得入口地址并启动所需服务(已开启的自有域名不受影响,两者可同时使用;命令行 `codiscuss admin entry join 接入码` 一步完成这些)。托管账号要邀请外部专家时,在“账号”页打开“允许邀请外部专家”,面板自动替该账号绑定,不需要接入码。面板给出的链接带电脑编号(`?m=…`),发给使用者即可。使用者的请求经入口 Worker 和中转到达这台电脑的登录入口,登录、会话与入口保护都在电脑上;Cloudflare 能看到这些往来内容(与自有域名隧道相同),每个页面的请求都计入 Workers 免费额度。
179
179
 
180
180
  ## 常见问题
181
181
 
@@ -173,7 +173,7 @@ It gets its own `workers.dev` address (such as `https://codiscuss-entry.<account
173
173
  "vars": { "ENTRY_URL": "https://codiscuss-entry.<account-subdomain>.workers.dev" }
174
174
  ```
175
175
 
176
- To connect a hosted computer: in the admin panel of your computer (the one that deployed the online site), go to **Overview → Sign-in entry → Hosted account entry**, choose **Online site**, expand **Generate connect code**, fill in the deployment config path and site address, and generate it (wrangler must be signed in; the code is single-use, and generating a new one voids unused ones). Send the code to the hosted computer and paste it into the same window there, then click **Connect and turn on**: it binds the site, gets the entry address, starts the needed services and turns on the online site (your own domain, if on, stays on; both can be used together). The link the panel shows carries the computer's ID (`?m=…`); send it to the users. Their requests reach this computer's sign-in entry through the entry Worker and the relay, while sign-in, sessions and entry protection all stay on the computer. Cloudflare can see this traffic (as with a tunnel on your own domain), and every page request counts against the free Workers quota.
176
+ To connect a hosted computer: in the admin panel of your computer (the one that deployed the online site), go to **Overview → This computer → Online site**, choose **Generate access code**, fill in the deployment config path and site address, and generate it (wrangler must be signed in; the code is single-use, and generating a new one voids unused ones). Send it to the hosted computer, paste it under **This computer → Online site → Bind** there, then turn on **Through the online site** under **Sign-in entry → Hosted account entry**; it fetches the entry address and starts what it needs (an enabled own domain is unaffected and both can be on; `codiscuss admin entry join <code>` does all of this in one step). For a hosted account to invite external experts, turn on **Allow inviting external experts** for it on the Accounts page; the panel binds it for you, with no access code. The link the panel shows carries the computer's ID (`?m=…`); send it to the users. Their requests reach this computer's sign-in entry through the entry Worker and the relay, while sign-in, sessions and entry protection all stay on the computer. Cloudflare can see this traffic (as with a tunnel on your own domain), and every page request counts against the free Workers quota.
177
177
 
178
178
  ## Troubleshooting
179
179
 
package/docs/en/runner.md CHANGED
@@ -71,7 +71,7 @@ If you deploy the site yourself, run this once on the machine running your agent
71
71
  codiscuss local connect https://your-site
72
72
  ```
73
73
 
74
- It binds this computer to the site with a one-time token: generated automatically on the machine that deployed the site (after `wrangler login`); otherwise run `codiscuss token` there first and add `--setup-key TOKEN`. Each token works once. The hosted site has no accounts or passwords and keeps no rooms: every device pairs with this computer first, then reads and writes its rooms through the relay, which must be deployed first (see "Relay" in the [deployment guide](deployment.md)). Revoke with `codiscuss local disconnect https://your-site`.
74
+ It binds this computer to the site with a one-time token: generated automatically on the machine that deployed the site (after `wrangler login`); otherwise run `codiscuss token` there first and add `--setup-key TOKEN`. Each token works once. Without the command line: in this computer's management panel, choose Bind under This computer → Online site and paste the access code generated on the deploying computer (Generate access code in the same place there, or `codiscuss admin entry code`). Inviting external experts also needs this binding. For a hosted account to invite external experts, turn on Allow inviting external experts for it on the Accounts page; the panel binds it for you, with no access code. The hosted site has no accounts or passwords and keeps no rooms: every device pairs with this computer first, then reads and writes its rooms through the relay, which must be deployed first (see "Relay" in the [deployment guide](deployment.md)). Revoke with `codiscuss local disconnect https://your-site`.
75
75
 
76
76
  ### From Other Devices
77
77
 
@@ -90,7 +90,7 @@ Invite an AI on another computer into your room: it reads only the project files
90
90
 
91
91
  **Invite (your computer)**:
92
92
  1. In the new-room panel or Invite members, click "External expert +" on the External row (once per expert), then on the card's back select what they can see (Room messages / Messages and project) and the membership duration after check-in. "Messages and project" opens all of the room's project folders.
93
- 2. Choose Invite (automatic when creating the room). The seat appears immediately in the right-hand roster. Above the message box, "External expert · awaiting check-in" offers Copy invitation link, or Invitation details for the QR code; share either. The link lasts 10 minutes and binds one member; regenerating it invalidates the previous link. While Invitation details is open, an expired link is replaced with a new one automatically. Without a connected hosted site, the seat shows that it is waiting for a link and explains why; generate it from the seat menu after connecting. Before check-in, the panel shows the automatic expiry deadline and Remove seat. Usage, read logs and access adjustments appear after check-in.
93
+ 2. Choose Invite (automatic when creating the room). The seat appears immediately in the right-hand roster. When added from the invite dialog, the dialog stays on an "added" step where you can choose Copy invitation link right away. Above the message box, "<name> awaiting check-in: send the invitation link to the invitee" offers Copy invitation link (also in the member menu), or Invitation details for the QR code; share either. The link lasts 10 minutes and binds one member; regenerating it invalidates the previous link. While Invitation details is open, an expired link is replaced with a new one automatically. Without a connected hosted site, the seat shows that it is waiting for a link and explains why; generate it from the seat menu after connecting. Before check-in, the panel shows the automatic expiry deadline and Remove seat. Usage, read logs and access adjustments appear after check-in.
94
94
  3. Redemption completes check-in and starts the membership duration, with **no extra approval step**. Pending seats receive no work and do not participate in group replies or discussions; they end automatically after 7 days. An expired link leaves the seat intact.
95
95
  4. `@` it in the room; its answers appear in the conversation as usual. "Read log and access" in the member menu lists every file it read (recorded by your computer) and lets you extend, switch to messages only, or revoke; revoking takes effect immediately. Once a member has ended (expired, left or revoked) it stays dimmed below the roster with the reason; Invite back makes a new link that brings the same member back, keeping its name and history in the room. If the other side still keeps its invited-room record, that record and its settings carry on; if it was deleted, a new one starts.
96
96
  5. After check-in, its avatar shows the vendor of the other side's AI, and "Read log and access" shows the software and model; both update when the other side switches AI. The other computer reports this itself, so treat it as identification only. A custom endpoint shows the external expert icon.
package/docs/runner.md CHANGED
@@ -85,7 +85,7 @@ Windows 上在终端运行 `codiscuss setup` 时,“安装配置”一步有
85
85
  codiscuss local connect https://你的站点
86
86
  ```
87
87
 
88
- 它用一次性绑定令牌把这台电脑绑定到网站:在部署网站的电脑上(已 `wrangler login`)自动生成,否则先在部署网站的电脑上运行 `codiscuss token`,再加 `--setup-key 令牌`。每个令牌只能用一次。线上网站没有账号和密码,也不保存房间;任何设备都要先与这台电脑配对,再经中转读写电脑上的房间,需先部署中转(见[部署指南](deployment.md)“中转”)。撤销使用 `codiscuss local disconnect https://你的站点`。
88
+ 它用一次性绑定令牌把这台电脑绑定到网站:在部署网站的电脑上(已 `wrangler login`)自动生成,否则先在部署网站的电脑上运行 `codiscuss token`,再加 `--setup-key 令牌`。每个令牌只能用一次。也可以不用命令行:在这台电脑的管理面板“本机 → 线上网站”点“绑定”,粘贴部署网站的电脑生成的接入码(它的同一处“生成接入码”,或 `codiscuss admin entry code`),一步完成。邀请外部专家也需要先绑定。托管账号要邀请外部专家时,在“账号”页打开该账号的“允许邀请外部专家”,面板会自动替它绑定,不需要接入码。线上网站没有账号和密码,也不保存房间;任何设备都要先与这台电脑配对,再经中转读写电脑上的房间,需先部署中转(见[部署指南](deployment.md)“中转”)。撤销使用 `codiscuss local disconnect https://你的站点`。
89
89
 
90
90
  ### 在其他设备上远程控制
91
91
 
@@ -121,7 +121,7 @@ codiscuss local connect https://你的站点
121
121
 
122
122
  **邀请(你的电脑)**:
123
123
  1. 建房面板或右栏“邀请成员”里点“外部”一行的“外部专家 +”(可加多位),翻到卡片背面设置“对方能看到”(房间消息 / 消息和项目)和签到后的有效期。选“消息和项目”时开放本房间的全部项目目录。
124
- 2. 点“邀请”(建房时自动添加),右栏名单立即显示待签到成员。输入框上方会出现“外部专家 · 待签到”,点“复制邀请链接”直接复制,或点“邀请详情”查看二维码,发给对方。链接 10 分钟有效,只能绑定一位成员;重新生成会立即作废旧链接。“邀请详情”开着时,链接到期会自动换成新的。未绑定线上站点时显示“待生成链接”及原因,绑定站点后从席位菜单生成。待签到面板显示自动结束期限,可“移除席位”;签到后才显示用量、读取记录和授权调整。
124
+ 2. 点“邀请”(建房时自动添加),右栏名单立即显示待签到成员。从邀请弹窗添加时,弹窗会停在“已加入”一步,可直接点“复制邀请链接”。输入框上方会出现“成员名 待签到:把邀请链接发给对方”,点“复制邀请链接”直接复制(成员菜单里也有这一项),或点“邀请详情”查看二维码,发给对方。链接 10 分钟有效,只能绑定一位成员;重新生成会立即作废旧链接。“邀请详情”开着时,链接到期会自动换成新的。未绑定线上站点时显示“待生成链接”及原因,绑定站点后从席位菜单生成。待签到面板显示自动结束期限,可“移除席位”;签到后才显示用量、读取记录和授权调整。
125
125
  3. 对方兑换即完成签到,成员有效期从兑换时开始,**没有额外批准步骤**。未签到不收任务、不参与全体回应或讨论,7 天后自动结束;链接过期不会删除席位。
126
126
  4. 在房间里 `@` 它,回答照常出现在对话中。成员菜单的“读取记录与权限”列出它读过的每个文件(由你的电脑记录),可延长、改为只看消息或撤销授权,撤销立即生效。成员结束后(到期、对方退出或撤销)仍灰显在名单下方并写明原因,点“重新邀请”可生成新链接把原成员请回:名字和房间里的历史不变;对方若还保留那条被邀请记录,记录与设置也接着用,删了则新建。
127
127
  5. 签到后头像显示对方 AI 的厂家,“读取记录与权限”里可看到软件和模型;对方换 AI 后自动更新。这些信息由对方电脑自报,仅供辨认。自定义接口显示外部专家图标。
@@ -146,7 +146,6 @@
146
146
  "刷新全部": "Refresh all",
147
147
  "请求失败({value1})": "Request failed ({value1})",
148
148
  "线上网站": "Online site",
149
- "不需要域名:经共议线上站点中转到这台电脑,手机和外地的电脑都能打开。需要先用接入码接入线上站点。": "No domain needed: relay through a CoDiscuss online site to this computer, accessible from phones and remote computers. Connect to the online site with an access code first.",
150
149
  "自有域名": "Own domain",
151
150
  "用你托管在 Cloudflare 的域名,经 Cloudflare 隧道连到这台电脑。需要有自己的域名。": "Connect a domain you host on Cloudflare to this computer through a Cloudflare Tunnel. Requires your own domain.",
152
151
  "已连接": "Connected",
@@ -157,8 +156,6 @@
157
156
  "登录入口启动后隧道随之启动": "The tunnel starts with the sign-in entry",
158
157
  "暂时打不开": "Temporarily unavailable",
159
158
  "可以访问": "Accessible",
160
- "已接入 {value1},开启时取得入口地址": "Connected to {value1}; the entry address is obtained when you turn it on",
161
- "已关闭线上网站": "Online site turned off",
162
159
  "已开启自有域名": "Own domain turned on",
163
160
  "已关闭自有域名": "Own domain turned off",
164
161
  "没有找到 {value1}": "{value1} not found",
@@ -300,14 +297,8 @@
300
297
  "未创建": "Not created",
301
298
  "保存后创建该文件": "This file will be created when saved",
302
299
  "撤销修改": "Discard changes",
303
- "已开启线上网站": "Online site turned on",
304
- "托管账号的使用者经共议线上站点访问这台电脑,不需要自有域名": "Hosted account users access this computer through a CoDiscuss online site; no domain of your own needed",
305
- "已接入 {value1}": "Connected to {value1}",
306
300
  "· 入口 {value1}": "· Entry {value1}",
307
- "。换站点时粘贴新的接入码。": ". Paste a new access code to switch sites.",
308
301
  "接入码": "Access code",
309
- "向为你提供线上站点的人要(自己部署了线上站点的,在下面生成)。只能用一次。": "Ask your online site provider for one (if you host the site yourself, generate one below). Single use only.",
310
- "接入并开启": "Connect and turn on",
311
302
  "生成接入码": "Generate access code",
312
303
  "在部署线上站点的电脑上用": "On the computer deploying the online site, use",
313
304
  "部署配置": "Deployment config",
@@ -315,8 +306,6 @@
315
306
  "站点地址": "Site address",
316
307
  "生成": "Generate",
317
308
  "复制接入码": "Copy access code",
318
- "发给托管电脑的操作者,粘贴到它的这个窗口里。只能用一次;再生成一个会让之前没用过的作废。": "Send this to the operator of the hosting computer to paste into this dialog there. Single use only; generating another invalidates unused codes.",
319
- "线上网站和自有域名隧道一样,Cloudflare 能看到托管账号的往来内容;登录、会话与入口保护仍由这台电脑负责。每个页面的请求都经过 Cloudflare Workers,免费额度适合少量使用者,人多时改用自有域名。": "As with a tunnel using your own domain, Cloudflare can see hosted accounts' traffic over the online site. This computer still handles sign-in, sessions and entry protection. Every page request goes through Cloudflare Workers; the free quota suits a small number of users. Use your own domain for more users.",
320
309
  "已加入技能库:{value1}": "Added to skill library: {value1}",
321
310
  "{value1} 不是文件夹或 .zip,已跳过": "{value1} is not a folder or .zip; skipped",
322
311
  "已从技能库删除 {value1}": "Deleted {value1} from skill library",
@@ -368,12 +357,8 @@
368
357
  "绑定": "Bind",
369
358
  "解绑": "Unbind",
370
359
  "共议服务未运行": "The CoDiscuss service is not running",
371
- "绑定后,扫码配对过的设备可以在外面使用这台电脑": "Once bound, devices paired by QR code can use this computer from anywhere",
372
360
  "共议服务未运行,线上网站暂时连不上这台电脑": "The CoDiscuss service is not running, so the online site cannot reach this computer for now",
373
361
  "绑定线上网站": "Bind online site",
374
- "你部署的共议线上网站,绑定后在本地网页的“设置”里给手机等设备配对": "The CoDiscuss online site you deployed. Once bound, pair phones and other devices under Settings on the local page",
375
- "绑定令牌": "Binding token",
376
- "在部署这个网站的电脑上运行 codiscuss token 获得,只能用一次;就在那台电脑上绑定时可以不填": "Run codiscuss token on the computer that deployed this site. It works once. Leave it empty when binding on that computer",
377
362
  "已绑定线上网站": "Online site bound",
378
363
  "已解绑线上网站": "Online site unbound",
379
364
  "解绑线上网站": "Unbind online site",
@@ -387,5 +372,22 @@
387
372
  "你自己使用这台电脑的入口。": "Your own ways into this computer.",
388
373
  "{value1} 有新版本": "New version of {value1}",
389
374
  "托管账号从这份副本运行。更新共议时会自动同步;Claude Code 等程序单独升级后,在这里同步一次。": "Hosted accounts run from this copy. Updating CoDiscuss syncs it automatically; sync here once after upgrading Claude Code or another program on its own.",
390
- "登录入口未运行,使用者暂时无法登录": "The sign-in entry is not running, so users cannot sign in for now"
375
+ "登录入口未运行,使用者暂时无法登录": "The sign-in entry is not running, so users cannot sign in for now",
376
+ "已允许该账号邀请外部专家": "This account can now invite external experts",
377
+ "已停止该账号邀请外部专家": "This account can no longer invite external experts",
378
+ "允许邀请外部专家": "Allow inviting external experts",
379
+ "这台电脑未绑定线上网站,请先在“概览 → 本机 → 线上网站”绑定": "This computer is not bound to an online site. Bind it first under Overview → This computer → Online site",
380
+ "扫码配对过的设备可以在外面使用这台电脑": "Devices paired by QR code can use this computer from elsewhere",
381
+ "需先在“本机 → 线上网站”绑定": "Bind under This computer → Online site first",
382
+ "经线上网站中转": "Through the online site",
383
+ "不需要域名:经共议线上网站中转到这台电脑,手机和外地的电脑都能打开。需要这台电脑已在“本机 → 线上网站”绑定。": "No domain needed: relayed through the CoDiscuss online site to this computer, so phones and computers elsewhere can open it. This computer must be bound under This computer → Online site.",
384
+ "已开启经线上网站中转": "Relay through the online site turned on",
385
+ "已关闭经线上网站中转": "Relay through the online site turned off",
386
+ "其他设备远程使用、邀请外部专家、托管账号经线上网站登录都需要": "Needed for using this computer from other devices, inviting external experts, and hosted accounts signing in through the online site",
387
+ "在部署线上网站的电脑上,为其他电脑生成绑定用的接入码": "On the computer that deployed the online site, make an access code for binding another computer",
388
+ "绑定共议线上网站(形如 https://xxx.pages.dev),不是你的自有域名": "Bind the CoDiscuss online site (like https://xxx.pages.dev), not your own domain",
389
+ "在部署线上网站的电脑上生成(它的管理面板“本机 → 线上网站 → 生成接入码”,或运行 codiscuss admin entry code),只能用一次。就在那台电脑上绑定时,只填站点地址即可。": "Generate it on the computer that deployed the online site (its management panel: This computer → Online site → Generate access code, or run codiscuss admin entry code); each code works once. On that computer itself, the site address alone is enough.",
390
+ "发给要绑定的电脑,在它的管理面板“本机 → 线上网站 → 绑定”里粘贴。只能用一次;再生成一个会让之前没用过的作废。": "Send it to the computer to bind and paste it in its management panel under This computer → Online site → Bind. It works once; generating another voids any unused earlier one.",
391
+ "打开后自动替这个账号绑定线上网站,它就能在房间里邀请另一台电脑上的 AI": "Turning this on binds the account to the online site for it, so it can invite AI on other computers into its rooms",
392
+ "不需要域名:经共议线上网站中转到这台电脑,手机和外地的电脑都能打开。": "No domain needed: relayed through the CoDiscuss online site to this computer, so phones and computers elsewhere can open it."
391
393
  }
@@ -816,5 +816,12 @@
816
816
  "读取总量已达上限": "The total read volume limit has been reached",
817
817
  "配额 {key} 须为 1–{limit} 的整数": "Quota {key} must be an integer from 1 to {limit}",
818
818
  "需要本房间外部成员的凭证": "This room's external member credential is required",
819
- "diffs 须为最多 {max_changed_files} 项的列表": "diffs must be a list of at most {max_changed_files} items"
819
+ "diffs 须为最多 {max_changed_files} 项的列表": "diffs must be a list of at most {max_changed_files} items",
820
+ "还有托管账号开着“允许邀请外部专家”,请先在“账号”页关闭": "Some hosted accounts still allow inviting external experts; turn that off on the Accounts page first",
821
+ "这台电脑未绑定线上网站,请在管理面板“本机 → 线上网站”处绑定": "This computer is not bound to an online site. Bind it under This computer → Online site in the management panel.",
822
+ "{value1} 的线上网站版本过旧,请部署方更新线上网站后再试": "The online site at {value1} is too old; ask whoever deploys it to update it, then try again",
823
+ "线上网站没有签发绑定令牌:{value1}": "The online site did not issue a binding token: {value1}",
824
+ "绑定令牌已过期,请重试": "The binding token expired; try again",
825
+ "线上网站没有释放这个账号:{value1}": "The online site did not release this account: {value1}",
826
+ "请先关闭该账号的“允许邀请外部专家”,再更改隔离": "Turn off Allow inviting external experts for this account before changing its isolation"
820
827
  }
@@ -82,5 +82,10 @@
82
82
  "绑定失败(退出码 {value1})": "Binding failed (exit code {value1})",
83
83
  "这台电脑已绑定 {value1},请先解绑": "This computer is already bound to {value1}. Unbind it first",
84
84
  "这个地址不是共议线上站点:{value1}": "This address is not a CoDiscuss online site: {value1}",
85
- "托管账号入口的线上网站还开着,请先关闭它": "The hosted accounts' online site is still on. Turn it off first"
85
+ "托管账号入口的线上网站还开着,请先关闭它": "The hosted accounts' online site is still on. Turn it off first",
86
+ "这个电脑编号已绑定,不能用托管账号的令牌改绑": "This computer id is already bound and cannot be rebound with a hosted account's token",
87
+ "托管账号的电脑不能再签发绑定令牌": "A hosted account's computer cannot issue binding tokens",
88
+ "未使用的绑定令牌过多,请稍后再试": "Too many unused binding tokens; try again later",
89
+ "这台电脑绑定的托管账号已达上限 {max} 个": "This computer has reached its limit of {max} bound hosted accounts",
90
+ "这台电脑名下没有这个托管账号": "This computer has no such hosted account"
86
91
  }
@@ -212,5 +212,14 @@
212
212
  "{count} 天内未签到自动结束": "Ends automatically if not checked in within {count} days",
213
213
  "移除席位": "Remove seat",
214
214
  "席位已移除": "Seat removed",
215
- "生成链接": "Generate link"
215
+ "生成链接": "Generate link",
216
+ "成员已加入:手动成员把启动指令交给各自的 AI 会话,外部专家把邀请链接发给对方;注册或签到后才算到场。": "Members added: give each manual member's launch instruction to its own AI session and send each external expert their invitation link; they count as present once registered or checked in.",
217
+ "{count} 个外部专家席位已加好,把邀请链接分别发给对方,对方签到后才算到场。": "{count} external expert seats added. Send each invitation link to its invitee; they count as present once they check in.",
218
+ "外部专家席位已加好,把邀请链接发给对方,对方签到后才算到场。": "External expert seat added. Send the invitation link to the invitee; they count as present once they check in.",
219
+ "邀请链接只发给要邀请的人;关闭后仍可在输入框上方或成员菜单的“邀请详情”里复制。": "Send the invitation link only to the person you are inviting. After closing, you can still copy it above the message box or from Invitation details in the member menu.",
220
+ "已签到": "Checked in",
221
+ "启动新成员": "Start new members",
222
+ "已复制邀请链接": "Invitation link copied",
223
+ "{value1} 待签到:把邀请链接发给对方": "{value1} awaiting check-in: send the invitation link to the invitee",
224
+ "选择一个 AI 派去对方房间,点卡片翻面可设置软件、模型和本机权限。": "Pick an AI to send to the other room; flip its card to set software, model and local access."
216
225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.4.88",
3
+ "version": "0.4.90",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -15,6 +15,8 @@
15
15
  * status the skills installed, the prompt, and whether the layout is complete.
16
16
  * skills install the skill folders in <job>/skills/ (replacing a copy of the same name) and remove request.remove.
17
17
  * prompt write request.prompt as the system prompt of all three.
18
+ * site bind the service home request.home to the online site request.site with the one-time child token
19
+ * request.setup_key, or remove that binding (request.unbind); the binding file is sealed for this user.
18
20
  */
19
21
  import { cpSync, existsSync, linkSync, lstatSync, mkdirSync, readdirSync, readFileSync, readlinkSync, renameSync, rmSync, symlinkSync, unlinkSync, writeFileSync } from 'node:fs';
20
22
  import { homedir } from 'node:os';
@@ -144,15 +146,22 @@ function prompt(request) {
144
146
  return { ok: true, layout: layout_status() };
145
147
  }
146
148
 
147
- function main() {
149
+ /** Bind or unbind this user's service home on the online site; the panel gave a one-time child token. */
150
+ async function site(request) {
151
+ const { bind_machine, save_site_connection } = await import('./discussion_local.mjs');
152
+ if (request.unbind) { save_site_connection(request.home, request.site); return { ok: true }; }
153
+ return { machine: await bind_machine(request.home, request.site, request.setup_key) };
154
+ }
155
+
156
+ async function main() {
148
157
  const [action, job] = process.argv.slice(2);
149
158
  const path = join(job, 'request.json');
150
159
  const request = existsSync(path) ? JSON.parse(readFileSync(path, 'utf8')) : {};
151
160
  // The job folder is the owner's; the request goes when the owner removes it.
152
161
  try { rmSync(path, { force: true }); } catch { /* removed with the job folder */ }
153
- const run = { init, status, skills: () => skills(job, request), prompt }[action];
162
+ const run = { init, status, skills: () => skills(job, request), prompt, site }[action];
154
163
  if (!run) throw new Error(`未知操作:${action}`);
155
- process.stdout.write(`${JSON.stringify(run(request))}\n`);
164
+ process.stdout.write(`${JSON.stringify(await run(request))}\n`);
156
165
  }
157
166
 
158
- try { main(); } catch (error) { process.stdout.write(`${JSON.stringify({ error: error.message })}\n`); process.exitCode = 1; }
167
+ main().catch(error => { process.stdout.write(`${JSON.stringify({ error: error.message })}\n`); process.exitCode = 1; });
@@ -49,7 +49,7 @@ export const HELP = t(`用法:codiscuss admin <命令> [参数](与管理面
49
49
 
50
50
  管理员入口
51
51
  site status 本地网页与线上网站的地址
52
- site connect <站点> [绑定令牌] 绑定线上网站(管理员外出用);在部署该网站的电脑上可不填令牌
52
+ site connect <接入码|站点> [绑定令牌] 绑定线上网站(管理员外出、邀请外部专家用);在部署该网站的电脑上只填站点即可
53
53
  site disconnect 解绑线上网站,已配对的设备不能再连到这台电脑
54
54
 
55
55
  登录入口与访问方式(需打开托管管理)
@@ -67,6 +67,7 @@ export const HELP = t(`用法:codiscuss admin <命令> [参数](与管理面
67
67
  中途失败时解决后重新执行同一命令,从缺少的步骤接着做
68
68
  account start|stop|disable|enable|remove|password <名>
69
69
  account isolate|unisolate|protect|unprotect <名>
70
+ account external|unexternal <名> 允许或停止该账号邀请外部专家(自动替它绑定这台电脑绑定的线上网站)
70
71
 
71
72
  命令行登录(目标 owner 为管理员自己,否则为托管账号名)
72
73
  login status <目标> 各程序的登录状态,以及每个程序可用的登录方式
@@ -151,6 +152,7 @@ async function account_command(call, [action, name], values) {
151
152
  need(name, t('account {value1} <名>', { value1: action }));
152
153
  if (action === 'add') return add_account(call, name, { isolate: !values['no-isolate'], start: !values['no-start'] });
153
154
  if (action === 'protect' || action === 'unprotect') return call(`accounts/${name}/protect`, { on: action === 'protect' });
155
+ if (action === 'external' || action === 'unexternal') return call(`accounts/${name}/external`, { on: action === 'external' });
154
156
  if (!ACCOUNT_ACTIONS[action]) throw new Error(HELP);
155
157
  return call(`accounts/${name}/${ACCOUNT_ACTIONS[action]}`, {});
156
158
  }
@@ -362,7 +362,8 @@ async function list_accounts(data) {
362
362
  return Promise.all(Object.entries(read_accounts(data)).map(async ([name, account]) => ({ name, port: account.port, home: account_home(data, name), disabled: Boolean(account.disabled), protected: account.protected === true,
363
363
  os_user: users[name]?.user || '', running: await instance_running(account.port), keys: list_keys(instance_home(data, name)).length,
364
364
  // The AI environment is set up once account_env.mjs has run for its Windows user (it records skills in the service home).
365
- skills: Boolean(users[name]) && existsSync(join(instance_home(data, name), SKILL_RECORD)) })));
365
+ skills: Boolean(users[name]) && existsSync(join(instance_home(data, name), SKILL_RECORD)),
366
+ external: Boolean(read_account_sites(data)[name]) })));
366
367
  }
367
368
 
368
369
  function write_settings(path, value) {
@@ -654,7 +655,7 @@ export function create_panel({ data, key, port, ops = {}, sessions = new Set() }
654
655
  const op = { list_accounts, add_account, reset_password, set_account_disabled, remove_account, run_instance, create_os_user, remove_os_user,
655
656
  login_status, apply_login, logout, start_login, login_progress, submit_login, cancel_login, install_runtime, prepare_account, account_env, account_skills, account_workflows, owner_env, owner_skills, owner_prompts, save_owner_prompt, shared_cli_state,
656
657
  save_api_key, list_keys, remove_key, use_shared_programs, service_overview, run_owner_service, latest_version, check_package, begin_update,
657
- autostart_enabled, set_autostart, entry_overview, start_entry, stop_entry, keep_tunnel, start_tunnel_setup, set_entry_way, set_relay_url, connect_site, make_access_code, join_relay, protect_account, start_verified, hand_over: () => {}, ...ops };
658
+ set_account_external, autostart_enabled, set_autostart, entry_overview, start_entry, stop_entry, keep_tunnel, start_tunnel_setup, set_entry_way, set_relay_url, connect_site, make_access_code, join_relay, protect_account, start_verified, hand_over: () => {}, ...ops };
658
659
  const hosts = new Set([`127.0.0.1:${port}`, `localhost:${port}`]);
659
660
 
660
661
  async function api(method, path, body) {
@@ -764,10 +765,19 @@ export function create_panel({ data, key, port, ops = {}, sessions = new Set() }
764
765
  if (method === 'POST' && action === 'protect') return op.protect_account(data, name, body.on !== false);
765
766
  if (method === 'POST' && (action === 'disable' || action === 'enable')) { op.set_account_disabled(data, name, action === 'disable'); return { disabled: action === 'disable' }; }
766
767
  // The instance stops first: its port goes to the next new account, which must not reach this one's instance.
767
- if (method === 'POST' && action === 'remove') { await op.run_instance(data, name, 'stop'); op.remove_account(data, name); return { removed: name, kept: account_home(data, name) }; }
768
+ if (method === 'POST' && action === 'remove') {
769
+ await op.run_instance(data, name, 'stop');
770
+ // Its online-site binding goes first, or the owner could never unbind the computer afterwards.
771
+ await op.set_account_external(data, name, false, undefined, { removing: true }).catch(() => {});
772
+ op.remove_account(data, name);
773
+ return { removed: name, kept: account_home(data, name) };
774
+ }
775
+ if (method === 'POST' && action === 'external') return op.set_account_external(data, name, body.on !== false);
768
776
  // A start is reported only once the instance serves as the account is set (protected or not).
769
777
  if (method === 'POST' && action === 'start') { await op.start_verified(data, name); return { ok: true }; }
770
778
  if (method === 'POST' && action === 'stop') { await op.run_instance(data, name, action); return { ok: true }; }
779
+ // Its binding file is sealed for whichever Windows user wrote it: changing that user would leave it unreadable.
780
+ if (method === 'POST' && action === 'os-user' && read_account_sites(data)[name]) throw panel_error('请先关闭该账号的“允许邀请外部专家”,再更改隔离');
771
781
  if (method === 'POST' && action === 'os-user' && extra === 'remove') { op.remove_os_user(data, name); return { ok: true }; }
772
782
  if (method === 'POST' && action === 'os-user') {
773
783
  const result = op.create_os_user(data, name, account_home(data, name));
@@ -1017,6 +1027,9 @@ function connect_site(data, site, setup_key) {
1017
1027
  /** Bind this computer to the owner's online site; it has one at a time, and the address must be such a site. */
1018
1028
  async function bind_online_site(data, { site, setup_key }, connect) {
1019
1029
  const bound = bound_site(data);
1030
+ // An access code (`站点/#codiscuss-bind=令牌`) carries both, so one paste binds (user 2026-11-19, #5469).
1031
+ const text = String(site || '').trim(), at = text.indexOf(BIND_MARK);
1032
+ if (at >= 0) { setup_key = text.slice(at + BIND_MARK.length); site = text.slice(0, at); }
1020
1033
  let origin;
1021
1034
  try { origin = new URL(String(site || '').trim()).origin; } catch { throw panel_error('站点地址格式不对,例如 https://xxx.pages.dev'); }
1022
1035
  if (bound && bound.site !== origin) throw panel_error('这台电脑已绑定 {value1},请先解绑', { value1: bound.site });
@@ -1030,10 +1043,83 @@ function disconnect_site(data) {
1030
1043
  const bound = bound_site(data);
1031
1044
  if (!bound) return { disconnected: '' };
1032
1045
  if (entry_settings(data).relay_enabled) throw panel_error('托管账号入口的线上网站还开着,请先关闭它');
1046
+ if (Object.keys(read_account_sites(data)).length) throw panel_error('还有托管账号开着“允许邀请外部专家”,请先在“账号”页关闭');
1033
1047
  save_site_connection(data, bound.site);
1034
1048
  return { disconnected: bound.site };
1035
1049
  }
1036
1050
 
1051
+ // ---- Hosted accounts on the online site (#5494) ----
1052
+
1053
+ const ACCOUNT_SITES_FILE = 'account-sites.json';
1054
+
1055
+ /** The accounts this panel bound to the online site: { name: { site, machine, at } }; their own files are sealed for them. */
1056
+ function read_account_sites(data) {
1057
+ try { return JSON.parse(readFileSync(join(data, ACCOUNT_SITES_FILE), 'utf8')); } catch { return {}; }
1058
+ }
1059
+
1060
+ /**
1061
+ * Let a hosted account invite external experts, or stop. On: this computer, bound to the online site, asks it for a
1062
+ * one-time child token and binds the account's own service home with it, so the account is a computer of its own there
1063
+ * and every external-member protection works as for the owner. Off: the site releases that computer first (its slot
1064
+ * under the cap comes back; a failure stops here for a retry), then the account's own binding is removed. An account
1065
+ * being removed lets go of the record whatever happens. Off by default.
1066
+ */
1067
+ async function set_account_external(data, name, on, bind = bind_account_site, { removing = false } = {}) {
1068
+ const sites = read_account_sites(data);
1069
+ const save = () => write_settings(join(data, ACCOUNT_SITES_FILE), sites);
1070
+ if (!on) {
1071
+ const record = sites[name];
1072
+ if (!record) return { external: false };
1073
+ // The site's slot first: a failure stops here so it can be retried, never leaving a slot held with nothing bound.
1074
+ // An account being removed lets go of the record whatever happens, or the owner could never unbind afterwards.
1075
+ try { await release_account_site(data, record); } catch (error) { if (!removing) throw error; }
1076
+ try { await bind(data, name, { site: record.site, unbind: true }); } catch (error) { if (!removing) throw error; }
1077
+ delete sites[name];
1078
+ save();
1079
+ return { external: false };
1080
+ }
1081
+ const bound = bound_site(data);
1082
+ if (!bound) throw panel_error('这台电脑未绑定线上网站,请在管理面板“本机 → 线上网站”处绑定');
1083
+ const answer = await fetch_outside(`${bound.site}/api/machines/${bound.machine}/setup`, OUTSIDE_TIMEOUT_MS,
1084
+ { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Machine-Token': machine_links(data).sites[bound.site].token }, body: '{}' });
1085
+ const given = await answer.json().catch(() => ({}));
1086
+ if (answer.status === 404) throw panel_error('{value1} 的线上网站版本过旧,请部署方更新线上网站后再试', { value1: bound.site });
1087
+ if (!answer.ok || !given.setup_key) throw panel_error('线上网站没有签发绑定令牌:{value1}', { value1: given.error || answer.status });
1088
+ let result;
1089
+ try { result = await bind(data, name, { site: bound.site, setup_key: given.setup_key }); }
1090
+ catch (error) {
1091
+ // The website words a used or expired token for someone running codiscuss token by hand.
1092
+ if (String(error.message).includes('绑定令牌错误或已用过')) throw panel_error('绑定令牌已过期,请重试');
1093
+ throw error;
1094
+ }
1095
+ sites[name] = { site: bound.site, machine: result.machine || '', at: Date.now() };
1096
+ save();
1097
+ return { external: true, site: bound.site };
1098
+ }
1099
+
1100
+ /** Ask the online site to let go of an account's computer; a site without this (older) or without it any more is done. */
1101
+ async function release_account_site(data, record) {
1102
+ const owner = machine_links(data).sites[record.site];
1103
+ if (!owner?.token || !record.machine) return;
1104
+ const answer = await fetch_outside(`${record.site}/api/machines/${owner.id}/release`, OUTSIDE_TIMEOUT_MS,
1105
+ { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Machine-Token': owner.token }, body: JSON.stringify({ machine: record.machine }) });
1106
+ if (answer.ok || answer.status === 404) return;
1107
+ const given = await answer.json().catch(() => ({}));
1108
+ throw panel_error('线上网站没有释放这个账号:{value1}', { value1: given.error || answer.status });
1109
+ }
1110
+
1111
+ /**
1112
+ * Bind or unbind one account's service home without starting anything (its instance re-reads bindings by itself), as
1113
+ * the account's own Windows user when it has one: the binding file is sealed for whoever writes it.
1114
+ */
1115
+ async function bind_account_site(data, name, { site, setup_key = '', unbind = false }) {
1116
+ const home = instance_home(data, name);
1117
+ if (read_os_users(data)[name]) return account_env(data, name, 'site', { home, site, setup_key, unbind });
1118
+ if (unbind) { save_site_connection(home, site); return { ok: true }; }
1119
+ const { bind_machine } = await import('./discussion_local.mjs');
1120
+ return { machine: await bind_machine(home, site, setup_key) };
1121
+ }
1122
+
1037
1123
  // ---- Hosted accounts' failures, to the owner's Weixin ----
1038
1124
 
1039
1125
  /** Whether two paths name the same place, as written (Windows paths compare without regard to case). */
@@ -241,14 +241,25 @@ export async function open_signed_request(home, id, sealed, machine_id) {
241
241
  */
242
242
  export async function signed_device_list(home, link, now = Date.now(), externals = []) {
243
243
  const { devices } = read_registry(home);
244
- const body = JSON.stringify({ machine: link.id, issued_at: now, devices: [...Object.entries(devices)
244
+ const listed = [...Object.entries(devices)
245
245
  .map(([id, device]) => ({ id, x: device.public_key.x, y: device.public_key.y, expires_at: device.expires_at,
246
246
  ...(renewable(device) ? { renew_until: device.expires_at + RENEW_GRACE_DAYS * DAY_MS } : {}) })),
247
- ...externals.map(({ id, x, y, room, expires_at }) => ({ id, x, y, kind: 'external', room, expires_at }))] });
247
+ ...externals.map(({ id, x, y, room, expires_at }) => ({ id, x, y, kind: 'external', room, expires_at }))];
248
+ // An unchanged list keeps its signature and issued_at, so the heartbeat that carries it is the same each time and
249
+ // the website neither rewrites it nor wakes the relay (2026-11-19, #5500); issued_at is when the content last changed.
250
+ const content = JSON.stringify({ machine: link.id, devices: listed });
251
+ const cache_key = [home, link.id, link.sign_private_key?.x || ''].join('|');
252
+ const cached = signed_lists.get(cache_key);
253
+ if (cached?.content === content) return cached.signed;
254
+ const body = JSON.stringify({ machine: link.id, issued_at: Math.max(now, (cached?.issued_at || 0) + 1), devices: listed });
248
255
  const key = await crypto.subtle.importKey('jwk', link.sign_private_key, { name: 'ECDSA', namedCurve: 'P-256' }, false, ['sign']);
249
256
  const signature = await crypto.subtle.sign({ name: 'ECDSA', hash: 'SHA-256' }, key, new TextEncoder().encode(body));
250
- return { body, signature: b64url(new Uint8Array(signature)) };
257
+ const signed = { body, signature: b64url(new Uint8Array(signature)) };
258
+ signed_lists.set(cache_key, { content, issued_at: JSON.parse(body).issued_at, signed });
259
+ return signed;
251
260
  }
261
+ // The last list signed per service directory and computer: { content, issued_at, signed }.
262
+ const signed_lists = new Map();
252
263
 
253
264
  /** List paired devices with their passkey counts and unlock times, newest first, and the recent audit entries. */
254
265
  export function list_devices(home, current = null) {
@@ -2445,7 +2445,7 @@ export async function launch_main(args = process.argv.slice(2), input_text) {
2445
2445
  // The QR code opens the paired website and carries this computer's key fingerprint for the new device to check.
2446
2446
  const { keyed_links } = await import('./remote_launch.mjs');
2447
2447
  const [site, link] = Object.entries(keyed_links(home).sites).find(([origin]) => !input?.site || origin === input.site) || [];
2448
- if (!link) throw new Error('这台电脑还没有绑定线上网站,请先运行 codiscuss local connect 网站地址');
2448
+ if (!link) throw new Error('这台电脑未绑定线上网站,请在管理面板“本机 → 线上网站”处绑定');
2449
2449
  result = start_pairing(home, { site, fingerprint: machine_fingerprint(link), temporary: input?.temporary === true, without_passkey: input?.without_passkey === true });
2450
2450
  }
2451
2451
  else if (positionals[0] === 'devices' && !values.remote) {
@@ -84,7 +84,7 @@ async function connect_site(home, site, no_open, setup_key) {
84
84
  * Register this computer with an online website using a one-time setup token, then publish its keys and signed device
85
85
  * list. Without a token given, the deploying computer creates one through wrangler, as `codiscuss token` does.
86
86
  */
87
- async function bind_machine(home, origin, setup_key) {
87
+ export async function bind_machine(home, origin, setup_key) {
88
88
  const { machine_link, sync_remote_launches } = await import('./remote_launch.mjs');
89
89
  let key = setup_key;
90
90
  if (!key) {
@@ -99,6 +99,7 @@ async function bind_machine(home, origin, setup_key) {
99
99
  // From now on this website reaches the local one only as the relay's bridge, never with a browser connection credential.
100
100
  (await import('./relay_channel.mjs')).bridge_token(home, origin);
101
101
  await sync_remote_launches(home);
102
+ return link.id;
102
103
  }
103
104
 
104
105
  /** Read the website supervisor's lock and last startup receipt. */
@@ -791,7 +791,7 @@ export async function run_service(home, output = () => {}) {
791
791
  if (!syncing && Date.now() - synced_at >= REMOTE_SYNC_MS) {
792
792
  synced_at = Date.now();
793
793
  channels.refresh();
794
- syncing = sync_remote_launches(home, { log: log_line }).catch(error => log_line(`远程启动检查失败:${error.message}`))
794
+ syncing = sync_remote_launches(home, { log: log_line, throttle: true }).catch(error => log_line(`远程启动检查失败:${error.message}`))
795
795
  .finally(() => { syncing = null; });
796
796
  }
797
797
  if (!relaying && Date.now() - relay_failed_at >= REMOTE_SYNC_MS) start_relay();
@@ -290,8 +290,10 @@ export async function machine_keys(site, machine, { fetcher = fetch, retry_delay
290
290
  }, { repeatable: true, delays: retry_delays });
291
291
  const body = await response.json().catch(() => ({}));
292
292
  const list = (Array.isArray(body) ? body : body.machines || []).filter(item => item?.public_key && item?.sign_key);
293
- if (!machine && list.length > 1) throw failure('machine_required', '对方站点连着多台电脑,请用 --machine 指定电脑编号:{ids}', { ids: list.map(item => `${item.id}(${item.name || ''})`).join('、') });
294
- const found = machine ? list.find(item => item.id === machine) : list[0];
293
+ // Hosted accounts' computers (`parent`) are reached by id only; without one the site's own computers are meant (#5494).
294
+ const owners = list.filter(item => !item.parent);
295
+ if (!machine && owners.length > 1) throw failure('machine_required', '对方站点连着多台电脑,请用 --machine 指定电脑编号:{ids}', { ids: owners.map(item => `${item.id}(${item.name || ''})`).join('、') });
296
+ const found = machine ? list.find(item => item.id === machine) : owners[0];
295
297
  if (!found) throw failure('machine_not_found', '对方站点上找不到这台电脑,或它还没有连接中转');
296
298
  return { id: found.id, public_key: found.public_key, sign_key: found.sign_key, name: String(found.name || ''), fingerprint: fingerprint_of(found.public_key, found.sign_key) };
297
299
  }
@@ -186,7 +186,7 @@ async function invite_site(home, site_url) {
186
186
  const sites = Object.entries(keyed_links(home).sites);
187
187
  const found = site_url ? sites.find(([origin]) => origin === site_url) : sites.length === 1 ? sites[0] : null;
188
188
  if (!found) throw sites.length ? new GatewayError(400, '这台电脑绑定了多个线上网站,请指定邀请使用的网站', {}, 'site_required')
189
- : new GatewayError(400, '这台电脑还没有绑定线上网站,请先运行 codiscuss local connect 网站地址', {}, 'site_missing');
189
+ : new GatewayError(400, '这台电脑未绑定线上网站,请在管理面板“本机 → 线上网站”处绑定', {}, 'site_missing');
190
190
  return { site: found[0], link: found[1] };
191
191
  }
192
192
 
@@ -25,7 +25,7 @@ export default {
25
25
  "已打开:{value1}": "Opened: {value1}",
26
26
  "AI CoDiscuss 讨论服务\n服务目录:{value1}\n已登记 {value2} 个房间\nCtrl+C 停止服务\n": "AI CoDiscuss discussion service\nService folder: {value1}\n{value2} rooms registered\nCtrl+C to stop the service\n",
27
27
  "尚未登记房间;可在另一终端运行 codiscuss service add --config FILE。\n": "No rooms registered yet. Run codiscuss service add --config FILE in another terminal.\n",
28
- "用法:codiscuss admin <命令> [参数](与管理面板的操作一一对应;除启动与退出外,需管理面板正在运行)\n需要管理员权限的步骤(建或删 Windows 用户),在管理员终端或管理员的 SSH 会话里直接执行;否则在电脑桌面上弹出确认。\n\n启动与退出(不需要面板在运行)\n start 启动共议:服务、管理面板与任务栏图标、登录入口与隧道(在桌面会话里启动)\n stop 彻底退出:管理面板与图标、登录入口、隧道、共议服务;托管账号的实例照常运行\n restart stop 后 start\n update [check] 检查更新;不带 check 时安装最新版(面板未运行时先启动)并等待每一步结果\n\n本机\n status [--full] 概览:服务、版本、开机自启、登录入口、托管账号;--full 输出面板的完整状态\n service start|stop|restart 只启停共议服务(网站与讨论服务)\n autostart on|off 登录 Windows 时自动启动\n\n管理员入口\n site status 本地网页与线上网站的地址\n site connect <站点> [绑定令牌] 绑定线上网站(管理员外出用);在部署该网站的电脑上可不填令牌\n site disconnect 解绑线上网站,已配对的设备不能再连到这台电脑\n\n登录入口与访问方式(需打开托管管理)\n entry start|stop 启动或停止登录入口\n entry open|close relay|tunnel 开启或关闭访问方式:线上网站 | 自有域名,两种可同时开启\n entry join <接入码> 用接入码接入线上站点并开启线上网站\n entry code [--config <wrangler.jsonc>] [--site <地址>] 在部署线上站点的电脑上生成接入码(不填用上次的)\n entry tunnel <域名> [隧道名] 设置自有域名(Cloudflare 隧道),输出授权链接;域名须已托管在 Cloudflare\n entry tunnel status 查看自有域名设置的进度\n runtime sync 同步隔离账号的程序副本\n\n托管账号\n account list\n account add <名> [--no-isolate] [--no-start] 创建、隔离、初始化 AI 环境、开启入口保护、启动;输出一次性密码。\n 中途失败时解决后重新执行同一命令,从缺少的步骤接着做\n account start|stop|disable|enable|remove|password <名>\n account isolate|unisolate|protect|unprotect <名>\n\n命令行登录(目标 owner 为管理员自己,否则为托管账号名)\n login status <目标> 各程序的登录状态,以及每个程序可用的登录方式\n login set <目标> <claude|codex> <方式> --set 字段=值 ... 如 login set alice claude setup_token --set token=sk-ant-oat01-…\n login start <目标> <程序> <方式> 浏览器登录:输出链接,之后用 login submit 提交授权码或回调地址\n login submit <作业> <文本> / login progress <作业> / login cancel <作业>\n logout <目标> <程序>\n\nAPI 密钥、技能、工作流、系统提示词(目标同上)\n key list <目标> / key add <目标> --base-url <地址> --key <密钥> / key remove <目标> <编号>\n skill library / skill import <文件夹或.zip> / skill delete <名>\n skill list <目标> / skill install <目标> <名>... / skill remove <目标> <名>...\n workflow list <目标> / workflow install <目标>\n prompt get <目标> / prompt set <目标> --file <文件> [--group <键>] 管理员的提示词按组保存(见 prompt get)\n prompt default get / prompt default set --file <文件> 新托管账号的默认系统提示词\n\n结果以 JSON 输出。--data 指定管理员服务目录(默认 ~/.codiscuss)。\n": "Usage: codiscuss admin <command> [arguments] (matches admin panel actions; the panel must be running except for start and stop)\nSteps requiring administrator rights (creating or deleting Windows users) run directly in an administrator terminal or administrator SSH session. Otherwise, approve the prompt on the computer's desktop.\n\nStart and exit (panel need not be running)\n start Start CoDiscuss: service, panel and tray icon, sign-in entry and tunnel (in the desktop session)\n stop Exit panel and tray icon, sign-in entry, tunnel and service; hosted instances keep running\n restart Run stop, then start\n update [check] Check for updates; omit check to install the latest version and wait for results (starts the panel if needed)\n\nLocal\n status [--full] Show service, version, startup, sign-in entry and hosted accounts; --full returns full panel state\n service start|stop|restart Start or stop only the CoDiscuss service (site and discussion service)\n autostart on|off Start automatically at Windows sign-in\n\nAdministrator entry\n site status Addresses of the local page and the online site\n site connect <site> [binding token] Bind the online site (to use this computer while away); the token is optional on the computer that deployed the site\n site disconnect Unbind the online site; paired devices can no longer reach this computer\n\nSign-in entry and access methods (hosting must be enabled)\n entry start|stop Start or stop the sign-in entry\n entry open|close relay|tunnel Turn an access method on or off: online site | own domain; both can be on\n entry join <code> Connect to an online site with an access code and turn on the online site\n entry code [--config <wrangler.jsonc>] [--site <address>] Generate an access code on the deployment computer (defaults to last settings)\n entry tunnel <domain> [tunnel-name] Configure a Cloudflare Tunnel and show the authorization link; domain must be hosted on Cloudflare\n entry tunnel status Show domain setup progress\n runtime sync Sync program copies for isolated accounts\n\nHosted accounts\n account list\n account add <name> [--no-isolate] [--no-start] Create, isolate, initialize AI environment, protect and start; show password once\n On failure, fix the cause and rerun the same command to resume missing steps\n account start|stop|disable|enable|remove|password <name>\n account isolate|unisolate|protect|unprotect <name>\n\nCLI sign-ins (target owner is the admin; otherwise use a hosted account name)\n login status <target> Show each app's sign-in status and available methods\n login set <target> <claude|codex> <method> --set field=value ... e.g. login set alice claude setup_token --set token=sk-ant-oat01-…\n login start <target> <app> <method> Browser sign-in: show a link; use login submit for the authorization code or callback URL\n login submit <job> <text> / login progress <job> / login cancel <job>\n logout <target> <app>\n\nAPI keys, skills, workflows and system prompts (same target convention)\n key list <target> / key add <target> --base-url <address> --key <key> / key remove <target> <id>\n skill library / skill import <folder-or.zip> / skill delete <name>\n skill list <target> / skill install <target> <name>... / skill remove <target> <name>...\n workflow list <target> / workflow install <target>\n prompt get <target> / prompt set <target> --file <file> [--group <key>] Admin prompts are saved by group (see prompt get)\n prompt default get / prompt default set --file <file> Default system prompt for new hosted accounts\n\nResults are JSON. --data sets the admin service folder (default ~/.codiscuss).\n",
28
+ "用法:codiscuss admin <命令> [参数](与管理面板的操作一一对应;除启动与退出外,需管理面板正在运行)\n需要管理员权限的步骤(建或删 Windows 用户),在管理员终端或管理员的 SSH 会话里直接执行;否则在电脑桌面上弹出确认。\n\n启动与退出(不需要面板在运行)\n start 启动共议:服务、管理面板与任务栏图标、登录入口与隧道(在桌面会话里启动)\n stop 彻底退出:管理面板与图标、登录入口、隧道、共议服务;托管账号的实例照常运行\n restart stop 后 start\n update [check] 检查更新;不带 check 时安装最新版(面板未运行时先启动)并等待每一步结果\n\n本机\n status [--full] 概览:服务、版本、开机自启、登录入口、托管账号;--full 输出面板的完整状态\n service start|stop|restart 只启停共议服务(网站与讨论服务)\n autostart on|off 登录 Windows 时自动启动\n\n管理员入口\n site status 本地网页与线上网站的地址\n site connect <接入码|站点> [绑定令牌] 绑定线上网站(管理员外出、邀请外部专家用);在部署该网站的电脑上只填站点即可\n site disconnect 解绑线上网站,已配对的设备不能再连到这台电脑\n\n登录入口与访问方式(需打开托管管理)\n entry start|stop 启动或停止登录入口\n entry open|close relay|tunnel 开启或关闭访问方式:线上网站 | 自有域名,两种可同时开启\n entry join <接入码> 用接入码接入线上站点并开启线上网站\n entry code [--config <wrangler.jsonc>] [--site <地址>] 在部署线上站点的电脑上生成接入码(不填用上次的)\n entry tunnel <域名> [隧道名] 设置自有域名(Cloudflare 隧道),输出授权链接;域名须已托管在 Cloudflare\n entry tunnel status 查看自有域名设置的进度\n runtime sync 同步隔离账号的程序副本\n\n托管账号\n account list\n account add <名> [--no-isolate] [--no-start] 创建、隔离、初始化 AI 环境、开启入口保护、启动;输出一次性密码。\n 中途失败时解决后重新执行同一命令,从缺少的步骤接着做\n account start|stop|disable|enable|remove|password <名>\n account isolate|unisolate|protect|unprotect <名>\n account external|unexternal <名> 允许或停止该账号邀请外部专家(自动替它绑定这台电脑绑定的线上网站)\n\n命令行登录(目标 owner 为管理员自己,否则为托管账号名)\n login status <目标> 各程序的登录状态,以及每个程序可用的登录方式\n login set <目标> <claude|codex> <方式> --set 字段=值 ... 如 login set alice claude setup_token --set token=sk-ant-oat01-…\n login start <目标> <程序> <方式> 浏览器登录:输出链接,之后用 login submit 提交授权码或回调地址\n login submit <作业> <文本> / login progress <作业> / login cancel <作业>\n logout <目标> <程序>\n\nAPI 密钥、技能、工作流、系统提示词(目标同上)\n key list <目标> / key add <目标> --base-url <地址> --key <密钥> / key remove <目标> <编号>\n skill library / skill import <文件夹或.zip> / skill delete <名>\n skill list <目标> / skill install <目标> <名>... / skill remove <目标> <名>...\n workflow list <目标> / workflow install <目标>\n prompt get <目标> / prompt set <目标> --file <文件> [--group <键>] 管理员的提示词按组保存(见 prompt get)\n prompt default get / prompt default set --file <文件> 新托管账号的默认系统提示词\n\n结果以 JSON 输出。--data 指定管理员服务目录(默认 ~/.codiscuss)。\n": "Usage: codiscuss admin <command> [arguments] (matches admin panel actions; the panel must be running except for start and stop)\nSteps requiring administrator rights (creating or deleting Windows users) run directly in an administrator terminal or administrator SSH session. Otherwise, approve the prompt on the computer's desktop.\n\nStart and exit (panel need not be running)\n start Start CoDiscuss: service, panel and tray icon, sign-in entry and tunnel (in the desktop session)\n stop Exit panel and tray icon, sign-in entry, tunnel and service; hosted instances keep running\n restart Run stop, then start\n update [check] Check for updates; omit check to install the latest version and wait for results (starts the panel if needed)\n\nLocal\n status [--full] Show service, version, startup, sign-in entry and hosted accounts; --full returns full panel state\n service start|stop|restart Start or stop only the CoDiscuss service (site and discussion service)\n autostart on|off Start automatically at Windows sign-in\n\nAdministrator entry\n site status Addresses of the local page and the online site\n site connect <access code|site> [token] Bind an online site (for using it away from this computer and inviting external experts); on the computer that deployed it, the site alone is enough\n site disconnect Unbind the online site; paired devices can no longer reach this computer\n\nSign-in entry and access methods (hosting must be enabled)\n entry start|stop Start or stop the sign-in entry\n entry open|close relay|tunnel Turn an access method on or off: online site | own domain; both can be on\n entry join <code> Connect to an online site with an access code and turn on the online site\n entry code [--config <wrangler.jsonc>] [--site <address>] Generate an access code on the deployment computer (defaults to last settings)\n entry tunnel <domain> [tunnel-name] Configure a Cloudflare Tunnel and show the authorization link; domain must be hosted on Cloudflare\n entry tunnel status Show domain setup progress\n runtime sync Sync program copies for isolated accounts\n\nHosted accounts\n account list\n account add <name> [--no-isolate] [--no-start] Create, isolate, initialize AI environment, protect and start; show password once\n On failure, fix the cause and rerun the same command to resume missing steps\n account start|stop|disable|enable|remove|password <name>\n account isolate|unisolate|protect|unprotect <name>\n account external|unexternal <name> Allow or stop the account inviting external experts (binds it to this computer's online site for it)\n\nCLI sign-ins (target owner is the admin; otherwise use a hosted account name)\n login status <target> Show each app's sign-in status and available methods\n login set <target> <claude|codex> <method> --set field=value ... e.g. login set alice claude setup_token --set token=sk-ant-oat01-…\n login start <target> <app> <method> Browser sign-in: show a link; use login submit for the authorization code or callback URL\n login submit <job> <text> / login progress <job> / login cancel <job>\n logout <target> <app>\n\nAPI keys, skills, workflows and system prompts (same target convention)\n key list <target> / key add <target> --base-url <address> --key <key> / key remove <target> <id>\n skill library / skill import <folder-or.zip> / skill delete <name>\n skill list <target> / skill install <target> <name>... / skill remove <target> <name>...\n workflow list <target> / workflow install <target>\n prompt get <target> / prompt set <target> --file <file> [--group <key>] Admin prompts are saved by group (see prompt get)\n prompt default get / prompt default set --file <file> Default system prompt for new hosted accounts\n\nResults are JSON. --data sets the admin service folder (default ~/.codiscuss).\n",
29
29
  "管理面板没有在运行:在这台电脑的桌面上运行 codiscuss panel open,或从任务栏图标打开": "The admin panel is not running. Run codiscuss panel open on this computer's desktop, or open it from the tray icon.",
30
30
  "管理面板没有响应:在这台电脑的桌面上运行 codiscuss panel open": "The admin panel did not respond. Run codiscuss panel open on this computer's desktop.",
31
31
  "管理面板拒绝了钥匙(面板可能刚重启):稍后重试": "The admin panel rejected the key (it may have just restarted). Try again shortly.",
@@ -506,7 +506,13 @@ export default {
506
506
  "这位外部成员只能讨论,不能读取项目": "This external member can discuss but cannot read the project",
507
507
  "这位外部成员未登记或已移除": "This external member is not registered or has been removed",
508
508
  "这台电脑绑定了多个线上网站,请指定邀请使用的网站": "This computer is connected to several online sites. Choose the site for the invite",
509
- "这台电脑还没有绑定线上网站,请先运行 codiscuss local connect 网站地址": "This computer is not connected to an online site yet. Run codiscuss local connect <site address> first",
509
+ "这台电脑未绑定线上网站,请在管理面板“本机 → 线上网站”处绑定": "This computer is not bound to an online site. Bind it under This computer → Online site in the management panel.",
510
+ "还有托管账号开着“允许邀请外部专家”,请先在“账号”页关闭": "Some hosted accounts still allow inviting external experts; turn that off on the Accounts page first",
511
+ "{value1} 的线上网站版本过旧,请部署方更新线上网站后再试": "The online site at {value1} is too old; ask whoever deploys it to update it, then try again",
512
+ "绑定令牌已过期,请重试": "The binding token expired; try again",
513
+ "线上网站没有释放这个账号:{value1}": "The online site did not release this account: {value1}",
514
+ "请先关闭该账号的“允许邀请外部专家”,再更改隔离": "Turn off Allow inviting external experts for this account before changing its isolation",
515
+ "线上网站没有签发绑定令牌:{value1}": "The online site did not issue a binding token: {value1}",
510
516
  "这把密钥已经加入过房间,请为新的邀请生成新密钥": "This key has already joined a room. Generate a new key for a new invite",
511
517
  "这条请求是发给另一台电脑的": "This request was meant for another computer",
512
518
  "邀请对应的房间已不在这台电脑上": "The invited room is no longer on this computer",