kooni-bot 0.1.0 → 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/bin/kooni.js +30 -3
- package/package.json +25 -15
package/bin/kooni.js
CHANGED
|
@@ -19,6 +19,8 @@ import { execFileSync } from "node:child_process";
|
|
|
19
19
|
const REPO = process.env.KOONI_REPO || "iamnocodeveloper/kooni-bot";
|
|
20
20
|
const BRANCH = process.env.KOONI_BRANCH || "main";
|
|
21
21
|
const TARBALL = `https://codeload.github.com/${REPO}/tar.gz/refs/heads/${BRANCH}`;
|
|
22
|
+
// Control del dueño: check-in al instalar (no bloquea; solo registra quién).
|
|
23
|
+
const CHECKIN_URL = process.env.KOONI_CHECKIN_URL || "https://f5gacw7g.function2.insforge.app/registrar-instalacion";
|
|
22
24
|
|
|
23
25
|
// El tar de Windows (MSYS) confunde las rutas C:\... con host remoto. Normaliza
|
|
24
26
|
// a rutas POSIX (/c/...) para que tar las entienda.
|
|
@@ -103,7 +105,7 @@ function extractFresh(tgz, dir) {
|
|
|
103
105
|
}
|
|
104
106
|
rmSync(tmp, { recursive: true, force: true });
|
|
105
107
|
rmSync(tgz, { force: true });
|
|
106
|
-
writeFileSync(join(dir, ".kooni-version"), "cli-0.1.
|
|
108
|
+
writeFileSync(join(dir, ".kooni-version"), "cli-0.1.2");
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
function extractOver(tgz, dir) {
|
|
@@ -124,7 +126,7 @@ function extractOver(tgz, dir) {
|
|
|
124
126
|
}
|
|
125
127
|
rmSync(tmp, { recursive: true, force: true });
|
|
126
128
|
rmSync(tgz, { force: true });
|
|
127
|
-
writeFileSync(join(dir, ".kooni-version"), "cli-0.1.
|
|
129
|
+
writeFileSync(join(dir, ".kooni-version"), "cli-0.1.2");
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
function isKooni(dir) {
|
|
@@ -165,6 +167,31 @@ async function cmdInit() {
|
|
|
165
167
|
process.exit(1);
|
|
166
168
|
}
|
|
167
169
|
console.log(I.ok(t("¡Bot listo! Tu panel: https://<slug>.workers.dev/admin", "Bot ready! Your panel: https://<slug>.workers.dev/admin")));
|
|
170
|
+
|
|
171
|
+
// Check-in (opcional, no bloquea): registrar quién instaló, para el control
|
|
172
|
+
// del dueño. Si KOONI_SILENT=1, no pregunta email y registra sin él.
|
|
173
|
+
try {
|
|
174
|
+
let email = "";
|
|
175
|
+
if (process.env.KOONI_SILENT !== "1" && process.env.KOONI_NO_CHECKIN !== "1") {
|
|
176
|
+
email = await ask(t("¿Tu email? (opcional, para soporte)", "Your email? (optional, for support)"), "");
|
|
177
|
+
}
|
|
178
|
+
const slug = dir.split(/[\\/]/).pop() || "kooni-bot";
|
|
179
|
+
const res = await fetch(CHECKIN_URL, {
|
|
180
|
+
method: "POST",
|
|
181
|
+
headers: { "Content-Type": "application/json" },
|
|
182
|
+
body: JSON.stringify({
|
|
183
|
+
email: email || undefined,
|
|
184
|
+
slug,
|
|
185
|
+
workerUrl: `https://${slug}.workers.dev`,
|
|
186
|
+
cliVersion: "0.1.2",
|
|
187
|
+
platform: process.platform,
|
|
188
|
+
}),
|
|
189
|
+
signal: AbortSignal.timeout(4000),
|
|
190
|
+
});
|
|
191
|
+
void res;
|
|
192
|
+
} catch {
|
|
193
|
+
// fire-and-forget: nunca falla la instalación por el check-in
|
|
194
|
+
}
|
|
168
195
|
}
|
|
169
196
|
|
|
170
197
|
async function cmdUpdate() {
|
|
@@ -184,7 +211,7 @@ async function cmdUpdate() {
|
|
|
184
211
|
async function main() {
|
|
185
212
|
const cmd = process.argv[2] || "help";
|
|
186
213
|
if (cmd === "help" || cmd === "--help" || cmd === "-h") return help();
|
|
187
|
-
if (cmd === "version" || cmd === "--version" || cmd === "-v") { console.log("kooni-bot 0.1.
|
|
214
|
+
if (cmd === "version" || cmd === "--version" || cmd === "-v") { console.log("kooni-bot 0.1.2"); return; }
|
|
188
215
|
if (cmd === "init") return cmdInit();
|
|
189
216
|
if (cmd === "update") return cmdUpdate();
|
|
190
217
|
console.log(t(`comando desconocido: ${cmd}`, `unknown command: ${cmd}`));
|
package/package.json
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "kooni-bot",
|
|
3
|
-
"version": "0.1.
|
|
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
|
-
|
|
15
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "kooni-bot",
|
|
3
|
+
"version": "0.1.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
|
+
]
|
|
25
|
+
}
|