@ozaiya/openclaw-channel 0.10.6 → 0.10.8
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/index.d.ts +74 -0
- package/dist/src/channel.js +450 -82
- package/dist/src/channel.js.map +1 -1
- package/dist/src/configSchema.d.ts +74 -0
- package/dist/src/configSchema.js +74 -0
- package/dist/src/configSchema.js.map +1 -1
- package/dist/src/doubao.d.ts +29 -0
- package/dist/src/doubao.js +76 -0
- package/dist/src/doubao.js.map +1 -0
- package/dist/src/index.d.ts +5 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/socialMedia.d.ts +35 -0
- package/dist/src/socialMedia.js +242 -0
- package/dist/src/socialMedia.js.map +1 -0
- package/dist/src/types.d.ts +50 -0
- package/dist/src/xueqiu.d.ts +43 -0
- package/dist/src/xueqiu.js +500 -0
- package/dist/src/xueqiu.js.map +1 -0
- package/dist/src/yuanbao.d.ts +21 -0
- package/dist/src/yuanbao.js +154 -0
- package/dist/src/yuanbao.js.map +1 -0
- package/package.json +1 -1
package/dist/src/configSchema.js
CHANGED
|
@@ -87,6 +87,80 @@ export const ozaiyaPluginConfigSchema = {
|
|
|
87
87
|
stt: {
|
|
88
88
|
$ref: "#/$defs/stt",
|
|
89
89
|
},
|
|
90
|
+
yuanbao: {
|
|
91
|
+
type: "object",
|
|
92
|
+
additionalProperties: false,
|
|
93
|
+
properties: {
|
|
94
|
+
cookieFile: {
|
|
95
|
+
type: "string",
|
|
96
|
+
},
|
|
97
|
+
cookies: {
|
|
98
|
+
type: "string",
|
|
99
|
+
},
|
|
100
|
+
agentId: {
|
|
101
|
+
type: "string",
|
|
102
|
+
},
|
|
103
|
+
chatModelId: {
|
|
104
|
+
type: "string",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
doubao: {
|
|
109
|
+
type: "object",
|
|
110
|
+
additionalProperties: false,
|
|
111
|
+
properties: {
|
|
112
|
+
apiBaseUrl: {
|
|
113
|
+
type: "string",
|
|
114
|
+
},
|
|
115
|
+
apiKey: {
|
|
116
|
+
type: "string",
|
|
117
|
+
},
|
|
118
|
+
model: {
|
|
119
|
+
type: "string",
|
|
120
|
+
},
|
|
121
|
+
timeoutMs: {
|
|
122
|
+
type: "integer",
|
|
123
|
+
minimum: 10000,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
xueqiu: {
|
|
128
|
+
type: "object",
|
|
129
|
+
additionalProperties: false,
|
|
130
|
+
properties: {
|
|
131
|
+
cookies: {
|
|
132
|
+
type: "string",
|
|
133
|
+
},
|
|
134
|
+
cookieFile: {
|
|
135
|
+
type: "string",
|
|
136
|
+
},
|
|
137
|
+
maxComments: {
|
|
138
|
+
type: "integer",
|
|
139
|
+
minimum: 1,
|
|
140
|
+
},
|
|
141
|
+
timeoutMs: {
|
|
142
|
+
type: "integer",
|
|
143
|
+
minimum: 5000,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
socialMedia: {
|
|
148
|
+
type: "object",
|
|
149
|
+
additionalProperties: false,
|
|
150
|
+
properties: {
|
|
151
|
+
apiBaseUrl: {
|
|
152
|
+
type: "string",
|
|
153
|
+
},
|
|
154
|
+
maxComments: {
|
|
155
|
+
type: "integer",
|
|
156
|
+
minimum: 0,
|
|
157
|
+
},
|
|
158
|
+
timeoutMs: {
|
|
159
|
+
type: "integer",
|
|
160
|
+
minimum: 5000,
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
90
164
|
},
|
|
91
165
|
$defs: {
|
|
92
166
|
stt: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/configSchema.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU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AE,QAAQ;qBACf;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;qBACf;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;qBACf;iBACF;aACF;SACF;QACD,GAAG,EAAE;YACH,IAAI,EAAE,aAAa;SACpB;KACF;IACD,KAAK,EAAE;QACL,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE,KAAK;YAC3B,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;iBAC9B;gBACD,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,CAAC;iBACX;gBACD,kBAAkB,EAAE;oBAClB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,CAAC;iBACX;aACF;SACF;KACF;CACO,CAAC"}
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/configSchema.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;SAChB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;SACf;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE;gBACpB,IAAI,EAAE,QAAQ;aACf;SACF;QACD,SAAS,EAAE;YAC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AAS,EAAE;oBACT,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,CAAC;iBACX;gBACD,kBAAkB,EAAE;oBAClB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,CAAC;iBACX;aACF;SACF;KACF;CACO,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Doubao (豆包) integration for summarizing Toutiao/Douyin content.
|
|
3
|
+
*
|
|
4
|
+
* Calls a doubao-2api compatible endpoint (OpenAI-compatible API) that proxies
|
|
5
|
+
* Doubao's chat API with real browser signatures via Playwright.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/lza6/doubao-2api
|
|
8
|
+
*/
|
|
9
|
+
export interface DoubaoConfig {
|
|
10
|
+
/** API base URL, e.g. "http://localhost:8088" */
|
|
11
|
+
apiBaseUrl: string;
|
|
12
|
+
/** API key (maps to API_MASTER_KEY in doubao-2api) */
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
/** Model name (default: "doubao-1.5-pro") */
|
|
15
|
+
model?: string;
|
|
16
|
+
/** Timeout in ms (default: 120000) */
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
}
|
|
19
|
+
interface DoubaoLog {
|
|
20
|
+
info?: (...args: unknown[]) => void;
|
|
21
|
+
warn?: (...args: unknown[]) => void;
|
|
22
|
+
error?: (...args: unknown[]) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Summarize a Toutiao/Douyin URL using Doubao via doubao-2api.
|
|
26
|
+
* Returns the summary text, or null if the operation fails.
|
|
27
|
+
*/
|
|
28
|
+
export declare function summarizeWithDoubao(url: string, config: DoubaoConfig, log?: DoubaoLog): Promise<string | null>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Doubao (豆包) integration for summarizing Toutiao/Douyin content.
|
|
3
|
+
*
|
|
4
|
+
* Calls a doubao-2api compatible endpoint (OpenAI-compatible API) that proxies
|
|
5
|
+
* Doubao's chat API with real browser signatures via Playwright.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/lza6/doubao-2api
|
|
8
|
+
*/
|
|
9
|
+
const DEFAULT_TIMEOUT_MS = 120_000;
|
|
10
|
+
const DEFAULT_MODEL = "doubao-1.5-pro";
|
|
11
|
+
/**
|
|
12
|
+
* Summarize a Toutiao/Douyin URL using Doubao via doubao-2api.
|
|
13
|
+
* Returns the summary text, or null if the operation fails.
|
|
14
|
+
*/
|
|
15
|
+
export async function summarizeWithDoubao(url, config, log) {
|
|
16
|
+
const apiBaseUrl = config.apiBaseUrl;
|
|
17
|
+
if (!apiBaseUrl) {
|
|
18
|
+
log?.warn?.("doubao: no apiBaseUrl configured, skipping");
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const model = config.model ?? DEFAULT_MODEL;
|
|
22
|
+
const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
23
|
+
const endpoint = `${apiBaseUrl.replace(/\/+$/, "")}/v1/chat/completions`;
|
|
24
|
+
const prompt = `请总结这个链接的内容:${url}`;
|
|
25
|
+
log?.info?.(`doubao: summarizing ${url} via ${endpoint} (model=${model})`);
|
|
26
|
+
const controller = new AbortController();
|
|
27
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
28
|
+
try {
|
|
29
|
+
const headers = {
|
|
30
|
+
"Content-Type": "application/json",
|
|
31
|
+
};
|
|
32
|
+
if (config.apiKey) {
|
|
33
|
+
headers["Authorization"] = `Bearer ${config.apiKey}`;
|
|
34
|
+
}
|
|
35
|
+
const resp = await fetch(endpoint, {
|
|
36
|
+
method: "POST",
|
|
37
|
+
headers,
|
|
38
|
+
body: JSON.stringify({
|
|
39
|
+
model,
|
|
40
|
+
messages: [{ role: "user", content: prompt }],
|
|
41
|
+
stream: false,
|
|
42
|
+
}),
|
|
43
|
+
signal: controller.signal,
|
|
44
|
+
});
|
|
45
|
+
if (!resp.ok) {
|
|
46
|
+
const body = await resp.text().catch(() => "");
|
|
47
|
+
log?.warn?.(`doubao: API error ${resp.status}: ${body.slice(0, 500)}`);
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const data = (await resp.json());
|
|
51
|
+
if (data.error) {
|
|
52
|
+
log?.warn?.(`doubao: API returned error: ${data.error.message}`);
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const content = data.choices?.[0]?.message?.content;
|
|
56
|
+
if (!content || content.length === 0) {
|
|
57
|
+
log?.warn?.("doubao: empty response from API");
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
log?.info?.(`doubao: got summary (${content.length} chars)`);
|
|
61
|
+
return content;
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
if (err.name === "AbortError") {
|
|
65
|
+
log?.warn?.(`doubao: request timed out after ${timeoutMs}ms`);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
log?.warn?.(`doubao: error: ${err}`);
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
clearTimeout(timer);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=doubao.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doubao.js","sourceRoot":"","sources":["../../src/doubao.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmBH,MAAM,kBAAkB,GAAG,OAAO,CAAC;AACnC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,GAAW,EACX,MAAoB,EACpB,GAAe;IAEf,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACrC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,GAAG,EAAE,IAAI,EAAE,CAAC,4CAA4C,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MA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roups, createGroup, addMember, getUserPublicKeys, searchUsers, createDirectChat, probeApi, toggleReaction, editMessage, deleteMessage, pinMessage, unpinMessage, uploadFile, } from "./api.js";
|
|
9
9
|
export { botCreateGroup, botCreateDirect } from "./botActions.js";
|
|
10
10
|
export type { BotConfig, BotCreateGroupResult, BotCreateDirectResult } from "./botActions.js";
|
|
11
|
-
export type { OzaiyaAccountConfig, OzaiyaChannelConfig, OzaiyaSttConfig, ResolvedOzaiyaSttConfig, ResolvedOzaiyaAccount, OzaiyaWebhookPayload, OzaiyaWebhookMessage, OzaiyaMessageContent, OzaiyaChatFileUploadResponse, OzaiyaSendMessageResult, } from "./types.js";
|
|
11
|
+
export type { OzaiyaAccountConfig, OzaiyaChannelConfig, OzaiyaSttConfig, ResolvedOzaiyaSttConfig, ResolvedOzaiyaAccount, OzaiyaWebhookPayload, OzaiyaWebhookMessage, OzaiyaMessageContent, OzaiyaChatFileUploadResponse, OzaiyaSendMessageResult, YuanbaoConfig, DoubaoConfig, XueqiuConfig, SocialMediaConfig, } from "./types.js";
|
|
12
|
+
export { summarizeWithYuanbao } from "./yuanbao.js";
|
|
13
|
+
export { summarizeWithDoubao } from "./doubao.js";
|
|
14
|
+
export { fetchXueqiuPost, searchXueqiuPosts } from "./xueqiu.js";
|
|
15
|
+
export { fetchSocialMediaPost, extractSocialMediaContent } from "./socialMedia.js";
|
package/dist/src/index.js
CHANGED
|
@@ -7,4 +7,8 @@
|
|
|
7
7
|
export { unwrapGroupKey, generateGroupKey, wrapGroupKey, decryptMessage, encryptMessage } from "./crypto.js";
|
|
8
8
|
export { sendMessage, fetchGroups, createGroup, addMember, getUserPublicKeys, searchUsers, createDirectChat, probeApi, toggleReaction, editMessage, deleteMessage, pinMessage, unpinMessage, uploadFile, } from "./api.js";
|
|
9
9
|
export { botCreateGroup, botCreateDirect } from "./botActions.js";
|
|
10
|
+
export { summarizeWithYuanbao } from "./yuanbao.js";
|
|
11
|
+
export { summarizeWithDoubao } from "./doubao.js";
|
|
12
|
+
export { fetchXueqiuPost, searchXueqiuPosts } from "./xueqiu.js";
|
|
13
|
+
export { fetchSocialMediaPost, extractSocialMediaContent } from "./socialMedia.js";
|
|
10
14
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7G,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7G,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAkBlE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified social media content fetcher.
|
|
3
|
+
*
|
|
4
|
+
* Calls the media-fetch-api service (Python + Playwright) which handles
|
|
5
|
+
* platform-specific scraping (XHS, Douyin, Bilibili, etc.).
|
|
6
|
+
*/
|
|
7
|
+
export interface SocialMediaConfig {
|
|
8
|
+
/** Base URL of the media-fetch-api service, e.g. "http://localhost:8089" */
|
|
9
|
+
apiBaseUrl: string;
|
|
10
|
+
/** Maximum number of comments to include (default: 10) */
|
|
11
|
+
maxComments?: number;
|
|
12
|
+
/** Request timeout in ms (default: 30000) */
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
}
|
|
15
|
+
interface SocialMediaLog {
|
|
16
|
+
info?: (...args: unknown[]) => void;
|
|
17
|
+
warn?: (...args: unknown[]) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch a social media post from the given URL via media-fetch-api.
|
|
21
|
+
* Returns formatted text suitable for chat display, or null on failure.
|
|
22
|
+
*/
|
|
23
|
+
export declare function fetchSocialMediaPost(url: string, config: SocialMediaConfig, log?: SocialMediaLog): Promise<string | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Search a social media platform via media-fetch-api /search endpoint.
|
|
26
|
+
* Returns formatted text suitable for chat display, or null on failure.
|
|
27
|
+
*/
|
|
28
|
+
export declare function searchSocialMedia(query: string, platform: string, config: SocialMediaConfig, log?: SocialMediaLog, count?: number): Promise<string | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Extract/summarize content from a URL via media-fetch-api /extract endpoint.
|
|
31
|
+
* Routes to the appropriate LLM backend (doubao for most, yuanbao for WeChat).
|
|
32
|
+
* Returns the summary text, or null on failure.
|
|
33
|
+
*/
|
|
34
|
+
export declare function extractSocialMediaContent(url: string, config: SocialMediaConfig, log?: SocialMediaLog): Promise<string | null>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified social media content fetcher.
|
|
3
|
+
*
|
|
4
|
+
* Calls the media-fetch-api service (Python + Playwright) which handles
|
|
5
|
+
* platform-specific scraping (XHS, Douyin, Bilibili, etc.).
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_MAX_COMMENTS = 10;
|
|
8
|
+
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
9
|
+
const EXTRACT_TIMEOUT_MS = 120_000;
|
|
10
|
+
const PLATFORM_LABELS = {
|
|
11
|
+
xhs: "小红书",
|
|
12
|
+
douyin: "抖音",
|
|
13
|
+
bilibili: "B站",
|
|
14
|
+
weibo: "微博",
|
|
15
|
+
xueqiu: "雪球",
|
|
16
|
+
toutiao: "今日头条",
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Fetch a social media post from the given URL via media-fetch-api.
|
|
20
|
+
* Returns formatted text suitable for chat display, or null on failure.
|
|
21
|
+
*/
|
|
22
|
+
export async function fetchSocialMediaPost(url, config, log) {
|
|
23
|
+
const apiBaseUrl = config.apiBaseUrl;
|
|
24
|
+
if (!apiBaseUrl) {
|
|
25
|
+
log?.warn?.("socialMedia: no apiBaseUrl configured, skipping");
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const maxComments = config.maxComments ?? DEFAULT_MAX_COMMENTS;
|
|
29
|
+
const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
30
|
+
const endpoint = `${apiBaseUrl.replace(/\/+$/, "")}/fetch?url=${encodeURIComponent(url)}&max_comments=${maxComments}`;
|
|
31
|
+
log?.info?.(`socialMedia: fetching ${url} via ${apiBaseUrl}`);
|
|
32
|
+
const controller = new AbortController();
|
|
33
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
34
|
+
try {
|
|
35
|
+
const resp = await fetch(endpoint, { signal: controller.signal });
|
|
36
|
+
if (!resp.ok) {
|
|
37
|
+
const body = await resp.text().catch(() => "");
|
|
38
|
+
log?.warn?.(`socialMedia: API error ${resp.status}: ${body.slice(0, 500)}`);
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const data = (await resp.json());
|
|
42
|
+
const formatted = formatPost(data);
|
|
43
|
+
log?.info?.(`socialMedia: got content (${formatted.length} chars)`);
|
|
44
|
+
return formatted;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
if (err.name === "AbortError") {
|
|
48
|
+
log?.warn?.(`socialMedia: request timed out after ${timeoutMs}ms`);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
log?.warn?.(`socialMedia: error: ${err}`);
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
clearTimeout(timer);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Search a social media platform via media-fetch-api /search endpoint.
|
|
61
|
+
* Returns formatted text suitable for chat display, or null on failure.
|
|
62
|
+
*/
|
|
63
|
+
export async function searchSocialMedia(query, platform, config, log, count = 5) {
|
|
64
|
+
const apiBaseUrl = config.apiBaseUrl;
|
|
65
|
+
if (!apiBaseUrl) {
|
|
66
|
+
log?.warn?.("socialMedia: no apiBaseUrl configured, skipping search");
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
70
|
+
const endpoint = `${apiBaseUrl.replace(/\/+$/, "")}/search?platform=${encodeURIComponent(platform)}&q=${encodeURIComponent(query)}&count=${count}`;
|
|
71
|
+
log?.info?.(`socialMedia: searching ${platform} for "${query}" via ${apiBaseUrl}`);
|
|
72
|
+
const controller = new AbortController();
|
|
73
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
74
|
+
try {
|
|
75
|
+
const resp = await fetch(endpoint, { signal: controller.signal });
|
|
76
|
+
if (!resp.ok) {
|
|
77
|
+
const body = await resp.text().catch(() => "");
|
|
78
|
+
log?.warn?.(`socialMedia: search API error ${resp.status}: ${body.slice(0, 500)}`);
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const data = (await resp.json());
|
|
82
|
+
if (!data.results || data.results.length === 0) {
|
|
83
|
+
return `${PLATFORM_LABELS[platform] || platform}搜索"${query}" — 没有找到相关帖子。`;
|
|
84
|
+
}
|
|
85
|
+
return formatSearchResults(data, query);
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
if (err.name === "AbortError") {
|
|
89
|
+
log?.warn?.(`socialMedia: search timed out after ${timeoutMs}ms`);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
log?.warn?.(`socialMedia: search error: ${err}`);
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
clearTimeout(timer);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Extract/summarize content from a URL via media-fetch-api /extract endpoint.
|
|
102
|
+
* Routes to the appropriate LLM backend (doubao for most, yuanbao for WeChat).
|
|
103
|
+
* Returns the summary text, or null on failure.
|
|
104
|
+
*/
|
|
105
|
+
export async function extractSocialMediaContent(url, config, log) {
|
|
106
|
+
const apiBaseUrl = config.apiBaseUrl;
|
|
107
|
+
if (!apiBaseUrl) {
|
|
108
|
+
log?.warn?.("socialMedia: no apiBaseUrl configured, skipping extract");
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
const timeoutMs = config.timeoutMs ?? EXTRACT_TIMEOUT_MS;
|
|
112
|
+
const endpoint = `${apiBaseUrl.replace(/\/+$/, "")}/extract?url=${encodeURIComponent(url)}`;
|
|
113
|
+
log?.info?.(`socialMedia: extracting ${url} via ${apiBaseUrl}`);
|
|
114
|
+
const controller = new AbortController();
|
|
115
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
116
|
+
try {
|
|
117
|
+
const resp = await fetch(endpoint, { signal: controller.signal });
|
|
118
|
+
if (!resp.ok) {
|
|
119
|
+
const body = await resp.text().catch(() => "");
|
|
120
|
+
log?.warn?.(`socialMedia: extract API error ${resp.status}: ${body.slice(0, 500)}`);
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const data = (await resp.json());
|
|
124
|
+
if (!data.summary) {
|
|
125
|
+
log?.warn?.("socialMedia: extract returned empty summary");
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
log?.info?.(`socialMedia: got extract summary (${data.summary.length} chars, backend=${data.backend})`);
|
|
129
|
+
return data.summary;
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
if (err.name === "AbortError") {
|
|
133
|
+
log?.warn?.(`socialMedia: extract timed out after ${timeoutMs}ms`);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
log?.warn?.(`socialMedia: extract error: ${err}`);
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
clearTimeout(timer);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function formatSearchResults(data, query) {
|
|
145
|
+
const label = PLATFORM_LABELS[data.platform] || data.platform;
|
|
146
|
+
const parts = [];
|
|
147
|
+
parts.push(`${label}搜索"${query}" — 共找到 ${data.results.length} 条结果:\n`);
|
|
148
|
+
for (let i = 0; i < data.results.length; i++) {
|
|
149
|
+
const item = data.results[i];
|
|
150
|
+
const author = item.author || "未知";
|
|
151
|
+
const likes = item.stats?.likes ?? 0;
|
|
152
|
+
const comments = item.stats?.comments ?? 0;
|
|
153
|
+
const reposts = item.stats?.reposts ?? 0;
|
|
154
|
+
const date = item.created_at ? new Date(item.created_at).toLocaleDateString("zh-CN") : "";
|
|
155
|
+
const title = item.title || "(无标题)";
|
|
156
|
+
parts.push(`${i + 1}. ${title}`);
|
|
157
|
+
parts.push(` 作者: @${author} | ${date} | 转发 ${reposts} 评论 ${comments} 点赞 ${likes}`);
|
|
158
|
+
if (item.description)
|
|
159
|
+
parts.push(` 摘要: ${item.description}`);
|
|
160
|
+
if (item.url)
|
|
161
|
+
parts.push(` 链接: ${item.url}`);
|
|
162
|
+
parts.push("");
|
|
163
|
+
}
|
|
164
|
+
return parts.join("\n");
|
|
165
|
+
}
|
|
166
|
+
function formatPost(post) {
|
|
167
|
+
const parts = [];
|
|
168
|
+
const label = PLATFORM_LABELS[post.platform] || post.platform;
|
|
169
|
+
// Title line
|
|
170
|
+
parts.push(`[${label}] ${post.title}`);
|
|
171
|
+
// Author line
|
|
172
|
+
const authorParts = [`作者: ${post.author.name}`];
|
|
173
|
+
if (post.author.ip_location)
|
|
174
|
+
authorParts.push(`📍 ${post.author.ip_location}`);
|
|
175
|
+
if (post.create_time) {
|
|
176
|
+
const date = new Date(post.create_time * 1000).toLocaleString("zh-CN", { timeZone: "Asia/Shanghai" });
|
|
177
|
+
authorParts.push(date);
|
|
178
|
+
}
|
|
179
|
+
parts.push(authorParts.join(" | "));
|
|
180
|
+
if (post.author.signature)
|
|
181
|
+
parts.push(`签名: ${post.author.signature}`);
|
|
182
|
+
// Stats line
|
|
183
|
+
const statsLine = [];
|
|
184
|
+
const s = post.stats;
|
|
185
|
+
if (s.views != null)
|
|
186
|
+
statsLine.push(`▶ ${s.views}`);
|
|
187
|
+
if (s.plays != null)
|
|
188
|
+
statsLine.push(`▶ ${s.plays}`);
|
|
189
|
+
if (s.likes != null)
|
|
190
|
+
statsLine.push(`👍 ${s.likes}`);
|
|
191
|
+
if (s.comments != null)
|
|
192
|
+
statsLine.push(`💬 ${s.comments}`);
|
|
193
|
+
if (s.collects != null)
|
|
194
|
+
statsLine.push(`⭐ ${s.collects}`);
|
|
195
|
+
if (s.favorites != null)
|
|
196
|
+
statsLine.push(`⭐ ${s.favorites}`);
|
|
197
|
+
if (s.coins != null)
|
|
198
|
+
statsLine.push(`🪙 ${s.coins}`);
|
|
199
|
+
if (s.shares != null)
|
|
200
|
+
statsLine.push(`🔗 ${s.shares}`);
|
|
201
|
+
if (s.reposts != null)
|
|
202
|
+
statsLine.push(`🔁 ${s.reposts}`);
|
|
203
|
+
if (s.danmaku != null)
|
|
204
|
+
statsLine.push(`💭 ${s.danmaku}`);
|
|
205
|
+
if (statsLine.length > 0)
|
|
206
|
+
parts.push(statsLine.join(" | "));
|
|
207
|
+
// Music / BGM
|
|
208
|
+
if (post.music?.title) {
|
|
209
|
+
const musicParts = [`🎵 ${post.music.title}`];
|
|
210
|
+
if (post.music.author)
|
|
211
|
+
musicParts.push(post.music.author);
|
|
212
|
+
parts.push(musicParts.join(" - "));
|
|
213
|
+
}
|
|
214
|
+
// Content type
|
|
215
|
+
if (post.aweme_type)
|
|
216
|
+
parts.push(`类型: ${post.aweme_type}`);
|
|
217
|
+
// Content
|
|
218
|
+
if (post.content) {
|
|
219
|
+
parts.push("");
|
|
220
|
+
parts.push(post.content);
|
|
221
|
+
}
|
|
222
|
+
// Comments
|
|
223
|
+
const comments = post.comments ?? [];
|
|
224
|
+
if (comments.length > 0) {
|
|
225
|
+
parts.push("");
|
|
226
|
+
parts.push(`热门评论 (${comments.length}):`);
|
|
227
|
+
for (let i = 0; i < comments.length; i++) {
|
|
228
|
+
const c = comments[i];
|
|
229
|
+
const meta = [];
|
|
230
|
+
if (c.likes)
|
|
231
|
+
meta.push(`赞 ${c.likes}`);
|
|
232
|
+
if (c.ip_location)
|
|
233
|
+
meta.push(c.ip_location);
|
|
234
|
+
if (c.sub_comment_count)
|
|
235
|
+
meta.push(`${c.sub_comment_count}条回复`);
|
|
236
|
+
const metaPart = meta.length > 0 ? ` (${meta.join(", ")})` : "";
|
|
237
|
+
parts.push(`${i + 1}. @${c.user}${metaPart}: ${c.text}`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return parts.join("\n");
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=socialMedia.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,CAAC,iBAAiB;gBAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,iBAAiB,KAAK,CAAC,CAAC;YAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,GAAG,QAAQ,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -75,6 +75,48 @@ export interface OzaiyaImageGenerationConfig {
|
|
|
75
75
|
model?: string;
|
|
76
76
|
defaultSize?: string;
|
|
77
77
|
}
|
|
78
|
+
/** Yuanbao (元宝) config for WeChat article summarization */
|
|
79
|
+
export interface YuanbaoConfig {
|
|
80
|
+
/** Path to cookie file (default: stateDir/yuanbao-cookies.txt) */
|
|
81
|
+
cookieFile?: string;
|
|
82
|
+
/** Inline cookie string (overrides cookieFile) */
|
|
83
|
+
cookies?: string;
|
|
84
|
+
/** Yuanbao agent ID (default: "naQivTmsDa") */
|
|
85
|
+
agentId?: string;
|
|
86
|
+
/** Chat model ID (default: "deep_seek_v3") */
|
|
87
|
+
chatModelId?: string;
|
|
88
|
+
}
|
|
89
|
+
/** Doubao (豆包) config for Toutiao/Douyin content summarization via doubao-2api */
|
|
90
|
+
export interface DoubaoConfig {
|
|
91
|
+
/** API base URL of doubao-2api, e.g. "http://localhost:8088" */
|
|
92
|
+
apiBaseUrl: string;
|
|
93
|
+
/** API key (API_MASTER_KEY in doubao-2api) */
|
|
94
|
+
apiKey?: string;
|
|
95
|
+
/** Model name (default: "doubao-1.5-pro") */
|
|
96
|
+
model?: string;
|
|
97
|
+
/** Timeout in ms (default: 120000) */
|
|
98
|
+
timeoutMs?: number;
|
|
99
|
+
}
|
|
100
|
+
/** Xueqiu (雪球) config for fetching post content + comments */
|
|
101
|
+
export interface XueqiuConfig {
|
|
102
|
+
/** Inline cookie string (overrides cookieFile) */
|
|
103
|
+
cookies?: string;
|
|
104
|
+
/** Path to cookie file */
|
|
105
|
+
cookieFile?: string;
|
|
106
|
+
/** Maximum number of comments to include (default: 10) */
|
|
107
|
+
maxComments?: number;
|
|
108
|
+
/** Request timeout in ms (default: 30000) */
|
|
109
|
+
timeoutMs?: number;
|
|
110
|
+
}
|
|
111
|
+
/** Social media fetch config (unified service for XHS, Douyin, Bilibili, etc.) */
|
|
112
|
+
export interface SocialMediaConfig {
|
|
113
|
+
/** Base URL of media-fetch-api, e.g. "http://localhost:8089" */
|
|
114
|
+
apiBaseUrl: string;
|
|
115
|
+
/** Maximum number of comments to include (default: 10) */
|
|
116
|
+
maxComments?: number;
|
|
117
|
+
/** Request timeout in ms (default: 30000) */
|
|
118
|
+
timeoutMs?: number;
|
|
119
|
+
}
|
|
78
120
|
/** Config stored at channels.ozaiya in OpenClaw config */
|
|
79
121
|
export interface OzaiyaChannelConfig {
|
|
80
122
|
enabled?: boolean;
|
|
@@ -90,6 +132,14 @@ export interface OzaiyaChannelConfig {
|
|
|
90
132
|
volcengineTts?: OzaiyaVolcengineTtsConfig;
|
|
91
133
|
/** Image generation config — explicit provider for generate_image tool */
|
|
92
134
|
imageGeneration?: OzaiyaImageGenerationConfig;
|
|
135
|
+
/** Yuanbao config for WeChat article summarization */
|
|
136
|
+
yuanbao?: YuanbaoConfig;
|
|
137
|
+
/** Doubao config for Toutiao/Douyin content summarization */
|
|
138
|
+
doubao?: DoubaoConfig;
|
|
139
|
+
/** Xueqiu config for fetching post content + comments */
|
|
140
|
+
xueqiu?: XueqiuConfig;
|
|
141
|
+
/** Social media fetch config (XHS, Douyin, Bilibili via media-fetch-api) */
|
|
142
|
+
socialMedia?: SocialMediaConfig;
|
|
93
143
|
userToken?: string;
|
|
94
144
|
gatewayName?: string;
|
|
95
145
|
webhookBase?: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface XueqiuConfig {
|
|
2
|
+
/** Inline cookie string (overrides cookieFile) */
|
|
3
|
+
cookies?: string;
|
|
4
|
+
/** Path to cookie file */
|
|
5
|
+
cookieFile?: string;
|
|
6
|
+
/** Maximum number of comments to include (default: 10) */
|
|
7
|
+
maxComments?: number;
|
|
8
|
+
/** Request timeout in ms (default: 30000) */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
/**
|
|
11
|
+
* CDP WebSocket base URL for browser-proxied fetch (e.g. "127.0.0.1:9223").
|
|
12
|
+
* When set, fetch is executed inside the browser via Runtime.evaluate,
|
|
13
|
+
* bypassing WAF TLS fingerprint checks.
|
|
14
|
+
*/
|
|
15
|
+
cdpEndpoint?: string;
|
|
16
|
+
/**
|
|
17
|
+
* CDP origin host:port for Host header spoofing when connecting through
|
|
18
|
+
* a proxy (e.g. socat). Set to "127.0.0.1:9223" when cdpEndpoint goes
|
|
19
|
+
* through a forwarder that changes the host.
|
|
20
|
+
*/
|
|
21
|
+
cdpOrigin?: string;
|
|
22
|
+
/**
|
|
23
|
+
* URL prefix to match an existing xueqiu.com tab in the browser.
|
|
24
|
+
* Default: "https://xueqiu.com"
|
|
25
|
+
*/
|
|
26
|
+
cdpPageUrl?: string;
|
|
27
|
+
}
|
|
28
|
+
interface XueqiuLog {
|
|
29
|
+
info?: (...args: unknown[]) => void;
|
|
30
|
+
warn?: (...args: unknown[]) => void;
|
|
31
|
+
error?: (...args: unknown[]) => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Search Xueqiu posts by keyword, returning formatted results.
|
|
35
|
+
* Returns null if the operation fails or no results are found.
|
|
36
|
+
*/
|
|
37
|
+
export declare function searchXueqiuPosts(query: string, config: XueqiuConfig, log?: XueqiuLog, count?: number): Promise<string | null>;
|
|
38
|
+
/**
|
|
39
|
+
* Fetch a Xueqiu post and its top comments, returning formatted text.
|
|
40
|
+
* Returns null if the operation fails or no content is available.
|
|
41
|
+
*/
|
|
42
|
+
export declare function fetchXueqiuPost(url: string, config: XueqiuConfig, log?: XueqiuLog): Promise<string | null>;
|
|
43
|
+
export {};
|