cerber-core 1.1.4 → 1.1.6
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 +103 -36
- package/dist/cli/contract-parser.js +2 -2
- package/dist/cli/contract-parser.js.map +1 -1
- package/dist/cli/init.js +2 -2
- package/package.json +117 -106
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# 🛡️ Cerber Core
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **AI doesn't break your project. Lack of a contract does.**
|
|
4
|
+
|
|
5
|
+
**Cerber is a contract-driven project guardian for AI-assisted development.**
|
|
6
|
+
It enforces a single source of truth (CERBER.md) across pre-commit, CI, and post-deploy health gates.
|
|
4
7
|
|
|
5
8
|
[](https://www.npmjs.com/package/cerber-core)
|
|
6
9
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -10,17 +13,47 @@
|
|
|
10
13
|
**Status:** Production-ready ✅
|
|
11
14
|
**License:** MIT
|
|
12
15
|
|
|
16
|
+
## 🎯 Elevator Pitch
|
|
17
|
+
|
|
18
|
+
Cerber is not a linter.
|
|
19
|
+
It's not a CI tool.
|
|
20
|
+
It's a contract that everything else must obey.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
13
24
|
## 🚀 Try It Now
|
|
14
25
|
|
|
15
26
|
```bash
|
|
16
27
|
npm install cerber-core --save-dev
|
|
17
|
-
npx cerber
|
|
28
|
+
npx cerber init
|
|
29
|
+
# Follow prompts to generate CERBER.md contract + guardian hooks
|
|
18
30
|
```
|
|
19
31
|
|
|
20
32
|
⭐ **Like what you see?** [Star the repo](https://github.com/Agaslez/cerber-core) and share with your team!
|
|
21
33
|
|
|
22
34
|
---
|
|
23
35
|
|
|
36
|
+
## 🤖 For AI Agents (Copilot, Cursor, Windsurf, Claude, etc.)
|
|
37
|
+
|
|
38
|
+
**Cerber's one rule:** `CERBER.md` is the single source of truth.
|
|
39
|
+
|
|
40
|
+
- If `CERBER.md` is missing → generate template and **STOP**. User must fill the contract.
|
|
41
|
+
- If `CERBER.md` exists → execute contract exactly as specified.
|
|
42
|
+
- **Never guess architecture.** Never invent rules. Never auto-design.
|
|
43
|
+
|
|
44
|
+
**Schema modes:**
|
|
45
|
+
- `schema.mode: template_only` → Generate minimal starter with "NOT SOURCE OF TRUTH" header
|
|
46
|
+
- `schema.mode: strict` → Require existing schema file, never generate
|
|
47
|
+
|
|
48
|
+
**Three enforcement points:**
|
|
49
|
+
1. **Pre-commit** (Guardian) - Blocks violating commits
|
|
50
|
+
2. **CI** (GitHub Actions) - Validates on push
|
|
51
|
+
3. **Post-deploy** - Health gate checks production
|
|
52
|
+
|
|
53
|
+
**Working with Cerber:** Read `CERBER.md` first. It tells you what's allowed and what's protected.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
24
57
|
## 📊 Real Production Metrics
|
|
25
58
|
|
|
26
59
|
> From Eliksir SaaS Backend (2026-01-02 session)
|
|
@@ -145,6 +178,48 @@ export const BACKEND_SCHEMA = {
|
|
|
145
178
|
|
|
146
179
|
---
|
|
147
180
|
|
|
181
|
+
## 🤔 Why Cerber Exists
|
|
182
|
+
|
|
183
|
+
AI tools don't understand your project boundaries.
|
|
184
|
+
They generate changes that cause:
|
|
185
|
+
- **Schema drift** - Models diverge from database reality
|
|
186
|
+
- **Architecture violations** - Security patterns bypassed
|
|
187
|
+
- **CI fail loops** - 2-3 hours wasted on fixes
|
|
188
|
+
- **Deployments without health validation** - Production incidents
|
|
189
|
+
|
|
190
|
+
**Cerber fixes this by enforcing a human-written contract:**
|
|
191
|
+
**CERBER.md is the only source of truth.**
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 🔥 How Cerber is Different
|
|
196
|
+
|
|
197
|
+
**Husky** runs scripts.
|
|
198
|
+
**Linters** check syntax.
|
|
199
|
+
**CI** runs pipelines.
|
|
200
|
+
|
|
201
|
+
**Cerber enforces project intent.**
|
|
202
|
+
|
|
203
|
+
Cerber does not guess.
|
|
204
|
+
Cerber does not invent rules.
|
|
205
|
+
Cerber executes your contract.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## ✅ When to Use Cerber
|
|
210
|
+
|
|
211
|
+
**Use Cerber if:**
|
|
212
|
+
- ✅ You work with AI coding assistants / agents
|
|
213
|
+
- ✅ Your project has strict architecture or schema rules
|
|
214
|
+
- ✅ CI failures waste time
|
|
215
|
+
- ✅ You need a single source of truth for humans + AI
|
|
216
|
+
|
|
217
|
+
**Do NOT use Cerber if:**
|
|
218
|
+
- ❌ You want the tool to design your architecture
|
|
219
|
+
- ❌ You don't want to maintain a contract (CERBER.md)
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
148
223
|
## 🎯 ONE SOURCE OF TRUTH
|
|
149
224
|
|
|
150
225
|
**Critical principle:** Cerber does NOT design your system. Cerber enforces YOUR design.
|
|
@@ -175,7 +250,7 @@ In `CERBER.md` contract, you control schema generation:
|
|
|
175
250
|
```yaml
|
|
176
251
|
schema:
|
|
177
252
|
enabled: true
|
|
178
|
-
file: BACKEND_SCHEMA.
|
|
253
|
+
file: BACKEND_SCHEMA.mjs
|
|
179
254
|
mode: strict # or template_only
|
|
180
255
|
```
|
|
181
256
|
|
|
@@ -183,7 +258,7 @@ schema:
|
|
|
183
258
|
- ✅ Cerber NEVER creates schema file
|
|
184
259
|
- ✅ You create schema based on YOUR architecture
|
|
185
260
|
- ✅ Full control, no helpers, no assumptions
|
|
186
|
-
- ✅ `npx cerber init` shows: "You must create BACKEND_SCHEMA.
|
|
261
|
+
- ✅ `npx cerber init` shows: "You must create BACKEND_SCHEMA.mjs"
|
|
187
262
|
|
|
188
263
|
**For beginners → `mode: template_only`**
|
|
189
264
|
- ✅ Cerber creates minimal template if file missing
|
|
@@ -254,11 +329,11 @@ mode: dev # solo | dev | team
|
|
|
254
329
|
|
|
255
330
|
guardian:
|
|
256
331
|
enabled: true
|
|
257
|
-
schemaFile: BACKEND_SCHEMA.
|
|
332
|
+
schemaFile: BACKEND_SCHEMA.mjs
|
|
258
333
|
|
|
259
334
|
schema:
|
|
260
335
|
enabled: true
|
|
261
|
-
file: BACKEND_SCHEMA.
|
|
336
|
+
file: BACKEND_SCHEMA.mjs
|
|
262
337
|
mode: template_only # strict (mature teams) | template_only (beginners)
|
|
263
338
|
# strict = You create schema, Cerber never generates
|
|
264
339
|
# template_only = Cerber creates minimal helper if missing
|
|
@@ -317,18 +392,13 @@ npm install cerber-core --save-dev
|
|
|
317
392
|
#### 🎨 **Frontend Developer (React/Vue/Angular)**
|
|
318
393
|
|
|
319
394
|
```bash
|
|
320
|
-
# 1.
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
# 2. Copy validation script
|
|
324
|
-
mkdir -p scripts
|
|
325
|
-
cp node_modules/cerber-core/guardian/templates/validate-schema.mjs scripts/
|
|
395
|
+
# 1. Initialize Cerber (generates CERBER.md + templates)
|
|
396
|
+
npx cerber init --mode=solo
|
|
326
397
|
|
|
327
|
-
#
|
|
328
|
-
|
|
329
|
-
npx husky add .husky/pre-commit "node scripts/validate-schema.mjs"
|
|
398
|
+
# 2. Customize your schema for frontend
|
|
399
|
+
# Edit BACKEND_SCHEMA.mjs (rename to FRONTEND_SCHEMA.mjs if you prefer)
|
|
330
400
|
|
|
331
|
-
#
|
|
401
|
+
# 3. Test it!
|
|
332
402
|
git commit -m "test"
|
|
333
403
|
# Guardian will validate automatically (<1s)
|
|
334
404
|
```
|
|
@@ -339,26 +409,21 @@ git commit -m "test"
|
|
|
339
409
|
- ✅ Required imports (`react`, `react-dom`)
|
|
340
410
|
- ✅ Required files (`tsconfig.json`, `vite.config.ts`)
|
|
341
411
|
|
|
342
|
-
**Then customize:** Edit FRONTEND_SCHEMA.
|
|
412
|
+
**Then customize:** Edit BACKEND_SCHEMA.mjs (rename to FRONTEND_SCHEMA.mjs if you prefer) to match YOUR folder structure, YOUR rules, YOUR tech stack.
|
|
343
413
|
|
|
344
414
|
#### ⚙️ **Backend Developer (Node.js/Express/NestJS)**
|
|
345
415
|
|
|
346
416
|
```bash
|
|
347
|
-
# 1.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
# 2. Copy validation script
|
|
351
|
-
mkdir -p scripts
|
|
352
|
-
cp node_modules/cerber-core/guardian/templates/validate-schema.mjs scripts/
|
|
417
|
+
# 1. Initialize Cerber (generates CERBER.md + guardian + health templates)
|
|
418
|
+
npx cerber init --mode=dev
|
|
353
419
|
|
|
354
|
-
#
|
|
355
|
-
|
|
356
|
-
npx husky add .husky/pre-commit "node scripts/validate-schema.mjs"
|
|
420
|
+
# 2. Customize BACKEND_SCHEMA.mjs
|
|
421
|
+
# Edit to match YOUR routes, YOUR layers, YOUR security rules
|
|
357
422
|
|
|
358
|
-
#
|
|
423
|
+
# 3. Add health endpoint (see example below)
|
|
359
424
|
```
|
|
360
425
|
|
|
361
|
-
**Then customize:** Edit BACKEND_SCHEMA.
|
|
426
|
+
**Then customize:** Edit BACKEND_SCHEMA.mjs to match YOUR routes, YOUR layers, YOUR security rules.
|
|
362
427
|
|
|
363
428
|
```javascript
|
|
364
429
|
// server.js (ESM)
|
|
@@ -476,7 +541,7 @@ cerber-focus
|
|
|
476
541
|
|
|
477
542
|
Before diving into examples below, understand this:
|
|
478
543
|
|
|
479
|
-
**📋 Schema files (BACKEND_SCHEMA.
|
|
544
|
+
**📋 Schema files (BACKEND_SCHEMA.mjs, FRONTEND_SCHEMA.mjs):**
|
|
480
545
|
- Are **examples** and **optional templates**
|
|
481
546
|
- Mirror YOUR architecture decisions from CERBER.md
|
|
482
547
|
- Are user-owned and user-created (in strict mode)
|
|
@@ -495,8 +560,8 @@ Before diving into examples below, understand this:
|
|
|
495
560
|
|
|
496
561
|
**1. Create architecture schema:**
|
|
497
562
|
|
|
498
|
-
```
|
|
499
|
-
// BACKEND_SCHEMA.
|
|
563
|
+
```javascript
|
|
564
|
+
// BACKEND_SCHEMA.mjs
|
|
500
565
|
export const BACKEND_SCHEMA = {
|
|
501
566
|
version: '1.0.0',
|
|
502
567
|
rules: [
|
|
@@ -520,7 +585,9 @@ export const BACKEND_SCHEMA = {
|
|
|
520
585
|
**2. Add pre-commit hook:**
|
|
521
586
|
|
|
522
587
|
```bash
|
|
523
|
-
|
|
588
|
+
# Pre-commit hook is automatically installed by npx cerber init
|
|
589
|
+
# Or manually:
|
|
590
|
+
npx husky add .husky/pre-commit "npm run cerber:guardian"
|
|
524
591
|
```
|
|
525
592
|
|
|
526
593
|
**3. Done!** Guardian now blocks commits that violate architecture rules.
|
|
@@ -654,8 +721,8 @@ curl https://your-api.com/api/health
|
|
|
654
721
|
|
|
655
722
|
### Example 1: Enforce Express Router in routes
|
|
656
723
|
|
|
657
|
-
```
|
|
658
|
-
// BACKEND_SCHEMA.
|
|
724
|
+
```javascript
|
|
725
|
+
// BACKEND_SCHEMA.mjs
|
|
659
726
|
{
|
|
660
727
|
name: 'Route files must import Router',
|
|
661
728
|
pattern: /routes\/.*\.ts$/,
|
|
@@ -787,8 +854,8 @@ export const cloudinaryCheck = async () => {
|
|
|
787
854
|
|
|
788
855
|
### Guardian Configuration
|
|
789
856
|
|
|
790
|
-
```
|
|
791
|
-
// BACKEND_SCHEMA.
|
|
857
|
+
```javascript
|
|
858
|
+
// BACKEND_SCHEMA.mjs
|
|
792
859
|
export const BACKEND_SCHEMA = {
|
|
793
860
|
version: '1.0.0',
|
|
794
861
|
|
|
@@ -230,7 +230,7 @@ export function getDefaultContract(mode = 'dev') {
|
|
|
230
230
|
mode,
|
|
231
231
|
guardian: {
|
|
232
232
|
enabled: true,
|
|
233
|
-
schemaFile: 'BACKEND_SCHEMA.
|
|
233
|
+
schemaFile: 'BACKEND_SCHEMA.mjs',
|
|
234
234
|
hook: 'husky',
|
|
235
235
|
approvalsTag: 'ARCHITECT_APPROVED'
|
|
236
236
|
},
|
|
@@ -256,7 +256,7 @@ export function getDefaultContract(mode = 'dev') {
|
|
|
256
256
|
},
|
|
257
257
|
schema: {
|
|
258
258
|
enabled: true,
|
|
259
|
-
file: 'BACKEND_SCHEMA.
|
|
259
|
+
file: 'BACKEND_SCHEMA.mjs',
|
|
260
260
|
mode: 'template_only',
|
|
261
261
|
description: 'Project architecture contract (user-owned)'
|
|
262
262
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-parser.js","sourceRoot":"","sources":["../../src/cli/contract-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,qBAAqB,GAAG,SAAS,CAAC;AACxC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,WAAmB;IAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAEvD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACvD,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,0BAA0B;QAC1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,EAAE,CAAC;IACvE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,+BAA+B;IAC/B,MAAM,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,iBAAiB,CAAC,CAAC;IACtF,IAAI,kBAAkB,KAAK,CAAC,CAAC,EAAE,CAA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E,CAAC;QACV,IAAI;QACJ,QAAQ,EAAE;YACR,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,oBAAoB;YAChC,IAAI,EAAE,OAAO;YACb,YAAY,EAAE,oBAAoB;SACnC;QACD,MAAM,EAAE;YACN,OAAO,EAAE,IAAI,KAAK,MAAM;YACxB,QAAQ,EAAE,aAAa;YACvB,MAAM,EAAE;gBACN,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,IAAI;gBACX,OAAO,EAAE,KAAK;aACf;SACF;QACD,EAAE,EAAE;YACF,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,CAAC,MAAM,CAAC;YAClB,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE;gBACV,OAAO,EAAE,IAAI,KAAK,MAAM;gBACxB,WAAW,EAAE,EAAE;gBACf,YAAY,EAAE,mBAAmB;gBACjC,gBAAgB,EAAE,2BAA2B;aAC9C;SACF;QACD,MAAM,EAAE;YACN,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,oBAAoB;YAC1B,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,4CAA4C;SAC1D;KACF,CAAC;AACJ,CAAC"}
|
package/dist/cli/init.js
CHANGED
|
@@ -23,7 +23,7 @@ mode: ${mode} # solo | dev | team
|
|
|
23
23
|
|
|
24
24
|
guardian:
|
|
25
25
|
enabled: true
|
|
26
|
-
schemaFile: BACKEND_SCHEMA.
|
|
26
|
+
schemaFile: BACKEND_SCHEMA.mjs
|
|
27
27
|
hook: husky
|
|
28
28
|
approvalsTag: ARCHITECT_APPROVED
|
|
29
29
|
|
|
@@ -47,7 +47,7 @@ ci:
|
|
|
47
47
|
|
|
48
48
|
schema:
|
|
49
49
|
enabled: true
|
|
50
|
-
file: BACKEND_SCHEMA.
|
|
50
|
+
file: BACKEND_SCHEMA.mjs
|
|
51
51
|
mode: template_only # strict | template_only
|
|
52
52
|
description: "Project architecture contract (user-owned)"
|
|
53
53
|
# strict = Cerber never creates schema, you must create it
|
package/package.json
CHANGED
|
@@ -1,106 +1,117 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cerber-core",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"bin": {
|
|
9
|
-
"cerber": "./bin/cerber",
|
|
10
|
-
"cerber-guardian": "./bin/cerber-guardian",
|
|
11
|
-
"cerber-health": "./bin/cerber-health",
|
|
12
|
-
"cerber-focus": "./bin/cerber-focus",
|
|
13
|
-
"cerber-morning": "./bin/cerber-morning",
|
|
14
|
-
"cerber-repair": "./bin/cerber-repair"
|
|
15
|
-
},
|
|
16
|
-
"exports": {
|
|
17
|
-
".": "./dist/index.js",
|
|
18
|
-
"./guardian": "./dist/guardian/index.js",
|
|
19
|
-
"./cerber": "./dist/cerber/index.js",
|
|
20
|
-
"./types": "./dist/types.js"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "tsc",
|
|
24
|
-
"test": "jest",
|
|
25
|
-
"lint": "eslint src/**/*.ts",
|
|
26
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
27
|
-
"prepublishOnly": "npm run build",
|
|
28
|
-
"validate": "node bin/cerber-guardian",
|
|
29
|
-
"health-check": "node bin/cerber-health",
|
|
30
|
-
"morning": "node solo/scripts/cerber-daily-check.js",
|
|
31
|
-
"repair": "node solo/scripts/cerber-auto-repair.js",
|
|
32
|
-
"repair:dry": "node solo/scripts/cerber-auto-repair.js --dry-run",
|
|
33
|
-
"dashboard": "node solo/scripts/cerber-dashboard.js"
|
|
34
|
-
},
|
|
35
|
-
"repository": {
|
|
36
|
-
"type": "git",
|
|
37
|
-
"url": "git+https://github.com/Agaslez/cerber-core.git"
|
|
38
|
-
},
|
|
39
|
-
"keywords": [
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
],
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
},
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
".
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "cerber-core",
|
|
3
|
+
"version": "1.1.6",
|
|
4
|
+
"description": "AI doesn't break your project. Lack of a contract does. Cerber is a contract-driven project guardian for AI-assisted development. It enforces a single source of truth (CERBER.md) across pre-commit, CI, and post-deploy health gates.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"cerber": "./bin/cerber",
|
|
10
|
+
"cerber-guardian": "./bin/cerber-guardian",
|
|
11
|
+
"cerber-health": "./bin/cerber-health",
|
|
12
|
+
"cerber-focus": "./bin/cerber-focus",
|
|
13
|
+
"cerber-morning": "./bin/cerber-morning",
|
|
14
|
+
"cerber-repair": "./bin/cerber-repair"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./dist/index.js",
|
|
18
|
+
"./guardian": "./dist/guardian/index.js",
|
|
19
|
+
"./cerber": "./dist/cerber/index.js",
|
|
20
|
+
"./types": "./dist/types.js"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"test": "jest",
|
|
25
|
+
"lint": "eslint src/**/*.ts",
|
|
26
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
28
|
+
"validate": "node bin/cerber-guardian",
|
|
29
|
+
"health-check": "node bin/cerber-health",
|
|
30
|
+
"morning": "node solo/scripts/cerber-daily-check.js",
|
|
31
|
+
"repair": "node solo/scripts/cerber-auto-repair.js",
|
|
32
|
+
"repair:dry": "node solo/scripts/cerber-auto-repair.js --dry-run",
|
|
33
|
+
"dashboard": "node solo/scripts/cerber-dashboard.js"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/Agaslez/cerber-core.git"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"ai",
|
|
41
|
+
"ai-agents",
|
|
42
|
+
"ai-coding",
|
|
43
|
+
"copilot",
|
|
44
|
+
"cursor",
|
|
45
|
+
"windsurf",
|
|
46
|
+
"llm",
|
|
47
|
+
"contract",
|
|
48
|
+
"contract-first",
|
|
49
|
+
"project-guard",
|
|
50
|
+
"single-source-of-truth",
|
|
51
|
+
"pre-commit",
|
|
52
|
+
"husky",
|
|
53
|
+
"guardrails",
|
|
54
|
+
"workflow-generator",
|
|
55
|
+
"ci-cd",
|
|
56
|
+
"github-actions",
|
|
57
|
+
"schema-enforcement",
|
|
58
|
+
"health-check",
|
|
59
|
+
"deployment-gate",
|
|
60
|
+
"dev-workflow",
|
|
61
|
+
"automation",
|
|
62
|
+
"architecture",
|
|
63
|
+
"validation",
|
|
64
|
+
"cerber",
|
|
65
|
+
"guardian"
|
|
66
|
+
],
|
|
67
|
+
"author": {
|
|
68
|
+
"name": "Agata Sleziak",
|
|
69
|
+
"email": "agata@example.com",
|
|
70
|
+
"url": "https://github.com/Agaslez"
|
|
71
|
+
},
|
|
72
|
+
"contributors": [
|
|
73
|
+
{
|
|
74
|
+
"name": "Stefan Pitek",
|
|
75
|
+
"role": "Collaborator"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"license": "MIT",
|
|
79
|
+
"bugs": {
|
|
80
|
+
"url": "https://github.com/Agaslez/cerber-core/issues"
|
|
81
|
+
},
|
|
82
|
+
"homepage": "https://github.com/Agaslez/cerber-core#readme",
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"typescript": ">=5.0.0"
|
|
85
|
+
},
|
|
86
|
+
"dependencies": {
|
|
87
|
+
"chalk": "^5.3.0",
|
|
88
|
+
"commander": "^12.0.0"
|
|
89
|
+
},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"@types/jest": "^29.5.0",
|
|
92
|
+
"@types/node": "^20.0.0",
|
|
93
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
94
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
95
|
+
"eslint": "^8.50.0",
|
|
96
|
+
"jest": "^29.7.0",
|
|
97
|
+
"prettier": "^3.0.0",
|
|
98
|
+
"ts-jest": "^29.1.0",
|
|
99
|
+
"typescript": "^5.3.0"
|
|
100
|
+
},
|
|
101
|
+
"engines": {
|
|
102
|
+
"node": ">=16.0.0"
|
|
103
|
+
},
|
|
104
|
+
"files": [
|
|
105
|
+
"dist",
|
|
106
|
+
"bin",
|
|
107
|
+
"examples",
|
|
108
|
+
".cerber-example",
|
|
109
|
+
"solo",
|
|
110
|
+
"dev",
|
|
111
|
+
"team",
|
|
112
|
+
"LICENSE",
|
|
113
|
+
"README.md",
|
|
114
|
+
"CHANGELOG.md",
|
|
115
|
+
"USAGE_GUIDE.md"
|
|
116
|
+
]
|
|
117
|
+
}
|