@dobby.ai/dobby 0.1.1 → 0.1.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.
Files changed (136) hide show
  1. package/README.md +20 -7
  2. package/dist/src/agent/event-forwarder.js +185 -16
  3. package/dist/src/cli/commands/cron.js +39 -35
  4. package/dist/src/cli/program.js +0 -6
  5. package/dist/src/core/types.js +2 -0
  6. package/dist/src/cron/config.js +2 -2
  7. package/dist/src/cron/service.js +87 -23
  8. package/dist/src/cron/store.js +1 -1
  9. package/package.json +9 -3
  10. package/.env.example +0 -8
  11. package/AGENTS.md +0 -267
  12. package/ROADMAP.md +0 -34
  13. package/config/cron.example.json +0 -9
  14. package/config/gateway.example.json +0 -132
  15. package/dist/plugins/connector-discord/src/mapper.js +0 -75
  16. package/dist/src/cli/tests/config-command.test.js +0 -42
  17. package/dist/src/cli/tests/config-io.test.js +0 -64
  18. package/dist/src/cli/tests/config-mutators.test.js +0 -47
  19. package/dist/src/cli/tests/discord-mapper.test.js +0 -90
  20. package/dist/src/cli/tests/doctor.test.js +0 -252
  21. package/dist/src/cli/tests/init-catalog.test.js +0 -134
  22. package/dist/src/cli/tests/program-options.test.js +0 -78
  23. package/dist/src/cli/tests/routing-config.test.js +0 -254
  24. package/dist/src/core/tests/control-command.test.js +0 -17
  25. package/dist/src/core/tests/runtime-registry.test.js +0 -116
  26. package/dist/src/core/tests/typing-controller.test.js +0 -103
  27. package/docs/BOXLITE_SANDBOX_FEASIBILITY.md +0 -175
  28. package/docs/CRON_SCHEDULER_DESIGN.md +0 -374
  29. package/docs/DOCKER_SANDBOX_vs_BOXLITE.md +0 -77
  30. package/docs/EXTENSION_SYSTEM_ARCHITECTURE.md +0 -119
  31. package/docs/MVP.md +0 -135
  32. package/docs/RUNBOOK.md +0 -243
  33. package/docs/TEAMWORK_HANDOFF_DESIGN.md +0 -440
  34. package/plugins/connector-discord/dobby.manifest.json +0 -18
  35. package/plugins/connector-discord/index.js +0 -1
  36. package/plugins/connector-discord/package-lock.json +0 -360
  37. package/plugins/connector-discord/package.json +0 -38
  38. package/plugins/connector-discord/src/connector.ts +0 -345
  39. package/plugins/connector-discord/src/contribution.ts +0 -21
  40. package/plugins/connector-discord/src/mapper.ts +0 -101
  41. package/plugins/connector-discord/tsconfig.json +0 -19
  42. package/plugins/connector-feishu/dobby.manifest.json +0 -18
  43. package/plugins/connector-feishu/index.js +0 -1
  44. package/plugins/connector-feishu/package-lock.json +0 -618
  45. package/plugins/connector-feishu/package.json +0 -38
  46. package/plugins/connector-feishu/src/connector.ts +0 -343
  47. package/plugins/connector-feishu/src/contribution.ts +0 -26
  48. package/plugins/connector-feishu/src/mapper.ts +0 -401
  49. package/plugins/connector-feishu/tsconfig.json +0 -19
  50. package/plugins/plugin-sdk/index.d.ts +0 -261
  51. package/plugins/plugin-sdk/index.js +0 -1
  52. package/plugins/plugin-sdk/package-lock.json +0 -12
  53. package/plugins/plugin-sdk/package.json +0 -22
  54. package/plugins/provider-claude/dobby.manifest.json +0 -17
  55. package/plugins/provider-claude/index.js +0 -1
  56. package/plugins/provider-claude/package-lock.json +0 -3398
  57. package/plugins/provider-claude/package.json +0 -39
  58. package/plugins/provider-claude/src/contribution.ts +0 -1018
  59. package/plugins/provider-claude/tsconfig.json +0 -19
  60. package/plugins/provider-claude-cli/dobby.manifest.json +0 -17
  61. package/plugins/provider-claude-cli/index.js +0 -1
  62. package/plugins/provider-claude-cli/package-lock.json +0 -2898
  63. package/plugins/provider-claude-cli/package.json +0 -38
  64. package/plugins/provider-claude-cli/src/contribution.ts +0 -1673
  65. package/plugins/provider-claude-cli/tsconfig.json +0 -19
  66. package/plugins/provider-pi/dobby.manifest.json +0 -17
  67. package/plugins/provider-pi/index.js +0 -1
  68. package/plugins/provider-pi/package-lock.json +0 -3877
  69. package/plugins/provider-pi/package.json +0 -40
  70. package/plugins/provider-pi/src/contribution.ts +0 -606
  71. package/plugins/provider-pi/tsconfig.json +0 -19
  72. package/plugins/sandbox-core/boxlite.js +0 -1
  73. package/plugins/sandbox-core/dobby.manifest.json +0 -17
  74. package/plugins/sandbox-core/docker.js +0 -1
  75. package/plugins/sandbox-core/package-lock.json +0 -136
  76. package/plugins/sandbox-core/package.json +0 -39
  77. package/plugins/sandbox-core/src/boxlite-context.ts +0 -2
  78. package/plugins/sandbox-core/src/boxlite-contribution.ts +0 -53
  79. package/plugins/sandbox-core/src/boxlite-executor.ts +0 -911
  80. package/plugins/sandbox-core/src/docker-contribution.ts +0 -43
  81. package/plugins/sandbox-core/src/docker-executor.ts +0 -217
  82. package/plugins/sandbox-core/tsconfig.json +0 -19
  83. package/scripts/local-extensions.mjs +0 -168
  84. package/src/agent/event-forwarder.ts +0 -414
  85. package/src/cli/commands/config.ts +0 -328
  86. package/src/cli/commands/configure.ts +0 -92
  87. package/src/cli/commands/cron.ts +0 -410
  88. package/src/cli/commands/doctor.ts +0 -331
  89. package/src/cli/commands/extension.ts +0 -207
  90. package/src/cli/commands/init.ts +0 -211
  91. package/src/cli/commands/start.ts +0 -223
  92. package/src/cli/commands/topology.ts +0 -415
  93. package/src/cli/index.ts +0 -9
  94. package/src/cli/program.ts +0 -314
  95. package/src/cli/shared/config-io.ts +0 -245
  96. package/src/cli/shared/config-mutators.ts +0 -470
  97. package/src/cli/shared/config-schema.ts +0 -228
  98. package/src/cli/shared/config-types.ts +0 -129
  99. package/src/cli/shared/configure-sections.ts +0 -595
  100. package/src/cli/shared/discord-config.ts +0 -14
  101. package/src/cli/shared/init-catalog.ts +0 -249
  102. package/src/cli/shared/local-extension-specs.ts +0 -108
  103. package/src/cli/shared/runtime.ts +0 -33
  104. package/src/cli/shared/schema-prompts.ts +0 -443
  105. package/src/cli/tests/config-command.test.ts +0 -56
  106. package/src/cli/tests/config-io.test.ts +0 -92
  107. package/src/cli/tests/config-mutators.test.ts +0 -59
  108. package/src/cli/tests/discord-mapper.test.ts +0 -128
  109. package/src/cli/tests/doctor.test.ts +0 -269
  110. package/src/cli/tests/init-catalog.test.ts +0 -144
  111. package/src/cli/tests/program-options.test.ts +0 -95
  112. package/src/cli/tests/routing-config.test.ts +0 -281
  113. package/src/core/control-command.ts +0 -12
  114. package/src/core/dedup-store.ts +0 -103
  115. package/src/core/gateway.ts +0 -609
  116. package/src/core/routing.ts +0 -404
  117. package/src/core/runtime-registry.ts +0 -141
  118. package/src/core/tests/control-command.test.ts +0 -20
  119. package/src/core/tests/runtime-registry.test.ts +0 -140
  120. package/src/core/tests/typing-controller.test.ts +0 -129
  121. package/src/core/types.ts +0 -324
  122. package/src/core/typing-controller.ts +0 -119
  123. package/src/cron/config.ts +0 -154
  124. package/src/cron/schedule.ts +0 -61
  125. package/src/cron/service.ts +0 -249
  126. package/src/cron/store.ts +0 -155
  127. package/src/cron/types.ts +0 -60
  128. package/src/extension/loader.ts +0 -145
  129. package/src/extension/manager.ts +0 -355
  130. package/src/extension/manifest.ts +0 -26
  131. package/src/extension/registry.ts +0 -229
  132. package/src/main.ts +0 -8
  133. package/src/sandbox/executor.ts +0 -44
  134. package/src/sandbox/host-executor.ts +0 -118
  135. package/src/shared/dobby-repo.ts +0 -48
  136. package/tsconfig.json +0 -18
@@ -1,345 +0,0 @@
1
- import {
2
- AttachmentBuilder,
3
- Client,
4
- GatewayIntentBits,
5
- Partials,
6
- type Message,
7
- type MessageCreateOptions,
8
- type SendableChannels,
9
- } from "discord.js";
10
- import type {
11
- ConnectorCapabilities,
12
- ConnectorContext,
13
- ConnectorPlugin,
14
- ConnectorSendResult,
15
- ConnectorTypingEnvelope,
16
- GatewayLogger,
17
- OutboundEnvelope,
18
- } from "@dobby.ai/plugin-sdk";
19
- import { mapDiscordMessage } from "./mapper.js";
20
-
21
- const DISCORD_MAX_CONTENT_LENGTH = 2000;
22
- const DEFAULT_RECONNECT_STALE_MS = 60_000;
23
- const DEFAULT_RECONNECT_CHECK_INTERVAL_MS = 10_000;
24
-
25
- export interface DiscordConnectorConfig {
26
- botName: string;
27
- botToken: string;
28
- reconnectStaleMs?: number;
29
- reconnectCheckIntervalMs?: number;
30
- }
31
-
32
- function clampDiscordContent(text: string): string {
33
- if (text.length <= DISCORD_MAX_CONTENT_LENGTH) {
34
- return text;
35
- }
36
-
37
- const suffix = "\n...(truncated)";
38
- const budget = DISCORD_MAX_CONTENT_LENGTH - suffix.length;
39
- if (budget <= 0) {
40
- return text.slice(0, DISCORD_MAX_CONTENT_LENGTH);
41
- }
42
-
43
- return `${text.slice(0, budget)}${suffix}`;
44
- }
45
-
46
- function isRecord(value: unknown): value is Record<string, unknown> {
47
- return Boolean(value) && typeof value === "object";
48
- }
49
-
50
- export class DiscordConnector implements ConnectorPlugin {
51
- readonly id: string;
52
- readonly platform = "discord" as const;
53
- readonly name = "discord";
54
- readonly capabilities: ConnectorCapabilities = {
55
- updateStrategy: "edit",
56
- supportedSources: ["channel"],
57
- supportsThread: true,
58
- supportsTyping: true,
59
- supportsFileUpload: true,
60
- maxTextLength: DISCORD_MAX_CONTENT_LENGTH,
61
- };
62
-
63
- private client: Client | null = null;
64
- private ctx: ConnectorContext | null = null;
65
- private botUserId: string | null = null;
66
- private botToken: string | null = null;
67
- private reconnectWatchdog: NodeJS.Timeout | null = null;
68
- private reconnectInFlight = false;
69
- private lastHealthyAtMs = 0;
70
- private stopped = false;
71
-
72
- constructor(
73
- id: string,
74
- private readonly config: DiscordConnectorConfig,
75
- private readonly attachmentsRoot: string,
76
- private readonly logger: GatewayLogger,
77
- ) {
78
- this.id = id;
79
- }
80
-
81
- async start(ctx: ConnectorContext): Promise<void> {
82
- if (this.client) {
83
- this.logger.warn({ connectorId: this.id }, "Discord connector start called while already started");
84
- return;
85
- }
86
-
87
- const token = this.config.botToken.trim();
88
- if (!token) {
89
- throw new Error("Discord bot token is empty");
90
- }
91
-
92
- this.ctx = ctx;
93
- this.botToken = token;
94
- this.stopped = false;
95
- this.lastHealthyAtMs = Date.now();
96
-
97
- this.client = this.createClient();
98
- this.bindClientEventHandlers(this.client);
99
- await this.client.login(token);
100
- this.startReconnectWatchdog();
101
- }
102
-
103
- async send(message: OutboundEnvelope): Promise<ConnectorSendResult> {
104
- if (!this.client) {
105
- throw new Error("Discord connector is not started");
106
- }
107
-
108
- const channel = await this.fetchTextChannel(message.chatId);
109
- const content = clampDiscordContent(message.text);
110
- if (content !== message.text) {
111
- this.logger.warn(
112
- {
113
- originalLength: message.text.length,
114
- truncatedLength: content.length,
115
- mode: message.mode,
116
- chatId: message.chatId,
117
- },
118
- "Outbound Discord message exceeded 2000 characters and was truncated",
119
- );
120
- }
121
-
122
- if (message.mode === "update") {
123
- if (!message.targetMessageId) {
124
- throw new Error("targetMessageId is required for update mode");
125
- }
126
-
127
- const existing = await channel.messages.fetch(message.targetMessageId);
128
- const edited = await existing.edit({ content });
129
- return { messageId: edited.id };
130
- }
131
-
132
- const options: MessageCreateOptions = {
133
- content,
134
- };
135
-
136
- if (message.replyToMessageId) {
137
- options.reply = { messageReference: message.replyToMessageId, failIfNotExists: false };
138
- }
139
-
140
- if (message.attachments && message.attachments.length > 0) {
141
- options.files = message.attachments.map((attachment) =>
142
- attachment.title
143
- ? new AttachmentBuilder(attachment.localPath, { name: attachment.title })
144
- : new AttachmentBuilder(attachment.localPath),
145
- );
146
- }
147
-
148
- const sent = await channel.send(options);
149
- return { messageId: sent.id };
150
- }
151
-
152
- async sendTyping(message: ConnectorTypingEnvelope): Promise<void> {
153
- if (!this.client) {
154
- throw new Error("Discord connector is not started");
155
- }
156
-
157
- const channel = await this.fetchTextChannel(message.chatId);
158
- await channel.sendTyping();
159
- }
160
-
161
- async stop(): Promise<void> {
162
- this.stopped = true;
163
- this.stopReconnectWatchdog();
164
- this.reconnectInFlight = false;
165
- if (!this.client) return;
166
-
167
- const client = this.client;
168
- this.client = null;
169
- client.removeAllListeners();
170
- client.destroy();
171
- this.ctx = null;
172
- this.botUserId = null;
173
- this.botToken = null;
174
- this.lastHealthyAtMs = 0;
175
- }
176
-
177
- private createClient(): Client {
178
- return new Client({
179
- intents: [
180
- GatewayIntentBits.Guilds,
181
- GatewayIntentBits.GuildMessages,
182
- GatewayIntentBits.MessageContent,
183
- GatewayIntentBits.DirectMessages,
184
- ],
185
- partials: [Partials.Channel, Partials.Message],
186
- });
187
- }
188
-
189
- private bindClientEventHandlers(client: Client): void {
190
- client.once("clientReady", () => {
191
- if (client !== this.client || !client.user) return;
192
- this.botUserId = client.user.id;
193
- this.lastHealthyAtMs = Date.now();
194
- this.logger.info(
195
- {
196
- userId: this.botUserId,
197
- userName: client.user.username,
198
- configuredBotName: this.config.botName,
199
- },
200
- "Discord connector ready",
201
- );
202
- });
203
-
204
- client.on("shardDisconnect", (event, shardId) => {
205
- if (client !== this.client) return;
206
- this.logger.warn(
207
- {
208
- shardId,
209
- reconnecting: client.ws.shards.get(shardId)?.status === 5,
210
- ...this.parseCloseEvent(event),
211
- },
212
- "Discord shard disconnected",
213
- );
214
- });
215
-
216
- client.on("shardReconnecting", (shardId) => {
217
- if (client !== this.client) return;
218
- this.logger.warn({ shardId }, "Discord shard reconnecting");
219
- });
220
-
221
- client.on("shardResume", (shardId, replayedEvents) => {
222
- if (client !== this.client) return;
223
- this.lastHealthyAtMs = Date.now();
224
- this.logger.info({ shardId, replayedEvents }, "Discord shard resumed");
225
- });
226
-
227
- client.on("error", (error) => {
228
- if (client !== this.client) return;
229
- this.logger.warn({ err: error }, "Discord client error");
230
- });
231
-
232
- client.on("shardError", (error, shardId) => {
233
- if (client !== this.client) return;
234
- this.logger.warn({ err: error, shardId }, "Discord shard error");
235
- });
236
-
237
- client.on("invalidated", () => {
238
- if (client !== this.client) return;
239
- this.logger.error("Discord session invalidated; forcing reconnect");
240
- void this.forceReconnect("session_invalidated");
241
- });
242
-
243
- client.on("messageCreate", async (message: Message) => {
244
- if (client !== this.client || !client.user || !this.ctx || !this.botUserId) return;
245
-
246
- if (message.author.bot) return;
247
-
248
- const sourceId = message.channel.isThread() && message.channel.parentId ? message.channel.parentId : message.channelId;
249
-
250
- const inbound = await mapDiscordMessage(
251
- message,
252
- this.id,
253
- this.botUserId,
254
- sourceId,
255
- this.attachmentsRoot,
256
- this.logger,
257
- );
258
- if (!inbound) return;
259
-
260
- await this.ctx.emitInbound(inbound);
261
- });
262
- }
263
-
264
- private startReconnectWatchdog(): void {
265
- if (this.reconnectWatchdog) return;
266
- const intervalMs = this.config.reconnectCheckIntervalMs ?? DEFAULT_RECONNECT_CHECK_INTERVAL_MS;
267
- this.reconnectWatchdog = setInterval(() => {
268
- void this.ensureConnected();
269
- }, intervalMs);
270
- }
271
-
272
- private stopReconnectWatchdog(): void {
273
- if (!this.reconnectWatchdog) return;
274
- clearInterval(this.reconnectWatchdog);
275
- this.reconnectWatchdog = null;
276
- }
277
-
278
- private async ensureConnected(): Promise<void> {
279
- const client = this.client;
280
- if (!client || this.stopped || this.reconnectInFlight) return;
281
-
282
- if (client.isReady()) {
283
- this.lastHealthyAtMs = Date.now();
284
- return;
285
- }
286
-
287
- const staleMs = Date.now() - this.lastHealthyAtMs;
288
- const thresholdMs = this.config.reconnectStaleMs ?? DEFAULT_RECONNECT_STALE_MS;
289
- if (staleMs < thresholdMs) {
290
- return;
291
- }
292
-
293
- this.logger.warn({ staleMs, thresholdMs }, "Discord connector remained not-ready for too long; forcing reconnect");
294
- await this.forceReconnect("watchdog_not_ready");
295
- }
296
-
297
- private async forceReconnect(reason: string): Promise<void> {
298
- if (this.stopped || this.reconnectInFlight || !this.botToken) {
299
- return;
300
- }
301
-
302
- this.reconnectInFlight = true;
303
- const previousClient = this.client;
304
-
305
- try {
306
- if (previousClient) {
307
- previousClient.removeAllListeners();
308
- previousClient.destroy();
309
- }
310
-
311
- this.botUserId = null;
312
- this.lastHealthyAtMs = Date.now();
313
-
314
- const nextClient = this.createClient();
315
- this.client = nextClient;
316
- this.bindClientEventHandlers(nextClient);
317
- await nextClient.login(this.botToken);
318
- this.logger.info({ reason }, "Discord reconnect login submitted");
319
- } catch (error) {
320
- this.logger.error({ err: error, reason }, "Failed to force Discord reconnect");
321
- } finally {
322
- this.reconnectInFlight = false;
323
- }
324
- }
325
-
326
- private parseCloseEvent(event: unknown): Record<string, unknown> {
327
- if (!isRecord(event)) return {};
328
- const result: Record<string, unknown> = {};
329
- if (typeof event.code === "number") result.code = event.code;
330
- if (typeof event.reason === "string" && event.reason.length > 0) result.reason = event.reason;
331
- if (typeof event.wasClean === "boolean") result.wasClean = event.wasClean;
332
- return result;
333
- }
334
-
335
- private async fetchTextChannel(channelId: string): Promise<SendableChannels> {
336
- if (!this.client) throw new Error("Discord connector is not started");
337
-
338
- const channel = await this.client.channels.fetch(channelId);
339
- if (!channel || !channel.isSendable()) {
340
- throw new Error(`Discord channel '${channelId}' is not text-based`);
341
- }
342
-
343
- return channel;
344
- }
345
- }
@@ -1,21 +0,0 @@
1
- import { z } from "zod";
2
- import type { ConnectorContributionModule } from "@dobby.ai/plugin-sdk";
3
- import { DiscordConnector, type DiscordConnectorConfig } from "./connector.js";
4
-
5
- const discordConnectorConfigSchema = z.object({
6
- botName: z.string().min(1),
7
- botToken: z.string().min(1),
8
- reconnectStaleMs: z.number().int().positive().default(60_000),
9
- reconnectCheckIntervalMs: z.number().int().positive().default(10_000),
10
- });
11
-
12
- export const connectorDiscordContribution: ConnectorContributionModule = {
13
- kind: "connector",
14
- configSchema: z.toJSONSchema(discordConnectorConfigSchema),
15
- createInstance(options) {
16
- const config = discordConnectorConfigSchema.parse(options.config) as DiscordConnectorConfig;
17
- return new DiscordConnector(options.instanceId, config, options.attachmentsRoot, options.host.logger);
18
- },
19
- };
20
-
21
- export default connectorDiscordContribution;
@@ -1,101 +0,0 @@
1
- import { mkdir, writeFile } from "node:fs/promises";
2
- import { dirname, join } from "node:path";
3
- import type { Message } from "discord.js";
4
- import type { GatewayLogger, InboundAttachment, InboundEnvelope } from "@dobby.ai/plugin-sdk";
5
-
6
- function stripBotMention(text: string, botUserId: string): string {
7
- const mentionRegex = new RegExp(`<@!?${botUserId}>`, "g");
8
- return text.replace(mentionRegex, "").trim();
9
- }
10
-
11
- function sanitizeFileName(value: string): string {
12
- return value.replaceAll(/[^a-zA-Z0-9._-]/g, "_");
13
- }
14
-
15
- async function downloadAttachment(url: string, targetPath: string): Promise<void> {
16
- const response = await fetch(url);
17
- if (!response.ok) {
18
- throw new Error(`Failed to download attachment from ${url}: ${response.status}`);
19
- }
20
-
21
- const data = await response.arrayBuffer();
22
- await mkdir(dirname(targetPath), { recursive: true });
23
- await writeFile(targetPath, Buffer.from(data));
24
- }
25
-
26
- function mapAttachmentBase(messageAttachment: {
27
- id: string;
28
- name: string | null;
29
- contentType: string | null;
30
- size: number;
31
- url: string;
32
- }): InboundAttachment {
33
- return {
34
- id: messageAttachment.id,
35
- size: messageAttachment.size,
36
- remoteUrl: messageAttachment.url,
37
- ...(messageAttachment.name ? { fileName: messageAttachment.name } : {}),
38
- ...(messageAttachment.contentType ? { mimeType: messageAttachment.contentType } : {}),
39
- };
40
- }
41
-
42
- export async function mapDiscordMessage(
43
- message: Message,
44
- connectorId: string,
45
- botUserId: string,
46
- sourceId: string,
47
- attachmentsRoot: string,
48
- logger: GatewayLogger,
49
- ): Promise<InboundEnvelope | null> {
50
- if (message.author.bot) return null;
51
-
52
- const isDirectMessage = message.guildId == null;
53
- const mentionedBot = message.mentions.users.has(botUserId);
54
-
55
- const chatId = message.channelId;
56
- const threadId = message.channel.isThread() ? message.channelId : undefined;
57
-
58
- const cleanedText = stripBotMention(message.content ?? "", botUserId);
59
-
60
- const attachments: InboundAttachment[] = [];
61
-
62
- for (const attachment of message.attachments.values()) {
63
- const base = mapAttachmentBase(attachment);
64
- const attachmentDir = join(attachmentsRoot, sourceId, message.id);
65
- const fileName = sanitizeFileName(attachment.name ?? attachment.id);
66
- const localPath = join(attachmentDir, fileName);
67
-
68
- try {
69
- await downloadAttachment(attachment.url, localPath);
70
- attachments.push({
71
- ...base,
72
- localPath,
73
- });
74
- } catch (error) {
75
- logger.warn({ err: error, attachmentUrl: attachment.url }, "Failed to download Discord attachment; keeping metadata only");
76
- attachments.push(base);
77
- }
78
- }
79
-
80
- return {
81
- connectorId,
82
- platform: "discord",
83
- accountId: botUserId,
84
- source: {
85
- type: "channel",
86
- id: sourceId,
87
- },
88
- chatId,
89
- messageId: message.id,
90
- userId: message.author.id,
91
- userName: message.author.username,
92
- text: cleanedText,
93
- attachments,
94
- timestampMs: message.createdTimestamp,
95
- raw: message.toJSON(),
96
- isDirectMessage,
97
- mentionedBot,
98
- ...(message.guildId ? { guildId: message.guildId } : {}),
99
- ...(threadId ? { threadId } : {}),
100
- };
101
- }
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "outDir": "./dist",
7
- "rootDir": "./src",
8
- "types": ["node"],
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "skipLibCheck": true,
13
- "noUncheckedIndexedAccess": true,
14
- "exactOptionalPropertyTypes": true,
15
- "resolveJsonModule": true
16
- },
17
- "include": ["src/**/*.ts"],
18
- "exclude": ["dist", "node_modules"]
19
- }
@@ -1,18 +0,0 @@
1
- {
2
- "apiVersion": "1.0",
3
- "name": "@dobby.ai/connector-feishu",
4
- "version": "0.1.0",
5
- "contributions": [
6
- {
7
- "id": "connector.feishu",
8
- "kind": "connector",
9
- "entry": "./dist/contribution.js",
10
- "capabilities": {
11
- "updateStrategy": "edit",
12
- "supportsThread": true,
13
- "supportsTyping": false,
14
- "supportsFileUpload": false
15
- }
16
- }
17
- ]
18
- }
@@ -1 +0,0 @@
1
- export { connectorFeishuContribution as contribution, connectorFeishuContribution as default } from "./dist/contribution.js";