Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ WeChat original voice can be prepared for playback, native quotes and retained l

### Added

- An app's conversation list in **Edit identity** is now manageable: conversations sort into **Waiting**, **Active**, **Muted** and **Blocked**. **Mute** keeps messages in the Inbox without waking the Bot, **Rules** edits one group's collection and wake, and **Block** (confirmed) cancels unsent replies and keeps the conversation out even after restart or unbinding and rebinding; **Allow again** starts fresh with no backfill. A new **New conversations** setting chooses **Admit automatically** or **Ask me first**; waiting conversations keep only names and counts, never message text. At most 20 new conversations per app join automatically each hour and 500 stay active; beyond that they wait with the reason shown ([#1109](https://github.com/BotHarness/BotHarness/issues/1109), [External identities guide](docs/channel-sidebar/external-identities.md)).

- Slack, Discord and personal WeChat bind in one step too: after **Bind app**, DMs to a Slack or Discord app and @mentions of it in channels go straight to the Bot's Inbox with replies in the same thread; personal WeChat admits only DMs from the person who scanned it, never other contacts or groups. The bind dialog shows the real receiving state on every platform, and recorded group conversations follow the platform's global group intake and wake defaults ([#1112](https://github.com/BotHarness/BotHarness/issues/1112), [External identities guide](docs/channel-sidebar/external-identities.md)).

- Binding a Lark app is now enough to send and receive: **Bind identity** under External identities becomes **Bind app**, and once bound, DMs to the app and @mentions of it in groups go straight to this Bot’s Inbox, with the Bot replying in place. No saved delivery target, conversation authorization or reception switch is needed. The first message records its conversation; the app row shows a conversation count and opens a read-only conversation list, and the bind dialog shows the real receiving state. `/pair` still goes to pairing, existing authorizations behave as before, and every bound app upgrades to admitting new conversations automatically ([#1108](https://github.com/BotHarness/BotHarness/issues/1108), [ADR-0142](docs/adr/0142-a-bound-app-admits-its-direct-messages-and-mentions.md), [External identities guide](docs/channel-sidebar/external-identities.md)).
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

### Added

- **编辑外部身份** 里的会话列表现在可以管理:会话分为 **等待处理**、**活跃**、**已静音**、**已屏蔽**。**静音** 后消息照常进入收件箱但不唤醒 Bot,**规则** 单独调整一个群的收件和唤醒,**屏蔽**(需确认)会取消未发出的回复,重启、解绑再绑定后依然有效;**再次允许** 从下一条消息重新开始,不补收。新增 **新会话** 设置,可选 **自动接收** 或 **先问我**;等待中的会话只记录名称和次数,不保存消息内容。每个应用每小时最多自动加入 20 个新会话、最多 500 个活跃会话,超出时进入等待并显示原因([#1109](https://github.com/BotHarness/BotHarness/issues/1109),[外部身份教程](docs/channel-sidebar/external-identities.md))。

- Slack、Discord 和个人微信也能一步绑定:**绑定应用** 后,私聊 Slack 或 Discord 应用、或在频道里 @ 它,消息直接进入 Bot 收件箱并在原话题回复;个人微信只接收扫码者本人的私聊,其他联系人和群不会进入。绑定弹窗对所有平台显示真实接收状态,已记下的群会话跟随平台全局默认的群收件和唤醒设置([#1112](https://github.com/BotHarness/BotHarness/issues/1112),[外部身份教程](docs/channel-sidebar/external-identities.md))。

- 绑定飞书应用就能收发:外部身份里的 **绑定身份** 改为 **绑定应用**,绑定后私聊这个应用、或在群里 @ 它,消息直接进入这个 Bot 的收件箱,Bot 在原会话回复,不需要保存投递目标、授权会话或打开收件开关。第一条消息会自动记下会话,应用行显示会话数,点开可查看只读会话列表;绑定后弹窗显示真实的接收状态。`/pair` 仍由配对处理,已有授权的行为不变,所有已绑定应用升级后都默认自动接收新会话([#1108](https://github.com/BotHarness/BotHarness/issues/1108),[ADR-0142](docs/adr/0142-a-bound-app-admits-its-direct-messages-and-mentions.md),[外部身份教程](docs/channel-sidebar/external-identities.md))。
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/assets/pr/1109-conversation-list/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# #1109 Conversation list: mute, rules, block, allow again

Captured from a real DSH Host (0.2.0-rc.1) with the simulated Lark provider and the real OpenCode Go model. Each state was produced through the Host commands, not injected client data.

## Before

The app's **Conversations** list was read-only. A conversation could not be muted, given its own rules or blocked, and every new DM or @mention was admitted.

## After

| | zh light | en dark |
| ----------------- | -------------------------------- | ------------------------------- |
| Four groups | ![](conversations-zh-light.webp) | ![](conversations-en-dark.webp) |
| Block confirm | ![](block-confirm-zh-light.webp) | ![](block-confirm-en-dark.webp) |
| Rules for a group | ![](rules-zh-light.webp) | ![](rules-en-dark.webp) |

The remaining light/dark and zh/en variants are in this folder.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 24 additions & 4 deletions docs/channel-sidebar/external-identities.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,37 @@ A `/pair` command doesn’t enter the Inbox. [IM administrator pairing](/docs/la

![Ready state after binding an app](/guides/channel-sidebar/18b-bind-app-ready-en.webp)

## See the conversations
## Manage the conversations

The first DM or @mention that reaches the Inbox records its conversation. Click the app row and look under **Conversations** in the **Edit identity** dialog: each conversation shows its name (the person’s name for a DM, the group ID for a group), DM or Group, and the last message time. The list is read-only for now; mute, reception rules and block come in a later release.
The first DM or @mention that reaches the Inbox records its conversation. Click the app row and look under **Conversations** in the **Edit identity** dialog. Each conversation shows its name (the person’s name for a DM, the group ID for a group), DM or Group, and the last message time, sorted into four groups:

![The app’s conversation list](/guides/channel-sidebar/19b-app-conversations-en.webp)
| Group | What it means | Actions |
| ----------- | ------------------------------------------------------------------------------------- | ----------------------------------------- |
| **Waiting** | A new conversation that hasn’t been let in yet, with the reason and its message count | **Allow**, **Block** |
| **Active** | Messages reach the Inbox and wake the Bot | **Mute**, **Rules** (groups), **Block** |
| **Muted** | Messages still reach the Inbox but never wake the Bot; you can still reply | **Unmute**, **Rules** (groups), **Block** |
| **Blocked** | Messages are dropped and the conversation never comes back on its own | **Allow again** |

- **Rules** opens the same collection and wake settings as a group in External connectors, for this one group.
- **Block** asks for confirmation. Replies that haven’t been sent yet are cancelled, and old messages can no longer be replied to. The block stays across restarts and even after you unbind and bind the same app to this Bot again.
- **Allow again** starts a fresh conversation from the next message. Messages sent while it was blocked are not backfilled, and its old rules are not restored.

### New conversations

**New conversations** in the same dialog decides what happens the first time someone DMs the app or @mentions it in a new group (personal WeChat only has its owner, so it has no such setting):

- **Admit automatically** (default): the message goes straight to the Inbox.
- **Ask me first**: the conversation waits under **Waiting**. Only its name, first and last seen time and message count are kept, never the message text. After **Allow**, the next message is admitted.

To keep a busy app from flooding the Inbox, at most 20 new conversations per app join automatically each hour, and an app holds at most 500 active conversations. Past either limit, new conversations wait under **Waiting** and the row says which limit was hit. **Waiting** keeps the 200 most recent conversations per app.

![The app’s conversation list](/guides/channel-sidebar/19c-app-conversations-en.webp)

## Edit, reconnect or unbind

Click an app row to open **Edit identity**.

1. Change the **Local display name** or the identity’s default behavior after binding: inherit the global default, or choose a custom value.
1. Change the **Local display name**, the identity’s default behavior after binding (inherit the global default, or choose a custom value), or **New conversations**.
2. Click **Save identity**.
3. **Reconnect** revalidates the same app and its existing conversations. A changed app requires unbinding and binding again.
4. **Unbind** (red) asks for confirmation and lists the conversations it invalidates. After unbinding, the app stops delivering to this Bot and old conversations can no longer be replied to. Accepted messages and source history are retained; the shared app and its credentials are not removed.
Expand Down
28 changes: 24 additions & 4 deletions docs/channel-sidebar/external-identities.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,37 @@ Slack 和 Discord 同样适用:私聊应用、或在它所在的频道里 @

![绑定应用后的就绪状态](/guides/channel-sidebar/18b-bind-app-ready-zh.webp)

## 查看会话
## 管理会话

第一条进入收件箱的私聊或 @ 消息会自动记下这个会话。点击应用行,在 **编辑外部身份** 弹窗的 **会话** 中可以看到这个应用的全部会话:名称(私聊显示对方名字,群聊显示群 ID)、私聊或群聊、最近消息时间。这个列表目前只读;静音、调整接收规则和屏蔽会在后续版本加入。
第一条进入收件箱的私聊或 @ 消息会自动记下这个会话。点击应用行,在 **编辑外部身份** 弹窗的 **会话** 中可以看到这个应用的全部会话:名称(私聊显示对方名字,群聊显示群 ID)、私聊或群聊、最近消息时间,分成四组:

![应用的会话列表](/guides/channel-sidebar/19b-app-conversations-zh.webp)
| 分组 | 含义 | 操作 |
| ------------ | ------------------------------------------ | -------------------------------------- |
| **等待处理** | 还没放行的新会话,显示原因和消息次数 | **允许**、**屏蔽** |
| **活跃** | 消息进入收件箱并唤醒 Bot | **静音**、**规则**(群)、**屏蔽** |
| **已静音** | 消息照常进入收件箱,但不唤醒 Bot;仍可回复 | **取消静音**、**规则**(群)、**屏蔽** |
| **已屏蔽** | 消息直接丢弃,会话不会自己回来 | **再次允许** |

- **规则** 打开与「外部连接器」中群相同的收件和唤醒设置,只作用于这一个群。
- **屏蔽** 需要确认。尚未发出的回复会取消,旧消息也不能再回复。屏蔽在重启后仍然有效,即使解绑后把同一个应用重新绑定到这个 Bot 也一样。
- **再次允许** 从下一条消息开始重新接收。屏蔽期间的消息不会补收,旧的规则也不会恢复。

### 新会话

同一弹窗里的 **新会话** 决定有人第一次私聊这个应用、或在新群里 @ 它时怎么处理(个人微信只有扫码者本人,没有这个设置):

- **自动接收**(默认):消息直接进入收件箱。
- **先问我**:会话先放在 **等待处理**,只记录名称、首次和最近出现时间以及消息次数,不保存消息内容;点 **允许** 后,从下一条消息开始接收。

为防止繁忙的应用刷屏,每个应用每小时最多自动加入 20 个新会话,活跃会话最多 500 个。超过任一上限,新会话进入 **等待处理**,并在行内说明是哪一个上限。**等待处理** 每个应用最多保留最近的 200 个会话。

![应用的会话列表](/guides/channel-sidebar/19c-app-conversations-zh.webp)

## 编辑、重新连接或解绑

点击应用行,打开 **编辑外部身份**。

1. 修改 **本地显示名称**,或修改 **绑定后的身份默认行为**:继承全局默认,或自定义。
1. 修改 **本地显示名称**、**绑定后的身份默认行为**(继承全局默认,或自定义),或 **新会话**。
2. 点击 **保存身份**。
3. **重新连接** 会重新验证同一应用与已有会话。应用已变更时,需要解绑后重新绑定。
4. **解绑**(红色)需要确认,并列出将失效的会话。解绑后这个应用不再给 Bot 送消息,旧会话也不能再回复;已收消息和来源历史保留,不会删除共享应用或凭据。
Expand Down
4 changes: 4 additions & 0 deletions packages/client/src/client/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from './last-view.js';
import { defaultStorage, type ConfigStorage } from './roster-config.js';
import type { GroupReceptionInput } from '../../../core/src/messaging/group-policy.js';
import type { MessagingConversationInput } from '../../../core/src/messaging/conversations.js';
import { publishWorkspaceGrantChange } from './workspace-grant-events.js';
import type { ExternalSource } from '../../../core/src/messaging/inbound.js';
import type {
Expand All @@ -51,6 +52,7 @@ import {
manageChannelBridge,
loadMessagingSnapshot,
manageMessagingIdentity,
manageMessagingConversation,
loadMessagingTargets,
authorizeMessaging,
revokeMessaging,
Expand Down Expand Up @@ -269,6 +271,7 @@ export interface BridgeActions {
approvalRetry(slug: string, id: string): Promise<void>;
pairingReview(slug: string, input: PairingReviewInput): Promise<PairingRequest>;
messagingIdentity(slug: string, input: MessagingIdentityInput): Promise<MessagingIdentity>;
messagingConversation(slug: string, input: MessagingConversationInput): Promise<void>;
messagingSnapshot(slug: string): Promise<MessagingSnapshot>;
messagingTargets(providerId: string, accountRef: string): Promise<MessagingTarget[]>;
messagingAuthorize(input: {
Expand Down Expand Up @@ -1807,6 +1810,7 @@ export function createActions(
approvalRetry: (slug, id) => retryApprovalNotification(call, slug, id),
pairingReview: (slug, input) => reviewPairing(call, slug, input),
messagingIdentity: (slug, input) => manageMessagingIdentity(call, slug, input),
messagingConversation: (slug, input) => manageMessagingConversation(call, slug, input),
messagingSnapshot: (slug) => loadMessagingSnapshot(call, slug),
messagingTargets: (providerId, accountRef) =>
loadMessagingTargets(call, providerId, accountRef),
Expand Down
8 changes: 8 additions & 0 deletions packages/client/src/client/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import type { OverviewUsage } from '../../../core/src/bridge/methods.js';
import type { UsageOverviewPeriod } from '../../../core/src/usage/overview.js';
import type { ChannelActivityToday } from '../../../core/src/channels/activity-today.js';
import type { GroupReceptionInput } from '../../../core/src/messaging/group-policy.js';
import type { MessagingConversationInput } from '../../../core/src/messaging/conversations.js';
import type { ActivityOverview } from '../../../core/src/bridge/methods.js';
import type { ExternalSource } from '../../../core/src/messaging/inbound.js';
import type { HumanAssignmentContext } from '../../../core/src/runtime/assignment-human-context.js';
Expand Down Expand Up @@ -3651,6 +3652,13 @@ export async function setMessagingGroupPolicy(
): Promise<void> {
await unwrap(call, 'messagingGroupPolicy', { slug, grantId, policy });
}
export async function manageMessagingConversation(
call: BridgeCall,
slug: string,
input: MessagingConversationInput,
): Promise<void> {
await unwrap(call, 'messagingConversation', { slug, input });
}
export async function setMessagingReceive(
call: BridgeCall,
slug: string,
Expand Down
Loading
Loading