@towns-protocol/bot 0.0.260

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.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 River Association
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @towns-protocol/bot
2
+
3
+ A bot framework for Towns.
4
+
5
+ ## Usage
6
+
7
+ ```ts
8
+ import { makeTownsBot } from "@towns-protocol/bot";
9
+ import { serve } from "@hono/node-server";
10
+
11
+ const bot = await makeTownsBot("<app-private-data-base64>", "<env>");
12
+
13
+ bot.onMentioned((client, { channelId }) =>
14
+ client.sendMessage(channelId, "Hello, world!"),
15
+ );
16
+
17
+ const { fetch } = await bot.start();
18
+ serve({ fetch });
19
+ ```
package/dist/bot.d.ts ADDED
@@ -0,0 +1,273 @@
1
+ import 'fake-indexeddb/auto';
2
+ import { type ClientV2, type makeRiverConfig, type ParsedEvent } from '@towns-protocol/sdk';
3
+ import TypedEmitter from 'typed-emitter';
4
+ import { type ChannelMessage_Post_Attachment, type ChannelMessage_Post_Mention, ChannelMessage, type UserInboxPayload_GroupEncryptionSessions, type PlainMessage, type ChunkedMedia, Tags } from '@towns-protocol/proto';
5
+ import { GroupEncryptionAlgorithmId } from '@towns-protocol/encryption';
6
+ import { type Abi, type Account, type Chain, type Client as ViemClient, type ContractFunctionArgs, type ContractFunctionName } from 'viem';
7
+ import { type ReadContractParameters, type WriteContractParameters } from 'viem/actions';
8
+ type BotActions = ReturnType<typeof buildBotActions>;
9
+ export type BotPayload<T extends keyof BotEvents> = Parameters<BotEvents[T]>[1];
10
+ type MessageOpts = {
11
+ threadId?: string;
12
+ replyId?: string;
13
+ mentions?: PlainMessage<ChannelMessage_Post_Mention>[];
14
+ attachments?: PlainMessage<ChannelMessage_Post_Attachment>[];
15
+ };
16
+ export type UserData = {
17
+ /** The user ID of the user */
18
+ userId: string;
19
+ /** The username of the user */
20
+ username: string | null;
21
+ /** The display name of the user */
22
+ displayName: string | null;
23
+ /** The ENS address of the user */
24
+ ensAddress?: string;
25
+ /** The bio of the user */
26
+ bio: string | null;
27
+ /** The NFT that the user is currently showcasing */
28
+ nft?: {
29
+ tokenId: string;
30
+ contractAddress: string;
31
+ chainId: number;
32
+ };
33
+ /** URL that points to the profile picture of the user */
34
+ profilePictureUrl: string;
35
+ };
36
+ export type BotEvents = {
37
+ message: (handler: BotActions, event: BasePayload & {
38
+ /** The decrypted message content */
39
+ message: string;
40
+ /** You can use this to check if the message is a direct message */
41
+ isDm: boolean;
42
+ /** You can use this to check if the message is a group message */
43
+ isGdm: boolean;
44
+ }) => void | Promise<void>;
45
+ redaction: (handler: BotActions, event: BasePayload & {
46
+ /** The event ID that got redacted */
47
+ refEventId: string;
48
+ }) => void | Promise<void>;
49
+ messageEdit: (handler: BotActions, event: BasePayload & {
50
+ /** The event ID of the message that got edited */
51
+ refEventId: string;
52
+ /** New message */
53
+ message: string;
54
+ }) => void | Promise<void>;
55
+ mentioned: (handler: BotActions, event: BasePayload & {
56
+ /** The decrypted message content */
57
+ message: string;
58
+ }) => void | Promise<void>;
59
+ reply: (handler: BotActions, event: BasePayload & {
60
+ /** The decrypted message content */
61
+ message: string;
62
+ }) => void | Promise<void>;
63
+ reaction: (handler: BotActions, event: BasePayload & {
64
+ /** The reaction that was added */
65
+ reaction: string;
66
+ /** The event ID of the message that got reacted to */
67
+ messageId: string;
68
+ /** The user ID of the user that added the reaction */
69
+ userId: string;
70
+ }) => Promise<void> | void;
71
+ eventRevoke: (handler: BotActions, event: BasePayload & {
72
+ /** The event ID of the message that got revoked */
73
+ refEventId: string;
74
+ }) => Promise<void> | void;
75
+ tip: (handler: BotActions, event: BasePayload & {
76
+ /** The amount of the tip */
77
+ amount: bigint;
78
+ /** The currency of the tip */
79
+ currency: `0x${string}`;
80
+ }) => Promise<void> | void;
81
+ channelJoin: (handler: BotActions, event: BasePayload) => Promise<void> | void;
82
+ channelLeave: (handler: BotActions, event: BasePayload) => Promise<void> | void;
83
+ streamEvent: (handler: BotActions, event: BasePayload & {
84
+ event: ParsedEvent;
85
+ }) => Promise<void> | void;
86
+ threadMessage: (handler: BotActions, event: BasePayload & {
87
+ /** The thread id where the message belongs to */
88
+ threadId: string;
89
+ /** The decrypted message content */
90
+ message: string;
91
+ }) => Promise<void> | void;
92
+ };
93
+ type BasePayload = {
94
+ /** The user ID of the user that triggered the event */
95
+ userId: string;
96
+ /** The space ID that the event was triggered in */
97
+ spaceId: string;
98
+ /** channelId that the event was triggered in */
99
+ channelId: string;
100
+ /** The ID of the event that triggered */
101
+ eventId: string;
102
+ };
103
+ declare const Bot_base: new () => TypedEmitter<BotEvents>;
104
+ export declare class Bot extends Bot_base {
105
+ private readonly server;
106
+ private readonly client;
107
+ botId: string;
108
+ viemClient: ViemClient;
109
+ private readonly jwtSecret;
110
+ private currentMessageTags;
111
+ constructor(clientV2: ClientV2<BotActions>, viemClient: ViemClient, jwtSecretBase64: string);
112
+ start(): Promise<{
113
+ fetch: (request: Request, Env?: unknown, executionCtx?: import("hono").ExecutionContext) => Response | Promise<Response>;
114
+ }>;
115
+ private webhookResponseHandler;
116
+ private handleEvent;
117
+ handleChannelMessage(streamId: string, parsed: ParsedEvent, { payload }: ChannelMessage): Promise<void>;
118
+ /**
119
+ * Send a message to a stream
120
+ * @param streamId - Id of the stream. Usually channelId or userId
121
+ * @param message - The cleartext of the message
122
+ */
123
+ sendMessage(streamId: string, message: string, opts?: MessageOpts): Promise<{
124
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
125
+ eventId: string;
126
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
127
+ }>;
128
+ /**
129
+ * Send a reaction to a stream
130
+ * @param streamId - Id of the stream. Usually channelId or userId
131
+ * @param refEventId - The eventId of the event to react to
132
+ * @param reaction - The reaction to send
133
+ */
134
+ sendReaction(streamId: string, refEventId: string, reaction: string): Promise<{
135
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
136
+ eventId: string;
137
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
138
+ }>;
139
+ /**
140
+ * Remove an specific event from a stream
141
+ * @param streamId - Id of the stream. Usually channelId or userId
142
+ * @param refEventId - The eventId of the event to remove
143
+ */
144
+ removeEvent(streamId: string, refEventId: string): Promise<{
145
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
146
+ eventId: string;
147
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
148
+ }>;
149
+ /**
150
+ * Edit an specific message from a stream
151
+ * @param streamId - Id of the stream. Usually channelId or userId
152
+ * @param messageId - The eventId of the message to edit
153
+ * @param message - The new message text
154
+ */
155
+ editMessage(streamId: string, messageId: string, message: string): Promise<{
156
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
157
+ eventId: string;
158
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
159
+ }>;
160
+ writeContract<chain extends Chain | undefined, account extends Account | undefined, const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, chainOverride extends Chain | undefined>(tx: WriteContractParameters<abi, functionName, args, chain, account, chainOverride>): Promise<`0x${string}`>;
161
+ readContract<const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'pure' | 'view'>, const args extends ContractFunctionArgs<abi, 'pure' | 'view', functionName>>(parameters: ReadContractParameters<abi, functionName, args>): Promise<import("viem").ContractFunctionReturnType<abi, "view" | "pure", functionName, args>>;
162
+ /**
163
+ * Triggered when someone sends a message.
164
+ * This is triggered for all messages, including direct messages and group messages.
165
+ */
166
+ onMessage(fn: BotEvents['message']): void;
167
+ onRedaction(fn: BotEvents['redaction']): void;
168
+ /**
169
+ * Triggered when a message gets edited
170
+ */
171
+ onMessageEdit(fn: BotEvents['messageEdit']): void;
172
+ /**
173
+ * Triggered when someone mentions the bot in a message
174
+ */
175
+ onMentioned(fn: BotEvents['mentioned']): void;
176
+ /**
177
+ * Triggered when someone replies to a message
178
+ */
179
+ onReply(fn: BotEvents['reply']): void;
180
+ /**
181
+ * Triggered when someone reacts to a message
182
+ */
183
+ onReaction(fn: BotEvents['reaction']): void;
184
+ /**
185
+ * Triggered when a message is revoked by a moderator
186
+ */
187
+ onEventRevoke(fn: BotEvents['eventRevoke']): void;
188
+ /**
189
+ * Triggered when someone tips the bot
190
+ * TODO: impl
191
+ */
192
+ onTip(fn: BotEvents['tip']): void;
193
+ /**
194
+ * Triggered when someone joins a channel
195
+ */
196
+ onChannelJoin(fn: BotEvents['channelJoin']): void;
197
+ /**
198
+ * Triggered when someone leaves a channel
199
+ */
200
+ onChannelLeave(fn: BotEvents['channelLeave']): void;
201
+ onStreamEvent(fn: BotEvents['streamEvent']): void;
202
+ onThreadMessage(fn: BotEvents['threadMessage']): void;
203
+ }
204
+ export declare const makeTownsBot: (appPrivateDataBase64: string, jwtSecretBase64: string, env: Parameters<typeof makeRiverConfig>[0], baseRpcUrl?: string) => Promise<Bot>;
205
+ declare const buildBotActions: (client: ClientV2, viemClient: ViemClient) => {
206
+ writeContract: <chain extends Chain | undefined, account extends Account | undefined, const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, "nonpayable" | "payable">, args extends ContractFunctionArgs<abi, "nonpayable" | "payable", functionName>, chainOverride extends Chain | undefined>(tx: WriteContractParameters<abi, functionName, args, chain, account, chainOverride>) => Promise<`0x${string}`>;
207
+ readContract: <const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, "pure" | "view">, const args extends ContractFunctionArgs<abi, "pure" | "view", functionName>>(parameters: ReadContractParameters<abi, functionName, args>) => Promise<import("viem").ContractFunctionReturnType<abi, "view" | "pure", functionName, args>>;
208
+ sendMessage: (streamId: string, message: string, opts?: {
209
+ threadId?: string;
210
+ replyId?: string;
211
+ mentions?: PlainMessage<ChannelMessage_Post_Mention>[];
212
+ attachments?: PlainMessage<ChannelMessage_Post_Attachment>[];
213
+ }, tags?: PlainMessage<Tags>) => Promise<{
214
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
215
+ eventId: string;
216
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
217
+ }>;
218
+ editMessage: (streamId: string, messageId: string, message: string, tags?: PlainMessage<Tags>) => Promise<{
219
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
220
+ eventId: string;
221
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
222
+ }>;
223
+ sendDm: (userId: string, message: string, opts?: {
224
+ threadId?: string;
225
+ replyId?: string;
226
+ mentions?: ChannelMessage_Post_Mention[];
227
+ attachments?: ChannelMessage_Post_Attachment[];
228
+ }) => Promise<{
229
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
230
+ eventId: string;
231
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
232
+ }>;
233
+ sendReaction: (streamId: string, messageId: string, reaction: string, tags?: PlainMessage<Tags>) => Promise<{
234
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
235
+ eventId: string;
236
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
237
+ }>;
238
+ removeEvent: (streamId: string, messageId: string, tags?: PlainMessage<Tags>) => Promise<{
239
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
240
+ eventId: string;
241
+ prevMiniblockHash: Uint8Array<ArrayBufferLike>;
242
+ }>;
243
+ sendKeySolicitation: (streamId: string, sessionIds: string[]) => Promise<{
244
+ eventId: string;
245
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
246
+ }>;
247
+ uploadDeviceKeys: () => Promise<{
248
+ eventId: string;
249
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
250
+ }>;
251
+ decryptSessions: (streamId: string, sessions: UserInboxPayload_GroupEncryptionSessions) => Promise<{
252
+ streamId: string;
253
+ sessionId: string;
254
+ sessionKey: string;
255
+ algorithm: GroupEncryptionAlgorithmId;
256
+ }[]>;
257
+ setUsername: (streamId: string, username: string) => Promise<{
258
+ eventId: string;
259
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
260
+ }>;
261
+ setDisplayName: (streamId: string, displayName: string) => Promise<{
262
+ eventId: string;
263
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
264
+ }>;
265
+ setUserProfileImage: (chunkedMediaInfo: PlainMessage<ChunkedMedia>) => Promise<{
266
+ eventId: string;
267
+ error: import("@towns-protocol/proto").AddEventResponse_Error | undefined;
268
+ }>;
269
+ /** @deprecated Not planned for now */
270
+ getUserData: (streamId: string, userId: string) => Promise<UserData | null>;
271
+ };
272
+ export {};
273
+ //# sourceMappingURL=bot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../src/bot.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,CAAA;AAG5B,OAAO,EAWH,KAAK,QAAQ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