Public declaration syntax from forge-ts/packages/forge-telemetry/src/collector.ts Original source SHA-256: 571cb2531cb02d67549971d165535c81cb20f88ba37e41801f4f80ddda1fc1fa Function bodies and constant values are omitted. This is not the complete implementation. Source line 23 export interface CompletedSpan { /** The unique identifier for this span. */ readonly spanId: SpanId; /** The span name (e.g., "anvil.generate", "anvil.tool.invoke"). */ readonly name: string; /** Key-value attributes associated with this span. */ readonly attributes: ReadonlyArray; /** ISO 8601 timestamp of when the span was started. */ readonly startTime: string; /** ISO 8601 timestamp of when the span was ended. */ readonly endTime: string; /** The agent's OAS DID, if available. */ readonly agentDid: string | undefined; } Source line 44 export interface SpanCollector { /** Record a completed span. */ recordSpan(span: CompletedSpan): void; /** Retrieve all recorded spans. */ spans(): CompletedSpan[]; /** Clear all recorded spans. */ clear(): void; /** Number of recorded spans. */ len(): number; /** Returns true if no spans have been recorded. */ isEmpty(): boolean; } Source line 67 export class NoopCollector implements SpanCollector { recordSpan(_span: CompletedSpan): void; spans(): CompletedSpan[]; clear(): void; len(): number; isEmpty(): boolean; } Source line 106 export class InMemoryCollector implements SpanCollector { recordSpan(span: CompletedSpan): void; spans(): CompletedSpan[]; clear(): void; len(): number; isEmpty(): boolean; } Source line 157 export class InMemoryTelemetry implements TelemetryContract { constructor(agentDid?: string); startSpan(name: string, attributes: ReadonlyArray): SpanId; endSpan(spanId: SpanId): void; emitEvent(event: AuditEvent): void; flush(): void; completedSpans(): CompletedSpan[]; events(): AuditEvent[]; clear(): void; spanCount(): number; eventCount(): number; }