-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Expand file tree
/
Copy pathbot-deps.ts
More file actions
152 lines (150 loc) · 5.78 KB
/
Copy pathbot-deps.ts
File metadata and controls
152 lines (150 loc) · 5.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// Telegram plugin module implements bot deps behavior.
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
import { buildChannelInboundEventContext } from "openclaw/plugin-sdk/channel-inbound";
import {
createChannelMessageReplyPipeline,
deliverInboundReplyWithMessageSendContext,
} from "openclaw/plugin-sdk/channel-outbound";
import { readChannelAllowFromStore } from "openclaw/plugin-sdk/conversation-runtime";
import {
recordInboundSession,
upsertChannelPairingRequest,
} from "openclaw/plugin-sdk/conversation-runtime";
import { buildModelsProviderData } from "openclaw/plugin-sdk/models-provider-runtime";
import { dispatchReplyWithBufferedBlockDispatcher } from "openclaw/plugin-sdk/reply-dispatch-runtime";
import { resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
import {
getSessionEntry,
listSessionEntries,
readSessionUpdatedAt,
resolveStorePath,
} from "openclaw/plugin-sdk/session-store-runtime";
import { loadSessionStore } from "openclaw/plugin-sdk/session-store-runtime";
import { listSkillCommandsForAgents } from "openclaw/plugin-sdk/skill-commands-runtime";
import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
import { syncTelegramMenuCommands } from "./bot-native-command-menu.js";
import { deliverReplies, emitInternalMessageSentHook } from "./bot/delivery.js";
import { createTelegramDraftStream } from "./draft-stream.js";
import { resolveTelegramExecApproval } from "./exec-approval-resolver.js";
import { recordOutboundMessageForPromptContext } from "./outbound-message-context.js";
import { editMessageTelegram } from "./send.js";
import { wasSentByBot } from "./sent-message-cache.js";
export type TelegramBotDeps = {
getRuntimeConfig: typeof getRuntimeConfig;
resolveStorePath: typeof resolveStorePath;
getSessionEntry?: typeof getSessionEntry;
listSessionEntries?: typeof listSessionEntries;
loadSessionStore?: typeof loadSessionStore;
readSessionUpdatedAt?: typeof readSessionUpdatedAt;
recordInboundSession?: typeof recordInboundSession;
recordChannelActivity?: typeof recordChannelActivity;
resolveInboundLastRouteSessionKey?: typeof resolveInboundLastRouteSessionKey;
resolvePinnedMainDmOwnerFromAllowlist?: typeof resolvePinnedMainDmOwnerFromAllowlist;
buildChannelInboundEventContext?: typeof buildChannelInboundEventContext;
readChannelAllowFromStore: typeof readChannelAllowFromStore;
upsertChannelPairingRequest: typeof upsertChannelPairingRequest;
enqueueSystemEvent: typeof enqueueSystemEvent;
dispatchReplyWithBufferedBlockDispatcher: typeof dispatchReplyWithBufferedBlockDispatcher;
loadWebMedia?: typeof loadWebMedia;
buildModelsProviderData: typeof buildModelsProviderData;
listSkillCommandsForAgents: typeof listSkillCommandsForAgents;
syncTelegramMenuCommands?: typeof syncTelegramMenuCommands;
wasSentByBot: typeof wasSentByBot;
resolveExecApproval?: typeof resolveTelegramExecApproval;
createTelegramDraftStream?: typeof createTelegramDraftStream;
deliverReplies?: typeof deliverReplies;
deliverInboundReplyWithMessageSendContext?: typeof deliverInboundReplyWithMessageSendContext;
emitInternalMessageSentHook?: typeof emitInternalMessageSentHook;
editMessageTelegram?: typeof editMessageTelegram;
recordOutboundMessageForPromptContext?: typeof recordOutboundMessageForPromptContext;
createChannelMessageReplyPipeline?: typeof createChannelMessageReplyPipeline;
};
export const defaultTelegramBotDeps: TelegramBotDeps = {
get getRuntimeConfig() {
return getRuntimeConfig;
},
get resolveStorePath() {
return resolveStorePath;
},
get getSessionEntry() {
return getSessionEntry;
},
get listSessionEntries() {
return listSessionEntries;
},
get readChannelAllowFromStore() {
return readChannelAllowFromStore;
},
get loadSessionStore() {
return loadSessionStore;
},
get readSessionUpdatedAt() {
return readSessionUpdatedAt;
},
get recordInboundSession() {
return recordInboundSession;
},
get recordChannelActivity() {
return recordChannelActivity;
},
get resolveInboundLastRouteSessionKey() {
return resolveInboundLastRouteSessionKey;
},
get resolvePinnedMainDmOwnerFromAllowlist() {
return resolvePinnedMainDmOwnerFromAllowlist;
},
get buildChannelInboundEventContext() {
return buildChannelInboundEventContext;
},
get upsertChannelPairingRequest() {
return upsertChannelPairingRequest;
},
get enqueueSystemEvent() {
return enqueueSystemEvent;
},
get dispatchReplyWithBufferedBlockDispatcher() {
return dispatchReplyWithBufferedBlockDispatcher;
},
get loadWebMedia() {
return loadWebMedia;
},
get buildModelsProviderData() {
return buildModelsProviderData;
},
get listSkillCommandsForAgents() {
return listSkillCommandsForAgents;
},
get syncTelegramMenuCommands() {
return syncTelegramMenuCommands;
},
get wasSentByBot() {
return wasSentByBot;
},
get resolveExecApproval() {
return resolveTelegramExecApproval;
},
get createTelegramDraftStream() {
return createTelegramDraftStream;
},
get deliverReplies() {
return deliverReplies;
},
get deliverInboundReplyWithMessageSendContext() {
return deliverInboundReplyWithMessageSendContext;
},
get emitInternalMessageSentHook() {
return emitInternalMessageSentHook;
},
get editMessageTelegram() {
return editMessageTelegram;
},
get recordOutboundMessageForPromptContext() {
return recordOutboundMessageForPromptContext;
},
get createChannelMessageReplyPipeline() {
return createChannelMessageReplyPipeline;
},
};