@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.
Files changed (41) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/CHANGELOG.zh-CN.md +9 -0
  3. package/README.md +2 -0
  4. package/README.zh-CN.md +2 -0
  5. package/lib/channels/weixin.d.ts.map +1 -1
  6. package/lib/channels/weixin.js +2 -0
  7. package/lib/channels/weixin.js.map +1 -1
  8. package/lib/engine/assistant-text.d.ts +11 -0
  9. package/lib/engine/assistant-text.d.ts.map +1 -0
  10. package/lib/engine/assistant-text.js +12 -0
  11. package/lib/engine/assistant-text.js.map +1 -0
  12. package/lib/engine/choices.d.ts +2 -0
  13. package/lib/engine/choices.d.ts.map +1 -1
  14. package/lib/engine/choices.js +4 -2
  15. package/lib/engine/choices.js.map +1 -1
  16. package/lib/engine/deferred-delivery.d.ts +1 -1
  17. package/lib/engine/deferred-delivery.d.ts.map +1 -1
  18. package/lib/engine/deferred-delivery.js +3 -2
  19. package/lib/engine/deferred-delivery.js.map +1 -1
  20. package/lib/engine/delivery-history.d.ts +1 -1
  21. package/lib/engine/delivery-history.d.ts.map +1 -1
  22. package/lib/engine/delivery-history.js +2 -2
  23. package/lib/engine/delivery-history.js.map +1 -1
  24. package/lib/engine/gateway.d.ts.map +1 -1
  25. package/lib/engine/gateway.js +10 -8
  26. package/lib/engine/gateway.js.map +1 -1
  27. package/lib/engine/question.d.ts +1 -0
  28. package/lib/engine/question.d.ts.map +1 -1
  29. package/lib/engine/question.js +5 -1
  30. package/lib/engine/question.js.map +1 -1
  31. package/lib/engine/types.d.ts +2 -0
  32. package/lib/engine/types.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/src/channels/weixin.ts +2 -0
  35. package/src/engine/assistant-text.ts +12 -0
  36. package/src/engine/choices.ts +11 -3
  37. package/src/engine/deferred-delivery.ts +3 -2
  38. package/src/engine/delivery-history.ts +2 -2
  39. package/src/engine/gateway.ts +10 -8
  40. package/src/engine/question.ts +5 -2
  41. package/src/engine/types.ts +2 -0
@@ -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
- lines.push(`${choiceIndex + 1}. ${choice.label}${description ? ` — ${description}` : ''}`)
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('请回复一个选项序号或文字,也可直接输入其他答案。'))
@@ -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>