Reference

TypeScript SDK

The evaris package is a TypeScript client for the Evaris backend. It has two layers: a generated client (from the OpenAPI spec) and a hand-written inspect helper on top.

import { publishInspectLogs, RunsService, OpenAPI } from "evaris";

Configuration

The generated client reads global config from the OpenAPI object. Set both fields before calling any service:

import { OpenAPI } from "evaris";

OpenAPI.BASE = "https://api.your-evaris-deploy.example";
OpenAPI.TOKEN = "<project-api-token>";   // sent as: Authorization: Bearer <token>

publishInspectLogs sets these from its apiUrl / apiToken options, so you do not normally touch OpenAPI directly when using that helper.

Other rarely-used fields: WITH_CREDENTIALS, CREDENTIALS, HEADERS.

Services

All service methods return a CancelablePromise<T> and throw ApiError on non-2xx responses. The error's status field matches the codes documented below.

RunsService

The eval-run lifecycle. Every method requires OpenAPI.TOKEN to be set.

MethodHTTPEndpointPurpose
createRun({ requestBody })POST/v1/runsCreate a run in created status
createArtifactUpload({ runId, requestBody })POST/v1/runs/{run_id}/artifacts/upload-urlGet a pre-signed PUT target for an artifact
putArtifactUpload({ runId, artifactId, requestBody })PUT/v1/runs/{run_id}/artifact-uploads/{artifact_id}Upload the raw artifact bytes
completeRun({ runId, requestBody })POST/v1/runs/{run_id}/completeSubmit the manifest, enqueue ingestion
getRun({ runId })GET/v1/runs/{run_id}Fetch a run
deleteRun({ runId })DELETE/v1/runs/{run_id}Delete a run (only in created status)

createRun

const run = await RunsService.createRun({
  requestBody: {
    project_id: "<project-id>",
    execution_mode: "external",     // or "managed"
    name: "optional-run-name",
    tags: { env: "staging" },       // optional, defaults to {}
  },
});
// run.run_id, run.status === "created", run.created_at, ...

createArtifactUpload

const upload = await RunsService.createArtifactUpload({
  runId: run.run_id,
  requestBody: {
    type: "inspect_eval_log",            // only type today
    file_name: "task.eval",
    content_type: "application/json",     // or application/octet-stream
    size_bytes: 1234,
    checksum_sha256: "<hex>",
  },
});
// upload.artifact_id, upload.upload_url, upload.headers, upload.expires_at

putArtifactUpload

await RunsService.putArtifactUpload({
  runId: run.run_id,
  artifactId: upload.artifact_id,
  requestBody: new Blob([bytes], { type: contentType }),
});

completeRun

const completed = await RunsService.completeRun({
  runId: run.run_id,
  requestBody: manifest,   // RunManifest, see data-model.md
});
// completed.status ∈ { succeeded, ingested_with_warnings, failed }

getRun / deleteRun

const run = await RunsService.getRun({ runId: "<id>" });
await RunsService.deleteRun({ runId: "<id>" });   // 409 if not deletable

SetupService

Session-gated (browser only). Used by the web UI, not by publishers.

MethodHTTPEndpointPurpose
bootstrapSetup()POST/v1/setup/bootstrapProvision tenant + default project
createProjectApiToken({ projectId, requestBody })POST/v1/setup/projects/{project_id}/api-tokensMint a project API token (returned once)

SystemService

Unauthenticated probes.

MethodHTTPEndpointResponse
getHealth()GET/health{ status: "ok" }
getVersion()GET/version{ name: "evaris-backend-service", version: "<semver>" }

Inspect helper

import { publishInspectLogs, discoverInspectLogFiles, sha256Bytes, detectInspectAiVersion } from "evaris";

publishInspectLogs(options) wraps the full create → upload → complete sequence. See Publish eval logs for the full contract. The package also exports the underlying utilities (discoverInspectLogFiles, sha256Bytes, detectInspectAiVersion, statFile) for callers building custom publish flows.

Models

The package exports the generated models: Run, RunManifest, ArtifactManifest, Artifact, ArtifactUpload, InspectSource, RunWarning, ProjectApiToken, BootstrapSetupResponse, SetupTenant, SetupProject, and the request types. Each model with an enum (e.g. Run) also exports a namespace with the enum values. See Data model for the shapes.

Known gaps

  • listRuns is not in the generated client. The OpenAPI spec defines a listRuns operation (GET /v1/runs with pagination), but the published SDK has not been regenerated since the route was added. CLI users cannot list runs yet.
  • Dual ESM/CJS: the package is published ESM-only. CommonJS consumers cannot require("evaris"). Acceptable for the inspect-ai audience (modern Node); if needed later, tsup can emit both formats with no rewrite.
  • No automatic retry/backoff in the generated client or the helper. A transient 5xx fails the publish. Callers in flaky environments should wrap.