@yeaft/webchat-agent 1.0.17 → 1.0.19
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/package.json +1 -1
- package/yeaft/cli.js +7 -7
- package/yeaft/debug-trace.js +899 -740
- package/yeaft/engine.js +127 -96
- package/yeaft/llm/adapter.js +7 -3
- package/yeaft/llm/anthropic.js +16 -4
- package/yeaft/llm/openai-responses.js +22 -12
- package/yeaft/session.js +9 -17
- package/yeaft/web-bridge.js +3 -3
package/package.json
CHANGED
package/yeaft/cli.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Features:
|
|
9
9
|
* --dry-run "prompt" — Assemble system prompt + messages, don't call LLM
|
|
10
|
-
* --trace stats|recent|search <keyword>|tools|compact — Query/maintain debug
|
|
10
|
+
* --trace stats|recent|search <keyword>|tools|compact — Query/maintain debug trace files
|
|
11
11
|
* -i / --interactive — REPL mode with / commands
|
|
12
12
|
* <prompt> — One-shot query (Phase 1: engine.query)
|
|
13
13
|
* --skip-mcp — Skip MCP server connections (faster startup)
|
|
@@ -117,12 +117,12 @@ function parseArgs(argv) {
|
|
|
117
117
|
// ─── Trace query handler ───────────────────────────────────────
|
|
118
118
|
|
|
119
119
|
function handleTraceQuery(args, config) {
|
|
120
|
-
const
|
|
120
|
+
const traceDir = config.dir;
|
|
121
121
|
let trace;
|
|
122
122
|
try {
|
|
123
|
-
trace = new DebugTrace(
|
|
123
|
+
trace = new DebugTrace(traceDir);
|
|
124
124
|
} catch (e) {
|
|
125
|
-
throw new Error(`Cannot open debug
|
|
125
|
+
throw new Error(`Cannot open debug trace store at ${traceDir}: ${e.message}`);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
try {
|
|
@@ -133,7 +133,7 @@ function handleTraceQuery(args, config) {
|
|
|
133
133
|
console.log(` Turns: ${s.turnCount}`);
|
|
134
134
|
console.log(` Tools: ${s.toolCount}`);
|
|
135
135
|
console.log(` Events: ${s.eventCount}`);
|
|
136
|
-
console.log(`
|
|
136
|
+
console.log(` Disk: ${(s.dbSizeBytes / 1024).toFixed(1)} KB`);
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
139
|
case 'recent': {
|
|
@@ -175,8 +175,8 @@ function handleTraceQuery(args, config) {
|
|
|
175
175
|
}
|
|
176
176
|
case 'compact': {
|
|
177
177
|
const s = trace.stats();
|
|
178
|
-
console.log(`Compacting debug
|
|
179
|
-
console.log('This
|
|
178
|
+
console.log(`Compacting debug trace files (${(s.dbSizeBytes / 1048576).toFixed(1)} MB, ${s.turnCount} turns)...`);
|
|
179
|
+
console.log('This prunes old request folders and may take a moment. Do not interrupt.');
|
|
180
180
|
const { before, after } = trace.compact();
|
|
181
181
|
const saved = Math.max(0, before - after);
|
|
182
182
|
console.log(`Done. ${(before / 1048576).toFixed(1)} MB → ${(after / 1048576).toFixed(1)} MB (reclaimed ${(saved / 1048576).toFixed(1)} MB).`);
|