@michengai/dsh-im-connect 0.1.76 → 0.1.77
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/CHANGELOG.md +9 -0
- package/CHANGELOG.zh-CN.md +9 -0
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/lib/channels/weixin.d.ts.map +1 -1
- package/lib/channels/weixin.js +2 -0
- package/lib/channels/weixin.js.map +1 -1
- package/lib/engine/assistant-text.d.ts +11 -0
- package/lib/engine/assistant-text.d.ts.map +1 -0
- package/lib/engine/assistant-text.js +12 -0
- package/lib/engine/assistant-text.js.map +1 -0
- package/lib/engine/choices.d.ts +2 -0
- package/lib/engine/choices.d.ts.map +1 -1
- package/lib/engine/choices.js +4 -2
- package/lib/engine/choices.js.map +1 -1
- package/lib/engine/deferred-delivery.d.ts +1 -1
- package/lib/engine/deferred-delivery.d.ts.map +1 -1
- package/lib/engine/deferred-delivery.js +3 -2
- package/lib/engine/deferred-delivery.js.map +1 -1
- package/lib/engine/delivery-history.d.ts +1 -1
- package/lib/engine/delivery-history.d.ts.map +1 -1
- package/lib/engine/delivery-history.js +2 -2
- package/lib/engine/delivery-history.js.map +1 -1
- package/lib/engine/gateway.d.ts.map +1 -1
- package/lib/engine/gateway.js +10 -8
- package/lib/engine/gateway.js.map +1 -1
- package/lib/engine/question.d.ts +1 -0
- package/lib/engine/question.d.ts.map +1 -1
- package/lib/engine/question.js +5 -1
- package/lib/engine/question.js.map +1 -1
- package/lib/engine/types.d.ts +2 -0
- package/lib/engine/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channels/weixin.ts +2 -0
- package/src/engine/assistant-text.ts +12 -0
- package/src/engine/choices.ts +11 -3
- package/src/engine/deferred-delivery.ts +3 -2
- package/src/engine/delivery-history.ts +2 -2
- package/src/engine/gateway.ts +10 -8
- package/src/engine/question.ts +5 -2
- package/src/engine/types.ts +2 -0
package/src/engine/question.ts
CHANGED
|
@@ -77,7 +77,7 @@ export function formatUserQuestion(
|
|
|
77
77
|
question: UserQuestionItem,
|
|
78
78
|
index: number,
|
|
79
79
|
total: number,
|
|
80
|
-
options: { requiresMention?: boolean } = {},
|
|
80
|
+
options: { requiresMention?: boolean; selected?: ReadonlySet<number> } = {},
|
|
81
81
|
): string {
|
|
82
82
|
const progress = total > 1 ? `(${index + 1}/${total})` : ''
|
|
83
83
|
const lines = [replyText('DeepSeek Harness 需要你补充信息{0}:', progress)]
|
|
@@ -93,8 +93,11 @@ export function formatUserQuestion(
|
|
|
93
93
|
lines.push('')
|
|
94
94
|
choices.forEach((choice, choiceIndex) => {
|
|
95
95
|
const description = nonEmptyText(choice.description)
|
|
96
|
-
|
|
96
|
+
const checked = question.multiSelect && options.selected?.has(choiceIndex) ? '✓ ' : ''
|
|
97
|
+
lines.push(`${choiceIndex + 1}. ${checked}${choice.label}${description ? ` — ${description}` : ''}`)
|
|
97
98
|
})
|
|
99
|
+
// 提交项属于选项列表,不能接在回复说明之后;企业微信按钮只有数字。
|
|
100
|
+
if (question.multiSelect === true && options.selected?.size) lines.push(`${choices.length + 1}. ${replyText('提交所选')}`)
|
|
98
101
|
lines.push('', question.multiSelect === true
|
|
99
102
|
? replyText('请回复选项序号或文字;多选用逗号分隔,也可补充其他内容。')
|
|
100
103
|
: replyText('请回复一个选项序号或文字,也可直接输入其他答案。'))
|
package/src/engine/types.ts
CHANGED
|
@@ -35,6 +35,8 @@ export interface ChannelAdapter {
|
|
|
35
35
|
readonly id: string
|
|
36
36
|
readonly label: string
|
|
37
37
|
readonly maxMessageLength: number
|
|
38
|
+
/** 抑制含工具调用的助手文字;实时与补发共用规则,不计为已投递。 */
|
|
39
|
+
readonly skipInterimText?: boolean
|
|
38
40
|
start(): void | Promise<void>
|
|
39
41
|
stop(): void | Promise<void>
|
|
40
42
|
send(chatId: string, text: string): Promise<void>
|