@eyeclaw/eyeclaw 2.0.6 → 2.0.7
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/client.ts +6 -5
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -130,7 +130,7 @@ export class EyeClawClient {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
private handleExecuteCommand(message: Record<string, unknown>): void {
|
|
133
|
+
private async handleExecuteCommand(message: Record<string, unknown>): Promise<void> {
|
|
134
134
|
const command = message.command as string
|
|
135
135
|
const params = (message.params as Record<string, unknown>) || {}
|
|
136
136
|
|
|
@@ -144,8 +144,8 @@ export class EyeClawClient {
|
|
|
144
144
|
// Send user message acknowledgment
|
|
145
145
|
this.sendLog('info', `收到消息: ${userMessage}`)
|
|
146
146
|
|
|
147
|
-
// Call OpenClaw Agent via callback
|
|
148
|
-
this.handleChatMessage(userMessage)
|
|
147
|
+
// Call OpenClaw Agent via callback and wait for completion
|
|
148
|
+
await this.handleChatMessage(userMessage)
|
|
149
149
|
break
|
|
150
150
|
}
|
|
151
151
|
|
|
@@ -184,11 +184,12 @@ export class EyeClawClient {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
private handleChatMessage(userMessage: string): void {
|
|
187
|
+
private async handleChatMessage(userMessage: string): Promise<void> {
|
|
188
188
|
// This will be called by OpenClaw channel plugin via sendAgent
|
|
189
189
|
if (this.sendAgentCallback) {
|
|
190
190
|
this.logger.info('🤖 Calling OpenClaw Agent...')
|
|
191
|
-
this.sendAgentCallback(userMessage)
|
|
191
|
+
await this.sendAgentCallback(userMessage)
|
|
192
|
+
this.logger.info('✅ OpenClaw Agent completed')
|
|
192
193
|
} else {
|
|
193
194
|
// Fallback: simple echo if not running in OpenClaw context
|
|
194
195
|
this.logger.warn('No OpenClaw Agent available, using echo mode')
|