@xmanrui/dsh-im 4.2.1 → 4.3.0

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/README.en.md CHANGED
@@ -140,9 +140,11 @@ See the [Proactive Delivery Guide](PROACTIVE_DELIVERY.en.md) ([简体中文](PRO
140
140
 
141
141
  ### Context enhancement
142
142
 
143
- Open **Context enhancement** on a bot card to choose conversation scopes, source fields and guidance, then **Save**. The five available fields are `channel`, `conversationType`, `senderId`, `senderName` and `botId`; only `senderId` is selected by default. Only selected values already available in the incoming message are included; no platform profile API is queried. Weixin currently supports DMs only.
143
+ Open **Context enhancement** on a bot card to configure separate enable switches, source fields, and guidance for group and direct chats, then **Save** to apply the complete configuration atomically. The two scopes do not share settings. Each offers `channel`, `conversationType`, `senderId`, `senderName`, and `botId`, with only `senderId` selected by default. Only values selected for the current scope and already available in the incoming message are included; no platform profile API is queried. Weixin currently supports DMs only.
144
144
 
145
- When enabled, ordinary user messages receive a `<dsh_im_source>` prefix. Nonempty guidance is automatically wrapped in `<dsh_im_source_guidance>` tags. Guidance starts empty; the question-mark help includes instructions and an example, while **Use example** and **Clear** only edit the draft. No selected fields means no source block. Commands, approvals and question answers keep their existing control paths.
145
+ When enabled, ordinary user messages receive the current scope's `<dsh_im_source>` prefix. Nonempty guidance for that scope is automatically wrapped in `<dsh_im_source_guidance>` tags. Both guidance fields start empty and have their own instructions, example, **Use example**, and **Clear** actions. No fields selected in the current scope means no source block. Commands, approvals and question answers keep their existing control paths.
146
+
147
+ Existing shared fields and guidance are automatically copied into both group and direct configurations during upgrade, while their original enable switches remain independent. The first read does not rewrite the settings file; the new structure is persisted through the existing mechanism on the next successful bot-settings write, with no manual migration required.
146
148
 
147
149
  When the current conversation scope is off, text, images, files and Session behavior are unchanged, without enhancement assembly or extra network queries. Unsaved or cancelled drafts have no effect. Saving does not reconnect bots or recreate Sessions; messages already received retain their original configuration snapshot.
148
150
 
package/README.md CHANGED
@@ -143,9 +143,11 @@ dsh web
143
143
 
144
144
  ### 上下文增强
145
145
 
146
- 点击机器人卡片中的「上下文增强」,设置群聊/私聊范围、来源字段和增强提示词,点击「保存」后生效。五个可选字段为 `channel`、`conversationType`、`senderId`、`senderName`、`botId`,默认只选择 `senderId`;只发送勾选且当前消息已有的值,不查询平台 API 补全。微信当前只支持私聊。
146
+ 点击机器人卡片中的「上下文增强」,分别设置群聊和私聊的启用开关、来源字段与增强提示词,点击「保存」后原子生效。两个场景互不共用配置;五个可选字段均为 `channel`、`conversationType`、`senderId`、`senderName`、`botId`,各自默认只选择 `senderId`。插件只发送当前场景勾选且当前消息已有的值,不查询平台 API 补全。微信当前只支持私聊。
147
147
 
148
- 开启后,插件在普通用户消息前附加 `<dsh_im_source>` 来源块;非空的增强提示词自动包裹为 `<dsh_im_source_guidance>`。增强提示词默认留空,标题旁的问号提供使用说明和示例,也可以「填入示例」或「清空」正文;字段全部取消时不生成来源块。命令、审批和问题回答继续走原有控制链路。
148
+ 开启后,插件在普通用户消息前附加当前场景的 `<dsh_im_source>` 来源块;当前场景非空的增强提示词自动包裹为 `<dsh_im_source_guidance>`。两个场景的提示词默认留空,并分别提供说明、示例、「填入示例」和「清空」;当前场景字段全部取消时不生成来源块。命令、审批和问题回答继续走原有控制链路。
149
+
150
+ 升级前已经保存的共用字段与增强提示词会自动复制到群聊、私聊两份配置,原有两个开关也分别保留。升级后的首次读取不会改写配置文件;之后任意一次机器人设置成功保存时,会随现有设置写入机制自动落盘为新结构,无需手工迁移。
149
151
 
150
152
  当前会话类型未开启时,原有文字、图片、文件和会话处理保持不变,不组装增强内容,也不新增网络查询。草稿、清空后取消等操作不改变运行配置;保存不重连机器人、不重建会话,已经接收的消息仍使用接收时的配置。
151
153