---
description: Core type boundary -- what belongs in core/types, import rules, schema conventions
paths:
  - core/types/**
---
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
<!-- Regenerate: pnpm scaffold:sync -->


# Core Types

`core/types/` is the browser-safe type boundary between the frontend (`ui/`) and platform runtime (`operations/`). Both runtimes import from here but never from each other.

Keep this as a standalone rule because it autoloads only for `core/types/**` edits. Operations workflow rules can reference this boundary, but shared browser-safe contract guidance belongs here.

## What Belongs Here

- Zod schemas for workflow input/output contracts
- TypeScript types inferred from those schemas (`z.infer<typeof schema>`)
- Domain types referenced by both runtimes (status enums, entity shapes)
- Shared constants

## What Does NOT Belong Here

- React components, hooks, or anything importing `react`
- SDK runtime code or anything importing `@elevasis/sdk/worker`
- Browser APIs or Node-specific APIs
- Implementation logic -- types and constants only

## Schema Convention

Define Zod schemas first, then infer the type:

```typescript
export const fooInputSchema = z.object({ ... })
export type FooInput = z.infer<typeof fooInputSchema>
```

Name schemas `<name>InputSchema` / `<name>OutputSchema`. Name types `<Name>Input` / `<Name>Output`.

## File Organization

Types live in `core/types/`. The directory structure:

- `core/types/index.ts` -- Main entry point, re-exports from domain files
- `core/types/entities.ts` -- Entity contracts extending published base entities
- As the project grows: split into domain files within the directory (e.g., `core/types/billing.ts`, `core/types/auth.ts`)
- Re-export new domain files from `core/types/index.ts`

## Path Alias

Project tsconfigs resolve `@core/*` to `core/*`. Always use `@core/types` or `@core/types/entities` (not relative paths) when importing shared contracts from `ui/` or `operations/src/`.
