project-context-ai 2.2.5 → 2.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/dist/generators/template-sections.d.ts +8 -0
- package/dist/generators/template-sections.d.ts.map +1 -0
- package/dist/generators/template-sections.js +261 -0
- package/dist/generators/template-sections.js.map +1 -0
- package/dist/generators/template.d.ts +1 -6
- package/dist/generators/template.d.ts.map +1 -1
- package/dist/generators/template.js +2 -280
- package/dist/generators/template.js.map +1 -1
- package/dist/scanner/business.d.ts.map +1 -1
- package/dist/scanner/business.js +12 -726
- package/dist/scanner/business.js.map +1 -1
- package/dist/scanner/conventions.js +25 -6
- package/dist/scanner/conventions.js.map +1 -1
- package/dist/scanner/dependencies.d.ts.map +1 -1
- package/dist/scanner/dependencies.js +30 -0
- package/dist/scanner/dependencies.js.map +1 -1
- package/dist/scanner/description.d.ts +7 -0
- package/dist/scanner/description.d.ts.map +1 -0
- package/dist/scanner/description.js +172 -0
- package/dist/scanner/description.js.map +1 -0
- package/dist/scanner/domain.d.ts +10 -0
- package/dist/scanner/domain.d.ts.map +1 -0
- package/dist/scanner/domain.js +323 -0
- package/dist/scanner/domain.js.map +1 -0
- package/dist/scanner/frameworks.d.ts.map +1 -1
- package/dist/scanner/frameworks.js +13 -0
- package/dist/scanner/frameworks.js.map +1 -1
- package/dist/scanner/patterns-code.d.ts +9 -0
- package/dist/scanner/patterns-code.d.ts.map +1 -0
- package/dist/scanner/patterns-code.js +283 -0
- package/dist/scanner/patterns-code.js.map +1 -0
- package/dist/scanner/patterns.d.ts.map +1 -1
- package/dist/scanner/patterns.js +2 -288
- package/dist/scanner/patterns.js.map +1 -1
- package/dist/scanner/skills.d.ts +5 -0
- package/dist/scanner/skills.d.ts.map +1 -0
- package/dist/scanner/skills.js +242 -0
- package/dist/scanner/skills.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProjectContext } from "../types.js";
|
|
2
|
+
export declare function buildRoutesSection(ctx: ProjectContext): string;
|
|
3
|
+
export declare function buildDatabaseSection(ctx: ProjectContext): string;
|
|
4
|
+
export declare function buildModulesSection(ctx: ProjectContext): string;
|
|
5
|
+
export declare function buildEnvServicesSection(ctx: ProjectContext): string;
|
|
6
|
+
export declare function buildBusinessSection(ctx: ProjectContext): string;
|
|
7
|
+
export declare function buildDocIndexSection(ctx: ProjectContext): string;
|
|
8
|
+
//# sourceMappingURL=template-sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-sections.d.ts","sourceRoot":"","sources":["../../src/generators/template-sections.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CA0B9D;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAqChE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAY/D;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAqCnE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CA2HhE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CA0BhE"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
export function buildRoutesSection(ctx) {
|
|
2
|
+
if (!ctx.routes?.length)
|
|
3
|
+
return "";
|
|
4
|
+
const lines = [];
|
|
5
|
+
lines.push("## API Routes");
|
|
6
|
+
lines.push("");
|
|
7
|
+
const hasHandlers = ctx.routes.some((r) => r.handler);
|
|
8
|
+
let header = "| Method | Path | File | Auth |";
|
|
9
|
+
let sep = "|--------|------|------|------|";
|
|
10
|
+
if (hasHandlers) {
|
|
11
|
+
header += " Handler |";
|
|
12
|
+
sep += "---------|";
|
|
13
|
+
}
|
|
14
|
+
lines.push(header);
|
|
15
|
+
lines.push(sep);
|
|
16
|
+
for (const r of ctx.routes.slice(0, 30)) {
|
|
17
|
+
let row = `| ${r.method} | ${r.path} | \`${r.file}\` | ${r.auth ? "✓" : "—"} |`;
|
|
18
|
+
if (hasHandlers)
|
|
19
|
+
row += ` ${r.handler || "—"} |`;
|
|
20
|
+
lines.push(row);
|
|
21
|
+
}
|
|
22
|
+
if (ctx.routes.length > 30) {
|
|
23
|
+
lines.push(`\n> ${ctx.routes.length} routes total`);
|
|
24
|
+
}
|
|
25
|
+
lines.push("");
|
|
26
|
+
return lines.join("\n");
|
|
27
|
+
}
|
|
28
|
+
export function buildDatabaseSection(ctx) {
|
|
29
|
+
if (!ctx.database?.length)
|
|
30
|
+
return "";
|
|
31
|
+
const lines = [];
|
|
32
|
+
lines.push("## Database Schema");
|
|
33
|
+
lines.push("");
|
|
34
|
+
for (const model of ctx.database.slice(0, 15)) {
|
|
35
|
+
lines.push(`### ${model.name} (${model.source})`);
|
|
36
|
+
for (const f of model.fields) {
|
|
37
|
+
const tags = [];
|
|
38
|
+
if (f.primary)
|
|
39
|
+
tags.push("PK");
|
|
40
|
+
if (f.unique)
|
|
41
|
+
tags.push("unique");
|
|
42
|
+
if (f.required === false)
|
|
43
|
+
tags.push("optional");
|
|
44
|
+
if (f.defaultValue)
|
|
45
|
+
tags.push(`default: ${f.defaultValue}`);
|
|
46
|
+
const t = tags.length ? ` (${tags.join(", ")})` : "";
|
|
47
|
+
lines.push(`- **${f.name}** ${f.type}${t}`);
|
|
48
|
+
}
|
|
49
|
+
for (const r of model.relations) {
|
|
50
|
+
lines.push(`- **${r.name}** → ${r.target} (${r.type})`);
|
|
51
|
+
}
|
|
52
|
+
if (model.indexes?.length) {
|
|
53
|
+
for (const idx of model.indexes) {
|
|
54
|
+
lines.push(`- 📇 ${idx.unique ? "unique" : "index"}(${idx.fields.join(", ")})`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (model.enums?.length) {
|
|
58
|
+
for (const en of model.enums) {
|
|
59
|
+
lines.push(`- 📋 \`${en.name}\`: ${en.values.join(" | ")}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
lines.push("");
|
|
63
|
+
}
|
|
64
|
+
if (ctx.database.length > 15)
|
|
65
|
+
lines.push(`> ... and ${ctx.database.length - 15} more models\n`);
|
|
66
|
+
return lines.join("\n");
|
|
67
|
+
}
|
|
68
|
+
export function buildModulesSection(ctx) {
|
|
69
|
+
if (!ctx.modules?.length)
|
|
70
|
+
return "";
|
|
71
|
+
const lines = [];
|
|
72
|
+
lines.push("## Modules");
|
|
73
|
+
lines.push("");
|
|
74
|
+
for (const m of ctx.modules) {
|
|
75
|
+
const deps = m.dependsOn.length > 0 ? `→ ${m.dependsOn.join(", ")}` : "(no deps)";
|
|
76
|
+
lines.push(`- **${m.name}** (${m.files} files) ${deps}`);
|
|
77
|
+
}
|
|
78
|
+
lines.push("");
|
|
79
|
+
return lines.join("\n");
|
|
80
|
+
}
|
|
81
|
+
export function buildEnvServicesSection(ctx) {
|
|
82
|
+
const lines = [];
|
|
83
|
+
if (ctx.services?.length) {
|
|
84
|
+
lines.push("## External Services");
|
|
85
|
+
lines.push(ctx.services.map((s) => `**${s.name}** (${s.type})`).join(" · "));
|
|
86
|
+
lines.push("");
|
|
87
|
+
}
|
|
88
|
+
if (ctx.envVars?.length) {
|
|
89
|
+
lines.push("## Environment Variables");
|
|
90
|
+
lines.push("");
|
|
91
|
+
const groups = new Map();
|
|
92
|
+
for (const v of ctx.envVars) {
|
|
93
|
+
if (!groups.has(v.category))
|
|
94
|
+
groups.set(v.category, []);
|
|
95
|
+
groups.get(v.category).push(v);
|
|
96
|
+
}
|
|
97
|
+
const labels = {
|
|
98
|
+
database: "DB", auth: "Auth", "api-key": "API Keys",
|
|
99
|
+
service: "Services", "feature-flag": "Flags", config: "Config", other: "Other",
|
|
100
|
+
};
|
|
101
|
+
for (const [cat, vars] of groups) {
|
|
102
|
+
const label = labels[cat] || cat;
|
|
103
|
+
const required = vars.filter((v) => v.required).map((v) => `\`${v.name}\``);
|
|
104
|
+
const optional = vars.filter((v) => !v.required).map((v) => `\`${v.name}\``);
|
|
105
|
+
const parts = [];
|
|
106
|
+
if (required.length)
|
|
107
|
+
parts.push(required.join(", "));
|
|
108
|
+
if (optional.length)
|
|
109
|
+
parts.push(`optional: ${optional.join(", ")}`);
|
|
110
|
+
lines.push(`**${label}:** ${parts.join(" | ")}`);
|
|
111
|
+
}
|
|
112
|
+
lines.push("");
|
|
113
|
+
}
|
|
114
|
+
return lines.join("\n");
|
|
115
|
+
}
|
|
116
|
+
export function buildBusinessSection(ctx) {
|
|
117
|
+
if (!ctx.business)
|
|
118
|
+
return "";
|
|
119
|
+
const biz = ctx.business;
|
|
120
|
+
const lines = [];
|
|
121
|
+
if (biz.entryPointsDescribed && biz.entryPointsDescribed.length > 0) {
|
|
122
|
+
lines.push("## Entry Points");
|
|
123
|
+
lines.push("");
|
|
124
|
+
for (const ep of biz.entryPointsDescribed) {
|
|
125
|
+
lines.push(`- \`${ep.file}\` — ${ep.description}`);
|
|
126
|
+
}
|
|
127
|
+
lines.push("");
|
|
128
|
+
}
|
|
129
|
+
if (biz.dataFlow && biz.dataFlow.length > 0) {
|
|
130
|
+
lines.push("## Data Flow");
|
|
131
|
+
lines.push("");
|
|
132
|
+
for (const flow of biz.dataFlow) {
|
|
133
|
+
lines.push(`- ${flow}`);
|
|
134
|
+
}
|
|
135
|
+
lines.push("");
|
|
136
|
+
}
|
|
137
|
+
if (biz.directoryMap && biz.directoryMap.length > 0) {
|
|
138
|
+
lines.push("## Directory Map");
|
|
139
|
+
lines.push("```");
|
|
140
|
+
for (const d of biz.directoryMap) {
|
|
141
|
+
lines.push(`${d.path.padEnd(30)} — ${d.description}`);
|
|
142
|
+
}
|
|
143
|
+
lines.push("```");
|
|
144
|
+
lines.push("");
|
|
145
|
+
}
|
|
146
|
+
if (biz.keyModules && biz.keyModules.length > 0) {
|
|
147
|
+
lines.push("## Key Modules");
|
|
148
|
+
lines.push("");
|
|
149
|
+
for (const m of biz.keyModules) {
|
|
150
|
+
lines.push(`- \`${m.file}\` — ${m.description}`);
|
|
151
|
+
}
|
|
152
|
+
lines.push("");
|
|
153
|
+
}
|
|
154
|
+
const actualFeatures = biz.features.filter((f) => !f.startsWith("["));
|
|
155
|
+
if (actualFeatures.length > 0) {
|
|
156
|
+
lines.push("## Features");
|
|
157
|
+
lines.push("");
|
|
158
|
+
for (const f of biz.features) {
|
|
159
|
+
if (f.startsWith("[") && f.endsWith("]")) {
|
|
160
|
+
lines.push(`\n**${f.slice(1, -1)}:**`);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
lines.push(`- ${f}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
lines.push("");
|
|
167
|
+
}
|
|
168
|
+
if (biz.skills.length > 0) {
|
|
169
|
+
lines.push("## Skills / Plugins");
|
|
170
|
+
lines.push("");
|
|
171
|
+
const interfaces = new Set(biz.skills.map((s) => s.interface).filter(Boolean));
|
|
172
|
+
if (interfaces.size === 1) {
|
|
173
|
+
lines.push(`> ${biz.skills.length} skills implementing \`${[...interfaces][0]}\``);
|
|
174
|
+
lines.push("");
|
|
175
|
+
}
|
|
176
|
+
for (const skill of biz.skills) {
|
|
177
|
+
const desc = skill.description ? ` — ${skill.description}` : "";
|
|
178
|
+
const toolList = skill.tools?.length ? `. Tools: \`${skill.tools.join("`, `")}\`` : "";
|
|
179
|
+
lines.push(`- **${skill.name}**${desc}${toolList}`);
|
|
180
|
+
}
|
|
181
|
+
lines.push("");
|
|
182
|
+
}
|
|
183
|
+
if (biz.validationRules.length > 0) {
|
|
184
|
+
lines.push("## Validation");
|
|
185
|
+
lines.push("");
|
|
186
|
+
for (const r of biz.validationRules) {
|
|
187
|
+
const fields = r.fields.length > 0 ? ` — ${r.fields.join(", ")}` : "";
|
|
188
|
+
lines.push(`- \`${r.schema}\` (${r.library})${fields}`);
|
|
189
|
+
}
|
|
190
|
+
lines.push("");
|
|
191
|
+
}
|
|
192
|
+
if (biz.handlers && biz.handlers.length > 0) {
|
|
193
|
+
lines.push("## Handlers");
|
|
194
|
+
lines.push("");
|
|
195
|
+
for (const h of biz.handlers) {
|
|
196
|
+
lines.push(`- **${h.name}** (\`${h.file}\`) — ${h.description}`);
|
|
197
|
+
}
|
|
198
|
+
lines.push("");
|
|
199
|
+
}
|
|
200
|
+
if (biz.frontendInfo) {
|
|
201
|
+
const fi = biz.frontendInfo;
|
|
202
|
+
lines.push("## Frontend");
|
|
203
|
+
lines.push("");
|
|
204
|
+
if (fi.stores.length > 0)
|
|
205
|
+
lines.push(`**Stores:** ${fi.stores.join(", ")}`);
|
|
206
|
+
if (fi.hooks.length > 0)
|
|
207
|
+
lines.push(`**Hooks:** ${fi.hooks.join(", ")}`);
|
|
208
|
+
if (fi.componentDirs.length > 0)
|
|
209
|
+
lines.push(`**Components:** ${fi.componentDirs.join(", ")}`);
|
|
210
|
+
if (fi.features.length > 0)
|
|
211
|
+
lines.push(`**UI Features:** ${fi.features.join(", ")}`);
|
|
212
|
+
lines.push("");
|
|
213
|
+
}
|
|
214
|
+
if (biz.authPatterns.length > 0) {
|
|
215
|
+
lines.push("## Auth & Permissions");
|
|
216
|
+
lines.push("");
|
|
217
|
+
for (const p of biz.authPatterns)
|
|
218
|
+
lines.push(`- ${p}`);
|
|
219
|
+
lines.push("");
|
|
220
|
+
}
|
|
221
|
+
if (biz.entityGroups && biz.entityGroups.length > 0) {
|
|
222
|
+
lines.push("## Domain Entities");
|
|
223
|
+
lines.push("");
|
|
224
|
+
for (const g of biz.entityGroups.slice(0, 10)) {
|
|
225
|
+
lines.push(`**\`${g.file}\`:** ${g.entities.slice(0, 5).join(", ")}`);
|
|
226
|
+
}
|
|
227
|
+
lines.push("");
|
|
228
|
+
}
|
|
229
|
+
else if (biz.domainEntities.length > 0) {
|
|
230
|
+
lines.push("## Domain Entities");
|
|
231
|
+
lines.push(biz.domainEntities.join(", "));
|
|
232
|
+
lines.push("");
|
|
233
|
+
}
|
|
234
|
+
return lines.join("\n");
|
|
235
|
+
}
|
|
236
|
+
export function buildDocIndexSection(ctx) {
|
|
237
|
+
if (!ctx.business?.documentation?.length && !ctx.patterns?.ideSkills?.length)
|
|
238
|
+
return "";
|
|
239
|
+
const lines = [];
|
|
240
|
+
lines.push("## Documentation Index");
|
|
241
|
+
lines.push("Read these files for detailed context:");
|
|
242
|
+
lines.push("");
|
|
243
|
+
if (ctx.business?.documentation) {
|
|
244
|
+
for (const doc of ctx.business.documentation) {
|
|
245
|
+
lines.push(`- \`${doc.file}\` — ${doc.title}`);
|
|
246
|
+
if (doc.keyRules?.length) {
|
|
247
|
+
for (const rule of doc.keyRules)
|
|
248
|
+
lines.push(` - ⚠️ ${rule}`);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (ctx.patterns?.ideSkills?.length) {
|
|
253
|
+
for (const skill of ctx.patterns.ideSkills) {
|
|
254
|
+
const when = skill.activatesOn ? ` (read when editing ${skill.activatesOn})` : "";
|
|
255
|
+
lines.push(`- \`${skill.file}\` — ${skill.description || skill.name}${when}`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
lines.push("");
|
|
259
|
+
return lines.join("\n");
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=template-sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-sections.js","sourceRoot":"","sources":["../../src/generators/template-sections.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,kBAAkB,CAAC,GAAmB;IACpD,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,MAAM,WAAW,GAAG,GA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AE,CAAC;YAC7C,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;YAC/C,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;gBACzB,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,QAAQ;oBAAE,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QACpC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,uBAAuB,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAClF,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import type { ProjectContext } from "../types.js";
|
|
2
|
+
export { buildRoutesSection, buildDatabaseSection, buildModulesSection, buildEnvServicesSection, buildBusinessSection, buildDocIndexSection, } from "./template-sections.js";
|
|
2
3
|
export declare function buildProjectOverview(ctx: ProjectContext): string;
|
|
3
4
|
export declare function buildRulesSection(ctx: ProjectContext): string;
|
|
4
5
|
export declare function buildPatternsSection(ctx: ProjectContext): string;
|
|
5
|
-
export declare function buildRoutesSection(ctx: ProjectContext): string;
|
|
6
|
-
export declare function buildDatabaseSection(ctx: ProjectContext): string;
|
|
7
|
-
export declare function buildModulesSection(ctx: ProjectContext): string;
|
|
8
|
-
export declare function buildEnvServicesSection(ctx: ProjectContext): string;
|
|
9
|
-
export declare function buildBusinessSection(ctx: ProjectContext): string;
|
|
10
|
-
export declare function buildDocIndexSection(ctx: ProjectContext): string;
|
|
11
6
|
export declare function buildStructureSection(_ctx: ProjectContext): string;
|
|
12
7
|
export declare function buildKeyFilesSection(_ctx: ProjectContext): string;
|
|
13
8
|
export declare function buildEntryPointsSection(_ctx: ProjectContext): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/generators/template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/generators/template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAIhC,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAkChE;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAmB7D;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAwHhE;AAID,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAe;AAClF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAe;AACjF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAe;AACpF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAe;AAChF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAe;AACrF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAe"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Re-export all section builders for consumers
|
|
2
|
+
export { buildRoutesSection, buildDatabaseSection, buildModulesSection, buildEnvServicesSection, buildBusinessSection, buildDocIndexSection, } from "./template-sections.js";
|
|
1
3
|
// ─── High-Signal Format: Rules → Stack → Patterns → Details → Pointers ───
|
|
2
4
|
export function buildProjectOverview(ctx) {
|
|
3
5
|
const lines = [];
|
|
@@ -23,7 +25,6 @@ export function buildProjectOverview(ctx) {
|
|
|
23
25
|
stackParts.push(ctx.conventions.api);
|
|
24
26
|
lines.push(`## Tech Stack`);
|
|
25
27
|
lines.push(`${stackParts.join(" | ")}`);
|
|
26
|
-
// Extra lines only for non-covered info
|
|
27
28
|
if (ctx.conventions.styling !== "CSS" && !coveredCategories.has("styling")) {
|
|
28
29
|
lines.push(`Styling: ${ctx.conventions.styling}`);
|
|
29
30
|
}
|
|
@@ -166,282 +167,6 @@ export function buildPatternsSection(ctx) {
|
|
|
166
167
|
}
|
|
167
168
|
return lines.join("\n");
|
|
168
169
|
}
|
|
169
|
-
export function buildRoutesSection(ctx) {
|
|
170
|
-
if (!ctx.routes?.length)
|
|
171
|
-
return "";
|
|
172
|
-
const lines = [];
|
|
173
|
-
lines.push("## API Routes");
|
|
174
|
-
lines.push("");
|
|
175
|
-
const hasHandlers = ctx.routes.some((r) => r.handler);
|
|
176
|
-
let header = "| Method | Path | File | Auth |";
|
|
177
|
-
let sep = "|--------|------|------|------|";
|
|
178
|
-
if (hasHandlers) {
|
|
179
|
-
header += " Handler |";
|
|
180
|
-
sep += "---------|";
|
|
181
|
-
}
|
|
182
|
-
lines.push(header);
|
|
183
|
-
lines.push(sep);
|
|
184
|
-
for (const r of ctx.routes.slice(0, 30)) {
|
|
185
|
-
let row = `| ${r.method} | ${r.path} | \`${r.file}\` | ${r.auth ? "✓" : "—"} |`;
|
|
186
|
-
if (hasHandlers)
|
|
187
|
-
row += ` ${r.handler || "—"} |`;
|
|
188
|
-
lines.push(row);
|
|
189
|
-
}
|
|
190
|
-
if (ctx.routes.length > 30) {
|
|
191
|
-
lines.push(`\n> ${ctx.routes.length} routes total`);
|
|
192
|
-
}
|
|
193
|
-
lines.push("");
|
|
194
|
-
return lines.join("\n");
|
|
195
|
-
}
|
|
196
|
-
export function buildDatabaseSection(ctx) {
|
|
197
|
-
if (!ctx.database?.length)
|
|
198
|
-
return "";
|
|
199
|
-
const lines = [];
|
|
200
|
-
lines.push("## Database Schema");
|
|
201
|
-
lines.push("");
|
|
202
|
-
for (const model of ctx.database.slice(0, 15)) {
|
|
203
|
-
lines.push(`### ${model.name} (${model.source})`);
|
|
204
|
-
for (const f of model.fields) {
|
|
205
|
-
const tags = [];
|
|
206
|
-
if (f.primary)
|
|
207
|
-
tags.push("PK");
|
|
208
|
-
if (f.unique)
|
|
209
|
-
tags.push("unique");
|
|
210
|
-
if (f.required === false)
|
|
211
|
-
tags.push("optional");
|
|
212
|
-
if (f.defaultValue)
|
|
213
|
-
tags.push(`default: ${f.defaultValue}`);
|
|
214
|
-
const t = tags.length ? ` (${tags.join(", ")})` : "";
|
|
215
|
-
lines.push(`- **${f.name}** ${f.type}${t}`);
|
|
216
|
-
}
|
|
217
|
-
for (const r of model.relations) {
|
|
218
|
-
lines.push(`- **${r.name}** → ${r.target} (${r.type})`);
|
|
219
|
-
}
|
|
220
|
-
if (model.indexes?.length) {
|
|
221
|
-
for (const idx of model.indexes) {
|
|
222
|
-
lines.push(`- 📇 ${idx.unique ? "unique" : "index"}(${idx.fields.join(", ")})`);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
if (model.enums?.length) {
|
|
226
|
-
for (const en of model.enums) {
|
|
227
|
-
lines.push(`- 📋 \`${en.name}\`: ${en.values.join(" | ")}`);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
lines.push("");
|
|
231
|
-
}
|
|
232
|
-
if (ctx.database.length > 15)
|
|
233
|
-
lines.push(`> ... and ${ctx.database.length - 15} more models\n`);
|
|
234
|
-
return lines.join("\n");
|
|
235
|
-
}
|
|
236
|
-
export function buildModulesSection(ctx) {
|
|
237
|
-
if (!ctx.modules?.length)
|
|
238
|
-
return "";
|
|
239
|
-
const lines = [];
|
|
240
|
-
lines.push("## Modules");
|
|
241
|
-
lines.push("");
|
|
242
|
-
for (const m of ctx.modules) {
|
|
243
|
-
const deps = m.dependsOn.length > 0 ? `→ ${m.dependsOn.join(", ")}` : "(no deps)";
|
|
244
|
-
lines.push(`- **${m.name}** (${m.files} files) ${deps}`);
|
|
245
|
-
}
|
|
246
|
-
lines.push("");
|
|
247
|
-
return lines.join("\n");
|
|
248
|
-
}
|
|
249
|
-
export function buildEnvServicesSection(ctx) {
|
|
250
|
-
const lines = [];
|
|
251
|
-
// Services (compact)
|
|
252
|
-
if (ctx.services?.length) {
|
|
253
|
-
lines.push("## External Services");
|
|
254
|
-
lines.push(ctx.services.map((s) => `**${s.name}** (${s.type})`).join(" · "));
|
|
255
|
-
lines.push("");
|
|
256
|
-
}
|
|
257
|
-
// Env vars (compact by category)
|
|
258
|
-
if (ctx.envVars?.length) {
|
|
259
|
-
lines.push("## Environment Variables");
|
|
260
|
-
lines.push("");
|
|
261
|
-
const groups = new Map();
|
|
262
|
-
for (const v of ctx.envVars) {
|
|
263
|
-
if (!groups.has(v.category))
|
|
264
|
-
groups.set(v.category, []);
|
|
265
|
-
groups.get(v.category).push(v);
|
|
266
|
-
}
|
|
267
|
-
const labels = {
|
|
268
|
-
database: "DB", auth: "Auth", "api-key": "API Keys",
|
|
269
|
-
service: "Services", "feature-flag": "Flags", config: "Config", other: "Other",
|
|
270
|
-
};
|
|
271
|
-
for (const [cat, vars] of groups) {
|
|
272
|
-
const label = labels[cat] || cat;
|
|
273
|
-
const required = vars.filter((v) => v.required).map((v) => `\`${v.name}\``);
|
|
274
|
-
const optional = vars.filter((v) => !v.required).map((v) => `\`${v.name}\``);
|
|
275
|
-
const parts = [];
|
|
276
|
-
if (required.length)
|
|
277
|
-
parts.push(required.join(", "));
|
|
278
|
-
if (optional.length)
|
|
279
|
-
parts.push(`optional: ${optional.join(", ")}`);
|
|
280
|
-
lines.push(`**${label}:** ${parts.join(" | ")}`);
|
|
281
|
-
}
|
|
282
|
-
lines.push("");
|
|
283
|
-
}
|
|
284
|
-
return lines.join("\n");
|
|
285
|
-
}
|
|
286
|
-
export function buildBusinessSection(ctx) {
|
|
287
|
-
if (!ctx.business)
|
|
288
|
-
return "";
|
|
289
|
-
const biz = ctx.business;
|
|
290
|
-
const lines = [];
|
|
291
|
-
// Entry points + Data flow (Fix #1 + #2)
|
|
292
|
-
if (biz.entryPointsDescribed && biz.entryPointsDescribed.length > 0) {
|
|
293
|
-
lines.push("## Entry Points");
|
|
294
|
-
lines.push("");
|
|
295
|
-
for (const ep of biz.entryPointsDescribed) {
|
|
296
|
-
lines.push(`- \`${ep.file}\` — ${ep.description}`);
|
|
297
|
-
}
|
|
298
|
-
lines.push("");
|
|
299
|
-
}
|
|
300
|
-
if (biz.dataFlow && biz.dataFlow.length > 0) {
|
|
301
|
-
lines.push("## Data Flow");
|
|
302
|
-
lines.push("");
|
|
303
|
-
for (const flow of biz.dataFlow) {
|
|
304
|
-
lines.push(`- ${flow}`);
|
|
305
|
-
}
|
|
306
|
-
lines.push("");
|
|
307
|
-
}
|
|
308
|
-
// Directory map (Fix #3 + #4)
|
|
309
|
-
if (biz.directoryMap && biz.directoryMap.length > 0) {
|
|
310
|
-
lines.push("## Directory Map");
|
|
311
|
-
lines.push("```");
|
|
312
|
-
for (const d of biz.directoryMap) {
|
|
313
|
-
lines.push(`${d.path.padEnd(30)} — ${d.description}`);
|
|
314
|
-
}
|
|
315
|
-
lines.push("```");
|
|
316
|
-
lines.push("");
|
|
317
|
-
}
|
|
318
|
-
// Key Modules (Fix #5 — core files with descriptions)
|
|
319
|
-
if (biz.keyModules && biz.keyModules.length > 0) {
|
|
320
|
-
lines.push("## Key Modules");
|
|
321
|
-
lines.push("");
|
|
322
|
-
for (const m of biz.keyModules) {
|
|
323
|
-
lines.push(`- \`${m.file}\` — ${m.description}`);
|
|
324
|
-
}
|
|
325
|
-
lines.push("");
|
|
326
|
-
}
|
|
327
|
-
// Features (only if there are actual bullet items, not just headings)
|
|
328
|
-
const actualFeatures = biz.features.filter((f) => !f.startsWith("["));
|
|
329
|
-
if (actualFeatures.length > 0) {
|
|
330
|
-
lines.push("## Features");
|
|
331
|
-
lines.push("");
|
|
332
|
-
for (const f of biz.features) {
|
|
333
|
-
if (f.startsWith("[") && f.endsWith("]")) {
|
|
334
|
-
lines.push(`\n**${f.slice(1, -1)}:**`);
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
lines.push(`- ${f}`);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
lines.push("");
|
|
341
|
-
}
|
|
342
|
-
// Skills (Fix #2 — description + tool names instead of broken signatures)
|
|
343
|
-
if (biz.skills.length > 0) {
|
|
344
|
-
lines.push("## Skills / Plugins");
|
|
345
|
-
lines.push("");
|
|
346
|
-
const interfaces = new Set(biz.skills.map((s) => s.interface).filter(Boolean));
|
|
347
|
-
if (interfaces.size === 1) {
|
|
348
|
-
lines.push(`> ${biz.skills.length} skills implementing \`${[...interfaces][0]}\``);
|
|
349
|
-
lines.push("");
|
|
350
|
-
}
|
|
351
|
-
for (const skill of biz.skills) {
|
|
352
|
-
const desc = skill.description ? ` — ${skill.description}` : "";
|
|
353
|
-
const toolList = skill.tools?.length ? `. Tools: \`${skill.tools.join("`, `")}\`` : "";
|
|
354
|
-
lines.push(`- **${skill.name}**${desc}${toolList}`);
|
|
355
|
-
}
|
|
356
|
-
lines.push("");
|
|
357
|
-
}
|
|
358
|
-
// Validation rules
|
|
359
|
-
if (biz.validationRules.length > 0) {
|
|
360
|
-
lines.push("## Validation");
|
|
361
|
-
lines.push("");
|
|
362
|
-
for (const r of biz.validationRules) {
|
|
363
|
-
const fields = r.fields.length > 0 ? ` — ${r.fields.join(", ")}` : "";
|
|
364
|
-
lines.push(`- \`${r.schema}\` (${r.library})${fields}`);
|
|
365
|
-
}
|
|
366
|
-
lines.push("");
|
|
367
|
-
}
|
|
368
|
-
// Handlers (Fix #4)
|
|
369
|
-
if (biz.handlers && biz.handlers.length > 0) {
|
|
370
|
-
lines.push("## Handlers");
|
|
371
|
-
lines.push("");
|
|
372
|
-
for (const h of biz.handlers) {
|
|
373
|
-
lines.push(`- **${h.name}** (\`${h.file}\`) — ${h.description}`);
|
|
374
|
-
}
|
|
375
|
-
lines.push("");
|
|
376
|
-
}
|
|
377
|
-
// Frontend (Fix #6)
|
|
378
|
-
if (biz.frontendInfo) {
|
|
379
|
-
const fi = biz.frontendInfo;
|
|
380
|
-
lines.push("## Frontend");
|
|
381
|
-
lines.push("");
|
|
382
|
-
if (fi.stores.length > 0) {
|
|
383
|
-
lines.push(`**Stores:** ${fi.stores.join(", ")}`);
|
|
384
|
-
}
|
|
385
|
-
if (fi.hooks.length > 0) {
|
|
386
|
-
lines.push(`**Hooks:** ${fi.hooks.join(", ")}`);
|
|
387
|
-
}
|
|
388
|
-
if (fi.componentDirs.length > 0) {
|
|
389
|
-
lines.push(`**Components:** ${fi.componentDirs.join(", ")}`);
|
|
390
|
-
}
|
|
391
|
-
if (fi.features.length > 0) {
|
|
392
|
-
lines.push(`**UI Features:** ${fi.features.join(", ")}`);
|
|
393
|
-
}
|
|
394
|
-
lines.push("");
|
|
395
|
-
}
|
|
396
|
-
// Auth
|
|
397
|
-
if (biz.authPatterns.length > 0) {
|
|
398
|
-
lines.push("## Auth & Permissions");
|
|
399
|
-
lines.push("");
|
|
400
|
-
for (const p of biz.authPatterns)
|
|
401
|
-
lines.push(`- ${p}`);
|
|
402
|
-
lines.push("");
|
|
403
|
-
}
|
|
404
|
-
// Domain entities (Fix #7 — limited to cross-boundary types)
|
|
405
|
-
if (biz.entityGroups && biz.entityGroups.length > 0) {
|
|
406
|
-
lines.push("## Domain Entities");
|
|
407
|
-
lines.push("");
|
|
408
|
-
for (const g of biz.entityGroups.slice(0, 10)) {
|
|
409
|
-
lines.push(`**\`${g.file}\`:** ${g.entities.slice(0, 5).join(", ")}`);
|
|
410
|
-
}
|
|
411
|
-
lines.push("");
|
|
412
|
-
}
|
|
413
|
-
else if (biz.domainEntities.length > 0) {
|
|
414
|
-
lines.push("## Domain Entities");
|
|
415
|
-
lines.push(biz.domainEntities.join(", "));
|
|
416
|
-
lines.push("");
|
|
417
|
-
}
|
|
418
|
-
return lines.join("\n");
|
|
419
|
-
}
|
|
420
|
-
export function buildDocIndexSection(ctx) {
|
|
421
|
-
if (!ctx.business?.documentation?.length && !ctx.patterns?.ideSkills?.length)
|
|
422
|
-
return "";
|
|
423
|
-
const lines = [];
|
|
424
|
-
lines.push("## Documentation Index");
|
|
425
|
-
lines.push("Read these files for detailed context:");
|
|
426
|
-
lines.push("");
|
|
427
|
-
if (ctx.business?.documentation) {
|
|
428
|
-
for (const doc of ctx.business.documentation) {
|
|
429
|
-
lines.push(`- \`${doc.file}\` — ${doc.title}`);
|
|
430
|
-
if (doc.keyRules?.length) {
|
|
431
|
-
for (const rule of doc.keyRules)
|
|
432
|
-
lines.push(` - ⚠️ ${rule}`);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
if (ctx.patterns?.ideSkills?.length) {
|
|
437
|
-
for (const skill of ctx.patterns.ideSkills) {
|
|
438
|
-
const when = skill.activatesOn ? ` (read when editing ${skill.activatesOn})` : "";
|
|
439
|
-
lines.push(`- \`${skill.file}\` — ${skill.description || skill.name}${when}`);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
lines.push("");
|
|
443
|
-
return lines.join("\n");
|
|
444
|
-
}
|
|
445
170
|
// ─── Legacy exports (kept for backward compat but now unused by generators) ───
|
|
446
171
|
export function buildStructureSection(_ctx) { return ""; }
|
|
447
172
|
export function buildKeyFilesSection(_ctx) { return ""; }
|
|
@@ -459,7 +184,4 @@ function groupFrameworksByCategory(ctx) {
|
|
|
459
184
|
}
|
|
460
185
|
return groups;
|
|
461
186
|
}
|
|
462
|
-
function capitalize(s) {
|
|
463
|
-
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
464
|
-
}
|
|
465
187
|
//# sourceMappingURL=template.js.map
|