archdraw-mcp-server 1.0.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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +757 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/__tests__/constants.test.d.ts +2 -0
- package/dist/lib/__tests__/constants.test.d.ts.map +1 -0
- package/dist/lib/__tests__/constants.test.js +47 -0
- package/dist/lib/__tests__/constants.test.js.map +1 -0
- package/dist/lib/__tests__/diagram-state.test.d.ts +2 -0
- package/dist/lib/__tests__/diagram-state.test.d.ts.map +1 -0
- package/dist/lib/__tests__/diagram-state.test.js +75 -0
- package/dist/lib/__tests__/diagram-state.test.js.map +1 -0
- package/dist/lib/__tests__/elk-runner.test.d.ts +2 -0
- package/dist/lib/__tests__/elk-runner.test.d.ts.map +1 -0
- package/dist/lib/__tests__/elk-runner.test.js +87 -0
- package/dist/lib/__tests__/elk-runner.test.js.map +1 -0
- package/dist/lib/checkpoints.d.ts +48 -0
- package/dist/lib/checkpoints.d.ts.map +1 -0
- package/dist/lib/checkpoints.js +58 -0
- package/dist/lib/checkpoints.js.map +1 -0
- package/dist/lib/constants.d.ts +29 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +62 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/diagram-state.d.ts +18 -0
- package/dist/lib/diagram-state.d.ts.map +1 -0
- package/dist/lib/diagram-state.js +55 -0
- package/dist/lib/diagram-state.js.map +1 -0
- package/dist/lib/elk-runner.d.ts +29 -0
- package/dist/lib/elk-runner.d.ts.map +1 -0
- package/dist/lib/elk-runner.js +532 -0
- package/dist/lib/elk-runner.js.map +1 -0
- package/dist/lib/http.d.ts +3 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +13 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/node-catalog.d.ts +10 -0
- package/dist/lib/node-catalog.d.ts.map +1 -0
- package/dist/lib/node-catalog.js +122 -0
- package/dist/lib/node-catalog.js.map +1 -0
- package/dist/lib/parse-prompt.d.ts +26 -0
- package/dist/lib/parse-prompt.d.ts.map +1 -0
- package/dist/lib/parse-prompt.js +289 -0
- package/dist/lib/parse-prompt.js.map +1 -0
- package/dist/lib/prompt-builder.d.ts +14 -0
- package/dist/lib/prompt-builder.d.ts.map +1 -0
- package/dist/lib/prompt-builder.js +133 -0
- package/dist/lib/prompt-builder.js.map +1 -0
- package/dist/lib/schema.d.ts +1231 -0
- package/dist/lib/schema.d.ts.map +1 -0
- package/dist/lib/schema.js +258 -0
- package/dist/lib/schema.js.map +1 -0
- package/dist/server.d.ts +36 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +287 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/__tests__/export-diagram.test.d.ts +2 -0
- package/dist/tools/__tests__/export-diagram.test.d.ts.map +1 -0
- package/dist/tools/__tests__/export-diagram.test.js +40 -0
- package/dist/tools/__tests__/export-diagram.test.js.map +1 -0
- package/dist/tools/__tests__/update-diagram.test.d.ts +2 -0
- package/dist/tools/__tests__/update-diagram.test.d.ts.map +1 -0
- package/dist/tools/__tests__/update-diagram.test.js +90 -0
- package/dist/tools/__tests__/update-diagram.test.js.map +1 -0
- package/dist/tools/apply-template.d.ts +28 -0
- package/dist/tools/apply-template.d.ts.map +1 -0
- package/dist/tools/apply-template.js +388 -0
- package/dist/tools/apply-template.js.map +1 -0
- package/dist/tools/export-diagram.d.ts +36 -0
- package/dist/tools/export-diagram.d.ts.map +1 -0
- package/dist/tools/export-diagram.js +65 -0
- package/dist/tools/export-diagram.js.map +1 -0
- package/dist/tools/fix-layout.d.ts +19 -0
- package/dist/tools/fix-layout.d.ts.map +1 -0
- package/dist/tools/fix-layout.js +100 -0
- package/dist/tools/fix-layout.js.map +1 -0
- package/dist/tools/generate-diagram.d.ts +31 -0
- package/dist/tools/generate-diagram.d.ts.map +1 -0
- package/dist/tools/generate-diagram.js +385 -0
- package/dist/tools/generate-diagram.js.map +1 -0
- package/dist/tools/list-nodes.d.ts +18 -0
- package/dist/tools/list-nodes.d.ts.map +1 -0
- package/dist/tools/list-nodes.js +48 -0
- package/dist/tools/list-nodes.js.map +1 -0
- package/dist/tools/load-checkpoint.d.ts +18 -0
- package/dist/tools/load-checkpoint.d.ts.map +1 -0
- package/dist/tools/load-checkpoint.js +24 -0
- package/dist/tools/load-checkpoint.js.map +1 -0
- package/dist/tools/read-me.d.ts +2 -0
- package/dist/tools/read-me.d.ts.map +1 -0
- package/dist/tools/read-me.js +326 -0
- package/dist/tools/read-me.js.map +1 -0
- package/dist/tools/save-checkpoint.d.ts +11 -0
- package/dist/tools/save-checkpoint.d.ts.map +1 -0
- package/dist/tools/save-checkpoint.js +17 -0
- package/dist/tools/save-checkpoint.js.map +1 -0
- package/dist/tools/update-diagram.d.ts +20 -0
- package/dist/tools/update-diagram.d.ts.map +1 -0
- package/dist/tools/update-diagram.js +189 -0
- package/dist/tools/update-diagram.js.map +1 -0
- package/dist/tools/validate-diagram.d.ts +14 -0
- package/dist/tools/validate-diagram.d.ts.map +1 -0
- package/dist/tools/validate-diagram.js +181 -0
- package/dist/tools/validate-diagram.js.map +1 -0
- package/dist/types/index.d.ts +218 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { TIER_COLORS } from './constants.js';
|
|
4
|
+
let cachedComponents = null;
|
|
5
|
+
export function getComponents() {
|
|
6
|
+
if (cachedComponents) {
|
|
7
|
+
return cachedComponents;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const componentsPath = join(__dirname, '..', '..', '..', 'frontend', 'data', 'components.json');
|
|
11
|
+
const content = readFileSync(componentsPath, 'utf-8');
|
|
12
|
+
cachedComponents = JSON.parse(content);
|
|
13
|
+
return cachedComponents;
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
console.error('[NodeCatalog] Failed to load components.json:', error);
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function getComponentsByCategory() {
|
|
21
|
+
const components = getComponents();
|
|
22
|
+
const categoryMap = new Map();
|
|
23
|
+
for (const component of components) {
|
|
24
|
+
const category = component.category;
|
|
25
|
+
if (!categoryMap.has(category)) {
|
|
26
|
+
categoryMap.set(category, []);
|
|
27
|
+
}
|
|
28
|
+
categoryMap.get(category).push(component);
|
|
29
|
+
}
|
|
30
|
+
const categories = Array.from(categoryMap.entries())
|
|
31
|
+
.map(([name, comps]) => ({
|
|
32
|
+
name,
|
|
33
|
+
count: comps.length,
|
|
34
|
+
nodes: comps.map(n => ({
|
|
35
|
+
id: n.id,
|
|
36
|
+
label: n.label,
|
|
37
|
+
icon: n.icon,
|
|
38
|
+
description: n.description,
|
|
39
|
+
})),
|
|
40
|
+
}))
|
|
41
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
42
|
+
return {
|
|
43
|
+
categories,
|
|
44
|
+
totalCount: components.length,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function searchComponents(query, limit = 50) {
|
|
48
|
+
const components = getComponents();
|
|
49
|
+
const lowerQuery = query.toLowerCase();
|
|
50
|
+
const results = components.filter(c => c.label.toLowerCase().includes(lowerQuery) ||
|
|
51
|
+
c.description.toLowerCase().includes(lowerQuery) ||
|
|
52
|
+
c.category.toLowerCase().includes(lowerQuery) ||
|
|
53
|
+
c.id.toLowerCase().includes(lowerQuery));
|
|
54
|
+
return results.slice(0, limit);
|
|
55
|
+
}
|
|
56
|
+
export function getComponentsByTier(tier) {
|
|
57
|
+
const components = getComponents();
|
|
58
|
+
const tierCategories = {
|
|
59
|
+
client: ['Client & Entry'],
|
|
60
|
+
edge: ['Client & Entry'],
|
|
61
|
+
compute: ['Compute', 'AI Agents', 'LLM Models', 'RAG', 'Vector Databases', 'ML Infrastructure', 'ML Serving', 'MLOps', 'LLM Ops', 'AI Frameworks', 'AI Data Pipeline', 'Speech & Audio', 'Vision AI', 'Real-time'],
|
|
62
|
+
async: ['Messaging & Events'],
|
|
63
|
+
data: ['Data Storage', 'Caching'],
|
|
64
|
+
observe: ['Observability'],
|
|
65
|
+
external: ['External Services'],
|
|
66
|
+
};
|
|
67
|
+
const validCategories = tierCategories[tier] || [];
|
|
68
|
+
return components.filter(c => validCategories.includes(c.category));
|
|
69
|
+
}
|
|
70
|
+
export function getTierFromCategory(category) {
|
|
71
|
+
const categoryToTier = {
|
|
72
|
+
'Client & Entry': 'client',
|
|
73
|
+
'Compute': 'compute',
|
|
74
|
+
'Data Storage': 'data',
|
|
75
|
+
'Caching': 'data',
|
|
76
|
+
'Messaging & Events': 'async',
|
|
77
|
+
'Auth & Security': 'compute',
|
|
78
|
+
'Observability': 'observe',
|
|
79
|
+
'AI / ML': 'compute',
|
|
80
|
+
'External Services': 'external',
|
|
81
|
+
'DevOps / Infra': 'compute',
|
|
82
|
+
'AI Agents': 'compute',
|
|
83
|
+
'LLM Models': 'compute',
|
|
84
|
+
'RAG': 'compute',
|
|
85
|
+
'Vector Databases': 'data',
|
|
86
|
+
'ML Infrastructure': 'compute',
|
|
87
|
+
'ML Serving': 'compute',
|
|
88
|
+
'MLOps': 'compute',
|
|
89
|
+
'LLM Ops': 'compute',
|
|
90
|
+
'AI Frameworks': 'compute',
|
|
91
|
+
'AI Data Pipeline': 'compute',
|
|
92
|
+
'Speech & Audio': 'compute',
|
|
93
|
+
'Vision AI': 'compute',
|
|
94
|
+
'Real-time': 'compute',
|
|
95
|
+
};
|
|
96
|
+
return categoryToTier[category] || null;
|
|
97
|
+
}
|
|
98
|
+
export function getTierColor(tier) {
|
|
99
|
+
return TIER_COLORS[tier] || '#3b82f6';
|
|
100
|
+
}
|
|
101
|
+
export function getLayerFromTier(tier) {
|
|
102
|
+
return tier;
|
|
103
|
+
}
|
|
104
|
+
export function normalizeLayer(layer) {
|
|
105
|
+
const layerMap = {
|
|
106
|
+
'presentation': 'client',
|
|
107
|
+
'gateway': 'edge',
|
|
108
|
+
'application': 'compute',
|
|
109
|
+
'orchestration': 'compute',
|
|
110
|
+
'data': 'data',
|
|
111
|
+
'observability': 'observe',
|
|
112
|
+
'external': 'external',
|
|
113
|
+
'client': 'client',
|
|
114
|
+
'edge': 'edge',
|
|
115
|
+
'compute': 'compute',
|
|
116
|
+
'async': 'async',
|
|
117
|
+
'observe': 'observe',
|
|
118
|
+
'group': 'group',
|
|
119
|
+
};
|
|
120
|
+
return layerMap[layer.toLowerCase()] || 'compute';
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=node-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-catalog.js","sourceRoot":"","sources":["../../src/lib/node-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,IAAI,gBAAgB,GAAiC,IAAI,CAAC;AAE1D,MAAM,UAAU,aAAa;IAC3B,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC;QAChG,MAAM,OAAO,GAAG,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACtD,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAA0B,CAAC;QAChE,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,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AE,SAAS;QAC1B,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,OAAO;KACjB,CAAC;IACF,OAAO,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,SAAS,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* parse-prompt.ts
|
|
3
|
+
* Pre-analyzes a user's natural language architecture request and extracts:
|
|
4
|
+
* - Domain (e.g., "video streaming", "e-commerce")
|
|
5
|
+
* - Detected tech stack
|
|
6
|
+
* - Explicit features requested
|
|
7
|
+
* - Recommended diagram direction
|
|
8
|
+
* - Domain-required nodes that must not be omitted
|
|
9
|
+
*
|
|
10
|
+
* Call this tool BEFORE generate_diagram when the user provides a descriptive prompt,
|
|
11
|
+
* then use the output to build accurate, prompt-faithful nodes and edges.
|
|
12
|
+
*/
|
|
13
|
+
interface ParsedPrompt {
|
|
14
|
+
domain: string;
|
|
15
|
+
confidence: number;
|
|
16
|
+
detectedTechStack: string[];
|
|
17
|
+
customFeatures: string[];
|
|
18
|
+
recommendedDirection: 'RIGHT' | 'DOWN';
|
|
19
|
+
diagramLabel: string;
|
|
20
|
+
domainRequiredNodes: string[];
|
|
21
|
+
architectureHints: string[];
|
|
22
|
+
warnings: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function parseUserPrompt(userPrompt: string): ParsedPrompt;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=parse-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-prompt.d.ts","sourceRoot":"","sources":["../../src/lib/parse-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,oBAAoB,EAAE,OAAO,GAAG,MAAM,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAgOD,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,CAsEhE"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* parse-prompt.ts
|
|
3
|
+
* Pre-analyzes a user's natural language architecture request and extracts:
|
|
4
|
+
* - Domain (e.g., "video streaming", "e-commerce")
|
|
5
|
+
* - Detected tech stack
|
|
6
|
+
* - Explicit features requested
|
|
7
|
+
* - Recommended diagram direction
|
|
8
|
+
* - Domain-required nodes that must not be omitted
|
|
9
|
+
*
|
|
10
|
+
* Call this tool BEFORE generate_diagram when the user provides a descriptive prompt,
|
|
11
|
+
* then use the output to build accurate, prompt-faithful nodes and edges.
|
|
12
|
+
*/
|
|
13
|
+
const TECH_PATTERNS = [
|
|
14
|
+
// Cloud providers
|
|
15
|
+
{ pattern: /\baws\b/i, tech: 'AWS' },
|
|
16
|
+
{ pattern: /\bgcp\b|google cloud/i, tech: 'GCP' },
|
|
17
|
+
{ pattern: /\bazure\b/i, tech: 'Azure' },
|
|
18
|
+
// AWS services
|
|
19
|
+
{ pattern: /\blambda\b/i, tech: 'AWS Lambda' },
|
|
20
|
+
{ pattern: /\bec2\b/i, tech: 'EC2' },
|
|
21
|
+
{ pattern: /\becs\b/i, tech: 'ECS' },
|
|
22
|
+
{ pattern: /\beks\b/i, tech: 'EKS' },
|
|
23
|
+
{ pattern: /\bs3\b/i, tech: 'S3' },
|
|
24
|
+
{ pattern: /\bdynamodb\b/i, tech: 'DynamoDB' },
|
|
25
|
+
{ pattern: /\brds\b/i, tech: 'RDS' },
|
|
26
|
+
{ pattern: /\baurora\b/i, tech: 'Aurora' },
|
|
27
|
+
{ pattern: /\bcloudfront\b/i, tech: 'CloudFront' },
|
|
28
|
+
{ pattern: /\bapi gateway\b/i, tech: 'API Gateway' },
|
|
29
|
+
{ pattern: /\bsqs\b/i, tech: 'SQS' },
|
|
30
|
+
{ pattern: /\bsns\b/i, tech: 'SNS' },
|
|
31
|
+
{ pattern: /\bkinesis\b/i, tech: 'Kinesis' },
|
|
32
|
+
{ pattern: /\bcognito\b/i, tech: 'Cognito' },
|
|
33
|
+
// Databases
|
|
34
|
+
{ pattern: /\bpostgres(ql)?\b/i, tech: 'PostgreSQL' },
|
|
35
|
+
{ pattern: /\bmysql\b/i, tech: 'MySQL' },
|
|
36
|
+
{ pattern: /\bmongodb\b/i, tech: 'MongoDB' },
|
|
37
|
+
{ pattern: /\bcassandra\b/i, tech: 'Cassandra' },
|
|
38
|
+
{ pattern: /\bfirebase\b/i, tech: 'Firebase' },
|
|
39
|
+
{ pattern: /\bsupabase\b/i, tech: 'Supabase' },
|
|
40
|
+
// Caching & Queuing
|
|
41
|
+
{ pattern: /\bredis\b/i, tech: 'Redis' },
|
|
42
|
+
{ pattern: /\bkafka\b/i, tech: 'Kafka' },
|
|
43
|
+
{ pattern: /\brabbitmq\b/i, tech: 'RabbitMQ' },
|
|
44
|
+
{ pattern: /\belasticsearch\b/i, tech: 'Elasticsearch' },
|
|
45
|
+
// Frameworks & Languages
|
|
46
|
+
{ pattern: /\bnext\.js\b/i, tech: 'Next.js' },
|
|
47
|
+
{ pattern: /\breact\b/i, tech: 'React' },
|
|
48
|
+
{ pattern: /\bvue\b/i, tech: 'Vue' },
|
|
49
|
+
{ pattern: /\bangular\b/i, tech: 'Angular' },
|
|
50
|
+
{ pattern: /\bsvelte\b/i, tech: 'Svelte' },
|
|
51
|
+
{ pattern: /\bnode\.js\b/i, tech: 'Node.js' },
|
|
52
|
+
{ pattern: /\bexpress\b/i, tech: 'Express' },
|
|
53
|
+
{ pattern: /\bfastapi\b/i, tech: 'FastAPI' },
|
|
54
|
+
{ pattern: /\bdjango\b/i, tech: 'Django' },
|
|
55
|
+
{ pattern: /\bspring boot\b/i, tech: 'Spring Boot' },
|
|
56
|
+
{ pattern: /\bgo(lang)?\b/i, tech: 'Go' },
|
|
57
|
+
{ pattern: /\brust\b/i, tech: 'Rust' },
|
|
58
|
+
{ pattern: /\bpython\b/i, tech: 'Python' },
|
|
59
|
+
{ pattern: /\bjava\b/i, tech: 'Java' },
|
|
60
|
+
{ pattern: /\btypescript\b/i, tech: 'TypeScript' },
|
|
61
|
+
// Protocols
|
|
62
|
+
{ pattern: /\bgraphql\b/i, tech: 'GraphQL' },
|
|
63
|
+
{ pattern: /\bgrpc\b/i, tech: 'gRPC' },
|
|
64
|
+
{ pattern: /\bwebsocket\b/i, tech: 'WebSocket' },
|
|
65
|
+
// Infra
|
|
66
|
+
{ pattern: /\bdocker\b/i, tech: 'Docker' },
|
|
67
|
+
{ pattern: /\bkubernetes\b|k8s/i, tech: 'Kubernetes' },
|
|
68
|
+
{ pattern: /\bnginx\b/i, tech: 'Nginx' },
|
|
69
|
+
{ pattern: /\bterraform\b/i, tech: 'Terraform' },
|
|
70
|
+
{ pattern: /\bcloudflare\b/i, tech: 'Cloudflare' },
|
|
71
|
+
{ pattern: /\bvercel\b/i, tech: 'Vercel' },
|
|
72
|
+
{ pattern: /\brailway\b/i, tech: 'Railway' },
|
|
73
|
+
// Observability
|
|
74
|
+
{ pattern: /\bprometheus\b/i, tech: 'Prometheus' },
|
|
75
|
+
{ pattern: /\bgrafana\b/i, tech: 'Grafana' },
|
|
76
|
+
{ pattern: /\bdatadog\b/i, tech: 'Datadog' },
|
|
77
|
+
{ pattern: /\bsentry\b/i, tech: 'Sentry' },
|
|
78
|
+
{ pattern: /\bjaeger\b/i, tech: 'Jaeger' },
|
|
79
|
+
// External services
|
|
80
|
+
{ pattern: /\bstripe\b/i, tech: 'Stripe' },
|
|
81
|
+
{ pattern: /\btwilio\b/i, tech: 'Twilio' },
|
|
82
|
+
{ pattern: /\bsendgrid\b/i, tech: 'SendGrid' },
|
|
83
|
+
{ pattern: /\bauth0\b/i, tech: 'Auth0' },
|
|
84
|
+
// Video/Media
|
|
85
|
+
{ pattern: /\bhls\b/i, tech: 'HLS' },
|
|
86
|
+
{ pattern: /\bdash\b/i, tech: 'DASH' },
|
|
87
|
+
{ pattern: /\bffmpeg\b/i, tech: 'FFmpeg' },
|
|
88
|
+
{ pattern: /\bdrm\b/i, tech: 'DRM' },
|
|
89
|
+
{ pattern: /\bwidevine\b/i, tech: 'Widevine' },
|
|
90
|
+
{ pattern: /\bfairplay\b/i, tech: 'FairPlay' },
|
|
91
|
+
];
|
|
92
|
+
const DOMAIN_PATTERNS = [
|
|
93
|
+
{
|
|
94
|
+
pattern: /video stream|vod|video platform|streaming platform|netflix|youtube/i,
|
|
95
|
+
domain: 'Video Streaming',
|
|
96
|
+
requiredNodes: [
|
|
97
|
+
'Object Storage (raw video)',
|
|
98
|
+
'Transcoding Worker (FFmpeg/AWS MediaConvert)',
|
|
99
|
+
'Object Storage (processed HLS/DASH)',
|
|
100
|
+
'CDN (CloudFront/Akamai)',
|
|
101
|
+
'DRM License Service (via API Gateway)',
|
|
102
|
+
'Analytics Event Stream (Kafka/Kinesis)',
|
|
103
|
+
'Recommendation Engine',
|
|
104
|
+
],
|
|
105
|
+
hints: [
|
|
106
|
+
'Use async edges for upload → transcoding → storage pipeline',
|
|
107
|
+
'DRM must route through API Gateway, never directly from client',
|
|
108
|
+
'Analytics stream feeds recommendation engine — show the feedback loop',
|
|
109
|
+
'CDN must have Object Storage as its origin (not directly from services)',
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
pattern: /social media|instagram|twitter|tiktok|facebook|feed|timeline|posts/i,
|
|
114
|
+
domain: 'Social Media',
|
|
115
|
+
requiredNodes: [
|
|
116
|
+
'Object Storage (media blobs)',
|
|
117
|
+
'CDN (media delivery)',
|
|
118
|
+
'Engagement Event Stream (Kafka)',
|
|
119
|
+
'Feed Ranking Service',
|
|
120
|
+
'Notification Service',
|
|
121
|
+
'Search Service',
|
|
122
|
+
],
|
|
123
|
+
hints: [
|
|
124
|
+
'Like/share/comment events must flow through an event stream',
|
|
125
|
+
'Feed ranking is separate from the main API — it reads from the event stream',
|
|
126
|
+
'Push notifications require a dedicated notification service',
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
pattern: /e-?comm|shop|store|marketplace|checkout|cart|order/i,
|
|
131
|
+
domain: 'E-Commerce',
|
|
132
|
+
requiredNodes: [
|
|
133
|
+
'Payment Gateway (Stripe)',
|
|
134
|
+
'Order Queue (Kafka/SQS)',
|
|
135
|
+
'Inventory Service',
|
|
136
|
+
'Notification Service (email/SMS)',
|
|
137
|
+
'Cart Service',
|
|
138
|
+
],
|
|
139
|
+
hints: [
|
|
140
|
+
'Order creation must be async (queue) to ensure reliability',
|
|
141
|
+
'Payment goes to external Stripe API',
|
|
142
|
+
'Inventory check happens before payment confirmation',
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
pattern: /ride.?shar|uber|lyft|delivery|driver|passenger/i,
|
|
147
|
+
domain: 'Ride-sharing',
|
|
148
|
+
requiredNodes: [
|
|
149
|
+
'Real-time Location Service (WebSocket)',
|
|
150
|
+
'Driver Matching Engine',
|
|
151
|
+
'Payment Gateway',
|
|
152
|
+
'Push Notification Service',
|
|
153
|
+
'Route Optimization Service',
|
|
154
|
+
],
|
|
155
|
+
hints: [
|
|
156
|
+
'Location updates must use WebSocket (stream) edges',
|
|
157
|
+
'Matching algorithm is a separate compute service',
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
pattern: /chat|messag|slack|discord|whatsapp|real.?time/i,
|
|
162
|
+
domain: 'Chat / Messaging',
|
|
163
|
+
requiredNodes: [
|
|
164
|
+
'WebSocket Gateway',
|
|
165
|
+
'Message Queue (Kafka/Redis)',
|
|
166
|
+
'Notification Service',
|
|
167
|
+
'Media Storage (S3)',
|
|
168
|
+
'Presence Service',
|
|
169
|
+
],
|
|
170
|
+
hints: [
|
|
171
|
+
'Use stream edges for WebSocket connections',
|
|
172
|
+
'Messages should persist asynchronously via queue',
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
pattern: /audio stream|music|spotify|podcast|soundcloud/i,
|
|
177
|
+
domain: 'Audio Streaming',
|
|
178
|
+
requiredNodes: [
|
|
179
|
+
'Object Storage (audio files)',
|
|
180
|
+
'CDN',
|
|
181
|
+
'Transcoding Worker',
|
|
182
|
+
'Recommendation Engine',
|
|
183
|
+
'Analytics Event Stream',
|
|
184
|
+
],
|
|
185
|
+
hints: [
|
|
186
|
+
'Similar to video streaming — CDN origin must be object storage',
|
|
187
|
+
'Play events feed the recommendation engine',
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
pattern: /saas|b2b|dashboard|workspace|tenant/i,
|
|
192
|
+
domain: 'SaaS / B2B',
|
|
193
|
+
requiredNodes: [
|
|
194
|
+
'Auth Service (login/token only)',
|
|
195
|
+
'Billing / Subscription Service',
|
|
196
|
+
'Audit Log',
|
|
197
|
+
'Webhook Delivery Service',
|
|
198
|
+
],
|
|
199
|
+
hints: [
|
|
200
|
+
'Multi-tenancy must be enforced at the API layer',
|
|
201
|
+
'Billing events trigger webhooks to customers',
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
];
|
|
205
|
+
const FEATURE_PATTERNS = [
|
|
206
|
+
{ pattern: /rate.?limit/i, feature: 'Rate Limiting' },
|
|
207
|
+
{ pattern: /push notif/i, feature: 'Push Notifications' },
|
|
208
|
+
{ pattern: /real.?time/i, feature: 'Real-time Updates' },
|
|
209
|
+
{ pattern: /search/i, feature: 'Search' },
|
|
210
|
+
{ pattern: /recommend/i, feature: 'Recommendations' },
|
|
211
|
+
{ pattern: /a\/b test/i, feature: 'A/B Testing' },
|
|
212
|
+
{ pattern: /drm/i, feature: 'DRM' },
|
|
213
|
+
{ pattern: /auth|login|sign.?in/i, feature: 'Authentication' },
|
|
214
|
+
{ pattern: /payment|checkout|billing/i, feature: 'Payments' },
|
|
215
|
+
{ pattern: /upload/i, feature: 'File Upload' },
|
|
216
|
+
{ pattern: /export|download/i, feature: 'Export / Download' },
|
|
217
|
+
{ pattern: /analytics|metric|telemetry/i, feature: 'Analytics' },
|
|
218
|
+
{ pattern: /webhook/i, feature: 'Webhooks' },
|
|
219
|
+
{ pattern: /multi.?tenant/i, feature: 'Multi-tenancy' },
|
|
220
|
+
{ pattern: /cach/i, feature: 'Caching' },
|
|
221
|
+
{ pattern: /monitor|observ|log/i, feature: 'Observability' },
|
|
222
|
+
{ pattern: /cdn/i, feature: 'CDN' },
|
|
223
|
+
{ pattern: /transcod/i, feature: 'Video Transcoding' },
|
|
224
|
+
{ pattern: /livestream/i, feature: 'Live Streaming' },
|
|
225
|
+
{ pattern: /social.?log|oauth/i, feature: 'Social Login / OAuth' },
|
|
226
|
+
];
|
|
227
|
+
export function parseUserPrompt(userPrompt) {
|
|
228
|
+
const warnings = [];
|
|
229
|
+
// Detect domain
|
|
230
|
+
let domain = 'General';
|
|
231
|
+
let confidence = 0;
|
|
232
|
+
let domainRequiredNodes = [];
|
|
233
|
+
let architectureHints = [];
|
|
234
|
+
for (const dp of DOMAIN_PATTERNS) {
|
|
235
|
+
if (dp.pattern.test(userPrompt)) {
|
|
236
|
+
domain = dp.domain;
|
|
237
|
+
confidence = 0.85;
|
|
238
|
+
domainRequiredNodes = dp.requiredNodes;
|
|
239
|
+
architectureHints = dp.hints;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// Extract tech stack
|
|
244
|
+
const detectedTechStack = [];
|
|
245
|
+
for (const tp of TECH_PATTERNS) {
|
|
246
|
+
if (tp.pattern.test(userPrompt)) {
|
|
247
|
+
if (!detectedTechStack.includes(tp.tech)) {
|
|
248
|
+
detectedTechStack.push(tp.tech);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
// Extract custom features
|
|
253
|
+
const customFeatures = [];
|
|
254
|
+
for (const fp of FEATURE_PATTERNS) {
|
|
255
|
+
if (fp.pattern.test(userPrompt)) {
|
|
256
|
+
if (!customFeatures.includes(fp.feature)) {
|
|
257
|
+
customFeatures.push(fp.feature);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// Generate diagram label
|
|
262
|
+
const diagramLabel = domain !== 'General'
|
|
263
|
+
? `${domain} Architecture`
|
|
264
|
+
: 'System Architecture';
|
|
265
|
+
// Direction recommendation
|
|
266
|
+
const recommendedDirection = /pipeline|ci.?cd|workflow|step|stage/i.test(userPrompt) ? 'DOWN' : 'RIGHT';
|
|
267
|
+
// Warnings for common mistakes
|
|
268
|
+
if (/auth.*service|service.*auth/i.test(userPrompt)) {
|
|
269
|
+
warnings.push('REMINDER: Auth Service must only receive login/register/token-refresh routes from the gateway. Never use Auth as a per-request hop for business operations.');
|
|
270
|
+
}
|
|
271
|
+
if (/cdn/i.test(userPrompt) && !/s3|storage|bucket|blob/i.test(userPrompt)) {
|
|
272
|
+
warnings.push('WARNING: CDN detected but no object storage mentioned. CDN must pull from an origin (S3/GCS/Azure Blob). Add an Object Storage node as the CDN origin.');
|
|
273
|
+
}
|
|
274
|
+
if (/drm/i.test(userPrompt)) {
|
|
275
|
+
warnings.push('SECURITY: DRM License Service must route through the API Gateway — never connect directly from client tier. Gateway verifies subscription before issuing DRM licenses.');
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
domain,
|
|
279
|
+
confidence,
|
|
280
|
+
detectedTechStack,
|
|
281
|
+
customFeatures,
|
|
282
|
+
recommendedDirection,
|
|
283
|
+
diagramLabel,
|
|
284
|
+
domainRequiredNodes,
|
|
285
|
+
architectureHints,
|
|
286
|
+
warnings,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=parse-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-prompt.js","sourceRoot":"","sources":["../../src/lib/parse-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH,MAAM,aAAa,GAA6C;IAC9D,kBAAkB;IAClB,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,EAAE,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE,KAAK,EAAE;IACjD,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;IACxC,eAAe;IACf,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE;IAC9C,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE;IAClC,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE;IAC9C,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1C,EAAE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,YAAY,EAAE;IAClD,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,EAAE;IACpD,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;IACpC,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS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yBAAyB;IACzB,MAAM,YAAY,GAAG,MAAM,KAAK,SAAS;QACvC,CAAC,CAAC,GAAG,MAAM,eAAe;QAC1B,CAAC,CAAC,qBAAqB,CAAC;IAE1B,2BAA2B;IAC3B,MAAM,oBAAoB,GACxB,sCAAsC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAE7E,+BAA+B;IAC/B,IAAI,8BAA8B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACpD,QAAQ,CAAC,IAAI,CAAC,6JAA6J,CAAC,CAAC;IAC/K,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3E,QAAQ,CAAC,IAAI,CAAC,wJAAwJ,CAAC,CAAC;IAC1K,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,QAAQ,CAAC,IAAI,CAAC,wKAAwK,CAAC,CAAC;IAC1L,CAAC;IAED,OAAO;QACL,MAAM;QACN,UAAU;QACV,iBAAiB;QACjB,cAAc;QACd,oBAAoB;QACpB,YAAY;QACZ,mBAAmB;QACnB,iBAAiB;QACjB,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TierType } from '../types/index.js';
|
|
2
|
+
export declare function inferTierFromLabel(label: string): TierType;
|
|
3
|
+
export declare function generateNodeId(label: string, index: number): string;
|
|
4
|
+
export declare const TIER_COLORS: Record<TierType, string>;
|
|
5
|
+
export declare const COMMUNICATION_COLORS: Record<string, {
|
|
6
|
+
color: string;
|
|
7
|
+
dash: string;
|
|
8
|
+
animated: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const TIER_ORDER: TierType[];
|
|
11
|
+
export declare const TIER_X_POSITIONS: Record<string, Record<TierType, number>>;
|
|
12
|
+
export declare const LAYER_DESCRIPTIONS: Record<TierType, string>;
|
|
13
|
+
export declare const TIER_TO_CATEGORY: Record<TierType, string[]>;
|
|
14
|
+
//# sourceMappingURL=prompt-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/lib/prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAkD1D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMnE;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAQhD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAMnG,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,QAAQ,EAQhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAqCrE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAQvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,CAQvD,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export function inferTierFromLabel(label) {
|
|
2
|
+
const lowerLabel = label.toLowerCase();
|
|
3
|
+
if (lowerLabel.includes('client') || lowerLabel.includes('browser') ||
|
|
4
|
+
lowerLabel.includes('mobile') || lowerLabel.includes('web app') ||
|
|
5
|
+
lowerLabel.includes('mobile app') || lowerLabel.includes('web client')) {
|
|
6
|
+
return 'client';
|
|
7
|
+
}
|
|
8
|
+
if (lowerLabel.includes('cdn') || lowerLabel.includes('load balancer') ||
|
|
9
|
+
lowerLabel.includes('gateway') || lowerLabel.includes('waf') ||
|
|
10
|
+
lowerLabel.includes('dns') || lowerLabel.includes('reverse proxy') ||
|
|
11
|
+
lowerLabel.includes('loadbalancer') || lowerLabel.includes('api gateway')) {
|
|
12
|
+
return 'edge';
|
|
13
|
+
}
|
|
14
|
+
if (lowerLabel.includes('queue') || lowerLabel.includes('event bus') ||
|
|
15
|
+
lowerLabel.includes('kafka') || lowerLabel.includes('rabbitmq') ||
|
|
16
|
+
lowerLabel.includes('sns') || lowerLabel.includes('sqs') ||
|
|
17
|
+
lowerLabel.includes('message') || lowerLabel.includes('redis') && lowerLabel.includes('queue') ||
|
|
18
|
+
lowerLabel.includes('pubsub') || lowerLabel.includes('pub/sub')) {
|
|
19
|
+
return 'async';
|
|
20
|
+
}
|
|
21
|
+
if (lowerLabel.includes('database') || lowerLabel.includes('db') ||
|
|
22
|
+
lowerLabel.includes('cache') || lowerLabel.includes('redis') ||
|
|
23
|
+
lowerLabel.includes('storage') || lowerLabel.includes('s3') ||
|
|
24
|
+
lowerLabel.includes('postgres') || lowerLabel.includes('postgresql') ||
|
|
25
|
+
lowerLabel.includes('mongodb') || lowerLabel.includes('mysql') ||
|
|
26
|
+
lowerLabel.includes('dynamodb') || lowerLabel.includes('sql') ||
|
|
27
|
+
lowerLabel.includes('object store')) {
|
|
28
|
+
return 'data';
|
|
29
|
+
}
|
|
30
|
+
if (lowerLabel.includes('monitor') || lowerLabel.includes('logging') ||
|
|
31
|
+
lowerLabel.includes('tracing') || lowerLabel.includes('cloudwatch') ||
|
|
32
|
+
lowerLabel.includes('grafana') || lowerLabel.includes('prometheus') ||
|
|
33
|
+
lowerLabel.includes('observab') || lowerLabel.includes('logs') ||
|
|
34
|
+
lowerLabel.includes('sentry') || lowerLabel.includes('datadog')) {
|
|
35
|
+
return 'observe';
|
|
36
|
+
}
|
|
37
|
+
if (lowerLabel.includes('stripe') || lowerLabel.includes('payment') ||
|
|
38
|
+
lowerLabel.includes('twilio') || lowerLabel.includes('sendgrid') ||
|
|
39
|
+
lowerLabel.includes('external') || lowerLabel.includes('third party') ||
|
|
40
|
+
lowerLabel.includes('3rd party') || lowerLabel.includes('third-party')) {
|
|
41
|
+
return 'external';
|
|
42
|
+
}
|
|
43
|
+
return 'compute';
|
|
44
|
+
}
|
|
45
|
+
export function generateNodeId(label, index) {
|
|
46
|
+
return label
|
|
47
|
+
.toLowerCase()
|
|
48
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
49
|
+
.replace(/^-+|-+$/g, '')
|
|
50
|
+
.substring(0, 30) + '-' + index;
|
|
51
|
+
}
|
|
52
|
+
export const TIER_COLORS = {
|
|
53
|
+
client: '#3b82f6',
|
|
54
|
+
edge: '#3b82f6',
|
|
55
|
+
compute: '#14b8a6',
|
|
56
|
+
async: '#f59e0b',
|
|
57
|
+
data: '#f97316',
|
|
58
|
+
observe: '#6b7280',
|
|
59
|
+
external: '#64748b',
|
|
60
|
+
};
|
|
61
|
+
export const COMMUNICATION_COLORS = {
|
|
62
|
+
sync: { color: '#94a3b8', dash: '', animated: false },
|
|
63
|
+
async: { color: '#f59e0b', dash: '8,4', animated: true },
|
|
64
|
+
stream: { color: '#10b981', dash: '4,2', animated: true },
|
|
65
|
+
event: { color: '#ec4899', dash: '2,3', animated: true },
|
|
66
|
+
dep: { color: '#94a3b8', dash: '6,6', animated: false },
|
|
67
|
+
};
|
|
68
|
+
export const TIER_ORDER = [
|
|
69
|
+
'client',
|
|
70
|
+
'edge',
|
|
71
|
+
'compute',
|
|
72
|
+
'async',
|
|
73
|
+
'data',
|
|
74
|
+
'observe',
|
|
75
|
+
'external',
|
|
76
|
+
];
|
|
77
|
+
export const TIER_X_POSITIONS = {
|
|
78
|
+
RIGHT: {
|
|
79
|
+
client: 50,
|
|
80
|
+
edge: 320,
|
|
81
|
+
compute: 650,
|
|
82
|
+
async: 1000,
|
|
83
|
+
data: 1350,
|
|
84
|
+
observe: 1700,
|
|
85
|
+
external: 2050,
|
|
86
|
+
},
|
|
87
|
+
DOWN: {
|
|
88
|
+
client: 50,
|
|
89
|
+
edge: 50,
|
|
90
|
+
compute: 50,
|
|
91
|
+
async: 50,
|
|
92
|
+
data: 50,
|
|
93
|
+
observe: 50,
|
|
94
|
+
external: 50,
|
|
95
|
+
},
|
|
96
|
+
LEFT: {
|
|
97
|
+
client: 2050,
|
|
98
|
+
edge: 1780,
|
|
99
|
+
compute: 1450,
|
|
100
|
+
async: 1100,
|
|
101
|
+
data: 750,
|
|
102
|
+
observe: 400,
|
|
103
|
+
external: 50,
|
|
104
|
+
},
|
|
105
|
+
UP: {
|
|
106
|
+
client: 1700,
|
|
107
|
+
edge: 1350,
|
|
108
|
+
compute: 1000,
|
|
109
|
+
async: 650,
|
|
110
|
+
data: 320,
|
|
111
|
+
observe: 50,
|
|
112
|
+
external: 0,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
export const LAYER_DESCRIPTIONS = {
|
|
116
|
+
client: 'Browser, Mobile App, Web Client',
|
|
117
|
+
edge: 'CDN, Load Balancer, API Gateway, WAF, DNS',
|
|
118
|
+
compute: 'API Server, Auth Service, Business Logic, Workers, Functions, Containers',
|
|
119
|
+
async: 'Message Queue, Event Bus, Task Queue (own column)',
|
|
120
|
+
data: 'Database, Cache, Object Storage, File System',
|
|
121
|
+
observe: 'Monitoring, Logging, Tracing',
|
|
122
|
+
external: 'Third-party APIs, Payment gateways',
|
|
123
|
+
};
|
|
124
|
+
export const TIER_TO_CATEGORY = {
|
|
125
|
+
client: ['Client & Entry'],
|
|
126
|
+
edge: ['Client & Entry'],
|
|
127
|
+
compute: ['Compute', 'AI Agents', 'LLM Models', 'RAG', 'Vector Databases', 'ML Infrastructure', 'ML Serving', 'MLOps', 'LLM Ops', 'AI Frameworks', 'AI Data Pipeline', 'Speech & Audio', 'Vision AI', 'Real-time', 'Auth & Security', 'DevOps / Infra'],
|
|
128
|
+
async: ['Messaging & Events'],
|
|
129
|
+
data: ['Data Storage', 'Caching'],
|
|
130
|
+
observe: ['Observability'],
|
|
131
|
+
external: ['External Services'],
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=prompt-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-builder.js","sourceRoot":"","sources":["../../src/lib/prompt-builder.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAEvC,IAAI,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/D,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/D,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3E,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC;QAClE,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC5D,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC;QAClE,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9E,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,QAAQ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