@artil-ai/server 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.
- package/README.md +1 -1
- package/bin/main.js +19 -11
- package/bin/main.js.map +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/main.js
CHANGED
|
@@ -22187,11 +22187,15 @@ class TelegramChannel extends Channel {
|
|
|
22187
22187
|
name = "Telegram";
|
|
22188
22188
|
recipients = "the id of someone who wrote to the agent's bot first, or a bot's @username";
|
|
22189
22189
|
senders = "a person's @username or Telegram user id, or a bot's @username";
|
|
22190
|
-
credentials = "
|
|
22190
|
+
credentials = "Bot token";
|
|
22191
22191
|
credentialsGuide = [
|
|
22192
|
-
"
|
|
22193
|
-
"
|
|
22194
|
-
"
|
|
22192
|
+
"Open @BotFather in Telegram.",
|
|
22193
|
+
"Send /newbot to make a bot, or /mybots to pick one you have.",
|
|
22194
|
+
"Tap API Token and copy it.",
|
|
22195
|
+
"",
|
|
22196
|
+
"Messages to the bot reach this account from now on.",
|
|
22197
|
+
"People write to the bot first, in private chats.",
|
|
22198
|
+
"Then the agent can answer."
|
|
22195
22199
|
].join(`
|
|
22196
22200
|
`);
|
|
22197
22201
|
#provider;
|
|
@@ -22322,7 +22326,7 @@ var channel = {
|
|
|
22322
22326
|
create: ({ webhookUrl, secret, fetch: fetch2 }) => new TelegramChannel(createBotApi({ webhook: webhookUrl ? { url: webhookUrl, secret } : undefined, fetch: fetch2 }))
|
|
22323
22327
|
};
|
|
22324
22328
|
// package.json
|
|
22325
|
-
var version2 = "0.1.
|
|
22329
|
+
var version2 = "0.1.2";
|
|
22326
22330
|
|
|
22327
22331
|
// src/app/cli.ts
|
|
22328
22332
|
import { parseArgs } from "util";
|
|
@@ -52135,12 +52139,14 @@ async function createAgents(context) {
|
|
|
52135
52139
|
}
|
|
52136
52140
|
}
|
|
52137
52141
|
async function setUpChannel({ context, channel: channel2 }) {
|
|
52138
|
-
|
|
52139
|
-
|
|
52140
|
-
|
|
52141
|
-
|
|
52142
|
+
function accountsWithout() {
|
|
52143
|
+
return context.agents.list().filter(({ id: id2 }) => !context.addresses.findByAgent({ agentId: id2, channel: channel2.kind }));
|
|
52144
|
+
}
|
|
52145
|
+
let connected = false;
|
|
52146
|
+
let agents2 = accountsWithout();
|
|
52147
|
+
while (agents2.length > 0) {
|
|
52142
52148
|
const connectNow = requireAnswer(await confirm({
|
|
52143
|
-
message: `Connect a ${channel2.name} address to an account?`,
|
|
52149
|
+
message: `Connect a ${channel2.name} address to ${connected ? "another" : "an"} account?`,
|
|
52144
52150
|
initialValue: false
|
|
52145
52151
|
}));
|
|
52146
52152
|
if (!connectNow)
|
|
@@ -52164,10 +52170,12 @@ async function setUpChannel({ context, channel: channel2 }) {
|
|
|
52164
52170
|
credentials: credentials.trim()
|
|
52165
52171
|
});
|
|
52166
52172
|
progressSpinner.stop(`${address.value} now reaches ${agent.name} on ${channel2.name}`);
|
|
52173
|
+
connected = true;
|
|
52167
52174
|
} catch (cause) {
|
|
52168
52175
|
progressSpinner.error(messageOf(cause, `Could not connect the ${channel2.name} address`));
|
|
52169
52176
|
continue;
|
|
52170
52177
|
}
|
|
52178
|
+
agents2 = accountsWithout();
|
|
52171
52179
|
const sender = requireAnswer(await text({
|
|
52172
52180
|
message: `Who may wake ${agent.name} on ${channel2.name}? Give ${channel2.senders}, or leave it empty for only the server's agents`,
|
|
52173
52181
|
defaultValue: ""
|
|
@@ -52602,5 +52610,5 @@ try {
|
|
|
52602
52610
|
process.exitCode = 1;
|
|
52603
52611
|
}
|
|
52604
52612
|
|
|
52605
|
-
//# debugId=
|
|
52613
|
+
//# debugId=E162EED6D52D865664756E2164756E21
|
|
52606
52614
|
//# sourceMappingURL=main.js.map
|