TypeScript Types

Complete TypeScript type definitions for the Doorway SDK.

Core types

All types are exported from @doorway/sdk. The SDK is fully typed — every response field has a concrete type.

Status

typescript
type Status = "GROUND" | "BRIDGE" | "CONFLICT" | "PROVISIONAL";

ReasoningResult

typescript
interface ReasoningResult {
  status: Status;
  content: {
    answer: string;
    confidence: number;
    implication: string;
  };
  structure: {
    closest_shape: string;
    geometric_confidence: number;
    gap_score: number;
    fires: boolean;
  };
  bridge: {
    bridge: string;
    assumptions: string[];
    confidence: number;
  } | null;
  conflict: {
    conflict: boolean;
    message: string;
  };
  chain: ChainInfo;
  receipt: unknown;
}

ChainInfo

typescript
interface ChainInfo {
  id: string;
  root: string;
  length: number;
  verified: boolean;
}

Session types

typescript
type SessionType = "reasoning" | "vantagepoint";
type UserTier = "agi" | "asi";

interface DoorwayConfig {
  apiKey?: string;
  baseUrl?: string;
  tier?: UserTier;
}

Error types

typescript
class DoorwayError extends Error {
  code: string;
  statusCode: number;
}

class TierError extends DoorwayError {
  // Thrown when ASI features are requested on AGI tier
}

class ValidationError extends DoorwayError {
  // Thrown when request validation fails
}