mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-06-12 00:13:17 +00:00
0926d053b0
- A1+C2: Include token usage in run.completed event payload for WS clients
- A2: Cost tracking with model pricing config, cost calculation, and cost summary API
- A3: Budget enforcement per agent with monthly budget limits (migration 000015)
- C1: External wake/trigger API (POST /v1/agents/{id}/wake) for orchestrators
- C3: Activity audit trail with structured logging and queryable API
- UI: Activity page, cost stat card on overview, budget section in agent detail
- i18n: Complete en/vi/zh translations for all new features
19 lines
732 B
SQL
19 lines
732 B
SQL
ALTER TABLE agents ADD COLUMN budget_monthly_cents INTEGER;
|
|
|
|
CREATE TABLE activity_logs (
|
|
id UUID PRIMARY KEY DEFAULT uuid_generate_v7(),
|
|
actor_type VARCHAR(20) NOT NULL,
|
|
actor_id VARCHAR(255) NOT NULL,
|
|
action VARCHAR(100) NOT NULL,
|
|
entity_type VARCHAR(50),
|
|
entity_id VARCHAR(255),
|
|
details JSONB,
|
|
ip_address VARCHAR(45),
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX idx_activity_logs_actor ON activity_logs (actor_type, actor_id);
|
|
CREATE INDEX idx_activity_logs_action ON activity_logs (action);
|
|
CREATE INDEX idx_activity_logs_entity ON activity_logs (entity_type, entity_id);
|
|
CREATE INDEX idx_activity_logs_created ON activity_logs (created_at DESC);
|