@stevederico/dotbot 0.20.1 → 0.21.0
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/CHANGELOG.md +8 -0
- package/bin/dotbot.js +45 -12
- package/dotbot.db +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/dotbot.js
CHANGED
|
@@ -60,6 +60,28 @@ async function loadModules() {
|
|
|
60
60
|
const DEFAULT_PORT = 3000;
|
|
61
61
|
const DEFAULT_DB = './dotbot.db';
|
|
62
62
|
|
|
63
|
+
// Spinner for tool execution feedback
|
|
64
|
+
let spinnerInterval = null;
|
|
65
|
+
|
|
66
|
+
function startSpinner() {
|
|
67
|
+
if (spinnerInterval) clearInterval(spinnerInterval);
|
|
68
|
+
spinnerInterval = setInterval(() => {
|
|
69
|
+
process.stdout.write('.');
|
|
70
|
+
}, 300);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function stopSpinner(text = 'done') {
|
|
74
|
+
if (spinnerInterval) {
|
|
75
|
+
clearInterval(spinnerInterval);
|
|
76
|
+
spinnerInterval = null;
|
|
77
|
+
if (text) {
|
|
78
|
+
process.stdout.write(` ${text}\n`);
|
|
79
|
+
} else {
|
|
80
|
+
process.stdout.write('\n');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
63
85
|
/**
|
|
64
86
|
* Print help message.
|
|
65
87
|
*/
|
|
@@ -216,7 +238,8 @@ async function runChat(message, options) {
|
|
|
216
238
|
|
|
217
239
|
const messages = [{ role: 'user', content: message }];
|
|
218
240
|
|
|
219
|
-
process.stdout.write('\n');
|
|
241
|
+
process.stdout.write('\n[thinking] ');
|
|
242
|
+
startSpinner();
|
|
220
243
|
|
|
221
244
|
for await (const event of agentLoop({
|
|
222
245
|
model: options.model,
|
|
@@ -227,18 +250,22 @@ async function runChat(message, options) {
|
|
|
227
250
|
})) {
|
|
228
251
|
switch (event.type) {
|
|
229
252
|
case 'thinking':
|
|
230
|
-
|
|
231
|
-
process.stdout.write(`\x1b[2m${event.text}\x1b[0m`);
|
|
232
|
-
}
|
|
253
|
+
// Already showing spinner, ignore thinking events
|
|
233
254
|
break;
|
|
234
255
|
case 'text_delta':
|
|
256
|
+
stopSpinner(''); // Stop thinking spinner silently
|
|
235
257
|
process.stdout.write(event.text);
|
|
236
258
|
break;
|
|
237
259
|
case 'tool_start':
|
|
238
|
-
|
|
260
|
+
stopSpinner(''); // Stop thinking spinner silently
|
|
261
|
+
process.stdout.write(`[${event.name}] `);
|
|
262
|
+
startSpinner();
|
|
239
263
|
break;
|
|
240
264
|
case 'tool_result':
|
|
241
|
-
|
|
265
|
+
stopSpinner('done');
|
|
266
|
+
break;
|
|
267
|
+
case 'tool_error':
|
|
268
|
+
stopSpinner('error');
|
|
242
269
|
break;
|
|
243
270
|
case 'error':
|
|
244
271
|
console.error(`\nError: ${event.error}`);
|
|
@@ -301,7 +328,8 @@ async function runRepl(options) {
|
|
|
301
328
|
|
|
302
329
|
messages.push({ role: 'user', content: trimmed });
|
|
303
330
|
|
|
304
|
-
process.stdout.write('\n');
|
|
331
|
+
process.stdout.write('\n[thinking] ');
|
|
332
|
+
startSpinner();
|
|
305
333
|
let assistantContent = '';
|
|
306
334
|
|
|
307
335
|
try {
|
|
@@ -314,21 +342,26 @@ async function runRepl(options) {
|
|
|
314
342
|
})) {
|
|
315
343
|
switch (event.type) {
|
|
316
344
|
case 'thinking':
|
|
317
|
-
|
|
318
|
-
process.stdout.write(`\x1b[2m${event.text}\x1b[0m`);
|
|
319
|
-
}
|
|
345
|
+
// Already showing spinner, ignore thinking events
|
|
320
346
|
break;
|
|
321
347
|
case 'text_delta':
|
|
348
|
+
stopSpinner(''); // Stop thinking spinner silently
|
|
322
349
|
process.stdout.write(event.text);
|
|
323
350
|
assistantContent += event.text;
|
|
324
351
|
break;
|
|
325
352
|
case 'tool_start':
|
|
326
|
-
|
|
353
|
+
stopSpinner(''); // Stop thinking spinner silently
|
|
354
|
+
process.stdout.write(`[${event.name}] `);
|
|
355
|
+
startSpinner();
|
|
327
356
|
break;
|
|
328
357
|
case 'tool_result':
|
|
329
|
-
|
|
358
|
+
stopSpinner('done');
|
|
359
|
+
break;
|
|
360
|
+
case 'tool_error':
|
|
361
|
+
stopSpinner('error');
|
|
330
362
|
break;
|
|
331
363
|
case 'error':
|
|
364
|
+
stopSpinner();
|
|
332
365
|
console.error(`\nError: ${event.error}`);
|
|
333
366
|
break;
|
|
334
367
|
}
|
package/dotbot.db
CHANGED
|
Binary file
|
package/package.json
CHANGED