File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ import { resolveFeishuReasoningPreviewEnabled } from "./reasoning-preview.js";
5454import { createFeishuReplyDispatcher } from "./reply-dispatcher.js" ;
5555import { getFeishuRuntime } from "./runtime.js" ;
5656import { getMessageFeishu , listFeishuThreadMessages , sendMessageFeishu } from "./send.js" ;
57+ export type { FeishuBotAddedEvent , FeishuMessageEvent } from "./event-types.js" ;
58+ import type { FeishuMessageEvent } from "./event-types.js" ;
5759import type { FeishuMessageContext , FeishuMessageInfo } from "./types.js" ;
5860import type { DynamicAgentCreationConfig } from "./types.js" ;
5961
@@ -63,49 +65,6 @@ export { toMessageResourceType } from "./bot-content.js";
6365// Key: appId or "default", Value: timestamp of last notification
6466const permissionErrorNotifiedAt = new Map < string , number > ( ) ;
6567const PERMISSION_ERROR_COOLDOWN_MS = 5 * 60 * 1000 ; // 5 minutes
66- export type FeishuMessageEvent = {
67- sender : {
68- sender_id : {
69- open_id ?: string ;
70- user_id ?: string ;
71- union_id ?: string ;
72- } ;
73- sender_type ?: string ;
74- tenant_key ?: string ;
75- } ;
76- message : {
77- message_id : string ;
78- root_id ?: string ;
79- parent_id ?: string ;
80- thread_id ?: string ;
81- chat_id : string ;
82- chat_type : "p2p" | "group" | "private" ;
83- message_type : string ;
84- content : string ;
85- create_time ?: string ;
86- mentions ?: Array < {
87- key : string ;
88- id : {
89- open_id ?: string ;
90- user_id ?: string ;
91- union_id ?: string ;
92- } ;
93- name : string ;
94- tenant_key ?: string ;
95- } > ;
96- } ;
97- } ;
98-
99- export type FeishuBotAddedEvent = {
100- chat_id : string ;
101- operator_id : {
102- open_id ?: string ;
103- user_id ?: string ;
104- union_id ?: string ;
105- } ;
106- external : boolean ;
107- operator_tenant_key ?: string ;
108- } ;
10968
11069// --- Broadcast support ---
11170// Resolve broadcast agent list for a given peer (group) ID.
Original file line number Diff line number Diff line change 1+ export type FeishuMessageEvent = {
2+ sender : {
3+ sender_id : {
4+ open_id ?: string ;
5+ user_id ?: string ;
6+ union_id ?: string ;
7+ } ;
8+ sender_type ?: string ;
9+ tenant_key ?: string ;
10+ } ;
11+ message : {
12+ message_id : string ;
13+ root_id ?: string ;
14+ parent_id ?: string ;
15+ thread_id ?: string ;
16+ chat_id : string ;
17+ chat_type : "p2p" | "group" | "private" ;
18+ message_type : string ;
19+ content : string ;
20+ create_time ?: string ;
21+ mentions ?: Array < {
22+ key : string ;
23+ id : {
24+ open_id ?: string ;
25+ user_id ?: string ;
26+ union_id ?: string ;
27+ } ;
28+ name : string ;
29+ tenant_key ?: string ;
30+ } > ;
31+ } ;
32+ } ;
33+
34+ export type FeishuBotAddedEvent = {
35+ chat_id : string ;
36+ operator_id : {
37+ open_id ?: string ;
38+ user_id ?: string ;
39+ union_id ?: string ;
40+ } ;
41+ external : boolean ;
42+ operator_tenant_key ?: string ;
43+ } ;
Original file line number Diff line number Diff line change 1+ export type MentionTarget = {
2+ openId : string ;
3+ name : string ;
4+ key : string ; // Placeholder in original message, e.g. @_user_1
5+ } ;
Original file line number Diff line number Diff line change 1- import type { FeishuMessageEvent } from "./bot.js" ;
1+ import type { FeishuMessageEvent } from "./event-types.js" ;
2+ export type { MentionTarget } from "./mention-target.types.js" ;
3+ import type { MentionTarget } from "./mention-target.types.js" ;
24
35/**
46 * Escape regex metacharacters so user-controlled mention fields are treated literally.
@@ -7,15 +9,6 @@ export function escapeRegExp(input: string): string {
79 return input . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ;
810}
911
10- /**
11- * Mention target user info
12- */
13- export type MentionTarget = {
14- openId : string ;
15- name : string ;
16- key : string ; // Placeholder in original message, e.g. @_user_1
17- } ;
18-
1912/**
2013 * Extract mention targets from message event (excluding the bot itself)
2114 */
Original file line number Diff line number Diff line change 88import { resolveFeishuRuntimeAccount } from "./accounts.js" ;
99import { createFeishuClient } from "./client.js" ;
1010import { sendMediaFeishu } from "./media.js" ;
11- import type { MentionTarget } from "./mention.js" ;
11+ import type { MentionTarget } from "./mention-target.types .js" ;
1212import { buildMentionedCardContent } from "./mention.js" ;
1313import {
1414 createReplyPrefixContext ,
Original file line number Diff line number Diff line change 77import type { ClawdbotConfig } from "../runtime-api.js" ;
88import { resolveFeishuRuntimeAccount } from "./accounts.js" ;
99import { createFeishuClient } from "./client.js" ;
10- import type { MentionTarget } from "./mention.js" ;
10+ import type { MentionTarget } from "./mention-target.types .js" ;
1111import { buildMentionedCardContent , buildMentionedMessage } from "./mention.js" ;
1212import { parsePostContent } from "./post.js" ;
1313import { assertFeishuMessageApiSuccess , toFeishuSendResult } from "./send-result.js" ;
Original file line number Diff line number Diff line change 1- import type { BaseProbeResult } from "../runtime-api.js " ;
1+ import type { BaseProbeResult } from "openclaw/plugin-sdk/core " ;
22import type {
33 FeishuConfigSchema ,
44 FeishuGroupSchema ,
55 FeishuAccountConfigSchema ,
66 z ,
77} from "./config-schema.js" ;
8- import type { MentionTarget } from "./mention.js" ;
8+ import type { MentionTarget } from "./mention-target.types .js" ;
99
1010export type FeishuConfig = z . infer < typeof FeishuConfigSchema > ;
1111export type FeishuGroupConfig = z . infer < typeof FeishuGroupSchema > ;
You can’t perform that action at this time.
0 commit comments