volute 0.26.0 → 0.28.0
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/README.md +18 -18
- package/dist/accept-666DIZX2.js +41 -0
- package/dist/{activity-events-ZMBAKLUF.js → activity-events-BBIEA2F4.js} +2 -3
- package/dist/api.d.ts +510 -299
- package/dist/{archive-4ZQYK5MN.js → archive-UA4BDFXQ.js} +2 -2
- package/dist/bridge-FQHZL3MC.js +206 -0
- package/dist/chat-M4SX42JD.js +68 -0
- package/dist/{chunk-PHU4DEAJ.js → chunk-2WPW7OT6.js} +3 -3
- package/dist/{chunk-5Y3PBKW6.js → chunk-2YP2TVDT.js} +138 -56
- package/dist/{chunk-3CFRE2VC.js → chunk-AAPXKR5V.js} +435 -1090
- package/dist/{chunk-YJA7P64S.js → chunk-AW7PFDVN.js} +5 -5
- package/dist/{chunk-OZFKBXD6.js → chunk-EHYDTZTF.js} +6 -6
- package/dist/{chunk-WBHMQ5OZ.js → chunk-H7OZRFJB.js} +192 -12
- package/dist/{chunk-ON3FF5JA.js → chunk-HDN7MNGD.js} +3 -3
- package/dist/chunk-IAYBDWVG.js +477 -0
- package/dist/{chunk-TZKJLDQN.js → chunk-IKRVFPWU.js} +14 -9
- package/dist/{chunk-UTL75LP6.js → chunk-J4IBNXGJ.js} +20 -22
- package/dist/{chunk-WGOGUMPO.js → chunk-JGFVMROS.js} +13 -6
- package/dist/{chunk-NWI2425I.js → chunk-K5NAC55T.js} +1 -1
- package/dist/chunk-KTLFDYPT.js +61 -0
- package/dist/{chunk-V63B7DX3.js → chunk-LAC664WU.js} +7 -4
- package/dist/chunk-MD4C26II.js +128 -0
- package/dist/{chunk-USNBKHYG.js → chunk-NI5FFCCS.js} +12 -7
- package/dist/{chunk-3TV4GLFO.js → chunk-P72MVS4R.js} +4 -43
- package/dist/{chunk-2VO7453N.js → chunk-POSXWWTA.js} +30 -54
- package/dist/{chunk-XOXLRRR2.js → chunk-RKQEHRBB.js} +4 -3
- package/dist/{chunk-LX22GRG7.js → chunk-SGVNFZHW.js} +11 -8
- package/dist/chunk-T6HKBWXZ.js +23 -0
- package/dist/{chunk-J2CO4WEV.js → chunk-VIVMW2H2.js} +4 -4
- package/dist/{chunk-KTJGZ7M7.js → chunk-XBLSAVJF.js} +1 -1
- package/dist/cli.js +32 -49
- package/dist/{cloud-sync-NI2K3C7G.js → cloud-sync-HDL6PHZI.js} +14 -14
- package/dist/connectors/discord-bridge.js +158 -0
- package/dist/connectors/slack-bridge.js +119 -0
- package/dist/connectors/telegram-bridge.js +133 -0
- package/dist/conversations-M2K4253F.js +55 -0
- package/dist/create-D7J73A6H.js +45 -0
- package/dist/{create-4YBRTTJS.js → create-QWV73WXD.js} +1 -1
- package/dist/{daemon-client-Z7FAJ6JW.js → daemon-client-I42FK2BF.js} +2 -2
- package/dist/{daemon-restart-BJZ3O4U4.js → daemon-restart-G4B2OYAB.js} +7 -7
- package/dist/daemon.js +1889 -1216
- package/dist/db-IC4J52XQ.js +8 -0
- package/dist/{delete-27OYNK25.js → delete-4JYGD4VN.js} +1 -1
- package/dist/down-LVBXEULC.js +14 -0
- package/dist/{env-M336ONDP.js → env-YJMUMFIY.js} +2 -2
- package/dist/{export-HP4G5DQC.js → export-BOJQWBMA.js} +4 -4
- package/dist/files-M546TKVN.js +46 -0
- package/dist/{history-B64GTFTD.js → history-ALPTNB3I.js} +5 -5
- package/dist/{import-XIB7UV4S.js → import-SRTQXBGH.js} +4 -4
- package/dist/join-J4QU42DL.js +66 -0
- package/dist/list-R73GENNL.js +40 -0
- package/dist/{login-B5E7N7MY.js → login-3QZNR2DF.js} +4 -4
- package/dist/{login-6U7U6BNG.js → login-BKP3AFWN.js} +8 -18
- package/dist/logout-IQK7FNEK.js +20 -0
- package/dist/{logout-XSJRYS3U.js → logout-T53VKCPU.js} +4 -4
- package/dist/message-delivery-HV3S6HZV.js +24 -0
- package/dist/migrate-registry-to-db-XC7T5B7P.js +110 -0
- package/dist/{mind-HZ3QSDDJ.js → mind-S5V6CK5W.js} +29 -34
- package/dist/{mind-activity-tracker-4G6FURY2.js → mind-activity-tracker-EN6XNXPF.js} +3 -4
- package/dist/mind-list-UPJ75GPI.js +29 -0
- package/dist/mind-manager-S6ILZVX3.js +18 -0
- package/dist/{mind-sleep-DTV7L44D.js → mind-sleep-BTSWQNAC.js} +4 -4
- package/dist/mind-status-TK5AETEM.js +55 -0
- package/dist/{mind-wake-PFN4FN3T.js → mind-wake-SBAKIDVP.js} +4 -4
- package/dist/{notes-37FW2UR2.js → notes-XCER3I7M.js} +11 -21
- package/dist/{package-VZWLXPHV.js → package-CG4RWUGP.js} +1 -1
- package/dist/{pages-DIIT5HMQ.js → pages-KJDJX4TA.js} +5 -5
- package/dist/{publish-HQV7YREB.js → publish-ZZB33WP4.js} +9 -20
- package/dist/read-36UFXN3G.js +46 -0
- package/dist/{register-EFND67FQ.js → register-CHREOMJ3.js} +6 -25
- package/dist/{registry-D2BSQ2X5.js → registry-NDNOOYG4.js} +15 -9
- package/dist/reject-LXIZFJ4Q.js +39 -0
- package/dist/{restart-CCK7D6TV.js → restart-6ESL3NBO.js} +5 -5
- package/dist/{sandbox-EHGFF52K.js → sandbox-5BW5HPXM.js} +3 -3
- package/dist/{schedule-6F7ELB2M.js → schedule-QTJMFATP.js} +5 -5
- package/dist/{seed-E5OQGWX3.js → seed-SSUCYYDF.js} +2 -2
- package/dist/{send-IH6XZKPC.js → send-TAOEZ4NH.js} +87 -23
- package/dist/{setup-YGAAIKKZ.js → setup-JHL5ZEST.js} +2 -2
- package/dist/{setup-F6TWFYGQ.js → setup-RXYVGGT7.js} +9 -9
- package/dist/{skill-42LGFBQC.js → skill-AUAQTSP5.js} +5 -5
- package/dist/skills/dreaming/references/INSTALL.md +2 -2
- package/dist/skills/orientation/SKILL.md +3 -3
- package/dist/skills/shared-files/SKILL.md +44 -0
- package/dist/skills/shared-files/scripts/merge.ts +72 -0
- package/dist/skills/shared-files/scripts/pull.ts +52 -0
- package/dist/skills/volute-mind/SKILL.md +35 -34
- package/dist/sleep-manager-WMVG2VCL.js +28 -0
- package/dist/split-TKJ5OT3P.js +63 -0
- package/dist/{sprout-QL74KR2X.js → sprout-UNT7LKKE.js} +6 -7
- package/dist/{start-O5JQASRC.js → start-EUJSS5R4.js} +2 -2
- package/dist/status-NQJYR4BG.js +114 -0
- package/dist/{status-LV34BG6G.js → status-S7UUPNRW.js} +4 -14
- package/dist/{stop-2SOG5NYF.js → stop-3XAITBBF.js} +5 -5
- package/dist/systems-SMEFSHTA.js +60 -0
- package/dist/{tailscale-AJ4VL5XK.js → tailscale-NY5MUMY3.js} +1 -1
- package/dist/up-GM2JOH2Y.js +17 -0
- package/dist/{update-5VUDAI3D.js → update-PTSH22AZ.js} +9 -9
- package/dist/{update-check-F5Z3ALXX.js → update-check-64FWC4Y2.js} +2 -2
- package/dist/{upgrade-QCCO33BK.js → upgrade-HA47CS4C.js} +12 -5
- package/dist/variant-7TGZHOU3.js +41 -0
- package/dist/{version-notify-USFZBWMG.js → version-notify-JDUF4HQJ.js} +24 -29
- package/dist/web-assets/assets/index-BZGvToHi.css +1 -0
- package/dist/web-assets/assets/index-Cz4TrpzB.js +75 -0
- package/dist/web-assets/favicon.png +0 -0
- package/dist/web-assets/index.html +2 -2
- package/drizzle/0017_minds.sql +16 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
- package/templates/_base/.init/.config/prompts.json +2 -2
- package/templates/_base/home/VOLUTE.md +5 -5
- package/templates/_base/src/lib/logger.ts +0 -4
- package/templates/_base/src/lib/startup.ts +2 -2
- package/dist/auth-4TV573WE.js +0 -37
- package/dist/channel-ZVZV42UD.js +0 -260
- package/dist/chunk-B2CPS4QU.js +0 -283
- package/dist/chunk-HFCBO2GL.js +0 -50
- package/dist/chunk-RWKVSSLY.js +0 -26
- package/dist/chunk-SIAG3QMM.js +0 -42
- package/dist/chunk-WSLPZF72.js +0 -173
- package/dist/connector-G722WXAU.js +0 -147
- package/dist/connectors/discord.js +0 -177
- package/dist/connectors/slack.js +0 -181
- package/dist/connectors/telegram.js +0 -187
- package/dist/down-7UKFMJJZ.js +0 -14
- package/dist/file-HUDKTRAS.js +0 -204
- package/dist/log-PBFNILJ4.js +0 -39
- package/dist/logout-UKD5LA37.js +0 -18
- package/dist/logs-3CART7O7.js +0 -77
- package/dist/merge-VK2HSKMA.js +0 -46
- package/dist/message-delivery-MS5JYPZX.js +0 -25
- package/dist/mind-manager-VVK67AY3.js +0 -19
- package/dist/pull-2MB4SK3C.js +0 -39
- package/dist/service-LLBV3R7M.js +0 -122
- package/dist/shared-UMO4S7CC.js +0 -39
- package/dist/sleep-manager-EE4NRN2Q.js +0 -29
- package/dist/status-FZBEBM7Q.js +0 -70
- package/dist/status-WXD4HXRL.js +0 -35
- package/dist/up-SDMCSVI3.js +0 -17
- package/dist/variant-WWLDY6D5.js +0 -207
- package/dist/web-assets/assets/index-CUQ31ieL.js +0 -69
- package/dist/web-assets/assets/index-CW8NSl1o.css +0 -1
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
promptLine
|
|
4
|
-
} from "./chunk-SSI47XP2.js";
|
|
5
|
-
import {
|
|
6
|
-
daemonFetch
|
|
7
|
-
} from "./chunk-WGOGUMPO.js";
|
|
8
|
-
import {
|
|
9
|
-
getClient,
|
|
10
|
-
urlOf
|
|
11
|
-
} from "./chunk-4RQBJWQX.js";
|
|
12
|
-
import {
|
|
13
|
-
resolveMindName
|
|
14
|
-
} from "./chunk-NAOW2CLO.js";
|
|
15
|
-
import {
|
|
16
|
-
parseArgs
|
|
17
|
-
} from "./chunk-D424ZQGI.js";
|
|
18
|
-
import "./chunk-B2CPS4QU.js";
|
|
19
|
-
import "./chunk-K3NQKI34.js";
|
|
20
|
-
|
|
21
|
-
// src/commands/connector.ts
|
|
22
|
-
async function run(args) {
|
|
23
|
-
const subcommand = args[0];
|
|
24
|
-
switch (subcommand) {
|
|
25
|
-
case "connect":
|
|
26
|
-
await connectConnector(args.slice(1));
|
|
27
|
-
break;
|
|
28
|
-
case "disconnect":
|
|
29
|
-
await disconnectConnector(args.slice(1));
|
|
30
|
-
break;
|
|
31
|
-
case "--help":
|
|
32
|
-
case "-h":
|
|
33
|
-
case void 0:
|
|
34
|
-
printUsage();
|
|
35
|
-
break;
|
|
36
|
-
default:
|
|
37
|
-
printUsage();
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function printUsage() {
|
|
42
|
-
console.log(`Usage:
|
|
43
|
-
volute mind connect <type> [--mind <name>]
|
|
44
|
-
volute mind disconnect <type> [--mind <name>]`);
|
|
45
|
-
}
|
|
46
|
-
async function connectConnector(args) {
|
|
47
|
-
const { positional, flags } = parseArgs(args, {
|
|
48
|
-
mind: { type: "string" }
|
|
49
|
-
});
|
|
50
|
-
const mindName = resolveMindName(flags);
|
|
51
|
-
const type = positional[0];
|
|
52
|
-
if (!type) {
|
|
53
|
-
console.error("Usage: volute mind connect <type> [--mind <name>]");
|
|
54
|
-
process.exit(1);
|
|
55
|
-
}
|
|
56
|
-
const client = getClient();
|
|
57
|
-
const connectorUrl = urlOf(
|
|
58
|
-
client.api.minds[":name"].connectors[":type"].$url({
|
|
59
|
-
param: { name: mindName, type }
|
|
60
|
-
})
|
|
61
|
-
);
|
|
62
|
-
let res = await daemonFetch(connectorUrl, { method: "POST" });
|
|
63
|
-
if (!res.ok) {
|
|
64
|
-
const body = await res.json().catch(() => ({ error: "Unknown error" }));
|
|
65
|
-
if (body.error === "missing_env" && "missing" in body) {
|
|
66
|
-
const { missing, connectorName } = body;
|
|
67
|
-
if (!process.stdin.isTTY) {
|
|
68
|
-
console.error(`Missing required environment variables for ${connectorName}:`);
|
|
69
|
-
for (const v of missing) {
|
|
70
|
-
console.error(` ${v.name} \u2014 ${v.description}`);
|
|
71
|
-
}
|
|
72
|
-
console.error(`
|
|
73
|
-
Set them with: volute env set <KEY> --mind ${mindName}`);
|
|
74
|
-
process.exit(1);
|
|
75
|
-
}
|
|
76
|
-
console.error(`${connectorName} connector requires some environment variables.
|
|
77
|
-
`);
|
|
78
|
-
for (const v of missing) {
|
|
79
|
-
const value = await promptLine(`${v.description}
|
|
80
|
-
Enter value for ${v.name}: `);
|
|
81
|
-
if (!value) {
|
|
82
|
-
console.error(`No value provided for ${v.name}. Aborting.`);
|
|
83
|
-
process.exit(1);
|
|
84
|
-
}
|
|
85
|
-
const envRes = await daemonFetch(
|
|
86
|
-
urlOf(
|
|
87
|
-
client.api.minds[":name"].env[":key"].$url({
|
|
88
|
-
param: { name: mindName, key: v.name }
|
|
89
|
-
})
|
|
90
|
-
),
|
|
91
|
-
{
|
|
92
|
-
method: "PUT",
|
|
93
|
-
headers: { "Content-Type": "application/json" },
|
|
94
|
-
body: JSON.stringify({ value })
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
if (!envRes.ok) {
|
|
98
|
-
const errBody = await envRes.json().catch(() => ({}));
|
|
99
|
-
console.error(`Failed to set ${v.name}: ${errBody.error ?? `HTTP ${envRes.status}`}`);
|
|
100
|
-
process.exit(1);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
console.log("Environment variables saved.\n");
|
|
104
|
-
res = await daemonFetch(connectorUrl, { method: "POST" });
|
|
105
|
-
if (!res.ok) {
|
|
106
|
-
const retryBody = await res.json().catch(() => ({ error: "Unknown error" }));
|
|
107
|
-
console.error(
|
|
108
|
-
`Failed to start ${type} connector: ${retryBody.error}`
|
|
109
|
-
);
|
|
110
|
-
process.exit(1);
|
|
111
|
-
}
|
|
112
|
-
} else {
|
|
113
|
-
console.error(`Failed to start ${type} connector: ${body.error}`);
|
|
114
|
-
process.exit(1);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
console.log(`${type} connector for ${mindName} started.`);
|
|
118
|
-
}
|
|
119
|
-
async function disconnectConnector(args) {
|
|
120
|
-
const { positional, flags } = parseArgs(args, {
|
|
121
|
-
mind: { type: "string" }
|
|
122
|
-
});
|
|
123
|
-
const mindName = resolveMindName(flags);
|
|
124
|
-
const type = positional[0];
|
|
125
|
-
if (!type) {
|
|
126
|
-
console.error("Usage: volute mind disconnect <type> [--mind <name>]");
|
|
127
|
-
process.exit(1);
|
|
128
|
-
}
|
|
129
|
-
const client = getClient();
|
|
130
|
-
const res = await daemonFetch(
|
|
131
|
-
urlOf(
|
|
132
|
-
client.api.minds[":name"].connectors[":type"].$url({
|
|
133
|
-
param: { name: mindName, type }
|
|
134
|
-
})
|
|
135
|
-
),
|
|
136
|
-
{ method: "DELETE" }
|
|
137
|
-
);
|
|
138
|
-
if (!res.ok) {
|
|
139
|
-
const body = await res.json().catch(() => ({ error: "Unknown error" }));
|
|
140
|
-
console.error(`Failed to stop ${type} connector: ${body.error}`);
|
|
141
|
-
process.exit(1);
|
|
142
|
-
}
|
|
143
|
-
console.log(`${type} connector for ${mindName} stopped.`);
|
|
144
|
-
}
|
|
145
|
-
export {
|
|
146
|
-
run
|
|
147
|
-
};
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
buildChannelSlug,
|
|
4
|
-
loadEnv,
|
|
5
|
-
loadFollowedChannels,
|
|
6
|
-
reportTyping,
|
|
7
|
-
sendToMind,
|
|
8
|
-
slugify,
|
|
9
|
-
writeChannelEntry
|
|
10
|
-
} from "../chunk-WSLPZF72.js";
|
|
11
|
-
import "../chunk-B2CPS4QU.js";
|
|
12
|
-
import "../chunk-K3NQKI34.js";
|
|
13
|
-
|
|
14
|
-
// src/connectors/discord.ts
|
|
15
|
-
import { ChannelType, Client, Events, GatewayIntentBits, Partials } from "discord.js";
|
|
16
|
-
var TYPING_INTERVAL_MS = 8e3;
|
|
17
|
-
var env = loadEnv();
|
|
18
|
-
var token = process.env.DISCORD_TOKEN;
|
|
19
|
-
if (!token) {
|
|
20
|
-
console.error("Missing required env var: DISCORD_TOKEN");
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
var followedChannelNames = loadFollowedChannels(env, "discord");
|
|
24
|
-
var followedChannelIds = /* @__PURE__ */ new Set();
|
|
25
|
-
var client = new Client({
|
|
26
|
-
intents: [
|
|
27
|
-
GatewayIntentBits.Guilds,
|
|
28
|
-
GatewayIntentBits.GuildMessages,
|
|
29
|
-
GatewayIntentBits.MessageContent,
|
|
30
|
-
GatewayIntentBits.DirectMessages,
|
|
31
|
-
GatewayIntentBits.GuildMessageTyping,
|
|
32
|
-
GatewayIntentBits.DirectMessageTyping
|
|
33
|
-
],
|
|
34
|
-
partials: [Partials.Channel]
|
|
35
|
-
});
|
|
36
|
-
function shutdown() {
|
|
37
|
-
client.destroy();
|
|
38
|
-
process.exit(0);
|
|
39
|
-
}
|
|
40
|
-
process.on("SIGINT", shutdown);
|
|
41
|
-
process.on("SIGTERM", shutdown);
|
|
42
|
-
client.once(Events.ClientReady, (c) => {
|
|
43
|
-
console.log(`Connected to Discord as ${c.user.tag}`);
|
|
44
|
-
console.log(`Bridging to mind: ${env.mindName} via ${env.baseUrl}/message`);
|
|
45
|
-
if (followedChannelNames.length > 0) {
|
|
46
|
-
for (const guild of c.guilds.cache.values()) {
|
|
47
|
-
for (const ch of guild.channels.cache.values()) {
|
|
48
|
-
if (ch.type !== ChannelType.GuildText) continue;
|
|
49
|
-
if (followedChannelNames.includes(ch.name)) {
|
|
50
|
-
followedChannelIds.add(ch.id);
|
|
51
|
-
console.log(`Following #${ch.name} (${ch.id}) in ${guild.name}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (followedChannelIds.size === 0) {
|
|
56
|
-
console.warn(`No channels found matching: ${followedChannelNames.join(", ")}`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
client.on(Events.MessageCreate, async (message) => {
|
|
61
|
-
if (message.author.bot) return;
|
|
62
|
-
const isDM = !message.guild;
|
|
63
|
-
const isMentioned = !isDM && message.mentions.has(client.user);
|
|
64
|
-
const isFollowedChannel = !isDM && followedChannelIds.has(message.channelId);
|
|
65
|
-
if (!isDM && !isMentioned && !isFollowedChannel) return;
|
|
66
|
-
let text = message.content;
|
|
67
|
-
if (isMentioned) {
|
|
68
|
-
text = text.replace(new RegExp(`<@!?${client.user.id}>`, "g"), "").trim();
|
|
69
|
-
}
|
|
70
|
-
const content = [];
|
|
71
|
-
if (text) content.push({ type: "text", text });
|
|
72
|
-
for (const attachment of message.attachments.values()) {
|
|
73
|
-
if (!attachment.contentType?.startsWith("image/")) continue;
|
|
74
|
-
try {
|
|
75
|
-
const res = await fetch(attachment.url);
|
|
76
|
-
const buffer = Buffer.from(await res.arrayBuffer());
|
|
77
|
-
content.push({
|
|
78
|
-
type: "image",
|
|
79
|
-
media_type: attachment.contentType,
|
|
80
|
-
data: buffer.toString("base64")
|
|
81
|
-
});
|
|
82
|
-
} catch (err) {
|
|
83
|
-
console.error(`Failed to download attachment: ${err}`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (content.length === 0) return;
|
|
87
|
-
const senderName = message.author.displayName || message.author.username;
|
|
88
|
-
const channelName = !isDM && "name" in message.channel ? message.channel.name : void 0;
|
|
89
|
-
const channelKey = isDM ? buildChannelSlug("discord", {
|
|
90
|
-
isDM: true,
|
|
91
|
-
recipients: [message.author.username]
|
|
92
|
-
}) : buildChannelSlug("discord", {
|
|
93
|
-
channelName: channelName ?? message.channelId,
|
|
94
|
-
serverName: message.guild?.name
|
|
95
|
-
});
|
|
96
|
-
try {
|
|
97
|
-
writeChannelEntry(env.mindName, channelKey, {
|
|
98
|
-
platformId: message.channelId,
|
|
99
|
-
platform: "discord",
|
|
100
|
-
name: channelName ? `#${channelName}` : void 0,
|
|
101
|
-
server: message.guild?.name,
|
|
102
|
-
type: isDM ? "dm" : "channel"
|
|
103
|
-
});
|
|
104
|
-
} catch (err) {
|
|
105
|
-
console.error(`[discord] failed to write channel entry for ${channelKey}:`, err);
|
|
106
|
-
}
|
|
107
|
-
const participantCount = isDM ? 2 : message.guild?.memberCount;
|
|
108
|
-
const payload = {
|
|
109
|
-
content,
|
|
110
|
-
channel: channelKey,
|
|
111
|
-
sender: senderName,
|
|
112
|
-
platform: "Discord",
|
|
113
|
-
...isDM ? { isDM: true } : {},
|
|
114
|
-
...channelName ? { channelName } : {},
|
|
115
|
-
...message.guild?.name ? { serverName: message.guild.name } : {},
|
|
116
|
-
...participantCount ? { participantCount } : {}
|
|
117
|
-
};
|
|
118
|
-
reportTyping(env, channelKey, senderName, false);
|
|
119
|
-
if (isFollowedChannel && !isMentioned) {
|
|
120
|
-
const result = await sendToMind(env, payload);
|
|
121
|
-
if (!result.ok)
|
|
122
|
-
message.reply(result.error ?? "Failed to process message").catch((err) => {
|
|
123
|
-
console.warn(`[discord] failed to send error reply: ${err}`);
|
|
124
|
-
});
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
await handleDiscordMessage(message, payload);
|
|
128
|
-
});
|
|
129
|
-
client.on(Events.TypingStart, (typing) => {
|
|
130
|
-
if (typing.user.bot) return;
|
|
131
|
-
const sender = typing.user.displayName || typing.user.username || typing.user.id || "unknown";
|
|
132
|
-
const typingChannel = typing.guild ? `discord:${slugify(typing.guild.name)}/${slugify("name" in typing.channel ? String(typing.channel.name) : typing.channel.id)}` : `discord:@${slugify(typing.user.username ?? typing.user.id)}`;
|
|
133
|
-
reportTyping(env, typingChannel, sender, true);
|
|
134
|
-
});
|
|
135
|
-
async function handleDiscordMessage(message, payload) {
|
|
136
|
-
const channel = message.channel;
|
|
137
|
-
if (!("sendTyping" in channel)) return;
|
|
138
|
-
const typingInterval = setInterval(() => {
|
|
139
|
-
channel.sendTyping().catch((err) => {
|
|
140
|
-
console.warn(`[discord] sendTyping failed: ${err}`);
|
|
141
|
-
});
|
|
142
|
-
}, TYPING_INTERVAL_MS);
|
|
143
|
-
channel.sendTyping().catch((err) => {
|
|
144
|
-
console.warn(`[discord] sendTyping failed: ${err}`);
|
|
145
|
-
});
|
|
146
|
-
try {
|
|
147
|
-
const result = await sendToMind(env, payload);
|
|
148
|
-
if (!result.ok)
|
|
149
|
-
message.reply(result.error ?? "Failed to process message").catch((err) => {
|
|
150
|
-
console.warn(`[discord] failed to send error reply: ${err}`);
|
|
151
|
-
});
|
|
152
|
-
} finally {
|
|
153
|
-
clearInterval(typingInterval);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
async function loginWithRetry() {
|
|
157
|
-
try {
|
|
158
|
-
await client.login(token);
|
|
159
|
-
} catch (err) {
|
|
160
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
161
|
-
const match = msg.match(/resets at (.+)/);
|
|
162
|
-
if (match) {
|
|
163
|
-
const resetAt = new Date(match[1]);
|
|
164
|
-
const waitMs = resetAt.getTime() - Date.now();
|
|
165
|
-
if (waitMs > 0) {
|
|
166
|
-
console.error(`Session limit hit, waiting until ${resetAt.toISOString()}...`);
|
|
167
|
-
await new Promise((r) => setTimeout(r, waitMs + 5e3));
|
|
168
|
-
return loginWithRetry();
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
throw err;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
loginWithRetry().catch((err) => {
|
|
175
|
-
console.error("Failed to connect to Discord:", err);
|
|
176
|
-
process.exit(1);
|
|
177
|
-
});
|
package/dist/connectors/slack.js
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
buildChannelSlug,
|
|
4
|
-
loadEnv,
|
|
5
|
-
loadFollowedChannels,
|
|
6
|
-
onShutdown,
|
|
7
|
-
sendToMind,
|
|
8
|
-
writeChannelEntry
|
|
9
|
-
} from "../chunk-WSLPZF72.js";
|
|
10
|
-
import "../chunk-B2CPS4QU.js";
|
|
11
|
-
import "../chunk-K3NQKI34.js";
|
|
12
|
-
|
|
13
|
-
// src/connectors/slack.ts
|
|
14
|
-
import { App } from "@slack/bolt";
|
|
15
|
-
var env = loadEnv();
|
|
16
|
-
var botToken = process.env.SLACK_BOT_TOKEN;
|
|
17
|
-
var appToken = process.env.SLACK_APP_TOKEN;
|
|
18
|
-
if (!botToken || !appToken) {
|
|
19
|
-
console.error("Missing required env vars: SLACK_BOT_TOKEN, SLACK_APP_TOKEN");
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
var followedChannelNames = loadFollowedChannels(env, "slack");
|
|
23
|
-
var followedChannelIds = /* @__PURE__ */ new Set();
|
|
24
|
-
var app = new App({
|
|
25
|
-
token: botToken,
|
|
26
|
-
socketMode: true,
|
|
27
|
-
appToken
|
|
28
|
-
});
|
|
29
|
-
var botUserId;
|
|
30
|
-
var serverName;
|
|
31
|
-
app.message(async ({ message }) => {
|
|
32
|
-
if (message.subtype) return;
|
|
33
|
-
if (!("user" in message) || !("text" in message)) return;
|
|
34
|
-
if ("bot_id" in message && message.bot_id) return;
|
|
35
|
-
const isDM = message.channel_type === "im" || message.channel_type === "mpim";
|
|
36
|
-
const isMentioned = !isDM && botUserId && message.text?.includes(`<@${botUserId}>`);
|
|
37
|
-
const isFollowedChannel = !isDM && followedChannelIds.has(message.channel);
|
|
38
|
-
if (!isDM && !isMentioned && !isFollowedChannel) return;
|
|
39
|
-
let text = message.text ?? "";
|
|
40
|
-
if (isMentioned && botUserId) {
|
|
41
|
-
text = text.replace(new RegExp(`<@${botUserId}>`, "g"), "").trim();
|
|
42
|
-
}
|
|
43
|
-
const content = [];
|
|
44
|
-
if (text) content.push({ type: "text", text });
|
|
45
|
-
if ("files" in message && message.files) {
|
|
46
|
-
for (const file of message.files) {
|
|
47
|
-
if (!file.mimetype?.startsWith("image/") || !file.url_private) continue;
|
|
48
|
-
try {
|
|
49
|
-
const res = await fetch(file.url_private, {
|
|
50
|
-
headers: { Authorization: `Bearer ${botToken}` }
|
|
51
|
-
});
|
|
52
|
-
if (!res.ok) {
|
|
53
|
-
console.error(`Failed to download attachment: HTTP ${res.status}`);
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
const buffer = Buffer.from(await res.arrayBuffer());
|
|
57
|
-
content.push({
|
|
58
|
-
type: "image",
|
|
59
|
-
media_type: file.mimetype,
|
|
60
|
-
data: buffer.toString("base64")
|
|
61
|
-
});
|
|
62
|
-
} catch (err) {
|
|
63
|
-
console.error(`Failed to download attachment: ${err}`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (content.length === 0) return;
|
|
68
|
-
let channelName;
|
|
69
|
-
let numMembers;
|
|
70
|
-
if (message.channel_type !== "im") {
|
|
71
|
-
try {
|
|
72
|
-
const info = await app.client.conversations.info({
|
|
73
|
-
channel: message.channel
|
|
74
|
-
});
|
|
75
|
-
channelName = info.channel?.name;
|
|
76
|
-
numMembers = info.channel?.num_members;
|
|
77
|
-
} catch (err) {
|
|
78
|
-
console.warn(`Failed to get channel info: ${err}`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
let senderName = message.user;
|
|
82
|
-
let senderUsername = message.user;
|
|
83
|
-
try {
|
|
84
|
-
const userInfo = await app.client.users.info({
|
|
85
|
-
user: message.user
|
|
86
|
-
});
|
|
87
|
-
senderName = userInfo.user?.profile?.display_name || userInfo.user?.profile?.real_name || message.user;
|
|
88
|
-
senderUsername = userInfo.user?.name ?? message.user;
|
|
89
|
-
} catch (err) {
|
|
90
|
-
console.warn(`Failed to get user info: ${err}`);
|
|
91
|
-
}
|
|
92
|
-
const channelKey = isDM ? buildChannelSlug("slack", {
|
|
93
|
-
isDM: true,
|
|
94
|
-
senderName: senderUsername
|
|
95
|
-
}) : buildChannelSlug("slack", {
|
|
96
|
-
channelName: channelName ?? message.channel,
|
|
97
|
-
serverName
|
|
98
|
-
});
|
|
99
|
-
try {
|
|
100
|
-
writeChannelEntry(env.mindName, channelKey, {
|
|
101
|
-
platformId: message.channel,
|
|
102
|
-
platform: "slack",
|
|
103
|
-
name: channelName ? `#${channelName}` : void 0,
|
|
104
|
-
server: serverName,
|
|
105
|
-
type: isDM ? "dm" : "channel"
|
|
106
|
-
});
|
|
107
|
-
} catch (err) {
|
|
108
|
-
console.error(`[slack] failed to write channel entry for ${channelKey}:`, err);
|
|
109
|
-
}
|
|
110
|
-
const participantCount = message.channel_type === "im" ? 2 : numMembers;
|
|
111
|
-
const payload = {
|
|
112
|
-
content,
|
|
113
|
-
channel: channelKey,
|
|
114
|
-
sender: senderName,
|
|
115
|
-
platform: "Slack",
|
|
116
|
-
...isDM ? { isDM: true } : {},
|
|
117
|
-
...channelName ? { channelName } : {},
|
|
118
|
-
...serverName ? { serverName } : {},
|
|
119
|
-
...participantCount ? { participantCount } : {}
|
|
120
|
-
};
|
|
121
|
-
if (isFollowedChannel && !isMentioned) {
|
|
122
|
-
const result2 = await sendToMind(env, payload);
|
|
123
|
-
if (!result2.ok)
|
|
124
|
-
app.client.chat.postMessage({
|
|
125
|
-
channel: message.channel,
|
|
126
|
-
text: result2.error ?? "Failed to process message"
|
|
127
|
-
}).catch((err) => {
|
|
128
|
-
console.warn(`[slack] failed to send error reply: ${err}`);
|
|
129
|
-
});
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const result = await sendToMind(env, payload);
|
|
133
|
-
if (!result.ok)
|
|
134
|
-
app.client.chat.postMessage({ channel: message.channel, text: result.error ?? "Failed to process message" }).catch((err) => {
|
|
135
|
-
console.warn(`[slack] failed to send error reply: ${err}`);
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
async function start() {
|
|
139
|
-
await app.start();
|
|
140
|
-
const auth = await app.client.auth.test();
|
|
141
|
-
if (!auth.user_id) {
|
|
142
|
-
throw new Error("auth.test succeeded but returned no user_id");
|
|
143
|
-
}
|
|
144
|
-
botUserId = auth.user_id;
|
|
145
|
-
serverName = auth.team;
|
|
146
|
-
console.log(
|
|
147
|
-
`Connected to Slack as bot user ${botUserId}${serverName ? ` in ${serverName}` : ""}`
|
|
148
|
-
);
|
|
149
|
-
console.log(`Bridging to mind: ${env.mindName} via ${env.baseUrl}/message`);
|
|
150
|
-
if (followedChannelNames.length > 0) {
|
|
151
|
-
try {
|
|
152
|
-
let cursor;
|
|
153
|
-
do {
|
|
154
|
-
const result = await app.client.conversations.list({
|
|
155
|
-
types: "public_channel,private_channel",
|
|
156
|
-
limit: 200,
|
|
157
|
-
...cursor ? { cursor } : {}
|
|
158
|
-
});
|
|
159
|
-
for (const ch of result.channels ?? []) {
|
|
160
|
-
if (followedChannelNames.includes(ch.name)) {
|
|
161
|
-
followedChannelIds.add(ch.id);
|
|
162
|
-
console.log(`Following #${ch.name} (${ch.id})`);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
cursor = result.response_metadata?.next_cursor || void 0;
|
|
166
|
-
} while (cursor);
|
|
167
|
-
} catch (err) {
|
|
168
|
-
console.error(`Failed to resolve channel names: ${err}`);
|
|
169
|
-
}
|
|
170
|
-
if (followedChannelIds.size === 0 && followedChannelNames.length > 0) {
|
|
171
|
-
console.warn(`No channels found matching: ${followedChannelNames.join(", ")}`);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
onShutdown(async () => {
|
|
176
|
-
await app.stop();
|
|
177
|
-
});
|
|
178
|
-
start().catch((err) => {
|
|
179
|
-
console.error("Failed to start Slack connector:", err);
|
|
180
|
-
process.exit(1);
|
|
181
|
-
});
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
buildChannelSlug,
|
|
4
|
-
loadEnv,
|
|
5
|
-
loadFollowedChannels,
|
|
6
|
-
sendToMind,
|
|
7
|
-
writeChannelEntry
|
|
8
|
-
} from "../chunk-WSLPZF72.js";
|
|
9
|
-
import "../chunk-B2CPS4QU.js";
|
|
10
|
-
import "../chunk-K3NQKI34.js";
|
|
11
|
-
|
|
12
|
-
// src/connectors/telegram.ts
|
|
13
|
-
import { Telegraf } from "telegraf";
|
|
14
|
-
import { message } from "telegraf/filters";
|
|
15
|
-
var TYPING_INTERVAL_MS = 5e3;
|
|
16
|
-
var env = loadEnv();
|
|
17
|
-
var botToken = process.env.TELEGRAM_BOT_TOKEN;
|
|
18
|
-
if (!botToken) {
|
|
19
|
-
console.error("Missing required env var: TELEGRAM_BOT_TOKEN");
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
var followedChatIds = loadFollowedChannels(env, "telegram");
|
|
23
|
-
var followedChatIdSet = new Set(followedChatIds.map(String));
|
|
24
|
-
var bot = new Telegraf(botToken);
|
|
25
|
-
bot.on(message("text"), async (ctx) => {
|
|
26
|
-
if (ctx.message.from.is_bot) return;
|
|
27
|
-
const isDM = ctx.chat.type === "private";
|
|
28
|
-
const botUsername = ctx.botInfo.username;
|
|
29
|
-
const isMentioned = !isDM && ctx.message.entities?.some(
|
|
30
|
-
(e) => e.type === "mention" && ctx.message.text.substring(e.offset, e.offset + e.length) === `@${botUsername}`
|
|
31
|
-
);
|
|
32
|
-
const isFollowedChat = !isDM && followedChatIdSet.has(String(ctx.chat.id));
|
|
33
|
-
if (!isDM && !isMentioned && !isFollowedChat) return;
|
|
34
|
-
let text = ctx.message.text;
|
|
35
|
-
if (isMentioned && botUsername) {
|
|
36
|
-
text = text.replace(new RegExp(`@${botUsername}`, "g"), "").trim();
|
|
37
|
-
}
|
|
38
|
-
const content = [];
|
|
39
|
-
if (text) content.push({ type: "text", text });
|
|
40
|
-
if (content.length === 0) return;
|
|
41
|
-
const senderName = ctx.message.from.first_name + (ctx.message.from.last_name ? ` ${ctx.message.from.last_name}` : "");
|
|
42
|
-
const chatTitle = "title" in ctx.chat ? ctx.chat.title : void 0;
|
|
43
|
-
let participantCount = isDM ? 2 : void 0;
|
|
44
|
-
if (!isDM) {
|
|
45
|
-
try {
|
|
46
|
-
participantCount = await ctx.telegram.getChatMembersCount(ctx.chat.id);
|
|
47
|
-
} catch (err) {
|
|
48
|
-
console.warn(`Failed to get member count for chat ${ctx.chat.id}: ${err}`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
const channelSlug = isDM ? buildChannelSlug("telegram", {
|
|
52
|
-
isDM: true,
|
|
53
|
-
senderName: ctx.message.from.username ?? ctx.message.from.first_name
|
|
54
|
-
}) : buildChannelSlug("telegram", {
|
|
55
|
-
channelName: chatTitle ?? String(ctx.chat.id)
|
|
56
|
-
});
|
|
57
|
-
try {
|
|
58
|
-
writeChannelEntry(env.mindName, channelSlug, {
|
|
59
|
-
platformId: String(ctx.chat.id),
|
|
60
|
-
platform: "telegram",
|
|
61
|
-
name: chatTitle,
|
|
62
|
-
type: isDM ? "dm" : "channel"
|
|
63
|
-
});
|
|
64
|
-
} catch (err) {
|
|
65
|
-
console.error(`[telegram] failed to write channel entry for ${channelSlug}:`, err);
|
|
66
|
-
}
|
|
67
|
-
const payload = {
|
|
68
|
-
content,
|
|
69
|
-
channel: channelSlug,
|
|
70
|
-
sender: senderName,
|
|
71
|
-
platform: "Telegram",
|
|
72
|
-
...isDM ? { isDM: true } : {},
|
|
73
|
-
...chatTitle ? { channelName: chatTitle } : {},
|
|
74
|
-
...participantCount ? { participantCount } : {}
|
|
75
|
-
};
|
|
76
|
-
if (isFollowedChat && !isMentioned) {
|
|
77
|
-
const result = await sendToMind(env, payload);
|
|
78
|
-
if (!result.ok)
|
|
79
|
-
ctx.reply(result.error ?? "Failed to process message").catch((err) => {
|
|
80
|
-
console.warn(`[telegram] failed to send error reply: ${err}`);
|
|
81
|
-
});
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
await handleTelegramMessage(ctx, payload);
|
|
85
|
-
});
|
|
86
|
-
bot.on(message("photo"), async (ctx) => {
|
|
87
|
-
if (ctx.message.from.is_bot) return;
|
|
88
|
-
const isDM = ctx.chat.type === "private";
|
|
89
|
-
const isFollowedChat = !isDM && followedChatIdSet.has(String(ctx.chat.id));
|
|
90
|
-
if (!isDM && !isFollowedChat) return;
|
|
91
|
-
const content = [];
|
|
92
|
-
const caption = ctx.message.caption;
|
|
93
|
-
if (caption) content.push({ type: "text", text: caption });
|
|
94
|
-
const photos = ctx.message.photo;
|
|
95
|
-
const largest = photos[photos.length - 1];
|
|
96
|
-
try {
|
|
97
|
-
const fileUrl = await ctx.telegram.getFileLink(largest.file_id);
|
|
98
|
-
const res = await fetch(fileUrl.href);
|
|
99
|
-
if (!res.ok) {
|
|
100
|
-
console.error(`Failed to download photo: HTTP ${res.status}`);
|
|
101
|
-
} else {
|
|
102
|
-
const buffer = Buffer.from(await res.arrayBuffer());
|
|
103
|
-
content.push({
|
|
104
|
-
type: "image",
|
|
105
|
-
media_type: "image/jpeg",
|
|
106
|
-
data: buffer.toString("base64")
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
} catch (err) {
|
|
110
|
-
console.error(`Failed to download photo: ${err}`);
|
|
111
|
-
}
|
|
112
|
-
if (content.length === 0) return;
|
|
113
|
-
const senderName = ctx.message.from.first_name + (ctx.message.from.last_name ? ` ${ctx.message.from.last_name}` : "");
|
|
114
|
-
const chatTitle = "title" in ctx.chat ? ctx.chat.title : void 0;
|
|
115
|
-
let participantCount = isDM ? 2 : void 0;
|
|
116
|
-
if (!isDM) {
|
|
117
|
-
try {
|
|
118
|
-
participantCount = await ctx.telegram.getChatMembersCount(ctx.chat.id);
|
|
119
|
-
} catch (err) {
|
|
120
|
-
console.warn(`Failed to get member count for chat ${ctx.chat.id}: ${err}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
const channelSlug = isDM ? buildChannelSlug("telegram", {
|
|
124
|
-
isDM: true,
|
|
125
|
-
senderName: ctx.message.from.username ?? ctx.message.from.first_name
|
|
126
|
-
}) : buildChannelSlug("telegram", {
|
|
127
|
-
channelName: chatTitle ?? String(ctx.chat.id)
|
|
128
|
-
});
|
|
129
|
-
try {
|
|
130
|
-
writeChannelEntry(env.mindName, channelSlug, {
|
|
131
|
-
platformId: String(ctx.chat.id),
|
|
132
|
-
platform: "telegram",
|
|
133
|
-
name: chatTitle,
|
|
134
|
-
type: isDM ? "dm" : "channel"
|
|
135
|
-
});
|
|
136
|
-
} catch (err) {
|
|
137
|
-
console.error(`[telegram] failed to write channel entry for ${channelSlug}:`, err);
|
|
138
|
-
}
|
|
139
|
-
const payload = {
|
|
140
|
-
content,
|
|
141
|
-
channel: channelSlug,
|
|
142
|
-
sender: senderName,
|
|
143
|
-
platform: "Telegram",
|
|
144
|
-
...isDM ? { isDM: true } : {},
|
|
145
|
-
...chatTitle ? { channelName: chatTitle } : {},
|
|
146
|
-
...participantCount ? { participantCount } : {}
|
|
147
|
-
};
|
|
148
|
-
if (isFollowedChat) {
|
|
149
|
-
const result = await sendToMind(env, payload);
|
|
150
|
-
if (!result.ok)
|
|
151
|
-
ctx.reply(result.error ?? "Failed to process message").catch((err) => {
|
|
152
|
-
console.warn(`[telegram] failed to send error reply: ${err}`);
|
|
153
|
-
});
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
await handleTelegramMessage(ctx, payload);
|
|
157
|
-
});
|
|
158
|
-
async function handleTelegramMessage(ctx, payload) {
|
|
159
|
-
const chatId = ctx.chat.id;
|
|
160
|
-
const typingInterval = setInterval(() => {
|
|
161
|
-
bot.telegram.sendChatAction(chatId, "typing").catch(() => {
|
|
162
|
-
});
|
|
163
|
-
}, TYPING_INTERVAL_MS);
|
|
164
|
-
bot.telegram.sendChatAction(chatId, "typing").catch(() => {
|
|
165
|
-
});
|
|
166
|
-
try {
|
|
167
|
-
const result = await sendToMind(env, payload);
|
|
168
|
-
if (!result.ok)
|
|
169
|
-
ctx.reply(result.error ?? "Failed to process message").catch((err) => {
|
|
170
|
-
console.warn(`[telegram] failed to send error reply: ${err}`);
|
|
171
|
-
});
|
|
172
|
-
} finally {
|
|
173
|
-
clearInterval(typingInterval);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
bot.launch().then(() => {
|
|
177
|
-
console.log(`Connected to Telegram as @${bot.botInfo?.username}`);
|
|
178
|
-
console.log(`Bridging to mind: ${env.mindName} via ${env.baseUrl}/message`);
|
|
179
|
-
if (followedChatIds.length > 0) {
|
|
180
|
-
console.log(`Following chats: ${followedChatIds.join(", ")}`);
|
|
181
|
-
}
|
|
182
|
-
}).catch((err) => {
|
|
183
|
-
console.error("Failed to start Telegram connector:", err);
|
|
184
|
-
process.exit(1);
|
|
185
|
-
});
|
|
186
|
-
process.once("SIGINT", () => bot.stop("SIGINT"));
|
|
187
|
-
process.once("SIGTERM", () => bot.stop("SIGTERM"));
|
package/dist/down-7UKFMJJZ.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
run,
|
|
4
|
-
stopDaemon
|
|
5
|
-
} from "./chunk-OZFKBXD6.js";
|
|
6
|
-
import "./chunk-V63B7DX3.js";
|
|
7
|
-
import "./chunk-YJA7P64S.js";
|
|
8
|
-
import "./chunk-XOXLRRR2.js";
|
|
9
|
-
import "./chunk-B2CPS4QU.js";
|
|
10
|
-
import "./chunk-K3NQKI34.js";
|
|
11
|
-
export {
|
|
12
|
-
run,
|
|
13
|
-
stopDaemon
|
|
14
|
-
};
|