ai_co_discuss 0.4.94 → 0.4.96

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.
@@ -529,9 +529,13 @@ def member_room_view(connection, room_id, member):
529
529
  room = connection.execute("SELECT r.id,r.title,r.goal,d.archived FROM rooms r JOIN room_directory d ON d.room_id=r.id WHERE r.id=?",
530
530
  (room_id,)).fetchone()
531
531
  labels = free_room.member_display_names(connection, room_id)
532
+ # An external member carries the vendor its computer reported (`platform`, display only), so the other computer's page
533
+ # can show it as this room does; local members are known by their platform names.
532
534
  members = [{"name": row["name"], "label": labels.get(row["name"], row["name"]), "role": row["role"], "status": row["status"],
533
- "external": row["access"] == "external"}
534
- for row in connection.execute(f"SELECT name,role,status,access FROM room_members WHERE room_id=? AND status<>'removed' AND {free_room.REGISTERED_MEMBER} ORDER BY id",
535
+ "external": row["access"] == "external", **({"platform": row["platform"] or ""} if row["access"] == "external" else {})}
536
+ for row in connection.execute(f"""SELECT room_members.name,room_members.role,room_members.status,room_members.access,ext.platform
537
+ FROM room_members LEFT JOIN external_members ext ON ext.member_id=room_members.id
538
+ WHERE room_members.room_id=? AND room_members.status<>'removed' AND {free_room.REGISTERED_MEMBER} ORDER BY room_members.id""",
535
539
  (room_id,))]
536
540
  latest = connection.execute("""SELECT COALESCE(MAX(id),0) FROM messages m WHERE room_id=?
537
541
  AND NOT EXISTS (SELECT 1 FROM internal_task_messages t WHERE t.message_id=m.id)""", (room_id,)).fetchone()[0]
@@ -594,6 +598,13 @@ def report_ai(connection, member, payload):
594
598
  return {"reported": True}
595
599
 
596
600
 
601
+ def lend_until(connection, member, payload):
602
+ """The member's computer sets how long it lends its AI; only its own end changes, never what it may read (red line 1 exception)."""
603
+ expires_at = checked_expiry(payload.get("expires_at"), int(time.time()))
604
+ connection.execute("UPDATE external_members SET expires_at=?,updated_at=? WHERE member_id=?", (expires_at, int(time.time()), member["id"]))
605
+ return {"expires_at": expires_at}
606
+
607
+
597
608
  def leave_room(connection, member):
598
609
  """The external member leaves on its own; its credential stops working at once."""
599
610
  end_member(connection, member, "left")
@@ -641,6 +652,8 @@ def external_api(connection, parts, params, method, token, read_payload, hooks):
641
652
  return hooks["answer"](connection, room_id, answer_payload(member, payload), member), 201
642
653
  if route == ["ai"]:
643
654
  return report_ai(connection, member, payload), 200
655
+ if route == ["expiry"]:
656
+ return lend_until(connection, member, payload), 200
644
657
  if route == ["leave"]:
645
658
  return leave_room(connection, member), 200
646
659
  raise LookupError(Text("地址不存在"))
package/backend/server.py CHANGED
@@ -83,7 +83,7 @@ DIRECTORY_OPERATIONS = ("move", "folder")
83
83
  # Local entry commands for external members: the owner's invites (room credential) and this computer's invited records.
84
84
  INVITE_COMMANDS = ("room-invite", "room-invites", "room-invite-revoke")
85
85
  INVITED_COMMANDS = ("invited-list", "invited-join", "invited-trust", "invited-ai", "invited-pause", "invited-approve", "invited-refuse",
86
- "invited-leave", "invited-remove", "invited-room")
86
+ "invited-lend", "invited-leave", "invited-remove", "invited-room")
87
87
  ADMIN_OPERATIONS = ("rename", "archive", "restore", "delete")
88
88
  DIRECTORY_PICKER_TIMEOUT = 600 # the folder dialog waits for the person at the computer
89
89
  # Files are streamed to players in pieces of this size.
@@ -3202,6 +3202,9 @@ class DiscussionHandler(BaseHTTPRequestHandler):
3202
3202
  connection.commit()
3203
3203
  if parts[3:4] == ["external-members"]:
3204
3204
  result, status = external_owner_api(connection, room_id, parts[4:], params, method, token, self.read_payload)
3205
+ # Revoking (or finding expired) the member that held the room frees it: messages queued behind it go now.
3206
+ if method == "POST":
3207
+ drain_room_queue(connection, room_id)
3205
3208
  connection.commit()
3206
3209
  return self.respond(result, status)
3207
3210
  if parts[3:] == ["discussion"]:
package/docs/en/runner.md CHANGED
@@ -89,22 +89,23 @@ Invite an AI on another computer into your room: it reads only the project files
89
89
  **Before you start**: both computers install CoDiscuss and run the local service; your computer is [connected to a hosted site](#from-a-hosted-site) with the relay deployed, and the other side reaches your room through that site's encrypted relay. While your computer is off or codiscuss is not running, the other side gets nothing.
90
90
 
91
91
  **Invite (your computer)**:
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.
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). How long the AI is lent is the other side's choice when joining; you do not set it. "Messages and project" opens all of the room's project folders.
93
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
- 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
- 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.
94
+ 3. Redemption completes check-in and starts the loan time, 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
+ 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 switch to messages only, or revoke; revoking takes effect immediately. The time left is set by the other side and only shown here. The external expert's card under Members and settings on the Room page shows the same details and actions. 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.
97
97
 
98
98
  **Join (the other computer)**:
99
- 1. Open the link and choose "Join with CoDiscuss on this computer" to go to the local page; or choose "+" under "External rooms" in the left panel and paste the link, scan the QR code with the camera, choose a QR code image, or paste a screenshot of it; or run `codiscuss join <link> --adapter TOOL`.
100
- 2. Pick the AI and set it up on its expert card: a new conversation or one this software already holds (joining with its context; manual start is unavailable), model and effort, its own prompt, and the two settings below (Room only · Answer at once by default, with no further confirmation after joining):
99
+ 1. Open the link and choose "Join with CoDiscuss on this computer" to go to the local page; or choose "+" under "External rooms" in the left panel and paste the link, scan the QR code with the camera, choose a QR code image, or paste a screenshot of it; or run `codiscuss join <link> --adapter TOOL [--duration 1h|today|3d]`, and later change the loan time with `codiscuss invited lend ID 1h|today|3d`.
100
+ 2. Pick the AI and set it up on its expert card: a new conversation or one this software already holds (joining with its context; manual start is unavailable), model and effort, its own prompt, and the three settings below (Room only · Answer at once · 1 hour by default, with no further confirmation after joining):
101
101
 
102
102
  | Setting | Options |
103
103
  | --- | --- |
104
104
  | When named | Answer at once: no wake count or time limit · Ask me: woken only after you approve in the right panel each time; declining, or 15 minutes without an answer, shows "Not accepted by the other side" |
105
105
  | Local access | Room only: limited to CoDiscuss commands, running in an empty temporary folder · Unrestricted: can read local files and use the network |
106
+ | Lent for | 1 hour · Today · 3 days (3 days at most). The membership ends when it runs out; renew before then to continue |
106
107
 
107
- The external room page shows the other room's chat like a room's messages, read only (scroll up for earlier messages); the requests to your AI carry how they went on this computer. The other room's private chats, runs, settings and files are not available there. Both settings are kept per room; you can change them later in the external room's right panel, or pause or leave. Once the room has ended, you can delete its record from this computer. `codiscuss invited` offers the same commands, and a paired phone or tablet can set every option. The local service does the waking, so keep codiscuss running. When the AI ends without submitting an answer, the external room page shows the end of its run output on this computer under the failure reason (kept here only, never sent to the other side); `codiscuss external room ID --json` shows it too.
108
+ The external room page shows the other room's chat like a room's messages, read only (scroll up for earlier messages); the requests to your AI carry how they went on this computer. The other room's private chats, runs, settings and files are not available there. All three settings are kept per room; you can change them later in the external room's right panel (a new loan time counts from the change, so it can renew or shorten), or pause or leave. Once the room has ended, you can delete its record from this computer. `codiscuss invited` offers the same commands, and a paired phone or tablet can set every option. The local service does the waking, so keep codiscuss running. When the AI ends without submitting an answer, the external room page shows the end of its run output on this computer under the failure reason (kept here only, never sent to the other side); `codiscuss external room ID --json` shows it too.
108
109
 
109
110
  **Supported tools**: Room only needs a tool that can be limited to CoDiscuss commands. Claude Code (background runs) supports it, tested on version 2.1.325 (other versions not individually checked), so does the Antigravity CLI, tested on version 1.5.12 (its web search cannot be turned off; anything else you always allowed in agy is denied in these tasks, while your own use of agy is unchanged), and so do model APIs, backed by unit tests; Codex and the Antigravity desktop app do not support it and can only run Unrestricted; desktop apps cannot join as external members.
110
111
 
package/docs/runner.md CHANGED
@@ -120,22 +120,23 @@ codiscuss local connect https://你的站点
120
120
  **前提**:两台电脑都安装共议并运行本机服务;你的电脑已[连接线上网站](#线上网页连接本机)并部署了中转,对方经这个网站的加密中转访问你的房间。你的电脑关机或 codiscuss 未运行时,对方什么也拿不到。
121
121
 
122
122
  **邀请(你的电脑)**:
123
- 1. 建房面板或右栏“邀请成员”里点“外部”一行的“外部专家 +”(可加多位),翻到卡片背面设置“对方能看到”(房间消息 / 消息和项目)和签到后的有效期。选“消息和项目”时开放本房间的全部项目目录。
123
+ 1. 建房面板或右栏“邀请成员”里点“外部”一行的“外部专家 +”(可加多位),翻到卡片背面设置“对方能看到”(房间消息 / 消息和项目)。借出多久由对方加入时决定,你不用设。选“消息和项目”时开放本房间的全部项目目录。
124
124
  2. 点“邀请”(建房时自动添加),右栏名单立即显示待签到成员。从邀请弹窗添加时,弹窗会停在“已加入”一步,可直接点“复制邀请链接”。输入框上方会出现“成员名 待签到:把邀请链接发给对方”,点“复制邀请链接”直接复制(成员菜单里也有这一项),或点“邀请详情”查看二维码,发给对方。链接 10 分钟有效,只能绑定一位成员;重新生成会立即作废旧链接。“邀请详情”开着时,链接到期会自动换成新的。未绑定线上站点时显示“待生成链接”及原因,绑定站点后从席位菜单生成。待签到面板显示自动结束期限,可“移除席位”;签到后才显示用量、读取记录和授权调整。
125
- 3. 对方兑换即完成签到,成员有效期从兑换时开始,**没有额外批准步骤**。未签到不收任务、不参与全体回应或讨论,7 天后自动结束;链接过期不会删除席位。
126
- 4. 在房间里 `@` 它,回答照常出现在对话中。成员菜单的“读取记录与权限”列出它读过的每个文件(由你的电脑记录),可延长、改为只看消息或撤销授权,撤销立即生效。成员结束后(到期、对方退出或撤销)仍灰显在名单下方并写明原因,点“重新邀请”可生成新链接把原成员请回:名字和房间里的历史不变;对方若还保留那条被邀请记录,记录与设置也接着用,删了则新建。
125
+ 3. 对方兑换即完成签到,借出时间从兑换时开始,**没有额外批准步骤**。未签到不收任务、不参与全体回应或讨论,7 天后自动结束;链接过期不会删除席位。
126
+ 4. 在房间里 `@` 它,回答照常出现在对话中。成员菜单的“读取记录与权限”列出它读过的每个文件(由你的电脑记录),可改为只看消息或撤销授权,撤销立即生效;剩余时间由对方设定,你这边只能看。房间页“成员与设置”里的外部专家卡片显示同样的信息与操作。成员结束后(到期、对方退出或撤销)仍灰显在名单下方并写明原因,点“重新邀请”可生成新链接把原成员请回:名字和房间里的历史不变;对方若还保留那条被邀请记录,记录与设置也接着用,删了则新建。
127
127
  5. 签到后头像显示对方 AI 的厂家,“读取记录与权限”里可看到软件和模型;对方换 AI 后自动更新。这些信息由对方电脑自报,仅供辨认。自定义接口显示外部专家图标。
128
128
 
129
129
  **加入(对方电脑)**:
130
- 1. 打开链接,点“用本机共议加入”跳到本机网页;或在左栏“外部房间”点“+”粘贴链接,也可以用相机扫码、选择二维码图片或粘贴二维码截图;命令行为 `codiscuss join <链接> --adapter 软件`。
131
- 2. 选派哪个 AI,在它的专家卡片上设置:新会话或续接这个软件已有的会话(带着原上下文加入;手动启动不可用)、模型与强度、专属提示词,以及下面两项(默认“只在房间里发言 · 直接回答”,加入后无需再确认):
130
+ 1. 打开链接,点“用本机共议加入”跳到本机网页;或在左栏“外部房间”点“+”粘贴链接,也可以用相机扫码、选择二维码图片或粘贴二维码截图;命令行为 `codiscuss join <链接> --adapter 软件 [--duration 1h|today|3d]`,之后用 `codiscuss invited lend ID 1h|today|3d` 改借出时间。
131
+ 2. 选派哪个 AI,在它的专家卡片上设置:新会话或续接这个软件已有的会话(带着原上下文加入;手动启动不可用)、模型与强度、专属提示词,以及下面三项(默认“只在房间里发言 · 直接回答 · 1 小时”,加入后无需再确认):
132
132
 
133
133
  | 设置 | 选项 |
134
134
  | --- | --- |
135
135
  | 被点名时 | 直接回答:不设次数与期限上限 · 先问我:每次在右栏同意才唤醒,拒绝或 15 分钟未处理,对方看到“对方未同意” |
136
136
  | 本机权限 | 只在房间里发言:只能用共议命令,在空的临时目录运行 · 不受限:可读本机文件、联网 |
137
+ | 借出时间 | 1 小时 · 今天 · 3 天(最长 3 天)。到期后成员资格结束,要继续须在到期前续期 |
137
138
 
138
- 外部房间的页面像房间消息页一样显示对方房间的聊天记录(只读,往上滚动可看更早的消息),点名你 AI 的请求标有在这台电脑上的处理结果;对方房间的私聊、执行、房间设置与文件都不开放。两项设置都按房间分别保存,之后可在外部房间的右栏调整,也可暂停或退出,房间结束后可删除这台电脑上的记录;`codiscuss invited` 有同样的命令,已配对的手机或平板也能设置全部选项。唤醒由本机服务完成,请保持 codiscuss 运行。AI 没提交回答就结束时,外部房间的页面会在失败原因下列出这台电脑上运行输出的末尾(只存在本机,不发给对方),`codiscuss invited room ID --json` 也能看到。
139
+ 外部房间的页面像房间消息页一样显示对方房间的聊天记录(只读,往上滚动可看更早的消息),点名你 AI 的请求标有在这台电脑上的处理结果;对方房间的私聊、执行、房间设置与文件都不开放。三项设置都按房间分别保存,之后可在外部房间的右栏调整(借出时间从调整时起重新计算,可续期也可改短),也可暂停或退出,房间结束后可删除这台电脑上的记录;`codiscuss invited` 有同样的命令,已配对的手机或平板也能设置全部选项。唤醒由本机服务完成,请保持 codiscuss 运行。AI 没提交回答就结束时,外部房间的页面会在失败原因下列出这台电脑上运行输出的末尾(只存在本机,不发给对方),`codiscuss invited room ID --json` 也能看到。
139
140
 
140
141
  **支持的软件**:“只在房间里发言”要求软件能限制为只用共议命令,目前支持 Claude Code(后台运行,已在 2.1.325 版实测,其他版本未逐一验证)、Antigravity CLI(已在 1.5.12 版实测;它的网页搜索无法禁止;你在 agy 里“始终允许”过的其他操作,在受限任务里会被禁止,平时使用不受影响)与模型 API(以单元测试为据);Codex 与 Antigravity 桌面版不支持,只能选“不受限”;桌面 App 不能作为外部成员加入。
141
142
 
@@ -371,12 +371,12 @@
371
371
  "已开启": "On",
372
372
  "你自己使用这台电脑的入口。": "Your own ways into this computer.",
373
373
  "{value1} 有新版本": "New version of {value1}",
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.",
374
+ "托管账号从这份副本运行。管理面板启动和更新共议时会自动同步;没有同步上时在这里同步。": "Hosted accounts run from this copy. It syncs automatically when the admin panel starts and when CoDiscuss updates; sync here if that did not work.",
375
375
  "登录入口未运行,使用者暂时无法登录": "The sign-in entry is not running, so users cannot sign in for now",
376
376
  "扫码配对过的设备可以在外面使用这台电脑": "Devices paired by QR code can use this computer from elsewhere",
377
377
  "需先在“本机 → 线上网站”绑定": "Bind under This computer → Online site first",
378
378
  "经线上网站中转": "Through the online site",
379
- "不需要域名:经共议线上网站中转到这台电脑,手机和外地的电脑都能打开。需要这台电脑已在“本机 → 线上网站”绑定。": "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.",
379
+ "不需要域名:经共议线上网站中转到这台电脑,手机和外地的电脑都能打开。需要先把这台电脑绑定到线上网站。": "No domain needed: relayed through the CoDiscuss online site to this computer, so phones and computers elsewhere can open it. Bind this computer to the online site first.",
380
380
  "已开启经线上网站中转": "Relay through the online site turned on",
381
381
  "已关闭经线上网站中转": "Relay through the online site turned off",
382
382
  "其他设备远程使用、邀请外部专家、托管账号经线上网站登录都需要": "Needed for using this computer from other devices, inviting external experts, and hosted accounts signing in through the online site",
@@ -37,7 +37,7 @@
37
37
  "这个账号开启了入口保护,但入口读不到它的密钥": "This account has entry protection enabled, but the entry cannot read its key",
38
38
  "实例没有按入口保护启动起来(启动失败,或密钥对不上)": "Instance did not start with entry protection (startup failed or the key does not match)",
39
39
  "实例没有启动起来": "Instance did not start",
40
- "还没有安装隔离账号的程序副本,请先在“概览 → 登录入口 → 托管账号入口”中同步": "Program copies for isolated accounts are not installed yet. Sync them under Overview → Sign-in entry → Hosted account entry first.",
40
+ "还没有安装隔离账号的程序副本,请先在“概览 → 本机 → 程序副本”中安装": "Program copies for isolated accounts are not installed yet. Install them under Overview → This computer → Program copy first.",
41
41
  "技能库里没有 {value1}": "Skill library does not contain {value1}",
42
42
  "未知操作:{value1}": "Unknown action: {value1}",
43
43
  "未知程序:{value1}": "Unknown app: {value1}",
@@ -37,8 +37,6 @@
37
37
  "等退出通知送达后可删除": "Can be deleted once the leave notice arrives",
38
38
  "1 小时": "1 hour",
39
39
  "今天": "Today",
40
- "30 天": "30 days",
41
- "7 天": "7 days",
42
40
  "已到期": "Expired",
43
41
  "剩余 {count} 天": "{count} d left",
44
42
  "剩余 {count} 小时": "{count} h left",
@@ -61,7 +59,6 @@
61
59
  "阿里云百炼": "Alibaba Cloud Model Studio",
62
60
  "开放目录": "Open directories",
63
61
  "只读:已跟踪与未忽略的文件,固定排除 .env、密钥、凭据、data/ 与 .git。": "Read-only: tracked and non-ignored files; .env, keys, credentials, data/ and .git are always excluded.",
64
- "有效期": "Valid for",
65
62
  "项目内容会发给对方模型服务商": "Project content goes to their model provider",
66
63
  "消息会发给对方模型服务商": "Messages go to their model provider",
67
64
  "生成邀请需要本机服务,请在这台电脑打开本机网站。": "Creating an invitation needs the local service; open the local website on this computer.",
@@ -71,8 +68,6 @@
71
68
  "已经读出去的内容收不回,会留在对方 AI 的会话里。": "What was already read cannot be taken back; it stays in the other AI's session.",
72
69
  "外部成员 · {name}": "External member · {name}",
73
70
  "调整": "Adjust",
74
- "延长": "Extend",
75
- "已延长": "Extended",
76
71
  "已降为只讨论,之后不能再读项目文件": "Downgraded to discussion only; it can no longer read project files",
77
72
  "读取记录": "Read log",
78
73
  "还没有读取记录": "No reads yet",
@@ -221,5 +216,29 @@
221
216
  "启动新成员": "Start new members",
222
217
  "已复制邀请链接": "Invitation link copied",
223
218
  "{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."
219
+ "选择一个 AI 派去对方房间,点卡片翻面可设置软件、模型和本机权限。": "Pick an AI to send to the other room; flip its card to set software, model and local access.",
220
+ "3 天": "3 days",
221
+ "借出时间": "Lent for",
222
+ "借出多久由你决定,最长 3 天;加入后可在外部房间里续期或改短。": "You decide how long to lend it, up to 3 days; after joining you can renew or shorten it in the external room.",
223
+ "借出时间已更新": "Loan time updated",
224
+ "对方设定": "set by the invitee",
225
+ "借出到": "Lent until",
226
+ "对方未说明": "Not stated",
227
+ "{name} 能看到的内容": "What {name} can see",
228
+ "可改为只看消息;再开放项目须重新邀请": "Can be narrowed to messages only; opening the project again needs a new invitation",
229
+ "再开放项目须重新邀请": "Opening the project again needs a new invitation",
230
+ "借出多久由对方决定,你可随时撤销": "The invitee decides how long it is lent; you can revoke at any time",
231
+ "由对方加入时决定": "Set by the invitee when joining",
232
+ "不变": "Unchanged",
233
+ "从现在起重新计算,最长 3 天": "Counted again from now, 3 days at most",
234
+ "绑定了多个线上网站,生成链接时选择": "Several hosted sites connected; choose one when making the link",
235
+ "未绑定线上网站,无法生成链接": "No hosted site connected; a link cannot be made",
236
+ "目录": "Folders",
237
+ "读取": "Reads",
238
+ "只读 · 每小时 {hourly} · 共 {total}": "Read only · {hourly} per hour · {total} in all",
239
+ "中转": "Relay",
240
+ "调整「{room}」的设置": "Settings for “{room}”",
241
+ "只影响你这台电脑上的 AI,对方房间的开放范围由对方决定。": "Only affects your AI on this computer; what the other room opens is up to its owner.",
242
+ "当前借出到 {time}": "Currently lent until {time}",
243
+ "正在添加席位…": "Adding the seat…"
225
244
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.4.94",
3
+ "version": "0.4.96",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -256,6 +256,27 @@ async function finish_update(data) {
256
256
  write_update_job(data, { ...job, status: 'done', ok: installed, steps });
257
257
  }
258
258
 
259
+ /**
260
+ * Bring an installed program copy up to date when the panel starts: a version installed some other way than the panel's
261
+ * update (npm, setup) or an AI program that upgraded itself leaves it behind (user 2026-11-19). Same order as an update:
262
+ * the isolated instances running from the copy stop first, or files in use stay old, then start again. What fails stays
263
+ * on the overview's program copy row for the owner.
264
+ */
265
+ async function sync_stale_copy(data) {
266
+ if (!hosting_enabled(data)) return;
267
+ const copy = shared_cli_state();
268
+ if (!copy.app || (copy.app_version === VERSION && !copy.outdated.length)) return;
269
+ const running = (await list_accounts(data)).filter(account => account.os_user && account.running);
270
+ for (const account of running) await run_instance(data, account.name, 'stop');
271
+ try {
272
+ const result = install_runtime(data);
273
+ if (result.warnings.length) throw new Error(result.warnings.join(';'));
274
+ for (const name of Object.keys(read_os_users(data))) if (read_accounts(data)[name]) await prepare_account(data, name);
275
+ } finally {
276
+ for (const account of running) await start_verified(data, account.name);
277
+ }
278
+ }
279
+
259
280
  // ---- Accounts ----
260
281
 
261
282
  /**
@@ -402,7 +423,7 @@ function install_runtime(data) {
402
423
  */
403
424
  function account_env(data, name, action, request = {}, folders = {}) {
404
425
  const { env_script } = shared_paths();
405
- if (!existsSync(env_script)) throw panel_error('还没有安装隔离账号的程序副本,请先在“概览 → 登录入口 → 托管账号入口”中同步');
426
+ if (!existsSync(env_script)) throw panel_error('还没有安装隔离账号的程序副本,请先在“概览 → 本机 → 程序副本”中安装');
406
427
  const text = run_as_user(data, name, `& ${ps_quote(process.execPath)} ${ps_quote(env_script)} ${action} $Job`,
407
428
  { files: { 'request.json': JSON.stringify(request) }, folders, timeout: 120_000 });
408
429
  const line = text.split(/\r?\n/).reverse().find(item => item.trim().startsWith('{'));
@@ -560,7 +581,7 @@ function run_instance(data, name, command) {
560
581
  }
561
582
  if (command === 'start' && read_os_users(data)[name]) {
562
583
  const { local_script } = shared_paths();
563
- if (!existsSync(local_script)) throw panel_error('还没有安装隔离账号的程序副本,请先在“概览 → 登录入口 → 托管账号入口”中同步');
584
+ if (!existsSync(local_script)) throw panel_error('还没有安装隔离账号的程序副本,请先在“概览 → 本机 → 程序副本”中安装');
564
585
  // Whatever was set up first, the instance starts on the shared copies its Windows user can run.
565
586
  use_shared_programs(data, name);
566
587
  return start_instance_as_user(data, name, service, local_script, process.execPath, { key_file });
@@ -1479,11 +1500,15 @@ function run_panel(data, port) {
1479
1500
  process.stdout.write(t(`管理面板已启动:http://127.0.0.1:{value1}
1480
1501
  `, { value1: port }));
1481
1502
  finish_update(data).catch(error => process.stderr.write(t(`更新收尾失败:{value1}
1482
- `, { value1: error.message })));
1503
+ `, { value1: error.message })))
1504
+ // After an update's own finish, which already synced the copy it installed.
1505
+ .then(() => sync_stale_copy(data)).catch(error => process.stderr.write(t('程序副本没有自动同步:{value1}\n', { value1: error.message })));
1483
1506
  });
1484
1507
  // The icon that ships with the package, the same on every computer.
1485
1508
  const icon = join(ROOT, 'web', 'codiscuss.ico');
1486
- const tray = show_tray({ title: t('共议'), icon_path: existsSync(icon) ? icon : '', window_title: WINDOW_TITLE,
1509
+ // A tray that fails to start must not leave `tray` uninitialised: shutdown (and so every update) reads it.
1510
+ let tray = null;
1511
+ try { tray = show_tray({ title: t('共议'), icon_path: existsSync(icon) ? icon : '', window_title: WINDOW_TITLE,
1487
1512
  host: join(data, 'launcher', '共议.exe'), on_action: action => {
1488
1513
  if (action === 'open') open_panel_window(data, panel_url(state), false);
1489
1514
  if (action === 'site') open_browser(signed_site_url(site_url(data), data));
@@ -1500,7 +1525,10 @@ function run_panel(data, port) {
1500
1525
  // The note goes with the icon, so it stays a moment before the icon closes.
1501
1526
  .finally(() => setTimeout(shutdown, 2500));
1502
1527
  }
1503
- } });
1528
+ } }); } catch (error) {
1529
+ process.stderr.write(t(`任务栏图标没有启动:{value1}
1530
+ `, { value1: error.message }));
1531
+ }
1504
1532
  function shutdown(exit = true) {
1505
1533
  clearInterval(relay);
1506
1534
  clearInterval(finisher);
@@ -1526,9 +1554,12 @@ async function start_panel(data, port) {
1526
1554
  rmSync(state_path(data), { force: true });
1527
1555
  await new Promise(done => setTimeout(done, 800));
1528
1556
  }
1557
+ // The failure message below points here, so the panel's output (its startup errors among it) has to land in this file.
1529
1558
  const log = join(data, 'admin-panel.log');
1559
+ const output = openSync(log, 'w');
1530
1560
  const child = spawn(process.execPath, [fileURLToPath(import.meta.url), 'run', '--port', String(port)],
1531
- { detached: true, stdio: ['ignore', 'ignore', 'ignore'], windowsHide: true, env: { ...process.env, CODISCUSS_GATEWAY_HOME: data } });
1561
+ { detached: true, stdio: ['ignore', output, output], windowsHide: true, env: { ...process.env, CODISCUSS_GATEWAY_HOME: data } });
1562
+ closeSync(output);
1532
1563
  child.unref();
1533
1564
  for (let waited = 0; waited < 10_000; waited += 200) {
1534
1565
  await new Promise(done => setTimeout(done, 200));
@@ -134,7 +134,7 @@ pick-directory 在本机弹出系统目录选择窗口,返回所选路径;
134
134
  browse-directory 列出常用项目及其中的子文件夹(只含文件夹名,分页),供其他设备选择目录;path 为空时列出常用项目。
135
135
  device-pairing 在本机生成 12 位设备配对码(2 分钟有效,可选 temporary 临时设备、without_passkey 允许这次配对不用通行密钥、site 指定已绑定的网站),扫码链接带本机密钥指纹;只能在这台电脑上执行,新设备只能在电脑前添加。
136
136
  devices 列出已配对设备;提供 revoke(设备 id)撤销设备。
137
- ${t("room-invite 创建待签到席位并签发邀请;提供 member_id 时重发该席位链接,旧链接失效。须提供 room_id、token,可选 level(discuss/read)、folders、duration(1h/today/3d/7d/30d)、site_url;程序先读名单 revision 再建席位。链接有效 10 分钟,未签到席位 7 天结束;未绑定线上站点时只建立席位。")}
137
+ ${t("room-invite 创建待签到席位并签发邀请;提供 member_id 时重发该席位链接,旧链接失效。须提供 room_id、token,可选 level(discuss/read)、folders、site_url(借出时间由被邀请方加入时决定);程序先读名单 revision 再建席位。链接有效 10 分钟,未签到席位 7 天结束;未绑定线上站点时只建立席位。")}
138
138
  room-invites 列出房间未兑换的邀请(不含配对码);须提供 room_id、token。
139
139
  room-invite-revoke 撤销一条未兑换的邀请;须提供 room_id、token、invite_id。
140
140
  projects 读取本机已配置的项目(名称与绝对路径);提供 JSON(projects 列表)时整体替换保存。
@@ -2399,6 +2399,8 @@ export async function launch_main(args = process.argv.slice(2), input_text) {
2399
2399
  let result;
2400
2400
  if (positionals[0] === 'settings') result = { ...(input ? save_launch_settings(home, input) : launch_settings(home)), api_providers: API_PROVIDERS,
2401
2401
  scheduler_providers: SCHEDULER_PROVIDERS, scheduler_modes: SCHEDULER_MODES, scheduler_default_mode: DEFAULT_SCHEDULER_MODE, api_keys: saved_api_keys(home), managed_api_keys: restricted ? managed_api_keys(home) : [], projects: launch_projects(home).projects, projects_restricted: restricted, full_access_only: ADAPTER_IDS.filter(id => adapter_capabilities(id).no_sandbox), workspace: space.workspace, user_home: restricted ? homedir() : '', ...expert_presets(home), ...workflow_library(home) };
2402
+ // The online site an invitation would use, so an external expert's card says before the room exists whether a link can be made.
2403
+ if (positionals[0] === 'settings') result.invite_site = await (await import('./external_gateway.mjs')).invite_site_state(home);
2402
2404
  else if (positionals[0] === 'projects') result = input ? save_launch_projects(home, input) : launch_projects(home);
2403
2405
  else if (positionals[0] === 'presets') result = input ? save_expert_presets(home, input) : expert_presets(home);
2404
2406
  else if (positionals[0] === 'workflows') result = await workflows_command(home, input || {});
@@ -22,6 +22,10 @@ import { t } from './i18n.mjs';
22
22
  export const WAKES = ['auto', 'ask'];
23
23
  // The single level records had before `wake` and `confined`, still accepted by `invited-trust` as a shorthand.
24
24
  const LEGACY_TRUST = { default: { wake: 'ask', confined: true }, borrow: { wake: 'auto', confined: true }, trusted: { wake: 'auto', confined: false } };
25
+ // How long this computer lends its AI to a room: chosen here when joining and changed here later, at most three days.
26
+ export const LEND_DURATIONS = ['1h', 'today', '3d'];
27
+ const HOUR_MS = 3600000;
28
+ const LEND_MAX_MS = 3 * 24 * HOUR_MS;
25
29
  export const APPROVAL_TIMEOUT_MS = 15 * 60000;
26
30
  export const POLL_MS = 5000;
27
31
  // The inviting room fails an execution whose lease lapses; renew it as the room runner does.
@@ -71,6 +75,7 @@ export const MEMBER_API = {
71
75
  answer: room => `${EXTERNAL_PREFIX(room)}/answer`,
72
76
  messages: room => `${EXTERNAL_PREFIX(room)}/messages`,
73
77
  ai: room => `${EXTERNAL_PREFIX(room)}/ai`,
78
+ expiry: room => `${EXTERNAL_PREFIX(room)}/expiry`,
74
79
  };
75
80
 
76
81
  // ---- Secrets: sealed with DPAPI for the signed-in Windows user, 0600 elsewhere (as machine-links.json). ----
@@ -439,10 +444,38 @@ function ai_identity(home, ai) {
439
444
  return { adapter: ai.adapter, platform: Object.hasOwn(API_PROVIDERS, platform) ? platform : 'Custom', model: String(ai.model || api?.model || '').slice(0, MODEL_LIMIT) };
440
445
  }
441
446
 
447
+ /**
448
+ * When a loan chosen now ends, in epoch seconds: an hour, the end of today here (at least an hour away) or three days.
449
+ * The inviting room keeps the end it is given; the three-day ceiling is this computer's own rule.
450
+ */
451
+ export function lend_until(duration, now = Date.now()) {
452
+ if (!LEND_DURATIONS.includes(duration)) throw failure('invalid_duration', '借出时间只能是 1h、today 或 3d');
453
+ if (duration === '3d') return Math.floor((now + LEND_MAX_MS) / 1000);
454
+ if (duration === 'today') {
455
+ const end = new Date(now);
456
+ end.setHours(23, 59, 59, 0);
457
+ return Math.floor(Math.min(Math.max(end.getTime(), now + HOUR_MS), now + LEND_MAX_MS) / 1000);
458
+ }
459
+ return Math.floor((now + HOUR_MS) / 1000);
460
+ }
461
+
462
+ /** Change how long this record's AI stays lent; the inviting room confirms the new end, which the record then keeps. */
463
+ export async function lend(home, { id, duration }, deps = {}) {
464
+ const expires_at = lend_until(duration, deps.now?.() ?? Date.now());
465
+ const record = find_record(read_store(home), id);
466
+ if (record.status !== 'active') throw failure('record_ended', '这条被邀请记录已结束,不能再改借出时间');
467
+ const answer = await member_api(home, id, 'POST', MEMBER_API.expiry(record.room), { expires_at }, deps);
468
+ return change_record(home, id, (current, now, store) => {
469
+ current.expires_at = Number(answer?.expires_at || expires_at) * 1000;
470
+ return { record: record_view(current, store) };
471
+ });
472
+ }
473
+
442
474
  /** Accept an invitation: check the computer's fingerprint when the link carries one, redeem with a new key, keep the record. */
443
475
  export async function join_invite(home, input, deps = {}) {
444
476
  const invite = parse_invite(input.invite, input);
445
477
  const ai = check_ai(input);
478
+ const expires_at = lend_until(input.duration || '1h', deps.now?.() ?? Date.now());
446
479
  // A conversation this computer's software already holds, picked to carry its context into the room.
447
480
  const session_id = String(input.session_id || '');
448
481
  const keys = await machine_keys(invite.site, invite.machine, deps);
@@ -462,7 +495,7 @@ export async function join_invite(home, input, deps = {}) {
462
495
  if (existing.records[attempt.id] && read_secrets(home)[attempt.id]?.token) return { record: record_view(existing.records[attempt.id], existing) };
463
496
  const pair = attempt.pair, key_id = key_id_of(pair.public_key), identity = ai_identity(home, ai);
464
497
  const answer = await relay_send({ site: invite.site, machine: keys.id, machine_key: keys.public_key }, { key_id, private_key: pair.private_key }, 'external-redeem',
465
- { public_key: pair.public_key, proof: invite_proof(invite.code, keys.id, pair.public_key), label: String(input.label || hostname()).slice(0, 80), ...identity }, deps);
498
+ { public_key: pair.public_key, proof: invite_proof(invite.code, keys.id, pair.public_key), label: String(input.label || hostname()).slice(0, 80), expires_at, ...identity }, deps);
466
499
  if (answer.status >= 400) throw remote_failure(answer.body, 'invite_invalid', '邀请无效或已过期');
467
500
  const joined = answer.body || {};
468
501
  if (!ROOM_ID.test(joined.room?.id || '') || typeof joined.member?.name !== 'string' || typeof joined.token !== 'string') {
@@ -713,6 +746,7 @@ export async function invited_command(home, action, input = {}, deps = {}) {
713
746
  if (action === 'invited-pause') return change_record(home, id, (record, now, store) => { record.paused = input.paused !== false; return { record: record_view(record, store) }; });
714
747
  if (action === 'invited-approve') return approve(home, input);
715
748
  if (action === 'invited-refuse') return refuse_approval(home, input, deps);
749
+ if (action === 'invited-lend') return lend(home, input, deps);
716
750
  if (action === 'invited-leave') return leave(home, input, deps);
717
751
  if (action === 'invited-remove') return remove_record(home, input, deps);
718
752
  if (action === 'invited-room') return room_view(home, input, deps);
@@ -720,7 +754,7 @@ export async function invited_command(home, action, input = {}, deps = {}) {
720
754
  }
721
755
 
722
756
  export const INVITED_ACTIONS = new Set(['invited-list', 'invited-join', 'invited-trust', 'invited-ai', 'invited-pause', 'invited-approve',
723
- 'invited-refuse', 'invited-leave', 'invited-remove', 'invited-room']);
757
+ 'invited-refuse', 'invited-lend', 'invited-leave', 'invited-remove', 'invited-room']);
724
758
 
725
759
  // ---- Pulling and waking (in the service) ----
726
760
 
@@ -835,7 +869,10 @@ async function start_run(home, record, execution, { lockdown, software, end, res
835
869
  role: 'member', cwd: null, project_access: 'read', draft_directory: drafts, open_level: record.open_level, directories,
836
870
  skills: ['discuss-participant/SKILL.md', 'discuss-participant/references/room.md'].map(file => join(skills_directory, file)),
837
871
  cli, subcommands: TASK_SUBCOMMANDS, access_file: access_path, tool_lockdown: lockdown, instructions });
838
- const profile = { adapter: record.ai.adapter, ...software, model: record.ai.model || software.model || '', effort: record.ai.effort, cwd: workdir, project_access: 'read',
872
+ // 不受限 means the AI works on this computer as usual (全放开): a sandbox would run its commands as another Windows
873
+ // account, which cannot open the record's credential (DPAPI, current user), so its `codiscuss` calls would all fail.
874
+ // A locked-down run is confined by the tool rules instead and keeps read-only.
875
+ const profile = { adapter: record.ai.adapter, ...software, model: record.ai.model || software.model || '', effort: record.ai.effort, cwd: workdir, project_access: lockdown ? 'read' : 'full',
839
876
  ...(Object.hasOwn(record.ai, 'system_prompt') ? { system_prompt: record.ai.system_prompt } : {}) };
840
877
  const log_path = join(base, `external-${execution.id}.log`);
841
878
  const deliver = deps.deliver || (await import('./adapters/index.mjs')).deliver_task;
@@ -1119,6 +1156,7 @@ function print_record(record) {
1119
1156
  const contact = { online: t('在线'), offline: t('不在线'), error: t('出错'), unknown: t('未知') }[record.contact?.state || 'unknown'];
1120
1157
  const lines = [t('{id} {room}({site})成员 {member}', { id: record.id, room: record.room_title || record.room, site: record.site, member: record.member }),
1121
1158
  t(' 被点名时:{wake};在这台电脑上:{scope};已唤醒 {wakes} 次;对方电脑:{contact}{paused}', { wake, scope, wakes: record.wakes, contact, paused: record.paused ? t(';已暂停') : '' })];
1159
+ if (record.status === 'active' && record.expires_at) lines.push(t(' 借出到 {time}', { time: new Date(record.expires_at).toLocaleString() }));
1122
1160
  for (const item of record.approvals) lines.push(t(' 待确认 {approval}:消息 {messages}', { approval: item.id, messages: item.message_ids.map(n => `#${n}`).join(', ') }));
1123
1161
  if (record.status === 'left') lines.push(t(' 已退出'));
1124
1162
  if (record.status === 'ended') lines.push(t(' 对方已结束你的成员资格({reason})', { reason: record.end_reason }));
@@ -1128,11 +1166,12 @@ function print_record(record) {
1128
1166
  const HELP = () => t(`外部房间(本机 AI 作为外部成员参加另一台电脑上的房间)
1129
1167
 
1130
1168
  用法:
1131
- codiscuss join <链接|配对码> [--site 站点] [--machine 电脑编号] --adapter 软件 [--model M] [--effort E] [--session 会话] [--prompt 提示词]
1169
+ codiscuss join <链接|配对码> [--site 站点] [--machine 电脑编号] --adapter 软件 [--model M] [--effort E] [--session 会话] [--prompt 提示词] [--duration 1h|today|3d]
1132
1170
  codiscuss invited list
1133
1171
  codiscuss invited trust ID auto|ask [--unconfined|--confined]
1134
1172
  codiscuss invited ai ID [--adapter 软件] [--model M] [--effort E] [--prompt 提示词]
1135
1173
  codiscuss invited pause ID | resume ID
1174
+ codiscuss invited lend ID 1h|today|3d
1136
1175
  codiscuss invited approve ID 待确认编号 | refuse ID 待确认编号
1137
1176
  codiscuss invited leave ID
1138
1177
  codiscuss invited remove ID
@@ -1140,6 +1179,7 @@ const HELP = () => t(`外部房间(本机 AI 作为外部成员参加另一台
1140
1179
 
1141
1180
  被点名时:auto 直接回答;ask 每次先问你。
1142
1181
  本机权限:默认只在房间里发言(只能运行共议命令);--unconfined 不受限,可读本机文件、联网。
1182
+ 借出时间:加入时用 --duration 选择(默认 1h),之后用 lend 从现在起重新计算,最长 3 天。
1143
1183
  --session 续接这个软件已有的会话(带着原上下文加入);--prompt 只发给它的专属提示词,空字符串表示不用软件预设。
1144
1184
  同意后由本机服务唤醒 AI,请保持 codiscuss 服务运行。加 --json 输出 JSON。
1145
1185
  `);
@@ -1159,7 +1199,7 @@ export async function external_main(command, args, { home, deps = {}, write = te
1159
1199
  const service = home || (await import('./discussion_service.mjs')).service_home();
1160
1200
  const { values, positionals } = parseArgs({ args, allowPositionals: true, options: {
1161
1201
  site: { type: 'string' }, machine: { type: 'string' }, adapter: { type: 'string' }, model: { type: 'string' }, effort: { type: 'string' },
1162
- session: { type: 'string' }, prompt: { type: 'string' },
1202
+ session: { type: 'string' }, prompt: { type: 'string' }, duration: { type: 'string' },
1163
1203
  label: { type: 'string' }, json: { type: 'boolean' }, help: { type: 'boolean', short: 'h' },
1164
1204
  unconfined: { type: 'boolean' }, confined: { type: 'boolean' },
1165
1205
  'access-file': { type: 'string' }, root: { type: 'string' }, offset: { type: 'string' }, limit: { type: 'string' }, 'max-bytes': { type: 'string' },
@@ -1180,17 +1220,17 @@ export async function external_main(command, args, { home, deps = {}, write = te
1180
1220
  const ai = { ...(values.adapter ? { adapter: values.adapter } : {}), ...(values.model !== undefined ? { model: values.model } : {}), ...(values.effort !== undefined ? { effort: values.effort } : {}),
1181
1221
  ...(values.prompt !== undefined ? { system_prompt: values.prompt } : {}) };
1182
1222
  let result;
1183
- if (command === 'join') result = await join_invite(service, { invite: positionals[0], site: values.site, machine: values.machine, label: values.label, ...(values.session ? { session_id: values.session } : {}), ...ai }, deps);
1223
+ if (command === 'join') result = await join_invite(service, { invite: positionals[0], site: values.site, machine: values.machine, label: values.label, ...(values.session ? { session_id: values.session } : {}), ...(values.duration ? { duration: values.duration } : {}), ...ai }, deps);
1184
1224
  else {
1185
1225
  const [verb, id, extra] = positionals;
1186
1226
  const action = { list: 'invited-list', trust: 'invited-trust', ai: 'invited-ai', pause: 'invited-pause', resume: 'invited-pause', approve: 'invited-approve',
1187
- refuse: 'invited-refuse', leave: 'invited-leave', remove: 'invited-remove', room: 'invited-room' }[verb];
1227
+ refuse: 'invited-refuse', lend: 'invited-lend', leave: 'invited-leave', remove: 'invited-remove', room: 'invited-room' }[verb];
1188
1228
  if (!action) return write(HELP());
1189
1229
  // `trust ID auto|ask` sets how it answers; the old single levels (default / borrow / trusted) are still understood.
1190
1230
  const setting = !extra ? {} : LEGACY_TRUST[extra] ? { trust: extra } : { wake: extra };
1191
1231
  const scope = values.unconfined ? { confined: false } : values.confined ? { confined: true } : {};
1192
1232
  const input = { id, ...(verb === 'trust' ? { ...setting, ...scope } : {}),
1193
- ...(verb === 'ai' ? ai : {}), ...(['pause', 'resume'].includes(verb) ? { paused: verb === 'pause' } : {}), ...(['approve', 'refuse'].includes(verb) ? { approval: extra } : {}) };
1233
+ ...(verb === 'ai' ? ai : {}), ...(['pause', 'resume'].includes(verb) ? { paused: verb === 'pause' } : {}), ...(['approve', 'refuse'].includes(verb) ? { approval: extra } : {}), ...(verb === 'lend' ? { duration: extra } : {}) };
1194
1234
  result = await invited_command(service, action, input, deps);
1195
1235
  }
1196
1236
  if (values.json) return out(result);