@luv20100918/openclaw-channel-talk 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/webhook.ts +21 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luv20100918/openclaw-channel-talk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Channel Talk (채널톡) integration for OpenClaw - Connect your AI assistant to Channel Talk team chats and customer conversations",
5
5
  "keywords": [
6
6
  "openclaw",
package/src/webhook.ts CHANGED
@@ -281,6 +281,27 @@ export async function processWebhookEvent(
281
281
  ...(isGroupChat ? { GroupSubject: `team-chat:${chatId}` } : {}),
282
282
  });
283
283
 
284
+ // Record session so messages appear in OpenClaw TUI
285
+ const storePath = runtime.channel.session.resolveStorePath(cfg.session?.store, {
286
+ agentId: route.agentId,
287
+ });
288
+ await runtime.channel.session.recordInboundSession({
289
+ storePath,
290
+ sessionKey: ctxPayload.SessionKey ?? route.sessionKey,
291
+ ctx: ctxPayload,
292
+ updateLastRoute: !isGroupChat
293
+ ? {
294
+ sessionKey: route.sessionKey,
295
+ channel: "channel-talk",
296
+ to: `channel-talk:${chatId}`,
297
+ accountId: target.accountId,
298
+ }
299
+ : undefined,
300
+ onRecordError: (err) => {
301
+ target.log?.error?.(`[channel-talk:${target.accountId}] session record error: ${String(err)}`);
302
+ },
303
+ });
304
+
284
305
  // Dispatch through agent pipeline, delivering reply via Channel Talk API
285
306
  await runtime.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
286
307
  ctx: ctxPayload,