@gherk/reactive-architecture 1.0.0 → 1.3.0
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 +98 -55
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/tools/audit-project.d.ts +3 -0
- package/dist/tools/audit-project.d.ts.map +1 -0
- package/dist/tools/audit-project.js +489 -0
- package/dist/tools/audit-project.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gherk/reactive-architecture
|
|
2
2
|
|
|
3
|
-
An MCP (Model Context Protocol) server that teaches AI assistants a **framework-agnostic reactive
|
|
3
|
+
An MCP (Model Context Protocol) server that teaches AI coding assistants a **framework-agnostic reactive architecture philosophy** — covering both frontend and backend patterns.
|
|
4
4
|
|
|
5
|
-
Add this server to any
|
|
5
|
+
Add this server to any AI assistant (Antigravity, Cursor, Claude Desktop, Copilot, Gemini CLI) and it will **always** structure code following the same proven patterns, regardless of the tech stack.
|
|
6
6
|
|
|
7
7
|
## Philosophy
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Frontend: Component → Store → Service
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
Component → Store → Service
|
|
13
13
|
(UI) (State) (Data Access)
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
- **Component
|
|
17
|
-
- **Store
|
|
18
|
-
- **Service
|
|
16
|
+
- **Component** — Presentation + user interaction only. Reads from store, dispatches actions.
|
|
17
|
+
- **Store** — Single source of truth. State management (loading/error/data), business logic.
|
|
18
|
+
- **Service** — Pure data access (HTTP, WebSocket, localStorage). Stateless, no logic.
|
|
19
|
+
|
|
20
|
+
### Backend: Controller → Service → Repository
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Controller → Service → Repository
|
|
24
|
+
(HTTP) (Business) (Data Access)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- **Controller** — HTTP adapter. Validates input, calls service, formats response.
|
|
28
|
+
- **Service** — Business logic. Orchestrates operations, enforces rules.
|
|
29
|
+
- **Repository** — Data access. DB queries, ORM calls, external API clients.
|
|
19
30
|
|
|
20
31
|
## Installation
|
|
21
32
|
|
|
33
|
+
### From npm
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx @gherk/reactive-architecture
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### From source
|
|
40
|
+
|
|
22
41
|
```bash
|
|
23
|
-
|
|
42
|
+
git clone <repo>
|
|
43
|
+
cd mcps/reactive-architecture
|
|
24
44
|
npm install
|
|
25
45
|
npm run build
|
|
26
46
|
```
|
|
27
47
|
|
|
28
48
|
## Configuration
|
|
29
49
|
|
|
50
|
+
### Antigravity (Gherk Desktop)
|
|
51
|
+
|
|
52
|
+
Already pre-configured in `agent-go/internal/mcp/mcp-servers.json`. No setup needed — the server is available automatically when Gherk Desktop runs.
|
|
53
|
+
|
|
30
54
|
### Claude Desktop
|
|
31
55
|
|
|
32
56
|
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
@@ -34,9 +58,9 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
34
58
|
```json
|
|
35
59
|
{
|
|
36
60
|
"mcpServers": {
|
|
37
|
-
"reactive-
|
|
38
|
-
"command": "
|
|
39
|
-
"args": ["/
|
|
61
|
+
"reactive-architecture": {
|
|
62
|
+
"command": "npx",
|
|
63
|
+
"args": ["-y", "@gherk/reactive-architecture"]
|
|
40
64
|
}
|
|
41
65
|
}
|
|
42
66
|
}
|
|
@@ -49,9 +73,9 @@ Add to `.cursor/mcp.json` in your project root:
|
|
|
49
73
|
```json
|
|
50
74
|
{
|
|
51
75
|
"mcpServers": {
|
|
52
|
-
"reactive-
|
|
53
|
-
"command": "
|
|
54
|
-
"args": ["/
|
|
76
|
+
"reactive-architecture": {
|
|
77
|
+
"command": "npx",
|
|
78
|
+
"args": ["-y", "@gherk/reactive-architecture"]
|
|
55
79
|
}
|
|
56
80
|
}
|
|
57
81
|
}
|
|
@@ -64,9 +88,9 @@ Add to `.vscode/mcp.json`:
|
|
|
64
88
|
```json
|
|
65
89
|
{
|
|
66
90
|
"servers": {
|
|
67
|
-
"reactive-
|
|
68
|
-
"command": "
|
|
69
|
-
"args": ["/
|
|
91
|
+
"reactive-architecture": {
|
|
92
|
+
"command": "npx",
|
|
93
|
+
"args": ["-y", "@gherk/reactive-architecture"]
|
|
70
94
|
}
|
|
71
95
|
}
|
|
72
96
|
}
|
|
@@ -79,71 +103,90 @@ Add to `~/.gemini/settings.json`:
|
|
|
79
103
|
```json
|
|
80
104
|
{
|
|
81
105
|
"mcpServers": {
|
|
82
|
-
"reactive-
|
|
83
|
-
"command": "
|
|
84
|
-
"args": ["/
|
|
106
|
+
"reactive-architecture": {
|
|
107
|
+
"command": "npx",
|
|
108
|
+
"args": ["-y", "@gherk/reactive-architecture"]
|
|
85
109
|
}
|
|
86
110
|
}
|
|
87
111
|
}
|
|
88
112
|
```
|
|
89
113
|
|
|
90
|
-
## Available Tools
|
|
114
|
+
## Available Tools (10)
|
|
115
|
+
|
|
116
|
+
### Frontend Architecture
|
|
91
117
|
|
|
92
118
|
| Tool | Description |
|
|
93
119
|
|------|-------------|
|
|
94
|
-
| `get_architecture_guide` | Returns the
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `get_framework_example` | Returns concrete, copy-paste-ready examples
|
|
120
|
+
| `get_architecture_guide` | Returns the reactive philosophy guide (Component → Store → Service). Supports sections: `overview`, `component`, `store`, `service`, `anti-patterns`, `file-structure`, `implementation-flow`. |
|
|
121
|
+
| `detect_and_guide` | Auto-detects the frontend stack from `package.json` content and returns tailored guidance with state library, HTTP pattern, and reactivity model. Supports Angular, React, Vue, Svelte. |
|
|
122
|
+
| `generate_scaffold` | Generates a complete feature scaffold (file names + content) for any framework. Supports operations: `list`, `detail`, `create`, `update`, `delete`. |
|
|
123
|
+
| `get_framework_example` | Returns concrete, copy-paste-ready examples of the reactive pattern for a specific framework and UI pattern (`list`, `detail`, `form`, `crud`). |
|
|
124
|
+
| `get_folder_structure` | Returns the recommended project folder structure. Supports: Angular, React, Next.js, Vue, Nuxt.js, SvelteKit. Includes detection guidance for existing projects. |
|
|
125
|
+
| `get_style_rules` | Returns strict coding style rules: formatting (4-space indent, single quotes, 120-char lines), size limits (10 lines/function, 160 lines/file), import ordering, and stack-specific naming conventions. |
|
|
98
126
|
|
|
99
|
-
###
|
|
127
|
+
### Backend Architecture
|
|
100
128
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### `generate_scaffold`
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
Params:
|
|
109
|
-
- feature_name: "user management"
|
|
110
|
-
- framework: angular | react | vue | svelte
|
|
111
|
-
- operations: [list, detail, create, update, delete]
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### `validate_architecture`
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
Params:
|
|
118
|
-
- description: "The component fetches users directly from the API..."
|
|
119
|
-
```
|
|
129
|
+
| Tool | Description |
|
|
130
|
+
|------|-------------|
|
|
131
|
+
| `get_backend_guide` | Returns the backend architecture guide (Controller → Service → Repository) with code examples. Supports: Django, Go, NestJS, Spring Boot, FastAPI, Express, Laravel, .NET. |
|
|
132
|
+
| `get_backend_folder_structure` | Returns the recommended backend folder structure with module portability. Same 8 stacks as above. |
|
|
120
133
|
|
|
121
|
-
###
|
|
134
|
+
### Analysis
|
|
122
135
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
```
|
|
136
|
+
| Tool | Description |
|
|
137
|
+
|------|-------------|
|
|
138
|
+
| `validate_architecture` | Validates a described architecture against the reactive patterns. Returns errors, warnings, and suggestions with severity levels. |
|
|
139
|
+
| `audit_project` | Parses a project's file tree (from `tree` or `find` command), auto-detects modules, validates each against both frontend and backend patterns, and generates **structured refactoring tickets** with priorities and concrete actions. |
|
|
128
140
|
|
|
129
141
|
## Available Resources
|
|
130
142
|
|
|
131
|
-
|
|
|
132
|
-
|
|
143
|
+
| URI | Description |
|
|
144
|
+
|-----|-------------|
|
|
133
145
|
| `reactive://philosophy` | Complete philosophy document as markdown |
|
|
134
146
|
|
|
135
147
|
## Available Prompts
|
|
136
148
|
|
|
137
149
|
| Prompt | Description |
|
|
138
150
|
|--------|-------------|
|
|
139
|
-
| `plan_feature` | Structured template for planning a feature with Component → Store → Service decomposition |
|
|
151
|
+
| `plan_feature` | Structured template for planning a feature with the Component → Store → Service decomposition |
|
|
152
|
+
|
|
153
|
+
## Supported Stacks
|
|
154
|
+
|
|
155
|
+
### Frontend
|
|
156
|
+
|
|
157
|
+
- **Angular** — Signals + Signal Store, inject-based services
|
|
158
|
+
- **React** — Zustand/TanStack Query, custom hooks
|
|
159
|
+
- **Vue** — Pinia + Composition API, composables
|
|
160
|
+
- **Svelte** — Svelte stores, reactive declarations
|
|
161
|
+
|
|
162
|
+
### Backend
|
|
163
|
+
|
|
164
|
+
- **Django** — DRF + Services/Selectors pattern
|
|
165
|
+
- **Go** — Handlers → Services → Repositories (interfaces)
|
|
166
|
+
- **NestJS** — Decorators, injectable services, TypeORM repos
|
|
167
|
+
- **Spring Boot** — `@RestController` → `@Service` → `@Repository`
|
|
168
|
+
- **FastAPI** — Routers → Services → Repositories (SQLAlchemy)
|
|
169
|
+
- **Express** — Router → Controller → Service → Repository
|
|
170
|
+
- **Laravel** — Controllers → Services → Eloquent Repositories
|
|
171
|
+
- **.NET** — Controllers → Services → EF Core Repositories
|
|
172
|
+
|
|
173
|
+
## How It Works
|
|
174
|
+
|
|
175
|
+
The AI calls the MCP tools to understand how to structure code **before** writing it:
|
|
176
|
+
|
|
177
|
+
1. **Stack Detection** — `detect_and_guide` auto-detects framework from `package.json`
|
|
178
|
+
2. **Architecture Guide** — `get_architecture_guide` / `get_backend_guide` provides the philosophy
|
|
179
|
+
3. **Folder Structure** — `get_folder_structure` / `get_backend_folder_structure` defines where files go
|
|
180
|
+
4. **Style Rules** — `get_style_rules` enforces formatting and size constraints
|
|
181
|
+
5. **Scaffolding** — `generate_scaffold` creates the feature boilerplate
|
|
182
|
+
6. **Validation** — `validate_architecture` / `audit_project` checks compliance
|
|
140
183
|
|
|
141
184
|
## Development
|
|
142
185
|
|
|
143
186
|
```bash
|
|
144
187
|
npm run dev # Watch mode (recompiles on changes)
|
|
145
188
|
npm run build # Production build
|
|
146
|
-
npm start # Run the server
|
|
189
|
+
npm start # Run the server directly
|
|
147
190
|
```
|
|
148
191
|
|
|
149
192
|
## License
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { registerStyleRulesTool } from './tools/style-rules.js';
|
|
|
21
21
|
import { registerFolderStructureTool } from './tools/folder-structure.js';
|
|
22
22
|
import { registerBackendGuideTool } from './tools/backend-guide.js';
|
|
23
23
|
import { registerBackendFolderStructureTool } from './tools/backend-folder-structure.js';
|
|
24
|
+
import { registerAuditProjectTool } from './tools/audit-project.js';
|
|
24
25
|
// Resources
|
|
25
26
|
import { registerPhilosophyResource } from './resources/philosophy-resource.js';
|
|
26
27
|
// Prompts
|
|
@@ -28,7 +29,7 @@ import { registerPlanFeaturePrompt } from './prompts/plan-feature.js';
|
|
|
28
29
|
// Create the MCP server
|
|
29
30
|
const server = new McpServer({
|
|
30
31
|
name: 'reactive-architecture',
|
|
31
|
-
version: '1.
|
|
32
|
+
version: '1.3.0',
|
|
32
33
|
});
|
|
33
34
|
// Register all tools
|
|
34
35
|
registerArchitectureGuideTool(server);
|
|
@@ -40,6 +41,7 @@ registerStyleRulesTool(server);
|
|
|
40
41
|
registerFolderStructureTool(server);
|
|
41
42
|
registerBackendGuideTool(server);
|
|
42
43
|
registerBackendFolderStructureTool(server);
|
|
44
|
+
registerAuditProjectTool(server);
|
|
43
45
|
// Register resources
|
|
44
46
|
registerPhilosophyResource(server);
|
|
45
47
|
// Register prompts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,gFAAgF;AAChF,mCAAmC;AACnC,gFAAgF;AAChF,qEAAqE;AACrE,qDAAqD;AACrD,mDAAmD;AACnD,EAAE;AACF,wEAAwE;AACxE,kCAAkC;AAClC,gFAAgF;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,QAAQ;AACR,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,gFAAgF;AAChF,mCAAmC;AACnC,gFAAgF;AAChF,qEAAqE;AACrE,qDAAqD;AACrD,mDAAmD;AACnD,EAAE;AACF,wEAAwE;AACxE,kCAAkC;AAClC,gFAAgF;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,QAAQ;AACR,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EA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,CAAC;AAElC,8BAA8B;AAC9B,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACtE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-project.d.ts","sourceRoot":"","sources":["../../src/tools/audit-project.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkjBpE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA0EhE"}
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// TOOL: audit_project
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Receives a project's file tree, detects modules/features, validates each
|
|
5
|
+
// against reactive architecture rules, and returns structured refactoring
|
|
6
|
+
// tickets — one per module with violations.
|
|
7
|
+
// =============================================================================
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
function parseFileTree(tree) {
|
|
10
|
+
const lines = tree.split('\n').filter((l) => l.trim().length > 0);
|
|
11
|
+
const root = [];
|
|
12
|
+
const stack = [];
|
|
13
|
+
for (const line of lines) {
|
|
14
|
+
// Handle both tree-style (├──, └──, │) and plain indented paths
|
|
15
|
+
const cleanLine = line
|
|
16
|
+
.replace(/[│├└─┬┤┘┐┌┼]/g, '')
|
|
17
|
+
.replace(/\|/g, '')
|
|
18
|
+
.trimEnd();
|
|
19
|
+
// Calculate depth from leading whitespace
|
|
20
|
+
const stripped = cleanLine.trimStart();
|
|
21
|
+
if (!stripped)
|
|
22
|
+
continue;
|
|
23
|
+
const leadingSpaces = cleanLine.length - stripped.length;
|
|
24
|
+
const depth = Math.floor(leadingSpaces / 2);
|
|
25
|
+
const name = stripped.replace(/\/$/, '');
|
|
26
|
+
const isDirectory = stripped.endsWith('/') || !stripped.includes('.');
|
|
27
|
+
const node = {
|
|
28
|
+
name,
|
|
29
|
+
path: name,
|
|
30
|
+
isDirectory,
|
|
31
|
+
children: [],
|
|
32
|
+
};
|
|
33
|
+
// Find parent at depth - 1
|
|
34
|
+
while (stack.length > 0 && stack[stack.length - 1].depth >= depth) {
|
|
35
|
+
stack.pop();
|
|
36
|
+
}
|
|
37
|
+
if (stack.length > 0) {
|
|
38
|
+
const parent = stack[stack.length - 1].node;
|
|
39
|
+
node.path = `${parent.path}/${name}`;
|
|
40
|
+
parent.children.push(node);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
root.push(node);
|
|
44
|
+
}
|
|
45
|
+
if (isDirectory) {
|
|
46
|
+
stack.push({ node, depth });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return root;
|
|
50
|
+
}
|
|
51
|
+
function flattenFiles(nodes, result = []) {
|
|
52
|
+
for (const node of nodes) {
|
|
53
|
+
if (!node.isDirectory) {
|
|
54
|
+
result.push(node.path);
|
|
55
|
+
}
|
|
56
|
+
flattenFiles(node.children, result);
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
// File patterns for detection
|
|
61
|
+
const FRONTEND_PATTERNS = {
|
|
62
|
+
component: /\.(component|page|view|screen)\.(ts|tsx|js|jsx|vue|svelte)$/i,
|
|
63
|
+
store: /\.(store|state|slice|reducer|signals?)\.(ts|tsx|js|jsx)$/i,
|
|
64
|
+
service: /\.(service|api|client|http|data-access)\.(ts|tsx|js|jsx)$/i,
|
|
65
|
+
model: /\.(model|interface|type|dto|entity)\.(ts|tsx|js|jsx)$/i,
|
|
66
|
+
module: /\.(module|routes?)\.(ts|tsx|js|jsx)$/i,
|
|
67
|
+
test: /\.(spec|test)\.(ts|tsx|js|jsx)$/i,
|
|
68
|
+
};
|
|
69
|
+
const BACKEND_PATTERNS = {
|
|
70
|
+
controller: /\.(controller|handler|endpoint|view|viewset|resource)s?\.(ts|js|go|py|java|cs|php)$/i,
|
|
71
|
+
service: /\.(service|usecase|interactor|logic|business)s?\.(ts|js|go|py|java|cs|php)$/i,
|
|
72
|
+
repository: /\.(repository|repo|dal|dao|gateway|adapter)s?\.(ts|js|go|py|java|cs|php)$/i,
|
|
73
|
+
model: /\.(model|entity|schema|domain|aggregate)s?\.(ts|js|go|py|java|cs|php)$/i,
|
|
74
|
+
dto: /\.(dto|request|response|payload|serializer)s?\.(ts|js|go|py|java|cs|php)$/i,
|
|
75
|
+
test: /\.(spec|test|_test)\.(ts|js|go|py|java|cs|php)$/i,
|
|
76
|
+
};
|
|
77
|
+
// Directories that indicate module boundaries
|
|
78
|
+
const MODULE_INDICATORS = [
|
|
79
|
+
'components', 'features', 'modules', 'pages', 'views', 'screens',
|
|
80
|
+
'domains', 'entities', 'apps', 'api', 'controllers', 'services',
|
|
81
|
+
];
|
|
82
|
+
// Directories to skip
|
|
83
|
+
const SKIP_DIRS = [
|
|
84
|
+
'node_modules', '.git', 'dist', 'build', '__pycache__',
|
|
85
|
+
'.next', '.nuxt', '.svelte-kit', 'coverage', 'vendor',
|
|
86
|
+
'bootstrap', 'elements', 'shared', 'core', 'common', 'utils',
|
|
87
|
+
];
|
|
88
|
+
function detectModules(files) {
|
|
89
|
+
const moduleMap = new Map();
|
|
90
|
+
for (const file of files) {
|
|
91
|
+
const parts = file.split('/');
|
|
92
|
+
if (parts.some((p) => SKIP_DIRS.includes(p)))
|
|
93
|
+
continue;
|
|
94
|
+
// Find the most specific module-like directory
|
|
95
|
+
let modulePath = '';
|
|
96
|
+
let moduleName = '';
|
|
97
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
98
|
+
const dir = parts[i];
|
|
99
|
+
const parentDir = i > 0 ? parts[i - 1] : '';
|
|
100
|
+
// If parent is a module indicator, this dir is likely a module name
|
|
101
|
+
if (MODULE_INDICATORS.includes(parentDir.toLowerCase())) {
|
|
102
|
+
modulePath = parts.slice(0, i + 1).join('/');
|
|
103
|
+
moduleName = dir;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
// If this dir contains component/service files directly, it's a module
|
|
107
|
+
if (i === parts.length - 2) {
|
|
108
|
+
const fileName = parts[parts.length - 1];
|
|
109
|
+
const isFrontend = Object.values(FRONTEND_PATTERNS).some((p) => p.test(fileName));
|
|
110
|
+
const isBackend = Object.values(BACKEND_PATTERNS).some((p) => p.test(fileName));
|
|
111
|
+
if (isFrontend || isBackend) {
|
|
112
|
+
modulePath = parts.slice(0, i + 1).join('/');
|
|
113
|
+
moduleName = dir;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (moduleName && modulePath) {
|
|
118
|
+
const existing = moduleMap.get(modulePath) ?? [];
|
|
119
|
+
existing.push(file);
|
|
120
|
+
moduleMap.set(modulePath, existing);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Convert to DetectedModule[]
|
|
124
|
+
const modules = [];
|
|
125
|
+
for (const [path, moduleFiles] of moduleMap) {
|
|
126
|
+
const hasFrontend = moduleFiles.some((f) => Object.values(FRONTEND_PATTERNS).some((p) => p.test(f)));
|
|
127
|
+
const hasBackend = moduleFiles.some((f) => Object.values(BACKEND_PATTERNS).some((p) => p.test(f)));
|
|
128
|
+
let type = 'frontend';
|
|
129
|
+
if (hasFrontend && hasBackend)
|
|
130
|
+
type = 'fullstack';
|
|
131
|
+
else if (hasBackend)
|
|
132
|
+
type = 'backend';
|
|
133
|
+
modules.push({
|
|
134
|
+
name: path.split('/').pop() ?? path,
|
|
135
|
+
path,
|
|
136
|
+
files: moduleFiles,
|
|
137
|
+
type,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return modules;
|
|
141
|
+
}
|
|
142
|
+
// ─── Validation ──────────────────────────────────────────────────────────────
|
|
143
|
+
function validateFrontendModule(mod) {
|
|
144
|
+
const violations = [];
|
|
145
|
+
const files = mod.files.map((f) => f.toLowerCase());
|
|
146
|
+
const hasComponent = files.some((f) => FRONTEND_PATTERNS.component.test(f));
|
|
147
|
+
const hasStore = files.some((f) => FRONTEND_PATTERNS.store.test(f));
|
|
148
|
+
const hasService = files.some((f) => FRONTEND_PATTERNS.service.test(f));
|
|
149
|
+
const hasModel = files.some((f) => FRONTEND_PATTERNS.model.test(f));
|
|
150
|
+
const hasTests = files.some((f) => FRONTEND_PATTERNS.test.test(f));
|
|
151
|
+
// --- ERRORS ---
|
|
152
|
+
if (hasComponent && !hasStore) {
|
|
153
|
+
violations.push({
|
|
154
|
+
severity: 'error',
|
|
155
|
+
rule: 'missing-store',
|
|
156
|
+
message: `Module "${mod.name}" has component(s) but NO store. ` +
|
|
157
|
+
`Every feature MUST have a store that acts as the single source of truth. ` +
|
|
158
|
+
`Components should read state from the store, not manage it internally.`,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (hasComponent && !hasService) {
|
|
162
|
+
violations.push({
|
|
163
|
+
severity: 'error',
|
|
164
|
+
rule: 'missing-service',
|
|
165
|
+
message: `Module "${mod.name}" has component(s) but NO dedicated service. ` +
|
|
166
|
+
`Data access (HTTP, WebSocket, localStorage) must be isolated in a service layer.`,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
if (hasComponent && hasService && !hasStore) {
|
|
170
|
+
violations.push({
|
|
171
|
+
severity: 'error',
|
|
172
|
+
rule: 'component-calls-service-directly',
|
|
173
|
+
message: `Module "${mod.name}" appears to have components calling services directly (no store). ` +
|
|
174
|
+
`The flow must be: Component → Store → Service. The Store orchestrates data operations.`,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
// --- WARNINGS ---
|
|
178
|
+
if (!hasModel) {
|
|
179
|
+
violations.push({
|
|
180
|
+
severity: 'warning',
|
|
181
|
+
rule: 'missing-models',
|
|
182
|
+
message: `Module "${mod.name}" has no model/interface files. ` +
|
|
183
|
+
`Define TypeScript interfaces for your data — they are the contract between all layers.`,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (!hasTests) {
|
|
187
|
+
violations.push({
|
|
188
|
+
severity: 'warning',
|
|
189
|
+
rule: 'missing-tests',
|
|
190
|
+
message: `Module "${mod.name}" has no test files. ` +
|
|
191
|
+
`Each layer should have tests: Service tests (mock HTTP), Store tests (mock service), Component tests (mock store).`,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return violations;
|
|
195
|
+
}
|
|
196
|
+
function validateBackendModule(mod) {
|
|
197
|
+
const violations = [];
|
|
198
|
+
const files = mod.files.map((f) => f.toLowerCase());
|
|
199
|
+
const hasController = files.some((f) => BACKEND_PATTERNS.controller.test(f));
|
|
200
|
+
const hasService = files.some((f) => BACKEND_PATTERNS.service.test(f));
|
|
201
|
+
const hasRepository = files.some((f) => BACKEND_PATTERNS.repository.test(f));
|
|
202
|
+
const hasModel = files.some((f) => BACKEND_PATTERNS.model.test(f));
|
|
203
|
+
const hasDto = files.some((f) => BACKEND_PATTERNS.dto.test(f));
|
|
204
|
+
const hasTests = files.some((f) => BACKEND_PATTERNS.test.test(f));
|
|
205
|
+
// --- ERRORS ---
|
|
206
|
+
if (hasController && !hasService) {
|
|
207
|
+
violations.push({
|
|
208
|
+
severity: 'error',
|
|
209
|
+
rule: 'missing-service-layer',
|
|
210
|
+
message: `Module "${mod.name}" has controller(s) but NO service layer. ` +
|
|
211
|
+
`Controllers must delegate ALL business logic to services. ` +
|
|
212
|
+
`Controller should only: validate input, call service, format response.`,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
if (hasService && !hasRepository && hasController) {
|
|
216
|
+
violations.push({
|
|
217
|
+
severity: 'error',
|
|
218
|
+
rule: 'missing-repository',
|
|
219
|
+
message: `Module "${mod.name}" has controller + service but NO repository. ` +
|
|
220
|
+
`Data access (DB queries, ORM calls, external APIs) must be isolated in a repository layer. ` +
|
|
221
|
+
`Services should not contain data access logic.`,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
if (hasController && !hasService && !hasRepository) {
|
|
225
|
+
violations.push({
|
|
226
|
+
severity: 'error',
|
|
227
|
+
rule: 'fat-controller',
|
|
228
|
+
message: `Module "${mod.name}" appears to be a "fat controller" — it has only controller files ` +
|
|
229
|
+
`with no service or repository layers. All logic is likely in the controller. ` +
|
|
230
|
+
`Refactor to: Controller → Service → Repository.`,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
// --- WARNINGS ---
|
|
234
|
+
if (!hasModel) {
|
|
235
|
+
violations.push({
|
|
236
|
+
severity: 'warning',
|
|
237
|
+
rule: 'missing-domain-model',
|
|
238
|
+
message: `Module "${mod.name}" has no domain model/entity files. ` +
|
|
239
|
+
`Define your domain entities explicitly — they are the core of your business logic.`,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
if (!hasDto && hasController) {
|
|
243
|
+
violations.push({
|
|
244
|
+
severity: 'warning',
|
|
245
|
+
rule: 'missing-dto',
|
|
246
|
+
message: `Module "${mod.name}" has no DTO/serializer files. ` +
|
|
247
|
+
`Use DTOs to separate API contracts from domain models for better decoupling.`,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
if (!hasTests) {
|
|
251
|
+
violations.push({
|
|
252
|
+
severity: 'warning',
|
|
253
|
+
rule: 'missing-tests',
|
|
254
|
+
message: `Module "${mod.name}" has no test files. ` +
|
|
255
|
+
`Each layer should have tests: Repository tests (mock DB), Service tests (mock repo), Controller tests (mock service).`,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
return violations;
|
|
259
|
+
}
|
|
260
|
+
function validateModule(mod) {
|
|
261
|
+
const violations = [];
|
|
262
|
+
if (mod.type === 'frontend' || mod.type === 'fullstack') {
|
|
263
|
+
violations.push(...validateFrontendModule(mod));
|
|
264
|
+
}
|
|
265
|
+
if (mod.type === 'backend' || mod.type === 'fullstack') {
|
|
266
|
+
violations.push(...validateBackendModule(mod));
|
|
267
|
+
}
|
|
268
|
+
return violations;
|
|
269
|
+
}
|
|
270
|
+
// ─── Ticket Generation ───────────────────────────────────────────────────────
|
|
271
|
+
function generateActions(mod, violations) {
|
|
272
|
+
const actions = [];
|
|
273
|
+
for (const v of violations) {
|
|
274
|
+
switch (v.rule) {
|
|
275
|
+
// Frontend
|
|
276
|
+
case 'missing-store':
|
|
277
|
+
actions.push(`Create ${mod.name}.store.ts with state signals and business logic`);
|
|
278
|
+
actions.push(`Move any state management from component(s) to the store`);
|
|
279
|
+
actions.push(`Inject store into component(s) and read state reactively`);
|
|
280
|
+
break;
|
|
281
|
+
case 'missing-service':
|
|
282
|
+
actions.push(`Create ${mod.name}.service.ts for all HTTP/data access calls`);
|
|
283
|
+
actions.push(`Move any fetch/HTTP calls from components or stores to the service`);
|
|
284
|
+
break;
|
|
285
|
+
case 'component-calls-service-directly':
|
|
286
|
+
actions.push(`Create ${mod.name}.store.ts to sit between component and service`);
|
|
287
|
+
actions.push(`Refactor component to call store methods instead of service directly`);
|
|
288
|
+
actions.push(`Store should call service and manage resulting state`);
|
|
289
|
+
break;
|
|
290
|
+
case 'missing-models':
|
|
291
|
+
actions.push(`Create ${mod.name}.model.ts with TypeScript interfaces for all data structures`);
|
|
292
|
+
break;
|
|
293
|
+
case 'missing-tests':
|
|
294
|
+
actions.push(`Create ${mod.name}.spec.ts with unit tests for each layer`);
|
|
295
|
+
break;
|
|
296
|
+
// Backend
|
|
297
|
+
case 'missing-service-layer':
|
|
298
|
+
actions.push(`Create ${mod.name}.service.ts with business logic extracted from controller`);
|
|
299
|
+
actions.push(`Controller should only: validate input → call service → format response`);
|
|
300
|
+
break;
|
|
301
|
+
case 'missing-repository':
|
|
302
|
+
actions.push(`Create ${mod.name}.repository.ts for all database/data access operations`);
|
|
303
|
+
actions.push(`Move DB queries and ORM calls from service to repository`);
|
|
304
|
+
break;
|
|
305
|
+
case 'fat-controller':
|
|
306
|
+
actions.push(`Create ${mod.name}.service.ts — extract ALL business logic from controller`);
|
|
307
|
+
actions.push(`Create ${mod.name}.repository.ts — extract ALL data access from controller`);
|
|
308
|
+
actions.push(`Controller should become a thin HTTP adapter`);
|
|
309
|
+
break;
|
|
310
|
+
case 'missing-domain-model':
|
|
311
|
+
actions.push(`Create ${mod.name}.entity.ts with domain model definition`);
|
|
312
|
+
break;
|
|
313
|
+
case 'missing-dto':
|
|
314
|
+
actions.push(`Create ${mod.name}.dto.ts with request/response DTOs separate from domain model`);
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return [...new Set(actions)]; // deduplicate
|
|
319
|
+
}
|
|
320
|
+
function determinePriority(violations) {
|
|
321
|
+
const errorCount = violations.filter((v) => v.severity === 'error').length;
|
|
322
|
+
if (errorCount >= 2)
|
|
323
|
+
return 'high';
|
|
324
|
+
if (errorCount === 1)
|
|
325
|
+
return 'medium';
|
|
326
|
+
return 'low';
|
|
327
|
+
}
|
|
328
|
+
function generateTitle(mod, violations) {
|
|
329
|
+
const hasErrors = violations.some((v) => v.severity === 'error');
|
|
330
|
+
const typeLabel = mod.type === 'frontend'
|
|
331
|
+
? '→ patrón Component→Store→Service'
|
|
332
|
+
: mod.type === 'backend'
|
|
333
|
+
? '→ patrón Controller→Service→Repository'
|
|
334
|
+
: '→ patrones reactivos (frontend + backend)';
|
|
335
|
+
if (!hasErrors) {
|
|
336
|
+
return `Mejorar módulo ${mod.name} ${typeLabel}`;
|
|
337
|
+
}
|
|
338
|
+
return `Refactorizar módulo ${mod.name} ${typeLabel}`;
|
|
339
|
+
}
|
|
340
|
+
function buildTickets(modules) {
|
|
341
|
+
const tickets = [];
|
|
342
|
+
for (const mod of modules) {
|
|
343
|
+
const violations = validateModule(mod);
|
|
344
|
+
if (violations.length === 0)
|
|
345
|
+
continue;
|
|
346
|
+
tickets.push({
|
|
347
|
+
module: mod.name,
|
|
348
|
+
path: mod.path,
|
|
349
|
+
type: mod.type,
|
|
350
|
+
priority: determinePriority(violations),
|
|
351
|
+
title: generateTitle(mod, violations),
|
|
352
|
+
violations,
|
|
353
|
+
actions: generateActions(mod, violations),
|
|
354
|
+
files_affected: mod.files,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
// Sort: high priority first
|
|
358
|
+
tickets.sort((a, b) => {
|
|
359
|
+
const order = { high: 0, medium: 1, low: 2 };
|
|
360
|
+
return order[a.priority] - order[b.priority];
|
|
361
|
+
});
|
|
362
|
+
return tickets;
|
|
363
|
+
}
|
|
364
|
+
// ─── Output Formatting ──────────────────────────────────────────────────────
|
|
365
|
+
function formatAuditResult(result) {
|
|
366
|
+
const { summary, tickets } = result;
|
|
367
|
+
let output = '# 🔍 Architecture Audit Report\n\n';
|
|
368
|
+
// Summary
|
|
369
|
+
output += '## Summary\n\n';
|
|
370
|
+
output += `| Metric | Count |\n`;
|
|
371
|
+
output += `|--------|-------|\n`;
|
|
372
|
+
output += `| Modules analyzed | ${summary.total_modules} |\n`;
|
|
373
|
+
output += `| Modules with issues | ${summary.modules_with_issues} |\n`;
|
|
374
|
+
output += `| Total violations | ${summary.total_violations} |\n`;
|
|
375
|
+
output += `| ❌ Errors | ${summary.errors} |\n`;
|
|
376
|
+
output += `| ⚠️ Warnings | ${summary.warnings} |\n`;
|
|
377
|
+
output += `| 💡 Suggestions | ${summary.suggestions} |\n\n`;
|
|
378
|
+
if (tickets.length === 0) {
|
|
379
|
+
output += '✅ **No architecture violations found!** The project follows the reactive patterns correctly.\n';
|
|
380
|
+
return output;
|
|
381
|
+
}
|
|
382
|
+
// Tickets
|
|
383
|
+
output += `## Refactoring Tickets (${tickets.length})\n\n`;
|
|
384
|
+
for (let i = 0; i < tickets.length; i++) {
|
|
385
|
+
const ticket = tickets[i];
|
|
386
|
+
const priorityEmoji = ticket.priority === 'high' ? '🔴' : ticket.priority === 'medium' ? '🟡' : '🟢';
|
|
387
|
+
output += `### ${priorityEmoji} Ticket ${i + 1}: ${ticket.title}\n\n`;
|
|
388
|
+
output += `| Field | Value |\n`;
|
|
389
|
+
output += `|-------|-------|\n`;
|
|
390
|
+
output += `| Module | \`${ticket.module}\` |\n`;
|
|
391
|
+
output += `| Path | \`${ticket.path}\` |\n`;
|
|
392
|
+
output += `| Type | ${ticket.type} |\n`;
|
|
393
|
+
output += `| Priority | **${ticket.priority}** |\n\n`;
|
|
394
|
+
// Violations
|
|
395
|
+
const errors = ticket.violations.filter((v) => v.severity === 'error');
|
|
396
|
+
const warnings = ticket.violations.filter((v) => v.severity === 'warning');
|
|
397
|
+
if (errors.length > 0) {
|
|
398
|
+
output += '**Violations:**\n';
|
|
399
|
+
errors.forEach((v) => {
|
|
400
|
+
output += `- ❌ **[${v.rule}]** ${v.message}\n`;
|
|
401
|
+
});
|
|
402
|
+
output += '\n';
|
|
403
|
+
}
|
|
404
|
+
if (warnings.length > 0) {
|
|
405
|
+
output += '**Warnings:**\n';
|
|
406
|
+
warnings.forEach((v) => {
|
|
407
|
+
output += `- ⚠️ **[${v.rule}]** ${v.message}\n`;
|
|
408
|
+
});
|
|
409
|
+
output += '\n';
|
|
410
|
+
}
|
|
411
|
+
// Actions
|
|
412
|
+
output += '**Actions:**\n';
|
|
413
|
+
ticket.actions.forEach((a, j) => {
|
|
414
|
+
output += `${j + 1}. ${a}\n`;
|
|
415
|
+
});
|
|
416
|
+
output += '\n';
|
|
417
|
+
// Files
|
|
418
|
+
output += '**Files affected:**\n';
|
|
419
|
+
ticket.files_affected.forEach((f) => {
|
|
420
|
+
output += `- \`${f}\`\n`;
|
|
421
|
+
});
|
|
422
|
+
output += '\n---\n\n';
|
|
423
|
+
}
|
|
424
|
+
return output;
|
|
425
|
+
}
|
|
426
|
+
// ─── Tool Registration ───────────────────────────────────────────────────────
|
|
427
|
+
export function registerAuditProjectTool(server) {
|
|
428
|
+
server.tool('audit_project', `Audits a project's architecture by analyzing its file tree. ` +
|
|
429
|
+
`Detects modules/features, validates each against the reactive architecture patterns ` +
|
|
430
|
+
`(Component → Store → Service for frontend, Controller → Service → Repository for backend), ` +
|
|
431
|
+
`and generates structured refactoring tickets — one per module with violations. ` +
|
|
432
|
+
`Pass the output of 'find' or 'tree' command showing the project structure.`, {
|
|
433
|
+
file_tree: z
|
|
434
|
+
.string()
|
|
435
|
+
.describe('The project file tree as text. Can be output from `tree`, `find`, ' +
|
|
436
|
+
'or a manually listed structure. Each line should be a file or directory path.'),
|
|
437
|
+
project_name: z
|
|
438
|
+
.string()
|
|
439
|
+
.optional()
|
|
440
|
+
.describe('Name of the project being audited (for the report title)'),
|
|
441
|
+
}, async ({ file_tree, project_name }) => {
|
|
442
|
+
// Parse and analyze
|
|
443
|
+
const tree = parseFileTree(file_tree);
|
|
444
|
+
const allFiles = flattenFiles(tree);
|
|
445
|
+
const modules = detectModules(allFiles);
|
|
446
|
+
if (modules.length === 0) {
|
|
447
|
+
return {
|
|
448
|
+
content: [
|
|
449
|
+
{
|
|
450
|
+
type: 'text',
|
|
451
|
+
text: '⚠️ **No modules detected** in the provided file tree.\n\n' +
|
|
452
|
+
'Make sure the file tree includes source files with standard naming conventions:\n' +
|
|
453
|
+
'- Frontend: `*.component.ts`, `*.store.ts`, `*.service.ts`\n' +
|
|
454
|
+
'- Backend: `*.controller.ts`, `*.service.ts`, `*.repository.ts`\n\n' +
|
|
455
|
+
'The tree should show the full path structure, e.g.:\n' +
|
|
456
|
+
'```\nsrc/\n app/\n users/\n users.component.ts\n users.service.ts\n```',
|
|
457
|
+
},
|
|
458
|
+
],
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
// Build tickets
|
|
462
|
+
const tickets = buildTickets(modules);
|
|
463
|
+
// Build summary
|
|
464
|
+
const allViolations = tickets.flatMap((t) => t.violations);
|
|
465
|
+
const result = {
|
|
466
|
+
summary: {
|
|
467
|
+
total_modules: modules.length,
|
|
468
|
+
modules_with_issues: tickets.length,
|
|
469
|
+
total_violations: allViolations.length,
|
|
470
|
+
errors: allViolations.filter((v) => v.severity === 'error').length,
|
|
471
|
+
warnings: allViolations.filter((v) => v.severity === 'warning').length,
|
|
472
|
+
suggestions: allViolations.filter((v) => v.severity === 'suggestion').length,
|
|
473
|
+
},
|
|
474
|
+
tickets,
|
|
475
|
+
};
|
|
476
|
+
const title = project_name
|
|
477
|
+
? `# 🔍 Architecture Audit: ${project_name}\n\n`
|
|
478
|
+
: '';
|
|
479
|
+
return {
|
|
480
|
+
content: [
|
|
481
|
+
{
|
|
482
|
+
type: 'text',
|
|
483
|
+
text: title + formatAuditResult(result),
|
|
484
|
+
},
|
|
485
|
+
],
|
|
486
|
+
};
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
//# sourceMappingURL=audit-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-project.js","sourceRoot":"","sources":["../../src/tools/audit-project.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAChF,2EAA2E;AAC3E,0EAA0E;AAC1E,4CAA4C;AAC5C,gFAAgF;AAGhF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8CxB,SAAS,aAAa,CAAC,IAAY;IAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAClE,MAAM,IAAI,GAAe,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAwC,EAAE,CAAC;IAEtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,gEAAgE;QAChE,MAAM,SAAS,GAAG,IAAI;aACjB,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;aAC5B,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;aAClB,OAAO,EAAE,CAAC;Q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a,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,MAAM;aAC/E;YACD,OAAO;SACV,CAAC;QAEF,MAAM,KAAK,GAAG,YAAY;YACtB,CAAC,CAAC,4BAA4B,YAAY,MAAM;YAChD,CAAC,CAAC,EAAE,CAAC;QAET,OAAO;YACH,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC;iBAC1C;aACJ;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gherk/reactive-architecture",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "MCP server that teaches AI assistants the reactive architecture philosophy: Component → Store → Service + Controller → Service → Repository",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|