tsunami-code 3.11.4 → 3.11.5

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 +25 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  } from './lib/memory.js';
27
27
  import { listMemories, readMemory, saveMemory, deleteMemory, getMemdirPath } from './lib/memdir.js';
28
28
 
29
- const VERSION = '3.11.4';
29
+ const VERSION = '3.11.5';
30
30
  const CONFIG_DIR = join(os.homedir(), '.tsunami-code');
31
31
  const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
32
32
  const DEFAULT_SERVER = 'https://radiometric-reita-amuck.ngrok-free.dev';
@@ -166,6 +166,20 @@ function createHighlighter(write) {
166
166
  renderLine(buf.slice(0, nl));
167
167
  buf = buf.slice(nl + 1);
168
168
  }
169
+ // Flush partial line at word boundaries so text streams word-by-word
170
+ // (skip inside code fences where exact formatting matters)
171
+ if (!inFence && buf.length > 0) {
172
+ const lastSpace = buf.lastIndexOf(' ');
173
+ if (lastSpace > 0) {
174
+ const partial = buf.slice(0, lastSpace + 1);
175
+ const styled = partial
176
+ .replace(/\*\*([^*\n]+)\*\*/g, (_, t) => chalk.bold(t))
177
+ .replace(/__([^_\n]+)__/g, (_, t) => chalk.bold(t))
178
+ .replace(/`([^`\n]+)`/g, (_, t) => chalk.yellow('`' + t + '`'));
179
+ write(styled);
180
+ buf = buf.slice(lastSpace + 1);
181
+ }
182
+ }
169
183
  };
170
184
  }
171
185
 
@@ -1256,18 +1270,22 @@ Output ONLY the TSUNAMI.md content, starting with "# Project: <name>"`;
1256
1270
  let toolTimers = {}; // track per-tool duration
1257
1271
 
1258
1272
  spinner.start();
1259
- const highlight = createHighlighter((s) => process.stdout.write(s));
1273
+ // Spinner stops the moment first text actually reaches the screen,
1274
+ // not on first raw token (highlighter buffers until word boundary).
1275
+ const highlight = createHighlighter((s) => {
1276
+ if (firstToken) {
1277
+ spinner.stop();
1278
+ process.stdout.write(' ');
1279
+ firstToken = false;
1280
+ }
1281
+ process.stdout.write(s);
1282
+ });
1260
1283
 
1261
1284
  try {
1262
1285
  await agentLoop(
1263
1286
  currentServerUrl,
1264
1287
  fullMessages,
1265
1288
  (token) => {
1266
- if (firstToken) {
1267
- spinner.stop();
1268
- process.stdout.write(' ');
1269
- firstToken = false;
1270
- }
1271
1289
  highlight(token);
1272
1290
  },
1273
1291
  (toolName, toolArgs) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsunami-code",
3
- "version": "3.11.4",
3
+ "version": "3.11.5",
4
4
  "description": "Tsunami Code CLI — AI coding agent by Keystone World Management Navy Seal Unit XI3",
5
5
  "type": "module",
6
6
  "bin": {