palz-connector 1.2.4 → 1.2.5

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "palz-connector",
3
3
  "name": "Palz Connector Channel",
4
- "version": "1.2.4",
4
+ "version": "1.2.5",
5
5
  "description": "Palz IM 接入 OpenClaw",
6
6
  "channels": [
7
7
  "palz-connector"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palz-connector",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "description": "Palz IM 接入 OpenClaw — 模块化架构,基于 OpenClaw Runtime 消息管道",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "enabled": true,
3
- "streamUrl": "ws://14.103.148.99:9090/ws/bot",
4
- "apiBaseUrl": "http://14.103.148.99:9090/api",
3
+ "streamUrl": "wss://claw-server.csaiagent.com/ws/bot",
4
+ "apiBaseUrl": "https://claw-server.csaiagent.com/api",
5
5
  "sessionTimeout": 1800000
6
6
  }
package/src/bot.ts CHANGED
@@ -400,6 +400,7 @@ async function dispatchPalzMessage(params: HandlePalzMessageParams): Promise<voi
400
400
  conversationType: msg.conversation_type || "direct",
401
401
  enableStreaming: useStream,
402
402
  msgId: msg.msg_id,
403
+ msgType: msg.msg_type,
403
404
  });
404
405
 
405
406
  // STEP 6d: 分发消息给 AI
@@ -41,6 +41,7 @@ export interface CreatePalzReplyDispatcherParams {
41
41
  conversationType: string;
42
42
  enableStreaming: boolean;
43
43
  msgId: string;
44
+ msgType?: string;
44
45
  }
45
46
 
46
47
  export function createPalzReplyDispatcher(params: CreatePalzReplyDispatcherParams) {
@@ -55,6 +56,7 @@ export function createPalzReplyDispatcher(params: CreatePalzReplyDispatcherParam
55
56
  conversationType,
56
57
  enableStreaming,
57
58
  msgId,
59
+ msgType,
58
60
  } = params;
59
61
 
60
62
  const log = typeof runtime?.log === "function" ? runtime.log : console.log;
@@ -84,6 +86,7 @@ export function createPalzReplyDispatcher(params: CreatePalzReplyDispatcherParam
84
86
  msgId,
85
87
  senderId,
86
88
  stream: streamOpts,
89
+ msgType,
87
90
  });
88
91
  log(`${tag}: [DISPATCHER←sendToIM] 输出: ${JSON.stringify(result)}`);
89
92
  return result;
package/src/send.ts CHANGED
@@ -14,7 +14,7 @@ function nextMsgId(): string {
14
14
  }
15
15
 
16
16
  export async function sendToPalzIM(params: SendToIMParams): Promise<any> {
17
- const { config, conversationId, content, conversationType, msgId, senderId, stream } = params;
17
+ const { config, conversationId, content, conversationType, msgId, senderId, stream, msgType } = params;
18
18
  const url = `${config.apiBaseUrl}/bot/send`;
19
19
  const resolvedMsgId = msgId || nextMsgId();
20
20
 
@@ -30,6 +30,10 @@ export async function sendToPalzIM(params: SendToIMParams): Promise<any> {
30
30
  reqBody.sender_id = senderId;
31
31
  }
32
32
 
33
+ if (msgType) {
34
+ reqBody.msg_type = msgType;
35
+ }
36
+
33
37
  if (stream) {
34
38
  reqBody.stream_id = stream.streamId;
35
39
  reqBody.seq = stream.seq;
package/src/types.ts CHANGED
@@ -29,6 +29,8 @@ export interface PalzMessageEvent {
29
29
  agent_id?: string;
30
30
  /** 群聊中是否 @了机器人 */
31
31
  mentioned_bot?: boolean;
32
+ /** 可选,IM 下发的消息类型,回复时原样透传 */
33
+ msg_type?: string;
32
34
  }
33
35
 
34
36
  // ============ 配置 ============
@@ -74,4 +76,6 @@ export interface SendToIMParams {
74
76
  msgId?: string;
75
77
  senderId?: string;
76
78
  stream?: StreamChunkOpts;
79
+ /** IM 下发的消息类型,回复时原样透传 */
80
+ msgType?: string;
77
81
  }