@melandlabs/contracts
v0.7.0
Published
Cross-cutting type contracts (UserType, IntegrationId, error codes, zod schemas) shared between OpenContext runtime and UI sub-projects.
Maintainers
Readme
contracts
Workspace package. Internal monorepo build artifact; not published to npm. End users install
@melandlabs/opencontext(the facade) instead. Monorepo contributors depend on this package via the workspace protocol.
Cross-cutting type contracts. Types, enums, and zod schemas only — no runtime logic. Canonical source of truth for boundary shapes.
Contents
| Sub-path | What it defines |
| -------------------------- | --------------------------------------------------------------------------------------------- |
| contracts (root) | Barrel — re-exports everything |
| contracts/user-type | UserType = "guest" \| "regular" \| "basic" \| "pro" \| "team" + isUserType, USER_TYPES |
| contracts/integration-id | IntegrationId (branded string union of multiple platforms) + isIntegrationId, INTEGRATION_IDS |
| contracts/errors | AuthErrorCode enum |
| contracts/schemas | UserTypeSchema, IntegrationIdSchema (zod) |
Conventions
- No
react,next,@tauri-apps/api,bcrypt-ts, etc. — this package must remain pure. zodis an optional peer dependency. Onlyschemas.tsimports from it; the rest of the package has zero runtime deps.- No domain types here. Domain-specific shapes belong in their owning
runtime package (e.g. memory graph contracts live in
memory-store).
Build
pnpm --filter @melandlabs/contracts buildProduces dist/ with ESM + .d.ts via the shared tsup preset.
