@vedangiitb/qwintly-core 1.0.2

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 (226) hide show
  1. package/README.md +8 -0
  2. package/dist/ai/ai.d.ts +2 -0
  3. package/dist/ai/ai.d.ts.map +1 -0
  4. package/dist/ai/ai.js +2 -0
  5. package/dist/ai/ai.js.map +1 -0
  6. package/dist/ai/generate/gemini.client.d.ts +15 -0
  7. package/dist/ai/generate/gemini.client.d.ts.map +1 -0
  8. package/dist/ai/generate/gemini.client.js +39 -0
  9. package/dist/ai/generate/gemini.client.js.map +1 -0
  10. package/dist/ai/generate/generateClient.d.ts +3 -0
  11. package/dist/ai/generate/generateClient.d.ts.map +1 -0
  12. package/dist/ai/generate/generateClient.js +8 -0
  13. package/dist/ai/generate/generateClient.js.map +1 -0
  14. package/dist/ai/toolLoop/toolLoopContext.d.ts +33 -0
  15. package/dist/ai/toolLoop/toolLoopContext.d.ts.map +1 -0
  16. package/dist/ai/toolLoop/toolLoopContext.js +112 -0
  17. package/dist/ai/toolLoop/toolLoopContext.js.map +1 -0
  18. package/dist/ai/toolLoop/toolLoopRunner.d.ts +43 -0
  19. package/dist/ai/toolLoop/toolLoopRunner.d.ts.map +1 -0
  20. package/dist/ai/toolLoop/toolLoopRunner.js +227 -0
  21. package/dist/ai/toolLoop/toolLoopRunner.js.map +1 -0
  22. package/dist/ai/toolLoop/toolLoopRunnerUtils.d.ts +51 -0
  23. package/dist/ai/toolLoop/toolLoopRunnerUtils.d.ts.map +1 -0
  24. package/dist/ai/toolLoop/toolLoopRunnerUtils.js +164 -0
  25. package/dist/ai/toolLoop/toolLoopRunnerUtils.js.map +1 -0
  26. package/dist/ai/tools/helpers/applyPatch.helpers.d.ts +36 -0
  27. package/dist/ai/tools/helpers/applyPatch.helpers.d.ts.map +1 -0
  28. package/dist/ai/tools/helpers/applyPatch.helpers.js +307 -0
  29. package/dist/ai/tools/helpers/applyPatch.helpers.js.map +1 -0
  30. package/dist/ai/tools/helpers/applyPatch.helpers.test.d.ts +2 -0
  31. package/dist/ai/tools/helpers/applyPatch.helpers.test.d.ts.map +1 -0
  32. package/dist/ai/tools/helpers/applyPatch.helpers.test.js +50 -0
  33. package/dist/ai/tools/helpers/applyPatch.helpers.test.js.map +1 -0
  34. package/dist/ai/tools/helpers/fileSystem.helpers.d.ts +2 -0
  35. package/dist/ai/tools/helpers/fileSystem.helpers.d.ts.map +1 -0
  36. package/dist/ai/tools/helpers/fileSystem.helpers.js +45 -0
  37. package/dist/ai/tools/helpers/fileSystem.helpers.js.map +1 -0
  38. package/dist/ai/tools/helpers/fileSystem.helpers.test.d.ts +2 -0
  39. package/dist/ai/tools/helpers/fileSystem.helpers.test.d.ts.map +1 -0
  40. package/dist/ai/tools/helpers/fileSystem.helpers.test.js +15 -0
  41. package/dist/ai/tools/helpers/fileSystem.helpers.test.js.map +1 -0
  42. package/dist/ai/tools/helpers/format.helpers.d.ts +2 -0
  43. package/dist/ai/tools/helpers/format.helpers.d.ts.map +1 -0
  44. package/dist/ai/tools/helpers/format.helpers.js +14 -0
  45. package/dist/ai/tools/helpers/format.helpers.js.map +1 -0
  46. package/dist/ai/tools/helpers/nextRouteFilePolicy.d.ts +8 -0
  47. package/dist/ai/tools/helpers/nextRouteFilePolicy.d.ts.map +1 -0
  48. package/dist/ai/tools/helpers/nextRouteFilePolicy.js +26 -0
  49. package/dist/ai/tools/helpers/nextRouteFilePolicy.js.map +1 -0
  50. package/dist/ai/tools/implementations/applyPatch.impl.d.ts +53 -0
  51. package/dist/ai/tools/implementations/applyPatch.impl.d.ts.map +1 -0
  52. package/dist/ai/tools/implementations/applyPatch.impl.js +242 -0
  53. package/dist/ai/tools/implementations/applyPatch.impl.js.map +1 -0
  54. package/dist/ai/tools/implementations/applyPatch.impl.test.d.ts +2 -0
  55. package/dist/ai/tools/implementations/applyPatch.impl.test.d.ts.map +1 -0
  56. package/dist/ai/tools/implementations/applyPatch.impl.test.js +72 -0
  57. package/dist/ai/tools/implementations/applyPatch.impl.test.js.map +1 -0
  58. package/dist/ai/tools/implementations/factories.d.ts +90 -0
  59. package/dist/ai/tools/implementations/factories.d.ts.map +1 -0
  60. package/dist/ai/tools/implementations/factories.js +26 -0
  61. package/dist/ai/tools/implementations/factories.js.map +1 -0
  62. package/dist/ai/tools/implementations/listDir.impl.d.ts +3 -0
  63. package/dist/ai/tools/implementations/listDir.impl.d.ts.map +1 -0
  64. package/dist/ai/tools/implementations/listDir.impl.js +47 -0
  65. package/dist/ai/tools/implementations/listDir.impl.js.map +1 -0
  66. package/dist/ai/tools/implementations/readFile.impl.d.ts +3 -0
  67. package/dist/ai/tools/implementations/readFile.impl.d.ts.map +1 -0
  68. package/dist/ai/tools/implementations/readFile.impl.js +23 -0
  69. package/dist/ai/tools/implementations/readFile.impl.js.map +1 -0
  70. package/dist/ai/tools/implementations/search.impl.d.ts +18 -0
  71. package/dist/ai/tools/implementations/search.impl.d.ts.map +1 -0
  72. package/dist/ai/tools/implementations/search.impl.js +74 -0
  73. package/dist/ai/tools/implementations/search.impl.js.map +1 -0
  74. package/dist/ai/tools/implementations/workspaceDeps.d.ts +22 -0
  75. package/dist/ai/tools/implementations/workspaceDeps.d.ts.map +1 -0
  76. package/dist/ai/tools/implementations/workspaceDeps.js +2 -0
  77. package/dist/ai/tools/implementations/workspaceDeps.js.map +1 -0
  78. package/dist/ai/tools/implementations/writeFile.impl.d.ts +27 -0
  79. package/dist/ai/tools/implementations/writeFile.impl.d.ts.map +1 -0
  80. package/dist/ai/tools/implementations/writeFile.impl.js +62 -0
  81. package/dist/ai/tools/implementations/writeFile.impl.js.map +1 -0
  82. package/dist/ai/tools/schemas/applyPatch.schema.d.ts +16 -0
  83. package/dist/ai/tools/schemas/applyPatch.schema.d.ts.map +1 -0
  84. package/dist/ai/tools/schemas/applyPatch.schema.js +17 -0
  85. package/dist/ai/tools/schemas/applyPatch.schema.js.map +1 -0
  86. package/dist/ai/tools/schemas/listDir.schema.d.ts +22 -0
  87. package/dist/ai/tools/schemas/listDir.schema.d.ts.map +1 -0
  88. package/dist/ai/tools/schemas/listDir.schema.js +22 -0
  89. package/dist/ai/tools/schemas/listDir.schema.js.map +1 -0
  90. package/dist/ai/tools/schemas/readFile.schema.d.ts +26 -0
  91. package/dist/ai/tools/schemas/readFile.schema.d.ts.map +1 -0
  92. package/dist/ai/tools/schemas/readFile.schema.js +26 -0
  93. package/dist/ai/tools/schemas/readFile.schema.js.map +1 -0
  94. package/dist/ai/tools/schemas/search.schema.d.ts +16 -0
  95. package/dist/ai/tools/schemas/search.schema.d.ts.map +1 -0
  96. package/dist/ai/tools/schemas/search.schema.js +16 -0
  97. package/dist/ai/tools/schemas/search.schema.js.map +1 -0
  98. package/dist/ai/tools/schemas/submitCodegenDone.schema.d.ts +16 -0
  99. package/dist/ai/tools/schemas/submitCodegenDone.schema.d.ts.map +1 -0
  100. package/dist/ai/tools/schemas/submitCodegenDone.schema.js +16 -0
  101. package/dist/ai/tools/schemas/submitCodegenDone.schema.js.map +1 -0
  102. package/dist/ai/tools/schemas/submitPlannerTasks.schema.d.ts +33 -0
  103. package/dist/ai/tools/schemas/submitPlannerTasks.schema.d.ts.map +1 -0
  104. package/dist/ai/tools/schemas/submitPlannerTasks.schema.js +31 -0
  105. package/dist/ai/tools/schemas/submitPlannerTasks.schema.js.map +1 -0
  106. package/dist/ai/tools/schemas/writeFile.schema.d.ts +20 -0
  107. package/dist/ai/tools/schemas/writeFile.schema.d.ts.map +1 -0
  108. package/dist/ai/tools/schemas/writeFile.schema.js +23 -0
  109. package/dist/ai/tools/schemas/writeFile.schema.js.map +1 -0
  110. package/dist/ai/tools/toolsets/codegenTools.d.ts +3 -0
  111. package/dist/ai/tools/toolsets/codegenTools.d.ts.map +1 -0
  112. package/dist/ai/tools/toolsets/codegenTools.js +17 -0
  113. package/dist/ai/tools/toolsets/codegenTools.js.map +1 -0
  114. package/dist/ai/tools/toolsets/plannerTools.d.ts +3 -0
  115. package/dist/ai/tools/toolsets/plannerTools.d.ts.map +1 -0
  116. package/dist/ai/tools/toolsets/plannerTools.js +17 -0
  117. package/dist/ai/tools/toolsets/plannerTools.js.map +1 -0
  118. package/dist/core.d.ts +44 -0
  119. package/dist/core.d.ts.map +1 -0
  120. package/dist/core.js +80 -0
  121. package/dist/core.js.map +1 -0
  122. package/dist/index.d.ts +2 -0
  123. package/dist/index.d.ts.map +1 -0
  124. package/dist/index.js +3 -0
  125. package/dist/index.js.map +1 -0
  126. package/dist/indexer/codegenIndex.d.ts +3 -0
  127. package/dist/indexer/codegenIndex.d.ts.map +1 -0
  128. package/dist/indexer/codegenIndex.js +17 -0
  129. package/dist/indexer/codegenIndex.js.map +1 -0
  130. package/dist/indexer/data/configs.constants.d.ts +85 -0
  131. package/dist/indexer/data/configs.constants.d.ts.map +1 -0
  132. package/dist/indexer/data/configs.constants.js +136 -0
  133. package/dist/indexer/data/configs.constants.js.map +1 -0
  134. package/dist/indexer/helpers/buildFolderTree.d.ts +2 -0
  135. package/dist/indexer/helpers/buildFolderTree.d.ts.map +1 -0
  136. package/dist/indexer/helpers/buildFolderTree.js +40 -0
  137. package/dist/indexer/helpers/buildFolderTree.js.map +1 -0
  138. package/dist/indexer/plannerIndex.d.ts +3 -0
  139. package/dist/indexer/plannerIndex.d.ts.map +1 -0
  140. package/dist/indexer/plannerIndex.js +20 -0
  141. package/dist/indexer/plannerIndex.js.map +1 -0
  142. package/dist/indexer/projectInfoIndex.d.ts +3 -0
  143. package/dist/indexer/projectInfoIndex.d.ts.map +1 -0
  144. package/dist/indexer/projectInfoIndex.js +257 -0
  145. package/dist/indexer/projectInfoIndex.js.map +1 -0
  146. package/dist/indexer/validatorIndex.d.ts +3 -0
  147. package/dist/indexer/validatorIndex.d.ts.map +1 -0
  148. package/dist/indexer/validatorIndex.js +14 -0
  149. package/dist/indexer/validatorIndex.js.map +1 -0
  150. package/dist/lib/redis.d.ts +3 -0
  151. package/dist/lib/redis.d.ts.map +1 -0
  152. package/dist/lib/redis.js +7 -0
  153. package/dist/lib/redis.js.map +1 -0
  154. package/dist/lib/supabase.d.ts +2 -0
  155. package/dist/lib/supabase.d.ts.map +1 -0
  156. package/dist/lib/supabase.js +4 -0
  157. package/dist/lib/supabase.js.map +1 -0
  158. package/dist/logging/genStatus.service.d.ts +14 -0
  159. package/dist/logging/genStatus.service.d.ts.map +1 -0
  160. package/dist/logging/genStatus.service.js +36 -0
  161. package/dist/logging/genStatus.service.js.map +1 -0
  162. package/dist/logging/logging.utils.d.ts +12 -0
  163. package/dist/logging/logging.utils.d.ts.map +1 -0
  164. package/dist/logging/logging.utils.js +15 -0
  165. package/dist/logging/logging.utils.js.map +1 -0
  166. package/dist/logging/redis.service.d.ts +11 -0
  167. package/dist/logging/redis.service.d.ts.map +1 -0
  168. package/dist/logging/redis.service.js +26 -0
  169. package/dist/logging/redis.service.js.map +1 -0
  170. package/dist/repository/context.repository.d.ts +8 -0
  171. package/dist/repository/context.repository.d.ts.map +1 -0
  172. package/dist/repository/context.repository.js +59 -0
  173. package/dist/repository/context.repository.js.map +1 -0
  174. package/dist/repository/genStatus.repository.d.ts +13 -0
  175. package/dist/repository/genStatus.repository.d.ts.map +1 -0
  176. package/dist/repository/genStatus.repository.js +18 -0
  177. package/dist/repository/genStatus.repository.js.map +1 -0
  178. package/dist/repository/planTasks.repository.d.ts +9 -0
  179. package/dist/repository/planTasks.repository.d.ts.map +1 -0
  180. package/dist/repository/planTasks.repository.js +24 -0
  181. package/dist/repository/planTasks.repository.js.map +1 -0
  182. package/dist/repository/repository.d.ts +5 -0
  183. package/dist/repository/repository.d.ts.map +1 -0
  184. package/dist/repository/repository.js +7 -0
  185. package/dist/repository/repository.js.map +1 -0
  186. package/dist/types/context.types.d.ts +64 -0
  187. package/dist/types/context.types.d.ts.map +1 -0
  188. package/dist/types/context.types.js +55 -0
  189. package/dist/types/context.types.js.map +1 -0
  190. package/dist/types/events.d.ts +16 -0
  191. package/dist/types/events.d.ts.map +1 -0
  192. package/dist/types/events.js +14 -0
  193. package/dist/types/events.js.map +1 -0
  194. package/dist/types/index/configs.types.d.ts +28 -0
  195. package/dist/types/index/configs.types.d.ts.map +1 -0
  196. package/dist/types/index/configs.types.js +2 -0
  197. package/dist/types/index/configs.types.js.map +1 -0
  198. package/dist/types/index/conventions.types.d.ts +40 -0
  199. package/dist/types/index/conventions.types.d.ts.map +1 -0
  200. package/dist/types/index/conventions.types.js +2 -0
  201. package/dist/types/index/conventions.types.js.map +1 -0
  202. package/dist/types/index/index.types.d.ts +16 -0
  203. package/dist/types/index/index.types.d.ts.map +1 -0
  204. package/dist/types/index/index.types.js +2 -0
  205. package/dist/types/index/index.types.js.map +1 -0
  206. package/dist/types/index/indexing.types.d.ts +9 -0
  207. package/dist/types/index/indexing.types.d.ts.map +1 -0
  208. package/dist/types/index/indexing.types.js +2 -0
  209. package/dist/types/index/indexing.types.js.map +1 -0
  210. package/dist/types/projectInfo.types.d.ts +16 -0
  211. package/dist/types/projectInfo.types.d.ts.map +1 -0
  212. package/dist/types/projectInfo.types.js +2 -0
  213. package/dist/types/projectInfo.types.js.map +1 -0
  214. package/dist/types/updatePlan.types.d.ts +34 -0
  215. package/dist/types/updatePlan.types.d.ts.map +1 -0
  216. package/dist/types/updatePlan.types.js +18 -0
  217. package/dist/types/updatePlan.types.js.map +1 -0
  218. package/dist/utils/utils.d.ts +2 -0
  219. package/dist/utils/utils.d.ts.map +1 -0
  220. package/dist/utils/utils.js +6 -0
  221. package/dist/utils/utils.js.map +1 -0
  222. package/dist/utils/workspace.d.ts +13 -0
  223. package/dist/utils/workspace.d.ts.map +1 -0
  224. package/dist/utils/workspace.js +92 -0
  225. package/dist/utils/workspace.js.map +1 -0
  226. package/package.json +58 -0
@@ -0,0 +1,3 @@
1
+ import { ValidatorIndex } from "../types/index/index.types.js";
2
+ export declare const buildValidatorIndex: (rootDir: string) => Promise<ValidatorIndex>;
3
+ //# sourceMappingURL=validatorIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorIndex.d.ts","sourceRoot":"","sources":["../../src/indexer/validatorIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,KACd,OAAO,CAAC,cAAc,CAWxB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { projectConfigs } from "./data/configs.constants.js";
2
+ import { buildFolderTree } from "./helpers/buildFolderTree.js";
3
+ export const buildValidatorIndex = async (rootDir) => {
4
+ const folderTree = await buildFolderTree(rootDir);
5
+ return {
6
+ folderTree,
7
+ projectConfigs: {
8
+ frameworkConfig: projectConfigs.frameworkConfig,
9
+ runtimeConfig: projectConfigs.runtimeConfig,
10
+ toolingConfig: projectConfigs.toolingConfig,
11
+ },
12
+ };
13
+ };
14
+ //# sourceMappingURL=validatorIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorIndex.js","sourceRoot":"","sources":["../../src/indexer/validatorIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,OAAe,EACU,EAAE;IAC3B,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;IAElD,OAAO;QACL,UAAU;QACV,cAAc,EAAE;YACd,eAAe,EAAE,cAAc,CAAC,eAAe;YAC/C,aAAa,EAAE,cAAc,CAAC,aAAa;YAC3C,aAAa,EAAE,cAAc,CAAC,aAAa;SAC5C;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { ValidatorIndex } from \"../types/index/index.types.js\";\nimport { projectConfigs } from \"./data/configs.constants.js\";\nimport { buildFolderTree } from \"./helpers/buildFolderTree.js\";\n\nexport const buildValidatorIndex = async (\n rootDir: string,\n): Promise<ValidatorIndex> => {\n const folderTree = await buildFolderTree(rootDir);\n\n return {\n folderTree,\n projectConfigs: {\n frameworkConfig: projectConfigs.frameworkConfig,\n runtimeConfig: projectConfigs.runtimeConfig,\n toolingConfig: projectConfigs.toolingConfig,\n },\n };\n};\n"]}
@@ -0,0 +1,3 @@
1
+ import { Redis } from "@upstash/redis";
2
+ export declare const redis: (upstashUrl: string, upstashToken: string) => Redis;
3
+ //# sourceMappingURL=redis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,eAAO,MAAM,KAAK,GAAI,YAAY,MAAM,EAAE,cAAc,MAAM,UAI1D,CAAC"}
@@ -0,0 +1,7 @@
1
+ // lib/redis.ts
2
+ import { Redis } from "@upstash/redis";
3
+ export const redis = (upstashUrl, upstashToken) => new Redis({
4
+ url: upstashUrl,
5
+ token: upstashToken,
6
+ });
7
+ //# sourceMappingURL=redis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.js","sourceRoot":"","sources":["../../src/lib/redis.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,UAAkB,EAAE,YAAoB,EAAE,EAAE,CAChE,IAAI,KAAK,CAAC;IACR,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,YAAY;CACpB,CAAC,CAAC","sourcesContent":["// lib/redis.ts\r\nimport { Redis } from \"@upstash/redis\";\r\n\r\nexport const redis = (upstashUrl: string, upstashToken: string) =>\r\n new Redis({\r\n url: upstashUrl,\r\n token: upstashToken,\r\n });\r\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const supabase: (sbUrl: string, sbSecret: string) => import("@supabase/supabase-js").SupabaseClient<any, "public", "public", any, any>;
2
+ //# sourceMappingURL=supabase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/lib/supabase.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,sFACxB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // lib/supabase.ts
2
+ import { createClient } from "@supabase/supabase-js";
3
+ export const supabase = (sbUrl, sbSecret) => createClient(sbUrl, sbSecret);
4
+ //# sourceMappingURL=supabase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supabase.js","sourceRoot":"","sources":["../../src/lib/supabase.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAE,EAAE,CAC1D,YAAY,CAAC,KAAK,EAAE,QAAS,CAAC,CAAC","sourcesContent":["// lib/supabase.ts\r\nimport { createClient } from \"@supabase/supabase-js\";\r\n\r\nexport const supabase = (sbUrl: string, sbSecret: string) =>\r\n createClient(sbUrl, sbSecret!);\r\n"]}
@@ -0,0 +1,14 @@
1
+ import { PersistedStatusEvent } from "../repository/genStatus.repository.js";
2
+ import { EventType, GenStep } from "../types/events.js";
3
+ export interface StatusRepository {
4
+ persist(chatId: string, sessionId: string, eventType: EventType, step: GenStep, message: string, source: string): Promise<PersistedStatusEvent>;
5
+ }
6
+ export interface StatusPublisher {
7
+ publish(chatId: string, genId: string, event: PersistedStatusEvent): Promise<void>;
8
+ }
9
+ export interface StatusServiceDeps {
10
+ repository: StatusRepository;
11
+ publisher: StatusPublisher;
12
+ }
13
+ export declare const statusService: (chatId: string, sessionId: string, eventType: EventType, step: GenStep, message: string, source: string, deps: StatusServiceDeps) => Promise<PersistedStatusEvent>;
14
+ //# sourceMappingURL=genStatus.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genStatus.service.d.ts","sourceRoot":"","sources":["../../src/logging/genStatus.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGxD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CACL,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CACL,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE,eAAe,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,WAAW,SAAS,EACpB,MAAM,OAAO,EACb,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,MAAM,iBAAiB,KACtB,OAAO,CAAC,oBAAoB,CAmD9B,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { assertNonEmpty, StatusServiceError } from "./logging.utils.js";
2
+ export const statusService = async (chatId, sessionId, eventType, step, message, source, deps) => {
3
+ const { repository, publisher } = deps;
4
+ assertNonEmpty(chatId, "chatId");
5
+ assertNonEmpty(message, "message");
6
+ assertNonEmpty(source, "source");
7
+ let persistedEvent;
8
+ try {
9
+ persistedEvent = await repository.persist(chatId, sessionId, eventType, step, message, source);
10
+ }
11
+ catch (error) {
12
+ throw new StatusServiceError("PERSISTENCE_FAILED", "Failed to persist status event", {
13
+ cause: error,
14
+ context: { chatId, eventType, step, source },
15
+ });
16
+ }
17
+ try {
18
+ await publisher.publish(chatId, sessionId, persistedEvent);
19
+ return persistedEvent;
20
+ }
21
+ catch (error) {
22
+ console.error("Failed publishing status event to Redis", {
23
+ chatId,
24
+ seq_num: persistedEvent.seq_num,
25
+ error,
26
+ });
27
+ throw new StatusServiceError("REDIS_PUBLISH_FAILED", "Status event persisted but failed to publish to Redis", {
28
+ cause: error,
29
+ context: {
30
+ chatId,
31
+ persistedEvent,
32
+ },
33
+ });
34
+ }
35
+ };
36
+ //# sourceMappingURL=genStatus.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genStatus.service.js","sourceRoot":"","sources":["../../src/logging/genStatus.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AA0BxE,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAChC,MAAc,EACd,SAAiB,EACjB,SAAoB,EACpB,IAAa,EACb,OAAe,EACf,MAAc,EACd,IAAuB,EACQ,EAAE;IACjC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAEvC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACjC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACnC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEjC,IAAI,cAAoC,CAAC;IAEzC,IAAI,CAAC;QACH,cAAc,GAAG,MAAM,UAAU,CAAC,OAAO,CACvC,MAAM,EACN,SAAS,EACT,SAAS,EACT,IAAI,EACJ,OAAO,EACP,MAAM,CACP,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,kBAAkB,CAC1B,oBAAoB,EACpB,gCAAgC,EAChC;YACE,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;SAC7C,CACF,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;QAC3D,OAAO,cAAc,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE;YACvD,MAAM;YACN,OAAO,EAAE,cAAc,CAAC,OAAO;YAC/B,KAAK;SACN,CAAC,CAAC;QAEH,MAAM,IAAI,kBAAkB,CAC1B,sBAAsB,EACtB,uDAAuD,EACvD;YACE,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE;gBACP,MAAM;gBACN,cAAc;aACf;SACF,CACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { PersistedStatusEvent } from \"../repository/genStatus.repository.js\";\nimport { EventType, GenStep } from \"../types/events.js\";\nimport { assertNonEmpty, StatusServiceError } from \"./logging.utils.js\";\n\nexport interface StatusRepository {\n persist(\n chatId: string,\n sessionId: string,\n eventType: EventType,\n step: GenStep,\n message: string,\n source: string,\n ): Promise<PersistedStatusEvent>;\n}\n\nexport interface StatusPublisher {\n publish(\n chatId: string,\n genId: string,\n event: PersistedStatusEvent,\n ): Promise<void>;\n}\n\nexport interface StatusServiceDeps {\n repository: StatusRepository;\n publisher: StatusPublisher;\n}\n\nexport const statusService = async (\n chatId: string,\n sessionId: string,\n eventType: EventType,\n step: GenStep,\n message: string,\n source: string,\n deps: StatusServiceDeps,\n): Promise<PersistedStatusEvent> => {\n const { repository, publisher } = deps;\n\n assertNonEmpty(chatId, \"chatId\");\n assertNonEmpty(message, \"message\");\n assertNonEmpty(source, \"source\");\n\n let persistedEvent: PersistedStatusEvent;\n\n try {\n persistedEvent = await repository.persist(\n chatId,\n sessionId,\n eventType,\n step,\n message,\n source,\n );\n } catch (error) {\n throw new StatusServiceError(\n \"PERSISTENCE_FAILED\",\n \"Failed to persist status event\",\n {\n cause: error,\n context: { chatId, eventType, step, source },\n },\n );\n }\n\n try {\n await publisher.publish(chatId, sessionId, persistedEvent);\n return persistedEvent;\n } catch (error) {\n console.error(\"Failed publishing status event to Redis\", {\n chatId,\n seq_num: persistedEvent.seq_num,\n error,\n });\n\n throw new StatusServiceError(\n \"REDIS_PUBLISH_FAILED\",\n \"Status event persisted but failed to publish to Redis\",\n {\n cause: error,\n context: {\n chatId,\n persistedEvent,\n },\n },\n );\n }\n};\n"]}
@@ -0,0 +1,12 @@
1
+ export type StatusErrorCode = "INVALID_ARGUMENTS" | "PERSISTENCE_FAILED" | "REDIS_PUBLISH_FAILED";
2
+ export declare class StatusServiceError extends Error {
3
+ readonly code: StatusErrorCode;
4
+ readonly cause?: unknown;
5
+ readonly context?: Record<string, unknown>;
6
+ constructor(code: StatusErrorCode, message: string, options?: {
7
+ cause?: unknown;
8
+ context?: Record<string, unknown>;
9
+ });
10
+ }
11
+ export declare const assertNonEmpty: (value: string, field: string) => void;
12
+ //# sourceMappingURL=logging.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.utils.d.ts","sourceRoot":"","sources":["../../src/logging/logging.utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,mBAAmB,GACnB,oBAAoB,GACpB,sBAAsB,CAAC;AAE3B,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAgB,IAAI,EAAE,eAAe,CAAC;IACtC,SAAgB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChC,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGhD,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;CAQnE;AAED,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM,KAAG,IAQ7D,CAAC"}
@@ -0,0 +1,15 @@
1
+ export class StatusServiceError extends Error {
2
+ constructor(code, message, options) {
3
+ super(message);
4
+ this.name = "StatusServiceError";
5
+ this.code = code;
6
+ this.cause = options?.cause;
7
+ this.context = options?.context;
8
+ }
9
+ }
10
+ export const assertNonEmpty = (value, field) => {
11
+ if (!value || !value.trim()) {
12
+ throw new StatusServiceError("INVALID_ARGUMENTS", `\`${field}\` must be a non-empty string`, { context: { field } });
13
+ }
14
+ };
15
+ //# sourceMappingURL=logging.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.utils.js","sourceRoot":"","sources":["../../src/logging/logging.utils.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAK3C,YACE,IAAqB,EACrB,OAAe,EACf,OAAgE;QAEhE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,CAAC;IAClC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,KAAa,EAAQ,EAAE;IACnE,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAC5B,MAAM,IAAI,kBAAkB,CAC1B,mBAAmB,EACnB,KAAK,KAAK,+BAA+B,EACzC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CACvB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["export type StatusErrorCode =\r\n | \"INVALID_ARGUMENTS\"\r\n | \"PERSISTENCE_FAILED\"\r\n | \"REDIS_PUBLISH_FAILED\";\r\n\r\nexport class StatusServiceError extends Error {\r\n public readonly code: StatusErrorCode;\r\n public readonly cause?: unknown;\r\n public readonly context?: Record<string, unknown>;\r\n\r\n constructor(\r\n code: StatusErrorCode,\r\n message: string,\r\n options?: { cause?: unknown; context?: Record<string, unknown> },\r\n ) {\r\n super(message);\r\n this.name = \"StatusServiceError\";\r\n this.code = code;\r\n this.cause = options?.cause;\r\n this.context = options?.context;\r\n }\r\n}\r\n\r\nexport const assertNonEmpty = (value: string, field: string): void => {\r\n if (!value || !value.trim()) {\r\n throw new StatusServiceError(\r\n \"INVALID_ARGUMENTS\",\r\n `\\`${field}\\` must be a non-empty string`,\r\n { context: { field } },\r\n );\r\n }\r\n};\r\n"]}
@@ -0,0 +1,11 @@
1
+ export declare class SendStatusToRedis {
2
+ upstashClient: any;
3
+ constructor(upstashUrl: string, upstashToken: string);
4
+ sendStatusToRedis: (chatId: string, genId: string, event: {
5
+ event_type: string;
6
+ step?: string;
7
+ message?: string;
8
+ seq_num: number;
9
+ }) => Promise<void>;
10
+ }
11
+ //# sourceMappingURL=redis.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.service.d.ts","sourceRoot":"","sources":["../../src/logging/redis.service.ts"],"names":[],"mappings":"AAEA,qBAAa,iBAAiB;IACrB,aAAa,EAAE,GAAG,CAAC;gBACd,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAIpD,iBAAiB,GACf,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,OAAO;QACL,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,mBA0BD;CACH"}
@@ -0,0 +1,26 @@
1
+ import { redis } from "../lib/redis.js";
2
+ export class SendStatusToRedis {
3
+ constructor(upstashUrl, upstashToken) {
4
+ this.sendStatusToRedis = async (chatId, genId, event) => {
5
+ const streamKey = `chat:${chatId}:gen:${genId}:events`;
6
+ await this.upstashClient.xadd(streamKey, "*", {
7
+ event_type: event.event_type,
8
+ step: event.step ?? "",
9
+ message: event.message ?? "",
10
+ seq_num: event.seq_num.toString(),
11
+ }, {
12
+ trim: {
13
+ type: "MAXLEN",
14
+ threshold: 1000,
15
+ comparison: "=",
16
+ },
17
+ });
18
+ await this.upstashClient.hset(`chat:${chatId}:state:${genId}`, {
19
+ current_status: event.message,
20
+ last_seq: event.seq_num.toString(),
21
+ });
22
+ };
23
+ this.upstashClient = redis(upstashUrl, upstashToken);
24
+ }
25
+ }
26
+ //# sourceMappingURL=redis.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.service.js","sourceRoot":"","sources":["../../src/logging/redis.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,OAAO,iBAAiB;IAE5B,YAAY,UAAkB,EAAE,YAAoB;QAIpD,sBAAiB,GAAG,KAAK,EACvB,MAAc,EACd,KAAa,EACb,KAKC,EACD,EAAE;YACF,MAAM,SAAS,GAAG,QAAQ,MAAM,QAAQ,KAAK,SAAS,CAAC;YAEvD,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAC3B,SAAS,EACT,GAAG,EACH;gBACE,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE;gBACtB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE;gBAC5B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;aAClC,EACD;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,SAAS,EAAE,IAAI;oBACf,UAAU,EAAE,GAAG;iBAChB;aACF,CACF,CAAC;YAEF,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,MAAM,UAAU,KAAK,EAAE,EAAE;gBAC7D,cAAc,EAAE,KAAK,CAAC,OAAO;gBAC7B,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;aACnC,CAAC,CAAC;QACL,CAAC,CAAC;QArCA,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;CAqCF","sourcesContent":["import { redis } from \"../lib/redis.js\";\r\n\r\nexport class SendStatusToRedis {\r\n public upstashClient: any;\r\n constructor(upstashUrl: string, upstashToken: string) {\r\n this.upstashClient = redis(upstashUrl, upstashToken);\r\n }\r\n\r\n sendStatusToRedis = async (\r\n chatId: string,\r\n genId: string,\r\n event: {\r\n event_type: string;\r\n step?: string;\r\n message?: string;\r\n seq_num: number;\r\n },\r\n ) => {\r\n const streamKey = `chat:${chatId}:gen:${genId}:events`;\r\n\r\n await this.upstashClient.xadd(\r\n streamKey,\r\n \"*\",\r\n {\r\n event_type: event.event_type,\r\n step: event.step ?? \"\",\r\n message: event.message ?? \"\",\r\n seq_num: event.seq_num.toString(),\r\n },\r\n {\r\n trim: {\r\n type: \"MAXLEN\",\r\n threshold: 1000,\r\n comparison: \"=\",\r\n },\r\n },\r\n );\r\n\r\n await this.upstashClient.hset(`chat:${chatId}:state:${genId}`, {\r\n current_status: event.message,\r\n last_seq: event.seq_num.toString(),\r\n });\r\n };\r\n}\r\n"]}
@@ -0,0 +1,8 @@
1
+ import { CollectedContext } from "../types/context.types.js";
2
+ import { ProjectInfo } from "../types/projectInfo.types.js";
3
+ import { DBRepository } from "./repository.js";
4
+ export declare class ContextRepository extends DBRepository {
5
+ fetchCollectedContext(id: string): Promise<CollectedContext>;
6
+ updateProjectInfo(id: string, projectInfo: ProjectInfo): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=context.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.repository.d.ts","sourceRoot":"","sources":["../../src/repository/context.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,iBAAkB,SAAQ,YAAY;IAK3C,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA8C5D,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;CAS7D"}
@@ -0,0 +1,59 @@
1
+ import { defaultCollectedContext, } from "../types/context.types.js";
2
+ import { DBRepository } from "./repository.js";
3
+ export class ContextRepository extends DBRepository {
4
+ /*
5
+ * Table: project_context
6
+ * Use: Fetch collected context (READ)
7
+ */
8
+ async fetchCollectedContext(id) {
9
+ const supabase = this.client;
10
+ const { data, error } = await supabase
11
+ .from("project_context")
12
+ .select("collected_context")
13
+ .eq("id", id)
14
+ .maybeSingle();
15
+ if (error)
16
+ throw error;
17
+ if (!data) {
18
+ return defaultCollectedContext;
19
+ }
20
+ const raw = data.collected_context ?? {};
21
+ return {
22
+ projectIdentity: {
23
+ ...defaultCollectedContext.projectIdentity,
24
+ ...(raw.projectIdentity ?? {}),
25
+ },
26
+ targetBusinessContext: {
27
+ ...defaultCollectedContext.targetBusinessContext,
28
+ ...(raw.targetBusinessContext ?? {}),
29
+ },
30
+ branding: {
31
+ ...defaultCollectedContext.branding,
32
+ ...(raw.branding ?? {}),
33
+ },
34
+ functionalRequirements: {
35
+ ...defaultCollectedContext.functionalRequirements,
36
+ ...(raw.functionalRequirements ?? {}),
37
+ },
38
+ constraints: {
39
+ ...defaultCollectedContext.constraints,
40
+ ...(raw.constraints ?? {}),
41
+ },
42
+ otherInfo: raw.otherInfo ?? [],
43
+ };
44
+ }
45
+ /*
46
+ * Table: project_context
47
+ * Use: Update project info (WRITE)
48
+ */
49
+ async updateProjectInfo(id, projectInfo) {
50
+ const supabase = this.client;
51
+ const { error } = await supabase
52
+ .from("project_context")
53
+ .update({ project_info: projectInfo })
54
+ .eq("id", id);
55
+ if (error)
56
+ throw error;
57
+ }
58
+ }
59
+ //# sourceMappingURL=context.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.repository.js","sourceRoot":"","sources":["../../src/repository/context.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,GACxB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IACjD;;;OAGG;IACH,KAAK,CAAC,qBAAqB,CAAC,EAAU;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ;aACnC,IAAI,CAAC,iBAAiB,CAAC;aACvB,MAAM,CAAC,mBAAmB,CAAC;aAC3B,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;aACZ,WAAW,EAAE,CAAC;QAEjB,IAAI,KAAK;YAAE,MAAM,KAAK,CAAC;QAEvB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,uBAAuB,CAAC;QACjC,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,IAAI,EAAE,CAAC;QAEzC,OAAO;YACL,eAAe,EAAE;gBACf,GAAG,uBAAuB,CAAC,eAAe;gBAC1C,GAAG,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;aAC/B;YACD,qBAAqB,EAAE;gBACrB,GAAG,uBAAuB,CAAC,qBAAqB;gBAChD,GAAG,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC;aACrC;YACD,QAAQ,EAAE;gBACR,GAAG,uBAAuB,CAAC,QAAQ;gBACnC,GAAG,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;aACxB;YACD,sBAAsB,EAAE;gBACtB,GAAG,uBAAuB,CAAC,sBAAsB;gBACjD,GAAG,CAAC,GAAG,CAAC,sBAAsB,IAAI,EAAE,CAAC;aACtC;YACD,WAAW,EAAE;gBACX,GAAG,uBAAuB,CAAC,WAAW;gBACtC,GAAG,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;aAC3B;YACD,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE;SAC/B,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,iBAAiB,CAAC,EAAU,EAAE,WAAwB;QAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;QAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ;aAC7B,IAAI,CAAC,iBAAiB,CAAC;aACvB,MAAM,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;aACrC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAEhB,IAAI,KAAK;YAAE,MAAM,KAAK,CAAC;IACzB,CAAC;CACF","sourcesContent":["import {\r\n CollectedContext,\r\n defaultCollectedContext,\r\n} from \"../types/context.types.js\";\r\nimport { ProjectInfo } from \"../types/projectInfo.types.js\";\r\nimport { DBRepository } from \"./repository.js\";\r\n\r\nexport class ContextRepository extends DBRepository {\r\n /*\r\n * Table: project_context\r\n * Use: Fetch collected context (READ)\r\n */\r\n async fetchCollectedContext(id: string): Promise<CollectedContext> {\r\n const supabase = this.client;\r\n\r\n const { data, error } = await supabase\r\n .from(\"project_context\")\r\n .select(\"collected_context\")\r\n .eq(\"id\", id)\r\n .maybeSingle();\r\n\r\n if (error) throw error;\r\n\r\n if (!data) {\r\n return defaultCollectedContext;\r\n }\r\n\r\n const raw = data.collected_context ?? {};\r\n\r\n return {\r\n projectIdentity: {\r\n ...defaultCollectedContext.projectIdentity,\r\n ...(raw.projectIdentity ?? {}),\r\n },\r\n targetBusinessContext: {\r\n ...defaultCollectedContext.targetBusinessContext,\r\n ...(raw.targetBusinessContext ?? {}),\r\n },\r\n branding: {\r\n ...defaultCollectedContext.branding,\r\n ...(raw.branding ?? {}),\r\n },\r\n functionalRequirements: {\r\n ...defaultCollectedContext.functionalRequirements,\r\n ...(raw.functionalRequirements ?? {}),\r\n },\r\n constraints: {\r\n ...defaultCollectedContext.constraints,\r\n ...(raw.constraints ?? {}),\r\n },\r\n otherInfo: raw.otherInfo ?? [],\r\n };\r\n }\r\n\r\n /*\r\n * Table: project_context\r\n * Use: Update project info (WRITE)\r\n */\r\n async updateProjectInfo(id: string, projectInfo: ProjectInfo) {\r\n const supabase = this.client;\r\n const { error } = await supabase\r\n .from(\"project_context\")\r\n .update({ project_info: projectInfo })\r\n .eq(\"id\", id);\r\n\r\n if (error) throw error;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,13 @@
1
+ import { EventType, GenStep } from "../types/events.js";
2
+ import { DBRepository } from "./repository.js";
3
+ export type PersistedStatusEvent = {
4
+ event_type: string;
5
+ step?: string | null;
6
+ message?: string | null;
7
+ source?: string | null;
8
+ seq_num: number;
9
+ };
10
+ export declare class GenStatusRepository extends DBRepository {
11
+ persistStatusMessage(chatId: string, sessionId: string, eventType: EventType, step: GenStep, message: string, source: string): Promise<PersistedStatusEvent>;
12
+ }
13
+ //# sourceMappingURL=genStatus.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genStatus.repository.d.ts","sourceRoot":"","sources":["../../src/repository/genStatus.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,mBAAoB,SAAQ,YAAY;IAC7C,oBAAoB,CACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,oBAAoB,CAAC;CAqBjC"}
@@ -0,0 +1,18 @@
1
+ import { DBRepository } from "./repository.js";
2
+ export class GenStatusRepository extends DBRepository {
3
+ async persistStatusMessage(chatId, sessionId, eventType, step, message, source) {
4
+ const { data, error } = await this.client.rpc("persist_generation_event", {
5
+ p_conv_id: chatId,
6
+ p_gen_id: sessionId,
7
+ p_event_type: eventType,
8
+ p_step: step,
9
+ p_message: message,
10
+ p_source: source,
11
+ });
12
+ if (error) {
13
+ throw new Error(`Failed calling persist_generation_event RPC: ${error.message}`);
14
+ }
15
+ return data;
16
+ }
17
+ }
18
+ //# sourceMappingURL=genStatus.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genStatus.repository.js","sourceRoot":"","sources":["../../src/repository/genStatus.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IACnD,KAAK,CAAC,oBAAoB,CACxB,MAAc,EACd,SAAiB,EACjB,SAAoB,EACpB,IAAa,EACb,OAAe,EACf,MAAc;QAEd,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAC3C,0BAA0B,EAC1B;YACE,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,SAAS;YACvB,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE,MAAM;SACjB,CACF,CAAC;QAEF,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,gDAAgD,KAAK,CAAC,OAAO,EAAE,CAChE,CAAC;QACJ,CAAC;QAED,OAAO,IAA4B,CAAC;IACtC,CAAC;CACF","sourcesContent":["import { EventType, GenStep } from \"../types/events.js\";\nimport { DBRepository } from \"./repository.js\";\n\nexport type PersistedStatusEvent = {\n event_type: string;\n step?: string | null;\n message?: string | null;\n source?: string | null;\n seq_num: number;\n};\n\nexport class GenStatusRepository extends DBRepository {\n async persistStatusMessage(\n chatId: string,\n sessionId: string,\n eventType: EventType,\n step: GenStep,\n message: string,\n source: string\n ): Promise<PersistedStatusEvent> {\n const { data, error } = await this.client.rpc(\n \"persist_generation_event\",\n {\n p_conv_id: chatId,\n p_gen_id: sessionId,\n p_event_type: eventType,\n p_step: step,\n p_message: message,\n p_source: source,\n }\n );\n\n if (error) {\n throw new Error(\n `Failed calling persist_generation_event RPC: ${error.message}`\n );\n }\n\n return data as PersistedStatusEvent;\n }\n}"]}
@@ -0,0 +1,9 @@
1
+ import { Plan } from "../types/updatePlan.types.js";
2
+ import { DBRepository } from "./repository.js";
3
+ export declare class TaskPlansRepository extends DBRepository {
4
+ fetchPlanTasksById(planId: string): Promise<{
5
+ id: string;
6
+ tasks: Plan["tasks"];
7
+ }>;
8
+ }
9
+ //# sourceMappingURL=planTasks.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planTasks.repository.d.ts","sourceRoot":"","sources":["../../src/repository/planTasks.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,mBAAoB,SAAQ,YAAY;IAK7C,kBAAkB,CACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC;CAiBjD"}
@@ -0,0 +1,24 @@
1
+ import { DBRepository } from "./repository.js";
2
+ export class TaskPlansRepository extends DBRepository {
3
+ /*
4
+ * Table: project_tasks
5
+ * Use: Fetch plan tasks by id (Fetch)
6
+ */
7
+ async fetchPlanTasksById(planId) {
8
+ const supabase = this.client;
9
+ const { data, error } = await supabase
10
+ .from("project_tasks")
11
+ .select("id, content")
12
+ .eq("id", planId)
13
+ .single();
14
+ if (error)
15
+ throw error;
16
+ if (!data)
17
+ throw new Error("plan not found or unauthorized");
18
+ return {
19
+ id: data.id,
20
+ tasks: data.content,
21
+ };
22
+ }
23
+ }
24
+ //# sourceMappingURL=planTasks.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planTasks.repository.js","sourceRoot":"","sources":["../../src/repository/planTasks.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IACnD;;;OAGG;IACH,KAAK,CAAC,kBAAkB,CACtB,MAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ;aACnC,IAAI,CAAC,eAAe,CAAC;aACrB,MAAM,CAAC,aAAa,CAAC;aACrB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;aAChB,MAAM,EAAE,CAAC;QAEZ,IAAI,KAAK;YAAE,MAAM,KAAK,CAAC;QACvB,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAE7D,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,OAAO;SACpB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { Plan } from \"../types/updatePlan.types.js\";\r\nimport { DBRepository } from \"./repository.js\";\r\n\r\nexport class TaskPlansRepository extends DBRepository {\r\n /*\r\n * Table: project_tasks\r\n * Use: Fetch plan tasks by id (Fetch)\r\n */\r\n async fetchPlanTasksById(\r\n planId: string,\r\n ): Promise<{ id: string; tasks: Plan[\"tasks\"] }> {\r\n const supabase = this.client;\r\n\r\n const { data, error } = await supabase\r\n .from(\"project_tasks\")\r\n .select(\"id, content\")\r\n .eq(\"id\", planId)\r\n .single();\r\n\r\n if (error) throw error;\r\n if (!data) throw new Error(\"plan not found or unauthorized\");\r\n\r\n return {\r\n id: data.id,\r\n tasks: data.content,\r\n };\r\n }\r\n}\r\n"]}
@@ -0,0 +1,5 @@
1
+ export declare class DBRepository {
2
+ client: any;
3
+ constructor(sbEndpoint: string, sbSecret: string);
4
+ }
5
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/repository/repository.ts"],"names":[],"mappings":"AACA,qBAAa,YAAY;IAChB,MAAM,EAAE,GAAG,CAAC;gBACA,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAGxD"}
@@ -0,0 +1,7 @@
1
+ import { supabase } from "../lib/supabase.js";
2
+ export class DBRepository {
3
+ constructor(sbEndpoint, sbSecret) {
4
+ this.client = supabase(sbEndpoint, sbSecret);
5
+ }
6
+ }
7
+ //# sourceMappingURL=repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/repository/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,MAAM,OAAO,YAAY;IAEvB,YAAmB,UAAkB,EAAE,QAAgB;QACrD,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;CACF","sourcesContent":["import { supabase } from \"../lib/supabase.js\";\r\nexport class DBRepository {\r\n public client: any;\r\n public constructor(sbEndpoint: string, sbSecret: string) {\r\n this.client = supabase(sbEndpoint, sbSecret);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,64 @@
1
+ export declare const PROJECT_TYPE: {
2
+ LANDING_PAGE: string;
3
+ SAAS: string;
4
+ PORTFOLIO: string;
5
+ ECOMMERCE: string;
6
+ HOBBY: string;
7
+ };
8
+ export type ProjectType = (typeof PROJECT_TYPE)[keyof typeof PROJECT_TYPE];
9
+ export declare const BUSINESS_MODEL: {
10
+ SUBSCRIPTION: string;
11
+ ONE_TIME: string;
12
+ LEAD_GEN: string;
13
+ FREE: string;
14
+ };
15
+ export type BusinessModel = (typeof BUSINESS_MODEL)[keyof typeof BUSINESS_MODEL];
16
+ export declare const TONE: {
17
+ MODERN: string;
18
+ MINIMAL: string;
19
+ PLAYFUL: string;
20
+ TECHNICAL: string;
21
+ CASUAL: string;
22
+ VINTAGE: string;
23
+ };
24
+ export type Tone = (typeof TONE)[keyof typeof TONE];
25
+ export interface ProjectIdentity {
26
+ projectName: string;
27
+ projectType: ProjectType;
28
+ description: string;
29
+ }
30
+ export interface TargetBusinessContext {
31
+ targetAudience: string;
32
+ businessModel: BusinessModel;
33
+ industry: string;
34
+ geography: string;
35
+ }
36
+ export interface Branding {
37
+ tone: Tone;
38
+ brandKeywords: string[];
39
+ colorPreference: string[];
40
+ designStyle: string;
41
+ }
42
+ export interface FunctionalRequirements {
43
+ authenticationRequired: boolean;
44
+ roles: string[];
45
+ paymentRequired: boolean;
46
+ integrations: string[];
47
+ dashboardRequired: boolean;
48
+ }
49
+ export interface Constraints {
50
+ budgetConstraints: string;
51
+ timeline: string;
52
+ performanceRequirements: string;
53
+ seoRequired: boolean;
54
+ }
55
+ export interface CollectedContext {
56
+ projectIdentity: ProjectIdentity;
57
+ targetBusinessContext: TargetBusinessContext;
58
+ branding: Branding;
59
+ functionalRequirements: FunctionalRequirements;
60
+ constraints: Constraints;
61
+ otherInfo: string[];
62
+ }
63
+ export declare const defaultCollectedContext: CollectedContext;
64
+ //# sourceMappingURL=context.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.types.d.ts","sourceRoot":"","sources":["../../src/types/context.types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;;CAMxB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E,eAAO,MAAM,cAAc;;;;;CAK1B,CAAC;AAEF,MAAM,MAAM,aAAa,GACvB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD,eAAO,MAAM,IAAI;;;;;;;CAOhB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,OAAO,IAAI,CAAC,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,sBAAsB,EAAE,OAAO,CAAC;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,EAAE,QAAQ,CAAC;IACnB,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,uBAAuB,EAAE,gBAgCrC,CAAC"}
@@ -0,0 +1,55 @@
1
+ export const PROJECT_TYPE = {
2
+ LANDING_PAGE: "landing_page",
3
+ SAAS: "saas",
4
+ PORTFOLIO: "portfolio",
5
+ ECOMMERCE: "ecommerce",
6
+ HOBBY: "hobby",
7
+ };
8
+ export const BUSINESS_MODEL = {
9
+ SUBSCRIPTION: "subscription",
10
+ ONE_TIME: "one-time",
11
+ LEAD_GEN: "lead-gen",
12
+ FREE: "free",
13
+ };
14
+ export const TONE = {
15
+ MODERN: "modern",
16
+ MINIMAL: "minimal",
17
+ PLAYFUL: "playful",
18
+ TECHNICAL: "technical",
19
+ CASUAL: "casual",
20
+ VINTAGE: "vintage",
21
+ };
22
+ export const defaultCollectedContext = {
23
+ projectIdentity: {
24
+ projectName: "",
25
+ projectType: "landing_page",
26
+ description: "",
27
+ },
28
+ targetBusinessContext: {
29
+ targetAudience: "",
30
+ businessModel: "free",
31
+ industry: "",
32
+ geography: "",
33
+ },
34
+ branding: {
35
+ tone: "modern",
36
+ brandKeywords: [],
37
+ colorPreference: [],
38
+ designStyle: "",
39
+ },
40
+ functionalRequirements: {
41
+ authenticationRequired: false,
42
+ roles: [],
43
+ paymentRequired: false,
44
+ integrations: [],
45
+ dashboardRequired: false,
46
+ },
47
+ constraints: {
48
+ budgetConstraints: "",
49
+ timeline: "",
50
+ performanceRequirements: "",
51
+ seoRequired: false,
52
+ },
53
+ otherInfo: [],
54
+ };
55
+ //# sourceMappingURL=context.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.types.js","sourceRoot":"","sources":["../../src/types/context.types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,YAAY,EAAE,cAAc;IAC5B,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;CACf,CAAC;AAIF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;CACb,CAAC;AAKF,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAC;AAgDF,MAAM,CAAC,MAAM,uBAAuB,GAAqB;IACvD,eAAe,EAAE;QACf,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,EAAE;KAChB;IACD,qBAAqB,EAAE;QACrB,cAAc,EAAE,EAAE;QAClB,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;KACd;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE,EAAE;QACjB,eAAe,EAAE,EAAE;QACnB,WAAW,EAAE,EAAE;KAChB;IACD,sBAAsB,EAAE;QACtB,sBAAsB,EAAE,KAAK;QAC7B,KAAK,EAAE,EAAE;QACT,eAAe,EAAE,KAAK;QACtB,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,KAAK;KACzB;IACD,WAAW,EAAE;QACX,iBAAiB,EAAE,EAAE;QACrB,QAAQ,EAAE,EAAE;QACZ,uBAAuB,EAAE,EAAE;QAC3B,WAAW,EAAE,KAAK;KACnB;IACD,SAAS,EAAE,EAAE;CACd,CAAC","sourcesContent":["export const PROJECT_TYPE = {\r\n LANDING_PAGE: \"landing_page\",\r\n SAAS: \"saas\",\r\n PORTFOLIO: \"portfolio\",\r\n ECOMMERCE: \"ecommerce\",\r\n HOBBY: \"hobby\",\r\n};\r\n\r\nexport type ProjectType = (typeof PROJECT_TYPE)[keyof typeof PROJECT_TYPE];\r\n\r\nexport const BUSINESS_MODEL = {\r\n SUBSCRIPTION: \"subscription\",\r\n ONE_TIME: \"one-time\",\r\n LEAD_GEN: \"lead-gen\",\r\n FREE: \"free\",\r\n};\r\n\r\nexport type BusinessModel =\r\n (typeof BUSINESS_MODEL)[keyof typeof BUSINESS_MODEL];\r\n\r\nexport const TONE = {\r\n MODERN: \"modern\",\r\n MINIMAL: \"minimal\",\r\n PLAYFUL: \"playful\",\r\n TECHNICAL: \"technical\",\r\n CASUAL: \"casual\",\r\n VINTAGE: \"vintage\",\r\n};\r\n\r\nexport type Tone = (typeof TONE)[keyof typeof TONE];\r\n\r\nexport interface ProjectIdentity {\r\n projectName: string;\r\n projectType: ProjectType;\r\n description: string;\r\n}\r\n\r\nexport interface TargetBusinessContext {\r\n targetAudience: string;\r\n businessModel: BusinessModel;\r\n industry: string;\r\n geography: string;\r\n}\r\n\r\nexport interface Branding {\r\n tone: Tone;\r\n brandKeywords: string[];\r\n colorPreference: string[];\r\n designStyle: string;\r\n}\r\n\r\nexport interface FunctionalRequirements {\r\n authenticationRequired: boolean;\r\n roles: string[];\r\n paymentRequired: boolean;\r\n integrations: string[];\r\n dashboardRequired: boolean;\r\n}\r\n\r\nexport interface Constraints {\r\n budgetConstraints: string;\r\n timeline: string;\r\n performanceRequirements: string;\r\n seoRequired: boolean;\r\n}\r\n\r\nexport interface CollectedContext {\r\n projectIdentity: ProjectIdentity;\r\n targetBusinessContext: TargetBusinessContext;\r\n branding: Branding;\r\n functionalRequirements: FunctionalRequirements;\r\n constraints: Constraints;\r\n otherInfo: string[];\r\n}\r\n\r\nexport const defaultCollectedContext: CollectedContext = {\r\n projectIdentity: {\r\n projectName: \"\",\r\n projectType: \"landing_page\",\r\n description: \"\",\r\n },\r\n targetBusinessContext: {\r\n targetAudience: \"\",\r\n businessModel: \"free\",\r\n industry: \"\",\r\n geography: \"\",\r\n },\r\n branding: {\r\n tone: \"modern\",\r\n brandKeywords: [],\r\n colorPreference: [],\r\n designStyle: \"\",\r\n },\r\n functionalRequirements: {\r\n authenticationRequired: false,\r\n roles: [],\r\n paymentRequired: false,\r\n integrations: [],\r\n dashboardRequired: false,\r\n },\r\n constraints: {\r\n budgetConstraints: \"\",\r\n timeline: \"\",\r\n performanceRequirements: \"\",\r\n seoRequired: false,\r\n },\r\n otherInfo: [],\r\n};\r\n"]}
@@ -0,0 +1,16 @@
1
+ export declare const EVENT_TYPES: {
2
+ STEP_STARTED: string;
3
+ STEP_FINISHED: string;
4
+ STEP_ERROR: string;
5
+ STEP_RETRY: string;
6
+ GENERATION_COMPLETED: string;
7
+ GENERATION_FAILED: string;
8
+ };
9
+ export type EventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];
10
+ export declare const GEN_STEPS: {
11
+ INITIATING: string;
12
+ BUILDING: string;
13
+ DEPLOYING: string;
14
+ };
15
+ export type GenStep = (typeof GEN_STEPS)[keyof typeof GEN_STEPS];
16
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEvE,eAAO,MAAM,SAAS;;;;CAIrB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export const EVENT_TYPES = {
2
+ STEP_STARTED: "step_started",
3
+ STEP_FINISHED: "step_finished",
4
+ STEP_ERROR: "step_error",
5
+ STEP_RETRY: "step_retry",
6
+ GENERATION_COMPLETED: "generation_completed",
7
+ GENERATION_FAILED: "generation_failed",
8
+ };
9
+ export const GEN_STEPS = {
10
+ INITIATING: "initiating",
11
+ BUILDING: "building",
12
+ DEPLOYING: "deploying",
13
+ };
14
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,oBAAoB,EAAE,sBAAsB;IAC5C,iBAAiB,EAAE,mBAAmB;CACvC,CAAC;AAIF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;CACvB,CAAC","sourcesContent":["export const EVENT_TYPES = {\r\n STEP_STARTED: \"step_started\",\r\n STEP_FINISHED: \"step_finished\",\r\n STEP_ERROR: \"step_error\",\r\n STEP_RETRY: \"step_retry\",\r\n GENERATION_COMPLETED: \"generation_completed\",\r\n GENERATION_FAILED: \"generation_failed\",\r\n};\r\n\r\nexport type EventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];\r\n\r\nexport const GEN_STEPS = {\r\n INITIATING: \"initiating\",\r\n BUILDING: \"building\",\r\n DEPLOYING: \"deploying\",\r\n};\r\n\r\nexport type GenStep = (typeof GEN_STEPS)[keyof typeof GEN_STEPS];"]}