kooni-bot 0.2.8 → 0.2.10
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/bin/kooni.js +19 -8
- package/package.json +24 -24
package/bin/kooni.js
CHANGED
|
@@ -22,7 +22,7 @@ import { execFileSync, spawnSync } from "node:child_process";
|
|
|
22
22
|
import { randomUUID } from "node:crypto";
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
24
24
|
|
|
25
|
-
const CLI_VERSION = "0.2.
|
|
25
|
+
const CLI_VERSION = "0.2.10";
|
|
26
26
|
|
|
27
27
|
const REPO = process.env.KOONI_REPO || "iamnocodeveloper/kooni-bot";
|
|
28
28
|
const BRANCH = process.env.KOONI_BRANCH || "main";
|
|
@@ -220,6 +220,7 @@ const BRAINS = {
|
|
|
220
220
|
claude: { provider: "anthropic", secret: "ANTHROPIC_API_KEY", label: "Claude" },
|
|
221
221
|
chatgpt: { provider: "openai", secret: "OPENAI_API_KEY", label: "ChatGPT" },
|
|
222
222
|
grok: { provider: "xai", secret: "XAI_API_KEY", label: "Grok" },
|
|
223
|
+
minimax: { provider: "minimax", secret: "MINIMAX_API_KEY", label: "MiniMax" },
|
|
223
224
|
gateway: { provider: "openai", secret: "OPENAI_API_KEY", label: "Gateway" },
|
|
224
225
|
};
|
|
225
226
|
|
|
@@ -741,7 +742,7 @@ function writeDevVars(dir, answers, kbToken) {
|
|
|
741
742
|
|
|
742
743
|
function collectAnswers(flags) {
|
|
743
744
|
const rawBrain = String(flags.cerebro || flags.brain || "").trim().toLowerCase();
|
|
744
|
-
const brainKey = ({ claude: "claude", anthropic: "claude", chatgpt: "chatgpt", openai: "chatgpt", gpt: "chatgpt", grok: "grok", xai: "grok", gateway: "gateway" })[rawBrain] || null;
|
|
745
|
+
const brainKey = ({ claude: "claude", anthropic: "claude", chatgpt: "chatgpt", openai: "chatgpt", gpt: "chatgpt", grok: "grok", xai: "grok", minimax: "minimax", gateway: "gateway" })[rawBrain] || null;
|
|
745
746
|
const tone = ({ cercano: "cercano", friendly: "cercano", formal: "formal", divertido: "divertido", playful: "divertido" })[String(flags.tono || "").trim().toLowerCase()] || null;
|
|
746
747
|
|
|
747
748
|
// Lo que vino por flag se conserva; lo que NO vino queda undefined para que
|
|
@@ -793,7 +794,7 @@ async function onboarding(rl, answers, defaultDir) {
|
|
|
793
794
|
// hace después desde el dashboard. Aquí solo fijamos el default.
|
|
794
795
|
answers.tier = answers.tier || "free";
|
|
795
796
|
|
|
796
|
-
const brainKeys = ["claude", "chatgpt", "grok", "gateway"];
|
|
797
|
+
const brainKeys = ["claude", "chatgpt", "grok", "minimax", "gateway"];
|
|
797
798
|
const brainIdx = await select(rl, t().brainQ, brainKeys.map((k) => ({
|
|
798
799
|
key: k, label: BRAINS[k].label,
|
|
799
800
|
desc: k === "claude" ? t().brainDesc : "",
|
|
@@ -965,7 +966,8 @@ async function deployBot(dir, { flags = {}, rl } = {}) {
|
|
|
965
966
|
let url = "";
|
|
966
967
|
try {
|
|
967
968
|
const dep = runPnpm(dir, ["run", "deploy"], { capture: true });
|
|
968
|
-
|
|
969
|
+
// La URL real incluye el subdominio de la cuenta: <worker>.<cuenta>.workers.dev
|
|
970
|
+
url = (dep.match(/https:\/\/[a-z0-9-]+(?:\.[a-z0-9-]+)*\.workers\.dev/) || [])[0] || "";
|
|
969
971
|
} catch (e) {
|
|
970
972
|
// Muestra el detalle real del deploy en vez de tragarlo: así el usuario ve
|
|
971
973
|
// qué falló (deploy-check, binding, auth…) y puede corregirlo.
|
|
@@ -1040,6 +1042,7 @@ constructor. No hay licencia ni servidor de Horizontes: el tier free/pro se cont
|
|
|
1040
1042
|
|
|
1041
1043
|
## Conexión de canales (DESDE el panel, sin redeploy)
|
|
1042
1044
|
- Telegram y Zernio se conectan pegando su token/API key en \`/admin/conexiones\`. Se guardan en D1 (\`settings\`) y el canal se pone verde al instante, SIN \`wrangler secret put\` ni redeploy.
|
|
1045
|
+
- **Telegram registra su webhook automáticamente** al guardar el token (setWebhook apuntando a <worker>/webhooks/telegram). En la misma card se puede poner el chat id del dueño para los avisos de handoff (alternativa al secret \`OWNER_TELEGRAM_CHAT_ID\`).
|
|
1043
1046
|
- La URL del webhook de cada canal se muestra en su propia card (con botón copiar).
|
|
1044
1047
|
|
|
1045
1048
|
## Regla de oro (memorízala)
|
|
@@ -1062,7 +1065,7 @@ Si dudas: **member/ es sagrado, src/ se actualiza.**
|
|
|
1062
1065
|
## Secrets y vars (referencia rápida)
|
|
1063
1066
|
- Secrets: \`ANTHROPIC_API_KEY\` / \`OPENAI_API_KEY\` / \`XAI_API_KEY\` (cerebro), \`DASHBOARD_PASSWORD\` (panel), \`KB_REINDEX_TOKEN\` (reindex).
|
|
1064
1067
|
- Canales: \`TELEGRAM_BOT_TOKEN\`, \`MANYCHAT_API_KEY\`, \`TWILIO_ACCOUNT_SID\`+\`TWILIO_AUTH_TOKEN\`+\`TWILIO_WA_FROM\`, \`META_PAGE_ACCESS_TOKEN\`+\`META_VERIFY_TOKEN\`+\`META_APP_SECRET\`, \`ZERNIO_API_KEY\`.
|
|
1065
|
-
- Avisos al dueño: \`OWNER_TELEGRAM_CHAT_ID
|
|
1068
|
+
- Avisos al dueño: \`OWNER_TELEGRAM_CHAT_ID\` (o el campo "chat id" de la card Telegram en Conexiones), \`RESEND_API_KEY\`+\`OWNER_EMAIL\`, \`OWNER_WA_NUMBER\`.
|
|
1066
1069
|
- Vars en \`wrangler.toml\`: \`BOT_NAME\`, \`BUSINESS_NAME\`, \`BOT_LANGUAGE\`, \`BOT_TIER\`, \`BUFFER_SECONDS\`, \`DASHBOARD_BASE_URL\`, \`LLM_PROVIDER\` (\`anthropic\` default | \`openai\` | \`xai\`).
|
|
1067
1070
|
|
|
1068
1071
|
## Comandos del proyecto (dentro de la carpeta del bot, con pnpm)
|
|
@@ -1166,6 +1169,7 @@ async function cmdInit(flags, rest) {
|
|
|
1166
1169
|
kbName: meta && meta.kbName,
|
|
1167
1170
|
});
|
|
1168
1171
|
console.log("\n " + C.green("✓") + " " + t().configDone);
|
|
1172
|
+
console.log(" " + C.green("✓") + " " + m(`Bot instalado → ${dir}`, `Bot installed → ${dir}`));
|
|
1169
1173
|
|
|
1170
1174
|
// Registrar la instalación local para el selector multi-bot.
|
|
1171
1175
|
recordInstall(dir, {
|
|
@@ -1183,9 +1187,16 @@ async function cmdInit(flags, rest) {
|
|
|
1183
1187
|
if (url) {
|
|
1184
1188
|
console.log("\n " + C.green(C.b(m("🎉 BOT EN LÍNEA", "🎉 BOT LIVE"))));
|
|
1185
1189
|
console.log(" " + C.cyan(t().panel) + " " + C.b(url + "/admin"));
|
|
1186
|
-
console.log(" " + C.
|
|
1190
|
+
console.log("\n " + C.b(m("Lo que sigue (tu agente de Claude Code lo hace por ti):", "Next steps (your Claude Code agent does them for you):")));
|
|
1191
|
+
console.log(" 1. " + C.dim(m("abre tu panel en el link de arriba (usuario admin + tu contraseña)", "open your panel at the link above (user admin + your password)")));
|
|
1192
|
+
console.log(" 2. " + C.dim(m("Conexiones → pega tu token de Telegram: lo valida y registra el webhook solo", "Connections → paste your Telegram token: it validates and registers the webhook automatically")));
|
|
1193
|
+
console.log(" 3. " + C.dim(m("en la misma card, pega tu chat id (mándale /start a tu bot y míralo con @userinfobot) para recibir los avisos de handoff", "on the same card, paste your chat id (send /start to your bot and see it with @userinfobot) to get handoff alerts")));
|
|
1194
|
+
console.log(" 4. " + C.dim(m("conecta el resto de canales (Zernio, WhatsApp…) desde el mismo panel — se ponen verdes al instante", "connect the other channels (Zernio, WhatsApp…) from the same panel — they turn green instantly")));
|
|
1195
|
+
console.log("\n " + C.dim(m("Actualiza cuando saquemos mejoras: npx kooni-bot update", "Update when we ship improvements: npx kooni-bot update")) + "\n");
|
|
1187
1196
|
} else {
|
|
1188
|
-
console.log(" " + C.yellow(m("No
|
|
1197
|
+
console.log("\n " + C.yellow(m("No desplegaste todavía. Cuando quieras:", "You haven't deployed yet. When you're ready:")));
|
|
1198
|
+
console.log(" " + C.cyan("npx kooni-bot deploy"));
|
|
1199
|
+
console.log(" " + C.dim(m("levanta el bot en TU Cloudflare y te da la URL del panel /admin.", "it deploys the bot on YOUR Cloudflare and gives you the /admin panel URL.")) + "\n");
|
|
1189
1200
|
}
|
|
1190
1201
|
}
|
|
1191
1202
|
|
|
@@ -1215,7 +1226,7 @@ async function cmdDeploy(flags, rest) {
|
|
|
1215
1226
|
try {
|
|
1216
1227
|
const wt = readFileSync(join(dir, "wrangler.toml"), "utf8");
|
|
1217
1228
|
const p = (wt.match(/LLM_PROVIDER\s*=\s*"([^"]+)"/) || [])[1] || "anthropic";
|
|
1218
|
-
brainKey = ({ anthropic: "claude", openai: "chatgpt", xai: "grok" })[p] || "claude";
|
|
1229
|
+
brainKey = ({ anthropic: "claude", openai: "chatgpt", xai: "grok", minimax: "minimax" })[p] || "claude";
|
|
1219
1230
|
} catch {}
|
|
1220
1231
|
flags.brainKey = brainKey;
|
|
1221
1232
|
await deployBot(dir, { flags, rl });
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "kooni-bot",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Kooni — instala tu asistente de IA multicanal (WhatsApp, Instagram, Messenger, Telegram) en TU Cloudflare, en un comando.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"kooni-bot": "bin/kooni.js"
|
|
9
|
-
},
|
|
10
|
-
"engines": {
|
|
11
|
-
"node": ">=18"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"chatbot",
|
|
15
|
-
"ai",
|
|
16
|
-
"whatsapp",
|
|
17
|
-
"instagram",
|
|
18
|
-
"telegram",
|
|
19
|
-
"cloudflare",
|
|
20
|
-
"kooni"
|
|
21
|
-
],
|
|
22
|
-
"files": [
|
|
23
|
-
"bin"
|
|
24
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"name": "kooni-bot",
|
|
3
|
+
"version": "0.2.10",
|
|
4
|
+
"description": "Kooni — instala tu asistente de IA multicanal (WhatsApp, Instagram, Messenger, Telegram) en TU Cloudflare, en un comando.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"kooni-bot": "bin/kooni.js"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=18"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"chatbot",
|
|
15
|
+
"ai",
|
|
16
|
+
"whatsapp",
|
|
17
|
+
"instagram",
|
|
18
|
+
"telegram",
|
|
19
|
+
"cloudflare",
|
|
20
|
+
"kooni"
|
|
21
|
+
],
|
|
22
|
+
"files": [
|
|
23
|
+
"bin"
|
|
24
|
+
]
|
|
25
25
|
}
|