ai_co_discuss 0.4.87 → 0.4.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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 Sign-in entries → Administrator → Online site and paste the access code generated on the deploying computer (`codiscuss admin entry code`). Inviting external experts also needs this binding. 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 后自动更新。这些信息由对方电脑自报,仅供辨认。自定义接口显示外部专家图标。
@@ -373,7 +373,6 @@
373
373
  "绑定线上网站": "Bind online site",
374
374
  "你部署的共议线上网站,绑定后在本地网页的“设置”里给手机等设备配对": "The CoDiscuss online site you deployed. Once bound, pair phones and other devices under Settings on the local page",
375
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
376
  "已绑定线上网站": "Online site bound",
378
377
  "已解绑线上网站": "Online site unbound",
379
378
  "解绑线上网站": "Unbind online site",
@@ -387,5 +386,6 @@
387
386
  "你自己使用这台电脑的入口。": "Your own ways into this computer.",
388
387
  "{value1} 有新版本": "New version of {value1}",
389
388
  "托管账号从这份副本运行。更新共议时会自动同步;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"
389
+ "登录入口未运行,使用者暂时无法登录": "The sign-in entry is not running, so users cannot sign in for now",
390
+ "在部署线上网站的电脑上生成(运行 codiscuss admin entry code,或在其管理面板“托管账号入口 → 线上网站”里生成),只能用一次。就在那台电脑上绑定时,只填站点地址即可。": "Generate it on the computer that deployed the online site (run codiscuss admin entry code, or use Hosted accounts entry → Online site in its management panel); each code works once. On that computer itself, the site address alone is enough."
391
391
  }
@@ -149,6 +149,7 @@
149
149
  "本机连接链接无效或无法保存,请重新运行连接命令;尚未发送启动请求": "The local connection link is invalid or could not be saved. Run the connection command again. No launch request was sent.",
150
150
  "无法连接本机服务:请在这台电脑运行 codiscuss local open,并允许浏览器访问本机网络,再重试原请求": "Cannot connect to the local service. Run codiscuss local open on this computer, allow the browser to access the local network, then retry the original request.",
151
151
  "本机启动请求失败": "Local launch request failed",
152
+ "本机服务返回了无法识别的内容(HTTP {status}):{excerpt}": "The local service returned an unrecognized response (HTTP {status}): {excerpt}",
152
153
  "未知设备": "Unknown device",
153
154
  "请在已配对的设备上操作": "Use a paired device",
154
155
  "网站上还没有绑定电脑,或电脑的 codiscuss 版本过旧": "No computer is bound to this site, or its codiscuss version is too old",
@@ -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.87",
3
+ "version": "0.4.89",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -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
  登录入口与访问方式(需打开托管管理)
@@ -1017,6 +1017,9 @@ function connect_site(data, site, setup_key) {
1017
1017
  /** Bind this computer to the owner's online site; it has one at a time, and the address must be such a site. */
1018
1018
  async function bind_online_site(data, { site, setup_key }, connect) {
1019
1019
  const bound = bound_site(data);
1020
+ // An access code (`站点/#codiscuss-bind=令牌`) carries both, so one paste binds (user 2026-11-19, #5469).
1021
+ const text = String(site || '').trim(), at = text.indexOf(BIND_MARK);
1022
+ if (at >= 0) { setup_key = text.slice(at + BIND_MARK.length); site = text.slice(0, at); }
1020
1023
  let origin;
1021
1024
  try { origin = new URL(String(site || '').trim()).origin; } catch { throw panel_error('站点地址格式不对,例如 https://xxx.pages.dev'); }
1022
1025
  if (bound && bound.site !== origin) throw panel_error('这台电脑已绑定 {value1},请先解绑', { value1: bound.site });
@@ -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) {
@@ -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
 
@@ -381,7 +381,7 @@ export default {
381
381
  "外网地址正在设置中,请等它完成": "Public address setup is already running; wait for it to finish",
382
382
  "准备": "Preparing",
383
383
  "启动隧道": "Start tunnel",
384
- " if ($env:SC_ICON) { $s.IconLocation=$env:SC_ICON }; $s.Description='启动共议'; $s.Save(); Write-Output $p": " if ($env:SC_ICON) { $s.IconLocation=$env:SC_ICON }; $s.Description='Start CoDiscuss'; $s.Save(); Write-Output $p",
384
+ "启动共议": "Start CoDiscuss",
385
385
  "创建快捷方式失败:{value1}": "Failed to create shortcut: {value1}",
386
386
  "还没有“共议”程序:先在 codiscuss setup 里勾选创建桌面快捷方式,或运行 codiscuss launcher": "CoDiscuss launcher not found. Select Create desktop shortcut in codiscuss setup, or run codiscuss launcher.",
387
387
  "启动器仅支持 Windows": "The launcher supports Windows only",
@@ -506,7 +506,7 @@ 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 Online site in the management panel.",
510
510
  "这把密钥已经加入过房间,请为新的邀请生成新密钥": "This key has already joined a room. Generate a new key for a new invite",
511
511
  "这条请求是发给另一台电脑的": "This request was meant for another computer",
512
512
  "邀请对应的房间已不在这台电脑上": "The invited room is no longer on this computer",
@@ -538,13 +538,45 @@ function installed_script(name) {
538
538
  return installed && existsSync(installed) ? installed : join(RUNNER, name);
539
539
  }
540
540
 
541
+ // IShellLinkW keeps the Chinese file and target names intact. WScript.Shell passes them through the ANSI code page, so on a
542
+ // computer whose non-Unicode language is not Chinese "共议" turns into "??" and Save() fails (test machine, 2026-11-19).
543
+ const SHELL_LINK_SOURCE = `using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Text;
544
+ public static class CoShortcut {
545
+ [ComImport, Guid("00021401-0000-0000-C000-000000000046")] class ShellLink {}
546
+ [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("000214F9-0000-0000-C000-000000000046")]
547
+ interface IShellLinkW {
548
+ void GetPath([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder file, int size, IntPtr data, int flags);
549
+ void GetIDList(out IntPtr list); void SetIDList(IntPtr list);
550
+ void GetDescription([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder name, int size);
551
+ void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string name);
552
+ void GetWorkingDirectory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder dir, int size);
553
+ void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string dir);
554
+ void GetArguments([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder args, int size);
555
+ void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string args);
556
+ void GetHotkey(out short key); void SetHotkey(short key);
557
+ void GetShowCmd(out int show); void SetShowCmd(int show);
558
+ void GetIconLocation([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder path, int size, out int index);
559
+ void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string path, int index);
560
+ void SetRelativePath([MarshalAs(UnmanagedType.LPWStr)] string path, int reserved);
561
+ void Resolve(IntPtr window, int flags);
562
+ void SetPath([MarshalAs(UnmanagedType.LPWStr)] string file);
563
+ }
564
+ public static void Save(string path, string target, string args, string cwd, string icon, string description) {
565
+ IShellLinkW link = (IShellLinkW)new ShellLink();
566
+ link.SetPath(target); link.SetArguments(args); link.SetWorkingDirectory(cwd); link.SetDescription(description);
567
+ if (!String.IsNullOrEmpty(icon)) link.SetIconLocation(icon, 0);
568
+ ((IPersistFile)link).Save(path, true);
569
+ }
570
+ }`;
571
+
541
572
  /** Put a shortcut to the exe in a special folder (Desktop, Programs or Startup); values pass through the environment. */
542
573
  function write_shortcut(folder, exe, icon, args = '') {
543
- const script = "$d=[Environment]::GetFolderPath($env:SC_FOLDER); $p=Join-Path $d $env:SC_NAME;"
544
- + " $s=(New-Object -ComObject WScript.Shell).CreateShortcut($p); $s.TargetPath=$env:SC_TARGET; $s.Arguments=$env:SC_ARGS; $s.WorkingDirectory=$env:SC_CWD;"
545
- + t(' if ($env:SC_ICON) { $s.IconLocation=$env:SC_ICON }; $s.Description=\'启动共议\'; $s.Save(); Write-Output $p');
574
+ const script = "$ErrorActionPreference='Stop'; Add-Type -TypeDefinition $env:SC_SOURCE;"
575
+ + " $p=Join-Path ([Environment]::GetFolderPath($env:SC_FOLDER)) $env:SC_NAME;"
576
+ + " [CoShortcut]::Save($p, $env:SC_TARGET, $env:SC_ARGS, $env:SC_CWD, $env:SC_ICON, $env:SC_DESC); Write-Output $p";
546
577
  const result = spawnSync('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', `[Console]::OutputEncoding=[Text.Encoding]::UTF8; ${script}`],
547
- { encoding: 'utf8', windowsHide: true, env: { ...process.env, SC_FOLDER: folder, SC_NAME: SHORTCUT_NAME, SC_TARGET: exe, SC_ARGS: args, SC_CWD: dirname(exe), SC_ICON: icon || '' } });
578
+ { encoding: 'utf8', windowsHide: true, env: { ...process.env, SC_SOURCE: SHELL_LINK_SOURCE, SC_FOLDER: folder, SC_NAME: SHORTCUT_NAME, SC_TARGET: exe,
579
+ SC_ARGS: args, SC_CWD: dirname(exe), SC_ICON: icon || '', SC_DESC: t('启动共议') } });
548
580
  if (result.status !== 0) throw new Error(t('创建快捷方式失败:{value1}', { value1: result.stderr }));
549
581
  return result.stdout.trim();
550
582
  }