auto-coder-web 0.1.93__py3-none-any.whl → 0.1.95__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.
- auto_coder_web/routers/auto_router.py +11 -0
- auto_coder_web/version.py +1 -1
- auto_coder_web/web/assets/HistoryPanel-DAeswjWO.js +2 -0
- auto_coder_web/web/assets/{main-D8cC7hK1.css → main-CA1DE4Rs.css} +1 -1
- auto_coder_web/web/assets/main.js +347 -347
- auto_coder_web/web/index.html +1 -1
- {auto_coder_web-0.1.93.dist-info → auto_coder_web-0.1.95.dist-info}/METADATA +2 -2
- {auto_coder_web-0.1.93.dist-info → auto_coder_web-0.1.95.dist-info}/RECORD +11 -11
- auto_coder_web/web/assets/HistoryPanel-B59ay4X7.js +0 -1
- {auto_coder_web-0.1.93.dist-info → auto_coder_web-0.1.95.dist-info}/WHEEL +0 -0
- {auto_coder_web-0.1.93.dist-info → auto_coder_web-0.1.95.dist-info}/entry_points.txt +0 -0
- {auto_coder_web-0.1.93.dist-info → auto_coder_web-0.1.95.dist-info}/top_level.txt +0 -0
auto_coder_web/web/index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
7
|
<title>Vite React App</title>
|
8
8
|
<script type="module" crossorigin src="/assets/main.js"></script>
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/main-
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/main-CA1DE4Rs.css">
|
10
10
|
</head>
|
11
11
|
<body>
|
12
12
|
<div id="root"></div>
|
@@ -1,13 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: auto_coder_web
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.95
|
4
4
|
Summary: auto-coder.web: A Python Project
|
5
5
|
Author: allwefantasy
|
6
6
|
Classifier: Programming Language :: Python :: 3.10
|
7
7
|
Classifier: Programming Language :: Python :: 3.11
|
8
8
|
Classifier: Programming Language :: Python :: 3.12
|
9
9
|
Description-Content-Type: text/markdown
|
10
|
-
Requires-Dist: auto-coder >=0.1.
|
10
|
+
Requires-Dist: auto-coder >=0.1.364
|
11
11
|
Requires-Dist: aiofiles
|
12
12
|
Requires-Dist: psutil
|
13
13
|
Requires-Dist: watchdog
|
@@ -7,7 +7,7 @@ auto_coder_web/lang.py,sha256=cXypkDesnMwZ0U6D_CZtxhDTAOp__hoJzYTulQ_8xPc,1108
|
|
7
7
|
auto_coder_web/proxy.py,sha256=if9-XT7bxD8dP_ddqQFuxTECr2XZmcmL94m1VrMlpTg,11878
|
8
8
|
auto_coder_web/terminal.py,sha256=jtAH7FaC573cgxc7FnI_mOZ3D2dSCO3PrZN0OehtbNQ,9521
|
9
9
|
auto_coder_web/types.py,sha256=TT-0UruUi67wz7w1DpjFyYeaCnkdKYviJvlpSnrdtD4,1435
|
10
|
-
auto_coder_web/version.py,sha256=
|
10
|
+
auto_coder_web/version.py,sha256=gjN1KV5-sjWWEJxZFy1n-akdf0dx0j2uY7S7h8BeZR0,23
|
11
11
|
auto_coder_web/common_router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
auto_coder_web/common_router/active_context_router.py,sha256=wbwG-J2iS5uBorN20q2PVoyJCVueECBR66xYjtIEWhM,6228
|
13
13
|
auto_coder_web/common_router/auto_coder_conf_router.py,sha256=oIRZE5OqeSfp-TYkGtX1M1Qd54iBYxftQtDbivdRj1o,1059
|
@@ -23,7 +23,7 @@ auto_coder_web/common_router/model_router.py,sha256=w-t6d6FkfF8sDo_8ZHfclHb50y7p
|
|
23
23
|
auto_coder_web/expert_routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
auto_coder_web/expert_routers/history_router.py,sha256=9NUPlDQJJY5xhGepj38ej3qXAlbaquJDVaSniNhFpqw,12471
|
25
25
|
auto_coder_web/routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
|
-
auto_coder_web/routers/auto_router.py,sha256=
|
26
|
+
auto_coder_web/routers/auto_router.py,sha256=Uo7fbVUjxx5yrgUc_9eiuwtbzMtK3aoTyS__L-qjoU4,17305
|
27
27
|
auto_coder_web/routers/chat_panels_router.py,sha256=3I4M746NCORdpcyk-SuAmBJAKuQeG4FtX7m3FEXrnWM,5417
|
28
28
|
auto_coder_web/routers/chat_router.py,sha256=Zxt8lUdLF1EJY1IMHdcS9tvw9ayec8jA-EKloYV3Bqk,16980
|
29
29
|
auto_coder_web/routers/code_editor_tabs_router.py,sha256=ogCQUp7YoIYIkphDqCLKdfBGq-HdrfKQvZA8UkArrrc,6168
|
@@ -41,12 +41,12 @@ auto_coder_web/routers/todo_router.py,sha256=IkQurQTw0Xk9P8yEtY_iie1z5ZK3CzDQE_N
|
|
41
41
|
auto_coder_web/routers/upload_router.py,sha256=HdQIl3ICcT3EB2kwryTbF-PItWV-Gugses7Y0Eaw2WQ,1798
|
42
42
|
auto_coder_web/web/bridge.js,sha256=us40dbuGHa2_zBBVBCa_GznOvpuZNDObViksMeoQch0,7364
|
43
43
|
auto_coder_web/web/favicon.ico,sha256=PRD32mxgMXg0AIFmjErFs66XQ8qaJiqw_NMS-7n0i90,3870
|
44
|
-
auto_coder_web/web/index.html,sha256=
|
44
|
+
auto_coder_web/web/index.html,sha256=IMKhF1jGIR4Oxzsmx7iiMUGhKT_H9do7y6mZnQtaL7A,410
|
45
45
|
auto_coder_web/web/logo192.png,sha256=w4Y5bscNs2CAdbX7-qxKscyqhroFpoqzk-xVHrZsPgA,5347
|
46
46
|
auto_coder_web/web/logo512.png,sha256=nqT02nBQwMxAiSb2o5wlNiTpursdQ8eXfNghRFpgtGE,9664
|
47
47
|
auto_coder_web/web/manifest.json,sha256=ULPYw5A68_eNhxuUVXqxT045yhkurKPSz6hjyGcnmhQ,492
|
48
48
|
auto_coder_web/web/robots.txt,sha256=kNJLw79pisHhc3OVAimMzKcq3x9WT6sF9IS4xI0crdI,67
|
49
|
-
auto_coder_web/web/assets/HistoryPanel-
|
49
|
+
auto_coder_web/web/assets/HistoryPanel-DAeswjWO.js,sha256=iTtcnHn_NJj0cfnEz3XBM-l8ITKTkqcywKl0rqoS5dM,18957
|
50
50
|
auto_coder_web/web/assets/abap-BrgZPUOV.js,sha256=o-KiQdqDx6qAg2rOn7OyokL0WP-Rffnxk2Py5kMN0Fk,14409
|
51
51
|
auto_coder_web/web/assets/apex-DyP6w7ZV.js,sha256=nm1bQzOU_JCzp8WFFKtYxrtJ50DvA-FGkoo_0Ala62g,4198
|
52
52
|
auto_coder_web/web/assets/azcli-BaLxmfj-.js,sha256=1H3GaflQKP3CG9cACVyVEHIIjd2HtFjK0hRmeUFVwLU,1094
|
@@ -86,8 +86,8 @@ auto_coder_web/web/assets/lexon-YWi4-JPR.js,sha256=l9pURhF6kU3UKzKOIIQprnjMAXzdI
|
|
86
86
|
auto_coder_web/web/assets/liquid-CPaH0eVF.js,sha256=uXE_OsLEw3W8B-ReZOUwybkJu3J6se8VlGWx0MFpx7g,4208
|
87
87
|
auto_coder_web/web/assets/lua-nf6ki56Z.js,sha256=O3vMsGoiFHDMGSxTP1bHnDnRPebfmFnC7kf8-ovGkO8,2369
|
88
88
|
auto_coder_web/web/assets/m3-Cpb6xl2v.js,sha256=PmotBCyVZvUGHh9t9juODmjXptTEP5K6bnPj2WgYO6c,3063
|
89
|
-
auto_coder_web/web/assets/main-
|
90
|
-
auto_coder_web/web/assets/main.js,sha256=
|
89
|
+
auto_coder_web/web/assets/main-CA1DE4Rs.css,sha256=_4MpF8CjGzpeJmG5nWCnYRMx-eL2OQbfh9SakGEHVh0,242729
|
90
|
+
auto_coder_web/web/assets/main.js,sha256=k5jwaBxq1UOEdXufDu28Jn1Y7ILqVWgNqXhkC2b3DxA,6682375
|
91
91
|
auto_coder_web/web/assets/markdown-DSZPf7rp.js,sha256=3ZMgfYxjKX9U8l6GFCNrO28Hj7JU-4rKrEqXIezyqT4,4034
|
92
92
|
auto_coder_web/web/assets/mdx-DRx1b0qs.js,sha256=awzor_jnBNHRhTxk3_jcpGXsNUFbi9Ow0OIqWYq4CQA,5113
|
93
93
|
auto_coder_web/web/assets/mips-B_c3zf-v.js,sha256=L4uNgcwtDWPbyL0qnO-2w9x2PdI02UJcc8yQrYnHahA,2825
|
@@ -241,8 +241,8 @@ auto_coder_web/web/monaco-editor/min/vs/language/typescript/tsWorker.js,sha256=_
|
|
241
241
|
auto_coder_web/web/sounds/ding-dong.wav,sha256=BveDrGCyt_YMHaJwFJ80L5NfbUF5cl5QjzR-SRehxTk,35324
|
242
242
|
auto_coder_web/web/sounds/gentle-notification.wav,sha256=bzd0MwECdrjmNz7mbqv_y03S7WwD3G6agbIh1rWJ9cQ,72124
|
243
243
|
auto_coder_web/web/sounds/soft-chime.wav,sha256=Akpw7_rHLnX3rE13dRYpyZbmQFLGtp8P53LCdAkT9sA,40364
|
244
|
-
auto_coder_web-0.1.
|
245
|
-
auto_coder_web-0.1.
|
246
|
-
auto_coder_web-0.1.
|
247
|
-
auto_coder_web-0.1.
|
248
|
-
auto_coder_web-0.1.
|
244
|
+
auto_coder_web-0.1.95.dist-info/METADATA,sha256=rYyfnaszhryKJn4a-hUFpctH6SZFMskHSfry-L6ilAQ,1435
|
245
|
+
auto_coder_web-0.1.95.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
246
|
+
auto_coder_web-0.1.95.dist-info/entry_points.txt,sha256=oh8kd1ZecWDgdv-bIj_ru3phvl4scuxwXl9DK0Khltg,61
|
247
|
+
auto_coder_web-0.1.95.dist-info/top_level.txt,sha256=UCzEw494Im0KvR-FTYf2jh-okqHvLsC_0JLOrQZoSpg,15
|
248
|
+
auto_coder_web-0.1.95.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r,I as U,_ as G,j as e,S as ee,T as Q,R as re,a as P,h as ne,v as ae,b as q,s as f,d as K,l as se,c as le,e as J,E as X,B as y,g as n,L as _,C as oe,f as Y,i as ie,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,i){return r.createElement(U,G({},d,{ref:i,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,i){return r.createElement(U,G({},d,{ref:i,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,i){return r.createElement(U,G({},d,{ref:i,icon:be}))},je=r.forwardRef(ye);se.config({paths:{vs:"/monaco-editor/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const{TabPane:Z}=Q,we=({commitId:o,onClose:d})=>{const[i,A]=r.useState({diff:""}),[c,R]=r.useState(null),[h,j]=r.useState(null),[M,E]=r.useState(!1),[x,L]=r.useState("split"),[m,$]=r.useState(null),[p,w]=r.useState(!1),[v,z]=r.useState("1"),N=r.useRef(null),b=r.useRef(null),C=r.useRef(null),k=r.useRef(null),B=async()=>{if(o){w(!0);try{const t=encodeURIComponent(o),a=await q.get(`/api/history/commit-diff/${t}`);a.data.success?A({diff:a.data.diff,file_changes:a.data.file_changes}):f.error(a.data.message||"获取diff失败")}catch(t){console.error("Error fetching diff:",t),f.error("获取diff失败")}finally{w(!1)}}},S=async t=>{if(o)try{E(!0),j(null),N.current=null,b.current=null,C.current=null;const a=encodeURIComponent(o),g=await q.get(`/api/history/file-diff/${a}?file_path=${encodeURIComponent(t)}`);g.data.success?j(g.data.file_diff):f.error(g.data.message||"获取文件差异失败")}catch(a){console.error("Error fetching file diff:",a),f.error("获取文件差异失败")}finally{E(!1)}},D=t=>{c===t?(R(null),j(null),N.current=null,b.current=null,C.current=null,$(null)):(R(t),S(t),$(null))},T=r.useCallback(t=>{N.current=t},[]),V=r.useCallback(t=>{b.current=t},[]),H=r.useCallback(t=>{C.current=t},[]),I=t=>{var F;const a=(F=t.split(".").pop())==null?void 0:F.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"}[a||""]||"plaintext"},s=({viewType:t})=>{const a=m===t;return e.jsx("button",{className:"ml-2 text-gray-400 hover:text-white transition-colors",onClick:g=>{g.stopPropagation(),$(a?null:t)},title:a?"恢复正常视图":"最大化视图",children:a?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"})})})},l=()=>{if(!c||!h)return null;const t=I(c),a=`diff-${o}-${c}-${x}`,g=`before-${o}-${c}`,F=`after-${o}-${c}`,O={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:k,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(s,{viewType:"diff"})]}),e.jsx(K,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:h.diff_content||"",theme:"vs-dark",onMount:H,options:O,loading:e.jsx("div",{className:"flex items-center justify-center h-full text-white",children:"加载中..."})},a)]}):e.jsxs("div",{ref:k,className:"grid grid-cols-2 gap-2",style:{height:"500px",width:"100%"},children:[(m===null||m==="before")&&e.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${m==="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:["修改前 (",h.file_status==="added"?"新文件":c,")"]}),e.jsx(s,{viewType:"before"})]}),e.jsx(K,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:t,value:h.before_content||"",theme:"vs-dark",onMount:T,options:O,loading:e.jsx("div",{className:"flex items-center justify-center h-full text-white",children:"加载中..."})},g)]}),(m===null||m==="after")&&e.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${m==="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:["修改后 (",h.file_status==="deleted"?"文件已删除":c,")"]}),e.jsx(s,{viewType:"after"})]}),e.jsx(K,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:t,value:h.after_content||"",theme:"vs-dark",onMount:V,options:O,loading:e.jsx("div",{className:"flex items-center justify-center h-full text-white",children:"加载中..."})},F)]})]})};r.useEffect(()=>{o&&B()},[o]);const u={background:"#1F2937",borderBottom:"1px solid #374151",margin:0,padding:"0 16px"},te=(t,a)=>e.jsx(a,{...t,style:u,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(ee,{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(Q,{activeKey:v,onChange:z,type:"card",className:"diff-viewer-tabs",renderTabBar:te,style:{background:"#111827"},children:[e.jsx(Z,{tab:e.jsx("div",{className:`py-2 px-4 ${v==="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:p?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"})}):i.file_changes&&i.file_changes.length>0?i.file_changes.map((t,a)=>e.jsx("div",{className:`text-sm py-2 px-3 rounded cursor-pointer ${c===t.path?"bg-gray-700 border-l-2 border-indigo-500":"hover:bg-gray-750 bg-gray-800"}`,onClick:()=>D(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"})]})},a)):e.jsx("div",{className:"text-center text-white py-8",children:e.jsx("p",{children:"没有文件变更信息"})})}),M&&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&&h&&!M&&e.jsx("div",{className:"flex justify-end mb-3",children:e.jsxs(P.Group,{value:x,onChange:t=>L(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:"统一视图"})]})}),c&&h&&!M&&l()]})},"1"),e.jsx(Z,{tab:e.jsx("div",{className:`py-2 px-4 ${v==="2"?"text-white font-medium":"text-gray-400"}`,children:"原始差异"}),children:e.jsx("div",{className:"p-4",children:p?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:i.diff||""})})},"2")]})})]})};se.config({paths:{vs:"/monaco-editor/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const{Text:W}=ie,{TabPane:Ce}=Q,ke=()=>{const[o,d]=r.useState([]),[i,A]=r.useState(!1),[c,R]=r.useState(!1),[h,j]=r.useState(!1),[M,E]=r.useState([]),[x,L]=r.useState(null),[m,$]=r.useState(!1),[p,w]=r.useState({show:!1,commitHash:"",commitMessage:""}),[v,z]=r.useState(!1),[N,b]=r.useState(null),[C,k]=r.useState(null),B=s=>{if(!s){f.info(n("noAssociatedCodeChanges"));return}L(s)},S=async()=>{R(!0);try{const s=await q.get("/api/history/validate-and-load");s.data.success?d(s.data.queries):f.error(s.data.message||n("loadHistoryFailed"))}catch(s){console.error("Error loading queries:",s),f.error(n("loadFailed"))}finally{R(!1)}};le.useEffect(()=>{S();const s=J.subscribe(X.CODING.TASK_COMPLETE,l=>{console.log("Coding task completed, reloading queries",l),S()});return()=>{s()}},[]);const D=(s,l,u)=>{s.stopPropagation(),w({show:!0,commitHash:l,commitMessage:u})},T=async()=>{try{z(!0),b(null),k(null);const s=await fetch(`/api/commits/${p.commitHash}/revert`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const u=await s.json();throw new Error(u.detail||n("revertCommitFailed"))}const l=await s.json();k(`${n("revertCommitSuccessPrefix")}: ${l.new_commit_hash.substring(0,7)}`),w(u=>({...u,show:!1})),S(),setTimeout(()=>{k(null)},5e3)}catch(s){b(s instanceof Error?s.message:"撤销提交失败"),console.error("Failed to revert commit:",s)}finally{z(!1)}},V=()=>{w({show:!1,commitHash:"",commitMessage:""}),b(null)},H=(s,l)=>{s.stopPropagation(),J.publish(X.CHAT.NEW_MESSAGE,{action:"review",commit_id:l,mode:"chat"}),f.success(n("reviewCommandSent"))},I=(s,l)=>{s.stopPropagation(),navigator.clipboard.writeText(l).then(()=>{f.success(n("commitCopied"))}).catch(u=>{console.error("复制失败:",u),f.error(n("copyFailed"))})};return x?e.jsx(we,{commitId:x,onClose:()=>L(null)}):e.jsxs("div",{className:"flex flex-col bg-[#111827] overflow-hidden",style:{height:"650px"},children:[e.jsx("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(ee,{children:[e.jsx(y,{icon:i?e.jsx(ve,{}):e.jsx(je,{}),onClick:()=>{A(!i),d([...o].reverse())},children:i?n("ascending"):n("descending")}),e.jsx(y,{type:"primary",onClick:S,loading:c,children:n("refresh")})]})}),p.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:n("confirmRevertTitle")}),e.jsx("p",{className:"text-gray-300 mb-6",children:n("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:[n("commitInfoLabel"),":"]}),e.jsx("p",{className:"text-white",children:p.commitMessage}),e.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Commit: ",p.commitHash.substring(0,7)]})]}),N&&e.jsx("div",{className:"bg-red-900 bg-opacity-25 text-red-400 p-3 rounded mb-4",children:N}),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:n("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:T,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"})]}),n("processing"),"..."]}):e.jsx(e.Fragment,{children:n("confirmRevertButton")})})]})]})}),C&&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:C})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[e.jsx(_,{dataSource:o,renderItem:s=>e.jsx(_.Item,{className:"border-b border-[#374151] last:border-b-0",children:e.jsx(oe,{className:"w-full bg-[#1F2937] border-[#374151] hover:bg-[#2D3748] transition-colors duration-200",title:e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{children:[e.jsx(Y,{style:{marginRight:"8px",color:"#9CA3AF"}}),e.jsx(W,{style:{color:"#E5E7EB"},children:`${s.file_number}_chat_action.yml`}),s.timestamp&&e.jsx(W,{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(y,{icon:e.jsx(Y,{}),type:"link",style:{color:"#60A5FA"},onClick:()=>{E(s.urls||[]),j(!0)},children:n("viewContext")}),s.response&&!s.is_reverted&&e.jsxs(e.Fragment,{children:[e.jsx(y,{icon:e.jsx(ce,{}),type:"link",style:{color:"#F87171"},onClick:l=>D(l,s.response,s.query),children:n("revert")}),e.jsx(y,{icon:e.jsx(me,{}),type:"link",style:{color:"#10B981"},onClick:l=>H(l,s.response),children:n("reviewChanges")}),e.jsx(y,{icon:e.jsx(de,{}),type:"link",style:{color:"#6366F1"},onClick:l=>I(l,s.response),children:n("copyCommit")})]}),e.jsx(y,{icon:e.jsx(he,{}),type:"link",style:{color:s.response?"#60A5FA":"#9CA3AF"},onClick:()=>B(s.response),disabled:!s.response,children:n("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:n("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:n("contextFileListTitle"),open:h,onCancel:()=>j(!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(_,{dataSource:M,className:"dark-theme-list max-h-96 overflow-y-auto",renderItem:s=>e.jsx(_.Item,{className:"text-gray-200 border-gray-700",children:e.jsx("div",{className:"flex items-center w-full",children:e.jsx(W,{style:{color:"#E5E7EB"},children:s})})})})})]})]})};export{ke as default};
|
File without changes
|
File without changes
|
File without changes
|