---
title: SDK Types
description: Type reference for @elevasis/sdk package exports, resource metadata, platform types, ElevasConfig, StepHandler context, and runtime values
---

`@elevasis/sdk` bundles platform types into a self-contained package for external projects.

```bash
pnpm add @elevasis/sdk zod
```

Zod is a peer dependency.

## Package Exports

```json
{
  "exports": {
    ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
    "./worker": { "import": "./dist/worker/index.js" }
  }
}
```

- `@elevasis/sdk` -- resource, workflow, agent, trigger, deployment, and execution types plus runtime errors.
- `@elevasis/sdk/worker` -- worker runtime module, platform adapters, and worker helpers.

## Platform Types

| Type                    | Description                                                                                                                 |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `ResourceDefinition`    | Base interface for resource definitions                                                                                     |
| `ResourceType`          | Resource kind such as `workflow`, `agent`, `trigger`, `integration`, `external`, or `human_checkpoint`                      |
| `ResourceStatus`        | Resource lifecycle status such as `dev` or `prod`                                                                           |
| `ResourceLink`          | Graph link `{ nodeId, kind }` binding a resource to an Organization Model node                                              |
| `ResourceCategory`      | Operational category: `production`, `diagnostic`, `internal`, or `testing`                                                  |
| `DeploymentSpec`        | Top-level export shape: `{ workflows, agents, triggers, integrations, humanCheckpoints, externalResources, relationships }` |
| `TriggerDefinition`     | Base for trigger configuration                                                                                              |
| `IntegrationDefinition` | Integration configuration structure                                                                                         |
| `WebhookProviderType`   | Supported webhook providers                                                                                                 |
| `WebhookTriggerConfig`  | Webhook trigger configuration                                                                                               |
| `ScheduleTriggerConfig` | Cron/schedule trigger configuration                                                                                         |
| `EventTriggerConfig`    | Internal event trigger configuration                                                                                        |
| `TriggerConfig`         | Union of all trigger config types                                                                                           |

Resource metadata uses graph links:

```ts
config: {
  resourceId: 'lead-import',
  name: 'Lead Import',
  type: 'workflow',
  version: '1.0.0',
  status: 'prod',
  links: [{ nodeId: 'system:sales.lead-gen', kind: 'operates-on' }],
  category: 'production'
}
```

## Execution Types

| Type                 | Description                                                                    |
| -------------------- | ------------------------------------------------------------------------------ |
| `WorkflowDefinition` | Complete workflow definition including config, contract, steps, and entryPoint |
| `WorkflowStep`       | Individual step definition with type, handler, and next routing                |
| `WorkflowConfig`     | Metadata block: name, description, status, links, category                     |
| `StepHandler`        | Function type: `(input: unknown, context: StepContext) => Promise<unknown>`    |
| `NextConfig`         | Union of `LinearNext` and `ConditionalNext`                                    |
| `LinearNext`         | Fixed next step routing                                                        |
| `ConditionalNext`    | Branching step routing                                                         |
| `StepType`           | Runtime enum for step routing                                                  |
| `AgentDefinition`    | Complete agent definition including config, agentConfig, and tools             |
| `ExecutionContext`   | Runtime context passed to step handlers                                        |
| `ExecutionMetadata`  | Metadata about a running execution                                             |
| `ExecutionInterface` | Interface for triggering and inspecting executions                             |

## ElevasConfig

```ts
export interface ElevasConfig {
  defaultStatus?: ResourceStatus
  dev?: { port?: number }
}
```

| Field           | Type     | Default | Description                   |
| --------------- | -------- | ------- | ----------------------------- | ---------------------------------------------------------------- |
| `defaultStatus` | `'dev'   | 'prod'` | `'prod'`                      | Default status applied when resources do not set `config.status` |
| `dev.port`      | `number` | `3001`  | Local worker development port |

## StepHandler Context

```ts
import type { StepHandler, ExecutionContext } from '@elevasis/sdk'

const handler: StepHandler = async (input, context: ExecutionContext) => {
  context.logger.info('Processing', {
    executionId: context.executionId,
    resourceId: context.resourceId
  })

  await context.store.set('checkpoint', JSON.stringify({ step: 'started' }))
  return { done: true }
}
```

## Runtime Values

Runtime exports include:

- `StepType`
- `ToolingError`
- `ExecutionError`

Use `ToolingError` for platform adapter failures and `ExecutionError` for execution-level failures that should be surfaced in run history.
