genoma-evolution 1.0.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 (445) hide show
  1. package/.brv/.obsidian/app.json +1 -0
  2. package/.brv/.obsidian/appearance.json +1 -0
  3. package/.brv/.obsidian/core-plugins.json +33 -0
  4. package/.brv/.obsidian/graph.json +22 -0
  5. package/.brv/.obsidian/workspace.json +195 -0
  6. package/.brv/Sin ti/314/201tulo 1.canvas" +1 -0
  7. package/.brv/Sin ti/314/201tulo 2.canvas" +1 -0
  8. package/.brv/Sin ti/314/201tulo.canvas" +1 -0
  9. package/.brv/_queue_status.json +1 -0
  10. package/.brv/config.json +5 -0
  11. package/.brv/context-tree/_index.md +60 -0
  12. package/.brv/context-tree/_manifest.json +165 -0
  13. package/.brv/context-tree/backend/_index.md +24 -0
  14. package/.brv/context-tree/backend/backend/_index.md +40 -0
  15. package/.brv/context-tree/backend/backend/init.abstract.md +0 -0
  16. package/.brv/context-tree/backend/backend/init.md +27 -0
  17. package/.brv/context-tree/backend/backend/init.overview.md +29 -0
  18. package/.brv/context-tree/backend/backend/job_tracker.abstract.md +1 -0
  19. package/.brv/context-tree/backend/backend/job_tracker.md +273 -0
  20. package/.brv/context-tree/backend/backend/job_tracker.overview.md +31 -0
  21. package/.brv/context-tree/backend/backend/main.abstract.md +0 -0
  22. package/.brv/context-tree/backend/backend/main.md +1292 -0
  23. package/.brv/context-tree/backend/backend/main.overview.md +30 -0
  24. package/.brv/context-tree/backend/backend/requirements.abstract.md +1 -0
  25. package/.brv/context-tree/backend/backend/requirements.md +37 -0
  26. package/.brv/context-tree/backend/backend/requirements.overview.md +28 -0
  27. package/.brv/context-tree/docs/_index.md +37 -0
  28. package/.brv/context-tree/docs/api/_index.md +54 -0
  29. package/.brv/context-tree/docs/api/context.md +11 -0
  30. package/.brv/context-tree/docs/api/hermes_api_openapi_specification.abstract.md +0 -0
  31. package/.brv/context-tree/docs/api/hermes_api_openapi_specification.md +468 -0
  32. package/.brv/context-tree/docs/api/hermes_api_openapi_specification.overview.md +44 -0
  33. package/.brv/context-tree/frontend/_index.md +48 -0
  34. package/.brv/context-tree/frontend/hermes_dashboard/_index.md +31 -0
  35. package/.brv/context-tree/frontend/hermes_dashboard/architecture_overview.abstract.md +0 -0
  36. package/.brv/context-tree/frontend/hermes_dashboard/architecture_overview.md +41 -0
  37. package/.brv/context-tree/frontend/hermes_dashboard/architecture_overview.overview.md +34 -0
  38. package/.brv/context-tree/frontend/src/_index.md +53 -0
  39. package/.brv/context-tree/frontend/src/components/_index.md +52 -0
  40. package/.brv/context-tree/frontend/src/components/sidebar_navigation_component.abstract.md +0 -0
  41. package/.brv/context-tree/frontend/src/components/sidebar_navigation_component.md +161 -0
  42. package/.brv/context-tree/frontend/src/components/sidebar_navigation_component.overview.md +32 -0
  43. package/.brv/context-tree/frontend/src/context.md +10 -0
  44. package/.brv/context-tree/frontend/src/functioncallingpage.abstract.md +0 -0
  45. package/.brv/context-tree/frontend/src/functioncallingpage.md +34 -0
  46. package/.brv/context-tree/frontend/src/functioncallingpage.overview.md +26 -0
  47. package/.brv/context-tree/frontend/src/lib/_index.md +48 -0
  48. package/.brv/context-tree/frontend/src/lib/api_client_library.abstract.md +1 -0
  49. package/.brv/context-tree/frontend/src/lib/api_client_library.md +403 -0
  50. package/.brv/context-tree/frontend/src/lib/api_client_library.overview.md +69 -0
  51. package/.brv/context-tree/frontend/src/page.abstract.md +0 -0
  52. package/.brv/context-tree/frontend/src/page.md +103 -0
  53. package/.brv/context-tree/frontend/src/page.overview.md +7 -0
  54. package/.brv/context-tree/frontend/src/settingspage.abstract.md +0 -0
  55. package/.brv/context-tree/frontend/src/settingspage.md +124 -0
  56. package/.brv/context-tree/frontend/src/settingspage.overview.md +34 -0
  57. package/.brv/context-tree/frontend/src/sidebar.abstract.md +0 -0
  58. package/.brv/context-tree/frontend/src/sidebar.md +170 -0
  59. package/.brv/context-tree/frontend/src/sidebar.overview.md +25 -0
  60. package/.brv/context-tree/meta/_index.md +24 -0
  61. package/.brv/context-tree/meta/curation_context/_index.md +24 -0
  62. package/.brv/context-tree/meta/curation_context/empty_context.abstract.md +4 -0
  63. package/.brv/context-tree/meta/curation_context/empty_context.md +35 -0
  64. package/.brv/context-tree/meta/curation_context/empty_context.overview.md +20 -0
  65. package/.brv/dream-log/drm-1777341062653.json +33 -0
  66. package/.brv/dream-state.json +8 -0
  67. package/.brv/dream.lock +0 -0
  68. package/.brv/review-backups/docs/api/hermes_api_openapi_specification.md +468 -0
  69. package/.claude/settings.local.json +7 -0
  70. package/.claude/worktrees/phase-2-mcp/.brv/.obsidian/app.json +1 -0
  71. package/.claude/worktrees/phase-2-mcp/.brv/.obsidian/appearance.json +1 -0
  72. package/.claude/worktrees/phase-2-mcp/.brv/.obsidian/core-plugins.json +33 -0
  73. package/.claude/worktrees/phase-2-mcp/.brv/.obsidian/graph.json +22 -0
  74. package/.claude/worktrees/phase-2-mcp/.brv/.obsidian/workspace.json +195 -0
  75. package/.claude/worktrees/phase-2-mcp/.brv/Sin t/303/255tulo 1.canvas" +1 -0
  76. package/.claude/worktrees/phase-2-mcp/.brv/Sin t/303/255tulo 2.canvas" +1 -0
  77. package/.claude/worktrees/phase-2-mcp/.brv/Sin t/303/255tulo.canvas" +1 -0
  78. package/.claude/worktrees/phase-2-mcp/.brv/_queue_status.json +1 -0
  79. package/.claude/worktrees/phase-2-mcp/.brv/config.json +5 -0
  80. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/_index.md +60 -0
  81. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/_manifest.json +165 -0
  82. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/_index.md +24 -0
  83. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/_index.md +40 -0
  84. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/init.abstract.md +0 -0
  85. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/init.md +27 -0
  86. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/init.overview.md +29 -0
  87. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/job_tracker.abstract.md +1 -0
  88. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/job_tracker.md +273 -0
  89. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/job_tracker.overview.md +31 -0
  90. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/main.abstract.md +0 -0
  91. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/main.md +1292 -0
  92. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/main.overview.md +30 -0
  93. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/requirements.abstract.md +1 -0
  94. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/requirements.md +37 -0
  95. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/backend/backend/requirements.overview.md +28 -0
  96. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/docs/_index.md +37 -0
  97. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/docs/api/_index.md +54 -0
  98. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/docs/api/context.md +11 -0
  99. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/docs/api/hermes_api_openapi_specification.abstract.md +0 -0
  100. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/docs/api/hermes_api_openapi_specification.md +468 -0
  101. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/docs/api/hermes_api_openapi_specification.overview.md +44 -0
  102. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/_index.md +48 -0
  103. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/hermes_dashboard/_index.md +31 -0
  104. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/hermes_dashboard/architecture_overview.abstract.md +0 -0
  105. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/hermes_dashboard/architecture_overview.md +41 -0
  106. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/hermes_dashboard/architecture_overview.overview.md +34 -0
  107. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/_index.md +53 -0
  108. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/components/_index.md +52 -0
  109. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/components/sidebar_navigation_component.abstract.md +0 -0
  110. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/components/sidebar_navigation_component.md +161 -0
  111. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/components/sidebar_navigation_component.overview.md +32 -0
  112. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/context.md +10 -0
  113. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/functioncallingpage.abstract.md +0 -0
  114. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/functioncallingpage.md +34 -0
  115. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/functioncallingpage.overview.md +26 -0
  116. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/lib/_index.md +48 -0
  117. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/lib/api_client_library.abstract.md +1 -0
  118. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/lib/api_client_library.md +403 -0
  119. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/lib/api_client_library.overview.md +69 -0
  120. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/page.abstract.md +0 -0
  121. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/page.md +103 -0
  122. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/page.overview.md +7 -0
  123. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/settingspage.abstract.md +0 -0
  124. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/settingspage.md +124 -0
  125. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/settingspage.overview.md +34 -0
  126. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/sidebar.abstract.md +0 -0
  127. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/sidebar.md +170 -0
  128. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/frontend/src/sidebar.overview.md +25 -0
  129. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/meta/_index.md +24 -0
  130. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/meta/curation_context/_index.md +24 -0
  131. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/meta/curation_context/empty_context.abstract.md +4 -0
  132. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/meta/curation_context/empty_context.md +35 -0
  133. package/.claude/worktrees/phase-2-mcp/.brv/context-tree/meta/curation_context/empty_context.overview.md +20 -0
  134. package/.claude/worktrees/phase-2-mcp/.brv/dream-log/drm-1777341062653.json +33 -0
  135. package/.claude/worktrees/phase-2-mcp/.brv/dream-state.json +8 -0
  136. package/.claude/worktrees/phase-2-mcp/.brv/dream.lock +0 -0
  137. package/.claude/worktrees/phase-2-mcp/.brv/review-backups/docs/api/hermes_api_openapi_specification.md +468 -0
  138. package/.claude/worktrees/phase-2-mcp/.claude/settings.local.json +13 -0
  139. package/.claude/worktrees/phase-2-mcp/.kilocode/package-lock.json +378 -0
  140. package/.claude/worktrees/phase-2-mcp/.kilocode/package.json +5 -0
  141. package/.claude/worktrees/phase-2-mcp/AGENTS.md +5 -0
  142. package/.claude/worktrees/phase-2-mcp/CLAUDE.md +29 -0
  143. package/.claude/worktrees/phase-2-mcp/QA_AUDIT_PLAN.md +156 -0
  144. package/.claude/worktrees/phase-2-mcp/README.md +316 -0
  145. package/.claude/worktrees/phase-2-mcp/agent-agnostic-evolution-dashboard.md +405 -0
  146. package/.claude/worktrees/phase-2-mcp/backend/__init__.py +0 -0
  147. package/.claude/worktrees/phase-2-mcp/backend/collectors/__init__.py +0 -0
  148. package/.claude/worktrees/phase-2-mcp/backend/collectors/claude_code_collector.py +277 -0
  149. package/.claude/worktrees/phase-2-mcp/backend/collectors/hermes_collector.py +68 -0
  150. package/.claude/worktrees/phase-2-mcp/backend/curator.py +512 -0
  151. package/.claude/worktrees/phase-2-mcp/backend/eval/__init__.py +19 -0
  152. package/.claude/worktrees/phase-2-mcp/backend/eval/engine.py +116 -0
  153. package/.claude/worktrees/phase-2-mcp/backend/eval/scorers.py +201 -0
  154. package/.claude/worktrees/phase-2-mcp/backend/generate_dataset.py +86 -0
  155. package/.claude/worktrees/phase-2-mcp/backend/job_tracker.py +232 -0
  156. package/.claude/worktrees/phase-2-mcp/backend/main.py +1746 -0
  157. package/.claude/worktrees/phase-2-mcp/backend/mcp_server.py +250 -0
  158. package/.claude/worktrees/phase-2-mcp/backend/promethean/__init__.py +24 -0
  159. package/.claude/worktrees/phase-2-mcp/backend/promethean/cycle_orchestrator.py +270 -0
  160. package/.claude/worktrees/phase-2-mcp/backend/promethean/delta_validator.py +191 -0
  161. package/.claude/worktrees/phase-2-mcp/backend/promethean/dspy_compiler.py +315 -0
  162. package/.claude/worktrees/phase-2-mcp/backend/promethean/gepa_strategist.py +213 -0
  163. package/.claude/worktrees/phase-2-mcp/backend/promethean/models.py +260 -0
  164. package/.claude/worktrees/phase-2-mcp/backend/promethean/skill_deployer.py +195 -0
  165. package/.claude/worktrees/phase-2-mcp/backend/promethean/trace_ingestion.py +142 -0
  166. package/.claude/worktrees/phase-2-mcp/backend/requirements.txt +6 -0
  167. package/.claude/worktrees/phase-2-mcp/backend/sdd_evolve.py +459 -0
  168. package/.claude/worktrees/phase-2-mcp/backend/skill_detector.py +227 -0
  169. package/.claude/worktrees/phase-2-mcp/backend/skill_registry.py +289 -0
  170. package/.claude/worktrees/phase-2-mcp/backend/storage/__init__.py +5 -0
  171. package/.claude/worktrees/phase-2-mcp/backend/storage/run_store.py +393 -0
  172. package/.claude/worktrees/phase-2-mcp/backend/storage/schema.sql +99 -0
  173. package/.claude/worktrees/phase-2-mcp/backend/validate_evolution.py +267 -0
  174. package/.claude/worktrees/phase-2-mcp/components.json +28 -0
  175. package/.claude/worktrees/phase-2-mcp/docs/api/hermes-api.openapi.yaml +438 -0
  176. package/.claude/worktrees/phase-2-mcp/docs/hero.svg +148 -0
  177. package/.claude/worktrees/phase-2-mcp/eslint.config.mjs +18 -0
  178. package/.claude/worktrees/phase-2-mcp/install.sh +245 -0
  179. package/.claude/worktrees/phase-2-mcp/next-env.d.ts +6 -0
  180. package/.claude/worktrees/phase-2-mcp/next.config.ts +32 -0
  181. package/.claude/worktrees/phase-2-mcp/package-lock.json +11936 -0
  182. package/.claude/worktrees/phase-2-mcp/package.json +41 -0
  183. package/.claude/worktrees/phase-2-mcp/pnpm-workspace.yaml +4 -0
  184. package/.claude/worktrees/phase-2-mcp/postcss.config.mjs +7 -0
  185. package/.claude/worktrees/phase-2-mcp/public/file.svg +1 -0
  186. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Display-Bold.otf +0 -0
  187. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Display-Heavy.otf +0 -0
  188. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Display-Medium.otf +0 -0
  189. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Display-Regular.otf +0 -0
  190. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Display-Semibold.otf +0 -0
  191. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Text-Bold.otf +0 -0
  192. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Text-Heavy.otf +0 -0
  193. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Text-Medium.otf +0 -0
  194. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Text-Regular.otf +0 -0
  195. package/.claude/worktrees/phase-2-mcp/public/fonts/SF-Pro-Text-Semibold.otf +0 -0
  196. package/.claude/worktrees/phase-2-mcp/public/globe.svg +1 -0
  197. package/.claude/worktrees/phase-2-mcp/public/next.svg +1 -0
  198. package/.claude/worktrees/phase-2-mcp/public/theme-preview.html +257 -0
  199. package/.claude/worktrees/phase-2-mcp/public/vercel.svg +1 -0
  200. package/.claude/worktrees/phase-2-mcp/public/window.svg +1 -0
  201. package/.claude/worktrees/phase-2-mcp/run.sh +26 -0
  202. package/.claude/worktrees/phase-2-mcp/skills-lock.json +10 -0
  203. package/.claude/worktrees/phase-2-mcp/specs/event-schema.md +223 -0
  204. package/.claude/worktrees/phase-2-mcp/specs/examples/run.jsonl +3 -0
  205. package/.claude/worktrees/phase-2-mcp/src/app/api/[...path]/route.ts +55 -0
  206. package/.claude/worktrees/phase-2-mcp/src/app/api/auth/token/route.ts +22 -0
  207. package/.claude/worktrees/phase-2-mcp/src/app/evolution/page.tsx +589 -0
  208. package/.claude/worktrees/phase-2-mcp/src/app/favicon.ico +0 -0
  209. package/.claude/worktrees/phase-2-mcp/src/app/globals.css +321 -0
  210. package/.claude/worktrees/phase-2-mcp/src/app/layout.tsx +63 -0
  211. package/.claude/worktrees/phase-2-mcp/src/app/page.tsx +70 -0
  212. package/.claude/worktrees/phase-2-mcp/src/app/skills/page.tsx +369 -0
  213. package/.claude/worktrees/phase-2-mcp/src/components/ApiConfigCard.tsx +199 -0
  214. package/.claude/worktrees/phase-2-mcp/src/components/ColorBends.css +1 -0
  215. package/.claude/worktrees/phase-2-mcp/src/components/ColorBends.d.ts +1 -0
  216. package/.claude/worktrees/phase-2-mcp/src/components/ColorBends.jsx +1 -0
  217. package/.claude/worktrees/phase-2-mcp/src/components/CoreLoopToggle.tsx +111 -0
  218. package/.claude/worktrees/phase-2-mcp/src/components/EnvironmentStatus.tsx +176 -0
  219. package/.claude/worktrees/phase-2-mcp/src/components/EvolutionBackground.tsx +1 -0
  220. package/.claude/worktrees/phase-2-mcp/src/components/ReactQueryProvider.tsx +24 -0
  221. package/.claude/worktrees/phase-2-mcp/src/components/Sidebar.tsx +247 -0
  222. package/.claude/worktrees/phase-2-mcp/src/components/SkillDiffViewer.tsx +154 -0
  223. package/.claude/worktrees/phase-2-mcp/src/components/ThemeAwareBackground.tsx +67 -0
  224. package/.claude/worktrees/phase-2-mcp/src/components/ThemeToggle.tsx +54 -0
  225. package/.claude/worktrees/phase-2-mcp/src/components/WelcomeHero.tsx +77 -0
  226. package/.claude/worktrees/phase-2-mcp/src/components/bits/ClickSpark.tsx +116 -0
  227. package/.claude/worktrees/phase-2-mcp/src/components/bits/CountUp.tsx +98 -0
  228. package/.claude/worktrees/phase-2-mcp/src/components/bits/DarkSelect.tsx +95 -0
  229. package/.claude/worktrees/phase-2-mcp/src/components/bits/DecryptedText.tsx +161 -0
  230. package/.claude/worktrees/phase-2-mcp/src/components/bits/ElectricBorder.tsx +184 -0
  231. package/.claude/worktrees/phase-2-mcp/src/components/bits/GlitchText.tsx +34 -0
  232. package/.claude/worktrees/phase-2-mcp/src/components/bits/ShinyText.tsx +55 -0
  233. package/.claude/worktrees/phase-2-mcp/src/components/bits/SpotlightCard.tsx +42 -0
  234. package/.claude/worktrees/phase-2-mcp/src/components/bits/TextType.tsx +95 -0
  235. package/.claude/worktrees/phase-2-mcp/src/components/bits/index.ts +9 -0
  236. package/.claude/worktrees/phase-2-mcp/src/components/pages/CuratorPage.tsx +632 -0
  237. package/.claude/worktrees/phase-2-mcp/src/components/pages/DatasetPage.tsx +271 -0
  238. package/.claude/worktrees/phase-2-mcp/src/components/pages/EvolutionPage.tsx +676 -0
  239. package/.claude/worktrees/phase-2-mcp/src/components/pages/FunctionCallingPage.tsx +1 -0
  240. package/.claude/worktrees/phase-2-mcp/src/components/pages/LogsPage.tsx +272 -0
  241. package/.claude/worktrees/phase-2-mcp/src/components/pages/MetricsPage.tsx +246 -0
  242. package/.claude/worktrees/phase-2-mcp/src/components/pages/OverviewPage.tsx +420 -0
  243. package/.claude/worktrees/phase-2-mcp/src/components/pages/SettingsPage.tsx +88 -0
  244. package/.claude/worktrees/phase-2-mcp/src/components/pages/SkillStudioPage.tsx +376 -0
  245. package/.claude/worktrees/phase-2-mcp/src/components/ui/animated-theme-toggler.tsx +97 -0
  246. package/.claude/worktrees/phase-2-mcp/src/components/ui/button.tsx +67 -0
  247. package/.claude/worktrees/phase-2-mcp/src/components/ui/card.tsx +103 -0
  248. package/.claude/worktrees/phase-2-mcp/src/components/ui/input.tsx +19 -0
  249. package/.claude/worktrees/phase-2-mcp/src/components/ui/separator.tsx +28 -0
  250. package/.claude/worktrees/phase-2-mcp/src/components/ui/sheet.tsx +147 -0
  251. package/.claude/worktrees/phase-2-mcp/src/components/ui/sidebar.tsx +702 -0
  252. package/.claude/worktrees/phase-2-mcp/src/components/ui/skeleton.tsx +13 -0
  253. package/.claude/worktrees/phase-2-mcp/src/components/ui/theme-toggle.tsx +272 -0
  254. package/.claude/worktrees/phase-2-mcp/src/components/ui/tooltip.tsx +57 -0
  255. package/.claude/worktrees/phase-2-mcp/src/hooks/use-mobile.ts +19 -0
  256. package/.claude/worktrees/phase-2-mcp/src/lib/api.ts +455 -0
  257. package/.claude/worktrees/phase-2-mcp/src/lib/queryClient.ts +12 -0
  258. package/.claude/worktrees/phase-2-mcp/src/lib/utils.ts +6 -0
  259. package/.claude/worktrees/phase-2-mcp/stitch/agent_dashboard/DESIGN_SPEC.md +521 -0
  260. package/.claude/worktrees/phase-2-mcp/stitch/agent_dashboard/prototype.html +676 -0
  261. package/.claude/worktrees/phase-2-mcp/stitch/curator_workspace/code.html +448 -0
  262. package/.claude/worktrees/phase-2-mcp/stitch/curator_workspace/screen.png +0 -0
  263. package/.claude/worktrees/phase-2-mcp/stitch/datasets/code.html +479 -0
  264. package/.claude/worktrees/phase-2-mcp/stitch/datasets/screen.png +0 -0
  265. package/.claude/worktrees/phase-2-mcp/stitch/evolution_history/code.html +461 -0
  266. package/.claude/worktrees/phase-2-mcp/stitch/evolution_history/screen.png +0 -0
  267. package/.claude/worktrees/phase-2-mcp/stitch/hermes_dashboard/DESIGN.md +192 -0
  268. package/.claude/worktrees/phase-2-mcp/stitch/hermes_dashboard/DESIGN_SPEC.md +455 -0
  269. package/.claude/worktrees/phase-2-mcp/stitch/hermes_overview/code.html +399 -0
  270. package/.claude/worktrees/phase-2-mcp/stitch/hermes_overview/screen.png +0 -0
  271. package/.claude/worktrees/phase-2-mcp/stitch/live_logs/code.html +324 -0
  272. package/.claude/worktrees/phase-2-mcp/stitch/live_logs/screen.png +0 -0
  273. package/.claude/worktrees/phase-2-mcp/stitch/skill_hub/code.html +596 -0
  274. package/.claude/worktrees/phase-2-mcp/stitch/skill_hub/screen.png +0 -0
  275. package/.claude/worktrees/phase-2-mcp/stitch/system_metrics/code.html +527 -0
  276. package/.claude/worktrees/phase-2-mcp/stitch/system_metrics/screen.png +0 -0
  277. package/.claude/worktrees/phase-2-mcp/stitch/system_settings/code.html +257 -0
  278. package/.claude/worktrees/phase-2-mcp/stitch/system_settings/screen.png +0 -0
  279. package/.claude/worktrees/phase-2-mcp/test_dashboard.py +201 -0
  280. package/.claude/worktrees/phase-2-mcp/tests/collectors/__init__.py +0 -0
  281. package/.claude/worktrees/phase-2-mcp/tests/collectors/fixtures/sample_session.jsonl +7 -0
  282. package/.claude/worktrees/phase-2-mcp/tests/collectors/test_claude_code_collector.py +171 -0
  283. package/.claude/worktrees/phase-2-mcp/tests/collectors/test_hermes_collector.py +167 -0
  284. package/.claude/worktrees/phase-2-mcp/tests/eval/test_engine.py +234 -0
  285. package/.claude/worktrees/phase-2-mcp/tests/eval/test_scorers.py +249 -0
  286. package/.claude/worktrees/phase-2-mcp/tests/storage/__init__.py +0 -0
  287. package/.claude/worktrees/phase-2-mcp/tests/storage/test_run_store.py +359 -0
  288. package/.claude/worktrees/phase-2-mcp/tests/test_curator.py +559 -0
  289. package/.claude/worktrees/phase-2-mcp/tests/test_mcp_server.py +114 -0
  290. package/.claude/worktrees/phase-2-mcp/tsconfig.json +34 -0
  291. package/.env.example +72 -0
  292. package/.kilocode/package-lock.json +378 -0
  293. package/.kilocode/package.json +5 -0
  294. package/AGENTS.md +5 -0
  295. package/CLAUDE.md +29 -0
  296. package/QA_AUDIT_PLAN.md +156 -0
  297. package/README.md +355 -0
  298. package/agent-agnostic-evolution-dashboard.md +405 -0
  299. package/backend/__init__.py +0 -0
  300. package/backend/collectors/__init__.py +0 -0
  301. package/backend/collectors/claude_code_collector.py +277 -0
  302. package/backend/collectors/hermes_collector.py +68 -0
  303. package/backend/curator.py +512 -0
  304. package/backend/eval/__init__.py +19 -0
  305. package/backend/eval/engine.py +116 -0
  306. package/backend/eval/scorers.py +201 -0
  307. package/backend/generate_dataset.py +86 -0
  308. package/backend/job_tracker.py +232 -0
  309. package/backend/main.py +1746 -0
  310. package/backend/mcp_server.py +250 -0
  311. package/backend/promethean/__init__.py +24 -0
  312. package/backend/promethean/cycle_orchestrator.py +270 -0
  313. package/backend/promethean/delta_validator.py +191 -0
  314. package/backend/promethean/dspy_compiler.py +315 -0
  315. package/backend/promethean/gepa_strategist.py +213 -0
  316. package/backend/promethean/models.py +260 -0
  317. package/backend/promethean/skill_deployer.py +195 -0
  318. package/backend/promethean/trace_ingestion.py +142 -0
  319. package/backend/requirements.txt +6 -0
  320. package/backend/sdd_evolve.py +459 -0
  321. package/backend/skill_detector.py +227 -0
  322. package/backend/skill_registry.py +289 -0
  323. package/backend/storage/__init__.py +5 -0
  324. package/backend/storage/run_store.py +393 -0
  325. package/backend/storage/schema.sql +99 -0
  326. package/backend/validate_evolution.py +267 -0
  327. package/bin/genoma.js +250 -0
  328. package/components.json +28 -0
  329. package/docs/api/hermes-api.openapi.yaml +438 -0
  330. package/docs/hero.svg +148 -0
  331. package/eslint.config.mjs +18 -0
  332. package/install.sh +245 -0
  333. package/next-env.d.ts +6 -0
  334. package/next.config.ts +32 -0
  335. package/package.json +46 -0
  336. package/pnpm-workspace.yaml +4 -0
  337. package/postcss.config.mjs +7 -0
  338. package/public/file.svg +1 -0
  339. package/public/fonts/SF-Pro-Display-Bold.otf +0 -0
  340. package/public/fonts/SF-Pro-Display-Heavy.otf +0 -0
  341. package/public/fonts/SF-Pro-Display-Medium.otf +0 -0
  342. package/public/fonts/SF-Pro-Display-Regular.otf +0 -0
  343. package/public/fonts/SF-Pro-Display-Semibold.otf +0 -0
  344. package/public/fonts/SF-Pro-Text-Bold.otf +0 -0
  345. package/public/fonts/SF-Pro-Text-Heavy.otf +0 -0
  346. package/public/fonts/SF-Pro-Text-Medium.otf +0 -0
  347. package/public/fonts/SF-Pro-Text-Regular.otf +0 -0
  348. package/public/fonts/SF-Pro-Text-Semibold.otf +0 -0
  349. package/public/globe.svg +1 -0
  350. package/public/next.svg +1 -0
  351. package/public/theme-preview.html +257 -0
  352. package/public/vercel.svg +1 -0
  353. package/public/window.svg +1 -0
  354. package/run.sh +26 -0
  355. package/scripts/postinstall.js +50 -0
  356. package/skills-lock.json +10 -0
  357. package/specs/event-schema.md +223 -0
  358. package/specs/examples/run.jsonl +3 -0
  359. package/src/app/api/[...path]/route.ts +55 -0
  360. package/src/app/api/auth/token/route.ts +22 -0
  361. package/src/app/evolution/page.tsx +589 -0
  362. package/src/app/favicon.ico +0 -0
  363. package/src/app/globals.css +321 -0
  364. package/src/app/layout.tsx +63 -0
  365. package/src/app/page.tsx +70 -0
  366. package/src/app/skills/page.tsx +369 -0
  367. package/src/components/ApiConfigCard.tsx +199 -0
  368. package/src/components/ColorBends.css +1 -0
  369. package/src/components/ColorBends.d.ts +1 -0
  370. package/src/components/ColorBends.jsx +1 -0
  371. package/src/components/CoreLoopToggle.tsx +111 -0
  372. package/src/components/EnvironmentStatus.tsx +176 -0
  373. package/src/components/EvolutionBackground.tsx +1 -0
  374. package/src/components/ReactQueryProvider.tsx +24 -0
  375. package/src/components/Sidebar.tsx +247 -0
  376. package/src/components/SkillDiffViewer.tsx +154 -0
  377. package/src/components/ThemeAwareBackground.tsx +67 -0
  378. package/src/components/ThemeToggle.tsx +54 -0
  379. package/src/components/WelcomeHero.tsx +77 -0
  380. package/src/components/bits/ClickSpark.tsx +116 -0
  381. package/src/components/bits/CountUp.tsx +98 -0
  382. package/src/components/bits/DarkSelect.tsx +95 -0
  383. package/src/components/bits/DecryptedText.tsx +161 -0
  384. package/src/components/bits/ElectricBorder.tsx +184 -0
  385. package/src/components/bits/GlitchText.tsx +34 -0
  386. package/src/components/bits/ShinyText.tsx +55 -0
  387. package/src/components/bits/SpotlightCard.tsx +42 -0
  388. package/src/components/bits/TextType.tsx +95 -0
  389. package/src/components/bits/index.ts +9 -0
  390. package/src/components/pages/CuratorPage.tsx +632 -0
  391. package/src/components/pages/DatasetPage.tsx +271 -0
  392. package/src/components/pages/EvolutionPage.tsx +676 -0
  393. package/src/components/pages/FunctionCallingPage.tsx +1 -0
  394. package/src/components/pages/LogsPage.tsx +272 -0
  395. package/src/components/pages/MetricsPage.tsx +246 -0
  396. package/src/components/pages/OverviewPage.tsx +420 -0
  397. package/src/components/pages/SettingsPage.tsx +88 -0
  398. package/src/components/pages/SkillStudioPage.tsx +376 -0
  399. package/src/components/ui/animated-theme-toggler.tsx +97 -0
  400. package/src/components/ui/button.tsx +67 -0
  401. package/src/components/ui/card.tsx +103 -0
  402. package/src/components/ui/input.tsx +19 -0
  403. package/src/components/ui/separator.tsx +28 -0
  404. package/src/components/ui/sheet.tsx +147 -0
  405. package/src/components/ui/sidebar.tsx +702 -0
  406. package/src/components/ui/skeleton.tsx +13 -0
  407. package/src/components/ui/theme-toggle.tsx +272 -0
  408. package/src/components/ui/tooltip.tsx +57 -0
  409. package/src/hooks/use-mobile.ts +19 -0
  410. package/src/lib/api.ts +455 -0
  411. package/src/lib/queryClient.ts +12 -0
  412. package/src/lib/utils.ts +6 -0
  413. package/stitch/agent_dashboard/DESIGN_SPEC.md +521 -0
  414. package/stitch/agent_dashboard/prototype.html +676 -0
  415. package/stitch/curator_workspace/code.html +448 -0
  416. package/stitch/curator_workspace/screen.png +0 -0
  417. package/stitch/datasets/code.html +479 -0
  418. package/stitch/datasets/screen.png +0 -0
  419. package/stitch/evolution_history/code.html +461 -0
  420. package/stitch/evolution_history/screen.png +0 -0
  421. package/stitch/hermes_dashboard/DESIGN.md +192 -0
  422. package/stitch/hermes_dashboard/DESIGN_SPEC.md +455 -0
  423. package/stitch/hermes_overview/code.html +399 -0
  424. package/stitch/hermes_overview/screen.png +0 -0
  425. package/stitch/live_logs/code.html +324 -0
  426. package/stitch/live_logs/screen.png +0 -0
  427. package/stitch/skill_hub/code.html +596 -0
  428. package/stitch/skill_hub/screen.png +0 -0
  429. package/stitch/system_metrics/code.html +527 -0
  430. package/stitch/system_metrics/screen.png +0 -0
  431. package/stitch/system_settings/code.html +257 -0
  432. package/stitch/system_settings/screen.png +0 -0
  433. package/test_dashboard.py +201 -0
  434. package/tests/collectors/__init__.py +0 -0
  435. package/tests/collectors/fixtures/sample_session.jsonl +7 -0
  436. package/tests/collectors/test_claude_code_collector.py +171 -0
  437. package/tests/collectors/test_hermes_collector.py +167 -0
  438. package/tests/eval/test_engine.py +234 -0
  439. package/tests/eval/test_scorers.py +249 -0
  440. package/tests/storage/__init__.py +0 -0
  441. package/tests/storage/test_run_store.py +359 -0
  442. package/tests/test_curator.py +559 -0
  443. package/tests/test_e2e_npm.py +621 -0
  444. package/tests/test_mcp_server.py +114 -0
  445. package/tsconfig.json +34 -0
@@ -0,0 +1,403 @@
1
+ ---
2
+ title: API Client Library
3
+ summary: TypeScript API client with typed functions for jobs, skills, evolution, and WebSocket connection management
4
+ tags: []
5
+ related: []
6
+ keywords: []
7
+ createdAt: '2026-04-28T03:46:41.151Z'
8
+ updatedAt: '2026-04-28T03:46:41.151Z'
9
+ ---
10
+ ## Reason
11
+ Preserving complete frontend API client with typed endpoints
12
+
13
+ ## Raw Concept
14
+ **Task:**
15
+ Document frontend API client library
16
+
17
+ **Files:**
18
+ - src/lib/api.ts
19
+
20
+ **Timestamp:** 2026-04-28
21
+
22
+ ## Narrative
23
+ ### Structure
24
+ React Query-based API client with typed endpoints, WebSocket hooks, and API configuration
25
+
26
+ ---
27
+
28
+
29
+ // ── Infrastructure: Resilient API client ──────────────────────────────
30
+ //
31
+ // Contract → docs/api/hermes-api.openapi.yaml
32
+ // Design → AbortController timeouts, typed errors, network detection
33
+ // Auth → Hermes session-token (X-Hermes-Session-Token), auto-refresh on 401
34
+ // Fallback → 127.0.0.1 (evita resolución DNS rota en tiling WMs/Linux)
35
+ // Env → NEXT_PUBLIC_API_BASE (sin trailing slash)
36
+
37
+ // ── Env resolution ───────────────────────────────────────────────────
38
+ function resolveBase(): string {
39
+ if (typeof window !== "undefined") {
40
+ // Client-side: NEXT_PUBLIC_ variables están expuestas
41
+ const env = process.env as Record<string, string | undefined>;
42
+ // Soporta ambas variables: NEXT_PUBLIC_API_BASE (nuevo estándar) y NEXT_PUBLIC_API_URL (legacy)
43
+ const fromEnv = env.NEXT_PUBLIC_API_BASE ?? env.NEXT_PUBLIC_API_URL;
44
+ if (fromEnv) return fromEnv.replace(/\/+$/, "");
45
+ }
46
+ // Fallback: 127.0.0.1 en vez de localhost para evitar problemas DNS. Puerto 9119 = default de Hermes web.
47
+ return "http://127.0.0.1:9119";
48
+ }
49
+
50
+ const API_BASE = resolveBase();
51
+
52
+ // ── Session token (Hermes auth) ──────────────────────────────────────
53
+ let _sessionToken: string | null = null;
54
+ let _tokenPromise: Promise<string | null> | null = null;
55
+
56
+ async function fetchSessionToken(): Promise<string | null> {
57
+ try {
58
+ const html = await fetch(`${API_BASE}/`, {
59
+ signal: AbortSignal.timeout(5_000),
60
+ }).then((r) => r.text());
61
+ const match = html.match(/__HERMES_SESSION_TOKEN__\s*=\s*"([^"]+)"/);
62
+ return match?.[1] ?? null;
63
+ } catch {
64
+ return null;
65
+ }
66
+ }
67
+
68
+ async function getSessionToken(): Promise<string | null> {
69
+ if (_sessionToken) return _sessionToken;
70
+ if (!_tokenPromise) {
71
+ _tokenPromise = fetchSessionToken().then((token) => {
72
+ _sessionToken = token;
73
+ _tokenPromise = null;
74
+ return token;
75
+ });
76
+ }
77
+ return _tokenPromise;
78
+ }
79
+
80
+ function invalidateToken(): void {
81
+ _sessionToken = null;
82
+ _tokenPromise = null;
83
+ }
84
+
85
+ // ── Defaults ─────────────────────────────────────────────────────────
86
+ const DEFAULT_TIMEOUT_MS = 15_000;
87
+
88
+ // ── Typed errors (contract: ApiError schema) ─────────────────────────
89
+ export type ErrorKind = "network" | "timeout" | "server" | "client";
90
+
91
+ export class ApiError extends Error {
92
+ readonly kind: ErrorKind;
93
+ readonly status?: number;
94
+ readonly endpoint: string;
95
+
96
+ constructor(kind: ErrorKind, message: string, endpoint: string, status?: number) {
97
+ super(message);
98
+ this.name = "ApiError";
99
+ this.kind = kind;
100
+ this.status = status;
101
+ this.endpoint = endpoint;
102
+ }
103
+ }
104
+
105
+ /** Type guard para distinguir errores de API de excepciones genéricas */
106
+ export function isApiError(err: unknown): err is ApiError {
107
+ return err instanceof ApiError;
108
+ }
109
+
110
+ // ── Core fetch wrapper ───────────────────────────────────────────────
111
+ interface ApiOptions extends Omit<RequestInit, "signal"> {
112
+ /** Timeout en ms. Default 15s. 0 = sin timeout. */
113
+ timeout?: number;
114
+ }
115
+
116
+ async function executeRequest<T>(
117
+ path: string,
118
+ init: RequestInit & { timeout?: number },
119
+ ): Promise<T> {
120
+ const url = `${API_BASE}${path}`;
121
+ const controller = new AbortController();
122
+ const timer =
123
+ init.timeout && init.timeout > 0
124
+ ? setTimeout(() => controller.abort(), init.timeout)
125
+ : null;
126
+ const signal = controller.signal;
127
+
128
+ try {
129
+ const res = await fetch(url, { ...init, signal });
130
+
131
+ if (timer) clearTimeout(timer);
132
+
133
+ if (!res.ok) {
134
+ const body = await res.text().catch(() => res.statusText);
135
+ const kind: ErrorKind = res.status >= 500 ? "server" : "client";
136
+ throw new ApiError(kind, `HTTP ${res.status}: ${body.slice(0, 200)}`, path, res.status);
137
+ }
138
+
139
+ return res.json() as T;
140
+ } finally {
141
+ if (timer) clearTimeout(timer);
142
+ }
143
+ }
144
+
145
+ export async function api<T>(path: string, options?: ApiOptions): Promise<T> {
146
+ const { timeout = DEFAULT_TIMEOUT_MS, ...init } = options ?? {};
147
+ const token = await getSessionToken();
148
+
149
+ const headers: Record<string, string> = {
150
+ "Content-Type": "application/json",
151
+ ...(token ? { "X-Hermes-Session-Token": token } : {}),
152
+ ...((init.headers as Record<string, string>) ?? {}),
153
+ };
154
+
155
+ try {
156
+ return await executeRequest<T>(path, { ...init, headers, timeout });
157
+ } catch (err: unknown) {
158
+ // Auto-refresh token on 401 and retry once
159
+ if (err instanceof ApiError && err.status === 401) {
160
+ invalidateToken();
161
+ const freshToken = await getSessionToken();
162
+ if (freshToken) {
163
+ headers["X-Hermes-Session-Token"] = freshToken;
164
+ return executeRequest<T>(path, { ...init, headers, timeout });
165
+ }
166
+ }
167
+
168
+ // Re-lanzar errores ya tipados
169
+ if (err instanceof ApiError) throw err;
170
+
171
+ // AbortController / timeout
172
+ if (err instanceof DOMException && err.name === "AbortError") {
173
+ throw new ApiError("timeout", `Request to ${path} timed out after ${timeout}ms`, path);
174
+ }
175
+
176
+ // TypeError (network unreachable, CORS, DNS)
177
+ if (err instanceof TypeError) {
178
+ throw new ApiError("network", `Cannot reach ${API_BASE} — ${err.message}`, path);
179
+ }
180
+
181
+ // Fallback
182
+ throw new ApiError("network", err instanceof Error ? err.message : "Unknown fetch error", path);
183
+ }
184
+ }
185
+
186
+ // ── WebSocket helper ─────────────────────────────────────────────────
187
+ let _wsToken: string | null = null;
188
+
189
+ export async function wsConnect(onMessage: (data: unknown) => void): Promise<WebSocket> {
190
+ // Lazy-load token
191
+ if (!_wsToken) {
192
+ _wsToken = await getSessionToken();
193
+ }
194
+ const tokenQs = _wsToken ? `?token=${encodeURIComponent(_wsToken)}` : "";
195
+ const wsUrl = API_BASE.replace(/^http/, "ws") + "/ws/stream" + tokenQs;
196
+ const ws = new WebSocket(wsUrl);
197
+
198
+ ws.onmessage = (event) => {
199
+ try {
200
+ onMessage(JSON.parse(event.data));
201
+ } catch {
202
+ // ignore parse errors
203
+ }
204
+ };
205
+
206
+ ws.onclose = () => {
207
+ // Auto-reconnect after 3s
208
+ setTimeout(() => wsConnect(onMessage), 3000);
209
+ };
210
+
211
+ return ws;
212
+ }
213
+
214
+ // ── Health check (for Circuit Breaker) ───────────────────────────────
215
+ //
216
+ // Uses /api/status which is public (no session token required), making it
217
+ // the ideal endpoint for connectivity checks.
218
+ export async function checkHealth(): Promise<{
219
+ ok: boolean;
220
+ kind?: ErrorKind;
221
+ message?: string;
222
+ }> {
223
+ try {
224
+ await api<unknown>("/api/status", { timeout: 5_000 });
225
+ return { ok: true };
226
+ } catch (err) {
227
+ if (err instanceof ApiError) {
228
+ return { ok: false, kind: err.kind, message: err.message };
229
+ }
230
+ return { ok: false, kind: "network", message: "Unknown error" };
231
+ }
232
+ }
233
+
234
+ // ── Typed API calls ──────────────────────────────────────────────────
235
+
236
+ export interface SkillInfo {
237
+ name: string;
238
+ path: string;
239
+ description: string;
240
+ size: number;
241
+ last_modified: string;
242
+ providers: string[];
243
+ provider_count: number;
244
+ category: string;
245
+ }
246
+
247
+ export interface SkillDetail {
248
+ name: string;
249
+ path: string;
250
+ frontmatter: Record<string, unknown>;
251
+ body: string;
252
+ raw: string;
253
+ size: number;
254
+ }
255
+
256
+ export interface EvolutionRun {
257
+ skill_name: string;
258
+ timestamp: string;
259
+ baseline_score: number;
260
+ evolved_score: number;
261
+ improvement: number;
262
+ elapsed_seconds: number;
263
+ constraints_passed: boolean;
264
+ iterations: number;
265
+ optimizer_model: string;
266
+ }
267
+
268
+ export interface MetricsData {
269
+ total_runs: number;
270
+ skills_evolved: number;
271
+ avg_improvement: number;
272
+ best_improvement: number;
273
+ total_time_seconds: number;
274
+ avg_time_seconds: number;
275
+ success_rate: number;
276
+ runs: EvolutionRun[];
277
+ }
278
+
279
+ export interface DatasetInfo {
280
+ skill: string;
281
+ path: string;
282
+ splits: Record<string, number>;
283
+ total: number;
284
+ }
285
+
286
+ export interface ConstraintResult {
287
+ passed: boolean;
288
+ constraint: string;
289
+ message: string;
290
+ details: string | null;
291
+ }
292
+
293
+ export const fetchSkills = () => api<SkillInfo[]>("/api/skills");
294
+ export const fetchSkill = (name: string) => api<SkillDetail>(`/api/skills/${name}`);
295
+ export const fetchSkillHistory = (name: string) =>
296
+ api<EvolutionRun[]>(`/api/skills/${name}/evolution-history`);
297
+
298
+ // Skill management helpers
299
+ export interface ProviderSummary {
300
+ name: string;
301
+ total: number;
302
+ enabled: number;
303
+ skills: {
304
+ name: string;
305
+ description: string;
306
+ enabled: boolean;
307
+ tags: string[];
308
+ is_fork?: boolean;
309
+ category: string;
310
+ }[];
311
+ }
312
+
313
+ export const fetchSkillProviders = () =>
314
+ api<{ status: string; providers: ProviderSummary[] }>("/api/skills/providers");
315
+
316
+ export const toggleSkillEnabled = (provider: string, skillName: string, enabled: boolean) =>
317
+ api<{ status: string; enabled: boolean }>("/api/skills/toggle", {
318
+ method: "POST",
319
+ body: JSON.stringify({ provider, skill_name: skillName, enabled }),
320
+ });
321
+
322
+ export const deleteProviderSkill = (provider: string, skillName: string) =>
323
+ api<{ status: string; message: string }>(`/api/skills/${provider}/${encodeURIComponent(skillName)}`, {
324
+ method: "DELETE",
325
+ });
326
+
327
+ export const deleteGlobalSkill = (skillName: string) =>
328
+ api<{ status: string; message: string }>(`/api/skills/global/${encodeURIComponent(skillName)}`, {
329
+ method: "DELETE",
330
+ });
331
+
332
+ export const refreshSkills = () =>
333
+ api<{ status: string; providers: ProviderSummary[] }>("/api/skills/refresh");
334
+ export const fetchEvolutionRuns = () => api<EvolutionRun[]>("/api/evolution/runs");
335
+
336
+ export interface SkillDiff {
337
+ skill_name: string;
338
+ run_dir: string;
339
+ baseline: string | null;
340
+ evolved: string | null;
341
+ metrics: Record<string, unknown> | null;
342
+ }
343
+
344
+ export const fetchSkillDiff = (skillName: string, runDir: string) =>
345
+ api<SkillDiff>(`/api/skills/${encodeURIComponent(skillName)}/evolution/${encodeURIComponent(runDir)}/diff`);
346
+
347
+ // ── Job tracking ─────────────────────────────────────────────────────
348
+
349
+ export interface EvolutionJob {
350
+ id: string;
351
+ skill_name: string;
352
+ status: string;
353
+ iterations: number;
354
+ current_iteration: number;
355
+ pid: number | null;
356
+ started_at: string;
357
+ completed_at: string;
358
+ baseline_score: number | null;
359
+ current_best_score: number | null;
360
+ evolved_score: number | null;
361
+ improvement: number | null;
362
+ error: string;
363
+ progress: number;
364
+ logs: string[];
365
+ }
366
+
367
+ export const fetchJobs = (activeOnly = false) =>
368
+ api<EvolutionJob[]>(`/api/jobs?active_only=${activeOnly}`);
369
+
370
+ export const fetchJob = (jobId: string) =>
371
+ api<EvolutionJob>(`/api/jobs/${jobId}`);
372
+
373
+ export const fetchJobLogs = (jobId: string, since = 0) =>
374
+ api<{ job_id: string; total_lines: number; logs: string[]; status: string; progress: number }>(
375
+ `/api/jobs/${jobId}/logs?since=${since}`
376
+ );
377
+
378
+ export const cancelJob = (jobId: string) =>
379
+ api<{ status: string; job_id: string }>(`/api/jobs/${jobId}`, { method: "DELETE" });
380
+
381
+ export const startEvolution = (skillName: string, iterations: number) =>
382
+ api<{ job_id: string; skill: string; status: string; error?: string }>("/api/evolution/start", {
383
+ method: "POST",
384
+ body: JSON.stringify({ skill_name: skillName, iterations, eval_source: "synthetic" }),
385
+ });
386
+ export const fetchMetrics = () => api<MetricsData>("/api/metrics");
387
+ export const fetchDatasets = () => api<DatasetInfo[]>("/api/datasets");
388
+ export const fetchDataset = (skill: string) =>
389
+ api<Record<string, unknown[]>>(`/api/datasets/${skill}`);
390
+ export const validateSkill = (name: string) =>
391
+ api<ConstraintResult[]>(`/api/constraints/validate/${name}`);
392
+ export const fetchHealth = () =>
393
+ api<{
394
+ status: string;
395
+ hermes_repo: string;
396
+ hermes_repo_exists: boolean;
397
+ evolution_dir: string;
398
+ evolution_dir_exists: boolean;
399
+ skills_count: number;
400
+ categories: Record<string, number>;
401
+ }>("/api/health");
402
+
403
+
@@ -0,0 +1,69 @@
1
+ ## API Client Library Overview
2
+
3
+ **File:** `src/lib/api.ts`
4
+ **Type:** TypeScript API client with typed endpoints and WebSocket support
5
+ **Purpose:** Frontend API client for Hermes backend (skills, evolution, jobs, WebSocket)
6
+
7
+ ---
8
+
9
+ ### Key Points
10
+
11
+ - **Typed API client** using a central `api<T>()` wrapper with AbortController timeouts (default 15s)
12
+ - **Hermes session authentication** via `X-Hermes-Session-Token` header with automatic token refresh on 401
13
+ - **Environment resolution:** Supports `NEXT_PUBLIC_API_BASE` and legacy `NEXT_PUBLIC_API_URL`; falls back to `http://127.0.0.1:9119`
14
+ - **Typed errors** via `ApiError` class with `ErrorKind`: `network`, `timeout`, `server`, `client`
15
+ - **WebSocket helper** (`wsConnect`) with auto-reconnect after 3s and JSON message parsing
16
+ - **Health check endpoint** uses `/api/status` (no auth required) for circuit breaker connectivity checks
17
+ - **Comprehensive typed interfaces** for skills, evolution runs, jobs, datasets, and constraints
18
+
19
+ ---
20
+
21
+ ### Structure / Sections Summary
22
+
23
+ 1. **Infrastructure Setup**
24
+ - Base URL resolution with fallback to `127.0.0.1:9119`
25
+ - Session token fetching from HTML `__HERMES_SESSION_TOKEN__`
26
+
27
+ 2. **Error Handling**
28
+ - `ApiError` class with status, kind, endpoint tracking
29
+ - `isApiError` type guard
30
+
31
+ 3. **Core Fetch Wrapper**
32
+ - `executeRequest<T>()` — low-level fetch with AbortController
33
+ - `api<T>()` — high-level wrapper with token injection and 401 retry logic
34
+
35
+ 4. **WebSocket Helper**
36
+ - `wsConnect(onMessage)` — lazy token, query param auth, auto-reconnect
37
+
38
+ 5. **Health Check**
39
+ - `checkHealth()` — returns `{ok, kind?, message?}`
40
+
41
+ 6. **Typed API Endpoints**
42
+ - Skills: `fetchSkills`, `fetchSkill`, `fetchSkillHistory`, `fetchSkillProviders`, `toggleSkillEnabled`, `deleteProviderSkill`, `deleteGlobalSkill`, `refreshSkills`
43
+ - Evolution: `fetchEvolutionRuns`, `fetchSkillDiff`, `startEvolution`
44
+ - Jobs: `fetchJobs`, `fetchJob`, `fetchJobLogs`, `cancelJob`
45
+ - Metrics/Datasets: `fetchMetrics`, `fetchDatasets`, `fetchDataset`
46
+ - Constraints: `validateSkill`
47
+ - Health: `fetchHealth`
48
+
49
+ ---
50
+
51
+ ### Notable Interfaces
52
+
53
+ | Interface | Fields |
54
+ |-----------|--------|
55
+ | `SkillInfo` | name, path, description, size, providers, category |
56
+ | `EvolutionRun` | skill_name, baseline_score, evolved_score, improvement, iterations |
57
+ | `EvolutionJob` | id, status, current_iteration, pid, progress, logs |
58
+ | `MetricsData` | total_runs, avg_improvement, success_rate, runs |
59
+ | `ConstraintResult` | passed, constraint, message, details |
60
+ | `ApiError` | kind (ErrorKind), status, endpoint |
61
+
62
+ ---
63
+
64
+ ### Notable Patterns
65
+
66
+ - **Token caching** via `_sessionToken` / `_tokenPromise` with lazy initialization
67
+ - **AbortController** for request timeout with `setTimeout` + `controller.abort()`
68
+ - **WebSocket auto-reconnect** on `onclose` event (3s delay)
69
+ - **URL encoding** via `encodeURIComponent` for skill names in paths
@@ -0,0 +1,103 @@
1
+ ---
2
+ title: page
3
+ summary: ''
4
+ tags: []
5
+ related: []
6
+ keywords: []
7
+ createdAt: '2026-04-28T01:33:30.559Z'
8
+ updatedAt: '2026-04-28T01:33:30.559Z'
9
+ ---
10
+ ## Reason
11
+ Preserving complete src/app/page.tsx from hermes-dashboard project
12
+
13
+ ## Raw Concept
14
+ **Task:**
15
+ Preserve src/app/page.tsx
16
+
17
+ **Files:**
18
+ - src/app/page.tsx
19
+
20
+ **Timestamp:** 2026-04-28
21
+
22
+ **Patterns:**
23
+ - `OverviewPage` - Component or function
24
+ - `SkillStudioPage` - Component or function
25
+ - `EvolutionPage` - Component or function
26
+ - `DatasetPage` - Component or function
27
+ - `MemoryPage` - Component or function
28
+ - `MetricsPage` - Component or function
29
+ - `LogsPage` - Component or function
30
+ - `SettingsPage` - Component or function
31
+ - `Home` - Component or function
32
+ - `PageComponent` - Component or function
33
+
34
+ ## Narrative
35
+ ### Structure
36
+ TSX file with 10 components/functions
37
+
38
+ ### Highlights
39
+ Source: hermes-dashboard/src/app/page.tsx
40
+
41
+ ---
42
+
43
+
44
+ &quot;use client&quot;;
45
+
46
+ import { useState } from &quot;react&quot;;
47
+ import Sidebar from &quot;@/components/Sidebar&quot;;
48
+ import dynamic from &quot;next/dynamic&quot;;
49
+ import type { Page } from &quot;@/components/Sidebar&quot;;
50
+
51
+ // Lazy load page components with loading states
52
+ const OverviewPage = dynamic(() =&gt; import(&quot;@/components/pages/OverviewPage&quot;), {
53
+ loading: () =&gt; &lt;div className=&quot;min-h-[20rem] flex items-center justify-center&quot;&gt;Cargando Overview...&lt;/div&gt;,
54
+ });
55
+ const SkillStudioPage = dynamic(() =&gt; import(&quot;@/components/pages/SkillStudioPage&quot;), {
56
+ loading: () =&gt; &lt;div className=&quot;min-h-[20rem] flex items-center justify-center&quot;&gt;Cargando Skill Studio...&lt;/div&gt;,
57
+ });
58
+ const EvolutionPage = dynamic(() =&gt; import(&quot;@/components/pages/EvolutionPage&quot;), {
59
+ loading: () =&gt; &lt;div className=&quot;min-h-[20rem] flex items-center justify-center&quot;&gt;Cargando Evolution...&lt;/div&gt;,
60
+ });
61
+ const DatasetPage = dynamic(() =&gt; import(&quot;@/components/pages/DatasetPage&quot;), {
62
+ loading: () =&gt; &lt;div className=&quot;min-h-[20rem] flex items-center justify-center&quot;&gt;Cargando Datasets...&lt;/div&gt;,
63
+ });
64
+ const MemoryPage = dynamic(() =&gt; import(&quot;@/components/pages/MemoryPage&quot;), {
65
+ loading: () =&gt; &lt;div className=&quot;min-h-[20rem] flex items-center justify-center&quot;&gt;Cargando Memory...&lt;/div&gt;,
66
+ });
67
+ const MetricsPage = dynamic(() =&gt; import(&quot;@/components/pages/MetricsPage&quot;), {
68
+ loading: () =&gt; &lt;div className=&quot;min-h-[20rem] flex items-center justify-center&quot;&gt;Cargando Metrics...&lt;/div&gt;,
69
+ });
70
+ const LogsPage = dynamic(() =&gt; import(&quot;@/components/pages/LogsPage&quot;), {
71
+ loading: () =&gt; &lt;div className=&quot;min-h-[20rem] flex items-center justify-center&quot;&gt;Cargando Logs...&lt;/div&gt;,
72
+ });
73
+ const SettingsPage = dynamic(() =&gt; import(&quot;@/components/pages/SettingsPage&quot;), {
74
+ loading: () =&gt; &lt;div className=&quot;min-h-[20rem] flex items-center justify-center&quot;&gt;Cargando Settings...&lt;/div&gt;,
75
+ });
76
+
77
+
78
+ const pages: Record&lt;Page, React.ComponentType&gt; = {
79
+ overview: OverviewPage,
80
+ skills: SkillStudioPage,
81
+ evolution: EvolutionPage,
82
+ datasets: DatasetPage,
83
+ memory: MemoryPage,
84
+ metrics: MetricsPage,
85
+ logs: LogsPage,
86
+ settings: SettingsPage,
87
+ };
88
+
89
+ export default function Home() {
90
+ const [activePage, setActivePage] = useState&lt;Page&gt;(&quot;overview&quot;);
91
+ const PageComponent = pages[activePage];
92
+
93
+ return (
94
+ &lt;div className=&quot;flex min-h-screen&quot;&gt;
95
+ &lt;Sidebar activePage={activePage} onNavigate={setActivePage} /&gt;
96
+ &lt;main className=&quot;flex-1 p-6 lg:p-8 overflow-y-auto&quot;&gt;
97
+ &lt;PageComponent /&gt;
98
+ &lt;/main&gt;
99
+ &lt;/div&gt;
100
+ );
101
+ }
102
+
103
+
@@ -0,0 +1,7 @@
1
+ # Structured Overview: hermes-dashboard page.tsx
2
+
3
+ ## Key Points
4
+
5
+ - **Client-side React component** using `"use client"` directive for Next.js App Router
6
+ - **Dynamic lazy loading** implemented for all 8 page components using `next/dynamic` with custom Spanish loading states
7
+ - **State-driven navigation**: Uses `use