Where are the ClearRun TypeScript types? (@clearrun/core-types)

In @clearrun/core-types. The SDK installs it and re-exports the main types, so you can import Verdict, VerdictRisk and the request types from @clearrun/sdk.

Last updated

Applies to version 1.2.0 of @clearrun/sdk and @clearrun/cli, with @clearrun/core-types 1.2.0.

Steps

  1. Import from the SDK

    import type { Verdict, VerdictRisk, ComponentSignal, ScoreResponse } from '@clearrun/sdk';
  2. Or from core-types directly

    import { isVerdict, VERDICT_SCHEMA_VERSION } from '@clearrun/core-types';

What is in it

  • Verdict, VerdictRisk, ConfidenceInterval, ComponentSignal
  • ScoreRequest, EvaluateRequest, ChatRequest, VerifyRequest and their responses
  • Receipt and ChatContextTurn
  • ApiErrorBody, HostedApiConfig
  • isVerdict(), a runtime check

ComponentSignal

The type for one component signal in verdict.componentSignals. Paid plans (Pro, Business and Enterprise) receive four signals: Evidence support, Reasoning integrity, Confidence calibration and Ambiguity handling. Free use, developer API access and public lookups receive Evidence support and Reasoning integrity.

Receipt and chat context

ScoreResponse and EvaluateResponse have an optional receipt (type Receipt). ChatRequest has an optional context: a list of earlier turns, each with role and content. ApiErrorBody has optional retryAfter, creditsNeeded and currentBalance. These come with @clearrun/core-types 1.2.0, which SDK 1.2.0 installs.