@mcp-graph-workflow/mcp-graph 5.2.0 → 5.4.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 (244) hide show
  1. package/dist/api/router.d.ts +0 -1
  2. package/dist/api/router.d.ts.map +1 -1
  3. package/dist/api/router.js +4 -5
  4. package/dist/api/router.js.map +1 -1
  5. package/dist/api/routes/benchmark.d.ts.map +1 -1
  6. package/dist/api/routes/benchmark.js +47 -2
  7. package/dist/api/routes/benchmark.js.map +1 -1
  8. package/dist/api/routes/code-graph.d.ts +12 -0
  9. package/dist/api/routes/code-graph.d.ts.map +1 -0
  10. package/dist/api/routes/code-graph.js +154 -0
  11. package/dist/api/routes/code-graph.js.map +1 -0
  12. package/dist/api/routes/context.d.ts.map +1 -1
  13. package/dist/api/routes/context.js +75 -0
  14. package/dist/api/routes/context.js.map +1 -1
  15. package/dist/api/routes/folder.d.ts +1 -4
  16. package/dist/api/routes/folder.d.ts.map +1 -1
  17. package/dist/api/routes/folder.js +19 -17
  18. package/dist/api/routes/folder.js.map +1 -1
  19. package/dist/api/routes/integrations.d.ts.map +1 -1
  20. package/dist/api/routes/integrations.js +60 -16
  21. package/dist/api/routes/integrations.js.map +1 -1
  22. package/dist/api/routes/knowledge.js +1 -1
  23. package/dist/api/routes/knowledge.js.map +1 -1
  24. package/dist/api/routes/skills.d.ts +2 -1
  25. package/dist/api/routes/skills.d.ts.map +1 -1
  26. package/dist/api/routes/skills.js +194 -4
  27. package/dist/api/routes/skills.js.map +1 -1
  28. package/dist/cli/commands/index-cmd.js +5 -5
  29. package/dist/cli/commands/index-cmd.js.map +1 -1
  30. package/dist/core/code/code-indexer.d.ts +20 -0
  31. package/dist/core/code/code-indexer.d.ts.map +1 -0
  32. package/dist/core/code/code-indexer.js +161 -0
  33. package/dist/core/code/code-indexer.js.map +1 -0
  34. package/dist/core/code/code-search.d.ts +16 -0
  35. package/dist/core/code/code-search.d.ts.map +1 -0
  36. package/dist/core/code/code-search.js +77 -0
  37. package/dist/core/code/code-search.js.map +1 -0
  38. package/dist/core/code/code-store.d.ts +35 -0
  39. package/dist/core/code/code-store.d.ts.map +1 -0
  40. package/dist/core/code/code-store.js +228 -0
  41. package/dist/core/code/code-store.js.map +1 -0
  42. package/dist/core/code/code-types.d.ts +209 -0
  43. package/dist/core/code/code-types.d.ts.map +1 -0
  44. package/dist/core/code/code-types.js +94 -0
  45. package/dist/core/code/code-types.js.map +1 -0
  46. package/dist/core/code/graph-traversal.d.ts +27 -0
  47. package/dist/core/code/graph-traversal.d.ts.map +1 -0
  48. package/dist/core/code/graph-traversal.js +122 -0
  49. package/dist/core/code/graph-traversal.js.map +1 -0
  50. package/dist/core/code/process-detector.d.ts +11 -0
  51. package/dist/core/code/process-detector.d.ts.map +1 -0
  52. package/dist/core/code/process-detector.js +65 -0
  53. package/dist/core/code/process-detector.js.map +1 -0
  54. package/dist/core/code/ts-analyzer.d.ts +12 -0
  55. package/dist/core/code/ts-analyzer.d.ts.map +1 -0
  56. package/dist/core/code/ts-analyzer.js +331 -0
  57. package/dist/core/code/ts-analyzer.js.map +1 -0
  58. package/dist/core/config/ai-memory-generator.d.ts.map +1 -1
  59. package/dist/core/config/ai-memory-generator.js +149 -61
  60. package/dist/core/config/ai-memory-generator.js.map +1 -1
  61. package/dist/core/config/config-loader.d.ts.map +1 -1
  62. package/dist/core/config/config-loader.js +2 -10
  63. package/dist/core/config/config-loader.js.map +1 -1
  64. package/dist/core/config/config-schema.d.ts +1 -2
  65. package/dist/core/config/config-schema.d.ts.map +1 -1
  66. package/dist/core/config/config-schema.js +2 -3
  67. package/dist/core/config/config-schema.js.map +1 -1
  68. package/dist/core/context/compact-context.d.ts +51 -0
  69. package/dist/core/context/compact-context.d.ts.map +1 -1
  70. package/dist/core/context/compact-context.js +292 -0
  71. package/dist/core/context/compact-context.js.map +1 -1
  72. package/dist/core/context/context-assembler.d.ts +1 -1
  73. package/dist/core/context/context-assembler.js +1 -1
  74. package/dist/core/doctor/doctor-checks.d.ts +1 -1
  75. package/dist/core/doctor/doctor-checks.js +21 -21
  76. package/dist/core/doctor/doctor-checks.js.map +1 -1
  77. package/dist/core/events/event-types.d.ts +18 -1
  78. package/dist/core/events/event-types.d.ts.map +1 -1
  79. package/dist/core/graph/graph-types.d.ts +1 -0
  80. package/dist/core/graph/graph-types.d.ts.map +1 -1
  81. package/dist/core/insights/bottleneck-detector.js +1 -1
  82. package/dist/core/insights/bottleneck-detector.js.map +1 -1
  83. package/dist/core/integrations/enriched-context.d.ts +10 -6
  84. package/dist/core/integrations/enriched-context.d.ts.map +1 -1
  85. package/dist/core/integrations/enriched-context.js +35 -35
  86. package/dist/core/integrations/enriched-context.js.map +1 -1
  87. package/dist/core/integrations/integration-orchestrator.js +2 -2
  88. package/dist/core/integrations/integration-orchestrator.js.map +1 -1
  89. package/dist/core/integrations/mcp-deps-installer.d.ts +1 -1
  90. package/dist/core/integrations/mcp-deps-installer.d.ts.map +1 -1
  91. package/dist/core/integrations/mcp-deps-installer.js +1 -60
  92. package/dist/core/integrations/mcp-deps-installer.js.map +1 -1
  93. package/dist/core/integrations/mcp-servers-config.d.ts +1 -1
  94. package/dist/core/integrations/mcp-servers-config.d.ts.map +1 -1
  95. package/dist/core/integrations/mcp-servers-config.js +0 -17
  96. package/dist/core/integrations/mcp-servers-config.js.map +1 -1
  97. package/dist/core/integrations/tool-status.d.ts +8 -3
  98. package/dist/core/integrations/tool-status.d.ts.map +1 -1
  99. package/dist/core/integrations/tool-status.js +38 -48
  100. package/dist/core/integrations/tool-status.js.map +1 -1
  101. package/dist/core/memory/memory-migrator.d.ts +15 -0
  102. package/dist/core/memory/memory-migrator.d.ts.map +1 -0
  103. package/dist/core/memory/memory-migrator.js +64 -0
  104. package/dist/core/memory/memory-migrator.js.map +1 -0
  105. package/dist/core/memory/memory-reader.d.ts +30 -0
  106. package/dist/core/memory/memory-reader.d.ts.map +1 -0
  107. package/dist/core/memory/memory-reader.js +106 -0
  108. package/dist/core/memory/memory-reader.js.map +1 -0
  109. package/dist/core/planner/lifecycle-phase.d.ts +1 -0
  110. package/dist/core/planner/lifecycle-phase.d.ts.map +1 -1
  111. package/dist/core/planner/lifecycle-phase.js +11 -8
  112. package/dist/core/planner/lifecycle-phase.js.map +1 -1
  113. package/dist/core/rag/memory-indexer.d.ts +16 -0
  114. package/dist/core/rag/memory-indexer.d.ts.map +1 -0
  115. package/dist/core/rag/{serena-indexer.js → memory-indexer.js} +12 -12
  116. package/dist/core/rag/memory-indexer.js.map +1 -0
  117. package/dist/core/rag/{serena-rag-query.d.ts → memory-rag-query.d.ts} +11 -9
  118. package/dist/core/rag/memory-rag-query.d.ts.map +1 -0
  119. package/dist/core/rag/{serena-rag-query.js → memory-rag-query.js} +18 -15
  120. package/dist/core/rag/memory-rag-query.js.map +1 -0
  121. package/dist/core/rag/skill-indexer.d.ts +16 -0
  122. package/dist/core/rag/skill-indexer.d.ts.map +1 -0
  123. package/dist/core/rag/skill-indexer.js +98 -0
  124. package/dist/core/rag/skill-indexer.js.map +1 -0
  125. package/dist/core/skills/built-in-skills.d.ts +26 -0
  126. package/dist/core/skills/built-in-skills.d.ts.map +1 -0
  127. package/dist/core/skills/built-in-skills.js +467 -0
  128. package/dist/core/skills/built-in-skills.js.map +1 -0
  129. package/dist/core/skills/self-healing-listener.d.ts +22 -0
  130. package/dist/core/skills/self-healing-listener.d.ts.map +1 -0
  131. package/dist/core/skills/self-healing-listener.js +102 -0
  132. package/dist/core/skills/self-healing-listener.js.map +1 -0
  133. package/dist/core/skills/skill-store.d.ts +14 -0
  134. package/dist/core/skills/skill-store.d.ts.map +1 -0
  135. package/dist/core/skills/skill-store.js +109 -0
  136. package/dist/core/skills/skill-store.js.map +1 -0
  137. package/dist/core/store/knowledge-store.d.ts +1 -1
  138. package/dist/core/store/knowledge-store.js +1 -1
  139. package/dist/core/store/migrations.d.ts.map +1 -1
  140. package/dist/core/store/migrations.js +128 -0
  141. package/dist/core/store/migrations.js.map +1 -1
  142. package/dist/core/store/path-resolver.d.ts +38 -0
  143. package/dist/core/store/path-resolver.d.ts.map +1 -0
  144. package/dist/core/store/path-resolver.js +92 -0
  145. package/dist/core/store/path-resolver.js.map +1 -0
  146. package/dist/core/store/sqlite-store.d.ts +21 -0
  147. package/dist/core/store/sqlite-store.d.ts.map +1 -1
  148. package/dist/core/store/sqlite-store.js +81 -30
  149. package/dist/core/store/sqlite-store.js.map +1 -1
  150. package/dist/core/store/tool-token-store.d.ts +39 -0
  151. package/dist/core/store/tool-token-store.d.ts.map +1 -0
  152. package/dist/core/store/tool-token-store.js +79 -0
  153. package/dist/core/store/tool-token-store.js.map +1 -0
  154. package/dist/core/utils/constants.d.ts +10 -0
  155. package/dist/core/utils/constants.d.ts.map +1 -1
  156. package/dist/core/utils/constants.js +12 -0
  157. package/dist/core/utils/constants.js.map +1 -1
  158. package/dist/mcp/app-factory.d.ts +0 -1
  159. package/dist/mcp/app-factory.d.ts.map +1 -1
  160. package/dist/mcp/app-factory.js +2 -2
  161. package/dist/mcp/app-factory.js.map +1 -1
  162. package/dist/mcp/lifecycle-wrapper.d.ts +3 -1
  163. package/dist/mcp/lifecycle-wrapper.d.ts.map +1 -1
  164. package/dist/mcp/lifecycle-wrapper.js +41 -1
  165. package/dist/mcp/lifecycle-wrapper.js.map +1 -1
  166. package/dist/mcp/server.js +19 -14
  167. package/dist/mcp/server.js.map +1 -1
  168. package/dist/mcp/tools/index.d.ts.map +1 -1
  169. package/dist/mcp/tools/index.js +6 -0
  170. package/dist/mcp/tools/index.js.map +1 -1
  171. package/dist/mcp/tools/list-skills.d.ts +7 -0
  172. package/dist/mcp/tools/list-skills.d.ts.map +1 -0
  173. package/dist/mcp/tools/list-skills.js +68 -0
  174. package/dist/mcp/tools/list-skills.js.map +1 -0
  175. package/dist/mcp/tools/manage-skill.d.ts +8 -0
  176. package/dist/mcp/tools/manage-skill.d.ts.map +1 -0
  177. package/dist/mcp/tools/manage-skill.js +149 -0
  178. package/dist/mcp/tools/manage-skill.js.map +1 -0
  179. package/dist/mcp/tools/memory.d.ts +8 -0
  180. package/dist/mcp/tools/memory.d.ts.map +1 -0
  181. package/dist/mcp/tools/memory.js +106 -0
  182. package/dist/mcp/tools/memory.js.map +1 -0
  183. package/dist/mcp/tools/reindex-knowledge.d.ts.map +1 -1
  184. package/dist/mcp/tools/reindex-knowledge.js +11 -7
  185. package/dist/mcp/tools/reindex-knowledge.js.map +1 -1
  186. package/dist/schemas/graph.schema.d.ts +2 -0
  187. package/dist/schemas/graph.schema.d.ts.map +1 -1
  188. package/dist/schemas/graph.schema.js +1 -0
  189. package/dist/schemas/graph.schema.js.map +1 -1
  190. package/dist/schemas/knowledge.schema.d.ts +4 -0
  191. package/dist/schemas/knowledge.schema.d.ts.map +1 -1
  192. package/dist/schemas/knowledge.schema.js +1 -1
  193. package/dist/schemas/knowledge.schema.js.map +1 -1
  194. package/dist/schemas/skill.schema.d.ts +57 -0
  195. package/dist/schemas/skill.schema.d.ts.map +1 -0
  196. package/dist/schemas/skill.schema.js +24 -0
  197. package/dist/schemas/skill.schema.js.map +1 -0
  198. package/dist/web/dashboard/dist/assets/benchmark-tab-BW4QxI49.js +1 -0
  199. package/dist/web/dashboard/dist/assets/constants-kpH_c6vY.js +1 -0
  200. package/dist/web/dashboard/dist/assets/context-tab-C5RAlXNW.js +1 -0
  201. package/dist/web/dashboard/dist/assets/gitnexus-tab-BnxxYl2F.js +430 -0
  202. package/dist/web/dashboard/dist/assets/graph-tab-Cv_wQ6Az.js +1 -0
  203. package/dist/web/dashboard/dist/assets/graph-utils-Ds1zJyD1.js +7 -0
  204. package/dist/web/dashboard/dist/assets/index-BAeZDWWy.js +53 -0
  205. package/dist/web/dashboard/dist/assets/index-Bic_URMs.js +17 -0
  206. package/dist/web/dashboard/dist/assets/index-DQqYFXms.css +1 -0
  207. package/dist/web/dashboard/dist/assets/insights-tab-U_ATOqPu.js +52 -0
  208. package/dist/web/dashboard/dist/assets/{logs-tab-Cxpcv_ni.js → logs-tab-B8psCXuB.js} +1 -1
  209. package/dist/web/dashboard/dist/assets/memories-tab-DcWok2by.js +1 -0
  210. package/dist/web/dashboard/dist/assets/prd-backlog-tab-CjftveTc.js +1 -0
  211. package/dist/web/dashboard/dist/assets/skills-tab-Ddp1w4vS.js +1 -0
  212. package/dist/web/dashboard/dist/index.html +2 -2
  213. package/package.json +2 -2
  214. package/dist/api/routes/gitnexus.d.ts +0 -12
  215. package/dist/api/routes/gitnexus.d.ts.map +0 -1
  216. package/dist/api/routes/gitnexus.js +0 -164
  217. package/dist/api/routes/gitnexus.js.map +0 -1
  218. package/dist/core/integrations/gitnexus-launcher.d.ts +0 -67
  219. package/dist/core/integrations/gitnexus-launcher.d.ts.map +0 -1
  220. package/dist/core/integrations/gitnexus-launcher.js +0 -268
  221. package/dist/core/integrations/gitnexus-launcher.js.map +0 -1
  222. package/dist/core/integrations/gitnexus-queries.d.ts +0 -55
  223. package/dist/core/integrations/gitnexus-queries.d.ts.map +0 -1
  224. package/dist/core/integrations/gitnexus-queries.js +0 -168
  225. package/dist/core/integrations/gitnexus-queries.js.map +0 -1
  226. package/dist/core/integrations/serena-reader.d.ts +0 -18
  227. package/dist/core/integrations/serena-reader.d.ts.map +0 -1
  228. package/dist/core/integrations/serena-reader.js +0 -68
  229. package/dist/core/integrations/serena-reader.js.map +0 -1
  230. package/dist/core/rag/serena-indexer.d.ts +0 -16
  231. package/dist/core/rag/serena-indexer.d.ts.map +0 -1
  232. package/dist/core/rag/serena-indexer.js.map +0 -1
  233. package/dist/core/rag/serena-rag-query.d.ts.map +0 -1
  234. package/dist/core/rag/serena-rag-query.js.map +0 -1
  235. package/dist/web/dashboard/dist/assets/benchmark-tab-DE6hAHVG.js +0 -1
  236. package/dist/web/dashboard/dist/assets/constants-BIEJOBya.js +0 -1
  237. package/dist/web/dashboard/dist/assets/gitnexus-tab-DsBjJHx8.js +0 -312
  238. package/dist/web/dashboard/dist/assets/graph-tab-C09DzeZ_.js +0 -1
  239. package/dist/web/dashboard/dist/assets/graph-utils-D4LFspTf.js +0 -23
  240. package/dist/web/dashboard/dist/assets/index-B2fTJ4AS.js +0 -53
  241. package/dist/web/dashboard/dist/assets/index-CkqEqKiH.css +0 -1
  242. package/dist/web/dashboard/dist/assets/insights-tab-Bm7CDckb.js +0 -1
  243. package/dist/web/dashboard/dist/assets/prd-backlog-tab-X84Rj-IB.js +0 -1
  244. package/dist/web/dashboard/dist/assets/serena-tab-BunULNvw.js +0 -1
@@ -1,2 +1,2 @@
1
- import{r,a as f,j as t}from"./index-B2fTJ4AS.js";function w(){const[l,o]=r.useState([]),[n,v]=r.useState(!0),d=r.useRef(0),p=r.useCallback(async()=>{try{const{logs:c}=await f.getLogs();o(c),c.length>0&&(d.current=c[c.length-1].id)}finally{v(!1)}},[]),u=r.useCallback(async()=>{await f.clearLogs(),o([]),d.current=0},[]);return r.useEffect(()=>{p()},[p]),r.useEffect(()=>{const c=new EventSource("/api/v1/events"),i=b=>{try{const s=JSON.parse(b.data),a={id:s.payload.id,level:s.payload.level,message:s.payload.message,context:s.payload.context,timestamp:s.timestamp};a.id>d.current&&(d.current=a.id,o(h=>[...h,a]))}catch{}};return c.addEventListener("log:entry",i),c.onerror=()=>{c.close(),setTimeout(()=>{},5e3)},()=>c.close()},[]),{logs:l,loading:n,clearLogs:u,refresh:p}}const k={info:"bg-blue-500/20 text-blue-400",warn:"bg-yellow-500/20 text-yellow-400",error:"bg-red-500/20 text-red-400",success:"bg-green-500/20 text-green-400",debug:"bg-gray-500/20 text-gray-400"},E=["info","warn","error","success","debug"];function y(l){return new Date(l).toLocaleTimeString("en-US",{hour12:!1})}function L(l){return!l||Object.keys(l).length===0?"":Object.entries(l).map(([o,n])=>`${o}="${String(n)}"`).join(" ")}function j(l){return l.map(o=>{const n=L(o.context);return`[${y(o.timestamp)}] [${o.level.toUpperCase()}] ${o.message}${n?" "+n:""}`}).join(`
1
+ import{r,a as f,j as t}from"./index-BAeZDWWy.js";function w(){const[l,o]=r.useState([]),[n,v]=r.useState(!0),d=r.useRef(0),p=r.useCallback(async()=>{try{const{logs:c}=await f.getLogs();o(c),c.length>0&&(d.current=c[c.length-1].id)}finally{v(!1)}},[]),u=r.useCallback(async()=>{await f.clearLogs(),o([]),d.current=0},[]);return r.useEffect(()=>{p()},[p]),r.useEffect(()=>{const c=new EventSource("/api/v1/events"),i=b=>{try{const s=JSON.parse(b.data),a={id:s.payload.id,level:s.payload.level,message:s.payload.message,context:s.payload.context,timestamp:s.timestamp};a.id>d.current&&(d.current=a.id,o(h=>[...h,a]))}catch{}};return c.addEventListener("log:entry",i),c.onerror=()=>{c.close(),setTimeout(()=>{},5e3)},()=>c.close()},[]),{logs:l,loading:n,clearLogs:u,refresh:p}}const k={info:"bg-blue-500/20 text-blue-400",warn:"bg-yellow-500/20 text-yellow-400",error:"bg-red-500/20 text-red-400",success:"bg-green-500/20 text-green-400",debug:"bg-gray-500/20 text-gray-400"},E=["info","warn","error","success","debug"];function y(l){return new Date(l).toLocaleTimeString("en-US",{hour12:!1})}function L(l){return!l||Object.keys(l).length===0?"":Object.entries(l).map(([o,n])=>`${o}="${String(n)}"`).join(" ")}function j(l){return l.map(o=>{const n=L(o.context);return`[${y(o.timestamp)}] [${o.level.toUpperCase()}] ${o.message}${n?" "+n:""}`}).join(`
2
2
  `)}function O(){const{logs:l,loading:o,clearLogs:n,refresh:v}=w(),[d,p]=r.useState("all"),[u,c]=r.useState(""),[i,b]=r.useState(!0),s=r.useRef(null),a=r.useMemo(()=>{let e=l;if(d!=="all"&&(e=e.filter(x=>x.level===d)),u.trim()){const x=u.toLowerCase();e=e.filter(g=>g.message.toLowerCase().includes(x))}return e},[l,d,u]);r.useEffect(()=>{i&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[a,i]);const h=r.useCallback(()=>{if(!s.current)return;const{scrollTop:e,scrollHeight:x,clientHeight:g}=s.current,m=x-e-g<40;b(m)},[]),C=r.useCallback(async()=>{const e=j(a);await navigator.clipboard.writeText(e)},[a]),N=r.useCallback(()=>{const e=j(a),x=new Blob([e],{type:"text/plain"}),g=URL.createObjectURL(x),m=document.createElement("a");m.href=g,m.download=`mcp-graph-logs-${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.txt`,m.click(),URL.revokeObjectURL(g)},[a]),S=r.useCallback(async()=>{await n()},[n]);return o?t.jsx("div",{className:"flex items-center justify-center h-full text-[var(--color-text-muted)]",children:"Loading logs..."}):t.jsxs("div",{className:"flex flex-col h-full","data-testid":"logs-tab",children:[t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-[var(--color-border)] bg-[var(--color-bg-secondary)]",children:[t.jsxs("select",{value:d,onChange:e=>p(e.target.value),className:"px-2 py-1 text-sm rounded border border-[var(--color-border)] bg-[var(--color-bg)] text-[var(--color-text)]","data-testid":"log-level-filter",children:[t.jsx("option",{value:"all",children:"All Levels"}),E.map(e=>t.jsx("option",{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))]}),t.jsx("input",{type:"text",value:u,onChange:e=>c(e.target.value),placeholder:"Search logs...",className:"flex-1 px-2 py-1 text-sm rounded border border-[var(--color-border)] bg-[var(--color-bg)] text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]","data-testid":"log-search"}),t.jsx("button",{onClick:()=>b(!i),className:`px-2 py-1 text-xs rounded border ${i?"border-[var(--color-accent)] text-[var(--color-accent)]":"border-[var(--color-border)] text-[var(--color-text-muted)]"}`,title:i?"Auto-scroll enabled":"Auto-scroll paused",children:i?"Auto-scroll ON":"Auto-scroll OFF"}),t.jsx("button",{onClick:C,className:"px-2 py-1 text-xs rounded border border-[var(--color-border)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",title:"Copy all visible logs",children:"Copy"}),t.jsx("button",{onClick:N,className:"px-2 py-1 text-xs rounded border border-[var(--color-border)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",title:"Download logs as .txt",children:"Download"}),t.jsx("button",{onClick:S,className:"px-2 py-1 text-xs rounded border border-red-500/30 text-red-400 hover:bg-red-500/10",title:"Clear all logs",children:"Clear"}),t.jsx("button",{onClick:()=>void v(),className:"px-2 py-1 text-xs rounded border border-[var(--color-border)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",title:"Refresh logs",children:"Refresh"}),t.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[a.length," entries"]})]}),t.jsx("div",{ref:s,onScroll:h,className:"flex-1 overflow-y-auto font-mono text-xs p-2","data-testid":"log-list",children:a.length===0?t.jsx("div",{className:"flex items-center justify-center h-full text-[var(--color-text-muted)]",children:"No logs to display"}):a.map(e=>t.jsxs("div",{className:"flex items-start gap-2 py-0.5 hover:bg-[var(--color-bg-secondary)]",children:[t.jsx("span",{className:"text-[var(--color-text-muted)] shrink-0",children:y(e.timestamp)}),t.jsx("span",{className:`px-1.5 py-0 rounded text-[10px] font-semibold uppercase shrink-0 ${k[e.level]}`,children:e.level}),t.jsx("span",{className:"text-[var(--color-text)]",children:e.message}),e.context&&Object.keys(e.context).length>0&&t.jsx("span",{className:"text-[var(--color-text-muted)]",children:L(e.context)})]},e.id))})]})}export{O as LogsTab};
@@ -0,0 +1 @@
1
+ import{r as i,a as b,j as e}from"./index-BAeZDWWy.js";function j(t){const c=[];for(const l of t){const o=l.name.split("/");let a=c;for(let n=0;n<o.length;n++){const r=o[n],x=o.slice(0,n+1).join("/"),d=n===o.length-1;let s=a.find(f=>f.name===r);s||(s={name:r,path:x,children:[]},d&&(s.memory=l),a.push(s)),d&&!s.memory&&(s.memory=l),a=s.children}}return c}function S(){const[t,c]=i.useState([]),[l,o]=i.useState(null),[a,n]=i.useState(null),[r,x]=i.useState(!0),d=i.useCallback(async()=>{try{x(!0);const s=await b.getMemories().catch(()=>[]);c(s)}catch(s){n(s instanceof Error?s.message:"Failed to load")}finally{x(!1)}},[]);return i.useEffect(()=>{d()},[d]),r?e.jsx("div",{className:"flex items-center justify-center h-full text-[var(--color-text-muted)]",children:"Loading Memories..."}):a?e.jsxs("div",{className:"flex items-center justify-center h-full text-[var(--color-danger)]",children:["Failed to load: ",a]}):e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-[var(--color-border)] bg-[var(--color-bg-secondary)]",children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Memories"}),e.jsx(g,{label:"Memories",active:t.length>0}),e.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:[t.length," memories"]})]}),e.jsxs("div",{className:"flex flex-1 min-h-0",children:[e.jsx(N,{memories:t,selectedMemory:l,onSelect:o}),e.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:e.jsx(y,{selectedMemory:l})})]})]})}function g({label:t,active:c}){const l=c?"var(--color-success)":"var(--color-text-muted)",o=c?"Active":"No data";return e.jsxs("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{background:`${l}20`,color:l},children:[t,": ",o]})}function N({memories:t,selectedMemory:c,onSelect:l}){const[o,a]=i.useState(""),[n,r]=i.useState(!1),[x,d]=i.useState(new Set),s=i.useMemo(()=>{if(!o.trim())return t;const m=o.toLowerCase();return t.filter(p=>p.name.toLowerCase().includes(m))},[t,o]),f=i.useMemo(()=>j(s),[s]),v=i.useCallback(m=>{d(p=>{const u=new Set(p);return u.has(m)?u.delete(m):u.add(m),u})},[]);return n?e.jsx("div",{className:"w-8 border-r border-[var(--color-border)] bg-[var(--color-bg-secondary)] flex flex-col items-center pt-2",children:e.jsx("button",{onClick:()=>r(!1),className:"text-[10px] text-[var(--color-text-muted)] hover:text-[var(--color-text)] rotate-90",title:"Expand file explorer",children:"Files"})}):e.jsxs("div",{className:"w-64 border-r border-[var(--color-border)] bg-[var(--color-bg-secondary)] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-[var(--color-border)]",children:[e.jsx("span",{className:"text-[10px] font-semibold text-[var(--color-text-muted)] uppercase tracking-wider",children:"Files"}),e.jsx("button",{onClick:()=>r(!0),className:"text-[10px] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",title:"Collapse",children:"✕"})]}),e.jsx("div",{className:"px-2 py-1.5 border-b border-[var(--color-border)]",children:e.jsx("input",{type:"text",value:o,onChange:m=>a(m.target.value),placeholder:"Search files...",className:"w-full text-[11px] px-2 py-1 rounded bg-[var(--color-bg)] border border-[var(--color-border)] focus:outline-none focus:border-[var(--color-accent)]"})}),e.jsx("div",{className:"flex-1 overflow-y-auto text-[11px]",children:t.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-[var(--color-text-muted)]",children:"No memories"}):e.jsx(h,{nodes:f,depth:0,expandedPaths:x,onToggle:v,selectedMemory:c,onSelect:l})})]})}function h({nodes:t,depth:c,expandedPaths:l,onToggle:o,selectedMemory:a,onSelect:n}){return e.jsx(e.Fragment,{children:t.map(r=>{const x=r.children.length>0,d=l.has(r.path),s=r.memory!=null&&(a==null?void 0:a.name)===r.memory.name;return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>{x&&o(r.path),r.memory&&n(r.memory)},className:`w-full text-left px-2 py-0.5 flex items-center gap-1 hover:bg-[var(--color-bg-tertiary)] transition-colors ${s?"bg-[var(--color-accent)]15 text-[var(--color-accent)]":"text-[var(--color-text)]"}`,style:{paddingLeft:`${c*12+8}px`},children:[x?e.jsx("span",{className:"w-3 text-[9px] text-[var(--color-text-muted)]",children:d?"▾":"▸"}):e.jsx("span",{className:"w-3 text-[9px] text-[var(--color-text-muted)]",children:"·"}),e.jsx("span",{className:"truncate",children:r.name})]}),x&&d&&e.jsx(h,{nodes:r.children,depth:c+1,expandedPaths:l,onToggle:o,selectedMemory:a,onSelect:n})]},r.path)})})}function y({selectedMemory:t}){return t?e.jsxs("div",{className:"p-4",children:[e.jsx("div",{className:"flex items-center gap-2 mb-3 pb-2 border-b border-[var(--color-border)]",children:e.jsx("span",{className:"text-sm font-semibold",children:t.name})}),e.jsx("pre",{className:"text-xs whitespace-pre-wrap text-[var(--color-text-muted)] font-mono leading-relaxed",children:t.content})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-[var(--color-text-muted)]",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm mb-1",children:"Select a memory from the explorer"}),e.jsx("p",{className:"text-xs",children:"Project memories appear as navigable files"})]})})}export{S as MemoriesTab};
@@ -0,0 +1 @@
1
+ import{r as a,j as e}from"./index-BAeZDWWy.js";import{R as _,u as M,a as E,h as P,b as T,g as B,t as D,d as R,e as F,i as $,W as z,f as I,B as L,C as A,N as O}from"./graph-utils-Ds1zJyD1.js";import{S as y}from"./constants-kpH_c6vY.js";import"./index-Bic_URMs.js";const V=a.memo(function({graph:c,onNodeClick:N}){const{groups:w,nextTask:h,nodeMap:g}=a.useMemo(()=>{const d=c.nodes.filter(s=>s.type==="task"||s.type==="subtask"),x=new Map(c.nodes.map(s=>[s.id,s])),m=new Set(c.nodes.filter(s=>s.status==="done").map(s=>s.id)),f=d.filter(s=>s.status!=="backlog"&&s.status!=="ready"||s.blocked?!1:c.edges.filter(r=>r.from===s.id&&r.relationType==="depends_on").every(r=>m.has(r.to)));f.sort((s,t)=>s.priority-t.priority);const i=new Map;for(const s of d){const t=s.parentId||"__root__";i.has(t)||i.set(t,[]),i.get(t).push(s)}for(const s of i.values())s.sort((t,r)=>t.priority-r.priority);return{groups:i,nextTask:f[0]||null,nodeMap:x}},[c]);return c.nodes.filter(d=>d.type==="task"||d.type==="subtask").length===0?e.jsx("div",{className:"p-4 text-center text-[var(--color-text-muted)]",children:"No tasks in backlog."}):e.jsxs("div",{className:"p-2",children:[h&&e.jsxs("div",{className:"mb-3 px-3 py-2 bg-[var(--color-accent)]10 border border-[var(--color-accent)] rounded-lg",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--color-accent)]",children:"Next:"})," ",e.jsx("span",{className:"text-sm font-semibold",children:h.title})]}),Array.from(w.entries()).map(([d,x])=>{const m=d!=="__root__"?g.get(d):null,f=m?m.title:"Ungrouped Tasks",i=x.filter(t=>t.status==="done").length,s=Math.round(i/x.length*100);return e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[e.jsx("h4",{className:"text-xs font-semibold truncate",children:f}),e.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:[i,"/",x.length]})]}),e.jsx("div",{className:"h-1 mx-2 mb-1 bg-[var(--color-bg-tertiary)] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${s}%`,background:y.done}})}),x.map(t=>{const r=(h==null?void 0:h.id)===t.id,v=y[t.status]||"#9e9e9e",j=c.edges.filter(n=>n.from===t.id&&n.relationType==="depends_on").map(n=>{var l;return((l=g.get(n.to))==null?void 0:l.title)||n.to});return e.jsxs("div",{onClick:()=>N(t),className:`mx-1 mb-1 px-2 py-1.5 rounded cursor-pointer hover:bg-[var(--color-bg-tertiary)] transition-colors ${r?"ring-1 ring-[var(--color-accent)]":""}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[9px] px-1 py-0.5 rounded font-medium shrink-0",style:{background:`${v}20`,color:v},children:t.status.replace("_"," ")}),e.jsx("span",{className:"text-xs truncate flex-1",children:t.title}),e.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["P",t.priority]}),t.xpSize&&e.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:t.xpSize})]}),j.length>0&&e.jsxs("div",{className:"text-[10px] text-[var(--color-text-muted)] mt-0.5 truncate pl-1",children:["Depends on: ",j.join(", ")]})]},t.id)})]},d)})]})}),W={workflowNode:I},U={workflowEdge:z},Z={hideAttribution:!0};function G({graph:o}){const[c,N,w]=M([]),[h,g,d]=E([]),[x,m]=a.useState(null),[f,i]=a.useState(new Set),s=a.useRef(!0),{fitView:t}=P(),r=a.useMemo(()=>T(o.nodes,o.edges),[o.nodes,o.edges]),v=a.useCallback(l=>{i(u=>{const p=new Set(u);return p.has(l)?p.delete(l):p.add(l),p})},[]);a.useEffect(()=>{const l=B(o.nodes,f,r),u=D(l,void 0,r,f,v),p=new Set(u.map(S=>S.id)),k=R(o.edges,p),b=F(u,k,"TB");N(b.nodes),g(b.edges),s.current?s.current=!1:setTimeout(()=>t({duration:300}),50)},[o,N,g,f,r,v,t]);const C=a.useCallback((l,u)=>{m(u.data.sourceNode)},[]),j=a.useCallback(l=>{m(l)},[]),n=a.useMemo(()=>{const l=o.nodes.length,u=o.nodes.filter(b=>b.status==="done").length,p=o.nodes.filter(b=>b.status==="in_progress").length,k=o.nodes.filter(b=>b.status==="blocked").length;return{total:l,done:u,inProgress:p,blocked:k,pctDone:l?Math.round(u/l*100):0}},[o.nodes]);return e.jsxs("div",{className:"flex h-full",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[e.jsx("div",{className:"px-3 py-1.5 bg-[var(--color-bg-secondary)] border-b border-[var(--color-border)] flex items-center gap-2 text-xs relative z-10",children:e.jsxs("span",{className:"text-[var(--color-text-muted)]",children:["Showing ",c.length," of ",o.nodes.length," nodes — click ▶ to expand"]})}),o.nodes.length>0?e.jsxs($,{nodes:c,edges:h,onNodesChange:w,onEdgesChange:d,onNodeClick:C,nodeTypes:W,edgeTypes:U,nodesDraggable:!1,nodesConnectable:!1,fitView:!0,minZoom:.1,maxZoom:2,proOptions:Z,children:[e.jsx(L,{gap:16,size:1}),e.jsx(A,{showInteractive:!1})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-[var(--color-text-muted)]",children:"Import a PRD to see the workflow"})]}),e.jsxs("div",{className:"w-96 border-l border-[var(--color-border)] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-[var(--color-border)] bg-[var(--color-bg-secondary)]",children:[e.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[e.jsxs("span",{children:[n.done,"/",n.total," done (",n.pctDone,"%)"]}),e.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[n.inProgress," in progress, ",n.blocked," blocked"]})]}),e.jsxs("div",{className:"h-2 bg-[var(--color-bg-tertiary)] rounded-full overflow-hidden flex",children:[e.jsx("div",{className:"h-full transition-all",style:{width:`${n.pctDone}%`,background:y.done}}),e.jsx("div",{className:"h-full transition-all",style:{width:`${n.total?Math.round(n.inProgress/n.total*100):0}%`,background:y.in_progress}})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(V,{graph:o,onNodeClick:j})})]}),x&&e.jsx(O,{node:x,onClose:()=>m(null)})]})}function Q({graph:o}){return e.jsx(_,{children:e.jsx(G,{graph:o})})}export{Q as PrdBacklogTab};
@@ -0,0 +1 @@
1
+ import{r as a,a as k,j as e}from"./index-BAeZDWWy.js";function O(){const[t,s]=a.useState([]),[x,l]=a.useState([]),[i,n]=a.useState(0),[m,h]=a.useState(!0),[b,v]=a.useState(null),d=a.useCallback(async()=>{h(!0),v(null);try{const[o,u]=await Promise.all([k.getSkills(),k.getRecommendations().catch(()=>({recommendations:[]}))]);s(o.skills),n(o.totalTokens),l(u.recommendations)}catch(o){v(o instanceof Error?o.message:"Failed to load skills")}finally{h(!1)}},[]);a.useEffect(()=>{d()},[d]);const N=a.useCallback(async(o,u)=>{s(S=>S.map(y=>y.name===o?{...y,enabled:u}:y));try{await k.toggleSkill(o,u)}catch{d()}},[d]),p=a.useCallback(async o=>{await k.createCustomSkill(o),d()},[d]),j=a.useCallback(async(o,u)=>{await k.updateCustomSkill(o,u),d()},[d]),f=a.useCallback(async o=>{await k.deleteCustomSkill(o),d()},[d]),g=t.filter(o=>o.enabled).reduce((o,u)=>o+u.estimatedTokens,0);return{skills:t,recommendations:x,totalTokens:i,activeTokens:g,loading:m,error:b,refresh:d,toggleSkill:N,createSkill:p,updateSkill:j,deleteSkill:f}}const F={ANALYZE:"#8b5cf6",DESIGN:"#3b82f6",PLAN:"#06b6d4",IMPLEMENT:"#10b981",VALIDATE:"#f59e0b",REVIEW:"#ef4444",HANDOFF:"#ec4899",LISTENING:"#6b7280"};function G({skill:t,onClose:s,onToggle:x,onDelete:l,onEdit:i}){return t?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:n=>{n.target===n.currentTarget&&s()},children:e.jsxs("div",{className:"bg-[var(--color-bg)] rounded-lg shadow-xl w-full max-w-lg p-6 max-h-[80vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-lg font-semibold truncate",children:t.name}),e.jsx("button",{onClick:s,className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)] text-xl",children:"×"})]}),e.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:t.description}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium ${t.source==="built-in"?"bg-blue-500/10 text-blue-500":t.source==="custom"?"bg-purple-500/10 text-purple-500":"bg-gray-500/10 text-gray-500"}`,children:t.source}),e.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium bg-[var(--color-border)] text-[var(--color-text-muted)]",children:t.category}),e.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium bg-[var(--color-border)] text-[var(--color-text-muted)]",children:[t.estimatedTokens.toLocaleString()," tokens"]})]}),t.phases&&t.phases.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-4",children:t.phases.map(n=>{const m=F[n]??"#6b7280";return e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-medium",style:{background:`${m}20`,color:m},children:n},n)})}),e.jsx("div",{className:"flex items-center gap-3 mb-4 p-3 rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)]",children:e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:n=>x(t.name,n.target.checked),className:"w-4 h-4 accent-[var(--color-accent)]"}),t.enabled?"Enabled":"Disabled"]})}),t.source==="custom"&&e.jsxs("div",{className:"flex gap-2",children:[i&&e.jsx("button",{onClick:()=>i(t),className:"px-3 py-1.5 text-sm border border-[var(--color-border)] rounded hover:bg-[var(--color-bg-tertiary)]",children:"Edit"}),l&&t.id&&e.jsx("button",{onClick:()=>l(t.id),className:"px-3 py-1.5 text-sm text-red-500 border border-red-500/30 rounded hover:bg-red-500/10",children:"Delete"})]})]})}):null}const $=["ANALYZE","DESIGN","PLAN","IMPLEMENT","VALIDATE","REVIEW","HANDOFF","LISTENING"],B=["know-me","software-design","security","testing","cost-reducer","research","ddd","frontend-design","other"];function H({open:t,onClose:s,onSubmit:x,editSkill:l}){const[i,n]=a.useState(""),[m,h]=a.useState(""),[b,v]=a.useState("know-me"),[d,N]=a.useState(["IMPLEMENT"]),[p,j]=a.useState(""),[f,g]=a.useState(!1),[o,u]=a.useState(null);a.useEffect(()=>{l?(n(l.name),h(l.description),v(l.category),N(l.phases??["IMPLEMENT"]),j("")):(n(""),h(""),v("know-me"),N(["IMPLEMENT"]),j("")),u(null)},[l,t]);const S=a.useCallback(r=>{N(E=>E.includes(r)?E.filter(L=>L!==r):[...E,r])},[]),y=a.useCallback(async()=>{if(!i.trim()||!m.trim()||!p.trim()||d.length===0){u("All fields are required and at least one phase must be selected.");return}g(!0),u(null);try{await x({name:i.trim(),description:m.trim(),category:b,phases:d,instructions:p.trim()}),s()}catch(r){u(r instanceof Error?r.message:"Failed to save skill")}finally{g(!1)}},[i,m,b,d,p,x,s]);return t?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:r=>{r.target===r.currentTarget&&s()},children:e.jsxs("div",{className:"bg-[var(--color-bg)] rounded-lg shadow-xl w-full max-w-lg p-6 max-h-[85vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:l?"Edit Skill":"Create Custom Skill"}),e.jsx("button",{onClick:s,className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)] text-xl",children:"×"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[var(--color-text-muted)] mb-1",children:"Name"}),e.jsx("input",{type:"text",value:i,onChange:r=>n(r.target.value),placeholder:"my-workflow",disabled:!!l,className:"w-full px-3 py-2 text-sm rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)] disabled:opacity-50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[var(--color-text-muted)] mb-1",children:"Description"}),e.jsx("input",{type:"text",value:m,onChange:r=>h(r.target.value),placeholder:"What does this skill do?",className:"w-full px-3 py-2 text-sm rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[var(--color-text-muted)] mb-1",children:"Category"}),e.jsx("select",{value:b,onChange:r=>v(r.target.value),className:"w-full px-3 py-2 text-sm rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)]",children:B.map(r=>e.jsx("option",{value:r,children:r},r))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[var(--color-text-muted)] mb-1",children:"Phases"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:$.map(r=>e.jsx("button",{type:"button",onClick:()=>S(r),className:`px-2 py-1 text-[10px] font-medium rounded-full border transition-colors ${d.includes(r)?"bg-[var(--color-accent)]/10 border-[var(--color-accent)] text-[var(--color-accent)]":"border-[var(--color-border)] text-[var(--color-text-muted)] hover:border-[var(--color-text)]"}`,children:r},r))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[var(--color-text-muted)] mb-1",children:"Instructions"}),e.jsx("textarea",{value:p,onChange:r=>j(r.target.value),rows:6,placeholder:"Instructions for the AI agent when this skill is active...",className:"w-full px-3 py-2 text-sm rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)] resize-y"})]}),o&&e.jsx("div",{className:"text-sm p-2 rounded bg-red-500/10 text-red-500",children:o}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:s,className:"px-3 py-1.5 text-sm border border-[var(--color-border)] rounded hover:bg-[var(--color-bg-tertiary)]",children:"Cancel"}),e.jsx("button",{onClick:y,disabled:f,className:"px-3 py-1.5 text-sm bg-[var(--color-accent)] text-white rounded hover:opacity-90 disabled:opacity-50",children:f?"Saving...":l?"Update":"Create"})]})]})]})}):null}const V=["ANALYZE","DESIGN","PLAN","IMPLEMENT","VALIDATE","REVIEW","HANDOFF","LISTENING"],D={ANALYZE:"#8b5cf6",DESIGN:"#3b82f6",PLAN:"#06b6d4",IMPLEMENT:"#10b981",VALIDATE:"#f59e0b",REVIEW:"#ef4444",HANDOFF:"#ec4899",LISTENING:"#6b7280"},P=4e3;function C({value:t,label:s}){return e.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)] text-center","data-testid":"metric-card",children:[e.jsx("div",{className:"text-xl font-bold",children:t}),e.jsx("div",{className:"text-[10px] text-[var(--color-text-muted)] uppercase",children:s})]})}function Y({phase:t}){const s=D[t]??"#6b7280";return e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-medium",style:{background:`${s}20`,color:s},children:t})}function W({source:t}){const s={"built-in":"bg-[var(--color-accent)]/10 text-[var(--color-accent)]",filesystem:"bg-[var(--color-text-muted)]/10 text-[var(--color-text-muted)]",custom:"bg-purple-500/10 text-purple-500"};return e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${s[t]}`,children:t})}function _({skill:t,onToggle:s,onClick:x}){return e.jsxs("div",{className:`p-3 rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)] cursor-pointer hover:border-[var(--color-accent)]/50 transition-all ${t.enabled?"":"opacity-50"}`,onClick:()=>x(t),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:t.name}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:l=>{l.stopPropagation(),s(t.name,l.target.checked)},onClick:l=>l.stopPropagation(),className:"w-3.5 h-3.5 accent-[var(--color-accent)]"}),e.jsx(W,{source:t.source}),e.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:[t.estimatedTokens.toLocaleString()," tok"]})]})]}),e.jsx("p",{className:"text-xs text-[var(--color-text-muted)] line-clamp-2",children:t.description})]})}function M({phase:t,skills:s,onToggle:x,onSkillClick:l}){const[i,n]=a.useState(!0),m=D[t]??"#6b7280",h=s.filter(b=>b.enabled).length;return e.jsxs("div",{className:"rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)] overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>n(!i),className:"w-full flex items-center justify-between px-3 py-2 text-xs font-medium hover:bg-[var(--color-bg-tertiary)] transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:m}}),t,e.jsxs("span",{className:"px-1.5 py-0.5 rounded-full bg-[var(--color-border)] text-[10px]",children:[h,"/",s.length]})]}),e.jsx("span",{className:"text-[var(--color-text-muted)]",children:i?"▲":"▼"})]}),i&&e.jsx("div",{className:"px-3 pb-3 space-y-2",children:s.map(b=>e.jsx(_,{skill:b,onToggle:x,onClick:l},b.name))})]})}function Z({rec:t}){return e.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-accent)]/30",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:t.skill}),e.jsx(Y,{phase:t.phase})]}),e.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:t.reason})]})}function z({totalTokens:t,activeTokens:s}){const x=Math.min(s/P,1),l=Math.min(t/P,1),i=Math.round(x*100),n=x>.8?"#ef4444":x>.5?"#f59e0b":"#10b981";return e.jsxs("div",{"data-testid":"token-budget-bar",className:"p-4 rounded-lg bg-[var(--color-bg-secondary)] border border-[var(--color-border)]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--color-text-muted)] uppercase",children:"Token Budget"}),e.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[s.toLocaleString()," active / ",t.toLocaleString()," total (",i,"%)"]})]}),e.jsxs("div",{className:"w-full h-2 rounded-full bg-[var(--color-border)] relative",children:[e.jsx("div",{className:"h-full rounded-full absolute top-0 left-0 opacity-30",style:{width:`${Math.round(l*100)}%`,background:"#6b7280"}}),e.jsx("div",{className:"h-full rounded-full absolute top-0 left-0 transition-all",style:{width:`${i}%`,background:n}})]})]})}function q(){const{skills:t,recommendations:s,totalTokens:x,activeTokens:l,loading:i,error:n,refresh:m,toggleSkill:h,createSkill:b,updateSkill:v,deleteSkill:d}=O(),[N,p]=a.useState(null),[j,f]=a.useState(!1),[g,o]=a.useState(null),u=a.useCallback(async c=>{await d(c),p(null)},[d]),S=a.useCallback(c=>{p(null),o(c),f(!0)},[]),y=a.useCallback(async c=>{g!=null&&g.id?await v(g.id,c):await b(c),o(null)},[g,b,v]);if(n)return e.jsxs("div",{className:"flex items-center justify-center h-full text-[var(--color-danger)]",children:["Failed to load skills: ",n]});if(i)return e.jsx("div",{className:"flex items-center justify-center h-full text-[var(--color-text-muted)]",children:"Loading skills..."});const r=t.filter(c=>c.source==="built-in").length,E=t.filter(c=>c.source==="custom").length,L=t.filter(c=>c.enabled).length,T=new Map;for(const c of V){const w=t.filter(R=>{var A;return(A=R.phases)==null?void 0:A.includes(c)});w.length>0&&T.set(c,w)}const I=t.filter(c=>!c.phases||c.phases.length===0);return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6 overflow-y-auto h-full",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Skills"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{o(null),f(!0)},className:"text-xs px-3 py-1.5 rounded-lg border border-[var(--color-accent)] text-[var(--color-accent)] hover:bg-[var(--color-accent)]/10 transition-colors",children:"+ Custom Skill"}),e.jsx("button",{onClick:()=>void m(),className:"text-xs px-3 py-1.5 rounded-lg bg-[var(--color-accent)] text-white hover:opacity-90 transition-opacity",children:"Refresh"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3","data-testid":"skills-stats",children:[e.jsx(C,{value:t.length,label:"Total Skills"}),e.jsx(C,{value:r,label:"Built-in"}),e.jsx(C,{value:E,label:"Custom"}),e.jsx(C,{value:L,label:"Enabled"}),e.jsx(C,{value:l.toLocaleString(),label:"Active Tokens"})]}),e.jsx(z,{totalTokens:x,activeTokens:l}),s.length>0&&e.jsxs("div",{"data-testid":"recommendations-section",className:"space-y-2",children:[e.jsxs("h3",{className:"text-xs font-semibold text-[var(--color-text-muted)] uppercase",children:["Recommendations (",s.length,")"]}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-2",children:s.map(c=>e.jsx(Z,{rec:c},c.skill))})]}),e.jsxs("div",{"data-testid":"skills-by-phase",className:"space-y-3",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--color-text-muted)] uppercase",children:"Skills by Lifecycle Phase"}),[...T.entries()].map(([c,w])=>e.jsx(M,{phase:c,skills:w,onToggle:h,onSkillClick:p},c)),I.length>0&&e.jsx(M,{phase:"Other",skills:I,onToggle:h,onSkillClick:p})]}),e.jsx(G,{skill:N,onClose:()=>p(null),onToggle:h,onDelete:u,onEdit:S}),e.jsx(H,{open:j,onClose:()=>{f(!1),o(null)},onSubmit:y,editSkill:g})]})}export{q as SkillsTab};
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
7
7
  <title>mcp-graph Workstation</title>
8
- <script type="module" crossorigin src="/assets/index-B2fTJ4AS.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-CkqEqKiH.css">
8
+ <script type="module" crossorigin src="/assets/index-BAeZDWWy.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-DQqYFXms.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-graph-workflow/mcp-graph",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "description": "MCP local-first PRD to task graph — transforms text into executable structure",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -70,7 +70,7 @@
70
70
  "@vitest/coverage-v8": "^4.0.0",
71
71
  "eslint": "^10.0.3",
72
72
  "eslint-plugin-security": "^4.0.0",
73
- "gitnexus": "^1.3.11",
73
+ "graphology": "^0.26.0",
74
74
  "supertest": "^7.2.2",
75
75
  "tsx": "^4.21.0",
76
76
  "typescript": "^5.9.3",
@@ -1,12 +0,0 @@
1
- /**
2
- * GitNexus API bridge routes.
3
- * Proxies requests to the local GitNexus instance.
4
- * All data stays local — no external communication.
5
- */
6
- import { Router } from "express";
7
- export interface GitNexusRouterOptions {
8
- getBasePath: () => string;
9
- gitnexusPort?: number;
10
- }
11
- export declare function createGitNexusRouter(options: GitNexusRouterOptions): Router;
12
- //# sourceMappingURL=gitnexus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gitnexus.d.ts","sourceRoot":"","sources":["../../../src/api/routes/gitnexus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAuBjC,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA4BD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAyI3E"}
@@ -1,164 +0,0 @@
1
- /**
2
- * GitNexus API bridge routes.
3
- * Proxies requests to the local GitNexus instance.
4
- * All data stays local — no external communication.
5
- */
6
- import { Router } from "express";
7
- import { z } from "zod/v4";
8
- import { isGitNexusIndexed, isGitNexusRunning, getAnalyzePhase, getServeBasePath, ensureGitNexusAnalyzed, startGitNexusServe, } from "../../core/integrations/gitnexus-launcher.js";
9
- import { logger } from "../../core/utils/logger.js";
10
- import { buildContextQuery, buildImpactQuery, parseContextResponse, parseImpactResponse, } from "../../core/integrations/gitnexus-queries.js";
11
- const QueryBodySchema = z.object({ query: z.string().min(1) });
12
- const SymbolBodySchema = z.object({ symbol: z.string().min(1) });
13
- const DEFAULT_GITNEXUS_PORT = 3737;
14
- async function proxyToGitNexus(port, endpoint, body) {
15
- try {
16
- const res = await fetch(`http://localhost:${port}${endpoint}`, {
17
- method: "POST",
18
- headers: { "Content-Type": "application/json" },
19
- body: JSON.stringify(body),
20
- });
21
- // Handle non-JSON responses (e.g. HTML 404 pages) gracefully
22
- const contentType = res.headers.get("content-type") ?? "";
23
- if (!contentType.includes("application/json")) {
24
- return { ok: false, status: res.status, data: { error: `Non-JSON response from GitNexus (${res.status})` } };
25
- }
26
- const data = await res.json();
27
- return { ok: res.ok, status: res.status, data };
28
- }
29
- catch (err) {
30
- const message = err instanceof Error ? err.message : String(err);
31
- return { ok: false, status: 502, data: { error: `GitNexus proxy error: ${message}` } };
32
- }
33
- }
34
- export function createGitNexusRouter(options) {
35
- const { getBasePath, gitnexusPort = DEFAULT_GITNEXUS_PORT } = options;
36
- const router = Router();
37
- // ── GET /status ───────────────────────────────
38
- router.get("/status", async (_req, res, next) => {
39
- try {
40
- const indexed = isGitNexusIndexed(getBasePath());
41
- const running = await isGitNexusRunning(gitnexusPort);
42
- res.json({
43
- indexed,
44
- running,
45
- port: gitnexusPort,
46
- analyzePhase: getAnalyzePhase(),
47
- basePath: getBasePath(),
48
- serveBasePath: getServeBasePath(),
49
- ...(running ? { url: `http://localhost:${gitnexusPort}` } : {}),
50
- });
51
- }
52
- catch (err) {
53
- next(err);
54
- }
55
- });
56
- // ── POST /analyze ────────────────────────────────
57
- router.post("/analyze", async (_req, res, next) => {
58
- try {
59
- const result = await ensureGitNexusAnalyzed(getBasePath());
60
- res.json(result);
61
- }
62
- catch (err) {
63
- next(err);
64
- }
65
- });
66
- // ── POST /serve ─────────────────────────────────
67
- router.post("/serve", async (_req, res, next) => {
68
- try {
69
- const result = await startGitNexusServe(getBasePath(), gitnexusPort);
70
- res.json(result);
71
- }
72
- catch (err) {
73
- next(err);
74
- }
75
- });
76
- // ── POST /query ───────────────────────────────
77
- router.post("/query", async (req, res, next) => {
78
- try {
79
- const parsed = QueryBodySchema.safeParse(req.body);
80
- if (!parsed.success) {
81
- res.status(400).json({ error: "Missing required field: query" });
82
- return;
83
- }
84
- const running = await isGitNexusRunning(gitnexusPort);
85
- if (!running) {
86
- res.status(503).json({ error: "GitNexus is not running. Start with: gitnexus serve" });
87
- return;
88
- }
89
- const result = await proxyToGitNexus(gitnexusPort, "/api/query", { cypher: parsed.data.query });
90
- res.status(result.status).json(result.data);
91
- }
92
- catch (err) {
93
- next(err);
94
- }
95
- });
96
- // ── POST /context ─────────────────────────────
97
- router.post("/context", async (req, res, next) => {
98
- try {
99
- const parsed = SymbolBodySchema.safeParse(req.body);
100
- if (!parsed.success) {
101
- res.status(400).json({ error: "Missing required field: symbol" });
102
- return;
103
- }
104
- const running = await isGitNexusRunning(gitnexusPort);
105
- if (!running) {
106
- res.status(503).json({ error: "GitNexus is not running. Start with: gitnexus serve" });
107
- return;
108
- }
109
- // Try direct proxy first, fallback to Cypher query
110
- const result = await proxyToGitNexus(gitnexusPort, "/api/context", { symbol: parsed.data.symbol });
111
- if (result.status === 404) {
112
- logger.debug("GitNexus /api/context returned 404, falling back to Cypher query", { symbol: parsed.data.symbol });
113
- const cypher = buildContextQuery(parsed.data.symbol);
114
- const cypherResult = await proxyToGitNexus(gitnexusPort, "/api/query", { cypher });
115
- if (!cypherResult.ok) {
116
- res.status(cypherResult.status).json(cypherResult.data);
117
- return;
118
- }
119
- const contextData = parseContextResponse(cypherResult.data);
120
- res.json(contextData);
121
- return;
122
- }
123
- res.status(result.status).json(result.data);
124
- }
125
- catch (err) {
126
- next(err);
127
- }
128
- });
129
- // ── POST /impact ──────────────────────────────
130
- router.post("/impact", async (req, res, next) => {
131
- try {
132
- const parsed = SymbolBodySchema.safeParse(req.body);
133
- if (!parsed.success) {
134
- res.status(400).json({ error: "Missing required field: symbol" });
135
- return;
136
- }
137
- const running = await isGitNexusRunning(gitnexusPort);
138
- if (!running) {
139
- res.status(503).json({ error: "GitNexus is not running. Start with: gitnexus serve" });
140
- return;
141
- }
142
- // Try direct proxy first, fallback to Cypher query
143
- const result = await proxyToGitNexus(gitnexusPort, "/api/impact", { symbol: parsed.data.symbol });
144
- if (result.status === 404) {
145
- logger.debug("GitNexus /api/impact returned 404, falling back to Cypher query", { symbol: parsed.data.symbol });
146
- const cypher = buildImpactQuery(parsed.data.symbol);
147
- const cypherResult = await proxyToGitNexus(gitnexusPort, "/api/query", { cypher });
148
- if (!cypherResult.ok) {
149
- res.status(cypherResult.status).json(cypherResult.data);
150
- return;
151
- }
152
- const impactData = parseImpactResponse(cypherResult.data, parsed.data.symbol);
153
- res.json(impactData);
154
- return;
155
- }
156
- res.status(result.status).json(result.data);
157
- }
158
- catch (err) {
159
- next(err);
160
- }
161
- });
162
- return router;
163
- }
164
- //# sourceMappingURL=gitnexus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gitnexus.js","sourceRoot":"","sources":["../../../src/api/routes/gitnexus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACL,iBAAi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AAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,67 +0,0 @@
1
- /**
2
- * GitNexus lifecycle manager.
3
- * Handles analyze, serve (as child process), and cleanup.
4
- * All operations are local-only — no data sent externally.
5
- *
6
- * Binary resolution order:
7
- * 1. Local node_modules/.bin/gitnexus (target project)
8
- * 2. Local node_modules/.bin/gitnexus (mcp-graph install dir)
9
- * 3. Global `gitnexus` on PATH
10
- * 4. Auto-install via `npm install --no-save gitnexus` in target project, then use local bin
11
- */
12
- export type AnalyzePhase = "idle" | "analyzing" | "ready" | "unavailable" | "error";
13
- /**
14
- * Get the current analyze phase.
15
- */
16
- export declare function getAnalyzePhase(): AnalyzePhase;
17
- /**
18
- * Reset analyze phase to idle (for testing).
19
- */
20
- export declare function resetAnalyzePhase(): void;
21
- /**
22
- * Get the basePath that the current GitNexus serve process is running for.
23
- * Returns null if serve is not running.
24
- */
25
- export declare function getServeBasePath(): string | null;
26
- /**
27
- * Check if the given path is inside a git repository.
28
- */
29
- export declare function isGitRepo(basePath: string): boolean;
30
- export interface AnalyzeResult {
31
- skipped: boolean;
32
- success?: boolean;
33
- reason: string;
34
- }
35
- export interface ServeResult {
36
- started: boolean;
37
- message: string;
38
- port?: number;
39
- }
40
- /**
41
- * Check if the codebase has been indexed by GitNexus.
42
- */
43
- export declare function isGitNexusIndexed(basePath: string): boolean;
44
- /**
45
- * Check if GitNexus serve is running on a given port via HTTP probe.
46
- */
47
- export declare function isGitNexusRunning(port: number): Promise<boolean>;
48
- /**
49
- * Resolve the gitnexus binary path.
50
- * Caches result after first successful resolution.
51
- */
52
- export declare function resolveGitNexusBin(basePath: string): Promise<string | null>;
53
- /**
54
- * Ensure codebase is analyzed by GitNexus.
55
- * Skips if `.gitnexus/` already exists.
56
- */
57
- export declare function ensureGitNexusAnalyzed(basePath: string): Promise<AnalyzeResult>;
58
- /**
59
- * Start GitNexus serve as a child process on the given port.
60
- * Returns immediately after spawning — does not wait for readiness.
61
- */
62
- export declare function startGitNexusServe(basePath: string, port: number): Promise<ServeResult>;
63
- /**
64
- * Stop the GitNexus serve child process if running.
65
- */
66
- export declare function stopGitNexus(): Promise<void>;
67
- //# sourceMappingURL=gitnexus-launcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gitnexus-launcher.d.ts","sourceRoot":"","sources":["../../../src/core/integrations/gitnexus-launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CAAC;AAIpF;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAEhD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUtE;AA4CD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAqCjF;AAID;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA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