auto-coder-web 0.1.99__py3-none-any.whl → 0.1.101__py3-none-any.whl

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 (71) hide show
  1. auto_coder_web/version.py +1 -1
  2. auto_coder_web/web/assets/HistoryPanel-gJupyfFp.js +2 -0
  3. auto_coder_web/web/assets/_basePickBy-CCSZj2pA.js +1 -0
  4. auto_coder_web/web/assets/_baseUniq-BTllNErT.js +1 -0
  5. auto_coder_web/web/assets/arc-BXjHXofo.js +1 -0
  6. auto_coder_web/web/assets/architectureDiagram-IEHRJDOE-DmIqWpdi.js +36 -0
  7. auto_coder_web/web/assets/blockDiagram-JOT3LUYC-DtACHz1R.js +121 -0
  8. auto_coder_web/web/assets/c4Diagram-VJAJSXHY-D3eQI0f_.js +10 -0
  9. auto_coder_web/web/assets/channel-C4EINljX.js +1 -0
  10. auto_coder_web/web/assets/chunk-4BMEZGHF-Ckc43zxH.js +1 -0
  11. auto_coder_web/web/assets/chunk-A2AXSNBT-CJ57iCVC.js +164 -0
  12. auto_coder_web/web/assets/chunk-AEK57VVT-o_ViTLZT.js +220 -0
  13. auto_coder_web/web/assets/chunk-D6G4REZN-2ayrGi-2.js +1 -0
  14. auto_coder_web/web/assets/chunk-RZ5BOZE2-csKhWZPs.js +1 -0
  15. auto_coder_web/web/assets/chunk-XZIHB7SX-G4BVkcV4.js +1 -0
  16. auto_coder_web/web/assets/classDiagram-GIVACNV2-DP0khH1f.js +1 -0
  17. auto_coder_web/web/assets/classDiagram-v2-COTLJTTW-DP0khH1f.js +1 -0
  18. auto_coder_web/web/assets/clone-Bg4iLekk.js +1 -0
  19. auto_coder_web/web/assets/{cssMode-dfzmIRw_.js → cssMode-BPyr8lmu.js} +1 -1
  20. auto_coder_web/web/assets/cytoscape.esm-BY7v1xhs.js +331 -0
  21. auto_coder_web/web/assets/dagre-OKDRZEBW-CCuMXe_S.js +4 -0
  22. auto_coder_web/web/assets/diagram-SSKATNLV-Bp-uorEf.js +43 -0
  23. auto_coder_web/web/assets/diagram-VNBRO52H-CKQFD3a_.js +24 -0
  24. auto_coder_web/web/assets/erDiagram-Q7BY3M3F-9eI0zHpI.js +60 -0
  25. auto_coder_web/web/assets/flowDiagram-4HSFHLVR-3RcC2Ccp.js +161 -0
  26. auto_coder_web/web/assets/{freemarker2-CD79_SV-.js → freemarker2-BU5Z-fJI.js} +1 -1
  27. auto_coder_web/web/assets/ganttDiagram-APWFNJXF-D2cSA1Cd.js +257 -0
  28. auto_coder_web/web/assets/gitGraphDiagram-7IBYFJ6S-D_9htwjS.js +65 -0
  29. auto_coder_web/web/assets/graph-cCt1e4eU.js +1 -0
  30. auto_coder_web/web/assets/{handlebars-B_inQ7Ga.js → handlebars-mkin9J8g.js} +2 -2
  31. auto_coder_web/web/assets/{html-s8IXsV2v.js → html-DtBbZIcO.js} +1 -1
  32. auto_coder_web/web/assets/{htmlMode-BNdCO4Um.js → htmlMode-RbI6rOrZ.js} +1 -1
  33. auto_coder_web/web/assets/infoDiagram-PH2N3AL5-BYP4b-4i.js +2 -0
  34. auto_coder_web/web/assets/init-Gi6I4Gst.js +1 -0
  35. auto_coder_web/web/assets/{javascript-D_ZBRKl9.js → javascript-f2lALfl-.js} +1 -1
  36. auto_coder_web/web/assets/journeyDiagram-U35MCT3I-B89eezTp.js +138 -0
  37. auto_coder_web/web/assets/{jsonMode-lWocgRYn.js → jsonMode-D_iny90a.js} +1 -1
  38. auto_coder_web/web/assets/kanban-definition-NDS4AKOZ-DXZ3QE3M.js +88 -0
  39. auto_coder_web/web/assets/katex-ChWnQ-fc.js +261 -0
  40. auto_coder_web/web/assets/layout-DEspB-Nn.js +1 -0
  41. auto_coder_web/web/assets/linear-DvyAnBDb.js +1 -0
  42. auto_coder_web/web/assets/{liquid-CPaH0eVF.js → liquid-BLUt9KkL.js} +1 -1
  43. auto_coder_web/web/assets/main-DgQa03WG.css +32 -0
  44. auto_coder_web/web/assets/main.js +637 -426
  45. auto_coder_web/web/assets/{mdx-DRx1b0qs.js → mdx-CiikeQLk.js} +1 -1
  46. auto_coder_web/web/assets/mindmap-definition-ALO5MXBD-BK4Kd7cQ.js +95 -0
  47. auto_coder_web/web/assets/ordinal-Cboi1Yqb.js +1 -0
  48. auto_coder_web/web/assets/pieDiagram-IB7DONF6-UuIn9g8t.js +30 -0
  49. auto_coder_web/web/assets/{python-5rTPwuda.js → python-BQGAmGD2.js} +1 -1
  50. auto_coder_web/web/assets/quadrantDiagram-7GDLP6J5-DdkeEcG5.js +7 -0
  51. auto_coder_web/web/assets/radar-MK3ICKWK-Bzl6RmHe.js +128 -0
  52. auto_coder_web/web/assets/{razor-zn6WfQ9V.js → razor-CMmYJAVf.js} +1 -1
  53. auto_coder_web/web/assets/requirementDiagram-KVF5MWMF-DYvXHPCT.js +64 -0
  54. auto_coder_web/web/assets/sankeyDiagram-QLVOVGJD-C3fiDKw0.js +10 -0
  55. auto_coder_web/web/assets/sequenceDiagram-X6HHIX6F-CifpUH-p.js +122 -0
  56. auto_coder_web/web/assets/stateDiagram-DGXRK772-x-pqGGcU.js +1 -0
  57. auto_coder_web/web/assets/stateDiagram-v2-YXO3MK2T-BhO6ozG8.js +1 -0
  58. auto_coder_web/web/assets/timeline-definition-BDJGKUSR-BmbgmEKE.js +61 -0
  59. auto_coder_web/web/assets/{tsMode-CkhihvQ0.js → tsMode-LqKHR7gR.js} +4 -4
  60. auto_coder_web/web/assets/{typescript-DH2E4fY1.js → typescript-KnQ9Sglt.js} +2 -2
  61. auto_coder_web/web/assets/{xml-kipCCfsB.js → xml-G2dyiWZM.js} +2 -2
  62. auto_coder_web/web/assets/xychartDiagram-VJFVF3MP-DnV9OlaB.js +7 -0
  63. auto_coder_web/web/assets/{yaml-BI9EB_1X.js → yaml-D_70BM1U.js} +1 -1
  64. auto_coder_web/web/index.html +1 -1
  65. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/METADATA +2 -2
  66. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/RECORD +69 -25
  67. auto_coder_web/web/assets/HistoryPanel-DAeswjWO.js +0 -2
  68. auto_coder_web/web/assets/main-D2S0ggFA.css +0 -32
  69. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/WHEEL +0 -0
  70. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/entry_points.txt +0 -0
  71. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/top_level.txt +0 -0
@@ -1,2 +0,0 @@
1
- import{r,I as G,_ as Y,j as e,S as se,T as J,R as re,a as P,h as ne,v as ae,b as U,s as u,d as K,l as te,c as le,e as W,E as q,B as g,g as a,L as T,C as ie,f as Z,i as oe,k as ce,m as de,n as he,M as fe}from"./main.js";var ue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M296 250c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm184 144H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-48 458H208V148h560v320c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm440-88H728v-36.6c46.3-13.8 80-56.6 80-107.4 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 50.7 33.7 93.6 80 107.4V764H520c-8.8 0-16 7.2-16 16v152c0 8.8 7.2 16 16 16h352c8.8 0 16-7.2 16-16V780c0-8.8-7.2-16-16-16zM646 620c0-27.6 22.4-50 50-50s50 22.4 50 50-22.4 50-50 50-50-22.4-50-50zm180 266H566v-60h260v60z"}}]},name:"audit",theme:"outlined"},xe=function(d,c){return r.createElement(G,Y({},d,{ref:c,icon:ue}))},me=r.forwardRef(xe),ge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 00-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 00-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 00-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0012.6 0l112-141.9c4.1-5.2.4-13-6.3-13z"}}]},name:"sort-ascending",theme:"outlined"},pe=function(d,c){return r.createElement(G,Y({},d,{ref:c,icon:ge}))},ve=r.forwardRef(pe),be={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 00-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 00-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 00-9.2-9.3zM310.3 167.1a8 8 0 00-12.6 0L185.7 309c-4.2 5.3-.4 13 6.3 13h76v530c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V322h76c6.7 0 10.5-7.8 6.3-13l-112-141.9z"}}]},name:"sort-descending",theme:"outlined"},ye=function(d,c){return r.createElement(G,Y({},d,{ref:c,icon:be}))},je=r.forwardRef(ye);te.config({paths:{vs:"/monaco-editor/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const{TabPane:ee}=J,we=({commitId:o,onClose:d})=>{const[c,A]=r.useState({diff:""}),[h,w]=r.useState(null),[f,y]=r.useState(null),[C,E]=r.useState(!1),[x,F]=r.useState("split"),[i,j]=r.useState(null),[L,$]=r.useState(!1),[z,X]=r.useState("1"),m=r.useRef(null),p=r.useRef(null),v=r.useRef(null),N=r.useRef(null),_=async()=>{if(o){$(!0);try{const t=encodeURIComponent(o),s=await U.get(`/api/history/commit-diff/${t}`);s.data.success?A({diff:s.data.diff,file_changes:s.data.file_changes}):u.error(s.data.message||"获取diff失败")}catch(t){console.error("Error fetching diff:",t),u.error("获取diff失败")}finally{$(!1)}}},k=async t=>{if(o)try{E(!0),y(null),m.current=null,p.current=null,v.current=null;const s=encodeURIComponent(o),n=await U.get(`/api/history/file-diff/${s}?file_path=${encodeURIComponent(t)}`);n.data.success?y(n.data.file_diff):u.error(n.data.message||"获取文件差异失败")}catch(s){console.error("Error fetching file diff:",s),u.error("获取文件差异失败")}finally{E(!1)}},B=t=>{h===t?(w(null),y(null),m.current=null,p.current=null,v.current=null,j(null)):(w(t),k(t),j(null))},S=r.useCallback(t=>{m.current=t},[]),H=r.useCallback(t=>{p.current=t},[]),D=r.useCallback(t=>{v.current=t},[]),b=t=>{var l;const s=(l=t.split(".").pop())==null?void 0:l.toLowerCase();return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",java:"java",c:"c",cpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",php:"php",html:"html",css:"css",scss:"scss",json:"json",md:"markdown",yml:"yaml",yaml:"yaml",xml:"xml",sh:"shell",bash:"shell",txt:"plaintext"}[s||""]||"plaintext"},R=({viewType:t})=>{const s=i===t;return e.jsx("button",{className:"ml-2 text-gray-400 hover:text-white transition-colors",onClick:n=>{n.stopPropagation(),j(s?null:t)},title:s?"恢复正常视图":"最大化视图",children:s?e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})}):e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})},I=()=>{if(!h||!f)return null;const t=b(h),s=`diff-${o}-${h}-${x}`,n=`before-${o}-${h}`,l=`after-${o}-${h}`,M={readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:14,horizontalScrollbarSize:14}};return x==="unified"?e.jsxs("div",{ref:N,className:"bg-gray-900 rounded-lg border border-gray-700",style:{height:"500px",width:"100%",overflow:"hidden"},children:[e.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-white flex justify-between items-center",children:[e.jsx("span",{children:"差异视图"}),e.jsx(R,{viewType:"diff"})]}),e.jsx(K,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:f.diff_content||"",theme:"vs-dark",onMount:D,options:M,loading:e.jsx("div",{className:"flex items-center justify-center h-full text-white",children:"加载中..."})},s)]}):e.jsxs("div",{ref:N,className:"grid grid-cols-2 gap-2",style:{height:"500px",width:"100%"},children:[(i===null||i==="before")&&e.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${i==="before"?"col-span-2":""}`,style:{overflow:"hidden"},children:[e.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-white flex justify-between items-center",children:[e.jsxs("span",{children:["修改前 (",f.file_status==="added"?"新文件":h,")"]}),e.jsx(R,{viewType:"before"})]}),e.jsx(K,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:t,value:f.before_content||"",theme:"vs-dark",onMount:S,options:M,loading:e.jsx("div",{className:"flex items-center justify-center h-full text-white",children:"加载中..."})},n)]}),(i===null||i==="after")&&e.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${i==="after"?"col-span-2":""}`,style:{overflow:"hidden"},children:[e.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-white flex justify-between items-center",children:[e.jsxs("span",{children:["修改后 (",f.file_status==="deleted"?"文件已删除":h,")"]}),e.jsx(R,{viewType:"after"})]}),e.jsx(K,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:t,value:f.after_content||"",theme:"vs-dark",onMount:H,options:M,loading:e.jsx("div",{className:"flex items-center justify-center h-full text-white",children:"加载中..."})},l)]})]})};r.useEffect(()=>{o&&_()},[o]);const V={background:"#1F2937",borderBottom:"1px solid #374151",margin:0,padding:"0 16px"},O=(t,s)=>e.jsx(s,{...t,style:V,className:"custom-tabs-bar"});return e.jsxs("div",{className:"flex flex-col h-full bg-[#111827] overflow-hidden",children:[e.jsxs("div",{className:"flex justify-between items-center p-4 bg-[#1F2937] border-b border-[#374151]",children:[e.jsx("h2",{className:"text-lg font-semibold text-white",children:"代码变更详情"}),e.jsx(se,{children:d&&e.jsx("button",{className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 text-white rounded text-sm",onClick:d,children:"关闭"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs(J,{activeKey:z,onChange:X,type:"card",className:"diff-viewer-tabs",renderTabBar:O,style:{background:"#111827"},children:[e.jsx(ee,{tab:e.jsx("div",{className:`py-2 px-4 ${z==="1"?"text-white font-medium":"text-gray-400"}`,children:"文件列表"}),children:e.jsxs("div",{className:"p-4",children:[e.jsx("div",{className:"space-y-2 mb-4",children:L?e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):c.file_changes&&c.file_changes.length>0?c.file_changes.map((t,s)=>e.jsx("div",{className:`text-sm py-2 px-3 rounded cursor-pointer ${h===t.path?"bg-gray-700 border-l-2 border-indigo-500":"hover:bg-gray-750 bg-gray-800"}`,onClick:()=>B(t.path),children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full mr-2 ${t.change_type==="added"?"bg-green-500":t.change_type==="modified"?"bg-yellow-500":t.change_type==="deleted"?"bg-red-500":"bg-blue-500"}`}),e.jsx("span",{className:`font-mono ${t.change_type==="deleted"?"line-through text-gray-500":"text-white"}`,children:t.path}),e.jsx(re,{className:"ml-2 text-gray-400"})]})},s)):e.jsx("div",{className:"text-center text-white py-8",children:e.jsx("p",{children:"没有文件变更信息"})})}),C&&e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}),h&&f&&!C&&e.jsx("div",{className:"flex justify-end mb-3",children:e.jsxs(P.Group,{value:x,onChange:t=>F(t.target.value),buttonStyle:"solid",children:[e.jsx(P.Button,{value:"split",style:{color:x==="split"?"#fff":"#1f2937"},children:"分割视图"}),e.jsx(P.Button,{value:"unified",style:{color:x==="unified"?"#fff":"#1f2937"},children:"统一视图"})]})}),h&&f&&!C&&I()]})},"1"),e.jsx(ee,{tab:e.jsx("div",{className:`py-2 px-4 ${z==="2"?"text-white font-medium":"text-gray-400"}`,children:"原始差异"}),children:e.jsx("div",{className:"p-4",children:L?e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):e.jsx(ne,{language:"diff",style:ae,customStyle:{padding:"12px",borderRadius:"4px",overflow:"auto",maxHeight:"600px"},children:c.diff||""})})},"2")]})})]})};te.config({paths:{vs:"/monaco-editor/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const{Text:Q}=oe,{TabPane:Ne}=J,ke=()=>{const[o,d]=r.useState([]),[c,A]=r.useState(!1),[h,w]=r.useState(!1),[f,y]=r.useState(!1),[C,E]=r.useState([]),[x,F]=r.useState(null),[i,j]=r.useState(null),[L,$]=r.useState([]),[z,X]=r.useState(!1),[m,p]=r.useState({show:!1,commitHash:"",commitMessage:""}),[v,N]=r.useState(!1),[_,k]=r.useState(null),[B,S]=r.useState(null),H=s=>{if(!s){u.info(a("noAssociatedCodeChanges"));return}F(s)},D=()=>{i&&(j(null),d(L))},b=async()=>{w(!0);try{const s=await U.get("/api/history/validate-and-load");if(s.data.success){const n=s.data.queries;if($(n),i){const l=n.filter(M=>M.response===i);d(l)}else d(n)}else u.error(s.data.message||a("loadHistoryFailed"))}catch(s){console.error("Error loading queries:",s),u.error(a("loadFailed"))}finally{w(!1)}};le.useEffect(()=>{b();const s=W.subscribe(q.CODING.TASK_COMPLETE,l=>{console.log("Coding task completed, reloading queries",l),b()}),n=W.subscribe(q.HISTORY.FILTER_BY_COMMIT,l=>{console.log("Filtering history by commit hash:",l.commitHash),j(l.commitHash),b()});return()=>{s(),n()}},[i]);const R=(s,n,l)=>{s.stopPropagation(),p({show:!0,commitHash:n,commitMessage:l})},I=async()=>{try{N(!0),k(null),S(null);const s=await fetch(`/api/commits/${m.commitHash}/revert`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const l=await s.json();throw new Error(l.detail||a("revertCommitFailed"))}const n=await s.json();S(`${a("revertCommitSuccessPrefix")}: ${n.new_commit_hash.substring(0,7)}`),p(l=>({...l,show:!1})),b(),setTimeout(()=>{S(null)},5e3)}catch(s){k(s instanceof Error?s.message:"撤销提交失败"),console.error("Failed to revert commit:",s)}finally{N(!1)}},V=()=>{p({show:!1,commitHash:"",commitMessage:""}),k(null)},O=(s,n)=>{s.stopPropagation(),W.publish(q.CHAT.NEW_MESSAGE,{action:"review",commit_id:n,mode:"chat"}),u.success(a("reviewCommandSent"))},t=(s,n)=>{s.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{u.success(a("commitCopied"))}).catch(l=>{console.error("复制失败:",l),u.error(a("copyFailed"))})};return x?e.jsx(we,{commitId:x,onClose:()=>F(null)}):e.jsxs("div",{className:"flex flex-col bg-[#111827] overflow-hidden",style:{height:"650px"},children:[e.jsxs("div",{className:"flex justify-between items-center p-4 bg-[#1F2937] border-b border-[#374151] sticky top-0 z-10 shadow-md",children:[e.jsxs(se,{children:[e.jsx(g,{icon:c?e.jsx(ve,{}):e.jsx(je,{}),onClick:()=>{A(!c),d([...o].reverse())},children:c?a("ascending"):a("descending")}),e.jsx(g,{type:"primary",onClick:b,loading:h,children:a("refresh")}),i&&e.jsx(g,{type:"default",onClick:D,danger:!0,children:a("clearFilter")||"清除过滤"})]}),i&&e.jsxs("div",{className:"px-2 py-1 bg-blue-900/30 text-blue-300 rounded-md text-xs flex items-center",children:[e.jsxs("span",{children:[a("filteringByCommit")||"按提交过滤",":"]}),e.jsx("code",{className:"ml-1 font-mono",children:i.substring(0,8)})]})]}),m.show&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-gray-800 rounded-lg shadow-xl max-w-md w-full p-6 border border-gray-700",children:[e.jsx("h3",{className:"text-xl font-semibold text-white mb-4",children:a("confirmRevertTitle")}),e.jsx("p",{className:"text-gray-300 mb-6",children:a("confirmRevertMessage")}),e.jsxs("div",{className:"bg-gray-900 p-3 rounded mb-6 border border-gray-700",children:[e.jsxs("p",{className:"text-sm text-gray-400 mb-1",children:[a("commitInfoLabel"),":"]}),e.jsx("p",{className:"text-white",children:m.commitMessage}),e.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Commit: ",m.commitHash.substring(0,7)]})]}),_&&e.jsx("div",{className:"bg-red-900 bg-opacity-25 text-red-400 p-3 rounded mb-4",children:_}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded transition-colors",onClick:V,disabled:v,children:a("cancel")}),e.jsx("button",{className:"px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded transition-colors flex items-center",onClick:I,disabled:v,children:v?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),a("processing"),"..."]}):e.jsx(e.Fragment,{children:a("confirmRevertButton")})})]})]})}),B&&e.jsx("div",{className:"fixed top-4 right-4 bg-green-800 text-green-100 p-4 rounded-lg shadow-lg z-50 animate-fade-in-out",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),e.jsx("span",{children:B})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[i&&o.length===0&&e.jsx("div",{className:"text-center p-8 text-gray-400",children:e.jsx("p",{children:a("noFilteredResults")||"没有匹配的历史记录"})}),e.jsx(T,{dataSource:o,renderItem:s=>e.jsx(T.Item,{className:"border-b border-[#374151] last:border-b-0",children:e.jsx(ie,{className:`w-full bg-[#1F2937] border-[#374151] hover:bg-[#2D3748] transition-colors duration-200
2
- ${i&&s.response===i?"border-blue-500 border-2":""}`,title:e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{children:[e.jsx(Z,{style:{marginRight:"8px",color:"#9CA3AF"}}),e.jsx(Q,{style:{color:"#E5E7EB"},children:`${s.file_number}_chat_action.yml`}),s.timestamp&&e.jsx(Q,{style:{marginLeft:"10px",fontSize:"12px",color:"#9CA3AF"},children:s.timestamp})]}),e.jsxs("div",{className:"flex space-x-2",children:[s.urls&&s.urls.length>0&&e.jsx(g,{icon:e.jsx(Z,{}),type:"link",style:{color:"#60A5FA"},onClick:()=>{E(s.urls||[]),y(!0)},children:a("viewContext")}),s.response&&!s.is_reverted&&e.jsxs(e.Fragment,{children:[e.jsx(g,{icon:e.jsx(ce,{}),type:"link",style:{color:"#F87171"},onClick:n=>R(n,s.response,s.query),children:a("revert")}),e.jsx(g,{icon:e.jsx(me,{}),type:"link",style:{color:"#10B981"},onClick:n=>O(n,s.response),children:a("reviewChanges")}),e.jsx(g,{icon:e.jsx(de,{}),type:"link",style:{color:"#6366F1"},onClick:n=>t(n,s.response),children:a("copyCommit")})]}),e.jsx(g,{icon:e.jsx(he,{}),type:"link",style:{color:s.response?"#60A5FA":"#9CA3AF"},onClick:()=>H(s.response),disabled:!s.response,children:a("viewChanges")})]})]}),children:e.jsxs("div",{className:`${s.is_reverted?"border border-red-500 rounded-lg p-2 relative":""}`,children:[s.is_reverted&&e.jsx("div",{className:"absolute -top-2 -right-2 bg-red-500 text-white text-xs px-2 py-0.5 rounded-full",children:a("reverted")}),e.jsx("div",{style:{backgroundColor:"#111827",padding:"12px",borderRadius:"4px",color:"#E5E7EB",border:"1px solid #374151",maxWidth:"100%",fontSize:"14px",lineHeight:"1.6",whiteSpace:"normal",wordBreak:"break-word"},children:s.query})]})})})}),e.jsx(fe,{title:a("contextFileListTitle"),open:f,onCancel:()=>y(!1),width:600,footer:null,className:"dark-theme-modal",styles:{content:{backgroundColor:"#1f2937",padding:"20px"},header:{backgroundColor:"#1f2937",borderBottom:"1px solid #374151",color:"#ffffff"},body:{backgroundColor:"#1f2937",color:"#ffffff"},mask:{backgroundColor:"rgba(0, 0, 0, 0.6)"}},children:e.jsx(T,{dataSource:C,className:"dark-theme-list max-h-96 overflow-y-auto",renderItem:s=>e.jsx(T.Item,{className:"text-gray-200 border-gray-700",children:e.jsx("div",{className:"flex items-center w-full",children:e.jsx(Q,{style:{color:"#E5E7EB"},children:s})})})})})]})]})};export{ke as default};