@path58/p58-n8n 0.2.12 → 0.2.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@path58/p58-n8n",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "The smartest and fastest n8n MCP server — validate, fix, and discover workflows inside your LLM",
5
5
  "keywords": [
6
6
  "mcp",
@@ -12,7 +12,7 @@
12
12
  "path58"
13
13
  ],
14
14
  "author": "Path58",
15
- "license": "MIT",
15
+ "license": "SEE LICENSE IN LICENSE",
16
16
  "homepage": "https://github.com/tsvika58/p58-n8n#readme",
17
17
  "repository": {
18
18
  "type": "git",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "files": [
28
28
  "dist/mcp/server.bundle.cjs",
29
+ "src/data/public-catalog/**/*",
29
30
  "README.md",
30
31
  "AGENT_INSTALL.md",
31
32
  "CHANGELOG.md",
@@ -41,6 +42,7 @@
41
42
  "test": "vitest run",
42
43
  "test:unit": "vitest run --config vitest.unit.config.ts",
43
44
  "test:ci": "vitest run --config vitest.config.ci.ts",
45
+ "catalog:snapshot": "npx tsx src/scripts/production/catalog/generate-catalog-snapshot.ts",
44
46
  "backfill:classifications": "tsx src/scripts/production/classification/backfill-classifications.ts",
45
47
  "production:fix-rerun": "tsx src/scripts/production/comprehensive-fix-rerun-production.ts",
46
48
  "production:fix-rerun-simple": "tsx src/scripts/production/comprehensive-fix-rerun-simple.ts",
package/src/README.md ADDED
@@ -0,0 +1,188 @@
1
+ # Source Code (`src/`)
2
+
3
+ **Purpose:** Core source code for n8n workflow validator - validation logic, API, database clients, and utilities
4
+ **Agent Entry Point:** Navigation hub for all source code modules
5
+ **Human Entry Point:** Developer guide to source code organization
6
+ **Standards:** Software Development Standards - Code Quality, Error Handling, Testing
7
+
8
+ ---
9
+
10
+ ## 🤖 Agent Entry Point
11
+
12
+ **For AI Agents (RND, PM, Dev):**
13
+
14
+ | Need | Go To |
15
+ |------|-------|
16
+ | **API routes & server** | [`api/`](api/) - REST API endpoints |
17
+ | **Database clients** | [`db/`](db/) - PostgreSQL connection management |
18
+ | **Validation logic** | [`validation/`](validation/) - L1-L5 validation system |
19
+ | **Factory patterns** | [`factory/`](factory/) - Validation workflow factories |
20
+ | **TypeScript scripts** | [`scripts/`](scripts/) - CLI scripts (693 files) |
21
+ | **Embedding generation** | [`embedding/`](embedding/) - Text builders for embeddings |
22
+ | **Services** | [`services/`](services/) - Business logic services |
23
+ | **Utilities** | [`utils/`](utils/) - Shared utility functions |
24
+ | **Error handling** | [`errors/`](errors/) - Error types and handlers |
25
+ | **Testing utilities** | [`testing/`](testing/) - Test adapters and mocks |
26
+
27
+ **Key Files:**
28
+ - `api/server.ts` - Express API server (port 3000)
29
+ - `db/validatorPostgresClient.ts` - Validator DB client (bluelime schema)
30
+ - `validation/core.ts` - Core validation orchestrator
31
+ - `factory/validation-config.ts` - Validation configuration
32
+
33
+ ---
34
+
35
+ ## 👤 Human Entry Point
36
+
37
+ **For Developers:**
38
+
39
+ | Need | Go To |
40
+ |------|-------|
41
+ | **Build API endpoints** | [`api/`](api/) - Add routes in `api/routes/` |
42
+ | **Database operations** | [`db/`](db/) - Use clients from `db/` |
43
+ | **Add validation rules** | [`validation/`](validation/) - Extend L1-L5 validators |
44
+ | **Create scripts** | [`scripts/`](scripts/) - Add TypeScript scripts |
45
+ | **Shared utilities** | [`utils/`](utils/) - Reusable helper functions |
46
+ | **Error handling** | [`errors/`](errors/) - Use AppError types |
47
+
48
+ ---
49
+
50
+ ## 📁 Directory Structure
51
+
52
+ ```
53
+ src/
54
+ ├── api/ # REST API server (Express)
55
+ │ ├── routes/ # API route handlers
56
+ │ └── middleware/ # Request middleware
57
+
58
+ ├── db/ # Database clients
59
+ │ ├── postgresClient.ts # n8n DB client
60
+ │ ├── scraperPostgresClient.ts # Scraper DB client
61
+ │ └── validatorPostgresClient.ts # Validator DB client (bluelime)
62
+
63
+ ├── validation/ # Validation system (L1-L5)
64
+ │ ├── l1-structure.ts # Structure validation
65
+ │ ├── l2-nodes.ts # Node validation
66
+ │ ├── l3-credentials.ts # Credential validation
67
+ │ ├── l4-connections.ts # Connection validation
68
+ │ ├── l5-parameters.ts # Parameter validation
69
+ │ └── core.ts # Core orchestrator
70
+
71
+ ├── factory/ # Factory pattern implementations
72
+ │ ├── validation-config.ts # Configuration
73
+ │ ├── validation-workflow-loader.ts # Workflow loading
74
+ │ ├── validation-batch-runner.ts # Batch processing
75
+ │ └── validation-result-recorder.ts # Result recording
76
+
77
+ ├── scripts/ # TypeScript CLI scripts (693 files)
78
+ │ ├── catalog/ # Catalog scripts (when organized)
79
+ │ ├── validation/ # Validation scripts (when organized)
80
+ │ └── ...
81
+
82
+ ├── embedding/ # Embedding text builders
83
+ │ ├── nodeTextBuilder.ts # Node text generation
84
+ │ ├── credentialTextBuilder.ts # Credential text generation
85
+ │ └── aiNodeTextBuilder.ts # AI node text generation
86
+
87
+ ├── services/ # Business logic services
88
+ │ ├── SearchService.ts # Semantic search
89
+ │ ├── EmbeddingService.ts # Embedding generation
90
+ │ ├── RankingService.ts # Result ranking
91
+ │ └── RedisCache.ts # Caching layer
92
+
93
+ ├── utils/ # Shared utility functions
94
+ │ ├── logger.ts # Logging utilities
95
+ │ ├── scriptRunner.ts # Script execution wrapper
96
+ │ ├── connectionManager.ts # Connection management
97
+ │ └── ...
98
+
99
+ ├── errors/ # Error types and handlers
100
+ │ ├── AppError.ts # Base error class
101
+ │ └── README.md # Error handling guide
102
+
103
+ ├── testing/ # Testing utilities
104
+ │ ├── k1/ # K1 level testing
105
+ │ ├── k2/ # K2 level testing
106
+ │ └── adapters/ # Test adapters
107
+
108
+ ├── config/ # Configuration
109
+ │ ├── env.ts # Environment variable resolution
110
+ │ └── scraperEnv.ts # Scraper environment
111
+
112
+ ├── types/ # TypeScript type definitions
113
+ ├── data/ # Data constants (golden workflows, etc.)
114
+ └── scraping/ # Web scraping utilities
115
+ ```
116
+
117
+ ---
118
+
119
+ ## 🔗 Navigation
120
+
121
+ **Related Directories:**
122
+ - [`../tests/`](../tests/) - Test files for source code
123
+ - [`../docs/`](../docs/) - Documentation
124
+ - [`../scripts/`](../scripts/) - Shell scripts
125
+
126
+ **Parent Directory:**
127
+ - [`../`](../) - Project root
128
+
129
+ ---
130
+
131
+ ## 📚 Standards
132
+
133
+ **Relevant Standards:**
134
+ - `/Users/tsvikavagman/Code Projects/.software-development-standards/01-code-quality/` - Code quality standards
135
+ - `/Users/tsvikavagman/Code Projects/.software-development-standards/02-architecture/` - Architecture patterns
136
+ - `/Users/tsvikavagman/Code Projects/.software-development-standards/05-testing/` - Testing standards
137
+
138
+ **Key Standards Applied:**
139
+ - Error handling: Mandatory type guards, AppError usage
140
+ - Code quality: Clean code principles, SOLID patterns
141
+ - Testing: AAA pattern, 80%+ coverage target
142
+ - Script lifecycle: exp_, dbg_, tmp_, util_, dev_ prefixes
143
+
144
+ ---
145
+
146
+ ## 🚀 Quick Start
147
+
148
+ ### Adding a New API Route
149
+
150
+ 1. Create route file in `api/routes/`
151
+ 2. Import and register in `api/server.ts`
152
+ 3. Add Swagger documentation in `api/swagger.ts`
153
+
154
+ ### Adding a New Validator
155
+
156
+ 1. Create validator file in `validation/` (e.g., `l6-custom.ts`)
157
+ 2. Export validator function
158
+ 3. Register in `validation/core.ts`
159
+
160
+ ### Creating a Script
161
+
162
+ 1. Use `utils/scriptRunner.ts` wrapper
163
+ 2. Always close database connections
164
+ 3. Use lifecycle prefixes (exp_, dbg_, tmp_, util_, dev_)
165
+
166
+ ---
167
+
168
+ ## ⚠️ Critical Notes
169
+
170
+ **Database Connections:**
171
+ - Always use `executeScript()` wrapper from `utils/scriptRunner.ts`
172
+ - Always call `shutdownValidatorPool()` in scripts
173
+ - Use `bluelime` schema (v4.0), not deprecated `validator` schema
174
+
175
+ **Error Handling:**
176
+ - Always use `AppError` from `errors/AppError.ts`
177
+ - Mandatory type guards for external data
178
+ - Never throw raw errors
179
+
180
+ **Testing:**
181
+ - ALWAYS run tests with `-v` flag FIRST
182
+ - NEVER pipe test output to files during first run
183
+ - User MUST see tests running in real-time
184
+
185
+ ---
186
+
187
+ **Last Updated:** January 1, 2026
188
+ **Maintained By:** RND (Technical Lead)