openclaw-elys 1.7.0 → 1.7.2
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/dist/src/monitor.d.ts +0 -1
- package/dist/src/monitor.js +18 -23
- package/package.json +1 -1
package/dist/src/monitor.d.ts
CHANGED
package/dist/src/monitor.js
CHANGED
|
@@ -30,12 +30,12 @@ export async function monitorElysProvider(opts) {
|
|
|
30
30
|
// 3. Set up command handler using PluginRuntime (same pattern as feishu)
|
|
31
31
|
const core = getElysRuntime();
|
|
32
32
|
const dispatchReplyFromConfig = core?.channel?.reply?.dispatchReplyFromConfig;
|
|
33
|
-
const
|
|
33
|
+
const createDispatcher = core?.channel?.reply?.createReplyDispatcherWithTyping;
|
|
34
34
|
const finalizeCtx = core?.channel?.reply?.finalizeInboundContext;
|
|
35
|
-
log(`[elys] pluginRuntime available: ${!!core}, dispatchReplyFromConfig: ${!!dispatchReplyFromConfig}, finalizeCtx: ${!!finalizeCtx}`);
|
|
35
|
+
log(`[elys] pluginRuntime available: ${!!core}, dispatchReplyFromConfig: ${!!dispatchReplyFromConfig}, createDispatcher: ${!!createDispatcher}, finalizeCtx: ${!!finalizeCtx}`);
|
|
36
36
|
const commandHandler = async (cmd, signal) => {
|
|
37
37
|
log(`[elys] executing command: ${cmd.command}`, cmd.args);
|
|
38
|
-
if (dispatchReplyFromConfig && finalizeCtx) {
|
|
38
|
+
if (dispatchReplyFromConfig && finalizeCtx && createDispatcher) {
|
|
39
39
|
try {
|
|
40
40
|
let seq = 0;
|
|
41
41
|
let fullText = "";
|
|
@@ -77,31 +77,26 @@ export async function monitorElysProvider(opts) {
|
|
|
77
77
|
log(`[elys] final reply delivered (empty)`);
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
cfg: opts.config,
|
|
89
|
-
}),
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
// Direct dispatch fallback
|
|
80
|
+
// Create dispatcher + dispatch (same pattern as feishu built-in channel)
|
|
81
|
+
const { dispatcher, replyOptions, markDispatchIdle } = createDispatcher({
|
|
82
|
+
deliver,
|
|
83
|
+
onError: (err, info) => {
|
|
84
|
+
log(`[elys] dispatch error (${info.kind}):`, err);
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
try {
|
|
94
88
|
await dispatchReplyFromConfig({
|
|
95
89
|
ctx: inboundCtx,
|
|
96
90
|
cfg: opts.config,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
onError: (err, info) => {
|
|
100
|
-
log(`[elys] dispatch error (${info.kind}):`, err);
|
|
101
|
-
},
|
|
102
|
-
},
|
|
91
|
+
dispatcher,
|
|
92
|
+
replyOptions,
|
|
103
93
|
});
|
|
104
94
|
}
|
|
95
|
+
finally {
|
|
96
|
+
dispatcher.markComplete();
|
|
97
|
+
await dispatcher.waitForIdle().catch(() => { });
|
|
98
|
+
markDispatchIdle();
|
|
99
|
+
}
|
|
105
100
|
return {
|
|
106
101
|
id: cmd.id,
|
|
107
102
|
type: "result",
|