@stevederico/dotbot 0.20.2 → 0.22.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 +21 -33
- package/dotbot.db +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/dotbot.js
CHANGED
|
@@ -13,12 +13,12 @@ process.emit = function (event, error) {
|
|
|
13
13
|
* dotbot CLI
|
|
14
14
|
*
|
|
15
15
|
* Usage:
|
|
16
|
-
* dotbot
|
|
17
|
-
* dotbot
|
|
18
|
-
* dotbot serve --port 3000
|
|
19
|
-
* dotbot --help
|
|
16
|
+
* dotbot "What's the weather?" One-shot query
|
|
17
|
+
* dotbot Interactive chat
|
|
18
|
+
* dotbot serve --port 3000 Start HTTP server
|
|
19
|
+
* dotbot --help Show help
|
|
20
20
|
*
|
|
21
|
-
* Requires Node.js 22
|
|
21
|
+
* Requires Node.js 22+
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import { parseArgs } from 'node:util';
|
|
@@ -64,6 +64,7 @@ const DEFAULT_DB = './dotbot.db';
|
|
|
64
64
|
let spinnerInterval = null;
|
|
65
65
|
|
|
66
66
|
function startSpinner() {
|
|
67
|
+
if (spinnerInterval) clearInterval(spinnerInterval);
|
|
67
68
|
spinnerInterval = setInterval(() => {
|
|
68
69
|
process.stdout.write('.');
|
|
69
70
|
}, 300);
|
|
@@ -89,8 +90,8 @@ function printHelp() {
|
|
|
89
90
|
dotbot v${VERSION} — AI agent CLI
|
|
90
91
|
|
|
91
92
|
Usage:
|
|
92
|
-
dotbot "message"
|
|
93
|
-
dotbot
|
|
93
|
+
dotbot "message" One-shot query
|
|
94
|
+
dotbot Interactive chat
|
|
94
95
|
dotbot serve [--port N] Start HTTP server (default: ${DEFAULT_PORT})
|
|
95
96
|
|
|
96
97
|
Options:
|
|
@@ -110,8 +111,7 @@ Environment Variables:
|
|
|
110
111
|
|
|
111
112
|
Examples:
|
|
112
113
|
dotbot "What's the weather in SF?"
|
|
113
|
-
dotbot
|
|
114
|
-
dotbot repl
|
|
114
|
+
dotbot
|
|
115
115
|
dotbot serve --port 8080
|
|
116
116
|
`);
|
|
117
117
|
}
|
|
@@ -256,7 +256,8 @@ async function runChat(message, options) {
|
|
|
256
256
|
process.stdout.write(event.text);
|
|
257
257
|
break;
|
|
258
258
|
case 'tool_start':
|
|
259
|
-
|
|
259
|
+
stopSpinner(''); // Stop thinking spinner silently
|
|
260
|
+
process.stdout.write(`[${event.name}] `);
|
|
260
261
|
startSpinner();
|
|
261
262
|
break;
|
|
262
263
|
case 'tool_result':
|
|
@@ -348,7 +349,8 @@ async function runRepl(options) {
|
|
|
348
349
|
assistantContent += event.text;
|
|
349
350
|
break;
|
|
350
351
|
case 'tool_start':
|
|
351
|
-
|
|
352
|
+
stopSpinner(''); // Stop thinking spinner silently
|
|
353
|
+
process.stdout.write(`[${event.name}] `);
|
|
352
354
|
startSpinner();
|
|
353
355
|
break;
|
|
354
356
|
case 'tool_result':
|
|
@@ -498,29 +500,15 @@ async function main() {
|
|
|
498
500
|
|
|
499
501
|
const command = args.positionals[0];
|
|
500
502
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
process.exit(1);
|
|
507
|
-
}
|
|
508
|
-
await runChat(chatMessage, args);
|
|
509
|
-
break;
|
|
510
|
-
|
|
511
|
-
case 'repl':
|
|
512
|
-
await runRepl(args);
|
|
513
|
-
break;
|
|
514
|
-
|
|
515
|
-
case 'serve':
|
|
516
|
-
await runServer(args);
|
|
517
|
-
break;
|
|
518
|
-
|
|
519
|
-
default:
|
|
520
|
-
// Default to chat if not a recognized command
|
|
521
|
-
const message = args.positionals.join(' ');
|
|
503
|
+
if (command === 'serve') {
|
|
504
|
+
await runServer(args);
|
|
505
|
+
} else {
|
|
506
|
+
const message = args.positionals.join(' ');
|
|
507
|
+
if (message) {
|
|
522
508
|
await runChat(message, args);
|
|
523
|
-
|
|
509
|
+
} else {
|
|
510
|
+
await runRepl(args);
|
|
511
|
+
}
|
|
524
512
|
}
|
|
525
513
|
}
|
|
526
514
|
|
package/dotbot.db
CHANGED
|
Binary file
|
package/package.json
CHANGED