@dcrays/dcgchat-test 0.3.7 → 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 +1 -1
- package/src/cron.ts +1 -1
- package/src/cronToolCall.ts +5 -5
package/package.json
CHANGED
package/src/cron.ts
CHANGED
package/src/cronToolCall.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
182
|
+
return params
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
return
|
|
186
|
+
return params
|
|
187
187
|
}
|