tsunami-code 3.12.0 → 3.12.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.
Files changed (2) hide show
  1. package/index.js +42 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -25,8 +25,9 @@ import {
25
25
  getSessionContext
26
26
  } from './lib/memory.js';
27
27
  import { listMemories, readMemory, saveMemory, deleteMemory, getMemdirPath } from './lib/memdir.js';
28
+ import { execSync, spawn } from 'child_process';
28
29
 
29
- const VERSION = '3.12.0';
30
+ const VERSION = '3.12.1';
30
31
  const CONFIG_DIR = join(os.homedir(), '.tsunami-code');
31
32
  const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
32
33
  const DEFAULT_SERVER = 'https://radiometric-reita-amuck.ngrok-free.dev';
@@ -1398,7 +1399,43 @@ Output ONLY the TSUNAMI.md content, starting with "# Project: <name>"`;
1398
1399
  });
1399
1400
  }
1400
1401
 
1401
- run().catch(e => {
1402
- console.error(chalk.red(`Fatal: ${e.message}`));
1403
- process.exit(1);
1404
- });
1402
+ // ── Whale Watcher — auto-update check on every startup ───────────────────────
1403
+ async function whaleWatcher() {
1404
+ if (!process.stdin.isTTY) return; // skip in --print / pipe mode
1405
+ const frames = ['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'];
1406
+ let fi = 0;
1407
+ const interval = setInterval(() => {
1408
+ process.stdout.write(`\r 🐋 ${chalk.bold('Whale Watcher')} ${chalk.dim(frames[fi++ % frames.length]+' checking for updates...')} `);
1409
+ }, 80);
1410
+ const clear = () => process.stdout.write('\r' + ' '.repeat(60) + '\r');
1411
+ try {
1412
+ const res = await fetch('https://registry.npmjs.org/tsunami-code/latest',
1413
+ { signal: AbortSignal.timeout(5000) });
1414
+ const { version: latest } = await res.json();
1415
+ clearInterval(interval); clear();
1416
+ if (latest && latest !== VERSION) {
1417
+ process.stdout.write(` 🐋 ${chalk.bold('Whale Watcher')} ${chalk.cyan(`update available`)} ${chalk.dim(`v${VERSION} → v${latest}`)}\n`);
1418
+ process.stdout.write(chalk.dim(' Installing...\n'));
1419
+ try {
1420
+ execSync(`npm install -g tsunami-code@${latest}`, { stdio: 'pipe' });
1421
+ process.stdout.write(chalk.green(` ✓ Updated to v${latest} — restarting...\n\n`));
1422
+ const child = spawn(process.execPath, process.argv.slice(1), { stdio: 'inherit' });
1423
+ child.on('exit', code => process.exit(code || 0));
1424
+ await new Promise(() => {}); // wait for child
1425
+ } catch {
1426
+ process.stdout.write(chalk.yellow(` ⚠ Auto-update failed — run: npm install -g tsunami-code\n\n`));
1427
+ }
1428
+ }
1429
+ // up to date — silent, proceed immediately
1430
+ } catch {
1431
+ clearInterval(interval); clear(); // network error — silent
1432
+ }
1433
+ }
1434
+
1435
+ (async () => {
1436
+ await whaleWatcher();
1437
+ run().catch(e => {
1438
+ console.error(chalk.red(`Fatal: ${e.message}`));
1439
+ process.exit(1);
1440
+ });
1441
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsunami-code",
3
- "version": "3.12.0",
3
+ "version": "3.12.1",
4
4
  "description": "Tsunami Code CLI — AI coding agent by Keystone World Management Navy Seal Unit XI3",
5
5
  "type": "module",
6
6
  "bin": {