tsunami-code 3.11.4 โ 3.11.6
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 +48 -10
- 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.
|
|
29
|
+
const VERSION = '3.11.6';
|
|
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';
|
|
@@ -64,9 +64,29 @@ const blue = (s) => chalk.blue(s);
|
|
|
64
64
|
const magenta = (s) => chalk.magenta(s);
|
|
65
65
|
|
|
66
66
|
function printBanner(serverUrl) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
const divider = chalk.cyan(' ' + 'โ'.repeat(54));
|
|
68
|
+
const thin = chalk.cyan.dim(' ' + 'โ'.repeat(54));
|
|
69
|
+
|
|
70
|
+
console.log('');
|
|
71
|
+
console.log(divider);
|
|
72
|
+
console.log('');
|
|
73
|
+
console.log(
|
|
74
|
+
' ' + chalk.bold.cyan('๐ T S U N A M I') +
|
|
75
|
+
' ' + chalk.bold.white('C O D E C L I') +
|
|
76
|
+
' ' + chalk.dim('v' + VERSION)
|
|
77
|
+
);
|
|
78
|
+
console.log('');
|
|
79
|
+
console.log(thin);
|
|
80
|
+
console.log('');
|
|
81
|
+
console.log(' ' + chalk.dim('KEYSTONE WORLD MANAGEMENT'));
|
|
82
|
+
console.log(
|
|
83
|
+
' ' + chalk.bold.white('NAVY SEAL UNIT XI3') +
|
|
84
|
+
chalk.dim(' ยท ') +
|
|
85
|
+
chalk.bold.red('INTERNATIONAL AI WARS')
|
|
86
|
+
);
|
|
87
|
+
console.log('');
|
|
88
|
+
console.log(divider);
|
|
89
|
+
console.log('');
|
|
70
90
|
}
|
|
71
91
|
|
|
72
92
|
function printToolCall(name, args, elapsedMs) {
|
|
@@ -166,6 +186,20 @@ function createHighlighter(write) {
|
|
|
166
186
|
renderLine(buf.slice(0, nl));
|
|
167
187
|
buf = buf.slice(nl + 1);
|
|
168
188
|
}
|
|
189
|
+
// Flush partial line at word boundaries so text streams word-by-word
|
|
190
|
+
// (skip inside code fences where exact formatting matters)
|
|
191
|
+
if (!inFence && buf.length > 0) {
|
|
192
|
+
const lastSpace = buf.lastIndexOf(' ');
|
|
193
|
+
if (lastSpace > 0) {
|
|
194
|
+
const partial = buf.slice(0, lastSpace + 1);
|
|
195
|
+
const styled = partial
|
|
196
|
+
.replace(/\*\*([^*\n]+)\*\*/g, (_, t) => chalk.bold(t))
|
|
197
|
+
.replace(/__([^_\n]+)__/g, (_, t) => chalk.bold(t))
|
|
198
|
+
.replace(/`([^`\n]+)`/g, (_, t) => chalk.yellow('`' + t + '`'));
|
|
199
|
+
write(styled);
|
|
200
|
+
buf = buf.slice(lastSpace + 1);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
169
203
|
};
|
|
170
204
|
}
|
|
171
205
|
|
|
@@ -1256,18 +1290,22 @@ Output ONLY the TSUNAMI.md content, starting with "# Project: <name>"`;
|
|
|
1256
1290
|
let toolTimers = {}; // track per-tool duration
|
|
1257
1291
|
|
|
1258
1292
|
spinner.start();
|
|
1259
|
-
|
|
1293
|
+
// Spinner stops the moment first text actually reaches the screen,
|
|
1294
|
+
// not on first raw token (highlighter buffers until word boundary).
|
|
1295
|
+
const highlight = createHighlighter((s) => {
|
|
1296
|
+
if (firstToken) {
|
|
1297
|
+
spinner.stop();
|
|
1298
|
+
process.stdout.write(' ');
|
|
1299
|
+
firstToken = false;
|
|
1300
|
+
}
|
|
1301
|
+
process.stdout.write(s);
|
|
1302
|
+
});
|
|
1260
1303
|
|
|
1261
1304
|
try {
|
|
1262
1305
|
await agentLoop(
|
|
1263
1306
|
currentServerUrl,
|
|
1264
1307
|
fullMessages,
|
|
1265
1308
|
(token) => {
|
|
1266
|
-
if (firstToken) {
|
|
1267
|
-
spinner.stop();
|
|
1268
|
-
process.stdout.write(' ');
|
|
1269
|
-
firstToken = false;
|
|
1270
|
-
}
|
|
1271
1309
|
highlight(token);
|
|
1272
1310
|
},
|
|
1273
1311
|
(toolName, toolArgs) => {
|