/** trace 的存储端口 —— 落库形状由 adapter 决定,usecase 不认识 Drizzle */ import type { TraceSpan } from './contract.ts'; export type TraceStore = { /** 只增不改的两笔:开 span 写一行,收尾补 output/ended_at */ insert(span: TraceSpan): Promise; finish(id: string, patch: { output?: Record; error?: { message: string }; attributes?: Record; endedAt: string }): Promise; listByWorkflow(workflowId: string): Promise; listByTask(taskId: string): Promise; }; export type Clock = { now(): Date };