neural-loom 0.1.1

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 (368) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +18 -0
  3. package/.next/build-manifest.json +20 -0
  4. package/.next/cache/.previewinfo +1 -0
  5. package/.next/cache/.rscinfo +1 -0
  6. package/.next/cache/.tsbuildinfo +1 -0
  7. package/.next/diagnostics/build-diagnostics.json +6 -0
  8. package/.next/diagnostics/framework.json +1 -0
  9. package/.next/diagnostics/route-bundle-stats.json +25 -0
  10. package/.next/export-marker.json +6 -0
  11. package/.next/fallback-build-manifest.json +13 -0
  12. package/.next/images-manifest.json +68 -0
  13. package/.next/next-minimal-server.js.nft.json +1 -0
  14. package/.next/next-server.js.nft.json +1 -0
  15. package/.next/package.json +1 -0
  16. package/.next/prerender-manifest.json +114 -0
  17. package/.next/required-server-files.js +332 -0
  18. package/.next/required-server-files.json +332 -0
  19. package/.next/routes-manifest.json +141 -0
  20. package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  21. package/.next/server/app/_global-error/page/build-manifest.json +16 -0
  22. package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  23. package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  24. package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  25. package/.next/server/app/_global-error/page.js +10 -0
  26. package/.next/server/app/_global-error/page.js.map +5 -0
  27. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  28. package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
  29. package/.next/server/app/_global-error.html +1 -0
  30. package/.next/server/app/_global-error.meta +15 -0
  31. package/.next/server/app/_global-error.rsc +15 -0
  32. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  33. package/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
  34. package/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
  35. package/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
  36. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  37. package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  38. package/.next/server/app/_not-found/page/build-manifest.json +16 -0
  39. package/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
  40. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  41. package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  42. package/.next/server/app/_not-found/page.js +13 -0
  43. package/.next/server/app/_not-found/page.js.map +5 -0
  44. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  45. package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
  46. package/.next/server/app/_not-found.html +1 -0
  47. package/.next/server/app/_not-found.meta +16 -0
  48. package/.next/server/app/_not-found.rsc +16 -0
  49. package/.next/server/app/_not-found.segments/_full.segment.rsc +16 -0
  50. package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
  51. package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -0
  52. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  53. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
  54. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  55. package/.next/server/app/api/context/aider/route/app-paths-manifest.json +3 -0
  56. package/.next/server/app/api/context/aider/route/build-manifest.json +9 -0
  57. package/.next/server/app/api/context/aider/route/server-reference-manifest.json +4 -0
  58. package/.next/server/app/api/context/aider/route.js +6 -0
  59. package/.next/server/app/api/context/aider/route.js.map +5 -0
  60. package/.next/server/app/api/context/aider/route.js.nft.json +1 -0
  61. package/.next/server/app/api/context/aider/route_client-reference-manifest.js +3 -0
  62. package/.next/server/app/api/context/claude/route/app-paths-manifest.json +3 -0
  63. package/.next/server/app/api/context/claude/route/build-manifest.json +9 -0
  64. package/.next/server/app/api/context/claude/route/server-reference-manifest.json +4 -0
  65. package/.next/server/app/api/context/claude/route.js +6 -0
  66. package/.next/server/app/api/context/claude/route.js.map +5 -0
  67. package/.next/server/app/api/context/claude/route.js.nft.json +1 -0
  68. package/.next/server/app/api/context/claude/route_client-reference-manifest.js +3 -0
  69. package/.next/server/app/api/context/route/app-paths-manifest.json +3 -0
  70. package/.next/server/app/api/context/route/build-manifest.json +9 -0
  71. package/.next/server/app/api/context/route/server-reference-manifest.json +4 -0
  72. package/.next/server/app/api/context/route.js +6 -0
  73. package/.next/server/app/api/context/route.js.map +5 -0
  74. package/.next/server/app/api/context/route.js.nft.json +1 -0
  75. package/.next/server/app/api/context/route_client-reference-manifest.js +3 -0
  76. package/.next/server/app/api/context/ssh/route/app-paths-manifest.json +3 -0
  77. package/.next/server/app/api/context/ssh/route/build-manifest.json +9 -0
  78. package/.next/server/app/api/context/ssh/route/server-reference-manifest.json +4 -0
  79. package/.next/server/app/api/context/ssh/route.js +6 -0
  80. package/.next/server/app/api/context/ssh/route.js.map +5 -0
  81. package/.next/server/app/api/context/ssh/route.js.nft.json +1 -0
  82. package/.next/server/app/api/context/ssh/route_client-reference-manifest.js +3 -0
  83. package/.next/server/app/api/files/route/app-paths-manifest.json +3 -0
  84. package/.next/server/app/api/files/route/build-manifest.json +9 -0
  85. package/.next/server/app/api/files/route/server-reference-manifest.json +4 -0
  86. package/.next/server/app/api/files/route.js +7 -0
  87. package/.next/server/app/api/files/route.js.map +5 -0
  88. package/.next/server/app/api/files/route.js.nft.json +1 -0
  89. package/.next/server/app/api/files/route_client-reference-manifest.js +3 -0
  90. package/.next/server/app/api/git/route/app-paths-manifest.json +3 -0
  91. package/.next/server/app/api/git/route/build-manifest.json +9 -0
  92. package/.next/server/app/api/git/route/server-reference-manifest.json +4 -0
  93. package/.next/server/app/api/git/route.js +6 -0
  94. package/.next/server/app/api/git/route.js.map +5 -0
  95. package/.next/server/app/api/git/route.js.nft.json +1 -0
  96. package/.next/server/app/api/git/route_client-reference-manifest.js +3 -0
  97. package/.next/server/app/api/sessions/inject/route/app-paths-manifest.json +3 -0
  98. package/.next/server/app/api/sessions/inject/route/build-manifest.json +9 -0
  99. package/.next/server/app/api/sessions/inject/route/server-reference-manifest.json +4 -0
  100. package/.next/server/app/api/sessions/inject/route.js +7 -0
  101. package/.next/server/app/api/sessions/inject/route.js.map +5 -0
  102. package/.next/server/app/api/sessions/inject/route.js.nft.json +1 -0
  103. package/.next/server/app/api/sessions/inject/route_client-reference-manifest.js +3 -0
  104. package/.next/server/app/api/sessions/input/route/app-paths-manifest.json +3 -0
  105. package/.next/server/app/api/sessions/input/route/build-manifest.json +9 -0
  106. package/.next/server/app/api/sessions/input/route/server-reference-manifest.json +4 -0
  107. package/.next/server/app/api/sessions/input/route.js +7 -0
  108. package/.next/server/app/api/sessions/input/route.js.map +5 -0
  109. package/.next/server/app/api/sessions/input/route.js.nft.json +1 -0
  110. package/.next/server/app/api/sessions/input/route_client-reference-manifest.js +3 -0
  111. package/.next/server/app/api/sessions/launch/route/app-paths-manifest.json +3 -0
  112. package/.next/server/app/api/sessions/launch/route/build-manifest.json +9 -0
  113. package/.next/server/app/api/sessions/launch/route/server-reference-manifest.json +4 -0
  114. package/.next/server/app/api/sessions/launch/route.js +7 -0
  115. package/.next/server/app/api/sessions/launch/route.js.map +5 -0
  116. package/.next/server/app/api/sessions/launch/route.js.nft.json +1 -0
  117. package/.next/server/app/api/sessions/launch/route_client-reference-manifest.js +3 -0
  118. package/.next/server/app/api/sessions/route/app-paths-manifest.json +3 -0
  119. package/.next/server/app/api/sessions/route/build-manifest.json +9 -0
  120. package/.next/server/app/api/sessions/route/server-reference-manifest.json +4 -0
  121. package/.next/server/app/api/sessions/route.js +7 -0
  122. package/.next/server/app/api/sessions/route.js.map +5 -0
  123. package/.next/server/app/api/sessions/route.js.nft.json +1 -0
  124. package/.next/server/app/api/sessions/route_client-reference-manifest.js +3 -0
  125. package/.next/server/app/api/sessions/stats/route/app-paths-manifest.json +3 -0
  126. package/.next/server/app/api/sessions/stats/route/build-manifest.json +9 -0
  127. package/.next/server/app/api/sessions/stats/route/server-reference-manifest.json +4 -0
  128. package/.next/server/app/api/sessions/stats/route.js +7 -0
  129. package/.next/server/app/api/sessions/stats/route.js.map +5 -0
  130. package/.next/server/app/api/sessions/stats/route.js.nft.json +1 -0
  131. package/.next/server/app/api/sessions/stats/route_client-reference-manifest.js +3 -0
  132. package/.next/server/app/api/sessions/stop/route/app-paths-manifest.json +3 -0
  133. package/.next/server/app/api/sessions/stop/route/build-manifest.json +9 -0
  134. package/.next/server/app/api/sessions/stop/route/server-reference-manifest.json +4 -0
  135. package/.next/server/app/api/sessions/stop/route.js +7 -0
  136. package/.next/server/app/api/sessions/stop/route.js.map +5 -0
  137. package/.next/server/app/api/sessions/stop/route.js.nft.json +1 -0
  138. package/.next/server/app/api/sessions/stop/route_client-reference-manifest.js +3 -0
  139. package/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
  140. package/.next/server/app/favicon.ico/route/build-manifest.json +9 -0
  141. package/.next/server/app/favicon.ico/route.js +7 -0
  142. package/.next/server/app/favicon.ico/route.js.map +5 -0
  143. package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
  144. package/.next/server/app/favicon.ico.body +0 -0
  145. package/.next/server/app/favicon.ico.meta +1 -0
  146. package/.next/server/app/index.html +1 -0
  147. package/.next/server/app/index.meta +14 -0
  148. package/.next/server/app/index.rsc +21 -0
  149. package/.next/server/app/index.segments/__PAGE__.segment.rsc +10 -0
  150. package/.next/server/app/index.segments/_full.segment.rsc +21 -0
  151. package/.next/server/app/index.segments/_head.segment.rsc +6 -0
  152. package/.next/server/app/index.segments/_index.segment.rsc +5 -0
  153. package/.next/server/app/index.segments/_tree.segment.rsc +5 -0
  154. package/.next/server/app/page/app-paths-manifest.json +3 -0
  155. package/.next/server/app/page/build-manifest.json +16 -0
  156. package/.next/server/app/page/next-font-manifest.json +11 -0
  157. package/.next/server/app/page/react-loadable-manifest.json +42 -0
  158. package/.next/server/app/page/server-reference-manifest.json +4 -0
  159. package/.next/server/app/page.js +14 -0
  160. package/.next/server/app/page.js.map +5 -0
  161. package/.next/server/app/page.js.nft.json +1 -0
  162. package/.next/server/app/page_client-reference-manifest.js +3 -0
  163. package/.next/server/app-paths-manifest.json +18 -0
  164. package/.next/server/chunks/[externals]__0shxiss._.js +3 -0
  165. package/.next/server/chunks/[externals]__0shxiss._.js.map +1 -0
  166. package/.next/server/chunks/[externals]_next_dist_0arv.vj._.js +3 -0
  167. package/.next/server/chunks/[externals]_next_dist_0arv.vj._.js.map +1 -0
  168. package/.next/server/chunks/[externals]_node-pty_12c-8pf._.js +3 -0
  169. package/.next/server/chunks/[externals]_node-pty_12c-8pf._.js.map +1 -0
  170. package/.next/server/chunks/[root-of-the-server]__0-k9zyi._.js +15 -0
  171. package/.next/server/chunks/[root-of-the-server]__0-k9zyi._.js.map +1 -0
  172. package/.next/server/chunks/[root-of-the-server]__04kdofw._.js +15 -0
  173. package/.next/server/chunks/[root-of-the-server]__04kdofw._.js.map +1 -0
  174. package/.next/server/chunks/[root-of-the-server]__0c.5qbe._.js +15 -0
  175. package/.next/server/chunks/[root-of-the-server]__0c.5qbe._.js.map +1 -0
  176. package/.next/server/chunks/[root-of-the-server]__0d0pykb._.js +28 -0
  177. package/.next/server/chunks/[root-of-the-server]__0d0pykb._.js.map +1 -0
  178. package/.next/server/chunks/[root-of-the-server]__0e5cwnx._.js +3 -0
  179. package/.next/server/chunks/[root-of-the-server]__0e5cwnx._.js.map +1 -0
  180. package/.next/server/chunks/[root-of-the-server]__0efi5cr._.js +3 -0
  181. package/.next/server/chunks/[root-of-the-server]__0efi5cr._.js.map +1 -0
  182. package/.next/server/chunks/[root-of-the-server]__0j8-xkl._.js +13 -0
  183. package/.next/server/chunks/[root-of-the-server]__0j8-xkl._.js.map +1 -0
  184. package/.next/server/chunks/[root-of-the-server]__0k6w___._.js +15 -0
  185. package/.next/server/chunks/[root-of-the-server]__0k6w___._.js.map +1 -0
  186. package/.next/server/chunks/[root-of-the-server]__0l7c-gn._.js +3 -0
  187. package/.next/server/chunks/[root-of-the-server]__0l7c-gn._.js.map +1 -0
  188. package/.next/server/chunks/[root-of-the-server]__0l_q72g._.js +15 -0
  189. package/.next/server/chunks/[root-of-the-server]__0l_q72g._.js.map +1 -0
  190. package/.next/server/chunks/[root-of-the-server]__0m7-xfc._.js +15 -0
  191. package/.next/server/chunks/[root-of-the-server]__0m7-xfc._.js.map +1 -0
  192. package/.next/server/chunks/[root-of-the-server]__0m_~dan._.js +15 -0
  193. package/.next/server/chunks/[root-of-the-server]__0m_~dan._.js.map +1 -0
  194. package/.next/server/chunks/[root-of-the-server]__0ntt3om._.js +3 -0
  195. package/.next/server/chunks/[root-of-the-server]__0ntt3om._.js.map +1 -0
  196. package/.next/server/chunks/[turbopack]_runtime.js +903 -0
  197. package/.next/server/chunks/[turbopack]_runtime.js.map +11 -0
  198. package/.next/server/chunks/_next-internal_server_app_api_context_aider_route_actions_0dszia..js +3 -0
  199. package/.next/server/chunks/_next-internal_server_app_api_context_aider_route_actions_0dszia..js.map +1 -0
  200. package/.next/server/chunks/_next-internal_server_app_api_context_claude_route_actions_12srkdn.js +3 -0
  201. package/.next/server/chunks/_next-internal_server_app_api_context_claude_route_actions_12srkdn.js.map +1 -0
  202. package/.next/server/chunks/_next-internal_server_app_api_context_route_actions_03ko8ta.js +3 -0
  203. package/.next/server/chunks/_next-internal_server_app_api_context_route_actions_03ko8ta.js.map +1 -0
  204. package/.next/server/chunks/_next-internal_server_app_api_context_ssh_route_actions_0~0~96d.js +3 -0
  205. package/.next/server/chunks/_next-internal_server_app_api_context_ssh_route_actions_0~0~96d.js.map +1 -0
  206. package/.next/server/chunks/_next-internal_server_app_api_files_route_actions_0x8kqqx.js +3 -0
  207. package/.next/server/chunks/_next-internal_server_app_api_files_route_actions_0x8kqqx.js.map +1 -0
  208. package/.next/server/chunks/_next-internal_server_app_api_git_route_actions_0xetuf~.js +3 -0
  209. package/.next/server/chunks/_next-internal_server_app_api_git_route_actions_0xetuf~.js.map +1 -0
  210. package/.next/server/chunks/_next-internal_server_app_api_sessions_inject_route_actions_0y2_m1_.js +3 -0
  211. package/.next/server/chunks/_next-internal_server_app_api_sessions_inject_route_actions_0y2_m1_.js.map +1 -0
  212. package/.next/server/chunks/_next-internal_server_app_api_sessions_input_route_actions_032sdjp.js +3 -0
  213. package/.next/server/chunks/_next-internal_server_app_api_sessions_input_route_actions_032sdjp.js.map +1 -0
  214. package/.next/server/chunks/_next-internal_server_app_api_sessions_launch_route_actions_0_qrmsm.js +3 -0
  215. package/.next/server/chunks/_next-internal_server_app_api_sessions_launch_route_actions_0_qrmsm.js.map +1 -0
  216. package/.next/server/chunks/_next-internal_server_app_api_sessions_route_actions_0y1t9w0.js +3 -0
  217. package/.next/server/chunks/_next-internal_server_app_api_sessions_route_actions_0y1t9w0.js.map +1 -0
  218. package/.next/server/chunks/_next-internal_server_app_api_sessions_stats_route_actions_0gc_vw-.js +3 -0
  219. package/.next/server/chunks/_next-internal_server_app_api_sessions_stats_route_actions_0gc_vw-.js.map +1 -0
  220. package/.next/server/chunks/_next-internal_server_app_api_sessions_stop_route_actions_0xg1t9k.js +3 -0
  221. package/.next/server/chunks/_next-internal_server_app_api_sessions_stop_route_actions_0xg1t9k.js.map +1 -0
  222. package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_095lj93.js +3 -0
  223. package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_095lj93.js.map +1 -0
  224. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ev3h.z.js +3 -0
  225. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ev3h.z.js.map +1 -0
  226. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0m.429v.js +3 -0
  227. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0m.429v.js.map +1 -0
  228. package/.next/server/chunks/ssr/[root-of-the-server]__0.kd7dh._.js +33 -0
  229. package/.next/server/chunks/ssr/[root-of-the-server]__0.kd7dh._.js.map +1 -0
  230. package/.next/server/chunks/ssr/[root-of-the-server]__089dc4i._.js +33 -0
  231. package/.next/server/chunks/ssr/[root-of-the-server]__089dc4i._.js.map +1 -0
  232. package/.next/server/chunks/ssr/[root-of-the-server]__0_7i5h0._.js +3 -0
  233. package/.next/server/chunks/ssr/[root-of-the-server]__0_7i5h0._.js.map +1 -0
  234. package/.next/server/chunks/ssr/[root-of-the-server]__0hw~y-4._.js +3 -0
  235. package/.next/server/chunks/ssr/[root-of-the-server]__0hw~y-4._.js.map +1 -0
  236. package/.next/server/chunks/ssr/[root-of-the-server]__0uk0awy._.js +3 -0
  237. package/.next/server/chunks/ssr/[root-of-the-server]__0uk0awy._.js.map +1 -0
  238. package/.next/server/chunks/ssr/[root-of-the-server]__0v73tbn._.js +3 -0
  239. package/.next/server/chunks/ssr/[root-of-the-server]__0v73tbn._.js.map +1 -0
  240. package/.next/server/chunks/ssr/[root-of-the-server]__0~y8ue.._.js +3 -0
  241. package/.next/server/chunks/ssr/[root-of-the-server]__0~y8ue.._.js.map +1 -0
  242. package/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
  243. package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +11 -0
  244. package/.next/server/chunks/ssr/_0t7oqy6._.js +3 -0
  245. package/.next/server/chunks/ssr/_0t7oqy6._.js.map +1 -0
  246. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js +3 -0
  247. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js.map +1 -0
  248. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js +3 -0
  249. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js.map +1 -0
  250. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_09-gtaw.js +3 -0
  251. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_09-gtaw.js.map +1 -0
  252. package/.next/server/chunks/ssr/node_modules_05l396c._.js +3 -0
  253. package/.next/server/chunks/ssr/node_modules_05l396c._.js.map +1 -0
  254. package/.next/server/chunks/ssr/node_modules_09w7yel._.js +33 -0
  255. package/.next/server/chunks/ssr/node_modules_09w7yel._.js.map +1 -0
  256. package/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_11~q6fv._.js +3 -0
  257. package/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_11~q6fv._.js.map +1 -0
  258. package/.next/server/chunks/ssr/node_modules_next_dist_0ppctuh._.js +19 -0
  259. package/.next/server/chunks/ssr/node_modules_next_dist_0ppctuh._.js.map +1 -0
  260. package/.next/server/chunks/ssr/node_modules_next_dist_0qoh8ry._.js +6 -0
  261. package/.next/server/chunks/ssr/node_modules_next_dist_0qoh8ry._.js.map +1 -0
  262. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js +3 -0
  263. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js.map +1 -0
  264. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js +3 -0
  265. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js.map +1 -0
  266. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js +3 -0
  267. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js.map +1 -0
  268. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js +3 -0
  269. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js.map +1 -0
  270. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03-z2qq.js +4 -0
  271. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03-z2qq.js.map +1 -0
  272. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_07vh7rm.js +4 -0
  273. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_07vh7rm.js.map +1 -0
  274. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0qp4u6g.js +4 -0
  275. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0qp4u6g.js.map +1 -0
  276. package/.next/server/functions-config-manifest.json +4 -0
  277. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  278. package/.next/server/middleware-build-manifest.js +20 -0
  279. package/.next/server/middleware-manifest.json +6 -0
  280. package/.next/server/next-font-manifest.js +1 -0
  281. package/.next/server/next-font-manifest.json +15 -0
  282. package/.next/server/pages/404.html +1 -0
  283. package/.next/server/pages/500.html +1 -0
  284. package/.next/server/pages-manifest.json +4 -0
  285. package/.next/server/prefetch-hints.json +1 -0
  286. package/.next/server/server-reference-manifest.js +1 -0
  287. package/.next/server/server-reference-manifest.json +5 -0
  288. package/.next/static/chunks/03g6xpslyid3~.js +1 -0
  289. package/.next/static/chunks/03~yq9q893hmn.js +1 -0
  290. package/.next/static/chunks/07b7-dl8gh17u.js +5 -0
  291. package/.next/static/chunks/07lhk_q6pmm3r.js +1 -0
  292. package/.next/static/chunks/0dbhjjzl8qfwv.js +1 -0
  293. package/.next/static/chunks/0ewdhgxsa_h.q.js +1 -0
  294. package/.next/static/chunks/0f4at4_v-tkgj.js +1 -0
  295. package/.next/static/chunks/0fpki3y6aj230.js +31 -0
  296. package/.next/static/chunks/0ga14ztvrhau2.css +1 -0
  297. package/.next/static/chunks/0lnobx4eh3~-_.js +1 -0
  298. package/.next/static/chunks/0mej.ad_ddvf1.js +1 -0
  299. package/.next/static/chunks/0q4suv6uexpud.css +1 -0
  300. package/.next/static/chunks/0xq6bhmghl02_.js +1 -0
  301. package/.next/static/chunks/139c54uo1w7.4.css +3 -0
  302. package/.next/static/chunks/140ovxvjat1ch.js +5 -0
  303. package/.next/static/chunks/16w4~t4h7gk13.js +1 -0
  304. package/.next/static/chunks/turbopack-08fpdsd.-ns2y.js +1 -0
  305. package/.next/static/media/4fa387ec64143e14-s.0wkzw~je483f-.woff2 +0 -0
  306. package/.next/static/media/53b9e256198e5412-s.0-wfv7uh4i7h9.woff2 +0 -0
  307. package/.next/static/media/5ce348bf30bf5439-s.0zgw-jeven.3w.woff2 +0 -0
  308. package/.next/static/media/6306c77e7c8268e4-s.0rhz0arwfsn~5.woff2 +0 -0
  309. package/.next/static/media/7178b3e590c64307-s.0nx0ww8fni_q3.woff2 +0 -0
  310. package/.next/static/media/797e433ab948586e-s.p.08e28id.o-okb.woff2 +0 -0
  311. package/.next/static/media/7d817b4c03b0c5f1-s.0l76wvqk9d84w.woff2 +0 -0
  312. package/.next/static/media/8a480f0b521d4e75-s.0jzbimsg8vl84.woff2 +0 -0
  313. package/.next/static/media/bbc41e54d2fcbd21-s.0k4k9394f2q-k.woff2 +0 -0
  314. package/.next/static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2 +0 -0
  315. package/.next/static/media/favicon.0x3dzn~oxb6tn.ico +0 -0
  316. package/.next/static/media/fef07dbb0973bf53-s.12tyk43_3sh9u.woff2 +0 -0
  317. package/.next/static/r-T5V6BKLiZ32Ai9Boe1d/_buildManifest.js +11 -0
  318. package/.next/static/r-T5V6BKLiZ32Ai9Boe1d/_clientMiddlewareManifest.js +1 -0
  319. package/.next/static/r-T5V6BKLiZ32Ai9Boe1d/_ssgManifest.js +1 -0
  320. package/.next/trace +1 -0
  321. package/.next/trace-build +1 -0
  322. package/.next/turbopack +0 -0
  323. package/.next/types/cache-life.d.ts +145 -0
  324. package/.next/types/routes.d.ts +84 -0
  325. package/.next/types/validator.ts +178 -0
  326. package/README.md +125 -0
  327. package/bin/cli.js +36 -0
  328. package/next.config.ts +7 -0
  329. package/package.json +40 -0
  330. package/public/file.svg +1 -0
  331. package/public/globe.svg +1 -0
  332. package/public/next.svg +1 -0
  333. package/public/vercel.svg +1 -0
  334. package/public/window.svg +1 -0
  335. package/src/app/api/context/aider/route.ts +113 -0
  336. package/src/app/api/context/claude/route.ts +64 -0
  337. package/src/app/api/context/route.ts +37 -0
  338. package/src/app/api/context/ssh/route.ts +88 -0
  339. package/src/app/api/files/route.ts +276 -0
  340. package/src/app/api/git/route.ts +81 -0
  341. package/src/app/api/sessions/inject/route.ts +21 -0
  342. package/src/app/api/sessions/input/route.ts +30 -0
  343. package/src/app/api/sessions/launch/route.ts +25 -0
  344. package/src/app/api/sessions/route.ts +27 -0
  345. package/src/app/api/sessions/stats/route.ts +76 -0
  346. package/src/app/api/sessions/stop/route.ts +26 -0
  347. package/src/app/components/AiderWizard.tsx +412 -0
  348. package/src/app/components/ClaudeWizard.tsx +335 -0
  349. package/src/app/components/ContextEditor.tsx +169 -0
  350. package/src/app/components/IdeLayout.tsx +2095 -0
  351. package/src/app/components/SshWizard.tsx +379 -0
  352. package/src/app/components/TerminalConsole.tsx +228 -0
  353. package/src/app/favicon.ico +0 -0
  354. package/src/app/globals.css +81 -0
  355. package/src/app/layout.tsx +30 -0
  356. package/src/app/page.module.css +330 -0
  357. package/src/app/page.tsx +581 -0
  358. package/src/lib/agents/AgentRunner.ts +86 -0
  359. package/src/lib/agents/AiderRunner.ts +261 -0
  360. package/src/lib/agents/ClaudeRunner.ts +148 -0
  361. package/src/lib/agents/ContextManager.ts +142 -0
  362. package/src/lib/agents/DockerRunner.ts +182 -0
  363. package/src/lib/agents/MockRunner.ts +126 -0
  364. package/src/lib/agents/SSHRunner.ts +180 -0
  365. package/src/lib/agents/SessionManager.ts +147 -0
  366. package/src/lib/agents/SessionPersister.ts +85 -0
  367. package/src/lib/agents/WebSocketServer.ts +118 -0
  368. package/tsconfig.json +34 -0
@@ -0,0 +1,261 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import type { IPty } from "node-pty";
4
+ import { AgentRunner, RunnerStatus } from "./AgentRunner";
5
+ import { SessionPersister } from "./SessionPersister";
6
+
7
+ function findGitBash(): string | null {
8
+ const pf = process.env.PROGRAMFILES || "C:\\Program Files";
9
+ const pf86 = process.env["PROGRAMFILES(X86)"] || "C:\\Program Files (x86)";
10
+ const local = process.env.LOCALAPPDATA || "";
11
+
12
+ const candidates: string[] = [
13
+ process.env.WINGMAN_BASH_PATH,
14
+ path.join(pf, "Git", "bin", "bash.exe"),
15
+ path.join(pf86, "Git", "bin", "bash.exe"),
16
+ local ? path.join(local, "Programs", "Git", "bin", "bash.exe") : "",
17
+ ].filter((p): p is string => typeof p === "string" && p !== "");
18
+
19
+ return candidates.find(p => fs.existsSync(p)) || null;
20
+ }
21
+
22
+ export class AiderRunner extends AgentRunner {
23
+ id: string;
24
+ name: string;
25
+ type: 'aider' | 'aider-docker';
26
+ status: 'idle' | 'running' | 'stopped' = 'idle';
27
+ createdAt: string;
28
+ logs: string[] = [];
29
+
30
+ private ptyProcess: IPty | null = null;
31
+ private ptyModule: typeof import("node-pty") | null = null;
32
+
33
+ constructor(id: string, type: 'aider' | 'aider-docker', name?: string) {
34
+ super();
35
+ this.id = id;
36
+ this.type = type;
37
+ this.name = name || (type === 'aider-docker' ? `Aider Docker ${id.substring(0, 8)}` : `Aider Session ${id.substring(0, 8)}`);
38
+ this.createdAt = new Date().toISOString();
39
+ }
40
+
41
+ private appendLog(line: string) {
42
+ this.logs.push(line);
43
+ if (this.logs.length > 5000) {
44
+ this.logs.shift();
45
+ }
46
+ this.parseTokenUsage(line);
47
+ this.emitOutput(line);
48
+ SessionPersister.saveSession(this);
49
+ }
50
+
51
+ async start(): Promise<void> {
52
+ if (this.status === 'running') return;
53
+
54
+ this.status = 'running';
55
+ this.appendLog("\x1b[1;35m==================================================\x1b[0m\r\n");
56
+ this.appendLog(`\x1b[1;36m NEURALLOOM AIDER AGENT ROUTE (${this.type.toUpperCase()}) \x1b[0m\r\n`);
57
+ this.appendLog("\x1b[1;35m==================================================\x1b[0m\r\n");
58
+
59
+ const bashPath = findGitBash();
60
+ if (!bashPath) {
61
+ this.status = 'stopped';
62
+ this.appendLog("\x1b[1;31m[System Error] Git Bash not found. Cannot spawn terminal.\x1b[0m\r\n");
63
+ return;
64
+ }
65
+
66
+ try {
67
+ if (!this.ptyModule) {
68
+ this.ptyModule = await import("node-pty");
69
+ }
70
+
71
+ // Load Aider configuration
72
+ let aiderConfig = {
73
+ openaiApiKey: "",
74
+ anthropicApiKey: "",
75
+ geminiApiKey: "",
76
+ model: "claude-3-5-sonnet",
77
+ extraFlags: "",
78
+ };
79
+
80
+ const aiderConfigPath = path.join(process.cwd(), ".ai", "neural-loom", "aider.json");
81
+ if (fs.existsSync(aiderConfigPath)) {
82
+ try {
83
+ aiderConfig = JSON.parse(fs.readFileSync(aiderConfigPath, "utf8"));
84
+ } catch (err) {
85
+ console.error("Failed to parse Aider configuration:", err);
86
+ }
87
+ }
88
+
89
+ // Setup process environment with injected keys
90
+ const customEnv = {
91
+ ...process.env,
92
+ TERM: "xterm-256color",
93
+ COLORTERM: "truecolor",
94
+ } as Record<string, string>;
95
+
96
+ if (aiderConfig.openaiApiKey) {
97
+ customEnv.OPENAI_API_KEY = aiderConfig.openaiApiKey;
98
+ }
99
+ if (aiderConfig.anthropicApiKey) {
100
+ customEnv.ANTHROPIC_API_KEY = aiderConfig.anthropicApiKey;
101
+ }
102
+ if (aiderConfig.geminiApiKey) {
103
+ customEnv.GEMINI_API_KEY = aiderConfig.geminiApiKey;
104
+ }
105
+
106
+ const modelFlag = aiderConfig.model ? `--model ${aiderConfig.model}` : "";
107
+ const extraFlags = aiderConfig.extraFlags || "";
108
+
109
+ const targetCwd = (this.workspaceRoot && fs.existsSync(this.workspaceRoot))
110
+ ? this.workspaceRoot
111
+ : process.cwd();
112
+
113
+ if (this.type === "aider-docker") {
114
+ this.appendLog("[System] Verifying Docker environment accessibility...\r\n");
115
+
116
+ // Check if docker executable exists by spawning `docker -v`
117
+ const testPty = this.ptyModule.spawn(bashPath, ["-c", "docker --version"], {
118
+ name: "xterm-256color",
119
+ cols: 80,
120
+ rows: 10,
121
+ cwd: targetCwd,
122
+ });
123
+
124
+ let hasDocker = false;
125
+ testPty.onData((data) => {
126
+ if (data.toLowerCase().includes("docker version")) {
127
+ hasDocker = true;
128
+ }
129
+ });
130
+
131
+ await new Promise(resolve => setTimeout(resolve, 800));
132
+ testPty.kill();
133
+
134
+ if (!hasDocker) {
135
+ this.status = 'stopped';
136
+ this.appendLog("\x1b[1;31m[Dependency Warning] Docker command not recognized in local PATH.\x1b[0m\r\n");
137
+ this.appendLog("\x1b[1;33mPlease install Docker Desktop and ensure the daemon is running.\x1b[0m\r\n");
138
+ return;
139
+ }
140
+
141
+ this.appendLog("[System] Spawning Aider container environment...\r\n");
142
+ const envFlags: string[] = [];
143
+ if (aiderConfig.openaiApiKey) envFlags.push("-e OPENAI_API_KEY");
144
+ if (aiderConfig.anthropicApiKey) envFlags.push("-e ANTHROPIC_API_KEY");
145
+ if (aiderConfig.geminiApiKey) envFlags.push("-e GEMINI_API_KEY");
146
+ const envFlagsStr = envFlags.join(" ");
147
+
148
+ // Volume mounts for primary workspace and each scoped directory
149
+ const mounts: string[] = [`-v "${targetCwd}:/workspace"`];
150
+ if (this.scopedDirs && Array.isArray(this.scopedDirs)) {
151
+ this.scopedDirs.forEach((dir) => {
152
+ if (fs.existsSync(dir)) {
153
+ const folderName = path.basename(dir).replace(/[^a-zA-Z0-9-_]/g, "_");
154
+ mounts.push(`-v "${dir}:/scoped/${folderName}"`);
155
+ }
156
+ });
157
+ }
158
+ const mountsStr = mounts.join(" ");
159
+
160
+ const dockerCmd = `docker run -it --name neural-loom-session-${this.id} --rm ${mountsStr} -w /workspace ${envFlagsStr} paulgauthier/aider ${modelFlag} ${extraFlags}`.trim();
161
+
162
+ this.ptyProcess = this.ptyModule.spawn(bashPath, ["-c", dockerCmd], {
163
+ name: "xterm-256color",
164
+ cols: 120,
165
+ rows: 30,
166
+ cwd: targetCwd,
167
+ env: customEnv,
168
+ });
169
+ } else {
170
+ this.appendLog("[System] Verifying 'aider' command availability in local PATH...\r\n");
171
+
172
+ // Check if aider executable exists by running `aider --version`
173
+ const testPty = this.ptyModule.spawn(bashPath, ["-c", "aider --version"], {
174
+ name: "xterm-256color",
175
+ cols: 80,
176
+ rows: 10,
177
+ cwd: targetCwd,
178
+ });
179
+
180
+ let hasAider = false;
181
+ testPty.onData((data) => {
182
+ if (data.toLowerCase().includes("aider")) {
183
+ hasAider = true;
184
+ }
185
+ });
186
+
187
+ await new Promise(resolve => setTimeout(resolve, 800));
188
+ testPty.kill();
189
+
190
+ if (!hasAider) {
191
+ this.status = 'stopped';
192
+ this.appendLog("\x1b[1;31m[Dependency Warning] 'aider' executable not found on local PATH.\x1b[0m\r\n");
193
+ this.appendLog("\x1b[1;33mPlease install Aider globally via pip:\r\n pip install aider-chat\x1b[0m\r\n");
194
+ return;
195
+ }
196
+
197
+ this.appendLog("[System] Spawning local Aider CLI...\r\n");
198
+ const localCmd = `aider ${modelFlag} ${extraFlags}`.trim();
199
+
200
+ this.ptyProcess = this.ptyModule.spawn(bashPath, ["-c", localCmd], {
201
+ name: "xterm-256color",
202
+ cols: 120,
203
+ rows: 30,
204
+ cwd: targetCwd,
205
+ env: customEnv,
206
+ });
207
+ }
208
+
209
+ this.ptyProcess.onData((data: string) => {
210
+ this.appendLog(data);
211
+ });
212
+
213
+ this.ptyProcess.onExit(({ exitCode, signal }: { exitCode: number; signal?: number }) => {
214
+ this.status = 'stopped';
215
+ this.appendLog(`\r\n\x1b[1;31m[System] Aider process exited (code=${exitCode}, signal=${signal}).\x1b[0m\r\n`);
216
+ this.ptyProcess = null;
217
+ });
218
+
219
+ } catch (err) {
220
+ const errorMessage = err instanceof Error ? err.message : "Unknown error";
221
+ this.status = 'stopped';
222
+ this.appendLog(`\x1b[1;31m[System Error] Failed to launch Aider: ${errorMessage}\x1b[0m\r\n`);
223
+ }
224
+ }
225
+
226
+ async stop(): Promise<void> {
227
+ this.status = 'stopped';
228
+ if (this.ptyProcess) {
229
+ try {
230
+ this.ptyProcess.kill();
231
+ } catch (err) {
232
+ console.error("Error killing Aider PTY process:", err);
233
+ }
234
+ this.ptyProcess = null;
235
+ }
236
+ this.appendLog("\r\n\x1b[1;31m[System] Aider session terminated.\x1b[0m\r\n");
237
+ }
238
+
239
+ async sendInput(text: string, isRaw = false): Promise<void> {
240
+ if (this.status !== 'running' || !this.ptyProcess) {
241
+ this.appendLog(`\r\n\x1b[1;31m[Error] Cannot write: Aider process is ${this.status}.\x1b[0m\r\n`);
242
+ return;
243
+ }
244
+
245
+ this.ptyProcess.write(isRaw ? text : text + "\r");
246
+ }
247
+
248
+ getStatus(): RunnerStatus {
249
+ return {
250
+ id: this.id,
251
+ name: this.name,
252
+ type: this.type,
253
+ status: this.status,
254
+ createdAt: this.createdAt,
255
+ logsCount: this.logs.length,
256
+ workspaceRoot: this.workspaceRoot,
257
+ scopedDirs: this.scopedDirs,
258
+ tokenUsage: this.tokenUsage
259
+ };
260
+ }
261
+ }
@@ -0,0 +1,148 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import type { IPty } from "node-pty";
4
+ import { AgentRunner, RunnerStatus } from "./AgentRunner";
5
+ import { SessionPersister } from "./SessionPersister";
6
+
7
+ function findGitBash(): string | null {
8
+ const pf = process.env.PROGRAMFILES || "C:\\Program Files";
9
+ const pf86 = process.env["PROGRAMFILES(X86)"] || "C:\\Program Files (x86)";
10
+ const local = process.env.LOCALAPPDATA || "";
11
+
12
+ const candidates: string[] = [
13
+ process.env.WINGMAN_BASH_PATH,
14
+ path.join(pf, "Git", "bin", "bash.exe"),
15
+ path.join(pf86, "Git", "bin", "bash.exe"),
16
+ local ? path.join(local, "Programs", "Git", "bin", "bash.exe") : "",
17
+ ].filter((p): p is string => typeof p === "string" && p !== "");
18
+
19
+ return candidates.find(p => fs.existsSync(p)) || null;
20
+ }
21
+
22
+ export class ClaudeRunner extends AgentRunner {
23
+ id: string;
24
+ name: string;
25
+ type: 'mock' | 'claude' = 'claude';
26
+ status: 'idle' | 'running' | 'stopped' = 'idle';
27
+ createdAt: string;
28
+ logs: string[] = [];
29
+
30
+ private ptyProcess: IPty | null = null;
31
+ private ptyModule: typeof import("node-pty") | null = null;
32
+
33
+ constructor(id: string, name?: string) {
34
+ super();
35
+ this.id = id;
36
+ this.name = name || `Claude Session ${id.substring(0, 8)}`;
37
+ this.createdAt = new Date().toISOString();
38
+ }
39
+
40
+ private appendLog(line: string) {
41
+ this.logs.push(line);
42
+ if (this.logs.length > 5000) {
43
+ this.logs.shift();
44
+ }
45
+ this.parseTokenUsage(line);
46
+ this.emitOutput(line);
47
+ SessionPersister.saveSession(this);
48
+ }
49
+
50
+ async start(): Promise<void> {
51
+ if (this.status === 'running') return;
52
+
53
+ // Detect Git Bash on Windows
54
+ const bashPath = findGitBash();
55
+ if (!bashPath) {
56
+ this.status = 'stopped';
57
+ this.appendLog("\x1b[1;31m[System Error] Git Bash not found. Please install Git for Windows.\x1b[0m\r\n");
58
+ return;
59
+ }
60
+
61
+ try {
62
+ // Dynamic import to prevent bundler SSR/Turbopack errors on server start
63
+ if (!this.ptyModule) {
64
+ this.ptyModule = await import("node-pty");
65
+ }
66
+
67
+ this.status = 'running';
68
+ this.appendLog("\x1b[1;35m==================================================\x1b[0m\r\n");
69
+ this.appendLog("\x1b[1;36m NEURALLOOM ACTIVE CLAUDE TERMINAL ROUTE \x1b[0m\r\n");
70
+ this.appendLog("\x1b[1;35m==================================================\x1b[0m\r\n");
71
+ this.appendLog(`[System] Spawning Claude Code CLI process using Git Bash...\r\n`);
72
+
73
+ const targetCwd = (this.workspaceRoot && fs.existsSync(this.workspaceRoot))
74
+ ? this.workspaceRoot
75
+ : process.cwd();
76
+
77
+ // Spawn bash and run 'claude' command
78
+ this.ptyProcess = this.ptyModule.spawn(bashPath, ["-c", "claude --agents-md"], {
79
+ name: "xterm-256color",
80
+ cols: 120,
81
+ rows: 30,
82
+ cwd: targetCwd,
83
+ env: {
84
+ ...process.env,
85
+ TERM: "xterm-256color",
86
+ COLORTERM: "truecolor",
87
+ // Inject custom path just in case child processes need Visual Studio Node
88
+ PATH: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Microsoft\\VisualStudio\\NodeJs;" + process.env.PATH
89
+ },
90
+ });
91
+
92
+ // Capture output
93
+ this.ptyProcess.onData((data: string) => {
94
+ this.appendLog(data);
95
+ });
96
+
97
+ // Capture process exit
98
+ this.ptyProcess.onExit(({ exitCode, signal }: { exitCode: number; signal?: number }) => {
99
+ this.status = 'stopped';
100
+ this.appendLog(`\r\n\x1b[1;31m[System] Claude Code PTY process exited (code=${exitCode}, signal=${signal}).\x1b[0m\r\n`);
101
+ this.ptyProcess = null;
102
+ });
103
+
104
+ } catch (err) {
105
+ const errorMessage = err instanceof Error ? err.message : "Unknown error";
106
+ this.status = 'stopped';
107
+ this.appendLog(`\x1b[1;31m[System Error] Failed to initialize node-pty runner: ${errorMessage}\x1b[0m\r\n`);
108
+ console.error("Failed to start Claude PTY runner:", err);
109
+ }
110
+ }
111
+
112
+ async stop(): Promise<void> {
113
+ this.status = 'stopped';
114
+ if (this.ptyProcess) {
115
+ try {
116
+ this.ptyProcess.kill();
117
+ } catch (err) {
118
+ console.error("Error killing PTY process:", err);
119
+ }
120
+ this.ptyProcess = null;
121
+ }
122
+ this.appendLog("\r\n\x1b[1;31m[System] Terminal bridge terminated.\x1b[0m\r\n");
123
+ }
124
+
125
+ async sendInput(text: string, isRaw = false): Promise<void> {
126
+ if (this.status !== 'running' || !this.ptyProcess) {
127
+ this.appendLog(`\r\n\x1b[1;31m[Error] Cannot write: session process is ${this.status}.\x1b[0m\r\n`);
128
+ return;
129
+ }
130
+
131
+ // PTY processes require carriage return (\r) to execute the command line
132
+ this.ptyProcess.write(isRaw ? text : text + "\r");
133
+ }
134
+
135
+ getStatus(): RunnerStatus {
136
+ return {
137
+ id: this.id,
138
+ name: this.name,
139
+ type: this.type,
140
+ status: this.status,
141
+ createdAt: this.createdAt,
142
+ logsCount: this.logs.length,
143
+ workspaceRoot: this.workspaceRoot,
144
+ scopedDirs: this.scopedDirs,
145
+ tokenUsage: this.tokenUsage
146
+ };
147
+ }
148
+ }
@@ -0,0 +1,142 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ export class ContextManager {
5
+ private static workspaceRoot = process.cwd();
6
+
7
+ private static ensureDirs(root: string) {
8
+ const aiDir = path.join(root, ".ai", "neural-loom");
9
+ if (!fs.existsSync(aiDir)) {
10
+ fs.mkdirSync(aiDir, { recursive: true });
11
+ }
12
+
13
+ const commandDir = path.join(root, ".claude", "commands");
14
+ if (!fs.existsSync(commandDir)) {
15
+ fs.mkdirSync(commandDir, { recursive: true });
16
+ }
17
+ }
18
+
19
+ public static initializeStaging(root: string = process.cwd()) {
20
+ this.ensureDirs(root);
21
+
22
+ // Create /ccp.md custom slash command file
23
+ const ccpPath = path.join(root, ".claude", "commands", "ccp.md");
24
+ if (!fs.existsSync(ccpPath)) {
25
+ fs.writeFileSync(
26
+ ccpPath,
27
+ "Read the prompt from .ai/neural-loom/cprompt.md and execute it. This is a staged prompt from the NeuralLoom UI. Treat the contents as user instructions.\n"
28
+ );
29
+ }
30
+
31
+ // Create /ccc.md custom slash command file
32
+ const cccPath = path.join(root, ".claude", "commands", "ccc.md");
33
+ if (!fs.existsSync(cccPath)) {
34
+ fs.writeFileSync(
35
+ cccPath,
36
+ "Read the context from .ai/neural-loom/ccontext.md. This is persistent context from the NeuralLoom UI. Absorb it as background information for this session. Acknowledge briefly what you received.\n"
37
+ );
38
+ }
39
+ }
40
+
41
+ public static updatePrompt(promptText: string, root: string = process.cwd()) {
42
+ this.ensureDirs(root);
43
+ const promptFile = path.join(root, ".ai", "neural-loom", "cprompt.md");
44
+ fs.writeFileSync(promptFile, promptText);
45
+ }
46
+
47
+ public static updateContext(contextText: string, root: string = process.cwd()) {
48
+ this.ensureDirs(root);
49
+ const contextFile = path.join(root, ".ai", "neural-loom", "ccontext.md");
50
+ fs.writeFileSync(contextFile, contextText);
51
+ }
52
+
53
+ public static updateRules(rulesText: string, root: string = process.cwd()) {
54
+ this.ensureDirs(root);
55
+ const agentsMdPath = path.join(root, "AGENTS.md");
56
+ fs.writeFileSync(agentsMdPath, rulesText, "utf8");
57
+ }
58
+
59
+ public static loadPrompt(root: string = process.cwd()): string {
60
+ const promptFile = path.join(root, ".ai", "neural-loom", "cprompt.md");
61
+ return fs.existsSync(promptFile) ? fs.readFileSync(promptFile, "utf8") : "";
62
+ }
63
+
64
+ public static loadRules(root: string = process.cwd()): string {
65
+ const agentsMdPath = path.join(root, "AGENTS.md");
66
+ return fs.existsSync(agentsMdPath) ? fs.readFileSync(agentsMdPath, "utf8") : "";
67
+ }
68
+
69
+ public static compileGlobalRules() {
70
+ this.compileSessionContext();
71
+ }
72
+
73
+ public static compileSessionContext(root: string = process.cwd(), scopedDirs?: string[]) {
74
+ this.ensureDirs(root);
75
+ this.initializeStaging(root);
76
+
77
+ // Check if AGENTS.md rules template exists
78
+ const agentsMdPath = path.join(root, "AGENTS.md");
79
+ let agentsRules = "";
80
+ if (fs.existsSync(agentsMdPath)) {
81
+ agentsRules = fs.readFileSync(agentsMdPath, "utf8");
82
+ } else {
83
+ // Try fallback from global
84
+ const fallbackPath = path.join(this.workspaceRoot, "AGENTS.md");
85
+ if (fs.existsSync(fallbackPath)) {
86
+ agentsRules = fs.readFileSync(fallbackPath, "utf8");
87
+ }
88
+ }
89
+
90
+ // Generate maps
91
+ let maps = `## Workspace Root Map (${root}):\n${this.generateProjectMapFor(root)}`;
92
+
93
+ if (scopedDirs && Array.isArray(scopedDirs)) {
94
+ scopedDirs.forEach((dir) => {
95
+ if (fs.existsSync(dir)) {
96
+ maps += `\n\n## Scoped Directory Map (${dir}):\n${this.generateProjectMapFor(dir)}`;
97
+ }
98
+ });
99
+ }
100
+
101
+ // Combine rules and folder map
102
+ const compiledContext = `# System Rules & Guidelines\n\n${agentsRules}\n\n# Project File Hierarchy Map\n\n${maps}`;
103
+ this.updateContext(compiledContext, root);
104
+
105
+ // Write a default empty prompt staging file if missing
106
+ const promptFile = path.join(root, ".ai", "neural-loom", "cprompt.md");
107
+ if (!fs.existsSync(promptFile)) {
108
+ fs.writeFileSync(promptFile, "Hello! Please review the project context (/ccc) and check for any tasks to execute.");
109
+ }
110
+ }
111
+
112
+ private static generateProjectMapFor(targetDir: string): string {
113
+ try {
114
+ const walk = (dir: string, depth = 0): string => {
115
+ if (depth > 2) return ""; // Keep map depth concise to fit tokens
116
+ let result = "";
117
+ const files = fs.readdirSync(dir, { withFileTypes: true });
118
+ for (const file of files) {
119
+ if (
120
+ file.name.startsWith(".") ||
121
+ file.name === "node_modules" ||
122
+ file.name === "out" ||
123
+ file.name === ".next"
124
+ ) {
125
+ continue;
126
+ }
127
+ const indent = " ".repeat(depth);
128
+ if (file.isDirectory()) {
129
+ result += `${indent}- [Dir] ${file.name}/\n`;
130
+ result += walk(path.join(dir, file.name), depth + 1);
131
+ } else {
132
+ result += `${indent}- [File] ${file.name}\n`;
133
+ }
134
+ }
135
+ return result;
136
+ };
137
+ return walk(targetDir);
138
+ } catch (err) {
139
+ return "Error generating project map: " + (err instanceof Error ? err.message : String(err));
140
+ }
141
+ }
142
+ }