openclaw-elys 1.7.0 → 1.7.1

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.
@@ -3,7 +3,6 @@ export interface MonitorElysOpts {
3
3
  runtime?: Record<string, unknown>;
4
4
  abortSignal?: AbortSignal;
5
5
  accountId?: string;
6
- channelRuntime?: unknown;
7
6
  }
8
7
  /**
9
8
  * The main monitor loop for the Elys channel.
@@ -35,7 +35,7 @@ export async function monitorElysProvider(opts) {
35
35
  log(`[elys] pluginRuntime available: ${!!core}, dispatchReplyFromConfig: ${!!dispatchReplyFromConfig}, 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 && withReplyDispatcher) {
39
39
  try {
40
40
  let seq = 0;
41
41
  let fullText = "";
@@ -77,31 +77,27 @@ export async function monitorElysProvider(opts) {
77
77
  log(`[elys] final reply delivered (empty)`);
78
78
  }
79
79
  };
80
- if (withReplyDispatcher) {
81
- // Preferred path: withReplyDispatcher + dispatchReplyFromConfig (same as feishu)
82
- await withReplyDispatcher({
83
- ctx: inboundCtx,
84
- cfg: opts.config,
85
- dispatcher: { deliver },
86
- fn: (dispatchCtx) => dispatchReplyFromConfig({
87
- ctx: dispatchCtx,
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 createDispatcher = core.channel.reply.createReplyDispatcherWithTyping;
82
+ const { dispatcher, replyOptions, markDispatchIdle } = createDispatcher({
83
+ deliver,
84
+ onError: (err, info) => {
85
+ log(`[elys] dispatch error (${info.kind}):`, err);
86
+ },
87
+ });
88
+ try {
94
89
  await dispatchReplyFromConfig({
95
90
  ctx: inboundCtx,
96
91
  cfg: opts.config,
97
- dispatcherOptions: {
98
- deliver,
99
- onError: (err, info) => {
100
- log(`[elys] dispatch error (${info.kind}):`, err);
101
- },
102
- },
92
+ dispatcher,
93
+ replyOptions,
103
94
  });
104
95
  }
96
+ finally {
97
+ dispatcher.markComplete();
98
+ await dispatcher.waitForIdle().catch(() => { });
99
+ markDispatchIdle();
100
+ }
105
101
  return {
106
102
  id: cmd.id,
107
103
  type: "result",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-elys",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "OpenClaw Elys channel plugin — connects to Elys App",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",