genaicode 0.6.1 → 0.8.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 (261) hide show
  1. package/README.md +0 -2
  2. package/dist/ai-service/ai-studio.js +7 -1
  3. package/dist/ai-service/ai-studio.js.map +1 -1
  4. package/dist/ai-service/anthropic.js +49 -19
  5. package/dist/ai-service/anthropic.js.map +1 -1
  6. package/dist/ai-service/chat-gpt.js +28 -11
  7. package/dist/ai-service/chat-gpt.js.map +1 -1
  8. package/dist/ai-service/common.d.ts +5 -4
  9. package/dist/ai-service/common.js +3 -4
  10. package/dist/ai-service/common.js.map +1 -1
  11. package/dist/ai-service/common.test.js +1 -1
  12. package/dist/ai-service/vertex-ai-claude.js +1 -1
  13. package/dist/ai-service/vertex-ai-claude.js.map +1 -1
  14. package/dist/ai-service/vertex-ai.js +7 -1
  15. package/dist/ai-service/vertex-ai.js.map +1 -1
  16. package/dist/cli/cli-options.js +0 -12
  17. package/dist/cli/cli-options.js.map +1 -1
  18. package/dist/cli/cli-params.d.ts +1 -4
  19. package/dist/cli/cli-params.js +1 -10
  20. package/dist/cli/cli-params.js.map +1 -1
  21. package/dist/cli/validate-cli-params.js +1 -7
  22. package/dist/cli/validate-cli-params.js.map +1 -1
  23. package/dist/cli/validate-cli-params.test.js +1 -1
  24. package/dist/cli/validate-cli-params.test.js.map +1 -1
  25. package/dist/eval/codegen-summary.test.d.ts +1 -0
  26. package/dist/eval/codegen-summary.test.js +93 -0
  27. package/dist/eval/codegen-summary.test.js.map +1 -0
  28. package/dist/eval/current-prompt-plugin.d.ts +3 -0
  29. package/dist/eval/current-prompt-plugin.js +10 -0
  30. package/dist/eval/current-prompt-plugin.js.map +1 -0
  31. package/dist/eval/data/current-prompt.d.ts +34 -0
  32. package/dist/eval/data/current-prompt.js +59 -0
  33. package/dist/eval/data/current-prompt.js.map +1 -0
  34. package/dist/eval/data/prompt-assistant-image.d.ts +49 -0
  35. package/dist/eval/data/prompt-assistant-image.js +67 -0
  36. package/dist/eval/data/prompt-assistant-image.js.map +1 -0
  37. package/dist/eval/data/prompt3.d.ts +34 -0
  38. package/dist/eval/data/prompt3.js +71 -0
  39. package/dist/eval/data/prompt3.js.map +1 -0
  40. package/dist/eval/prompt-debug.test.d.ts +1 -0
  41. package/dist/eval/prompt-debug.test.js +76 -0
  42. package/dist/eval/prompt-debug.test.js.map +1 -0
  43. package/dist/eval/prompt2.d.ts +34 -0
  44. package/dist/eval/prompt2.js +125 -0
  45. package/dist/eval/prompt2.js.map +1 -0
  46. package/dist/files/read-files.d.ts +29 -6
  47. package/dist/files/read-files.js +31 -10
  48. package/dist/files/read-files.js.map +1 -1
  49. package/dist/files/read-files.test.js +15 -9
  50. package/dist/files/read-files.test.js.map +1 -1
  51. package/dist/files/source-code-tree.d.ts +17 -0
  52. package/dist/files/source-code-tree.js +70 -0
  53. package/dist/files/source-code-tree.js.map +1 -0
  54. package/dist/main/codegen-types.d.ts +8 -5
  55. package/dist/main/codegen.ai-services.test.d.ts +3 -0
  56. package/dist/main/codegen.ai-services.test.js +198 -0
  57. package/dist/main/codegen.ai-services.test.js.map +1 -0
  58. package/dist/main/codegen.cli-options.test.d.ts +3 -0
  59. package/dist/main/codegen.cli-options.test.js +171 -0
  60. package/dist/main/codegen.cli-options.test.js.map +1 -0
  61. package/dist/main/codegen.image-generation.test.d.ts +3 -0
  62. package/dist/main/codegen.image-generation.test.js +187 -0
  63. package/dist/main/codegen.image-generation.test.js.map +1 -0
  64. package/dist/main/codegen.js +2 -5
  65. package/dist/main/codegen.js.map +1 -1
  66. package/dist/main/codegen.test-utils.d.ts +81 -0
  67. package/dist/main/codegen.test-utils.js +88 -0
  68. package/dist/main/codegen.test-utils.js.map +1 -0
  69. package/dist/main/codegen.test.js +47 -28
  70. package/dist/main/codegen.test.js.map +1 -1
  71. package/dist/main/common/content-bus-types.d.ts +6 -0
  72. package/dist/main/common/content-bus.d.ts +2 -2
  73. package/dist/main/common/content-bus.js +3 -1
  74. package/dist/main/common/content-bus.js.map +1 -1
  75. package/dist/main/common/user-actions.d.ts +8 -2
  76. package/dist/main/common/user-actions.js.map +1 -1
  77. package/dist/main/config-lib.js +20 -2
  78. package/dist/main/config-lib.js.map +1 -1
  79. package/dist/main/config.js +4 -28
  80. package/dist/main/config.js.map +1 -1
  81. package/dist/main/interactive/codegen-interactive.js +0 -4
  82. package/dist/main/interactive/codegen-interactive.js.map +1 -1
  83. package/dist/main/interactive/codegen-interactive.test.js +1 -7
  84. package/dist/main/interactive/codegen-interactive.test.js.map +1 -1
  85. package/dist/main/interactive/common.d.ts +1 -1
  86. package/dist/main/interactive/common.js +0 -2
  87. package/dist/main/interactive/common.js.map +1 -1
  88. package/dist/main/interactive/configure.js +0 -2
  89. package/dist/main/interactive/configure.js.map +1 -1
  90. package/dist/main/interactive/help.js +0 -2
  91. package/dist/main/interactive/help.js.map +1 -1
  92. package/dist/main/interactive/task-file.js +1 -1
  93. package/dist/main/interactive/task-file.js.map +1 -1
  94. package/dist/main/interactive/text-prompt.js +1 -1
  95. package/dist/main/interactive/text-prompt.js.map +1 -1
  96. package/dist/main/interactive/user-action-handlers.js +4 -2
  97. package/dist/main/interactive/user-action-handlers.js.map +1 -1
  98. package/dist/main/plugin-loader.d.ts +7 -1
  99. package/dist/main/plugin-loader.js +61 -0
  100. package/dist/main/plugin-loader.js.map +1 -1
  101. package/dist/main/ui/backend/api.js +9 -3
  102. package/dist/main/ui/backend/api.js.map +1 -1
  103. package/dist/main/ui/backend/service.d.ts +2 -1
  104. package/dist/main/ui/backend/service.js +6 -3
  105. package/dist/main/ui/backend/service.js.map +1 -1
  106. package/dist/main/ui/frontend/assets/index-QOcNx5ac.js +812 -0
  107. package/dist/main/ui/frontend/index.html +1 -1
  108. package/dist/main/ui/user-action-handlers.js +1 -1
  109. package/dist/main/ui/user-action-handlers.js.map +1 -1
  110. package/dist/project-profiles/detection.d.ts +40 -0
  111. package/dist/project-profiles/detection.js +131 -0
  112. package/dist/project-profiles/detection.js.map +1 -0
  113. package/dist/project-profiles/index.d.ts +35 -0
  114. package/dist/project-profiles/index.js +72 -0
  115. package/dist/project-profiles/index.js.map +1 -0
  116. package/dist/project-profiles/profiles/golang.d.ts +65 -0
  117. package/dist/project-profiles/profiles/golang.js +208 -0
  118. package/dist/project-profiles/profiles/golang.js.map +1 -0
  119. package/dist/project-profiles/profiles/java-maven.d.ts +80 -0
  120. package/dist/project-profiles/profiles/java-maven.js +165 -0
  121. package/dist/project-profiles/profiles/java-maven.js.map +1 -0
  122. package/dist/project-profiles/profiles/javascript-npm.d.ts +40 -0
  123. package/dist/project-profiles/profiles/javascript-npm.js +118 -0
  124. package/dist/project-profiles/profiles/javascript-npm.js.map +1 -0
  125. package/dist/project-profiles/profiles/javascript-react.d.ts +46 -0
  126. package/dist/project-profiles/profiles/javascript-react.js +147 -0
  127. package/dist/project-profiles/profiles/javascript-react.js.map +1 -0
  128. package/dist/project-profiles/profiles/python-django.d.ts +58 -0
  129. package/dist/project-profiles/profiles/python-django.js +200 -0
  130. package/dist/project-profiles/profiles/python-django.js.map +1 -0
  131. package/dist/project-profiles/types.d.ts +122 -0
  132. package/dist/project-profiles/types.js +77 -0
  133. package/dist/project-profiles/types.js.map +1 -0
  134. package/dist/prompt/function-calling.js +8 -3
  135. package/dist/prompt/function-calling.js.map +1 -1
  136. package/dist/prompt/function-defs/ask-question.d.ts +5 -0
  137. package/dist/prompt/function-defs/ask-question.js +140 -60
  138. package/dist/prompt/function-defs/ask-question.js.map +1 -1
  139. package/dist/prompt/function-defs/codegen-planning.d.ts +8 -0
  140. package/dist/prompt/function-defs/codegen-planning.js +50 -0
  141. package/dist/prompt/function-defs/codegen-planning.js.map +1 -0
  142. package/dist/prompt/function-defs/codegen-summary.js +2 -2
  143. package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
  144. package/dist/prompt/function-defs/get-source-code.js +32 -2
  145. package/dist/prompt/function-defs/get-source-code.js.map +1 -1
  146. package/dist/prompt/function-defs/optimize-context.js +35 -12
  147. package/dist/prompt/function-defs/optimize-context.js.map +1 -1
  148. package/dist/prompt/function-defs/set-summaries.js +20 -1
  149. package/dist/prompt/function-defs/set-summaries.js.map +1 -1
  150. package/dist/prompt/limits.js +2 -2
  151. package/dist/prompt/limits.js.map +1 -1
  152. package/dist/prompt/limits.test.js +3 -3
  153. package/dist/prompt/limits.test.js.map +1 -1
  154. package/dist/prompt/prompt-codegen.js +7 -79
  155. package/dist/prompt/prompt-codegen.js.map +1 -1
  156. package/dist/prompt/prompt-codegen.test.js +8 -14
  157. package/dist/prompt/prompt-codegen.test.js.map +1 -1
  158. package/dist/prompt/prompt-service-ask-question.test.js +27 -80
  159. package/dist/prompt/prompt-service-ask-question.test.js.map +1 -1
  160. package/dist/prompt/prompt-service.ai-services.test.d.ts +1 -0
  161. package/dist/prompt/prompt-service.ai-services.test.js +149 -0
  162. package/dist/prompt/prompt-service.ai-services.test.js.map +1 -0
  163. package/dist/prompt/prompt-service.context-optimization.test.d.ts +1 -0
  164. package/dist/prompt/prompt-service.context-optimization.test.js +212 -0
  165. package/dist/prompt/prompt-service.context-optimization.test.js.map +1 -0
  166. package/dist/prompt/prompt-service.image-handling.test.d.ts +1 -0
  167. package/dist/prompt/prompt-service.image-handling.test.js +212 -0
  168. package/dist/prompt/prompt-service.image-handling.test.js.map +1 -0
  169. package/dist/prompt/prompt-service.js +41 -127
  170. package/dist/prompt/prompt-service.js.map +1 -1
  171. package/dist/prompt/prompt-service.test-utils.d.ts +66 -0
  172. package/dist/prompt/prompt-service.test-utils.js +169 -0
  173. package/dist/prompt/prompt-service.test-utils.js.map +1 -0
  174. package/dist/prompt/prompt-service.test.js +96 -20
  175. package/dist/prompt/prompt-service.test.js.map +1 -1
  176. package/dist/prompt/prompt-service.validation-recovery.test.d.ts +1 -0
  177. package/dist/prompt/prompt-service.validation-recovery.test.js +263 -0
  178. package/dist/prompt/prompt-service.validation-recovery.test.js.map +1 -0
  179. package/dist/prompt/static-prompts.d.ts +16 -0
  180. package/dist/prompt/static-prompts.js +22 -0
  181. package/dist/prompt/static-prompts.js.map +1 -0
  182. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js +1 -3
  183. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +1 -1
  184. package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts +2 -0
  185. package/dist/prompt/steps/step-ask-question/handlers/code-generation.js +58 -0
  186. package/dist/prompt/steps/step-ask-question/handlers/code-generation.js.map +1 -0
  187. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts +1 -1
  188. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +8 -7
  189. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +1 -1
  190. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js +6 -6
  191. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js.map +1 -1
  192. package/dist/prompt/steps/step-ask-question/handlers/default-action.js +1 -4
  193. package/dist/prompt/steps/step-ask-question/handlers/default-action.js.map +1 -1
  194. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.d.ts +2 -0
  195. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js +86 -0
  196. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js.map +1 -0
  197. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts +2 -0
  198. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.js +97 -0
  199. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.js.map +1 -0
  200. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.d.ts +2 -0
  201. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js +20 -0
  202. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js.map +1 -0
  203. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.d.ts +0 -0
  204. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js +2 -0
  205. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js.map +1 -0
  206. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts +1 -1
  207. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +57 -15
  208. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +1 -1
  209. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +1 -1
  210. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +109 -12
  211. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js.map +1 -1
  212. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.d.ts +1 -1
  213. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js +48 -26
  214. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js.map +1 -1
  215. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js +1 -1
  216. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +1 -1
  217. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js +1 -0
  218. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +1 -1
  219. package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +25 -21
  220. package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts +2 -5
  221. package/dist/prompt/steps/step-ask-question/step-ask-question.js +36 -33
  222. package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
  223. package/dist/prompt/steps/step-codegen-planning.d.ts +10 -0
  224. package/dist/prompt/steps/step-codegen-planning.js +69 -0
  225. package/dist/prompt/steps/step-codegen-planning.js.map +1 -0
  226. package/dist/prompt/steps/step-codegen-summary.d.ts +7 -0
  227. package/dist/prompt/steps/step-codegen-summary.js +106 -0
  228. package/dist/prompt/steps/step-codegen-summary.js.map +1 -0
  229. package/dist/prompt/steps/step-codegen-summary.test.d.ts +1 -0
  230. package/dist/prompt/steps/step-codegen-summary.test.js +136 -0
  231. package/dist/prompt/steps/step-codegen-summary.test.js.map +1 -0
  232. package/dist/prompt/steps/step-context-optimization.js +243 -126
  233. package/dist/prompt/steps/step-context-optimization.js.map +1 -1
  234. package/dist/prompt/steps/step-context-optimization.test.d.ts +2 -0
  235. package/dist/prompt/steps/step-context-optimization.test.js +475 -0
  236. package/dist/prompt/steps/step-context-optimization.test.js.map +1 -0
  237. package/dist/prompt/steps/step-ensure-context.d.ts +15 -0
  238. package/dist/prompt/steps/step-ensure-context.js +102 -0
  239. package/dist/prompt/steps/step-ensure-context.js.map +1 -0
  240. package/dist/prompt/steps/step-ensure-context.test.d.ts +1 -0
  241. package/dist/prompt/steps/step-ensure-context.test.js +242 -0
  242. package/dist/prompt/steps/step-ensure-context.test.js.map +1 -0
  243. package/dist/prompt/steps/step-generate-image.d.ts +8 -1
  244. package/dist/prompt/steps/step-generate-image.js +1 -0
  245. package/dist/prompt/steps/step-generate-image.js.map +1 -1
  246. package/dist/prompt/steps/step-summarization.d.ts +2 -2
  247. package/dist/prompt/steps/step-summarization.js +45 -9
  248. package/dist/prompt/steps/step-summarization.js.map +1 -1
  249. package/dist/prompt/steps/step-validate-recover.js +24 -15
  250. package/dist/prompt/steps/step-validate-recover.js.map +1 -1
  251. package/dist/prompt/steps/steps-types.d.ts +2 -0
  252. package/dist/prompt/steps/steps-types.js.map +1 -1
  253. package/dist/prompt/systemprompt.d.ts +2 -2
  254. package/dist/prompt/systemprompt.js +74 -176
  255. package/dist/prompt/systemprompt.js.map +1 -1
  256. package/dist/prompt/systemprompt.test.js +4 -5
  257. package/dist/prompt/systemprompt.test.js.map +1 -1
  258. package/dist/vite-genaicode/vite-genaicode-plugin.js +0 -2
  259. package/dist/vite-genaicode/vite-genaicode-plugin.js.map +1 -1
  260. package/package.json +6 -2
  261. package/dist/main/ui/frontend/assets/index-Dk_qaEQg.js +0 -782
@@ -7,7 +7,7 @@
7
7
  <meta name="keywords" content="GenAIcode, AI, code generation, programming" />
8
8
  <title>GenAIcode - AI-Powered Code Generation</title>
9
9
  <link rel="icon" href="/favicon.ico" type="image/x-icon" />
10
- <script type="module" crossorigin src="/assets/index-Dk_qaEQg.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-QOcNx5ac.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-S_ocA1xG.css">
12
12
  </head>
13
13
  <body data-security-token="__SECURITY_TOKEN__">
@@ -1,6 +1,6 @@
1
1
  import { registerConfirmHandler, registerInputHandler } from '../common/user-actions.js';
2
2
  export function registerUserActionHandlers(service) {
3
- registerInputHandler((_, message) => service.askQuestion(message, undefined).then((response) => response.answer));
3
+ registerInputHandler((_, message) => service.askQuestion(message, undefined));
4
4
  registerConfirmHandler(async (props) => {
5
5
  const response = await service.askQuestion(props.prompt, {
6
6
  defaultValue: props.defaultValue,
@@ -1 +1 @@
1
- {"version":3,"file":"user-action-handlers.js","sourceRoot":"","sources":["../../../src/main/ui/user-action-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGzF,MAAM,UAAU,0BAA0B,CAAC,OAAgB;IACzD,oBAAoB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACrC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE;YACvD,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"user-action-handlers.js","sourceRoot":"","sources":["../../../src/main/ui/user-action-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGzF,MAAM,UAAU,0BAA0B,CAAC,OAAgB;IACzD,oBAAoB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IAC9E,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACrC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE;YACvD,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { ProjectProfile, ProfileDetectionResult } from './types.js';
2
+ /**
3
+ * Check if a file exists in the given directory
4
+ */
5
+ declare function fileExists(rootDir: string, filePath: string): Promise<boolean>;
6
+ /**
7
+ * Check if any of the files exist in the given directory
8
+ */
9
+ declare function anyFileExists(rootDir: string, filePaths: string[]): Promise<boolean>;
10
+ /**
11
+ * Recursively find files matching patterns in directory and subdirectories
12
+ * @param rootDir - The root directory to start searching from
13
+ * @param patterns - Array of file patterns to match (e.g., ['main.go', 'go.sum'])
14
+ * @param ignoreDirs - Optional array of directory names to ignore (e.g., ['vendor', 'node_modules'])
15
+ * @returns Array of found file paths relative to rootDir
16
+ */
17
+ declare function findFilesRecursively(rootDir: string, patterns: string[], ignoreDirs?: string[]): Promise<string[]>;
18
+ /**
19
+ * Check if any files matching patterns exist in directory or its subdirectories
20
+ * @param rootDir - The root directory to start searching from
21
+ * @param patterns - Array of file patterns to match
22
+ * @param ignoreDirs - Optional array of directory names to ignore
23
+ * @returns true if any matching file is found
24
+ */
25
+ declare function anyFileExistsRecursively(rootDir: string, patterns: string[], ignoreDirs?: string[]): Promise<boolean>;
26
+ /**
27
+ * Detect the project profile with the highest weight
28
+ */
29
+ export declare function detectProjectProfile(rootDir: string, profiles: ProjectProfile[]): Promise<ProfileDetectionResult>;
30
+ /**
31
+ * Initialize the selected profile
32
+ */
33
+ export declare function initializeProfile(rootDir: string, detectionResult: ProfileDetectionResult): Promise<ProfileDetectionResult>;
34
+ export declare const profileUtils: {
35
+ readonly fileExists: typeof fileExists;
36
+ readonly anyFileExists: typeof anyFileExists;
37
+ readonly findFilesRecursively: typeof findFilesRecursively;
38
+ readonly anyFileExistsRecursively: typeof anyFileExistsRecursively;
39
+ };
40
+ export {};
@@ -0,0 +1,131 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ /**
4
+ * Check if a file exists in the given directory
5
+ */
6
+ async function fileExists(rootDir, filePath) {
7
+ try {
8
+ await fs.promises.access(path.join(rootDir, filePath));
9
+ return true;
10
+ }
11
+ catch {
12
+ return false;
13
+ }
14
+ }
15
+ /**
16
+ * Check if any of the files exist in the given directory
17
+ */
18
+ async function anyFileExists(rootDir, filePaths) {
19
+ const results = await Promise.all(filePaths.map((file) => fileExists(rootDir, file)));
20
+ return results.some((exists) => exists);
21
+ }
22
+ /**
23
+ * Recursively find files matching patterns in directory and subdirectories
24
+ * @param rootDir - The root directory to start searching from
25
+ * @param patterns - Array of file patterns to match (e.g., ['main.go', 'go.sum'])
26
+ * @param ignoreDirs - Optional array of directory names to ignore (e.g., ['vendor', 'node_modules'])
27
+ * @returns Array of found file paths relative to rootDir
28
+ */
29
+ async function findFilesRecursively(rootDir, patterns, ignoreDirs = []) {
30
+ const foundFiles = [];
31
+ async function searchDirectory(currentDir) {
32
+ try {
33
+ const entries = await fs.promises.readdir(currentDir, { withFileTypes: true });
34
+ for (const entry of entries) {
35
+ const fullPath = path.join(currentDir, entry.name);
36
+ const relativePath = path.relative(rootDir, fullPath);
37
+ // Skip ignored directories
38
+ if (entry.isDirectory()) {
39
+ if (!ignoreDirs.includes(entry.name)) {
40
+ await searchDirectory(fullPath);
41
+ }
42
+ continue;
43
+ }
44
+ // Check if file matches any pattern
45
+ if (patterns.includes(entry.name)) {
46
+ foundFiles.push(relativePath);
47
+ }
48
+ }
49
+ }
50
+ catch (error) {
51
+ console.error(`Error reading directory ${currentDir}:`, error);
52
+ }
53
+ }
54
+ await searchDirectory(rootDir);
55
+ return foundFiles;
56
+ }
57
+ /**
58
+ * Check if any files matching patterns exist in directory or its subdirectories
59
+ * @param rootDir - The root directory to start searching from
60
+ * @param patterns - Array of file patterns to match
61
+ * @param ignoreDirs - Optional array of directory names to ignore
62
+ * @returns true if any matching file is found
63
+ */
64
+ async function anyFileExistsRecursively(rootDir, patterns, ignoreDirs = []) {
65
+ const files = await findFilesRecursively(rootDir, patterns, ignoreDirs);
66
+ return files.length > 0;
67
+ }
68
+ /**
69
+ * Detect the project profile with the highest weight
70
+ */
71
+ export async function detectProjectProfile(rootDir, profiles) {
72
+ // Run detection for all profiles
73
+ const detectionResults = await Promise.all(profiles.map(async (profile) => {
74
+ try {
75
+ const matches = await profile.detect(rootDir);
76
+ return {
77
+ profile: matches ? profile : null,
78
+ weight: matches ? profile.detectionWeight : 0,
79
+ };
80
+ }
81
+ catch (error) {
82
+ console.error(`Error detecting profile ${profile.id}:`, error);
83
+ return {
84
+ profile: null,
85
+ weight: 0,
86
+ };
87
+ }
88
+ }));
89
+ // Filter out non-matches and sort by weight (descending)
90
+ const matches = detectionResults
91
+ .filter((result) => result.profile !== null)
92
+ .sort((a, b) => b.weight - a.weight);
93
+ // If we have matches, return the highest weight match
94
+ if (matches.length > 0) {
95
+ const bestMatch = matches[0];
96
+ if (matches.length > 1) {
97
+ console.log(`Multiple matching profiles found. Selected "${bestMatch.profile?.name}" (weight: ${bestMatch.weight}) over:`, matches
98
+ .slice(1)
99
+ .map((match) => `"${match.profile?.name}" (weight: ${match.weight})`)
100
+ .join(', '));
101
+ }
102
+ return bestMatch;
103
+ }
104
+ // No matches found
105
+ return {
106
+ profile: null,
107
+ weight: 0,
108
+ };
109
+ }
110
+ /**
111
+ * Initialize the selected profile
112
+ */
113
+ export async function initializeProfile(rootDir, detectionResult) {
114
+ if (detectionResult.profile?.initialize) {
115
+ try {
116
+ await detectionResult.profile.initialize(rootDir);
117
+ }
118
+ catch (error) {
119
+ console.error(`Error initializing profile ${detectionResult.profile.id}:`, error);
120
+ }
121
+ }
122
+ return detectionResult;
123
+ }
124
+ // Export utility functions for profile implementations
125
+ export const profileUtils = {
126
+ fileExists,
127
+ anyFileExists,
128
+ findFilesRecursively,
129
+ anyFileExistsRecursively,
130
+ };
131
+ //# sourceMappingURL=detection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detection.js","sourceRoot":"","sources":["../../src/project-profiles/detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB;;GAEG;AACH,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,QAAgB;IACzD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,aAAa,CAAC,OAAe,EAAE,SAAmB;IAC/D,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACtF,OAAO,OAAO,CAAC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C,EAAE,CAAC;QACvB,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CACT,+CAA+C,SAAS,CAAC,OAAO,EAAE,IAAI,cAAc,SAAS,CAAC,MAAM,SAAS,EAC7G,OAAO;iBACJ,KAAK,CAAC,CAAC,CAAC;iBACR,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,IAAI,cAAc,KAAK,CAAC,MAAM,GAAG,CAAC;iBACpE,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,mBAAmB;IACnB,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAe,EACf,eAAuC;IAEvC,IAAI,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;QACxC,IAAI,CAAC;YACH,MAAM,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,uDAAuD;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU;IACV,aAAa;IACb,oBAAoB;IACpB,wBAAwB;CAChB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Project Profiles System for GenAIcode
3
+ *
4
+ * This module provides project type detection and configuration management
5
+ * for different types of projects. It includes default profiles for common
6
+ * project types and supports custom profiles through plugins.
7
+ */
8
+ import { ProjectProfile, ProfileDetectionResult, ProjectProfilePlugin, PROJECT_FILE_PATTERNS, DETECTION_WEIGHTS, DEFAULT_EXTENSIONS, DEFAULT_IGNORE_PATHS } from './types.js';
9
+ import { profileUtils } from './detection.js';
10
+ import { npmProfile } from './profiles/javascript-npm.js';
11
+ import { reactProfile } from './profiles/javascript-react.js';
12
+ import { mavenProfile } from './profiles/java-maven.js';
13
+ import { golangProfile } from './profiles/golang.js';
14
+ import { djangoProfile } from './profiles/python-django.js';
15
+ /**
16
+ * Register a project profile
17
+ */
18
+ declare function registerProfile(profile: ProjectProfile): void;
19
+ /**
20
+ * Get a registered profile by ID
21
+ */
22
+ declare function getProfile(id: string): ProjectProfile | undefined;
23
+ /**
24
+ * Get all registered profiles
25
+ */
26
+ declare function getAllProfiles(): ProjectProfile[];
27
+ /**
28
+ * Register a project profile plugin
29
+ */
30
+ declare function registerProfilePlugin(plugin: ProjectProfilePlugin): void;
31
+ /**
32
+ * Main function to detect and configure project profile
33
+ */
34
+ declare function detectAndConfigureProfile(rootDir: string): Promise<ProfileDetectionResult>;
35
+ export { ProjectProfile, ProfileDetectionResult, ProjectProfilePlugin, PROJECT_FILE_PATTERNS, DETECTION_WEIGHTS, DEFAULT_EXTENSIONS, DEFAULT_IGNORE_PATHS, detectAndConfigureProfile, registerProfile, registerProfilePlugin, getProfile, getAllProfiles, npmProfile, reactProfile, mavenProfile, golangProfile, djangoProfile, profileUtils, };
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Project Profiles System for GenAIcode
3
+ *
4
+ * This module provides project type detection and configuration management
5
+ * for different types of projects. It includes default profiles for common
6
+ * project types and supports custom profiles through plugins.
7
+ */
8
+ import { PROJECT_FILE_PATTERNS, DETECTION_WEIGHTS, DEFAULT_EXTENSIONS, DEFAULT_IGNORE_PATHS, } from './types.js';
9
+ import { detectProjectProfile, initializeProfile, profileUtils } from './detection.js';
10
+ // Import default profiles
11
+ import { npmProfile } from './profiles/javascript-npm.js';
12
+ import { reactProfile } from './profiles/javascript-react.js';
13
+ import { mavenProfile } from './profiles/java-maven.js';
14
+ import { golangProfile } from './profiles/golang.js';
15
+ import { djangoProfile } from './profiles/python-django.js';
16
+ // Simple array to store all available profiles
17
+ const profiles = [];
18
+ /**
19
+ * Register a project profile
20
+ */
21
+ function registerProfile(profile) {
22
+ const existingIndex = profiles.findIndex((p) => p.id === profile.id);
23
+ if (existingIndex !== -1) {
24
+ console.warn(`Warning: Profile with ID "${profile.id}" is already registered. Overwriting...`);
25
+ profiles[existingIndex] = profile;
26
+ }
27
+ else {
28
+ profiles.push(profile);
29
+ }
30
+ }
31
+ /**
32
+ * Get a registered profile by ID
33
+ */
34
+ function getProfile(id) {
35
+ return profiles.find((profile) => profile.id === id);
36
+ }
37
+ /**
38
+ * Get all registered profiles
39
+ */
40
+ function getAllProfiles() {
41
+ return [...profiles];
42
+ }
43
+ /**
44
+ * Register a project profile plugin
45
+ */
46
+ function registerProfilePlugin(plugin) {
47
+ plugin.profiles.forEach(registerProfile);
48
+ }
49
+ // Register default profiles
50
+ [npmProfile, reactProfile, mavenProfile, golangProfile, djangoProfile].forEach(registerProfile);
51
+ /**
52
+ * Main function to detect and configure project profile
53
+ */
54
+ async function detectAndConfigureProfile(rootDir) {
55
+ const detectionResult = await detectProjectProfile(rootDir, getAllProfiles());
56
+ if (detectionResult.profile) {
57
+ // Initialize the profile
58
+ await initializeProfile(rootDir, detectionResult);
59
+ }
60
+ return detectionResult;
61
+ }
62
+ // Export everything needed by other modules
63
+ export {
64
+ // Constants
65
+ PROJECT_FILE_PATTERNS, DETECTION_WEIGHTS, DEFAULT_EXTENSIONS, DEFAULT_IGNORE_PATHS,
66
+ // Core functions
67
+ detectAndConfigureProfile, registerProfile, registerProfilePlugin, getProfile, getAllProfiles,
68
+ // Default profiles
69
+ npmProfile, reactProfile, mavenProfile, golangProfile, djangoProfile,
70
+ // Utilities
71
+ profileUtils, };
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
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rB,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,MAA4B;IACzD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAC3C,CAAC;AAED,4BAA4B;AAC5B,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAEhG;;GAEG;AACH,KAAK,UAAU,yBAAyB,CAAC,OAAe;IACtD,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IAE9E,IAAI,eAAe,CAAC,OAAO,EAAE,CAAC;QAC5B,yBAAyB;QACzB,MAAM,iBAAiB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,4CAA4C;AAC5C,OAAO;AAML,YAAY;AACZ,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB;AAEpB,iBAAiB;AACjB,yBAAyB,EACzB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,cAAc;AAEd,mBAAmB;AACnB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa;AAEb,YAAY;AACZ,YAAY,GACb,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Go Project Profile
3
+ *
4
+ * This profile handles Go projects, supporting both single module
5
+ * and workspace configurations. It includes detection for common
6
+ * Go frameworks and tools.
7
+ */
8
+ import { ProjectProfile } from '../types.js';
9
+ /**
10
+ * Different types of Go projects we can detect
11
+ */
12
+ declare const GO_PROJECT_TYPES: {
13
+ readonly WORKSPACE: "workspace";
14
+ readonly MODULE: "module";
15
+ readonly FRAMEWORK: {
16
+ readonly GIN: "gin";
17
+ readonly ECHO: "echo";
18
+ readonly CHI: "chi";
19
+ readonly FIBER: "fiber";
20
+ };
21
+ };
22
+ type GoProjectType = typeof GO_PROJECT_TYPES.WORKSPACE | typeof GO_PROJECT_TYPES.MODULE | (typeof GO_PROJECT_TYPES.FRAMEWORK)[keyof typeof GO_PROJECT_TYPES.FRAMEWORK];
23
+ /**
24
+ * Parse go.mod file to extract module information
25
+ */
26
+ declare function parseGoMod(filePath: string): Promise<{
27
+ module: string;
28
+ requires: string[];
29
+ } | null>;
30
+ /**
31
+ * Parse go.work file to extract workspace information
32
+ */
33
+ declare function parseGoWork(filePath: string): Promise<string[] | null>;
34
+ /**
35
+ * Detect specific Go project type
36
+ */
37
+ declare function detectGoProjectType(rootDir: string): Promise<{
38
+ type: GoProjectType;
39
+ weight: number;
40
+ }>;
41
+ /**
42
+ * Check for golangci-lint configuration
43
+ */
44
+ declare function hasGolangciLint(rootDir: string): Promise<boolean>;
45
+ /**
46
+ * Get appropriate lint command based on project configuration
47
+ */
48
+ declare function detectLintCommand(rootDir: string): Promise<string | undefined>;
49
+ /**
50
+ * Get Go-specific ignore paths based on project type
51
+ */
52
+ declare function getGoIgnorePaths(projectType: GoProjectType): Promise<string[]>;
53
+ /**
54
+ * Go project profile
55
+ */
56
+ export declare const golangProfile: ProjectProfile;
57
+ export declare const goUtils: {
58
+ parseGoMod: typeof parseGoMod;
59
+ parseGoWork: typeof parseGoWork;
60
+ detectGoProjectType: typeof detectGoProjectType;
61
+ hasGolangciLint: typeof hasGolangciLint;
62
+ detectLintCommand: typeof detectLintCommand;
63
+ getGoIgnorePaths: typeof getGoIgnorePaths;
64
+ };
65
+ export {};
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Go Project Profile
3
+ *
4
+ * This profile handles Go projects, supporting both single module
5
+ * and workspace configurations. It includes detection for common
6
+ * Go frameworks and tools.
7
+ */
8
+ import path from 'path';
9
+ import fs from 'fs';
10
+ import { PROJECT_FILE_PATTERNS, DETECTION_WEIGHTS, DEFAULT_EXTENSIONS, DEFAULT_IGNORE_PATHS, } from '../types.js';
11
+ import { profileUtils } from '../detection.js';
12
+ /**
13
+ * Different types of Go projects we can detect
14
+ */
15
+ const GO_PROJECT_TYPES = {
16
+ WORKSPACE: 'workspace',
17
+ MODULE: 'module',
18
+ FRAMEWORK: {
19
+ GIN: 'gin',
20
+ ECHO: 'echo',
21
+ CHI: 'chi',
22
+ FIBER: 'fiber',
23
+ },
24
+ };
25
+ /**
26
+ * Common Go framework imports that help identify project type
27
+ */
28
+ const GO_FRAMEWORK_IMPORTS = {
29
+ [GO_PROJECT_TYPES.FRAMEWORK.GIN]: 'github.com/gin-gonic/gin',
30
+ [GO_PROJECT_TYPES.FRAMEWORK.ECHO]: 'github.com/labstack/echo/v4',
31
+ [GO_PROJECT_TYPES.FRAMEWORK.CHI]: 'github.com/go-chi/chi/v5',
32
+ [GO_PROJECT_TYPES.FRAMEWORK.FIBER]: 'github.com/gofiber/fiber/v2',
33
+ };
34
+ /**
35
+ * Parse go.mod file to extract module information
36
+ */
37
+ async function parseGoMod(filePath) {
38
+ try {
39
+ const content = await fs.promises.readFile(filePath, 'utf-8');
40
+ const lines = content.split('\n');
41
+ const module = lines
42
+ .find((line) => line.trim().startsWith('module'))
43
+ ?.split(' ')[1]
44
+ ?.trim();
45
+ const requires = lines
46
+ .filter((line) => line.trim().startsWith('require'))
47
+ .map((line) => line.split(' ')[1]?.trim())
48
+ .filter(Boolean);
49
+ return module ? { module, requires } : null;
50
+ }
51
+ catch {
52
+ return null;
53
+ }
54
+ }
55
+ /**
56
+ * Parse go.work file to extract workspace information
57
+ */
58
+ async function parseGoWork(filePath) {
59
+ try {
60
+ const content = await fs.promises.readFile(filePath, 'utf-8');
61
+ const lines = content.split('\n');
62
+ return lines
63
+ .filter((line) => line.trim().startsWith('use'))
64
+ .map((line) => line.split(' ')[1]?.trim())
65
+ .filter(Boolean);
66
+ }
67
+ catch {
68
+ return null;
69
+ }
70
+ }
71
+ /**
72
+ * Detect specific Go project type
73
+ */
74
+ async function detectGoProjectType(rootDir) {
75
+ // Check for workspace first
76
+ if (await profileUtils.fileExists(rootDir, PROJECT_FILE_PATTERNS.GO.WORK)) {
77
+ console.log('Detected Go workspace project');
78
+ return { type: GO_PROJECT_TYPES.WORKSPACE, weight: DETECTION_WEIGHTS.BASE.GO_BASE + 1 };
79
+ }
80
+ // Check for module and framework
81
+ const modPath = path.join(rootDir, PROJECT_FILE_PATTERNS.GO.MOD);
82
+ const goMod = await parseGoMod(modPath);
83
+ if (goMod?.requires) {
84
+ // Check for known frameworks
85
+ for (const [framework, importPath] of Object.entries(GO_FRAMEWORK_IMPORTS)) {
86
+ if (goMod.requires.some((req) => req.startsWith(importPath))) {
87
+ console.log(`Detected Go ${framework} project`);
88
+ return { type: framework, weight: DETECTION_WEIGHTS.FRAMEWORK.REACT };
89
+ }
90
+ }
91
+ }
92
+ console.log('Detected Go module project');
93
+ return { type: GO_PROJECT_TYPES.MODULE, weight: DETECTION_WEIGHTS.BASE.GO_BASE };
94
+ }
95
+ /**
96
+ * Check for golangci-lint configuration
97
+ */
98
+ async function hasGolangciLint(rootDir) {
99
+ return profileUtils.anyFileExists(rootDir, ['.golangci.yml', '.golangci.yaml', '.golangci.toml', '.golangci.json']);
100
+ }
101
+ /**
102
+ * Get appropriate lint command based on project configuration
103
+ */
104
+ async function detectLintCommand(rootDir) {
105
+ // Check if golangci-lint is configured
106
+ if (await hasGolangciLint(rootDir)) {
107
+ return 'golangci-lint run';
108
+ }
109
+ // Fallback to basic Go linting
110
+ return 'go vet ./...';
111
+ }
112
+ /**
113
+ * Get Go-specific ignore paths based on project type
114
+ */
115
+ async function getGoIgnorePaths(projectType) {
116
+ const baseIgnorePaths = [...DEFAULT_IGNORE_PATHS.GO];
117
+ // Add common test and build artifacts
118
+ baseIgnorePaths.push('*.test', 'coverage.out', 'coverage.html', 'cpu.out', 'mem.out');
119
+ if (projectType === GO_PROJECT_TYPES.WORKSPACE) {
120
+ // For workspaces, include all potential build directories
121
+ baseIgnorePaths.push('**/bin', '**/dist');
122
+ }
123
+ return baseIgnorePaths;
124
+ }
125
+ /**
126
+ * Go project profile
127
+ */
128
+ export const golangProfile = {
129
+ id: 'golang',
130
+ name: 'Go',
131
+ extensions: [...DEFAULT_EXTENSIONS.GO],
132
+ ignorePaths: [...DEFAULT_IGNORE_PATHS.GO],
133
+ detectionWeight: DETECTION_WEIGHTS.BASE.GO_BASE,
134
+ /**
135
+ * Detect if this is a Go project
136
+ */
137
+ async detect(rootDir) {
138
+ try {
139
+ // Check for go.mod or go.work
140
+ const hasGoFiles = await profileUtils.anyFileExists(rootDir, [
141
+ PROJECT_FILE_PATTERNS.GO.MOD,
142
+ PROJECT_FILE_PATTERNS.GO.WORK,
143
+ ]);
144
+ if (!hasGoFiles) {
145
+ console.log('No Go files (go.mod/go.work) found');
146
+ return false;
147
+ }
148
+ console.log('Found Go files (go.mod/go.work)');
149
+ // For workspace projects, check recursively
150
+ const isWorkspace = await profileUtils.fileExists(rootDir, PROJECT_FILE_PATTERNS.GO.WORK);
151
+ if (isWorkspace) {
152
+ console.log('Checking workspace modules recursively for source files');
153
+ const hasSourceFiles = await profileUtils.anyFileExistsRecursively(rootDir, ['main.go', 'go.sum'], [...DEFAULT_IGNORE_PATHS.GO]);
154
+ console.log('Workspace source files found:', hasSourceFiles);
155
+ return hasSourceFiles;
156
+ }
157
+ // For regular modules, check in the root directory
158
+ console.log('Checking root directory for source files');
159
+ const hasSourceFiles = await profileUtils.anyFileExists(rootDir, ['main.go', 'go.sum']);
160
+ console.log('Root directory source files found:', hasSourceFiles);
161
+ return hasSourceFiles;
162
+ }
163
+ catch (error) {
164
+ console.error('Error during Go project detection:', error);
165
+ return false;
166
+ }
167
+ },
168
+ /**
169
+ * Initialize Go-specific configuration
170
+ */
171
+ async initialize(rootDir) {
172
+ try {
173
+ // Detect Go project type
174
+ const { type: projectType } = await detectGoProjectType(rootDir);
175
+ console.log(`Initializing Go profile (${projectType})`);
176
+ // Set Go-specific ignore paths
177
+ this.ignorePaths = await getGoIgnorePaths(projectType);
178
+ // Set appropriate lint command
179
+ this.lintCommand = await detectLintCommand(rootDir);
180
+ // Add .go and .mod files to extensions
181
+ this.extensions = [...DEFAULT_EXTENSIONS.GO];
182
+ // For workspaces, add additional extensions
183
+ if (projectType === GO_PROJECT_TYPES.WORKSPACE) {
184
+ this.extensions.push('.work');
185
+ }
186
+ console.log('Go profile initialization completed:', {
187
+ type: projectType,
188
+ extensions: this.extensions,
189
+ ignorePaths: this.ignorePaths,
190
+ lintCommand: this.lintCommand,
191
+ });
192
+ }
193
+ catch (error) {
194
+ console.error('Error during Go profile initialization:', error);
195
+ throw error;
196
+ }
197
+ },
198
+ };
199
+ // Export utilities for other profiles that might extend Go
200
+ export const goUtils = {
201
+ parseGoMod,
202
+ parseGoWork,
203
+ detectGoProjectType,
204
+ hasGolangciLint,
205
+ detectLintCommand,
206
+ getGoIgnorePaths,
207
+ };
208
+ //# sourceMappingURL=golang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"golang.js","sourceRoot":"","sources":["../../../src/project-profiles/profiles/golang.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAEL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;GAEG;AACH,MAAM,gBAAgB,GAAG;IACvB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE;QACT,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,KAAK,EAAE,OAAO;KACf;CACO,CAAC;AAOX;;GAEG;AACH,MAAM,oBAAoB,GAAG;IAC3B,CAAC,gBAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,0BAA0B;IAC5D,CAAC,gBAAgB,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