@insureco/cli 0.1.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.
Files changed (174) hide show
  1. package/README.md +168 -0
  2. package/dist/commands/backup.d.ts +11 -0
  3. package/dist/commands/backup.d.ts.map +1 -0
  4. package/dist/commands/backup.js +112 -0
  5. package/dist/commands/backup.js.map +1 -0
  6. package/dist/commands/config.d.ts +10 -0
  7. package/dist/commands/config.d.ts.map +1 -0
  8. package/dist/commands/config.js +41 -0
  9. package/dist/commands/config.js.map +1 -0
  10. package/dist/commands/deploy.d.ts +16 -0
  11. package/dist/commands/deploy.d.ts.map +1 -0
  12. package/dist/commands/deploy.js +219 -0
  13. package/dist/commands/deploy.js.map +1 -0
  14. package/dist/commands/destroy.d.ts +12 -0
  15. package/dist/commands/destroy.d.ts.map +1 -0
  16. package/dist/commands/destroy.js +62 -0
  17. package/dist/commands/destroy.js.map +1 -0
  18. package/dist/commands/env.d.ts +7 -0
  19. package/dist/commands/env.d.ts.map +1 -0
  20. package/dist/commands/env.js +42 -0
  21. package/dist/commands/env.js.map +1 -0
  22. package/dist/commands/init-ai.d.ts +7 -0
  23. package/dist/commands/init-ai.d.ts.map +1 -0
  24. package/dist/commands/init-ai.js +257 -0
  25. package/dist/commands/init-ai.js.map +1 -0
  26. package/dist/commands/init.d.ts +8 -0
  27. package/dist/commands/init.d.ts.map +1 -0
  28. package/dist/commands/init.js +228 -0
  29. package/dist/commands/init.js.map +1 -0
  30. package/dist/commands/link.d.ts +10 -0
  31. package/dist/commands/link.d.ts.map +1 -0
  32. package/dist/commands/link.js +193 -0
  33. package/dist/commands/link.js.map +1 -0
  34. package/dist/commands/login.d.ts +8 -0
  35. package/dist/commands/login.d.ts.map +1 -0
  36. package/dist/commands/login.js +164 -0
  37. package/dist/commands/login.js.map +1 -0
  38. package/dist/commands/logs.d.ts +16 -0
  39. package/dist/commands/logs.d.ts.map +1 -0
  40. package/dist/commands/logs.js +362 -0
  41. package/dist/commands/logs.js.map +1 -0
  42. package/dist/commands/preflight.d.ts +8 -0
  43. package/dist/commands/preflight.d.ts.map +1 -0
  44. package/dist/commands/preflight.js +188 -0
  45. package/dist/commands/preflight.js.map +1 -0
  46. package/dist/commands/program.d.ts +7 -0
  47. package/dist/commands/program.d.ts.map +1 -0
  48. package/dist/commands/program.js +59 -0
  49. package/dist/commands/program.js.map +1 -0
  50. package/dist/commands/push.d.ts +12 -0
  51. package/dist/commands/push.d.ts.map +1 -0
  52. package/dist/commands/push.js +171 -0
  53. package/dist/commands/push.js.map +1 -0
  54. package/dist/commands/register.d.ts +7 -0
  55. package/dist/commands/register.d.ts.map +1 -0
  56. package/dist/commands/register.js +124 -0
  57. package/dist/commands/register.js.map +1 -0
  58. package/dist/commands/rollback.d.ts +11 -0
  59. package/dist/commands/rollback.d.ts.map +1 -0
  60. package/dist/commands/rollback.js +172 -0
  61. package/dist/commands/rollback.js.map +1 -0
  62. package/dist/commands/sample.d.ts +11 -0
  63. package/dist/commands/sample.d.ts.map +1 -0
  64. package/dist/commands/sample.js +114 -0
  65. package/dist/commands/sample.js.map +1 -0
  66. package/dist/commands/services.d.ts +13 -0
  67. package/dist/commands/services.d.ts.map +1 -0
  68. package/dist/commands/services.js +95 -0
  69. package/dist/commands/services.js.map +1 -0
  70. package/dist/commands/status.d.ts +9 -0
  71. package/dist/commands/status.d.ts.map +1 -0
  72. package/dist/commands/status.js +170 -0
  73. package/dist/commands/status.js.map +1 -0
  74. package/dist/commands/troubleshoot.d.ts +19 -0
  75. package/dist/commands/troubleshoot.d.ts.map +1 -0
  76. package/dist/commands/troubleshoot.js +465 -0
  77. package/dist/commands/troubleshoot.js.map +1 -0
  78. package/dist/commands/versions.d.ts +16 -0
  79. package/dist/commands/versions.d.ts.map +1 -0
  80. package/dist/commands/versions.js +162 -0
  81. package/dist/commands/versions.js.map +1 -0
  82. package/dist/index.d.ts +3 -0
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/index.js +294 -0
  85. package/dist/index.js.map +1 -0
  86. package/dist/lib/ai/client.d.ts +36 -0
  87. package/dist/lib/ai/client.d.ts.map +1 -0
  88. package/dist/lib/ai/client.js +140 -0
  89. package/dist/lib/ai/client.js.map +1 -0
  90. package/dist/lib/ai/generator.d.ts +17 -0
  91. package/dist/lib/ai/generator.d.ts.map +1 -0
  92. package/dist/lib/ai/generator.js +338 -0
  93. package/dist/lib/ai/generator.js.map +1 -0
  94. package/dist/lib/ai/prompts.d.ts +47 -0
  95. package/dist/lib/ai/prompts.d.ts.map +1 -0
  96. package/dist/lib/ai/prompts.js +247 -0
  97. package/dist/lib/ai/prompts.js.map +1 -0
  98. package/dist/lib/ai/scanner.d.ts +50 -0
  99. package/dist/lib/ai/scanner.d.ts.map +1 -0
  100. package/dist/lib/ai/scanner.js +237 -0
  101. package/dist/lib/ai/scanner.js.map +1 -0
  102. package/dist/lib/api.d.ts +18 -0
  103. package/dist/lib/api.d.ts.map +1 -0
  104. package/dist/lib/api.js +67 -0
  105. package/dist/lib/api.js.map +1 -0
  106. package/dist/lib/builder.d.ts +34 -0
  107. package/dist/lib/builder.d.ts.map +1 -0
  108. package/dist/lib/builder.js +132 -0
  109. package/dist/lib/builder.js.map +1 -0
  110. package/dist/lib/config.d.ts +20 -0
  111. package/dist/lib/config.d.ts.map +1 -0
  112. package/dist/lib/config.js +124 -0
  113. package/dist/lib/config.js.map +1 -0
  114. package/dist/lib/output.d.ts +12 -0
  115. package/dist/lib/output.d.ts.map +1 -0
  116. package/dist/lib/output.js +39 -0
  117. package/dist/lib/output.js.map +1 -0
  118. package/dist/lib/scaffold.d.ts +29 -0
  119. package/dist/lib/scaffold.d.ts.map +1 -0
  120. package/dist/lib/scaffold.js +166 -0
  121. package/dist/lib/scaffold.js.map +1 -0
  122. package/dist/lib/troubleshoot/analyzer.d.ts +14 -0
  123. package/dist/lib/troubleshoot/analyzer.d.ts.map +1 -0
  124. package/dist/lib/troubleshoot/analyzer.js +541 -0
  125. package/dist/lib/troubleshoot/analyzer.js.map +1 -0
  126. package/dist/lib/troubleshoot/auto-fix.d.ts +29 -0
  127. package/dist/lib/troubleshoot/auto-fix.d.ts.map +1 -0
  128. package/dist/lib/troubleshoot/auto-fix.js +373 -0
  129. package/dist/lib/troubleshoot/auto-fix.js.map +1 -0
  130. package/dist/lib/troubleshoot/index.d.ts +5 -0
  131. package/dist/lib/troubleshoot/index.d.ts.map +1 -0
  132. package/dist/lib/troubleshoot/index.js +6 -0
  133. package/dist/lib/troubleshoot/index.js.map +1 -0
  134. package/dist/lib/troubleshoot/log-fetcher.d.ts +43 -0
  135. package/dist/lib/troubleshoot/log-fetcher.d.ts.map +1 -0
  136. package/dist/lib/troubleshoot/log-fetcher.js +431 -0
  137. package/dist/lib/troubleshoot/log-fetcher.js.map +1 -0
  138. package/dist/lib/troubleshoot/redactor.d.ts +35 -0
  139. package/dist/lib/troubleshoot/redactor.d.ts.map +1 -0
  140. package/dist/lib/troubleshoot/redactor.js +208 -0
  141. package/dist/lib/troubleshoot/redactor.js.map +1 -0
  142. package/dist/lib/validators/catalog-validator.d.ts +3 -0
  143. package/dist/lib/validators/catalog-validator.d.ts.map +1 -0
  144. package/dist/lib/validators/catalog-validator.js +205 -0
  145. package/dist/lib/validators/catalog-validator.js.map +1 -0
  146. package/dist/lib/validators/dockerfile-validator.d.ts +4 -0
  147. package/dist/lib/validators/dockerfile-validator.d.ts.map +1 -0
  148. package/dist/lib/validators/dockerfile-validator.js +262 -0
  149. package/dist/lib/validators/dockerfile-validator.js.map +1 -0
  150. package/dist/lib/validators/env-validator.d.ts +3 -0
  151. package/dist/lib/validators/env-validator.d.ts.map +1 -0
  152. package/dist/lib/validators/env-validator.js +268 -0
  153. package/dist/lib/validators/env-validator.js.map +1 -0
  154. package/dist/lib/validators/git-validator.d.ts +3 -0
  155. package/dist/lib/validators/git-validator.d.ts.map +1 -0
  156. package/dist/lib/validators/git-validator.js +236 -0
  157. package/dist/lib/validators/git-validator.js.map +1 -0
  158. package/dist/lib/validators/health-detector.d.ts +4 -0
  159. package/dist/lib/validators/health-detector.d.ts.map +1 -0
  160. package/dist/lib/validators/health-detector.js +159 -0
  161. package/dist/lib/validators/health-detector.js.map +1 -0
  162. package/dist/lib/validators/index.d.ts +7 -0
  163. package/dist/lib/validators/index.d.ts.map +1 -0
  164. package/dist/lib/validators/index.js +7 -0
  165. package/dist/lib/validators/index.js.map +1 -0
  166. package/dist/lib/validators/route-validator.d.ts +3 -0
  167. package/dist/lib/validators/route-validator.d.ts.map +1 -0
  168. package/dist/lib/validators/route-validator.js +238 -0
  169. package/dist/lib/validators/route-validator.js.map +1 -0
  170. package/dist/types/index.d.ts +455 -0
  171. package/dist/types/index.d.ts.map +1 -0
  172. package/dist/types/index.js +37 -0
  173. package/dist/types/index.js.map +1 -0
  174. package/package.json +58 -0
@@ -0,0 +1,338 @@
1
+ import { writeFile, mkdir, readFile } from 'node:fs/promises';
2
+ import { join, dirname } from 'node:path';
3
+ import { stringify } from 'yaml';
4
+ import chalk from 'chalk';
5
+ export function generateCatalogInfo(input, directory = process.cwd()) {
6
+ const routes = input.routes?.map((r) => ({
7
+ path: r.path,
8
+ methods: r.methods,
9
+ auth: r.auth,
10
+ }));
11
+ const catalogInfo = {
12
+ apiVersion: 'backstage.io/v1alpha1',
13
+ kind: 'Component',
14
+ metadata: {
15
+ name: input.name,
16
+ description: input.description,
17
+ tags: input.tags || ['tawa'],
18
+ annotations: {
19
+ ...(input.database && input.database !== 'none'
20
+ ? { 'insureco.io/database': input.database }
21
+ : {}),
22
+ },
23
+ },
24
+ spec: {
25
+ type: 'service',
26
+ lifecycle: input.lifecycle || 'experimental',
27
+ owner: input.owner,
28
+ routes,
29
+ oauth: input.oauth
30
+ ? {
31
+ clientId: input.oauth.clientId,
32
+ grantTypes: input.oauth.grantTypes,
33
+ scopes: input.oauth.scopes,
34
+ }
35
+ : undefined,
36
+ },
37
+ };
38
+ // Clean up undefined/empty values
39
+ if (Object.keys(catalogInfo.metadata.annotations || {}).length === 0) {
40
+ delete catalogInfo.metadata.annotations;
41
+ }
42
+ if (!catalogInfo.spec.routes || catalogInfo.spec.routes.length === 0) {
43
+ delete catalogInfo.spec.routes;
44
+ }
45
+ if (!catalogInfo.spec.oauth) {
46
+ delete catalogInfo.spec.oauth;
47
+ }
48
+ return {
49
+ path: join(directory, 'catalog-info.yaml'),
50
+ content: stringify(catalogInfo),
51
+ description: 'Service catalog entry for Koko registry',
52
+ };
53
+ }
54
+ export function generateHelmChart(input, directory = process.cwd()) {
55
+ const port = input.port || 3000;
56
+ const replicas = input.replicas || 1;
57
+ const healthPath = input.healthPath || '/health';
58
+ const cpu = input.resources?.cpu || '500m';
59
+ const memory = input.resources?.memory || '512Mi';
60
+ const chartYaml = {
61
+ apiVersion: 'v2',
62
+ name: input.name,
63
+ description: `Helm chart for ${input.name}`,
64
+ type: 'application',
65
+ version: '0.1.0',
66
+ appVersion: '0.1.0',
67
+ };
68
+ const valuesYaml = {
69
+ replicaCount: replicas,
70
+ image: {
71
+ repository: `registry.digitalocean.com/insureco/${input.name}`,
72
+ tag: 'latest',
73
+ pullPolicy: 'IfNotPresent',
74
+ },
75
+ service: {
76
+ type: 'ClusterIP',
77
+ port,
78
+ },
79
+ resources: {
80
+ limits: { cpu, memory },
81
+ requests: { cpu: '100m', memory: '128Mi' },
82
+ },
83
+ env: input.env || {},
84
+ healthCheck: {
85
+ path: healthPath,
86
+ },
87
+ };
88
+ const deploymentYaml = `apiVersion: apps/v1
89
+ kind: Deployment
90
+ metadata:
91
+ name: {{ .Release.Name }}
92
+ labels:
93
+ app: {{ .Release.Name }}
94
+ spec:
95
+ replicas: {{ .Values.replicaCount }}
96
+ selector:
97
+ matchLabels:
98
+ app: {{ .Release.Name }}
99
+ template:
100
+ metadata:
101
+ labels:
102
+ app: {{ .Release.Name }}
103
+ spec:
104
+ containers:
105
+ - name: {{ .Chart.Name }}
106
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
107
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
108
+ ports:
109
+ - containerPort: {{ .Values.service.port }}
110
+ envFrom:
111
+ - configMapRef:
112
+ name: {{ .Release.Name }}-config
113
+ optional: true
114
+ - secretRef:
115
+ name: {{ .Release.Name }}-secrets
116
+ optional: true
117
+ {{- range $key, $value := .Values.env }}
118
+ env:
119
+ - name: {{ $key }}
120
+ value: {{ $value | quote }}
121
+ {{- end }}
122
+ resources:
123
+ {{- toYaml .Values.resources | nindent 12 }}
124
+ livenessProbe:
125
+ httpGet:
126
+ path: {{ .Values.healthCheck.path }}
127
+ port: {{ .Values.service.port }}
128
+ initialDelaySeconds: 10
129
+ periodSeconds: 10
130
+ readinessProbe:
131
+ httpGet:
132
+ path: {{ .Values.healthCheck.path }}
133
+ port: {{ .Values.service.port }}
134
+ initialDelaySeconds: 5
135
+ periodSeconds: 5
136
+ `;
137
+ const serviceYaml = `apiVersion: v1
138
+ kind: Service
139
+ metadata:
140
+ name: {{ .Release.Name }}
141
+ spec:
142
+ type: {{ .Values.service.type }}
143
+ ports:
144
+ - port: {{ .Values.service.port }}
145
+ targetPort: {{ .Values.service.port }}
146
+ protocol: TCP
147
+ selector:
148
+ app: {{ .Release.Name }}
149
+ `;
150
+ const helmDir = join(directory, 'helm', input.name);
151
+ return [
152
+ {
153
+ path: join(helmDir, 'Chart.yaml'),
154
+ content: stringify(chartYaml),
155
+ description: 'Helm chart metadata',
156
+ },
157
+ {
158
+ path: join(helmDir, 'values.yaml'),
159
+ content: stringify(valuesYaml),
160
+ description: 'Default Helm values',
161
+ },
162
+ {
163
+ path: join(helmDir, 'templates', 'deployment.yaml'),
164
+ content: deploymentYaml,
165
+ description: 'Kubernetes Deployment template',
166
+ },
167
+ {
168
+ path: join(helmDir, 'templates', 'service.yaml'),
169
+ content: serviceYaml,
170
+ description: 'Kubernetes Service template',
171
+ },
172
+ ];
173
+ }
174
+ export function generateHealthEndpoint(input, directory = process.cwd()) {
175
+ const healthPath = input.path || '/health';
176
+ const framework = input.framework;
177
+ const healthEndpoints = {
178
+ express: {
179
+ file: 'src/routes/health.ts',
180
+ code: `import { Router, Request, Response } from 'express'
181
+
182
+ const router = Router()
183
+
184
+ router.get('${healthPath}', (_req: Request, res: Response) => {
185
+ const health = {
186
+ status: 'ok',
187
+ timestamp: new Date().toISOString(),
188
+ uptime: process.uptime(),
189
+ }
190
+
191
+ res.json(health)
192
+ })
193
+
194
+ export default router
195
+ `,
196
+ },
197
+ fastify: {
198
+ file: 'src/routes/health.ts',
199
+ code: `import { FastifyPluginAsync } from 'fastify'
200
+
201
+ const healthRoutes: FastifyPluginAsync = async (fastify) => {
202
+ fastify.get('${healthPath}', async () => {
203
+ return {
204
+ status: 'ok',
205
+ timestamp: new Date().toISOString(),
206
+ uptime: process.uptime(),
207
+ }
208
+ })
209
+ }
210
+
211
+ export default healthRoutes
212
+ `,
213
+ },
214
+ nextjs: {
215
+ file: 'app/api/health/route.ts',
216
+ code: `import { NextResponse } from 'next/server'
217
+
218
+ export async function GET() {
219
+ const health = {
220
+ status: 'ok',
221
+ timestamp: new Date().toISOString(),
222
+ uptime: process.uptime(),
223
+ }
224
+
225
+ return NextResponse.json(health)
226
+ }
227
+ `,
228
+ },
229
+ hono: {
230
+ file: 'src/routes/health.ts',
231
+ code: `import { Hono } from 'hono'
232
+
233
+ const app = new Hono()
234
+
235
+ app.get('${healthPath}', (c) => {
236
+ return c.json({
237
+ status: 'ok',
238
+ timestamp: new Date().toISOString(),
239
+ uptime: process.uptime(),
240
+ })
241
+ })
242
+
243
+ export default app
244
+ `,
245
+ },
246
+ koa: {
247
+ file: 'src/routes/health.ts',
248
+ code: `import Router from '@koa/router'
249
+
250
+ const router = new Router()
251
+
252
+ router.get('${healthPath}', (ctx) => {
253
+ ctx.body = {
254
+ status: 'ok',
255
+ timestamp: new Date().toISOString(),
256
+ uptime: process.uptime(),
257
+ }
258
+ })
259
+
260
+ export default router
261
+ `,
262
+ },
263
+ nestjs: {
264
+ file: 'src/health/health.controller.ts',
265
+ code: `import { Controller, Get } from '@nestjs/common'
266
+
267
+ @Controller('health')
268
+ export class HealthController {
269
+ @Get()
270
+ check() {
271
+ return {
272
+ status: 'ok',
273
+ timestamp: new Date().toISOString(),
274
+ uptime: process.uptime(),
275
+ }
276
+ }
277
+ }
278
+ `,
279
+ },
280
+ 'raw-node': {
281
+ file: 'src/health.ts',
282
+ code: `import { IncomingMessage, ServerResponse } from 'node:http'
283
+
284
+ export function handleHealth(_req: IncomingMessage, res: ServerResponse): void {
285
+ const health = {
286
+ status: 'ok',
287
+ timestamp: new Date().toISOString(),
288
+ uptime: process.uptime(),
289
+ }
290
+
291
+ res.writeHead(200, { 'Content-Type': 'application/json' })
292
+ res.end(JSON.stringify(health))
293
+ }
294
+ `,
295
+ },
296
+ };
297
+ const endpoint = healthEndpoints[framework] || healthEndpoints['raw-node'];
298
+ return {
299
+ path: join(directory, endpoint.file),
300
+ content: endpoint.code,
301
+ description: `Health endpoint for ${framework}`,
302
+ };
303
+ }
304
+ export async function writeGeneratedFile(file, dryRun = false) {
305
+ if (dryRun) {
306
+ console.log(chalk.dim(`\n--- ${file.path} ---`));
307
+ console.log(chalk.dim(file.content));
308
+ return;
309
+ }
310
+ await mkdir(dirname(file.path), { recursive: true });
311
+ await writeFile(file.path, file.content, 'utf-8');
312
+ }
313
+ export async function showDiff(file) {
314
+ try {
315
+ const existingContent = await readFile(file.path, 'utf-8');
316
+ if (existingContent === file.content) {
317
+ return 'No changes';
318
+ }
319
+ // Simple diff - just show that file will be modified
320
+ const existingLines = existingContent.split('\n').length;
321
+ const newLines = file.content.split('\n').length;
322
+ return `File will be modified (${existingLines} -> ${newLines} lines)`;
323
+ }
324
+ catch {
325
+ return 'New file will be created';
326
+ }
327
+ }
328
+ export function formatFilePreview(files) {
329
+ const lines = [];
330
+ lines.push(chalk.bold('\nFiles to be generated:'));
331
+ lines.push('');
332
+ for (const file of files) {
333
+ lines.push(` ${chalk.green('+')} ${file.path}`);
334
+ lines.push(` ${chalk.dim(file.description)}`);
335
+ }
336
+ return lines.join('\n');
337
+ }
338
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/lib/ai/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,KAAK,MAAM,OAAO,CAAA;AAmBzB,MAAM,UAAU,mBAAmB,CACjC,KAA2B,EAC3B,YAAoB,OAAO,CAAC,GAAG,EAAE;IAEjC,MAAM,MAAM,GAA+B,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnE,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,IAAI,EAAE,CAAC,CAAC,IAAI;KACb,CAAC,CAAC,CAAA;IAEH,MAAM,WAAW,GAAgB;QAC/B,UAAU,EAAE,uBAAuB;QACnC,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE;YACR,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE;gBACX,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM;oBAC7C,CAAC,CAAC,EAAE,sBAAsB,EAAE,KAAK,CAAC,QAAQ,EAAE;oBAC5C,CAAC,CAAC,EAAE,CAAC;aACR;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,cAAc;YAC5C,KAAK,EAAE,KAAK,CAAC,KAAK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B,aAAa,OAAO,QAAQ,SAAS,CAAA;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,0BAA0B,CAAA;IACnC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAsB;IACtD,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAA;IAClD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QAChD,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IAClD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { Tool } from '@anthropic-ai/sdk/resources/messages';
2
+ export declare const SYSTEM_PROMPT = "You are an AI assistant helping developers set up services for the InsurEco Tawa platform. You help configure services for deployment on the IEC (InsurEco Cloud) infrastructure.\n\n## About IEC Platform\n\nThe IEC platform is a Kubernetes-based internal developer platform with these key components:\n\n1. **Koko** - Service registry and API gateway (similar to Backstage)\n2. **Janus** - API gateway that proxies requests to services\n3. **Bio-ID** - Authentication/identity provider\n4. **iec-builder** - CI/CD system that builds and deploys services\n\n## Files You Can Generate\n\n### 1. catalog-info.yaml (Backstage-style service descriptor)\n```yaml\napiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n name: service-name\n description: Service description\n tags: [tawa]\n annotations:\n insureco.io/database: mongodb # or redis, neo4j, none\nspec:\n type: service\n lifecycle: experimental # or production, deprecated\n owner: team-name\n routes: # Optional: API routes for Janus proxy\n - path: /api/users\n methods: [GET, POST]\n auth: required # or none, service\n oauth: # Optional: OAuth client config\n clientId: service-oauth-client\n grantTypes: [authorization_code, client_credentials]\n scopes: [read:users, write:users]\n```\n\n### 2. Helm Chart (helm/<service-name>/)\n- Chart.yaml - Chart metadata\n- values.yaml - Default values (replicas, resources, env vars)\n- templates/deployment.yaml - Kubernetes Deployment\n- templates/service.yaml - Kubernetes Service\n\n### 3. Health Endpoint\nEvery service needs a /health endpoint for Kubernetes probes.\n\n## Your Task\n\n1. First, analyze the codebase using the scan_codebase tool\n2. Based on what you find, ask clarifying questions using ask_question\n3. Generate appropriate configuration using generate_catalog, generate_helm, add_health_endpoint\n4. Be conversational and helpful\n\n## Guidelines\n\n- Ask smart questions based on what you detect (don't ask obvious things)\n- If you detect a framework, tailor your questions to that framework\n- Suggest sensible defaults but ask for confirmation\n- Explain what each generated file does\n- Be concise but thorough\n";
3
+ export declare const AI_TOOLS: Tool[];
4
+ export interface AskQuestionInput {
5
+ question: string;
6
+ choices?: string[];
7
+ default?: string;
8
+ }
9
+ export interface GenerateCatalogInput {
10
+ name: string;
11
+ description: string;
12
+ owner: string;
13
+ lifecycle?: 'experimental' | 'production' | 'deprecated';
14
+ database?: 'mongodb' | 'redis' | 'neo4j' | 'none';
15
+ tags?: string[];
16
+ routes?: Array<{
17
+ path: string;
18
+ methods: Array<'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'>;
19
+ auth: 'none' | 'required' | 'service';
20
+ }>;
21
+ oauth?: {
22
+ clientId: string;
23
+ grantTypes: Array<'authorization_code' | 'client_credentials' | 'refresh_token'>;
24
+ scopes: string[];
25
+ };
26
+ }
27
+ export interface GenerateHelmInput {
28
+ name: string;
29
+ port?: number;
30
+ replicas?: number;
31
+ resources?: {
32
+ cpu?: string;
33
+ memory?: string;
34
+ };
35
+ env?: Record<string, string>;
36
+ healthPath?: string;
37
+ }
38
+ export interface AddHealthEndpointInput {
39
+ framework: 'express' | 'fastify' | 'nextjs' | 'hono' | 'koa' | 'nestjs' | 'raw-node';
40
+ path?: string;
41
+ includeDetails?: boolean;
42
+ }
43
+ export interface CompleteSetupInput {
44
+ summary: string;
45
+ nextSteps: string[];
46
+ }
47
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/lib/ai/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAA;AAEhE,eAAO,MAAM,aAAa,spEA4DzB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,IAAI,EAwL1B,CAAA;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,YAAY,CAAA;IACxD,QAAQ,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IACjD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,KAAK,CAAC,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAA;QAC3D,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAA;KACtC,CAAC,CAAA;IACF,KAAK,CAAC,EAAE;QACN,QAAQ,EAAE,MAAM,CAAA;QAChB,UAAU,EAAE,KAAK,CAAC,oBAAoB,GAAG,oBAAoB,GAAG,eAAe,CAAC,CAAA;QAChF,MAAM,EAAE,MAAM,EAAE,CAAA;KACjB,CAAA;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE;QACV,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,CAAA;IACpF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB"}
@@ -0,0 +1,247 @@
1
+ export const SYSTEM_PROMPT = `You are an AI assistant helping developers set up services for the InsurEco Tawa platform. You help configure services for deployment on the IEC (InsurEco Cloud) infrastructure.
2
+
3
+ ## About IEC Platform
4
+
5
+ The IEC platform is a Kubernetes-based internal developer platform with these key components:
6
+
7
+ 1. **Koko** - Service registry and API gateway (similar to Backstage)
8
+ 2. **Janus** - API gateway that proxies requests to services
9
+ 3. **Bio-ID** - Authentication/identity provider
10
+ 4. **iec-builder** - CI/CD system that builds and deploys services
11
+
12
+ ## Files You Can Generate
13
+
14
+ ### 1. catalog-info.yaml (Backstage-style service descriptor)
15
+ \`\`\`yaml
16
+ apiVersion: backstage.io/v1alpha1
17
+ kind: Component
18
+ metadata:
19
+ name: service-name
20
+ description: Service description
21
+ tags: [tawa]
22
+ annotations:
23
+ insureco.io/database: mongodb # or redis, neo4j, none
24
+ spec:
25
+ type: service
26
+ lifecycle: experimental # or production, deprecated
27
+ owner: team-name
28
+ routes: # Optional: API routes for Janus proxy
29
+ - path: /api/users
30
+ methods: [GET, POST]
31
+ auth: required # or none, service
32
+ oauth: # Optional: OAuth client config
33
+ clientId: service-oauth-client
34
+ grantTypes: [authorization_code, client_credentials]
35
+ scopes: [read:users, write:users]
36
+ \`\`\`
37
+
38
+ ### 2. Helm Chart (helm/<service-name>/)
39
+ - Chart.yaml - Chart metadata
40
+ - values.yaml - Default values (replicas, resources, env vars)
41
+ - templates/deployment.yaml - Kubernetes Deployment
42
+ - templates/service.yaml - Kubernetes Service
43
+
44
+ ### 3. Health Endpoint
45
+ Every service needs a /health endpoint for Kubernetes probes.
46
+
47
+ ## Your Task
48
+
49
+ 1. First, analyze the codebase using the scan_codebase tool
50
+ 2. Based on what you find, ask clarifying questions using ask_question
51
+ 3. Generate appropriate configuration using generate_catalog, generate_helm, add_health_endpoint
52
+ 4. Be conversational and helpful
53
+
54
+ ## Guidelines
55
+
56
+ - Ask smart questions based on what you detect (don't ask obvious things)
57
+ - If you detect a framework, tailor your questions to that framework
58
+ - Suggest sensible defaults but ask for confirmation
59
+ - Explain what each generated file does
60
+ - Be concise but thorough
61
+ `;
62
+ export const AI_TOOLS = [
63
+ {
64
+ name: 'scan_codebase',
65
+ description: 'Scan the current directory to understand the project structure, framework, dependencies, and existing configuration. Always call this first.',
66
+ input_schema: {
67
+ type: 'object',
68
+ properties: {
69
+ directory: {
70
+ type: 'string',
71
+ description: 'Directory to scan (default: current directory)',
72
+ },
73
+ },
74
+ required: [],
75
+ },
76
+ },
77
+ {
78
+ name: 'ask_question',
79
+ description: 'Ask the user a clarifying question. Use this to gather information needed for configuration.',
80
+ input_schema: {
81
+ type: 'object',
82
+ properties: {
83
+ question: {
84
+ type: 'string',
85
+ description: 'The question to ask the user',
86
+ },
87
+ choices: {
88
+ type: 'array',
89
+ items: { type: 'string' },
90
+ description: 'Optional list of choices for the user to select from (for multiple choice questions)',
91
+ },
92
+ default: {
93
+ type: 'string',
94
+ description: 'Optional default answer',
95
+ },
96
+ },
97
+ required: ['question'],
98
+ },
99
+ },
100
+ {
101
+ name: 'generate_catalog',
102
+ description: 'Generate a catalog-info.yaml file for the service. This registers the service with Koko.',
103
+ input_schema: {
104
+ type: 'object',
105
+ properties: {
106
+ name: {
107
+ type: 'string',
108
+ description: 'Service name (kebab-case)',
109
+ },
110
+ description: {
111
+ type: 'string',
112
+ description: 'Human-readable service description',
113
+ },
114
+ owner: {
115
+ type: 'string',
116
+ description: 'Team or person who owns the service',
117
+ },
118
+ lifecycle: {
119
+ type: 'string',
120
+ enum: ['experimental', 'production', 'deprecated'],
121
+ description: 'Service lifecycle stage',
122
+ },
123
+ database: {
124
+ type: 'string',
125
+ enum: ['mongodb', 'redis', 'neo4j', 'none'],
126
+ description: 'Database type if any',
127
+ },
128
+ tags: {
129
+ type: 'array',
130
+ items: { type: 'string' },
131
+ description: 'Tags for categorization',
132
+ },
133
+ routes: {
134
+ type: 'array',
135
+ items: {
136
+ type: 'object',
137
+ properties: {
138
+ path: { type: 'string' },
139
+ methods: {
140
+ type: 'array',
141
+ items: { type: 'string', enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'] },
142
+ },
143
+ auth: { type: 'string', enum: ['none', 'required', 'service'] },
144
+ },
145
+ required: ['path', 'methods', 'auth'],
146
+ },
147
+ description: 'API routes to expose through Janus gateway',
148
+ },
149
+ oauth: {
150
+ type: 'object',
151
+ properties: {
152
+ clientId: { type: 'string' },
153
+ grantTypes: {
154
+ type: 'array',
155
+ items: { type: 'string', enum: ['authorization_code', 'client_credentials', 'refresh_token'] },
156
+ },
157
+ scopes: { type: 'array', items: { type: 'string' } },
158
+ },
159
+ description: 'OAuth client configuration if needed',
160
+ },
161
+ },
162
+ required: ['name', 'description', 'owner'],
163
+ },
164
+ },
165
+ {
166
+ name: 'generate_helm',
167
+ description: 'Generate a Helm chart for Kubernetes deployment.',
168
+ input_schema: {
169
+ type: 'object',
170
+ properties: {
171
+ name: {
172
+ type: 'string',
173
+ description: 'Service name',
174
+ },
175
+ port: {
176
+ type: 'number',
177
+ description: 'Port the service listens on (default: 3000)',
178
+ },
179
+ replicas: {
180
+ type: 'number',
181
+ description: 'Number of replicas (default: 1)',
182
+ },
183
+ resources: {
184
+ type: 'object',
185
+ properties: {
186
+ cpu: { type: 'string', description: 'CPU limit (e.g., "500m")' },
187
+ memory: { type: 'string', description: 'Memory limit (e.g., "512Mi")' },
188
+ },
189
+ description: 'Resource limits',
190
+ },
191
+ env: {
192
+ type: 'object',
193
+ additionalProperties: { type: 'string' },
194
+ description: 'Environment variables (key-value pairs)',
195
+ },
196
+ healthPath: {
197
+ type: 'string',
198
+ description: 'Health check path (default: /health)',
199
+ },
200
+ },
201
+ required: ['name'],
202
+ },
203
+ },
204
+ {
205
+ name: 'add_health_endpoint',
206
+ description: 'Add a health check endpoint to the existing application code.',
207
+ input_schema: {
208
+ type: 'object',
209
+ properties: {
210
+ framework: {
211
+ type: 'string',
212
+ enum: ['express', 'fastify', 'nextjs', 'hono', 'koa', 'nestjs', 'raw-node'],
213
+ description: 'The web framework being used',
214
+ },
215
+ path: {
216
+ type: 'string',
217
+ description: 'Path for health endpoint (default: /health)',
218
+ },
219
+ includeDetails: {
220
+ type: 'boolean',
221
+ description: 'Include database connectivity and other health details',
222
+ },
223
+ },
224
+ required: ['framework'],
225
+ },
226
+ },
227
+ {
228
+ name: 'complete_setup',
229
+ description: 'Signal that the setup is complete. Call this after all files have been generated.',
230
+ input_schema: {
231
+ type: 'object',
232
+ properties: {
233
+ summary: {
234
+ type: 'string',
235
+ description: 'Summary of what was generated',
236
+ },
237
+ nextSteps: {
238
+ type: 'array',
239
+ items: { type: 'string' },
240
+ description: 'List of next steps for the user',
241
+ },
242
+ },
243
+ required: ['summary', 'nextSteps'],
244
+ },
245
+ },
246
+ ];
247
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/lib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