Public declaration syntax from forge-ts/packages/forge-telemetry/src/contract.ts Original source SHA-256: 26b1c724b21a71f748efe0b4bf83a8bfd3130fd20af29cdf249cb5e9a2716ca2 Function bodies and constant values are omitted. This is not the complete implementation. Source line 21 export const AuditEventKind /* type inferred in source */; Source line 34 export type AuditEventKindType = (typeof AuditEventKind)[keyof typeof AuditEventKind]; Source line 46 export class SpanId { readonly value: string; static generate(): SpanId; static fromString(id: string): SpanId; toString(): string; } Source line 97 export class AuditEvent { readonly kind: AuditEventKindType; readonly agentDid: string; readonly timestamp: string; readonly details: Record; readonly signature: string | undefined; static create( kind: AuditEventKindType, agentDid: string, details: Record ): AuditEvent; withSignature(signature: string): AuditEvent; isSigned(): boolean; toJSON(): Record; } Source line 175 export interface TelemetryContract { /** * Start a new span with the given name and attributes. * * @param name - The span name (use dotted notation, e.g., "anvil.generate"). * @param attributes - Key-value pairs of span attributes. * @returns A unique SpanId for the started span. */ startSpan(name: string, attributes: ReadonlyArray): SpanId; /** * End a previously started span. * * @param spanId - The ID returned by startSpan. */ endSpan(spanId: SpanId): void; /** * Emit an audit event for the agent's audit trail. * * @param event - The audit event to record. */ emitEvent(event: AuditEvent): void; /** * Flush any buffered telemetry data to the backend. * * @throws {TelemetryError} If the flush operation fails. */ flush(): void; } Source line 223 export class NoopTelemetry implements TelemetryContract { startSpan(_name: string, _attributes: ReadonlyArray): SpanId; endSpan(_spanId: SpanId): void; emitEvent(_event: AuditEvent): void; flush(): void; }