@vurb/prisma-gen
v3.6.6
Published
Prisma Generator for Vurb. Reads schema annotations (@vurb.hide, @vurb.describe, @vurb.tenantKey) and emits hardened Presenters and ToolBuilders with field-level security, tenant isolation, and OOM protection.
Downloads
274
Maintainers
Readme
A compile-time Prisma Generator that reads
schema.prismaannotations and emits hardened Vurb.ts Presenters and ToolBuilders — with field-level security, tenant isolation, and OOM protection baked into the generated code.
Quick Start
generator mcp {
provider = "vurb-prisma-gen"
output = "../src/tools/database"
}
model User {
id String @id @default(uuid())
email String @unique
passwordHash String /// @vurb.hide
stripeToken String /// @vurb.hide
creditScore Int /// @vurb.describe("Score 0-1000. Above 700 is PREMIUM.")
tenantId String /// @vurb.tenantKey
}npx prisma generate
# → src/tools/database/userPresenter.ts
# → src/tools/database/userTools.ts
# → src/tools/database/index.tsFeatures
| Feature | Description |
|---------|-------------|
| Egress Firewall | @vurb.hide physically excludes columns from the generated Zod response schema — SOC2 at compile time |
| Semantic Descriptions | @vurb.describe("...") injects domain semantics into generated Zod fields |
| Tenant Isolation | @vurb.tenantKey injects tenant filters into every query's WHERE clause |
| OOM Guard | Pagination enforced with take (capped at 50) and skip — unbounded queries are structurally impossible |
| Inversion of Control | Generates ToolBuilder + Presenter files, not a server. You wire them in |
Schema Annotations
| Annotation | Effect |
|---|---|
| /// @vurb.hide | Excludes the field from the generated Zod response schema |
| /// @vurb.describe("...") | Adds .describe() to the Zod field — LLM reads this as a business rule |
| /// @vurb.tenantKey | Injects the field into every query's WHERE clause from ctx |
Installation
npm install @vurb/prisma-gen vurb zodPeer Dependencies
| Package | Version |
|---------|---------|
| vurb | ^2.0.0 |
| zod | ^3.25.1 \|\| ^4.0.0 |
| prisma | ^6.0.0 |
Requirements
- Node.js ≥ 18.0.0
- Vurb.ts ≥ 2.0.0 (peer dependency)
- Prisma ≥ 6.0.0
