Repository navigation
Expand file tree
/
Copy pathcode.ts
More file actions
120 lines (119 loc) · 4.04 KB
/
Copy pathcode.ts
File metadata and controls
120 lines (119 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import { GoogleGenerativeAI, SchemaType, type Schema } from "@google/generative-ai";
export const SCOPE_RESPONSE_SCHEMA = {
type: SchemaType.OBJECT,
properties: {
proposal: {
type: SchemaType.OBJECT,
properties: {
title: { type: SchemaType.STRING, description: "Project title" },
summary: {
type: SchemaType.STRING,
description: "2-3 paragraph executive summary",
},
objectives: {
type: SchemaType.ARRAY,
items: { type: SchemaType.STRING },
description: "List of key project objectives",
},
},
required: ["title", "summary", "objectives"],
},
estimates: {
type: SchemaType.OBJECT,
properties: {
total_weeks: { type: SchemaType.NUMBER },
dev_days: { type: SchemaType.NUMBER },
team_size: { type: SchemaType.NUMBER },
cost_estimate: { type: SchemaType.STRING }
},
required: ["total_weeks", "dev_days", "team_size", "cost_estimate"]
},
sprint_timeline: {
type: SchemaType.ARRAY,
items: {
type: SchemaType.OBJECT,
properties: {
sprint: { type: SchemaType.NUMBER, description: "Sprint number" },
duration: {
type: SchemaType.STRING,
description: "Duration e.g. '2 weeks'",
},
tasks: {
type: SchemaType.ARRAY,
items: { type: SchemaType.STRING },
description: "List of tasks for this sprint",
},
},
required: ["sprint", "duration", "tasks"],
},
},
tech_stack: {
type: SchemaType.OBJECT,
properties: {
frontend: {
type: SchemaType.ARRAY,
items: { type: SchemaType.STRING },
},
backend: {
type: SchemaType.ARRAY,
items: { type: SchemaType.STRING },
},
database: { type: SchemaType.STRING },
infra: {
type: SchemaType.ARRAY,
items: { type: SchemaType.STRING },
},
},
required: ["frontend", "backend", "database", "infra"],
},
sql_schema: {
type: SchemaType.STRING,
description:
"Complete PostgreSQL CREATE TABLE statements for the project",
},
security: {
type: SchemaType.OBJECT,
properties: {
rls_notes: { type: SchemaType.STRING, description: "CRITICAL: You MUST output raw PostgreSQL CREATE POLICY statements here. Absolutely NO English summaries or explanations. ONLY valid SQL syntax." },
auth_flow: { type: SchemaType.STRING },
encryption_at_rest: { type: SchemaType.STRING },
rate_limiting: { type: SchemaType.STRING }
},
required: ["rls_notes", "auth_flow", "encryption_at_rest", "rate_limiting"]
},
api_endpoints: {
type: SchemaType.ARRAY,
items: {
type: SchemaType.OBJECT,
properties: {
path: { type: SchemaType.STRING },
method: { type: SchemaType.STRING },
auth_required: { type: SchemaType.BOOLEAN },
request_schema_summary: { type: SchemaType.STRING },
response_schema_summary: { type: SchemaType.STRING }
},
required: ["path", "method", "auth_required", "request_schema_summary", "response_schema_summary"]
}
},
data_model_summary: {
type: SchemaType.OBJECT,
properties: {
entities: {
type: SchemaType.ARRAY,
items: {
type: SchemaType.OBJECT,
properties: {
name: { type: SchemaType.STRING },
description: { type: SchemaType.STRING },
key_fields: { type: SchemaType.ARRAY, items: { type: SchemaType.STRING } }
},
required: ["name", "description", "key_fields"]
}
},
relationships: { type: SchemaType.ARRAY, items: { type: SchemaType.STRING } }
},
required: ["entities", "relationships"]
}
},
required: ["proposal", "sprint_timeline", "tech_stack", "sql_schema", "security", "api_endpoints", "data_model_summary", "estimates"],
} as Schema;