bereach-openclaw 1.6.12 → 1.6.13
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/tools/index.ts +37 -1
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/tools/index.ts
CHANGED
|
@@ -5,6 +5,41 @@ import { resolveApiKey } from "../index";
|
|
|
5
5
|
|
|
6
6
|
const API_BASE = "https://api.bereach.ai";
|
|
7
7
|
|
|
8
|
+
// 42 bereach tools that are never used by automation tasks AND have low chat
|
|
9
|
+
// value. Skipping at registration saves ~5,200 prompt tokens/turn (−15%).
|
|
10
|
+
// Proven via Haiku 4.5 probe 2026-04-15: pt 34,121 → 28,912.
|
|
11
|
+
const SKIP_TOOLS = new Set([
|
|
12
|
+
"bereach_typing_indicator", "bereach_react_message", "bereach_unreact_message",
|
|
13
|
+
"bereach_mark_all_read", "bereach_unarchive_conversation", "bereach_unstar_conversation",
|
|
14
|
+
"bereach_list_starred_conversations", "bereach_list_archived_conversations",
|
|
15
|
+
"bereach_edit_profile", "bereach_edit_post", "bereach_edit_comment",
|
|
16
|
+
"bereach_repost_post", "bereach_unlike_post", "bereach_like_comment",
|
|
17
|
+
"bereach_unlike_comment", "bereach_reply_to_comment", "bereach_save_post",
|
|
18
|
+
"bereach_unsave_post", "bereach_follow_profile", "bereach_unfollow_profile",
|
|
19
|
+
"bereach_follow_company", "bereach_unfollow_company", "bereach_get_profile_views",
|
|
20
|
+
"bereach_search_appearances", "bereach_follower_analytics",
|
|
21
|
+
"bereach_company_page_analytics", "bereach_company_page_posts",
|
|
22
|
+
"bereach_company_page_permissions", "bereach_list_company_pages",
|
|
23
|
+
"bereach_get_own_posts", "bereach_get_followers", "bereach_get_connections",
|
|
24
|
+
"bereach_search_conversations", "bereach_decline_invitation",
|
|
25
|
+
"bereach_list_sent_invitations", "bereach_withdraw_invitation",
|
|
26
|
+
"bereach_switch_account", "bereach_list_account", "bereach_update_account",
|
|
27
|
+
"bereach_collect_comment_replies", "bereach_collect_saved_posts",
|
|
28
|
+
"bereach_refresh_profile",
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
// Essential chat tools keep full descriptions; non-essential tools get "" to
|
|
32
|
+
// save ~3,800 prompt tokens/turn. Agent infers purpose from tool names.
|
|
33
|
+
// Proven via Haiku 4.5 probe 2026-04-15: pt 29,430 → 25,624.
|
|
34
|
+
const KEEP_DESCRIPTION = new Set([
|
|
35
|
+
"bereach_list_campaigns", "bereach_create_campaign", "bereach_context_get",
|
|
36
|
+
"bereach_context_set", "bereach_review_drafts", "bereach_list_tasks",
|
|
37
|
+
"bereach_events_feed", "bereach_campaign_health", "bereach_unified_search",
|
|
38
|
+
"bereach_save_conversation", "bereach_get_dm_history",
|
|
39
|
+
"bereach_scheduled_message_create", "bereach_scheduled_message_update",
|
|
40
|
+
"bereach_contacts_add", "bereach_get_credits", "bereach_set_api_key",
|
|
41
|
+
]);
|
|
42
|
+
|
|
8
43
|
// Drops short/redundant property descriptions before registration to shrink the
|
|
9
44
|
// cached tool-schema prefix (~3,400 tokens/turn on Haiku 4.5). Keeps any
|
|
10
45
|
// description that contains quoted enum hints, cross-refs to other tools, or
|
|
@@ -39,11 +74,12 @@ export function registerAllTools(api: any) {
|
|
|
39
74
|
console.warn(`[bereach:tools] SKIP ${def.name}: no apiPath defined`);
|
|
40
75
|
continue;
|
|
41
76
|
}
|
|
77
|
+
if (SKIP_TOOLS.has(def.name)) continue;
|
|
42
78
|
|
|
43
79
|
registered++;
|
|
44
80
|
api.registerTool({
|
|
45
81
|
name: def.name,
|
|
46
|
-
description: def.description,
|
|
82
|
+
description: KEEP_DESCRIPTION.has(def.name) ? def.description : "",
|
|
47
83
|
parameters: compactSchemaDescriptions(def.parameters),
|
|
48
84
|
async execute(_id: string, params: Record<string, unknown>) {
|
|
49
85
|
if (def.handler === "__set_api_key__") {
|