clodds 1.2.2 → 1.2.4

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.
@@ -3666,7 +3666,21 @@ function createOnboardCommand(program) {
3666
3666
  console.log(` ${bold('clodds doctor')} ${dim('run diagnostics')}`);
3667
3667
  console.log(` ${bold('clodds repl')} ${dim('local test shell')}`);
3668
3668
  console.log('');
3669
- console.log(` ${dim('WebChat:')} ${cyan('http://localhost:18789/webchat')}`);
3669
+ const { networkInterfaces } = await Promise.resolve().then(() => __importStar(require('os')));
3670
+ const getHost = () => {
3671
+ if (process.env.CLODDS_PUBLIC_HOST)
3672
+ return process.env.CLODDS_PUBLIC_HOST;
3673
+ const nets = networkInterfaces();
3674
+ for (const iface of Object.values(nets)) {
3675
+ for (const cfg of iface || []) {
3676
+ if (!cfg.internal && cfg.family === 'IPv4')
3677
+ return cfg.address;
3678
+ }
3679
+ }
3680
+ return 'localhost';
3681
+ };
3682
+ const webHost = getHost();
3683
+ console.log(` ${dim('WebChat:')} ${cyan(`http://${webHost}:18789/webchat`)}`);
3670
3684
  if (channelChoice === 'telegram' && envVars.TELEGRAM_BOT_TOKEN) {
3671
3685
  console.log(` ${dim('Telegram:')} message your bot to start chatting`);
3672
3686
  }
@@ -3695,7 +3709,7 @@ function createOnboardCommand(program) {
3695
3709
  rootLog.level = 'info';
3696
3710
  console.log(`\r ${green(bold('Clodds is running'))} `);
3697
3711
  console.log('');
3698
- console.log(` ${cyan(`http://localhost:${config.gateway.port}/webchat`)}`);
3712
+ console.log(` ${cyan(`http://${webHost}:${config.gateway.port}/webchat`)}`);
3699
3713
  console.log(` ${dim('Press Ctrl+C to stop')}`);
3700
3714
  console.log('');
3701
3715
  const shutdown = async () => {