kooni-bot 0.3.4 → 0.4.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.
Files changed (2) hide show
  1. package/bin/kooni.js +24 -0
  2. package/package.json +1 -1
package/bin/kooni.js CHANGED
@@ -108,6 +108,7 @@ const DICT = {
108
108
  qFaq: "¿Qué es lo que MÁS te pregunta la gente? (separa con |)",
109
109
  qReglas: "¿Algo que el bot NO deba hacer o decir? ¿Y cuándo debe pasarte la conversación?",
110
110
  qTone: "¿Cómo quieres que suene?",
111
+ qNiche: "¿Para qué giro es el bot? (elige el que más se parezca)",
111
112
  toneFriendly: "Cercano", toneFormal: "Formal", tonePlayful: "Divertido",
112
113
  tone1: "cercano y amigable, como hablarle a un conocido",
113
114
  tone2: "formal y profesional, claro y respetuoso",
@@ -184,6 +185,7 @@ const DICT = {
184
185
  qFaq: "What do people ask you the MOST? (separate with |)",
185
186
  qReglas: "Anything the bot should NOT do or say? And when should it hand the chat to you?",
186
187
  qTone: "How should it sound?",
188
+ qNiche: "What's the bot for? (pick the closest)",
187
189
  toneFriendly: "Friendly", toneFormal: "Formal", tonePlayful: "Playful",
188
190
  tone1: "friendly and warm, like talking to someone you know",
189
191
  tone2: "formal and professional, clear and respectful",
@@ -677,6 +679,12 @@ function stampWrangler(dir, answers, botUid) {
677
679
  set(/BOT_LANGUAGE\s*=\s*"[^"]*"/g, `BOT_LANGUAGE = "${answers.lang}"`);
678
680
  set(/BOT_TIER\s*=\s*"[^"]*"/g, `BOT_TIER = "${answers.tier}"`);
679
681
  set(/BUFFER_SECONDS\s*=\s*"[^"]*"/g, `BUFFER_SECONDS = "${answers.bufferSeconds || "15"}"`);
682
+ // BOT_NICHE: pack del giro. Se inyecta en [vars] si el template no lo trae.
683
+ {
684
+ const niche = String(answers.niche || "generico");
685
+ if (/BOT_NICHE\s*=/.test(s)) set(/BOT_NICHE\s*=\s*"[^"]*"/, `BOT_NICHE = "${niche}"`);
686
+ else s = s.replace(/^(\s*\[vars\][^\n]*\n)/m, `$1BOT_NICHE = "${niche}"\n`);
687
+ }
680
688
  set(/DASHBOARD_BASE_URL\s*=\s*"[^"]*"/g, `DASHBOARD_BASE_URL = ""`);
681
689
  set(/database_name\s*=\s*"[^"]*"/, `database_name = "${dbName}"`);
682
690
  set(/index_name\s*=\s*"[^"]*"/, `index_name = "${kbName}"`);
@@ -903,6 +911,22 @@ async function onboarding(rl, answers, defaultDir, flags = {}) {
903
911
  answers.faq = answers.faq ?? (await ask(rl, t().qFaq, undefined) || "");
904
912
  answers.reglas = answers.reglas ?? (await ask(rl, t().qReglas, undefined) || "");
905
913
 
914
+ // Giro → BOT_NICHE: decide el pack del panel (re-etiquetado), el playbook del
915
+ // prompt y las tools extra (ej. cartera de cobros → consultarDeuda/registrarPromesa).
916
+ const NICHE_CHOICES = [
917
+ { key: "generico", label: m("Genérico / otro", "Generic / other") },
918
+ { key: "agencia-ia", label: m("Agencia de IA / servicios", "AI agency / services") },
919
+ { key: "restaurante", label: m("Restaurante / comida", "Restaurant / food") },
920
+ { key: "inmobiliaria", label: m("Inmobiliaria", "Real estate") },
921
+ { key: "clinica", label: m("Clínica / consultorio", "Clinic") },
922
+ { key: "barberia", label: m("Barbería / estética", "Barber / beauty") },
923
+ { key: "cartera", label: m("Cartera de cobros", "Debt collection") },
924
+ ];
925
+ if (!answers.niche) {
926
+ const nicheIdx = await select(rl, t().qNiche, NICHE_CHOICES, { default: 0 });
927
+ answers.niche = NICHE_CHOICES[nicheIdx]?.key || "generico";
928
+ }
929
+
906
930
  const toneIdx = await select(rl, t().qTone, [
907
931
  { key: "cercano", label: t().toneFriendly, desc: t().tone1 },
908
932
  { key: "formal", label: t().toneFormal, desc: t().tone2 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kooni-bot",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "Kooni — instala tu asistente de IA multicanal (WhatsApp, Instagram, Messenger, Telegram) en TU Cloudflare, en un comando.",
5
5
  "license": "MIT",
6
6
  "type": "module",