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.
@@ -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.
@@ -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 withReplyDispatcher = core?.channel?.reply?.withReplyDispatcher;
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
- 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 { 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
- dispatcherOptions: {
98
- deliver,
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-elys",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "OpenClaw Elys channel plugin — connects to Elys App",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",