Types & Constants
TypeScript types, interfaces, JobStatus, JOB_TYPES registry, and SDK constants
This page catalogs the TypeScript types and constants the SDK exports — the shapes of its configuration, job progress events, submission parameters, and the JOB_TYPES registry of supported tools. Reach for it when you want compile-time safety on the values you pass to and receive from the Client and Jobs methods, or when you need the canonical list of valid tool names and job statuses. It also documents the Harness session types used by the Harness Sessions API.
SDK Types Reference
Planned specification. @ivybiosciences/sdk is not released, and there is no package to install. This page describes the SDK's planned interface. To call the platform today, use the REST API, the ivybloom CLI, or the MCP server.
Core TypeScript types exported from @ivybiosciences/sdk. These types define the SDK's configuration, events, and domain models.
JobStatus
All possible states for a computational job in the IvyAI system.
Lifecycle Diagram
Values
| Status | Description |
|---|---|
PENDING | Job accepted and queued for execution |
STARTED | Modal container provisioned, initializing |
PROCESSING | Main computation running |
PROGRESS | Intermediate update (may include phase info) |
COMPLETED | Finished successfully; results available |
FAILURE | Fatal error; see JobProgress.error |
CANCELLED | Cancelled by user before completion |
IMPORTED | Migrated from another system (guest → authenticated) |
TERMINAL_STATUSES
Set of JobStatus values that indicate a job has reached a final state.
Once a job is in a terminal status, it will never change status again.
Example
IvyClientConfig
Configuration for creating an IvyClient instance. Exactly one of apiKey or getToken must be provided.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
baseUrl | string | Production endpoint | API base URL including /api/v1 prefix |
apiKey | string | — | API key with ivy_ prefix. Mutually exclusive with getToken |
getToken | () => Promise<string | null> | — | Async JWT provider (e.g., Clerk). Mutually exclusive with apiKey |
timeout | number | 30000 | HTTP request timeout in milliseconds |
retries | number | 3 | Max retries for transient failures (429, 5xx) |
onError | (error: Error) => void | — | Global callback for unhandled SDK errors |
Examples
JobProgress
Real-time progress snapshot of a computational job. Delivered via WebSocket subscription or HTTP polling.
Fields
| Field | Type | Description |
|---|---|---|
jobId | string | Unique job identifier (format: job_{uuid4}) |
status | JobStatus | Current lifecycle state |
progress | number? | Overall completion percentage (0–100) |
phase | string? | Current computational phase name |
result | Record<string, unknown>? | Structured result data (only when COMPLETED) |
error | string? | Error description (only when FAILURE) |
presignedUrl | string? | Time-limited S3 download URL for artifacts |
updatedAt | string? | ISO 8601 timestamp of last status change |
Standard Phases
| Phase | Typical Progress | Description |
|---|---|---|
initialization | ~5% | Input validation |
data_preprocessing | ~15% | Data loading and prep |
model_loading | ~10% | ML model initialization |
main_computation | ~50% | Core processing |
post_processing | ~15% | Result analysis |
result_generation | ~5% | Format and store |
Examples
JobProgressCallback
Callback function invoked with progress updates during job execution.
Used by SubmitAndWaitOptions.onProgress and the useIvyJob hook.
SubmitJobParams
Parameters for submitting a new computational job.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
toolName | string | Yes | Computational tool to run (see JOB_TYPES) |
parameters | Record<string, unknown> | Yes | Tool-specific input parameters |
projectId | string | No | Project for billing/access control |
jobTitle | string | No | Human-readable title for dashboard |
orgId | string | No | Organization ID for team-scoped jobs |
analysisLevel | "basic" | "standard" | "comprehensive" | No | Analysis depth (default: "standard") |
Analysis Levels
| Level | Description | Data Fields |
|---|---|---|
basic | Fast results, minimal metrics | Standard output only |
standard | Balanced analysis (default) | Key quality metrics |
comprehensive | Full analytical suite | 5-10x more fields |
Examples
SubmitAndWaitOptions
Options for the submitAndWait() convenience method. Controls how the SDK monitors job progress until completion.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
onProgress | JobProgressCallback | — | Called on each status/progress change |
pollInterval | number | 3000 | Polling interval in ms (fallback mode) |
timeout | number | 600000 | Max wait time in ms (throws IvyTimeoutError) |
useWebSocket | boolean | true | Use WebSocket for real-time updates |
WebSocketOptions
Configuration for WebSocket connection behavior. Controls reconnection strategy and lifecycle callbacks.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
autoReconnect | boolean | true | Reconnect on unexpected close (non-1000 code) |
maxReconnectAttempts | number | 5 | Max consecutive reconnection attempts |
reconnectInterval | number | 1000 | Base delay in ms (doubles each attempt) |
onReconnect | (attempt: number) => void | — | Called on each reconnection attempt |
onClose | (code: number, reason: string) => void | — | Called when connection closes |
Reconnection Backoff
JobType
Union type of all valid tool names. Derived from the JOB_TYPES constant.
Example
Constants
Exported constants from the main entry point:
| Constant | Value | Description |
|---|---|---|
DEFAULT_BASE_URL | "https://www.ivybiosciences.com/api/v1" | Planned default: the web app's API on our own domain |
JOB_TYPES | { esmfold: "...", ... } | Complete tool registry (see below) |
Internal Defaults
These values are used internally by the SDK and configured via IvyClientConfig or SubmitAndWaitOptions. They are not exported but documented here for reference:
| Default | Value | Configured via |
|---|---|---|
| HTTP timeout | 30000 (30s) | IvyClientConfig.timeout |
| Retry attempts | 3 | IvyClientConfig.retries |
| Poll interval | 3000 (3s) | SubmitAndWaitOptions.pollInterval |
| Wait timeout | 600000 (10min) | SubmitAndWaitOptions.timeout |
| WS ping interval | 25000 (25s) | Not configurable |
JOB_TYPES Registry
Complete registry of supported computational tools.
Structure Prediction
| Key | Description |
|---|---|
esmfold | Protein structure prediction (GPU) |
esm3_generate | ESM3 protein generation |
esm3_inverse_fold | ESM3 inverse folding |
esm3_embeddings | ESM3 protein embeddings |
Molecular Docking & Design
| Key | Description |
|---|---|
diffdock | Protein-ligand docking (GPU) |
reinvent | De novo molecule generation |
fragment_growing | Fragment-based drug design. Retired, no replacement |
fragment_library | Fragment library management. Retired, no replacement |
Property Prediction
| Key | Description |
|---|---|
admet_ai | ADMET property prediction |
admetlab3 | ADMETLab3 comprehensive profiling. Retired, use admet_ai |
graphsol | Aqueous solubility prediction |
deepsol | Deep learning solubility. Not currently callable, use graphsol |
protox3 | Protein toxicity prediction. Retired, use admet_ai for the overlapping endpoints |
deeppurpose | Drug-target interaction |
Database Screening
| Key | Description |
|---|---|
rdkit_full | RDKit SMILES validation & properties |
zinc | ZINC database screening |
pubchem | PubChem compound queries |
Sequence & Structure
| Key | Description |
|---|---|
blast | Sequence homology search |
biotite_fetch | UniProt/PDB structure fetching |
aizynthfinder | Retrosynthetic route planning |
Literature & NLP
| Key | Description |
|---|---|
biobert_pubmed | Scientific literature mining |
Example
Harness Types
Types used by the Harness Sessions API. Exported from @pleach/core/types.
SessionState
The full state of a harness session.
StreamEvent
Events emitted during harness session execution via SSE. See Message Execution for the full reference.
VersionVector
Used for multi-client synchronization. See Sync Protocol.
SyncMode
Conflict resolution mode for the sync endpoint.
CheckpointSource
What triggered a checkpoint.
Was this page helpful?