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