Skip to Content
SDKsTypeScriptErrors and Envelope

TypeScript Errors and Envelope

The SDK keeps language-native ergonomics while preserving raw wire-level semantics.

TypeScript

type ResponseEnvelope<T> = {
  data: T | null
  meta: {
    requestId: string
    sessionId?: string
    executionId?: string
    lineageId?: string
    timingMs: { total: number; policy?: number; route?: number; tool?: number }
  }
  error: null | { code: string; message: string; status: number; retryable: boolean }
}

Canonical Wire Rules

  • JSON keys are always camelCase on the wire
  • SDK aliases may expose snake_case or PascalCase accessors
  • Raw envelope remains available for diagnostics and logging

See Response Envelope for complete field semantics.

Last updated on