project-foundry 1.1.0 → 1.1.1

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/foundry.js CHANGED
@@ -6,7 +6,7 @@ import * as p from '@clack/prompts';
6
6
  import pc from 'picocolors';
7
7
  import { hasConfig, writeConfig, readConfig, getDefaultStorageDir } from '../src/config.js';
8
8
  import { registerNodeWithCloud } from '../src/api-client.js';
9
- import { installAutostartService, isServerHealthy, startDaemonBackground } from '../src/service-manager.js';
9
+ import { installAutostartService, isServerHealthy, startDaemonBackground, stopRunningDaemon } from '../src/service-manager.js';
10
10
  import { runInteractiveTui } from '../src/tui.js';
11
11
  import { startDaemon } from '../src/daemon.js';
12
12
 
@@ -31,6 +31,7 @@ program
31
31
  .description('Inicia o servidor local e o túnel com logs visíveis no terminal')
32
32
  .action(() => {
33
33
  console.log(pc.bold(pc.cyan('Iniciando Project Foundry Local Server...')));
34
+ stopRunningDaemon();
34
35
  startDaemon();
35
36
  });
36
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-foundry",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Project Foundry CLI & Local Node Daemon Manager",
5
5
  "bin": {
6
6
  "project-foundry": "bin/foundry.js",
package/src/daemon.js CHANGED
@@ -167,6 +167,14 @@ export function startDaemon() {
167
167
  }
168
168
  });
169
169
 
170
+ server.on('error', (err) => {
171
+ if (err.code === 'EADDRINUSE') {
172
+ console.warn(`[Foundry Daemon] Aviso: Porta ${port} já está em uso por outro processo. O túnel reverso segue operando normalmente.`);
173
+ return;
174
+ }
175
+ console.error(`[Foundry Daemon] Erro no servidor HTTP local: ${err.message}`);
176
+ });
177
+
170
178
  server.listen(port, '0.0.0.0', () => {
171
179
  console.log(`[Foundry Daemon] Servidor local escutando em http://0.0.0.0:${port}`);
172
180
  console.log(`[Foundry Daemon] Diretório de arquivos: ${config.storagePath}`);
@@ -32,6 +32,9 @@ export function stopRunningDaemon() {
32
32
  try {
33
33
  execSync("pkill -f 'foundry.*daemon' || true", { stdio: 'ignore' });
34
34
  } catch {}
35
+ try {
36
+ execSync("fuser -k 3010/tcp || true", { stdio: 'ignore' });
37
+ } catch {}
35
38
  }
36
39
  }
37
40