@vurb/prisma-gen 3.6.6 → 3.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -83
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<h1 align="center">@vurb/prisma-gen</h1>
|
|
3
|
-
<p align="center">
|
|
4
|
-
<strong>Prisma Schema → MCP Tools Generator</strong> — Compile-time CRUD generation with field-level security
|
|
5
|
-
</p>
|
|
6
|
-
</p>
|
|
7
|
-
|
|
8
|
-
<p align="center">
|
|
9
|
-
<a href="https://www.npmjs.com/package/@vurb/prisma-gen"><img src="https://img.shields.io/npm/v/@vurb/prisma-gen?color=blue" alt="npm" /></a>
|
|
10
|
-
<a href="https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="License" /></a>
|
|
11
|
-
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node" />
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
> A compile-time Prisma Generator that reads `schema.prisma` annotations and emits hardened Vurb.ts Presenters and ToolBuilders — with field-level security, tenant isolation, and OOM protection baked into the generated code.
|
|
17
|
-
|
|
18
|
-
## Quick Start
|
|
19
|
-
|
|
20
|
-
```prisma
|
|
21
|
-
generator mcp {
|
|
22
|
-
provider = "vurb-prisma-gen"
|
|
23
|
-
output = "../src/tools/database"
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
model User {
|
|
27
|
-
id String @id @default(uuid())
|
|
28
|
-
email String @unique
|
|
29
|
-
passwordHash String /// @vurb.hide
|
|
30
|
-
stripeToken String /// @vurb.hide
|
|
31
|
-
creditScore Int /// @vurb.describe("Score 0-1000. Above 700 is PREMIUM.")
|
|
32
|
-
tenantId String /// @vurb.tenantKey
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npx prisma generate
|
|
38
|
-
# → src/tools/database/userPresenter.ts
|
|
39
|
-
# → src/tools/database/userTools.ts
|
|
40
|
-
# → src/tools/database/index.ts
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Features
|
|
44
|
-
|
|
45
|
-
| Feature | Description |
|
|
46
|
-
|---------|-------------|
|
|
47
|
-
| **Egress Firewall** | `@vurb.hide` physically excludes columns from the generated Zod response schema — SOC2 at compile time |
|
|
48
|
-
| **Semantic Descriptions** | `@vurb.describe("...")` injects domain semantics into generated Zod fields |
|
|
49
|
-
| **Tenant Isolation** | `@vurb.tenantKey` injects tenant filters into every query's WHERE clause |
|
|
50
|
-
| **OOM Guard** | Pagination enforced with `take` (capped at 50) and `skip` — unbounded queries are structurally impossible |
|
|
51
|
-
| **Inversion of Control** | Generates `ToolBuilder` + `Presenter` files, not a server. You wire them in |
|
|
52
|
-
|
|
53
|
-
## Schema Annotations
|
|
54
|
-
|
|
55
|
-
| Annotation | Effect |
|
|
56
|
-
|---|---|
|
|
57
|
-
| `/// @vurb.hide` | Excludes the field from the generated Zod response schema |
|
|
58
|
-
| `/// @vurb.describe("...")` | Adds `.describe()` to the Zod field — LLM reads this as a business rule |
|
|
59
|
-
| `/// @vurb.tenantKey` | Injects the field into every query's `WHERE` clause from `ctx` |
|
|
60
|
-
|
|
61
|
-
## Installation
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
npm install @vurb/prisma-gen vurb zod
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Peer Dependencies
|
|
68
|
-
|
|
69
|
-
| Package | Version |
|
|
70
|
-
|---------|---------|
|
|
71
|
-
| `vurb` | `^2.0.0` |
|
|
72
|
-
| `zod` | `^3.25.1 \|\| ^4.0.0` |
|
|
73
|
-
| `prisma` | `^6.0.0` |
|
|
74
|
-
|
|
75
|
-
## Requirements
|
|
76
|
-
|
|
77
|
-
- **Node.js** ≥ 18.0.0
|
|
78
|
-
- **Vurb.ts** ≥ 2.0.0 (peer dependency)
|
|
79
|
-
- **Prisma** ≥ 6.0.0
|
|
80
|
-
|
|
81
|
-
## License
|
|
82
|
-
|
|
83
|
-
[Apache-2.0](https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE)
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">@vurb/prisma-gen</h1>
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Prisma Schema → MCP Tools Generator</strong> — Compile-time CRUD generation with field-level security
|
|
5
|
+
</p>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://www.npmjs.com/package/@vurb/prisma-gen"><img src="https://img.shields.io/npm/v/@vurb/prisma-gen?color=blue" alt="npm" /></a>
|
|
10
|
+
<a href="https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="License" /></a>
|
|
11
|
+
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node" />
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
> A compile-time Prisma Generator that reads `schema.prisma` annotations and emits hardened Vurb.ts Presenters and ToolBuilders — with field-level security, tenant isolation, and OOM protection baked into the generated code.
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```prisma
|
|
21
|
+
generator mcp {
|
|
22
|
+
provider = "vurb-prisma-gen"
|
|
23
|
+
output = "../src/tools/database"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
model User {
|
|
27
|
+
id String @id @default(uuid())
|
|
28
|
+
email String @unique
|
|
29
|
+
passwordHash String /// @vurb.hide
|
|
30
|
+
stripeToken String /// @vurb.hide
|
|
31
|
+
creditScore Int /// @vurb.describe("Score 0-1000. Above 700 is PREMIUM.")
|
|
32
|
+
tenantId String /// @vurb.tenantKey
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx prisma generate
|
|
38
|
+
# → src/tools/database/userPresenter.ts
|
|
39
|
+
# → src/tools/database/userTools.ts
|
|
40
|
+
# → src/tools/database/index.ts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
| Feature | Description |
|
|
46
|
+
|---------|-------------|
|
|
47
|
+
| **Egress Firewall** | `@vurb.hide` physically excludes columns from the generated Zod response schema — SOC2 at compile time |
|
|
48
|
+
| **Semantic Descriptions** | `@vurb.describe("...")` injects domain semantics into generated Zod fields |
|
|
49
|
+
| **Tenant Isolation** | `@vurb.tenantKey` injects tenant filters into every query's WHERE clause |
|
|
50
|
+
| **OOM Guard** | Pagination enforced with `take` (capped at 50) and `skip` — unbounded queries are structurally impossible |
|
|
51
|
+
| **Inversion of Control** | Generates `ToolBuilder` + `Presenter` files, not a server. You wire them in |
|
|
52
|
+
|
|
53
|
+
## Schema Annotations
|
|
54
|
+
|
|
55
|
+
| Annotation | Effect |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `/// @vurb.hide` | Excludes the field from the generated Zod response schema |
|
|
58
|
+
| `/// @vurb.describe("...")` | Adds `.describe()` to the Zod field — LLM reads this as a business rule |
|
|
59
|
+
| `/// @vurb.tenantKey` | Injects the field into every query's `WHERE` clause from `ctx` |
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install @vurb/prisma-gen vurb zod
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Peer Dependencies
|
|
68
|
+
|
|
69
|
+
| Package | Version |
|
|
70
|
+
|---------|---------|
|
|
71
|
+
| `vurb` | `^2.0.0` |
|
|
72
|
+
| `zod` | `^3.25.1 \|\| ^4.0.0` |
|
|
73
|
+
| `prisma` | `^6.0.0` |
|
|
74
|
+
|
|
75
|
+
## Requirements
|
|
76
|
+
|
|
77
|
+
- **Node.js** ≥ 18.0.0
|
|
78
|
+
- **Vurb.ts** ≥ 2.0.0 (peer dependency)
|
|
79
|
+
- **Prisma** ≥ 6.0.0
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
[Apache-2.0](https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vurb/prisma-gen",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.8",
|
|
4
4
|
"description": "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.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|