diff --git a/.agents/skills/verify-deepseekbot/features/remote-hosts.md b/.agents/skills/verify-deepseekbot/features/remote-hosts.md index 39825f4892..66951a2982 100644 --- a/.agents/skills/verify-deepseekbot/features/remote-hosts.md +++ b/.agents/skills/verify-deepseekbot/features/remote-hosts.md @@ -7,6 +7,7 @@ The browser reads each Remote Host Feed through its own Paired Device and the sh - `packages/client/src/client/remote-host*.{ts,tsx}` - `packages/client/src/client/features/environments/remote-host-*.ts` - `packages/client/src/client/owner-password-{dialog,sign-in-settings}.tsx` +- `packages/client/src/client/connection-hosts.tsx` - `packages/host-client/src/{owner-sign-in,sign-in-discovery}.ts` - `packages/client/src/client/relationship{s,-settings}.{ts,tsx}` - `packages/core/src/devices/relationship*.ts` @@ -26,6 +27,14 @@ With Team mode off, open the target Host's Connections settings. Turn on **Passw Use `team-mode owner-sign-in status` to inspect the setting. Sign in a separate CLI device with `device-owner-sign-in` and validate `device-probe` with its private device file. Disable password sign-in on the target. Verify that a new login is refused and both enrolled devices still read the target Feed. Revoke the CLI device by its ID and verify it loses access. Restart the target Profile and verify the setting and selected username persist. Remove test device files during cleanup. +## Change the Owner password (#4899) + +On a fresh Host with Team mode off, enroll two Owner devices by password and one by QR code. On the first device, open the target **Host settings → Connections → Your password → Change**. On the Host itself, use **Settings → Team → Your password → Change**. Confirm the sign-out checkbox defaults to selected. Save the new password. The other password-enrolled device loses its live connection and its next authenticated read is refused. The device that changed the password and the QR-paired device still read the target Host Feed. Verify the old password is refused for new sign-ins and the new password works. Repeat with the checkbox cleared and verify all existing devices keep their access. + +For CLI parity, pass the private JSON containing `current` and `password` on stdin to `team-mode owner-password --password-stdin --sign-out-others=true --confirm`. Compare `devices` and `device-probe` results for password and QR grants, and repeat with `--sign-out-others=false`. Redact credentials from visual and console evidence. + +In remote Connections, check that route selection, route status and route actions share a list card, and that each paired device has its own row and revoke action in the device card. Use a narrow settings window with a long route address to check that the address and action remain readable. Compare the device list with the target Host's `devices` output. + ## Reciprocal relationship (E1) Use fresh schema144 Homes after published Team141–143; do not launch internal Environment141–143 preview databases with this source. Relationship management is current-Owner-only: member/Admin HTTP carriers and CLI `--as` must refuse list/initiate/approve/enroll/disconnect. Transfer Owner and require old derived credentials and pending old-Owner offers to refuse; a newly enrolled Client records the new Owner Human. A valid current-Owner credential still cannot bypass inactive-relationship admission. Retain private Source Event Human readback, spoofed Human rejection and private-Bot access refusals through the same per-Human bridge factory. diff --git a/changes/4899-owner-password-device-revocation.md b/changes/4899-owner-password-device-revocation.md new file mode 100644 index 0000000000..270ff661e1 --- /dev/null +++ b/changes/4899-owner-password-device-revocation.md @@ -0,0 +1,11 @@ +--- +section: Added +--- + +## en + +- When Host Owners change their password, they can sign out other devices enrolled by password. The current device and QR-paired devices retain access ([#4899](https://github.com/BotHarness/DeepSeekBot/issues/4899)). + +## zh + +- Host Owner 更改密码时可退出其他通过账密登录的设备。当前设备和扫码配对设备可继续访问([#4899](https://github.com/BotHarness/DeepSeekBot/issues/4899))。 diff --git a/docs/architecture/botharness-architecture.en.md b/docs/architecture/botharness-architecture.en.md index bd05467f6b..6794252a5f 100644 --- a/docs/architecture/botharness-architecture.en.md +++ b/docs/architecture/botharness-architecture.en.md @@ -72,6 +72,8 @@ Desktop, iOS, and Android share the Host identity and password sign-in flow when The Host issues a Paired Device grant for the authenticated Human and binds it to the Client device key. The existing Devices module owns the grant and records its issuance method for selective revocation during Owner password changes. Team mode enables password sign-in. With Team mode off, the standalone Owner setting controls new Owner password sign-ins. The first delivery covers standalone Owner sign-in over HTTPS in desktop and Web Clients. See [connection decisions](../decisions/connections.md#remote-host-password-sign-in-uses-the-same-encrypted-device-channel-on-every-route) and [Team mode decisions](../decisions/team-mode.md#host-password-sign-in-and-team-mode). +When the Owner chooses to sign out other devices during a password change, the Team Service commits the new password and targeted revocations together. The device gateway supplies the current device from its authenticated connection. The Devices module then closes the revoked connections. + ## 1 · System context ```mermaid diff --git a/docs/architecture/botharness-architecture.md b/docs/architecture/botharness-architecture.md index 6d1ef22af5..713de25497 100644 --- a/docs/architecture/botharness-architecture.md +++ b/docs/architecture/botharness-architecture.md @@ -666,6 +666,8 @@ The application-defined `ConnectionsDialog` presents pairing and device manageme Host 按当前 Human 身份签发与客户端设备公钥绑定的 Paired Device 授权。设备授权由现有设备模块持有,并记录签发方式,供 Owner 改密时选择性撤销。Team mode 自动开启账密登录。Team mode 关闭后,Host 根据独立的 Owner 设置决定是否接收新的 Owner 账密登录。见[连接决策](../decisions/connections.md#remote-host-password-sign-in-uses-the-same-encrypted-device-channel-on-every-route)和 [Team mode 决策](../decisions/team-mode.md#host-password-sign-in-and-team-mode)。 +Owner 改密时若选择退出其他设备,Team Service 在同一事务中保存新密码并撤销指定授权。设备网关从已认证连接取得当前设备,设备模块在提交后关闭已撤销的连接。 + ### 手机推送 [ADR-0202](../decisions/mobile.md#adr-0202)([#1655](https://github.com/BotHarness/DeepSeekBot/issues/1655)):应用定义的 Push delivery 模块(`packages/core/src/push/`)是 Activity 的投影,不另设通知权威。Activity 表或 PersonaBot 的审批、提问、私密输入计数变化时(以及每分钟一次的兜底扫描),模块读取 `action` 项与未读的 `replies` 项,对每台已登记的配对设备只发送一次新项,并经 Expo Push Service 投递;推送标题为频道名(`#名称`,私信为 PersonaBot 名称),正文为所需操作加上工具与主要参数、问题或消息的简短预览(折叠空白,预览最多 140 个 UTF-16 代码单元,含截断省略号);私密输入请求不含内容([ADR-0213](../decisions/mobile.md#adr-0213))。数据字段包含路由标识、显示文字及适用的发送者和审批元数据。由 Android 原生模块呈现的通知也从数据字段读取标题、正文和角标。角标表示该 Host 的未处理 Human 操作数。设备经设备网关的 `/botharness-device/push` 登记 Expo push token、切换各类通知、发送测试通知;撤销设备或 Expo 回报 `DeviceNotRegistered` 时删除 token。发送失败有界重试,结果写入不含内容的 `push` 开发者日志。App 保存每台配对的 Host,点按通知先切换到对应 Host,再打开该审批、提问或私信。 diff --git a/docs/bot-cli.md b/docs/bot-cli.md index 8ca369623a..8277c47f88 100644 --- a/docs/bot-cli.md +++ b/docs/bot-cli.md @@ -2343,6 +2343,8 @@ QQ also supports `deepseekbot messaging-defaults qq` and `messaging-defaults-set Use `team-mode owner-sign-in status` to read the standalone Owner sign-in setting on the selected Host. To create the first credential, run `team-mode owner-sign-in on --username --password-stdin --confirm` with the password on stdin. To reuse a configured credential, run `team-mode owner-sign-in on --confirm`. The `off` action stops new password sign-ins and keeps existing Owner devices connected. +To change an existing Owner password, pass a private JSON file containing the `current` and `password` fields on stdin to `team-mode owner-password --password-stdin`. Add `--sign-out-others=true --confirm` to revoke the other Owner devices enrolled by password. QR-paired devices and the active Owner session retain access. With the flag omitted or set to `false`, existing devices retain access. + On another Client, use `device-owner-sign-in --password-stdin --confirm --out `. The CLI validates the HTTPS origin and sends the password through the authenticated encrypted device channel. It writes keys and credentials to the new private file and prints the Host ID, device ID, and output path. Use `device-probe --device-file ` to read the real Host Feed with that device grant. `dm ` opens or creates the authenticated Human's canonical DM with that active person on the selected Host. Opening from either participant returns the same Channel; another Human's DM remains inaccessible. Use `channels send --body-stdin` and `channel-messages ` for messages. Pure Human DMs have no Bot participant; Group messages remain readable by their eligible Bot members. diff --git a/docs/bot-cli.zh.md b/docs/bot-cli.zh.md index 335e7edf5a..0a835530ef 100644 --- a/docs/bot-cli.zh.md +++ b/docs/bot-cli.zh.md @@ -2231,6 +2231,8 @@ QQ 同样支持 `deepseekbot messaging-defaults qq` 和 `messaging-defaults-set 使用 `team-mode owner-sign-in status` 查看目标 Host 的独立 Owner 账密登录设置。首次创建账密时执行 `team-mode owner-sign-in on --username <用户名> --password-stdin --confirm`,通过标准输入提供密码。已有账密时,执行 `team-mode owner-sign-in on --confirm` 即可继续使用。用 `off` 停止新的账密登录,已登记的 Owner 设备可以继续连接。 +更改现有 Owner 密码时,把含有 `current` 和 `password` 字段的私有 JSON 文件通过标准输入传给 `team-mode owner-password --password-stdin`。添加 `--sign-out-others=true --confirm` 可撤销其他通过账密登记的 Owner 设备。扫码配对设备和当前 Owner 会话可继续访问。省略该选项或设为 `false` 时,已有设备可继续访问。 + 在另一端执行 `device-owner-sign-in <可信 HTTPS 地址> <用户名> --password-stdin --confirm --out <私有设备文件绝对路径>`。CLI 验证 HTTPS 地址,经已认证的设备加密通道提交密码,将设备密钥和凭据写入新建的私有文件。标准输出只报告 Host ID、设备 ID 和文件路径等连接信息。使用 `device-probe --device-file <私有设备文件绝对路径>` 验证可用该设备授权读取真实 Host Feed。 `dm ` 在指定 Host 上打开或创建当前 Human 与该活跃联系人的唯一私聊。双方打开会返回同一频道,其他 Human 无权读取。使用 `channels send --body-stdin` 和 `channel-messages ` 收发、读取消息。纯 Human 私聊没有 Bot 参与者;群消息仍可由有权参与的 Bot 阅读。 diff --git a/packages/client/src/client/connection-hosts.tsx b/packages/client/src/client/connection-hosts.tsx index a4cfeb7496..b717c3a7cd 100644 --- a/packages/client/src/client/connection-hosts.tsx +++ b/packages/client/src/client/connection-hosts.tsx @@ -14,6 +14,8 @@ import { import { parseConnectedHosts } from './connect-account-hosts.js'; import { useMountedResource } from './mounted-resource.js'; import { SettingsRow, SettingsSection } from './ds/settings-row.js'; +import { Icon } from './ds/icon.js'; +import { ListCard, ListCardItem } from './ds/list-card.js'; import { StatusDisclosure } from './ds/status-block.js'; import { Note } from './ds/note.js'; import { ConfirmDialog } from './ds/form-dialog.js'; @@ -153,6 +155,7 @@ function HostDetailsSession({ } }; const observed = observedHost(remote); + const devices = managed?.devices.filter((device) => !device.revoked) ?? []; const mutationBlocked = busy || remote.host.pendingConnection !== undefined || @@ -180,75 +183,135 @@ function HostDetailsSession({ ) : null} - route.address), - ...(observed.routePreference === 'automatic' ? [] : [observed.routePreference]), - ]), - ].map((route) => ({ - value: route, - label: `${routeLabel(route, t)} · ${route}`, - })), - ]} - onChange={(route) => void perform({ action: 'select-route', route, confirm: true })} - /> - } - /> - {observed.routeChangePending ? {t('connections.hosts.switchPending')} : null} - {observed.routePreference !== 'automatic' ? ( - <> - {t('connections.hosts.manualHint')} - + + ) : null} + + ) : undefined } - > - {t('connections.hosts.returnAutomatic')} - - - ) : null} - {observed.routes.map((route) => ( - void perform({ action: 'test-route', route: route.address })} - > - {t('connections.hosts.testRoute')} - - } - /> - ))} + trailing={ +