feat: 添加 tokens 统计和耗时显示功能

- 添加进程级别累计 CompletionTokens 统计
- 显示此次消耗 tokens 和耗时
- 显示累计 tokens(hxclaw 进程级别)
- 使用 lipgloss 样式(icon #ffcc80, text #5c7a9a)
- 更新 AGENTS.md 构建说明
This commit is contained in:
2026-04-12 03:04:54 +08:00
parent 1568c63462
commit f85092175e
5 changed files with 75 additions and 5 deletions

6
go.mod
View File

@@ -4,14 +4,15 @@ go 1.25.9
require (
charm.land/bubbles/v2 v2.1.0
charm.land/bubbletea/v2 v2.0.2
charm.land/glamour/v2 v2.0.0
charm.land/lipgloss/v2 v2.0.2
github.com/ergochat/readline v0.1.3
github.com/muesli/termenv v0.16.0
github.com/sipeed/picoclaw v0.0.0
)
require (
charm.land/glamour/v2 v2.0.0 // indirect
charm.land/bubbletea/v2 v2.0.2 // indirect
github.com/adhocore/gronx v1.19.6 // indirect
github.com/alecthomas/chroma/v2 v2.14.0 // indirect
github.com/anthropics/anthropic-sdk-go v1.26.0 // indirect
@@ -61,7 +62,6 @@ require (
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
github.com/modelcontextprotocol/go-sdk v1.5.0 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/openai/openai-go/v3 v3.22.0 // indirect
github.com/pion/randutil v0.1.0 // indirect