auto-coder-web 0.1.99__py3-none-any.whl → 0.1.100__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/version.py +1 -1
- auto_coder_web/web/assets/main-DgQa03WG.css +32 -0
- auto_coder_web/web/assets/main.js +1 -1
- auto_coder_web/web/index.html +1 -1
- {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.100.dist-info}/METADATA +2 -2
- {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.100.dist-info}/RECORD +9 -9
- auto_coder_web/web/assets/main-D2S0ggFA.css +0 -32
- {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.100.dist-info}/WHEEL +0 -0
- {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.100.dist-info}/entry_points.txt +0 -0
- {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.100.dist-info}/top_level.txt +0 -0
@@ -525,7 +525,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
525
525
|
`);return w.jsxs("div",{className:"font-mono text-[14px]",children:[w.jsxs("div",{className:`flex items-center ${n.isStreaming?"text-white":"text-blue-400"} font-semibold mb-2`,children:[e&&s.length>3&&w.jsx("button",{onClick:()=>i(!t),className:"mr-2 p-0.5 rounded hover:bg-gray-700 transition-colors",children:t?w.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"mr-2",children:n.isStreaming?w.jsxs("svg",{className:"animate-spin h-3 w-3",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.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"})]}):w.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),w.jsx("span",{children:n.isStreaming?Z("analyzingContext"):Z("contextAnalysisComplete")})]}),!t&&w.jsx("div",{className:`bg-gray-800/50 p-2 rounded-md border border-gray-700 whitespace-pre-wrap text-xs ${n.isStreaming?"text-white":"text-gray-200"}`,children:r})]})},hPt=({message:n})=>{var i,r;const[e,t]=b.useState(!0);return w.jsxs("div",{className:"font-mono text-[14px]",children:[w.jsxs("div",{className:"flex items-center",children:[w.jsx("button",{onClick:()=>t(!e),className:"mr-2 p-0.5 rounded hover:bg-gray-700 transition-colors",children:e?w.jsx("svg",{className:"w-3 h-3 text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"w-3 h-3 text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"mr-2",children:w.jsx("svg",{className:"w-4 h-4 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),w.jsx("span",{className:"text-blue-400 font-semibold",children:Z("contextAwareInfo")})]}),!e&&w.jsxs("div",{className:"mt-2 bg-gray-850 rounded-lg overflow-hidden border border-gray-700 shadow-md",children:[((i=n.metadata)==null?void 0:i.title)&&w.jsx("div",{className:"px-3 py-2 bg-gray-800/50 border-b border-gray-700",children:w.jsx("h3",{className:"text-white font-medium text-[14px]",children:n.metadata.title})}),((r=n.metadata)==null?void 0:r.contextItems)&&n.metadata.contextItems.length>0&&w.jsxs("div",{className:"px-3 py-2 bg-gray-800/30 border-b border-gray-700",children:[w.jsxs("div",{className:"text-gray-400 text-[14px] mb-1",children:[Z("relevantContext"),":"]}),w.jsx("div",{className:"flex flex-col gap-0.5 max-h-[150px] overflow-y-auto",children:n.metadata.contextItems.map((s,o)=>w.jsxs("div",{className:"flex items-center text-[14px]",children:[w.jsx("svg",{className:"w-2.5 h-2.5 mr-1 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),w.jsx("span",{className:"text-blue-300 font-mono truncate",children:s})]},o))})]}),w.jsx("div",{className:"p-3 bg-gray-800/20",children:w.jsx("div",{className:"prose prose-invert prose-xs max-w-none",children:w.jsx(Hp,{className:"text-gray-200 break-words text-[14px]",components:{code:({className:s,children:o,...a})=>{const l=/language-(\w+)/.exec(s||"");return!l?w.jsx("code",{className:`${s} bg-gray-700/50 px-1 rounded text-[14px]`,...a,children:o}):w.jsx(zl,{language:l?l[1]:"",style:yc,PreTag:"div",wrapLines:!0,wrapLongLines:!0,customStyle:{borderRadius:"0.25rem",marginTop:"0.375rem",marginBottom:"0.375rem",fontSize:"14px"},children:String(o).replace(/\n$/,"")})}},children:n.content})})})]})]})},fPt=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="code_generate",t=e&&!n.isStreaming;return e?w.jsx(gPt,{message:n,isCompleted:t}):w.jsx(pPt,{message:n})},gPt=({message:n,isCompleted:e})=>{const[t,i]=b.useState(e),r=n.content||"",s=r.split(`
|
526
526
|
`),o=5,a=n.language||"javascript",l=()=>{e&&Rn.publish(Dn.UI.SHOW_MODAL,{content:n.content,format:"markdown",language:a,title:Z("generatingCode")})};return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[e&&s.length>o&&w.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:n.isStreaming?w.jsxs("svg",{className:"animate-spin w-3.5 h-3.5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.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"})]}):w.jsx("svg",{className:"w-3.5 h-3.5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}),w.jsx("span",{className:"text-blue-400 message-title-text text-xs",children:n.isStreaming?Z("generatingCode"):Z("generatedCode")}),e&&w.jsxs(w.Fragment,{children:[w.jsx("button",{onClick:()=>{navigator.clipboard.writeText(r)},className:"ml-auto message-copy-button text-gray-400 hover:text-blue-400",title:Z("copy")||"Copy",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),w.jsx("button",{onClick:l,className:"ml-1 message-maximize-button text-gray-400 hover:text-blue-400",title:Z("maximize")||"Maximize",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.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"})})})]})]}),!t&&w.jsx("div",{className:"message-content-container border border-gray-800",children:w.jsx(zl,{language:a,style:yc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:r})})]})},pPt=({message:n})=>{var s;const[e,t]=b.useState(!1),i=n.language||"javascript",r=()=>{var o;Rn.publish(Dn.UI.SHOW_MODAL,{content:n.content,format:"markdown",language:i,title:((o=n.metadata)==null?void 0:o.fileName)||Z("generatedCode")})};return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-3.5 h-3.5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}),w.jsx("span",{className:"text-blue-400 message-title-text text-xs",children:Z("generatedCode")||"Generated Code"}),w.jsx("button",{onClick:()=>{navigator.clipboard.writeText(n.content)},className:"ml-auto message-copy-button text-gray-400 hover:text-blue-400",title:Z("copy")||"Copy",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),w.jsx("button",{onClick:r,className:"ml-1 message-maximize-button text-gray-400 hover:text-blue-400",title:Z("maximize")||"Maximize",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.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&&w.jsxs("div",{className:"message-content-container border border-gray-800",children:[((s=n.metadata)==null?void 0:s.fileName)&&w.jsxs("div",{className:"px-2 py-0.5 bg-gray-800/50 border-b border-gray-800 flex items-center",children:[w.jsx("svg",{className:"w-3 h-3 mr-1 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),w.jsx("span",{className:"text-gray-300 font-mono text-xs",children:n.metadata.fileName})]}),w.jsx("div",{className:"p-0 bg-gray-800/20",children:w.jsx(zl,{language:i,style:yc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:n.content})})]})]})},mPt=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="code_rank",t=e&&!n.isStreaming;return e?w.jsx(APt,{message:n,isCompleted:t}):w.jsx(vPt,{message:n})},APt=({message:n,isCompleted:e})=>{const[t,i]=b.useState(e),r=n.content||"";r.split(`
|
527
527
|
`);const s=n.language||"javascript";return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?w.jsx("svg",{className:"message-toggle-icon text-purple-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-purple-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-4 h-4 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),w.jsx("span",{className:"text-purple-400 message-title-text",children:n.isStreaming?Z("rankingCode"):Z("rankedCode")}),n.isStreaming&&w.jsx("span",{className:"ml-2",children:w.jsxs("svg",{className:"animate-spin h-4 w-4 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.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"})]})})]}),!t&&w.jsx("div",{className:"message-content-container",children:w.jsx(zl,{language:s,style:yc,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent"},wrapLines:!0,wrapLongLines:!0,children:r})})]})},vPt=({message:n})=>{var r;const e=n.language||"javascript",[t,i]=b.useState(!0);return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?w.jsx("svg",{className:"message-toggle-icon text-purple-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-purple-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-4 h-4 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),w.jsx("span",{className:"text-purple-400 message-title-text",children:Z("rankedCode")||"Ranked Code"})]}),!t&&w.jsxs("div",{className:"message-content-container",children:[((r=n.metadata)==null?void 0:r.rankTitle)&&w.jsxs("div",{className:"px-4 py-2 bg-gray-800/50 border-b border-gray-700 flex items-center",children:[w.jsx("svg",{className:"w-4 h-4 mr-2 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),w.jsx("span",{className:"text-gray-300 font-mono",children:n.metadata.rankTitle})]}),w.jsx("div",{className:"p-0 bg-gray-800/20",children:w.jsx(zl,{language:e,style:yc,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent"},wrapLines:!0,wrapLongLines:!0,children:n.content})})]})]})},bPt=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="lint",t=e&&!n.isStreaming;return e?w.jsx(_Pt,{message:n,isCompleted:t}):w.jsx(yPt,{message:n})},_Pt=({message:n,isCompleted:e})=>{const[t,i]=b.useState(e),r=n.content||"",s=r.split(`
|
528
|
-
`);return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[e&&s.length>5&&w.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:n.isStreaming?w.jsxs("svg",{className:"animate-spin w-3.5 h-3.5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.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"})]}):w.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),w.jsx("span",{className:"text-yellow-400 message-title-text text-xs",children:n.isStreaming?Z("analyzingCode")||"Analyzing Code":Z("lintResults")||"Lint Results"})]}),!t&&w.jsx("div",{className:"message-content-container border border-gray-800",children:w.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs text-white",children:r})})]})},yPt=({message:n})=>{var i;const[e,t]=b.useState(!1);return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),w.jsx("span",{className:"text-yellow-400 message-title-text text-xs",children:Z("lintResults")||"Lint Results"})]}),!e&&w.jsxs("div",{className:"message-content-container border border-gray-800",children:[((i=n.metadata)==null?void 0:i.fileName)&&w.jsxs("div",{className:"px-2 py-0.5 bg-gray-800/50 border-b border-gray-800 flex items-center",children:[w.jsx("svg",{className:"w-3 h-3 mr-1 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),w.jsx("span",{className:"text-gray-300 font-mono text-xs",children:n.metadata.fileName})]}),w.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs text-white",children:n.content})]})]})};function J8e(n,e=2){let t;if(typeof n=="string"){if(t=parseFloat(n),isNaN(t))return""}else t=n;if(typeof t!="number"||isNaN(t))return"";const i=e<0?0:e;return t.toFixed(i)}const CPt=(n,e,t=5)=>{if(n===void 0||e===void 0)return"$0.00000";const i=n+e;return`$${J8e(i,t)}`},wPt=({message:n})=>{const e=b.useRef(null),[t,i]=b.useState(!0),r=()=>{e.current&&i(e.current.offsetWidth>500)};return b.useEffect(()=>{r();const s=new ResizeObserver(()=>{r()});return e.current&&s.observe(e.current),()=>{e.current&&s.unobserve(e.current)}},[]),w.jsx("div",{ref:e,className:"font-mono text-[11px] text-gray-400 flex flex-row items-center gap-2 flex-wrap",children:n.metadata&&w.jsxs(w.Fragment,{children:[n.metadata.file_number!==void 0&&n.metadata.total_files!==void 0&&w.jsx("div",{className:"flex items-center",children:w.jsxs("span",{children:[Z("indexingFiles",{file_number:n.metadata.file_number,file_increment:Number(J8e(n.metadata.file_number/n.metadata.total_files*100))}),"% "]})}),n.metadata.updated_files!==void 0&&w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"flex items-center",children:w.jsx("span",{className:"text-green-500 ml-1",children:n.metadata.updated_files})}),w.jsxs("div",{className:"flex items-center",children:[w.jsxs("span",{children:[Z("removedFiles"),": "]}),w.jsx("span",{className:"text-red-500 ml-1",children:n.metadata.removed_files})]})]}),n.metadata.input_tokens!==void 0&&w.jsxs("div",{className:"flex items-center",children:[w.jsxs("span",{children:[Z("tokens"),": "]}),w.jsxs("span",{className:"text-green-500 ml-1",children:["↑ ",n.metadata.input_tokens]}),w.jsxs("span",{className:"text-red-500 ml-1",children:["↓ ",n.metadata.output_tokens]})]}),n.metadata.input_cost!==void 0&&w.jsxs("div",{className:"flex items-center",children:[w.jsxs("span",{children:[Z("apiCost"),": "]}),w.jsx("span",{className:"text-white ml-1",children:CPt(n.metadata.input_cost,n.metadata.output_cost,5)})]})]})})},SPt=({message:n})=>{const e=()=>{Rn.publish(Dn.CHAT.REFRESH_FROM_MESSAGE,{messageId:n.id,messageContent:n.content})};return w.jsxs("div",{className:"message-font group relative",children:[" ",w.jsx("button",{onClick:e,className:"absolute top-1 right-1 p-1 rounded text-gray-400 hover:text-gray-200 transition-opacity",title:Z("refreshFromHere")||"Refresh from here",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m-15.357-2a8.001 8.001 0 0015.357 2M15 15H9"})})}),w.jsxs("div",{className:"message-title",children:[w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-4 h-4 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}),w.jsx("span",{className:"text-indigo-400 message-title-text",children:Z("user")||"User"})]}),w.jsxs("div",{className:"prose prose-invert prose-xs max-w-none pt-1",children:[" ",w.jsx(Hp,{className:"text-gray-200 break-words",components:{code:({className:t,children:i,...r})=>{const s=/language-(\w+)/.exec(t||"");return!s?w.jsx("code",{className:t,...r,children:i}):w.jsx(zl,{language:s?s[1]:"",style:yc,PreTag:"div",wrapLines:!0,wrapLongLines:!0,children:String(i).replace(/\n$/,"")})}},children:n.content})]})]})},xPt=({message:n})=>{const[e,t]=b.useState(!0),i=b.useMemo(()=>{try{return JSON.parse(n.content).content||""}catch{return n.content}},[n.content]),r=n.language||"javascript",s=()=>{Rn.publish(Dn.UI.SHOW_MODAL,{content:i,format:"markdown",language:r,title:Z("unmergedBlocks")})};return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-3.5 h-3.5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"})})}),w.jsx("span",{className:"text-blue-400 message-title-text text-xs",children:Z("unmergedBlocks")||"Unmerged Blocks"}),w.jsx("button",{onClick:()=>{navigator.clipboard.writeText(i)},className:"ml-auto message-copy-button text-gray-400 hover:text-blue-400",title:Z("copy")||"Copy",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),w.jsx("button",{onClick:s,className:"ml-1 message-maximize-button text-gray-400 hover:text-blue-400",title:Z("maximize")||"Maximize",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.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&&w.jsx("div",{className:"message-content-container border border-gray-800",children:w.jsx("div",{className:"p-0 bg-gray-800/20",children:w.jsxs(zl,{language:r,style:yc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:[i," "]})})})]})},EPt=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="compile",t=e&&!n.isStreaming;return e?w.jsx(kPt,{message:n,isCompleted:t}):w.jsx(IPt,{message:n})},kPt=({message:n,isCompleted:e})=>{const[t,i]=b.useState(e),r=n.content||"",s=r.split(`
|
528
|
+
`);return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[e&&s.length>5&&w.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:n.isStreaming?w.jsxs("svg",{className:"animate-spin w-3.5 h-3.5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.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"})]}):w.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),w.jsx("span",{className:"text-yellow-400 message-title-text text-xs",children:n.isStreaming?Z("analyzingCode")||"Analyzing Code":Z("lintResults")||"Lint Results"})]}),!t&&w.jsx("div",{className:"message-content-container border border-gray-800",children:w.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs text-white",children:r})})]})},yPt=({message:n})=>{var i;const[e,t]=b.useState(!1);return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),w.jsx("span",{className:"text-yellow-400 message-title-text text-xs",children:Z("lintResults")||"Lint Results"})]}),!e&&w.jsxs("div",{className:"message-content-container border border-gray-800",children:[((i=n.metadata)==null?void 0:i.fileName)&&w.jsxs("div",{className:"px-2 py-0.5 bg-gray-800/50 border-b border-gray-800 flex items-center",children:[w.jsx("svg",{className:"w-3 h-3 mr-1 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),w.jsx("span",{className:"text-gray-300 font-mono text-xs",children:n.metadata.fileName})]}),w.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs text-white",children:n.content})]})]})};function J8e(n,e=2){let t;if(typeof n=="string"){if(t=parseFloat(n),isNaN(t))return""}else t=n;if(typeof t!="number"||isNaN(t))return"";const i=e<0?0:e;return t.toFixed(i)}const CPt=(n,e,t=5)=>{if(n===void 0||e===void 0)return"$0.00000";const i=n+e;return`$${J8e(i,t)}`},wPt=({message:n})=>{const e=b.useRef(null),[t,i]=b.useState(!0),r=()=>{e.current&&i(e.current.offsetWidth>500)};return b.useEffect(()=>{r();const s=new ResizeObserver(()=>{r()});return e.current&&s.observe(e.current),()=>{e.current&&s.unobserve(e.current)}},[]),w.jsx("div",{ref:e,className:"font-mono text-[11px] text-gray-400 flex flex-row items-center gap-2 flex-wrap",children:n.metadata&&w.jsxs(w.Fragment,{children:[n.metadata.file_number!==void 0&&n.metadata.total_files!==void 0&&w.jsx("div",{className:"flex items-center",children:w.jsxs("span",{children:[Z("indexingFiles",{file_number:n.metadata.file_number,file_increment:Number(J8e(n.metadata.file_number/n.metadata.total_files*100))}),"% "]})}),n.metadata.updated_files!==void 0&&w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"flex items-center",children:w.jsx("span",{className:"text-green-500 ml-1",children:n.metadata.updated_files})}),w.jsxs("div",{className:"flex items-center",children:[w.jsxs("span",{children:[Z("removedFiles"),": "]}),w.jsx("span",{className:"text-red-500 ml-1",children:n.metadata.removed_files})]})]}),n.metadata.input_tokens!==void 0&&w.jsxs("div",{className:"flex items-center",children:[w.jsxs("span",{children:[Z("tokens"),": "]}),w.jsxs("span",{className:"text-green-500 ml-1",children:["↑ ",n.metadata.input_tokens]}),w.jsxs("span",{className:"text-red-500 ml-1",children:["↓ ",n.metadata.output_tokens]})]}),n.metadata.input_cost!==void 0&&w.jsxs("div",{className:"flex items-center",children:[w.jsxs("span",{children:[Z("apiCost"),": "]}),w.jsx("span",{className:"text-white ml-1",children:CPt(n.metadata.input_cost,n.metadata.output_cost,5)})]})]})})},SPt=({message:n})=>{const e=()=>{Rn.publish(Dn.CHAT.REFRESH_FROM_MESSAGE,{messageId:n.id,messageContent:n.content})};return w.jsxs("div",{className:"message-font group relative",children:[" ",w.jsx("button",{onClick:e,className:"absolute top-1 right-1 p-1 rounded text-gray-400 hover:text-gray-200 transition-opacity",title:Z("refreshFromHere")||"Refresh from here",children:w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m-15.357-2a8.001 8.001 0 0015.357 2M15 15H9"})})}),w.jsxs("div",{className:"message-title",children:[w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-4 h-4 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}),w.jsx("span",{className:"text-indigo-400 message-title-text",children:Z("user")||"User"})]}),w.jsxs("div",{className:"prose prose-invert prose-xs max-w-none pt-1 user-message-content",children:[" ",w.jsx(Hp,{className:"text-gray-200 break-words",components:{code:({className:t,children:i,...r})=>{const s=/language-(\w+)/.exec(t||"");return!s?w.jsx("code",{className:t,...r,children:i}):w.jsx(zl,{language:s?s[1]:"",style:yc,PreTag:"div",wrapLines:!0,wrapLongLines:!0,children:String(i).replace(/\n$/,"")})}},children:n.content})]})]})},xPt=({message:n})=>{const[e,t]=b.useState(!0),i=b.useMemo(()=>{try{return JSON.parse(n.content).content||""}catch{return n.content}},[n.content]),r=n.language||"javascript",s=()=>{Rn.publish(Dn.UI.SHOW_MODAL,{content:i,format:"markdown",language:r,title:Z("unmergedBlocks")})};return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-3.5 h-3.5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"})})}),w.jsx("span",{className:"text-blue-400 message-title-text text-xs",children:Z("unmergedBlocks")||"Unmerged Blocks"}),w.jsx("button",{onClick:()=>{navigator.clipboard.writeText(i)},className:"ml-auto message-copy-button text-gray-400 hover:text-blue-400",title:Z("copy")||"Copy",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),w.jsx("button",{onClick:s,className:"ml-1 message-maximize-button text-gray-400 hover:text-blue-400",title:Z("maximize")||"Maximize",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.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&&w.jsx("div",{className:"message-content-container border border-gray-800",children:w.jsx("div",{className:"p-0 bg-gray-800/20",children:w.jsxs(zl,{language:r,style:yc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:[i," "]})})})]})},EPt=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="compile",t=e&&!n.isStreaming;return e?w.jsx(kPt,{message:n,isCompleted:t}):w.jsx(IPt,{message:n})},kPt=({message:n,isCompleted:e})=>{const[t,i]=b.useState(e),r=n.content||"",s=r.split(`
|
529
529
|
`);return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[e&&s.length>5&&w.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?w.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:n.isStreaming?w.jsxs("svg",{className:"animate-spin w-3.5 h-3.5 text-orange-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.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"})]}):w.jsx("svg",{className:"w-3.5 h-3.5 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),w.jsx("span",{className:"text-orange-400 message-title-text text-xs",children:n.isStreaming?Z("analyzingCompile")||"Analyzing Compile...":Z("compileResults")||"Compile Results"})]}),!t&&w.jsx("div",{className:"message-content-container border border-gray-800",children:w.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs",children:r})})]})},IPt=({message:n})=>{const[e,t]=b.useState(!1),i=b.useMemo(()=>{try{return JSON.parse(n.content).content||n.content}catch{return n.content}},[n.content]),r="bash",s=()=>{Rn.publish(Dn.UI.SHOW_MODAL,{content:i,format:"plaintext",language:r,title:Z("compileResults")})};return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?w.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-3.5 h-3.5 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),w.jsx("span",{className:"text-orange-400 message-title-text text-xs",children:Z("compileResults")||"Compile Results"}),w.jsx("button",{onClick:()=>navigator.clipboard.writeText(i),className:"ml-auto message-copy-button text-gray-400 hover:text-orange-400",title:Z("copy")||"Copy",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),w.jsx("button",{onClick:s,className:"ml-1 message-maximize-button text-gray-400 hover:text-orange-400",title:Z("maximize")||"Maximize",children:w.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.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&&w.jsx("div",{className:"message-content-container border border-gray-800",children:w.jsx("div",{className:"p-0 bg-gray-800/20",children:w.jsx(zl,{language:r,style:yc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:i})})})]})},LPt=({message:n})=>{const[e,t]=b.useState(!0),i=JSON.parse(n.content);i.tool_name;const r=i.path,s=i.diff,o=a=>{const l=[],c=/<<<<<<< SEARCH\n([\s\S]*?)=======\n([\s\S]*?)>>>>>>> REPLACE/gm;let d;for(;(d=c.exec(a))!==null;)l.push({search:d[1].trimEnd(),replace:d[2].trimEnd()});return l.map((u,h)=>w.jsx("div",{className:"mb-1.5 border border-gray-700 rounded overflow-hidden text-xs font-mono shadow-sm",children:w.jsxs("div",{className:"flex",children:[w.jsxs("div",{className:"w-1/2 border-r border-gray-700",children:[w.jsx("div",{className:"bg-gray-800 px-1.5 py-0.5 text-xs font-medium text-gray-300 border-b border-gray-700",children:"SEARCH"}),w.jsx("div",{className:"bg-gray-900 h-56 overflow-auto",children:w.jsx("pre",{className:"px-1.5 py-1 whitespace-pre text-red-300 min-w-full text-xs",children:u.search})})]}),w.jsxs("div",{className:"w-1/2",children:[w.jsx("div",{className:"bg-gray-800 px-1.5 py-0.5 text-xs font-medium text-gray-300 border-b border-gray-700",children:"REPLACE"}),w.jsx("div",{className:"bg-gray-900 h-56 overflow-auto",children:w.jsx("pre",{className:"px-1.5 py-1 whitespace-pre text-green-300 min-w-full text-xs",children:u.replace})})]})]})},h))};return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button text-gray-400",children:e?w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsxs("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 20h9"}),w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4h9"}),w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 12h16"})]})}),w.jsx("span",{className:"message-title-text ml-1 text-yellow-400 font-semibold",children:Z("agenticEditReplaceInFileToolTitle")})]}),w.jsx("div",{className:"mt-1 text-gray-300 text-xs whitespace-pre-wrap break-words px-2 py-1",children:w.jsx("span",{title:r,className:"hover:underline cursor-help",children:r})}),!e&&w.jsx("div",{className:"mt-2 text-white",children:o(s)})]})},NPt=({message:n})=>{const[e,t]=b.useState(!0);let i="",r=!1,s="",o="";try{const a=JSON.parse(n.content||"{}");i=a.tool_name||"",r=a.success??!1,s=a.message||"",o=a.content||"",i==="ReplaceInFileTool"&&(i=Z("agenticEditToolResultReplaceInFileTool")),i==="WriteToFileTool"&&(i=Z("agenticEditToolResultWriteToFileTool")),i==="ReadFileTool"&&(i=Z("agenticEditToolResultReadFileTool")),i==="ListFilesTool"&&(i=Z("agenticEditToolResultListFilesTool")),i==="SearchFilesTool"&&(i=Z("agenticEditToolResultSearchFilesTool")),typeof o!="string"&&(Array.isArray(o)||o!==null&&typeof o=="object"&&Object.keys(o).length>0?o=JSON.stringify(o,null,2):o=String(o))}catch(a){console.error("Failed to parse tool result content:",a),s=n.content}return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button text-gray-400",children:e?w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsxs("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 20h9"}),w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4h9"}),w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 12h16"})]})}),w.jsx("span",{className:"message-title-text ml-1 text-yellow-400 font-semibold",children:i}),w.jsx("span",{className:`text-xs px-2 py-0.5 ml-2 rounded-full ${r?"bg-green-600/30 text-green-400":"bg-red-600/30 text-red-400"}`,children:r?"Success":"Failed"})]}),w.jsx("div",{className:"mt-1 text-gray-300 text-xs whitespace-pre-wrap break-words px-2 py-1",children:w.jsx("span",{title:s,className:"hover:underline cursor-help",children:s})}),!e&&o&&w.jsx("div",{className:"mt-2 p-2 bg-gray-900 overflow-auto text-xs font-mono whitespace-pre-wrap text-gray-200 border-t border-gray-700 max-h-[400px] scrollbar-thin scrollbar-thumb-gray-600",children:o})]})},TPt=({message:n})=>{const[e,t]=b.useState(!0);let i="",r="",s="";try{const o=JSON.parse(n.content||"{}");i=o.path||"N/A";const a=o.content||"";r=a.substring(0,150),s=a.length>150?"...":""}catch(o){console.error("Failed to parse WriteToFileTool content:",o),i="Error parsing content",r=""}return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[w.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon mr-1",children:w.jsx("svg",{className:"w-4 h-4 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),w.jsx("span",{className:"message-title-text text-purple-400 font-semibold",children:Z("agenticEditWriteToFileToolTitle")})]}),w.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:i}),!e&&w.jsxs("div",{className:"mt-2",children:[w.jsx("div",{className:"text-gray-400 text-xs mb-1",children:"Content Snippet:"}),w.jsxs("pre",{className:"bg-gray-900 p-2 rounded text-xs font-mono whitespace-pre-wrap overflow-x-auto text-gray-300 max-h-40",children:[r,s]})]})]})},DPt=({message:n})=>{const[e,t]=b.useState(!1);let i="",r=[];try{const s=JSON.parse(n.content||"{}");i=s.question||"N/A";const o=s.options;if(typeof o=="string")try{r=JSON.parse(o),Array.isArray(r)||(r=[])}catch{r=[]}else Array.isArray(o)?r=o:r=[]}catch(s){console.error("Failed to parse AskFollowupQuestionTool content:",s),i="Error parsing content"}return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[w.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon mr-1",children:w.jsx("svg",{className:"w-4 h-4 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.742 0-3.223-.835-3.772-2M12 5v.01M12 19v.01M3.34 16.66l.01-.01M20.66 7.34l-.01.01M16.66 20.66l-.01-.01M7.34 3.34l.01.01M12 22a10 10 0 110-20 10 10 0 010 20z"})})}),w.jsx("span",{className:"message-title-text text-orange-400 font-semibold",children:"AutoCoder is asking a question:"})]}),!e&&w.jsxs("div",{className:"mt-2 space-y-2",children:[w.jsx("div",{className:"text-gray-200",children:i}),r.length>0&&w.jsxs("div",{children:[w.jsx("div",{className:"text-gray-400 text-xs mb-1",children:"Options:"}),w.jsx("ul",{className:"list-disc list-inside text-sm text-gray-300 space-y-1",children:r.map((s,o)=>w.jsx("li",{children:s},o))})]})]})]})},RPt=({message:n})=>{const[e,t]=b.useState(""),[i,r]=b.useState(!1),[s,o]=b.useState(!0);return b.useEffect(()=>{try{const a=JSON.parse(n.content||"{}"),l=a.command||"N/A";t(l),r(a.requires_approval||!1),o(l.length>=80)}catch(a){console.error("Failed to parse ExecuteCommandTool content:",a),t("Error parsing content")}},[n.content]),w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>o(!s),children:[w.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:s?w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon mr-1",children:w.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l4-4 4 4m0 6l-4 4-4-4"})})}),w.jsx("span",{className:"message-title-text text-green-400 font-semibold",children:"AutoCoder wants to execute this command:"})]}),!s&&w.jsx("div",{className:"mt-1 text-yellow-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:e}),w.jsxs("div",{className:`mt-1 text-xs ${i?"text-red-400":"text-gray-400"}`,children:["(Requires Approval: ",i?"Yes":"No",")"]})]})},MPt=({message:n})=>{let e="";try{e=JSON.parse(n.content||"{}").path||"N/A"}catch(t){console.error("Failed to parse ListCodeDefinitionNamesTool content:",t),e="Error parsing content"}return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center",children:[w.jsx("span",{className:"message-title-icon mr-1",children:w.jsx("svg",{className:"w-4 h-4 text-teal-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}),w.jsx("span",{className:"message-title-text text-teal-400 font-semibold",children:"AutoCoder wants to list definitions in:"})]}),w.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:e})]})},OPt=({message:n})=>{let e="",t=!1;try{const i=JSON.parse(n.content||"{}");e=i.path||"N/A",t=i.recursive||!1}catch(i){console.error("Failed to parse ListFilesTool content:",i),e="Error parsing content"}return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center",children:[w.jsx("span",{className:"message-title-icon mr-1",children:w.jsx("svg",{className:"w-4 h-4 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}),w.jsx("span",{className:"message-title-text text-indigo-400 font-semibold",children:Z("agenticEditListFilesToolTitle")})]}),w.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:e}),w.jsxs("div",{className:"mt-1 text-xs text-gray-400",children:["(",t?"Recursively":"Top Level Only",")"]})]})},PPt=({message:n})=>{let e="";try{e=JSON.parse(n.content||"{}").path||"N/A"}catch(t){console.error("Failed to parse ReadFileTool content:",t),e="Error parsing content"}return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center",children:[w.jsx("span",{className:"message-title-icon mr-1",children:w.jsxs("svg",{className:"w-4 h-4 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}),w.jsx("span",{className:"message-title-text text-blue-400 font-semibold",children:Z("agenticEditReadFileToolTitle")})]}),w.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-words max-h-[120px] overflow-auto scrollbar-thin scrollbar-thumb-gray-600",children:w.jsx("span",{title:e,className:"hover:underline cursor-help",children:e})})]})},BPt=({message:n})=>{const[e,t]=b.useState(!0);let i="",r="",s="";try{const o=JSON.parse(n.content||"{}");i=o.path||"N/A",r=o.regex||"N/A",s=o.file_pattern||"*"}catch(o){console.error("Failed to parse SearchFilesTool content:",o),i="Error parsing content"}return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[w.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon mr-1",children:w.jsx("svg",{className:"w-4 h-4 text-pink-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),w.jsx("span",{className:"message-title-text text-pink-400 font-semibold",children:Z("agenticEditSearchFilesToolTitle")})]}),w.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:i}),!e&&w.jsxs("div",{className:"mt-2 space-y-1",children:[w.jsxs("div",{className:"text-xs",children:[w.jsx("span",{className:"text-gray-400",children:"File Pattern: "}),w.jsx("span",{className:"text-yellow-300 font-mono",children:s})]}),w.jsxs("div",{className:"text-xs",children:[w.jsx("span",{className:"text-gray-400",children:"Regex: "}),w.jsx("span",{className:"text-yellow-300 font-mono break-all",children:r})]})]})]})},FPt=({message:n})=>{const[e,t]=b.useState(!0);let i="",r="",s="",o="";try{const a=JSON.parse(n.content||"{}");i=a.server_name||"Default",r=a.tool_name||"Default";const l=a.query||"";s=l.substring(0,100),o=l.length>100?"...":""}catch(a){console.error("Failed to parse UseMcpTool content:",a),i="Error",r="Parsing",s="Content"}return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[w.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon mr-1",children:w.jsxs("svg",{className:"w-4 h-4 text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),w.jsx("span",{className:"message-title-text text-cyan-400 font-semibold",children:"AutoCoder wants to use an MCP tool:"})]}),!e&&w.jsxs("div",{className:"mt-2 space-y-1",children:[w.jsxs("div",{className:"text-xs",children:[w.jsx("span",{className:"text-gray-400",children:"Server: "}),w.jsx("span",{className:"text-blue-300 font-mono",children:i})]}),w.jsxs("div",{className:"text-xs",children:[w.jsx("span",{className:"text-gray-400",children:"Tool: "}),w.jsx("span",{className:"text-blue-300 font-mono",children:r})]}),w.jsxs("div",{className:"text-xs",children:[w.jsx("span",{className:"text-gray-400",children:"Query Snippet: "}),w.jsxs("pre",{className:"bg-gray-900 p-1 rounded text-xs font-mono whitespace-pre-wrap overflow-x-auto text-gray-300",children:[s,o]})]})]})]})},HPt=({message:n})=>{let e="",t="";try{const r=JSON.parse(n.content||"{}");e=r.result||"N/A",t=r.command||""}catch(r){console.error("Failed to parse AttemptCompletionTool content:",r),e="Error parsing content"}const i={...n,content:e};return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title flex items-center mb-2",children:[w.jsx("span",{className:"message-title-icon mr-1",children:w.jsx("svg",{className:"w-4 h-4 text-lime-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),w.jsx("span",{className:"message-title-text text-lime-400 font-semibold",children:"任务完成"})]}),w.jsx("div",{className:"completion-result",children:w.jsx(f2,{message:i})}),t&&w.jsxs("div",{className:"mt-2",children:[w.jsx("span",{className:"text-gray-400 text-xs",children:"Suggested command: "}),w.jsx("span",{className:"text-yellow-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:t})]})]})};class wIe{constructor(e){this.panelId=e}}class k3{constructor(e,t){this.text=e,this.panelId=t}}class $Pt{constructor(e){this.panelId=e}}class UPt{constructor(e,t){this.mentions=e,this.panelId=t}}class jPt{constructor(e){this.panelId=e}}class WPt{constructor(e){this.panelId=e}}class zPt{constructor(e,t){this.enabled=e,this.panelId=t}}class VPt{constructor(e){this.panelId=e}}class _m{constructor(e){this.panelId=e}}class KPt{constructor(e,t,i){this.groupNames=e,this.filePaths=t,this.panelId=i}}class eHe{constructor(e){this.commitHash=e}}const GPt=({message:n})=>{var a;let e="",t=0,i="",r=!1;(a=n.metadata)==null||a.action_file;try{const l=JSON.parse(n.content||"{}");e=l.commit_hash||"",t=l.diff_file_num||0,i=l.event_file||"",r=l.have_commit!==!1}catch(l){console.error("Failed to parse apply changes content:",l)}const s=()=>{e&&(Rn.publish(Dn.UI.ACTIVATE_PANEL,"history"),Rn.publish(Dn.HISTORY.FILTER_BY_COMMIT,new eHe(e)))},o=l=>{l.stopPropagation(),e&&navigator.clipboard.writeText(e).then(()=>{pt.success(Z("commitIdCopied")||"Commit ID copied to clipboard")}).catch(c=>{console.error("Failed to copy commit ID:",c),pt.error(Z("failedToCopyCommitId")||"Failed to copy commit ID")})};return w.jsx("div",{className:"message-font text-xs",children:w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"message-title flex items-center py-1 px-2",children:[w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-3 h-3 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),w.jsx("span",{className:"message-title-text ml-0.5 text-green-400 font-semibold text-xs",children:Z("codeChangesCommitted")})]}),w.jsxs("div",{className:"mt-1 p-1.5 bg-gray-800 rounded-md text-xs",children:[w.jsxs("div",{className:"flex items-center mb-1",children:[w.jsxs("span",{className:"text-gray-300 text-xs",children:[Z("commitId"),":"]}),w.jsx("span",{className:"ml-1 font-mono text-green-300 text-xs cursor-pointer hover:text-green-400 hover:underline",onClick:s,title:Z("clickToFilterHistory"),children:e.length>8?e.substring(0,8)+"...":e}),w.jsx("button",{className:"ml-1 text-gray-400 hover:text-green-400 focus:outline-none",onClick:o,title:Z("copyFullCommitId")||"Copy full commit ID",children:w.jsx(YR,{style:{fontSize:"12px"}})})]}),w.jsxs("div",{className:"flex items-center",children:[w.jsxs("span",{className:"text-gray-300 text-xs",children:[Z("modifiedFiles"),":"]}),w.jsx("span",{className:"ml-1 text-green-300 text-xs",children:t})]})]})]})})},QPt=({message:n})=>{var a;let e=!1,t="",i=0,r="";(a=n.metadata)==null||a.action_file;try{const l=JSON.parse(n.content||"{}");t=l.commit_hash||"",i=l.diff_file_num||0,r=l.event_file||"",e=l.have_commit||!1}catch(l){console.error("Failed to parse apply changes content:",l)}const s=()=>{t&&(Rn.publish(Dn.UI.ACTIVATE_PANEL,"history"),Rn.publish(Dn.HISTORY.FILTER_BY_COMMIT,new eHe(t)))},o=l=>{l.stopPropagation(),t&&navigator.clipboard.writeText(t).then(()=>{pt.success(Z("commitIdCopied")||"Commit ID copied to clipboard")}).catch(c=>{console.error("Failed to copy commit ID:",c),pt.error(Z("failedToCopyCommitId")||"Failed to copy commit ID")})};return w.jsx("div",{className:"message-font text-xs",children:w.jsxs("div",{className:"mt-1 p-1.5 bg-gray-800 rounded-md text-xs",children:[w.jsx("div",{className:"text-gray-300",children:Z("manualChangesCommited")}),e&&t&&w.jsx("div",{className:"mt-1 pt-1 border-t border-gray-700",children:w.jsxs("div",{className:"flex items-center",children:[w.jsxs("span",{className:"text-gray-400 text-xs",children:[Z("commitId"),":"]}),w.jsx("span",{className:"ml-1 font-mono text-blue-300 text-xs cursor-pointer hover:text-blue-400 hover:underline",onClick:s,title:Z("clickToFilterHistory"),children:t.length>8?t.substring(0,8)+"...":t}),w.jsx("button",{className:"ml-1 text-gray-400 hover:text-blue-400 focus:outline-none",onClick:o,title:Z("copyFullCommitId")||"Copy full commit ID",children:w.jsx(YR,{style:{fontSize:"12px"}})})]})})]})})},qPt=({message:n})=>{var g,m;const[e,t]=b.useState(!1),[i,r]=b.useState([]),[s,o]=b.useState(null),[a,l]=b.useState(""),c=()=>{var p;if(t(!e),!e&&((p=n.metadata)==null?void 0:p.command)==="read_files"&&n.content){const A=Z8e(n.content);r(A)}},d=p=>{s===p?o(null):(o(p),l(i[p].content))},u=b.useCallback((p,A)=>{},[]),h=b.useCallback(p=>{p!==void 0&&l(p)},[]),f=b.useCallback(()=>{},[]);return w.jsxs("div",{className:"message-font message-content-container",children:[w.jsxs("div",{className:"bg-gradient-to-r from-gray-800 to-gray-750 px-4 py-3 border-b border-gray-700 flex items-center justify-between cursor-pointer",onClick:c,children:[w.jsxs("div",{className:"flex items-center",children:[w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-5 h-5 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),w.jsx("span",{className:"text-indigo-400 message-title-text",children:Z("agenticFilterCommandResult",{command:(g=n.metadata)==null?void 0:g.command})})]}),w.jsx("div",{className:"text-gray-400",children:w.jsx("svg",{className:`w-5 h-5 transition-transform duration-200 ${e?"transform rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})})]}),e&&w.jsx("div",{className:"p-4 bg-gray-800/30",children:((m=n.metadata)==null?void 0:m.command)==="read_files"?w.jsxs("div",{className:"text-gray-200",children:[w.jsxs("div",{className:"mb-4",children:[w.jsxs("h3",{className:"font-medium text-gray-300 mb-2",children:[Z("files"),":"]}),w.jsx("div",{className:"space-y-1",children:i.map((p,A)=>w.jsxs("div",{className:`flex items-center p-2 rounded cursor-pointer hover:bg-gray-700/50 ${s===A?"bg-gray-700/70 border-l-2 border-indigo-500":""}`,onClick:()=>d(A),children:[w.jsx("svg",{className:"w-4 h-4 mr-2 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),w.jsx("span",{className:"truncate",children:p.file}),w.jsx("svg",{className:`w-4 h-4 ml-auto transition-transform duration-200 ${s===A?"transform rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]},A))})]}),s!==null&&w.jsx("div",{className:"border border-gray-700 rounded-lg overflow-hidden",style:{height:"400px"},children:w.jsx(Fue,{initialContent:i[s].content,onContentChange:h,onEditorReady:u,onSubmit:f})})]}):w.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:w.jsx(Hp,{className:"text-gray-200 break-words",components:{code:({className:p,children:A,...v})=>{const _=/language-(\w+)/.exec(p||"");return!_?w.jsx("code",{className:p,...v,children:A}):w.jsx(zl,{language:_?_[1]:"",style:yc,PreTag:"div",wrapLines:!0,wrapLongLines:!0,customStyle:{borderRadius:"0.375rem",fontSize:"14px"},children:String(A).replace(/\n$/,"")})}},children:n.content})})})]})},YPt=({message:n})=>{var e,t;return w.jsxs("div",{className:"font-mono text-sm",children:[w.jsx("div",{className:"text-indigo-400 font-semibold mb-1",children:Z("commandPreparation")}),w.jsxs("div",{className:"mb-2",children:[w.jsxs("span",{className:"text-gray-400",children:[Z("command"),": "]}),w.jsx("span",{className:"text-white font-semibold",children:(e=n.metadata)==null?void 0:e.command})]}),((t=n.metadata)==null?void 0:t.parameters)&&Object.keys(n.metadata.parameters).length>0&&w.jsxs("div",{children:[w.jsxs("div",{className:"text-gray-400 mb-1",children:[Z("parameters"),":"]}),w.jsx("div",{className:"bg-gray-800 p-2 rounded",children:Object.entries(n.metadata.parameters).map(([i,r])=>w.jsxs("div",{className:"grid grid-cols-[120px_1fr] gap-2 mb-1",children:[w.jsxs("span",{className:"text-indigo-300",children:[i,":"]}),w.jsx("span",{className:"text-white break-all",children:typeof r=="object"?JSON.stringify(r):String(r)})]},i))})]})]})},XPt=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="command_suggestion",t=e&&!n.isStreaming;return e?w.jsx(ZPt,{message:n,isCompleted:t}):w.jsx(JPt,{message:n})},ZPt=({message:n,isCompleted:e})=>{const[t,i]=b.useState(e),r=n.content||"",s=r.split(`
|
530
530
|
`),o=3,a=s.length>o?s.slice(0,o).join(`
|
531
531
|
`)+"...":r;return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-4 h-4 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),w.jsxs("span",{className:"text-yellow-400 message-title-text",children:[n.isStreaming?Z("processingStatus"):Z("processingComplete"),"(",Z("agenticFilterContext"),")"]}),n.isStreaming&&w.jsx("span",{className:"ml-2",children:w.jsxs("svg",{className:"animate-spin h-4 w-4 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),w.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"})]})})]}),w.jsx("div",{className:"message-content-container bg-gray-800/50 p-2 whitespace-pre-wrap text-white break-words",children:t?a:r})]})},JPt=({message:n})=>{const[e,t]=b.useState(!1);return w.jsxs("div",{className:"message-font",children:[w.jsxs("div",{className:"message-title",children:[w.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):w.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),w.jsx("span",{className:"message-title-icon",children:w.jsx("svg",{className:"w-4 h-4 text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:w.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),w.jsx("span",{className:"text-blue-400 message-title-text",children:Z("agenticFilterCommandChoose",{command:n.content.split("(")[0]})})]}),!e&&w.jsx("div",{className:"message-content-container bg-gray-800/50 p-2 whitespace-pre-wrap text-white break-words",children:n.content})]})},tHe=({messages:n,onUserResponse:e})=>{const t=r=>{if(r.length===0)return[];const s=r.slice(0,-1),o=r[r.length-1],a=["code_generate","agentic_filter","token_stat"];return[...s.filter(c=>{var u,h;if(c.contentType==="command_prepare_stat"||c.type==="STREAM"&&!c.isStreaming&&a.includes((u=c.metadata)==null?void 0:u.stream_out_type))return!1;const d=(h=c.metadata)==null?void 0:h.path;if(d==="/agent/edit/completion"||d==="/agent/edit/window_length_change"||d==="/agent/edit/token_usage"||d==="/agent/edit/apply_pre_changes")return!1;if(d==="/agent/edit/apply_changes"||d==="/agent/edit/apply_pre_changes")try{if(JSON.parse(c.content||"{}").have_commit===!1)return!1}catch(f){console.debug("Failed to parse message content for filtering:",f)}return!0}),o]},i=r=>{var s,o,a,l,c,d,u,h,f,g,m,p,A,v,_,y,C,x,E,I;if(r.isUser)return w.jsx(SPt,{message:r});if((o=(s=r.metadata)==null?void 0:s.path)!=null&&o.startsWith("/agent/")){if(((a=r.metadata)==null?void 0:a.path)==="/agent/edit"||((l=r.metadata)==null?void 0:l.path)==="/agent/edit/thinking")return w.jsx(CIe,{message:r});if(((c=r.metadata)==null?void 0:c.path)==="/agent/edit/tool/call"){const L=JSON.parse(r.content);if(L.tool_name==="ReplaceInFileTool")return w.jsx(LPt,{message:r});if(L.tool_name==="WriteToFileTool")return w.jsx(TPt,{message:r});if(L.tool_name==="AskFollowupQuestionTool")return w.jsx(DPt,{message:r});if(L.tool_name==="ExecuteCommandTool")return w.jsx(RPt,{message:r});if(L.tool_name==="ListCodeDefinitionNamesTool")return w.jsx(MPt,{message:r});if(L.tool_name==="ListFilesTool")return w.jsx(OPt,{message:r});if(L.tool_name==="ReadFileTool")return w.jsx(PPt,{message:r});if(L.tool_name==="SearchFilesTool")return w.jsx(BPt,{message:r});if(L.tool_name==="UseMcpTool")return w.jsx(FPt,{message:r});if(L.tool_name==="AttemptCompletionTool")return w.jsx(HPt,{message:r})}return((d=r.metadata)==null?void 0:d.path)==="/agent/edit/tool/result"?w.jsx(NPt,{message:r}):((u=r.metadata)==null?void 0:u.path)==="/agent/edit/apply_changes"?w.jsx(GPt,{message:r}):((h=r.metadata)==null?void 0:h.path)==="/agent/edit/apply_pre_changes"?w.jsx(QPt,{message:r}):((f=r.metadata)==null?void 0:f.path)==="/agent/edit/plan/mode/respond"||((g=r.metadata)==null?void 0:g.path)==="/agent/edit/completion"?w.jsx(f2,{message:r}):w.jsx(f2,{message:r})}return((m=r.metadata)==null?void 0:m.stream_out_type)==="agentic_filter"?r.contentType==="command_execute_stat"?w.jsx(qPt,{message:r}):r.contentType==="command_prepare"?w.jsx(YPt,{message:r}):r.contentType==="text"?w.jsx(lPt,{message:r}):w.jsx(XPt,{message:r}):r.type==="COMPLETION"?w.jsx(rPt,{message:r}):((p=r.metadata)==null?void 0:p.stream_out_type)==="file_number_list"?w.jsx(dPt,{message:r}):((A=r.metadata)==null?void 0:A.stream_out_type)==="index_build"?w.jsx(wPt,{message:r}):((v=r.metadata)==null?void 0:v.stream_out_type)==="code_generate"?w.jsx(fPt,{message:r}):((_=r.metadata)==null?void 0:_.stream_out_type)==="lint"?w.jsx(bPt,{message:r}):((y=r.metadata)==null?void 0:y.stream_out_type)==="compile"?w.jsx(EPt,{message:r}):((C=r.metadata)==null?void 0:C.stream_out_type)==="code_rank"?w.jsx(mPt,{message:r}):((x=r.metadata)==null?void 0:x.stream_out_type)==="unmerged_blocks"?w.jsx(xPt,{message:r}):r.contentType==="summary"?w.jsx(cPt,{message:r}):r.contentType==="token_stat"?w.jsx(tPt,{message:r}):r.contentType==="command_execute_stat"?w.jsx(nPt,{message:r}):r.contentType==="context_used"?w.jsx(iPt,{message:r}):r.isThinking||r.isStreaming||r.type==="STREAM"?w.jsx(CIe,{message:r}):((E=r.metadata)==null?void 0:E.stream_out_type)==="command_suggestion"?w.jsx(sPt,{message:r}):r.contentType==="markdown"&&!((I=r.metadata)!=null&&I.stream_out_type)?w.jsx(f2,{message:r}):w.jsx(f2,{message:r})};return w.jsx(w.Fragment,{children:t(n).map((r,s)=>w.jsxs("div",{className:`flex ${r.isUser?"justify-end":"justify-start"} mb-2 w-full`,children:[!r.isUser&&w.jsx("div",{className:"w-7 h-7 rounded-full bg-indigo-600 flex items-center justify-center mr-2 flex-shrink-0",children:w.jsx("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"})})}),w.jsxs("div",{className:`w-[80%] ${r.isUser?"bg-indigo-600":r.type==="ERROR"?"bg-red-900/80":r.isThinking||r.isStreaming?"bg-gray-700/50":"bg-gray-700"}
|
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-DgQa03WG.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.100
|
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.370
|
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=YovNqtVQJrVFN6UoIRR7K0-DP3AjMX3wXpsuueLnZe8,11959
|
8
8
|
auto_coder_web/terminal.py,sha256=jtAH7FaC573cgxc7FnI_mOZ3D2dSCO3PrZN0OehtbNQ,9521
|
9
9
|
auto_coder_web/types.py,sha256=hwHLmYXaCZo-V66dAOsCK2weBAd87gexBeJBpfjO5aU,1693
|
10
|
-
auto_coder_web/version.py,sha256=
|
10
|
+
auto_coder_web/version.py,sha256=SXjHvdCf9Txppd9ny6z9oI9X7Vqv82L9FF-xc2-ukjM,24
|
11
11
|
auto_coder_web/agentic_message_parser/__init__.py,sha256=a6tHO-3fWK2uIU-E3wPISO3H-5I9XHKjofyPxj-m7pY,358
|
12
12
|
auto_coder_web/agentic_message_parser/message_parser.py,sha256=-uGG2QDXS7aLPi7zJopDwlt0S__JFHgKPPZs68LpKhI,2690
|
13
13
|
auto_coder_web/agentic_message_parser/tool_parsers.py,sha256=hCjd02ErCu5u5EmElOPHc6w0UZFX4M59FVJwfy3WkV8,2653
|
@@ -45,7 +45,7 @@ auto_coder_web/routers/todo_router.py,sha256=IkQurQTw0Xk9P8yEtY_iie1z5ZK3CzDQE_N
|
|
45
45
|
auto_coder_web/routers/upload_router.py,sha256=HdQIl3ICcT3EB2kwryTbF-PItWV-Gugses7Y0Eaw2WQ,1798
|
46
46
|
auto_coder_web/web/bridge.js,sha256=us40dbuGHa2_zBBVBCa_GznOvpuZNDObViksMeoQch0,7364
|
47
47
|
auto_coder_web/web/favicon.ico,sha256=PRD32mxgMXg0AIFmjErFs66XQ8qaJiqw_NMS-7n0i90,3870
|
48
|
-
auto_coder_web/web/index.html,sha256=
|
48
|
+
auto_coder_web/web/index.html,sha256=WuO2DVpv1Lraf5Q3vKutirlmOYPLn_a2sufO5unRPiQ,410
|
49
49
|
auto_coder_web/web/logo192.png,sha256=w4Y5bscNs2CAdbX7-qxKscyqhroFpoqzk-xVHrZsPgA,5347
|
50
50
|
auto_coder_web/web/logo512.png,sha256=nqT02nBQwMxAiSb2o5wlNiTpursdQ8eXfNghRFpgtGE,9664
|
51
51
|
auto_coder_web/web/manifest.json,sha256=ULPYw5A68_eNhxuUVXqxT045yhkurKPSz6hjyGcnmhQ,492
|
@@ -90,8 +90,8 @@ auto_coder_web/web/assets/lexon-YWi4-JPR.js,sha256=l9pURhF6kU3UKzKOIIQprnjMAXzdI
|
|
90
90
|
auto_coder_web/web/assets/liquid-CPaH0eVF.js,sha256=uXE_OsLEw3W8B-ReZOUwybkJu3J6se8VlGWx0MFpx7g,4208
|
91
91
|
auto_coder_web/web/assets/lua-nf6ki56Z.js,sha256=O3vMsGoiFHDMGSxTP1bHnDnRPebfmFnC7kf8-ovGkO8,2369
|
92
92
|
auto_coder_web/web/assets/m3-Cpb6xl2v.js,sha256=PmotBCyVZvUGHh9t9juODmjXptTEP5K6bnPj2WgYO6c,3063
|
93
|
-
auto_coder_web/web/assets/main-
|
94
|
-
auto_coder_web/web/assets/main.js,sha256=
|
93
|
+
auto_coder_web/web/assets/main-DgQa03WG.css,sha256=kfCXS5MwxhAJ067NF0xkkREtMgRX6Ny84ANT6uoiG_0,242985
|
94
|
+
auto_coder_web/web/assets/main.js,sha256=uTE1iccF6uwuh9KZcbMG1luPW1T-NdWRTjGxLdZuMHA,6694420
|
95
95
|
auto_coder_web/web/assets/markdown-DSZPf7rp.js,sha256=3ZMgfYxjKX9U8l6GFCNrO28Hj7JU-4rKrEqXIezyqT4,4034
|
96
96
|
auto_coder_web/web/assets/mdx-DRx1b0qs.js,sha256=awzor_jnBNHRhTxk3_jcpGXsNUFbi9Ow0OIqWYq4CQA,5113
|
97
97
|
auto_coder_web/web/assets/mips-B_c3zf-v.js,sha256=L4uNgcwtDWPbyL0qnO-2w9x2PdI02UJcc8yQrYnHahA,2825
|
@@ -245,8 +245,8 @@ auto_coder_web/web/monaco-editor/min/vs/language/typescript/tsWorker.js,sha256=_
|
|
245
245
|
auto_coder_web/web/sounds/ding-dong.wav,sha256=BveDrGCyt_YMHaJwFJ80L5NfbUF5cl5QjzR-SRehxTk,35324
|
246
246
|
auto_coder_web/web/sounds/gentle-notification.wav,sha256=bzd0MwECdrjmNz7mbqv_y03S7WwD3G6agbIh1rWJ9cQ,72124
|
247
247
|
auto_coder_web/web/sounds/soft-chime.wav,sha256=Akpw7_rHLnX3rE13dRYpyZbmQFLGtp8P53LCdAkT9sA,40364
|
248
|
-
auto_coder_web-0.1.
|
249
|
-
auto_coder_web-0.1.
|
250
|
-
auto_coder_web-0.1.
|
251
|
-
auto_coder_web-0.1.
|
252
|
-
auto_coder_web-0.1.
|
248
|
+
auto_coder_web-0.1.100.dist-info/METADATA,sha256=Ga4xKw-ZvYBuFzpDL95-nDvYqFl3Kx_YvupVvbw82xw,1436
|
249
|
+
auto_coder_web-0.1.100.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
250
|
+
auto_coder_web-0.1.100.dist-info/entry_points.txt,sha256=oh8kd1ZecWDgdv-bIj_ru3phvl4scuxwXl9DK0Khltg,61
|
251
|
+
auto_coder_web-0.1.100.dist-info/top_level.txt,sha256=UCzEw494Im0KvR-FTYf2jh-okqHvLsC_0JLOrQZoSpg,15
|
252
|
+
auto_coder_web-0.1.100.dist-info/RECORD,,
|