@wenbin_wb/dsh-bridge 2.3.1 → 2.3.3

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.
@@ -818,12 +818,13 @@ function getWorkspaceBasename(cwd) {
818
818
 
819
819
  async function routeCommand(node, text) {
820
820
  const trimmed = text.trim()
821
- if (!trimmed.startsWith('/')) return false
822
821
 
823
822
  if (trimmed === '/yes' || trimmed === '/no' || /^[12]$/.test(trimmed)) {
824
823
  if (node.resolveApproval(trimmed)) return true
825
824
  }
826
825
 
826
+ if (!trimmed.startsWith('/')) return false
827
+
827
828
  const [command, ...rest] = trimmed.slice(1).split(/\s+/)
828
829
  switch (command) {
829
830
  case 'help':
package/lib/qq/node.js CHANGED
@@ -205,6 +205,38 @@ export class QqConversationNode extends ConversationBridge {
205
205
  return this._sendMarkdown(peerId, text, { scope, msgId: replyMsgId, keyboard })
206
206
  }
207
207
 
208
+ // 审批申请:发送带「✓ 批准执行」与「✕ 拒绝执行」交互按钮的 Markdown 卡片
209
+ const isApprovalMessage = text.includes('操作权限确认')
210
+ if (isApprovalMessage) {
211
+ const keyboard = {
212
+ content: {
213
+ rows: [
214
+ {
215
+ buttons: [
216
+ {
217
+ id: 'approve_yes',
218
+ render_data: { label: '✓ 批准执行', visited_label: '已批准', style: 1 },
219
+ action: { type: 1, permission: { type: 2 }, data: '/yes', unsupport_tips: '请升级QQ客户端后使用' },
220
+ },
221
+ {
222
+ id: 'approve_no',
223
+ render_data: { label: '✕ 拒绝执行', visited_label: '已拒绝', style: 0 },
224
+ action: { type: 1, permission: { type: 2 }, data: '/no', unsupport_tips: '请升级QQ客户端后使用' },
225
+ },
226
+ ],
227
+ },
228
+ ],
229
+ },
230
+ }
231
+ return this._sendMarkdown(peerId, sanitizeQQMarkdown(text), { scope, keyboard })
232
+ }
233
+
234
+ // 审批决议通知(已批准/已拒绝):直接单条 Markdown 发送,无需流式分片
235
+ const isResolutionMessage = text.includes('已批准执行') || text.includes('已拒绝执行')
236
+ if (isResolutionMessage) {
237
+ return this._sendMarkdown(peerId, sanitizeQQMarkdown(text), { scope })
238
+ }
239
+
208
240
  // 其他回复统一走「流式 Markdown」:content_type=markdown 让手机端渲染
209
241
  const content = String(text || '').trim()
210
242
  if (content.length === 0) return { success: true }
@@ -421,6 +453,10 @@ export class QqConversationNode extends ConversationBridge {
421
453
  await this.handleInbound({ senderId: authId, text: '/list', isGroup })
422
454
  } else if (buttonId === 'help') {
423
455
  await this.handleInbound({ senderId: authId, text: '/help', isGroup })
456
+ } else if (buttonId === 'approve_yes') {
457
+ await this.handleInbound({ senderId: authId, text: '/yes', isGroup })
458
+ } else if (buttonId === 'approve_no') {
459
+ await this.handleInbound({ senderId: authId, text: '/no', isGroup })
424
460
  } else {
425
461
  this.logger?.info?.(`[dsh-bridge qq] unknown button interaction: ${buttonId}`)
426
462
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenbin_wb/dsh-bridge",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "手机扫码即可在移动端/公网继续用 DeepSeek Harness,人不在电脑前也能接着干。一键局域网二维码、Cloudflare 公网隧道、自建隧道与微信 / QQ / 飞书 Bot(多工作区/会话持久化/媒体/卡片审批/流式输出),无需自己搭公网服务器。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",