pipely-ai 1.4.0 → 1.4.3
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/index.js +52 -15
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -520,7 +520,7 @@ function generateLocalEnv() {
|
|
|
520
520
|
const setupKey = randomUUID();
|
|
521
521
|
const dir = getLocalDir();
|
|
522
522
|
|
|
523
|
-
const dbPath = join(dir, "data", "pipely.db").replace(/\\/g, "/");
|
|
523
|
+
const dbPath = join(dir, "data", "pipely.db").replace(/\\/g, "/").replace(/ /g, "%20");
|
|
524
524
|
const frontendPath = join(getBundleDir(), "frontend").replace(/\\/g, "/");
|
|
525
525
|
const env = `# Pipely AI — Local Mode
|
|
526
526
|
DATABASE_URL=file:${dbPath}
|
|
@@ -611,7 +611,7 @@ async function installLocal() {
|
|
|
611
611
|
mkdirSync(join(dir, "data"), { recursive: true });
|
|
612
612
|
|
|
613
613
|
// Setup database
|
|
614
|
-
const dbPath = join(dir, "data", "pipely.db").replace(/\\/g, "/");
|
|
614
|
+
const dbPath = join(dir, "data", "pipely.db").replace(/\\/g, "/").replace(/ /g, "%20");
|
|
615
615
|
process.stdout.write(` Criando banco de dados... `);
|
|
616
616
|
try {
|
|
617
617
|
execSync("npx prisma db push", {
|
|
@@ -627,19 +627,43 @@ async function installLocal() {
|
|
|
627
627
|
|
|
628
628
|
console.log(`\n ${c.green}✓${c.reset} Instalacao concluida\n`);
|
|
629
629
|
|
|
630
|
-
|
|
630
|
+
printLocalSummary(setupKey, dir);
|
|
631
|
+
return runLocal();
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function printLocalSummary(setupKey, dir) {
|
|
631
635
|
const line = "═".repeat(56);
|
|
632
636
|
console.log(` ${c.green}${line}${c.reset}`);
|
|
633
|
-
console.log(` ${c.green}${c.bold} PIPELY AI —
|
|
637
|
+
console.log(` ${c.green}${c.bold} PIPELY AI — PRONTO! (Local Mode)${c.reset}`);
|
|
634
638
|
console.log(` ${c.green}${line}${c.reset}`);
|
|
635
639
|
console.log("");
|
|
636
|
-
console.log(` ${c.bold}
|
|
640
|
+
console.log(` ${c.bold}Endpoints:${c.reset}`);
|
|
641
|
+
console.log(` Frontend + API: ${c.cyan}http://localhost:3333${c.reset}`);
|
|
642
|
+
console.log(` Setup: ${c.cyan}http://localhost:3333/setup${c.reset}`);
|
|
643
|
+
console.log(` Agent Webhook: ${c.cyan}http://localhost:3335/webhook${c.reset}`);
|
|
644
|
+
console.log(` Health: ${c.cyan}http://localhost:3333/health${c.reset}`);
|
|
637
645
|
console.log("");
|
|
638
|
-
console.log(` ${c.bold}
|
|
639
|
-
console.log(`
|
|
646
|
+
console.log(` ${c.bold}Chaves:${c.reset}`);
|
|
647
|
+
console.log(` Setup Key: ${c.yellow}${setupKey}${c.reset}`);
|
|
648
|
+
console.log("");
|
|
649
|
+
console.log(` ${c.bold}Arquivos:${c.reset}`);
|
|
650
|
+
console.log(` Diretorio: ${c.dim}${dir}${c.reset}`);
|
|
651
|
+
console.log(` Banco de dados: ${c.dim}${join(dir, "data/pipely.db")}${c.reset}`);
|
|
652
|
+
console.log(` Configuracao: ${c.dim}${join(dir, ".env")}${c.reset}`);
|
|
653
|
+
console.log("");
|
|
654
|
+
console.log(` ${c.bold}Proximo passo:${c.reset}`);
|
|
655
|
+
console.log(` 1. Acesse ${c.cyan}http://localhost:3333/setup${c.reset}`);
|
|
656
|
+
console.log(` 2. Use a Setup Key acima para criar sua conta`);
|
|
657
|
+
console.log(` 3. Configure WhatsApp e OpenAI nas paginas do app`);
|
|
658
|
+
console.log("");
|
|
659
|
+
console.log(` ${c.bold}Comandos:${c.reset}`);
|
|
660
|
+
console.log(` npx pipely-ai start ${c.dim}# Iniciar${c.reset}`);
|
|
661
|
+
console.log(` npx pipely-ai keys ${c.dim}# Ver chaves${c.reset}`);
|
|
662
|
+
console.log(` npx pipely-ai update ${c.dim}# Atualizar${c.reset}`);
|
|
663
|
+
console.log(` npx pipely-ai --local ${c.dim}# Forcar modo local${c.reset}`);
|
|
664
|
+
console.log("");
|
|
665
|
+
console.log(` ${c.green}${line}${c.reset}`);
|
|
640
666
|
console.log("");
|
|
641
|
-
|
|
642
|
-
return runLocal();
|
|
643
667
|
}
|
|
644
668
|
|
|
645
669
|
async function runLocal() {
|
|
@@ -650,13 +674,17 @@ async function runLocal() {
|
|
|
650
674
|
|
|
651
675
|
const bundleDir = getBundleDir();
|
|
652
676
|
|
|
653
|
-
|
|
677
|
+
const line = "═".repeat(56);
|
|
678
|
+
console.log(` ${c.magenta}${line}${c.reset}`);
|
|
679
|
+
console.log(` ${c.magenta}${c.bold} PIPELY AI — Iniciando...${c.reset}`);
|
|
680
|
+
console.log(` ${c.magenta}${line}${c.reset}`);
|
|
681
|
+
console.log("");
|
|
654
682
|
|
|
655
683
|
const envPath = getLocalEnvPath();
|
|
656
684
|
const envContent = existsSync(envPath) ? readFileSync(envPath, "utf-8") : "";
|
|
657
685
|
const envVars = {};
|
|
658
|
-
for (const
|
|
659
|
-
const match =
|
|
686
|
+
for (const envLine of envContent.split("\n")) {
|
|
687
|
+
const match = envLine.match(/^([A-Z_]+)=(.*)$/);
|
|
660
688
|
if (match) envVars[match[1]] = match[2];
|
|
661
689
|
}
|
|
662
690
|
|
|
@@ -679,10 +707,19 @@ async function runLocal() {
|
|
|
679
707
|
// Wait for server to start then print endpoints
|
|
680
708
|
await sleep(2000);
|
|
681
709
|
console.log("");
|
|
682
|
-
console.log(` ${c.
|
|
683
|
-
console.log(` ${c.
|
|
710
|
+
console.log(` ${c.green}${line}${c.reset}`);
|
|
711
|
+
console.log(` ${c.green}${c.bold} PIPELY AI — Rodando${c.reset}`);
|
|
712
|
+
console.log(` ${c.green}${line}${c.reset}`);
|
|
713
|
+
console.log("");
|
|
714
|
+
console.log(` ${c.bold}Endpoints:${c.reset}`);
|
|
715
|
+
console.log(` Frontend + API: ${c.cyan}http://localhost:3333${c.reset}`);
|
|
716
|
+
console.log(` Agent Webhook: ${c.cyan}http://localhost:3335/webhook${c.reset}`);
|
|
717
|
+
console.log("");
|
|
718
|
+
console.log(` ${c.bold}Setup Key:${c.reset} ${c.yellow}${envVars.OWNER_SETUP_KEY || "ver .env"}${c.reset}`);
|
|
719
|
+
console.log("");
|
|
720
|
+
console.log(` Pressione ${c.bold}Ctrl+C${c.reset} para parar.`);
|
|
721
|
+
console.log(` ${c.green}${line}${c.reset}`);
|
|
684
722
|
console.log("");
|
|
685
|
-
console.log(` Pressione ${c.bold}Ctrl+C${c.reset} para parar.\n`);
|
|
686
723
|
|
|
687
724
|
function shutdown() {
|
|
688
725
|
console.log(`\n Parando...\n`);
|