@elizaos/plugin-feishu 2.0.0-beta.1 → 2.0.3-beta.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.
- package/LICENSE +21 -0
- package/README.md +65 -113
- package/package.json +21 -4
- package/dist/accounts.d.ts +0 -148
- package/dist/accounts.d.ts.map +0 -1
- package/dist/actions/index.d.ts +0 -2
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/config.d.ts +0 -87
- package/dist/config.d.ts.map +0 -1
- package/dist/connector-account-provider.d.ts +0 -16
- package/dist/connector-account-provider.d.ts.map +0 -1
- package/dist/constants.d.ts +0 -20
- package/dist/constants.d.ts.map +0 -1
- package/dist/environment.d.ts +0 -38
- package/dist/environment.d.ts.map +0 -1
- package/dist/formatting.d.ts +0 -104
- package/dist/formatting.d.ts.map +0 -1
- package/dist/index.d.ts +0 -14
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1593
- package/dist/index.js.map +0 -19
- package/dist/messageManager.d.ts +0 -52
- package/dist/messageManager.d.ts.map +0 -1
- package/dist/providers/index.d.ts +0 -4
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/service.d.ts +0 -59
- package/dist/service.d.ts.map +0 -1
- package/dist/types.d.ts +0 -288
- package/dist/types.d.ts.map +0 -1
- package/dist/workflow-credential-provider.d.ts +0 -21
- package/dist/workflow-credential-provider.d.ts.map +0 -1
package/dist/formatting.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Feishu text chunk limit
|
|
3
|
-
*/
|
|
4
|
-
export declare const FEISHU_TEXT_CHUNK_LIMIT = 4000;
|
|
5
|
-
/**
|
|
6
|
-
* Feishu Post (rich text) element types
|
|
7
|
-
*/
|
|
8
|
-
export type FeishuPostElement = {
|
|
9
|
-
tag: "text";
|
|
10
|
-
text: string;
|
|
11
|
-
style?: string[];
|
|
12
|
-
} | {
|
|
13
|
-
tag: "a";
|
|
14
|
-
text: string;
|
|
15
|
-
href: string;
|
|
16
|
-
style?: string[];
|
|
17
|
-
} | {
|
|
18
|
-
tag: "at";
|
|
19
|
-
user_id: string;
|
|
20
|
-
} | {
|
|
21
|
-
tag: "img";
|
|
22
|
-
image_key: string;
|
|
23
|
-
} | {
|
|
24
|
-
tag: "media";
|
|
25
|
-
file_key: string;
|
|
26
|
-
} | {
|
|
27
|
-
tag: "emotion";
|
|
28
|
-
emoji_type: string;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* A line of Feishu Post content
|
|
32
|
-
*/
|
|
33
|
-
export type FeishuPostLine = FeishuPostElement[];
|
|
34
|
-
/**
|
|
35
|
-
* Feishu Post content structure
|
|
36
|
-
*/
|
|
37
|
-
export interface FeishuPostContent {
|
|
38
|
-
zh_cn?: {
|
|
39
|
-
title?: string;
|
|
40
|
-
content: FeishuPostLine[];
|
|
41
|
-
};
|
|
42
|
-
en_us?: {
|
|
43
|
-
title?: string;
|
|
44
|
-
content: FeishuPostLine[];
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Result of formatting markdown for Feishu
|
|
49
|
-
*/
|
|
50
|
-
export interface FeishuFormattedChunk {
|
|
51
|
-
post: FeishuPostContent;
|
|
52
|
-
text: string;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Options for text chunking
|
|
56
|
-
*/
|
|
57
|
-
export interface ChunkFeishuTextOpts {
|
|
58
|
-
limit?: number;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Convert markdown to Feishu Post format
|
|
62
|
-
*/
|
|
63
|
-
export declare function markdownToFeishuPost(markdown: string): FeishuPostContent;
|
|
64
|
-
/**
|
|
65
|
-
* Chunk text for Feishu messages
|
|
66
|
-
*/
|
|
67
|
-
export declare function chunkFeishuText(text: string, opts?: ChunkFeishuTextOpts): string[];
|
|
68
|
-
/**
|
|
69
|
-
* Convert markdown to Feishu Post chunks
|
|
70
|
-
*/
|
|
71
|
-
export declare function markdownToFeishuChunks(markdown: string, limit?: number): FeishuFormattedChunk[];
|
|
72
|
-
/**
|
|
73
|
-
* Check if text contains markdown formatting
|
|
74
|
-
*/
|
|
75
|
-
export declare function containsMarkdown(text: string): boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Strip markdown formatting from text
|
|
78
|
-
*/
|
|
79
|
-
export declare function stripMarkdown(text: string): string;
|
|
80
|
-
/**
|
|
81
|
-
* Format Feishu user mention
|
|
82
|
-
*/
|
|
83
|
-
export declare function formatFeishuUserMention(userId: string): string;
|
|
84
|
-
/**
|
|
85
|
-
* Format Feishu user mention for all users
|
|
86
|
-
*/
|
|
87
|
-
export declare function formatFeishuAtAll(): string;
|
|
88
|
-
/**
|
|
89
|
-
* Truncate text to a maximum length
|
|
90
|
-
*/
|
|
91
|
-
export declare function truncateText(text: string, maxLength: number): string;
|
|
92
|
-
/**
|
|
93
|
-
* Resolve system location for logging
|
|
94
|
-
*/
|
|
95
|
-
export declare function resolveFeishuSystemLocation(params: {
|
|
96
|
-
chatType: "p2p" | "group";
|
|
97
|
-
chatId: string;
|
|
98
|
-
chatName?: string;
|
|
99
|
-
}): string;
|
|
100
|
-
/**
|
|
101
|
-
* Check if chat is a group chat
|
|
102
|
-
*/
|
|
103
|
-
export declare function isGroupChat(chatType: string): boolean;
|
|
104
|
-
//# sourceMappingURL=formatting.d.ts.map
|
package/dist/formatting.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAC1B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAC/C;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,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BAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAgBtD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkClD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAQpE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IACnD,QAAQ,EAAE,KAAK,GAAG,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAIT;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "@elizaos/core";
|
|
2
|
-
import { FEISHU_SERVICE_NAME } from "./constants";
|
|
3
|
-
import { MessageManager } from "./messageManager";
|
|
4
|
-
import { FeishuService } from "./service";
|
|
5
|
-
declare const feishuPlugin: Plugin;
|
|
6
|
-
export { DEFAULT_ACCOUNT_ID, type FeishuAccountConfig, type FeishuGroupConfig, type FeishuMultiAccountConfig, type FeishuTokenSource, isFeishuMentionRequired, isFeishuUserAllowed, isMultiAccountEnabled, listEnabledFeishuAccounts, listFeishuAccountIds, normalizeAccountId, type ResolvedFeishuAccount, resolveDefaultFeishuAccountId, resolveFeishuAccount, resolveFeishuGroupConfig, } from "./accounts";
|
|
7
|
-
export * from "./constants";
|
|
8
|
-
export * from "./environment";
|
|
9
|
-
export { type ChunkFeishuTextOpts, chunkFeishuText, containsMarkdown, FEISHU_TEXT_CHUNK_LIMIT, type FeishuFormattedChunk, type FeishuPostContent, type FeishuPostElement, type FeishuPostLine, formatFeishuAtAll, formatFeishuUserMention, isGroupChat, markdownToFeishuChunks, markdownToFeishuPost, resolveFeishuSystemLocation, stripMarkdown, truncateText, } from "./formatting";
|
|
10
|
-
export * from "./types";
|
|
11
|
-
export { FEISHU_SERVICE_NAME, FeishuService, MessageManager };
|
|
12
|
-
export default feishuPlugin;
|
|
13
|
-
export type { FeishuActionConfig, FeishuConfig, FeishuReactionNotificationMode, } from "./config";
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAG3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,QAAA,MAAM,YAAY,EAAE,MA8BnB,CAAC;AAGF,OAAO,EACN,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,6BAA6B,EAC7B,oBAAoB,EACpB,wBAAwB,GACxB,MAAM,YAAY,CAAC;AACpB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAE9B,OAAO,EACN,KAAK,mBAAmB,EACxB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,aAAa,EACb,YAAY,GACZ,MAAM,cAAc,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AAE9D,eAAe,YAAY,CAAC;AAG5B,YAAY,EACX,kBAAkB,EAClB,YAAY,EACZ,8BAA8B,GAC9B,MAAM,UAAU,CAAC"}
|