@dcrays/dcgchat-test 0.3.8 → 0.3.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcrays/dcgchat-test",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "type": "module",
5
5
  "description": "OpenClaw channel plugin for 书灵墨宝 (WebSocket)",
6
6
  "main": "index.ts",
@@ -154,14 +154,14 @@ export function cronToolCall(event: { toolName: any; params: any; toolCallId: an
154
154
  const delivery = extractDelivery(params)
155
155
  if (!delivery) {
156
156
  dcgLogger(`[${LOG_TAG}] cron call (${toolCallId}) has no delivery config, skip.`)
157
- return undefined
157
+ return params
158
158
  }
159
159
  if (!needsBestEffort(delivery)) {
160
160
  dcgLogger(
161
161
  `[${LOG_TAG}] cron call (${toolCallId}) delivery does not need bestEffort ` +
162
162
  `(mode=${String(delivery.mode)}, channel=${String(delivery.channel)}, bestEffort=${String(delivery.bestEffort)}), skip.`
163
163
  )
164
- return undefined
164
+ return params
165
165
  }
166
166
 
167
167
  // ★ 核心:注入 bestEffort: true
@@ -173,15 +173,15 @@ export function cronToolCall(event: { toolName: any; params: any; toolCallId: an
173
173
 
174
174
  return { params: newParams }
175
175
  } else if (toolName === 'exec') {
176
- if (params.command.indexOf('cron create') || params.command.indexOf('cron add')) {
176
+ if (params.command.indexOf('cron create') > -1 || params.command.indexOf('cron add') > -1) {
177
177
  const newParams = JSON.parse(JSON.stringify(params)) as Record<string, unknown>
178
178
  newParams.command =
179
179
  params.command.replace('--json', '') + ` --session-key ${sk} --channel ${"dcgchat-test"} --to ${sk} --json`
180
180
  return { params: newParams }
181
181
  } else {
182
- return undefined
182
+ return params
183
183
  }
184
184
  }
185
185
 
186
- return undefined
186
+ return params
187
187
  }