@ynhcj/xiaoyi-channel 0.0.182-next → 0.0.183-next

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/bot.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-runtime";
1
2
  import { updateSessionStoreEntry, updateSessionStore, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
2
3
  import { getXYRuntime } from "./runtime.js";
3
4
  import { createXYReplyDispatcher } from "./reply-dispatcher.js";
@@ -176,6 +177,19 @@ export async function handleXYMessage(params) {
176
177
  },
177
178
  });
178
179
  log.log(`[BOT] Resolved route, sessionKey=${route.sessionKey}`);
180
+ // Check for ACP runtime binding on this A2A conversation
181
+ const runtimeRoute = resolveRuntimeConversationBindingRoute({
182
+ route,
183
+ channel: "xiaoyi-channel",
184
+ accountId,
185
+ conversationId: parsed.sessionId,
186
+ });
187
+ route = runtimeRoute.route;
188
+ if (runtimeRoute.bindingRecord) {
189
+ log.log(runtimeRoute.boundSessionKey
190
+ ? `[BOT] routed via bound conversation ${parsed.sessionId} -> ${runtimeRoute.boundSessionKey}`
191
+ : `[BOT] plugin-bound conversation ${parsed.sessionId}`);
192
+ }
179
193
  // ALS only: no registerSession. The sessionContext built below is handed
180
194
  // to runWithSessionContext() inside withReplyDispatcher.run, which is the
181
195
  // single wrap point for the whole agent turn.
@@ -126,6 +126,15 @@ export const xyPlugin = {
126
126
  ? { conversationId, matchPriority: 2 }
127
127
  : null;
128
128
  },
129
+ resolveCommandConversation: ({ accountId }) => {
130
+ // xiaoyi-channel: the A2A sessionId IS the conversationId.
131
+ // Read from the current ALS session context.
132
+ const ctx = getCurrentSessionContext();
133
+ const sessionId = ctx?.sessionId?.trim();
134
+ if (!sessionId)
135
+ return null;
136
+ return { conversationId: sessionId };
137
+ },
129
138
  },
130
139
  reload: {
131
140
  configPrefixes: ["channels.xiaoyi-channel"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.182-next",
3
+ "version": "0.0.183-next",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",