可观测性(Phase 3,开核)
自托管的 agent harness 缺一个轻量、harness 无关的可观测层。@agenthub/tracer 是开核对:一个事件 schema,不管你的 agent 跑在 Hermes(Python)还是 OpenClaw(Node)都能用。JSONL 就是契约。
事件链
tracer 给整条链打 span:
channel— 消息进来(Telegram/微信/…)agent— 一轮 agent 推理skill— 调用的 skillmcp_tool— MCP 工具调用cron— 后台定时任务reply— 回复出去
示例 trace(本地 dashboard 渲染)
下面是一条代表性 trace,由 tracer 的 JSONL 渲染。hosted 云 dashboard 是未来的闭源层。
用法
import { Tracer } from '@agenthub/tracer';
const t = new Tracer();
const root = t.startSpan('telegram message in', 'channel');
const agent = t.startSpan('agent turn', 'agent', { model: 'claude-fable-5' });
t.endSpan(agent);
t.endSpan(root);
console.log(t.toJSONL());源码在 packages/tracer/(TypeScript,给 OpenClaw)+ packages/tracer-python/(Python,给 Hermes),用同样 JSONL schema——两边互通。本地测试:pytest packages/tracer-python。hosted 云 dashboard 是未来的闭源层。