@kimuson/claude-code-viewer 0.0.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/standalone/.next/BUILD_ID +1 -1
- package/dist/standalone/.next/app-build-manifest.json +23 -18
- package/dist/standalone/.next/app-path-routes-manifest.json +1 -1
- package/dist/standalone/.next/build-manifest.json +2 -2
- package/dist/standalone/.next/prerender-manifest.json +1 -51
- package/dist/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/standalone/.next/server/app/_not-found.rsc +18 -17
- package/dist/standalone/.next/server/app/api/[[...route]]/route.js +13 -3
- package/dist/standalone/.next/server/app/api/[[...route]]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/[[...route]]/route_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/index.html +1 -1
- package/dist/standalone/.next/server/app/index.rsc +19 -18
- package/dist/standalone/.next/server/app/page.js +2 -2
- package/dist/standalone/.next/server/app/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/projects/[projectId]/page.js +2 -2
- package/dist/standalone/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page.js +3 -7
- package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/projects/page.js +2 -2
- package/dist/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app-paths-manifest.json +1 -1
- package/dist/standalone/.next/server/chunks/144.js +1 -0
- package/dist/standalone/.next/server/chunks/161.js +1 -0
- package/dist/standalone/.next/server/chunks/388.js +9 -0
- package/dist/standalone/.next/server/chunks/389.js +1 -0
- package/dist/standalone/.next/server/chunks/451.js +1 -0
- package/dist/standalone/.next/server/chunks/522.js +5 -0
- package/dist/standalone/.next/server/chunks/63.js +9 -0
- package/dist/standalone/.next/server/chunks/705.js +9 -0
- package/dist/standalone/.next/server/chunks/781.js +9 -0
- package/dist/standalone/.next/server/chunks/791.js +1 -0
- package/dist/standalone/.next/server/chunks/852.js +1 -0
- package/dist/standalone/.next/server/chunks/856.js +1 -1
- package/dist/standalone/.next/server/chunks/902.js +22 -0
- package/dist/standalone/.next/server/chunks/914.js +1 -0
- package/dist/standalone/.next/server/chunks/942.js +5 -0
- package/dist/standalone/.next/server/chunks/997.js +1 -0
- package/dist/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/standalone/.next/server/pages/404.html +1 -1
- package/dist/standalone/.next/server/pages/500.html +1 -1
- package/dist/standalone/.next/server/pages-manifest.json +1 -2
- package/dist/standalone/.next/static/-IIvPzgFKOrPTwJWbCFbN/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/-IIvPzgFKOrPTwJWbCFbN/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/0s5c6k0my6qOdeLpUYduU/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/0s5c6k0my6qOdeLpUYduU/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/2WjtgNUcg91Bcreklxqxp/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/2WjtgNUcg91Bcreklxqxp/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/3wUyAp1hHYhcdsJulD71A/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/3wUyAp1hHYhcdsJulD71A/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/4N8RL28w5jrZdQ-1sMMIq/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/4N8RL28w5jrZdQ-1sMMIq/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/5AUO0zgGdttgCNx_mWteG/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/5AUO0zgGdttgCNx_mWteG/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/698PYz5QwFZuAn2e9RH8C/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/698PYz5QwFZuAn2e9RH8C/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/8DnHa44e9AArokHSXrcsI/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/8DnHa44e9AArokHSXrcsI/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/EIL5npT28-fn4fSGUWrc8/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/EIL5npT28-fn4fSGUWrc8/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/IOhSwXFlUVKXfDsM06h4V/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/IOhSwXFlUVKXfDsM06h4V/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/SEBz9OZpEQ6TnqzeJMw8F/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/SEBz9OZpEQ6TnqzeJMw8F/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/T3zQfL4k5EGmOyq6yYkh_/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/T3zQfL4k5EGmOyq6yYkh_/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/W4GtvpXwWodCDdggwkxOX/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/W4GtvpXwWodCDdggwkxOX/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/W5CW36NTaXhL6uyyPwVCF/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/W5CW36NTaXhL6uyyPwVCF/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/X4tH_cQbzXceXn-a6E2ps/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/X4tH_cQbzXceXn-a6E2ps/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/XHD-ZWwPpwboATLIQpO4r/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/XHD-ZWwPpwboATLIQpO4r/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/Y5DbqR5i6bYEsNIGUxchh/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/Y5DbqR5i6bYEsNIGUxchh/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/b0Lnuz5_C3sn8k4UNpCRv/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/b0Lnuz5_C3sn8k4UNpCRv/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/bF5XFDQE8k1mIDZjTpdZl/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/bF5XFDQE8k1mIDZjTpdZl/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/bUS3oITEgVt2-me9Yhouc/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/bUS3oITEgVt2-me9Yhouc/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/chunks/150-423be7500182cc33.js +1 -0
- package/dist/standalone/.next/static/chunks/219-3522179604e6066c.js +16 -0
- package/dist/standalone/.next/static/chunks/251-c78cf6d746377497.js +1 -0
- package/dist/standalone/.next/static/chunks/311-8ddb4880d5fee039.js +1 -0
- package/dist/standalone/.next/static/chunks/33-366ba0d0a94aa3c4.js +1 -0
- package/dist/standalone/.next/static/chunks/409-7242985dd65d8d0a.js +1 -0
- package/dist/standalone/.next/static/chunks/409-89924c7045c85d4d.js +1 -0
- package/dist/standalone/.next/static/chunks/409-8e5de6996e43c44c.js +1 -0
- package/dist/standalone/.next/static/chunks/409-b1dba29a07ae758a.js +1 -0
- package/dist/standalone/.next/static/chunks/409-dbcdfb0a640d2f16.js +1 -0
- package/dist/standalone/.next/static/chunks/412-2403338d7a344504.js +1 -0
- package/dist/standalone/.next/static/chunks/5-3d4eff5d72d53094.js +1 -0
- package/dist/standalone/.next/static/chunks/5-55adc565d173510e.js +1 -0
- package/dist/standalone/.next/static/chunks/559-4a9cb1227f1261b7.js +16 -0
- package/dist/standalone/.next/static/chunks/583-5caa5b2bfe8a2df8.js +1 -0
- package/dist/standalone/.next/static/chunks/595-52c0638105e94677.js +16 -0
- package/dist/standalone/.next/static/chunks/608-b86cfa3cfb160138.js +1 -0
- package/dist/standalone/.next/static/chunks/608-ca4efe3ce4fe39a5.js +1 -0
- package/dist/standalone/.next/static/chunks/730-1d22f1bf654b6820.js +16 -0
- package/dist/standalone/.next/static/chunks/830-6e23a90b5a6129bd.js +16 -0
- package/dist/standalone/.next/static/chunks/884-279acd79efa6e9a9.js +1 -0
- package/dist/standalone/.next/static/chunks/98-9a09a0ec86541f6f.js +1 -0
- package/dist/standalone/.next/static/chunks/984-bb9e4d0b54a7feae.js +16 -0
- package/dist/standalone/.next/static/chunks/app/layout-248f77cb1dbbb2f1.js +1 -0
- package/dist/standalone/.next/static/chunks/app/layout-61da9bef4edbd721.js +1 -0
- package/dist/standalone/.next/static/chunks/app/layout-9cc578291d1122a6.js +1 -0
- package/dist/standalone/.next/static/chunks/app/layout-df3fe9e7453a44b8.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-017f8e1a8383e65e.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-0f45fc00d7175cae.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-35f34576b393594d.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-60ed06e2d8d22cb2.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-9af32caff2a4976d.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-a80c2e583d03357d.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-ad7bf7983bb30c87.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-b63764462f54f2b5.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-03ef02af087afc6b.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-1ec8a186b7ec29eb.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-38b196c8794a039c.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-3bce8fbc542864bc.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-3caf2718308efd7c.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-5c73f56ab45c8d63.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-7327712352196987.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-78abd82b3673601b.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-7d9772e3e18620b2.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-7e03ad068ad34e14.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-88f34cd031f28e09.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-8c83ef1c4c77523c.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-935bedd35de577e3.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-bb728f4bbfea646c.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-c0e036944a6ac016.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-e26692214649a2aa.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-e67af2503b1ebdc2.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/page-0a575db7be576968.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/page-68046792ceaef9df.js +1 -0
- package/dist/standalone/.next/static/chunks/app/projects/page-9b96f0e12f54372e.js +1 -0
- package/dist/standalone/.next/static/css/31cea2df842c4c03.css +3 -0
- package/dist/standalone/.next/static/css/462242960d6ce780.css +3 -0
- package/dist/standalone/.next/static/css/736c23b2e8dc3f6b.css +3 -0
- package/dist/standalone/.next/static/css/8b7e282cc0b7d79b.css +3 -0
- package/dist/standalone/.next/static/css/a3d3768acd87162f.css +3 -0
- package/dist/standalone/.next/static/css/b1a4c8257c96f3e5.css +3 -0
- package/dist/standalone/.next/static/css/d7126693e49651c5.css +3 -0
- package/dist/standalone/.next/static/css/e2d764fdabf9fe7c.css +3 -0
- package/dist/standalone/.next/static/css/fe4d89aa2fe70ed7.css +3 -0
- package/dist/standalone/.next/static/jzCawpNJ_5UTY8p7oQDfU/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/jzCawpNJ_5UTY8p7oQDfU/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/kiCbJQ67aOIy8KF8CxcWF/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/kiCbJQ67aOIy8KF8CxcWF/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/llWcBaLinPeFWO-DeRCO1/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/llWcBaLinPeFWO-DeRCO1/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/n5ByUeVZI4rMF6_3jTTX4/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/n5ByUeVZI4rMF6_3jTTX4/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/nrRdBRNH-XGdnlJwLXOk1/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/nrRdBRNH-XGdnlJwLXOk1/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/q951Du7jKgT3tazxs0jAW/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/q951Du7jKgT3tazxs0jAW/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/tOczoqzLEaSm1a2E0hv1s/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/tOczoqzLEaSm1a2E0hv1s/_ssgManifest.js +1 -0
- package/dist/standalone/.next/static/wUD6Y_u_-tDhO52jWPYQZ/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/wUD6Y_u_-tDhO52jWPYQZ/_ssgManifest.js +1 -0
- package/dist/standalone/package.json +5 -2
- package/package.json +5 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{63758:(e,s,r)=>{"use strict";r.d(s,{SessionPageContent:()=>eu});var t=r(89835),a=r(59054),n=r(50417),l=r(58903),i=r(93856),d=r(38514),o=r(75123),c=r.n(o),m=r(55931),u=r(80942),x=r(53630),h=r(72667),p=r(63812),g=r(27608),b=r(89854),j=r(45320),f=r(41633),v=r(40138);let N=e=>{let{conversation:s,sidechainConversations:r,getToolResult:a}=e,n=(e=>{let s=e.at(0),r="".concat(e.length," conversations (").concat((null==s?void 0:s.type)!=="summary"?null==s?void 0:s.uuid:"",")");if(!s||"user"!==s.type)return r;let t="string"==typeof s.message.content?s.message.content:(()=>{let e=s.message.content.at(0);return void 0===e?null:"string"==typeof e?e:"text"===e.type?e.text:null})();return null!=t?t:r})(r),l="summary"!==s.type?s.uuid:s.leafUuid;return(0,t.jsxs)(v.lG,{children:[(0,t.jsx)(v.zM,{asChild:!0,children:(0,t.jsx)(u.$,{variant:"outline",size:"sm",className:"w-full mb-3 items-center justify-start",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,t.jsx)(f.A,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"overflow-hidden text-ellipsis",children:["View Task: ",n]})]})})}),(0,t.jsxs)(v.Cf,{className:"!w-[1200px] !max-w-none max-h-[80vh] overflow-hidden flex flex-col",children:[(0,t.jsxs)(v.c7,{children:[(0,t.jsx)(v.L3,{children:n.length>100?"".concat(n.slice(0,100),"..."):n}),(0,t.jsxs)(v.rr,{children:["Root UUID: ",l]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(X,{conversations:r,getToolResult:a})})]})]})};var y=r(55407),w=r(5530),k=r(9005),A=r(68607),C=r(36703),R=r(83632),S=r(8607),T=r(7951),M=r(18237);let I=(0,T.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function P(e){let{className:s,variant:r,asChild:a=!1,...n}=e,l=a?S.DX:"span";return(0,t.jsx)(l,{"data-slot":"badge",className:(0,M.cn)(I({variant:r}),s),...n})}var _=r(75284),U=r(45730),z=r(35853),Z=r(35880),B=r(96318);let E=e=>{let{content:s,className:r=""}=e;return(0,t.jsx)("div",{className:"prose prose-neutral dark:prose-invert max-w-none ".concat(r),children:(0,t.jsx)(z.oz,{remarkPlugins:[B.A],components:{h1(e){let{children:s,...r}=e;return(0,t.jsx)("h1",{className:"text-3xl font-bold mb-6 mt-8 pb-3 border-b border-border text-foreground",...r,children:s})},h2(e){let{children:s,...r}=e;return(0,t.jsx)("h2",{className:"text-2xl font-semibold mb-4 mt-8 pb-2 border-b border-border/50 text-foreground",...r,children:s})},h3(e){let{children:s,...r}=e;return(0,t.jsx)("h3",{className:"text-xl font-semibold mb-3 mt-6 text-foreground",...r,children:s})},h4(e){let{children:s,...r}=e;return(0,t.jsx)("h4",{className:"text-lg font-medium mb-2 mt-4 text-foreground",...r,children:s})},h5(e){let{children:s,...r}=e;return(0,t.jsx)("h5",{className:"text-base font-medium mb-2 mt-4 text-foreground",...r,children:s})},h6(e){let{children:s,...r}=e;return(0,t.jsx)("h6",{className:"text-sm font-medium mb-2 mt-4 text-muted-foreground",...r,children:s})},p(e){let{children:s,...r}=e;return(0,t.jsx)("p",{className:"mb-4 leading-7 text-foreground",...r,children:s})},ul(e){let{children:s,...r}=e;return(0,t.jsx)("ul",{className:"mb-4 ml-6 list-disc space-y-2",...r,children:s})},ol(e){let{children:s,...r}=e;return(0,t.jsx)("ol",{className:"mb-4 ml-6 list-decimal space-y-2",...r,children:s})},li(e){let{children:s,...r}=e;return(0,t.jsx)("li",{className:"leading-7 text-foreground",...r,children:s})},code(e){let{className:s,children:r,...a}=e,n=/language-(\w+)/.exec(s||"");return n?(0,t.jsxs)("div",{className:"relative my-6",children:[(0,t.jsx)("div",{className:"flex items-center justify-between bg-muted/30 px-4 py-2 border-b border-border rounded-t-lg",children:(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:n[1]})}),(0,t.jsx)(C.A,{style:Z.A,language:n[1],PreTag:"div",className:"!mt-0 !rounded-t-none !rounded-b-lg !border-t-0 !border !border-border",customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:String(r).replace(/\n$/,"")})]}):(0,t.jsx)("code",{className:"bg-muted/70 px-2 py-1 rounded-md text-sm font-mono text-foreground border",...a,children:r})},pre(e){let{children:s,...r}=e;return(0,t.jsx)("pre",{...r,children:s})},blockquote(e){let{children:s,...r}=e;return(0,t.jsx)("blockquote",{className:"border-l-4 border-primary/30 bg-muted/30 pl-6 pr-4 py-4 my-6 italic rounded-r-lg",...r,children:(0,t.jsx)("div",{className:"text-muted-foreground",children:s})})},a(e){let{children:s,href:r,...a}=e;return(0,t.jsx)("a",{href:r,className:"text-primary hover:text-primary/80 underline underline-offset-4 decoration-primary/30 hover:decoration-primary/60 transition-colors",...a,children:s})},table(e){let{children:s,...r}=e;return(0,t.jsx)("div",{className:"overflow-x-auto my-6 rounded-lg border border-border",children:(0,t.jsx)("table",{className:"min-w-full border-collapse",...r,children:s})})},thead(e){let{children:s,...r}=e;return(0,t.jsx)("thead",{className:"bg-muted/50",...r,children:s})},th(e){let{children:s,...r}=e;return(0,t.jsx)("th",{className:"border-b border-border px-4 py-3 text-left font-semibold text-foreground",...r,children:s})},td(e){let{children:s,...r}=e;return(0,t.jsx)("td",{className:"border-b border-border px-4 py-3 text-foreground",...r,children:s})},hr(e){let{...s}=e;return(0,t.jsx)("hr",{className:"my-8 border-t border-border",...s})},strong(e){let{children:s,...r}=e;return(0,t.jsx)("strong",{className:"font-semibold text-foreground",...r,children:s})},em(e){let{children:s,...r}=e;return(0,t.jsx)("em",{className:"italic text-foreground",...r,children:s})}},children:s})})},K=e=>{let{content:s,getToolResult:r}=e;if("text"===s.type)return(0,t.jsx)("div",{className:"w-full mx-2 my-6",children:(0,t.jsx)(E,{content:s.text})});if("thinking"===s.type)return(0,t.jsx)(_.Zp,{className:"bg-muted/50 border-dashed gap-2 py-3 mb-2",children:(0,t.jsxs)(U.Nt,{children:[(0,t.jsx)(U.R6,{asChild:!0,children:(0,t.jsx)(_.aR,{className:"cursor-pointer hover:bg-muted/80 rounded-t-lg transition-colors py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(y.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(_.ZB,{className:"text-sm font-medium",children:"Thinking"}),(0,t.jsx)(w.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,t.jsx)(U.Ke,{children:(0,t.jsx)(_.Wu,{className:"py-0 px-4",children:(0,t.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap font-mono",children:s.thinking})})})]})});if("tool_use"===s.type){let e=r(s.id);return(0,t.jsxs)(_.Zp,{className:"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20 gap-2 py-3 mb-2",children:[(0,t.jsxs)(_.aR,{className:"py-0 px-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(k.A,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),(0,t.jsx)(_.ZB,{className:"text-sm font-medium",children:"Tool Use"}),(0,t.jsx)(P,{variant:"outline",className:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",children:s.name})]}),(0,t.jsxs)(_.BT,{className:"text-xs",children:["Tool execution with ID: ",s.id]})]}),(0,t.jsxs)(_.Wu,{className:"space-y-2 py-0 px-4",children:[(0,t.jsxs)(U.Nt,{children:[(0,t.jsx)(U.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Input Parameters"}),(0,t.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(U.Ke,{children:(0,t.jsx)(C.A,{style:R.A,language:"json",PreTag:"div",className:"text-xs",children:JSON.stringify(s.input,null,2)})})]}),e&&(0,t.jsxs)(U.Nt,{children:[(0,t.jsx)(U.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Tool Result"}),(0,t.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(U.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:"string"==typeof e.content?(0,t.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.content}):e.content.map(e=>{if("image"===e.type)return(0,t.jsx)(A.default,{src:"data:".concat(e.source.media_type,";base64,").concat(e.source.data),alt:"Tool Result"},e.source.data);if("text"===e.type)return(0,t.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.text},e.text);throw Error("Unexpected tool result content type")})})})]})]})]})}return s.type,null},$=e=>{let{children:s}=e;return(0,t.jsxs)(U.Nt,{children:[(0,t.jsx)(U.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Meta Information"}),(0,t.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(U.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:s})})]})},F=e=>{let{children:s}=e;return(0,t.jsxs)(U.Nt,{children:[(0,t.jsx)(U.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Summarized"}),(0,t.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(U.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})},D=e=>{let{children:s}=e;return(0,t.jsxs)(U.Nt,{children:[(0,t.jsx)(U.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"System Message"}),(0,t.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(U.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})};var W=r(93021),q=r(28043),L=r(72676),O=r(5556);let H=RegExp("<(?<tag>[^>]+)>(?<content>\\s*[^<]*?\\s*)<\\/\\k<tag>>","g"),V=O.Ik({tag:O.Yj(),content:O.Yj()}),Q=e=>{let{text:s,id:r}=e,a=(e=>{var s,r,t,a;let n=Array.from(e.matchAll(H)).map(e=>V.safeParse(e.groups)).filter(e=>e.success).map(e=>e.data);if(0===n.length)return{kind:"text",content:e};let l=null==(s=n.find(e=>"command-name"===e.tag))?void 0:s.content,i=null==(r=n.find(e=>"command-args"===e.tag))?void 0:r.content,d=null==(t=n.find(e=>"command-message"===e.tag))?void 0:t.content,o=null==(a=n.find(e=>"local-command-stdout"===e.tag))?void 0:a.content;switch(!0){case void 0!==l:return{kind:"command",commandName:l,commandArgs:i,commandMessage:d};case void 0!==o:return{kind:"local-command",stdout:o};default:return{kind:"text",content:e}}})(s);return"command"===a.kind?(0,t.jsxs)(_.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",id:r,children:[(0,t.jsx)(_.aR,{className:"py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(L.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,t.jsx)(_.ZB,{className:"text-sm font-medium",children:"Claude Code Command"}),(0,t.jsx)(P,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",children:a.commandName})]})}),a.commandArgs||a.commandMessage?(0,t.jsx)(_.Wu,{className:"py-0 px-4",children:(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{children:[a.commandArgs&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Arguments:"}),(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandArgs})})]}),a.commandMessage&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Message:"}),(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandMessage})})]})]})})}):null]}):"local-command"===a.kind?(0,t.jsxs)(_.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,t.jsx)(_.aR,{className:"py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(L.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,t.jsx)(_.ZB,{className:"text-sm font-medium",children:"Local Command"})]})}),(0,t.jsx)(_.Wu,{className:"py-0 px-4",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:a.stdout})})]}):(0,t.jsx)(E,{className:"w-full px-3 py-3 mb-5 border border-border rounded-lg bg-slate-50",content:a.content})},Y=e=>{let{content:s,id:r}=e;return"string"==typeof s?(0,t.jsx)(Q,{text:s,id:r}):"text"===s.type?(0,t.jsx)(Q,{text:s.text,id:r}):"image"===s.type?"base64"===s.source.type?(0,t.jsxs)(_.Zp,{className:"border-purple-200 bg-purple-50/50 dark:border-purple-800 dark:bg-purple-950/20",id:r,children:[(0,t.jsxs)(_.aR,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(W.A,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),(0,t.jsx)(_.ZB,{className:"text-sm font-medium",children:"Image"}),(0,t.jsx)(P,{variant:"outline",className:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",children:s.source.media_type})]}),(0,t.jsx)(_.BT,{className:"text-xs",children:"User uploaded image content"})]}),(0,t.jsx)(_.Wu,{children:(0,t.jsx)("div",{className:"rounded-lg border overflow-hidden bg-background",children:(0,t.jsx)(A.default,{src:"data:".concat(s.source.media_type,";base64,").concat(s.source.data),alt:"User uploaded content",className:"max-w-full h-auto max-h-96 object-contain"})})})]}):(0,t.jsx)(_.Zp,{className:"border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",id:r,children:(0,t.jsxs)(_.aR,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(q.A,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,t.jsx)(_.ZB,{className:"text-sm font-medium",children:"Unsupported Media"}),(0,t.jsx)(P,{variant:"destructive",children:"Error"})]}),(0,t.jsx)(_.BT,{className:"text-xs",children:"Media type not supported for display"})]})}):(s.type,null)},G=e=>{let{conversation:s,getToolResult:r,isRootSidechain:a,getSidechainConversations:n}=e;if("summary"===s.type)return(0,t.jsx)(F,{children:s.summary});if("system"===s.type)return(0,t.jsx)(D,{children:s.content});if(s.isSidechain)return a(s)?(0,t.jsx)(N,{conversation:s,sidechainConversations:n(s.uuid).map(e=>"summary"===e.type?e:{...e,isSidechain:!1}),getToolResult:r}):null;if("user"===s.type){let e="string"==typeof s.message.content?(0,t.jsx)(Y,{content:s.message.content,id:"message-".concat(s.uuid)}):(0,t.jsx)("ul",{className:"w-full",id:"message-".concat(s.uuid),children:s.message.content.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(Y,{content:e})},e.toString()))});return!0===s.isMeta?(0,t.jsx)($,{children:e}):e}return"assistant"===s.type?(0,t.jsx)("ul",{className:"w-full",children:s.message.content.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(K,{content:e,getToolResult:r})},e.toString()))}):null},J=e=>{if("user"===e.type)return"user_".concat(e.uuid);if("assistant"===e.type)return"assistant_".concat(e.uuid);if("system"===e.type)return"system_".concat(e.uuid);if("summary"===e.type)return"summary_".concat(e.leafUuid);throw Error("Unknown conversation type: ".concat(e))},X=e=>{let{conversations:s,getToolResult:r}=e,{isRootSidechain:a,getSidechainConversations:n}=(e=>{let s=(0,m.useMemo)(()=>new Map(e.filter(e=>"summary"!==e.type).map(e=>[e.uuid,e])),[e]),r=(0,m.useCallback)(e=>{if("summary"===e.type||null===e.parentUuid)return e;let t=s.get(e.parentUuid);return void 0===t?e:r(t)},[s]),t=(0,m.useMemo)(()=>{let s=e.filter(e=>"summary"!==e.type).filter(e=>!0===e.isSidechain),t=new Map;for(let e of s){let s=r(e);if("summary"!==s.type)if(t.has(s.uuid)){var a;null==(a=t.get(s.uuid))||a.push(e)}else t.set(s.uuid,[e])}return t},[e,r]);return{isRootSidechain:(0,m.useCallback)(e=>"summary"!==e.type&&t.has(e.uuid),[t]),getSidechainConversations:(0,m.useCallback)(e=>{var s;return null!=(s=t.get(e))?s:[]},[t])}})(s);return(0,t.jsx)("ul",{children:s.flatMap(e=>{let s=(0,t.jsx)(G,{conversation:e,getToolResult:r,isRootSidechain:a,getSidechainConversations:n},J(e)),l="summary"!==e.type&&e.isSidechain;return[(0,t.jsx)("li",{className:"w-full flex ".concat(l||"assistant"===e.type||"system"===e.type||"summary"===e.type?"justify-start":"justify-end"),children:(0,t.jsx)("div",{className:"w-[85%]",children:s})},J(e))]})})};var ee=r(26057),es=r(70038),er=r(79588),et=r(31264),ea=r(19611);let en=e=>{let{projectId:s,sessionId:r,isPausedTask:n}=e,i=(0,er.useRouter)(),d=(0,m.useRef)(null),o=(0,a.useMutation)({mutationFn:async e=>{let t=await x.s.api.projects[":projectId"].sessions[":sessionId"].resume.$post({param:{projectId:s,sessionId:r},json:{resumeMessage:e.message}});if(!t.ok)throw Error(t.statusText);return t.json()},onSuccess:async e=>{h(""),r!==e.sessionId&&i.push("/projects/".concat(s,"/sessions/").concat(e.sessionId,"#message-").concat(e.userMessageId))}}),[c,h]=(0,m.useState)(""),p=(0,m.useRef)(null),g=(0,m.useId)(),b=()=>{c.trim()&&o.mutate({message:c.trim()})};return(0,t.jsxs)(_.Zp,{className:"border-t rounded-t-none border-x-0 bg-background/50 backdrop-blur-sm mt-10",children:[(0,t.jsxs)(_.aR,{className:"pb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ee.A,{className:"w-5 h-5 text-primary"}),(0,t.jsx)(_.ZB,{className:"text-lg",children:"Continue Conversation"})]}),(0,t.jsx)(_.BT,{children:"Start a new conversation based on this session's context"})]}),(0,t.jsxs)(_.Wu,{className:"space-y-4",children:[o.error&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md",children:[(0,t.jsx)(q.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Failed to resume chat. Please try again."})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(et.T,{ref:d,value:c,onChange:e=>h(e.target.value),onKeyDown:e=>{var s;(null==(s=p.current)||!s.handleKeyDown(e))&&"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),b())},placeholder:"Type your message here... (Start with / for commands, Shift+Enter to send)",className:"min-h-[80px] resize-none",disabled:o.isPending,maxLength:4e3,"aria-label":"Message input with command completion","aria-describedby":g,"aria-expanded":c.startsWith("/"),"aria-haspopup":"listbox",role:"combobox","aria-autocomplete":"list"}),(0,t.jsx)(ea.s,{ref:p,projectId:s,inputValue:c,onCommandSelect:e=>{var s;h(e),null==(s=d.current)||s.focus()},className:"absolute top-full left-0 right-0"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",id:g,children:[c.length,"/4000 characters • Use arrow keys to navigate commands"]}),(0,t.jsx)(u.$,{onClick:b,disabled:!c.trim()||o.isPending,size:"lg",className:"gap-2",children:o.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.A,{className:"w-4 h-4 animate-spin"}),"Starting... This may take a while."]}):n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(es.A,{className:"w-4 h-4"}),"Send"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(es.A,{className:"w-4 h-4"}),"Resume"]})})]})]})]})]})};var el=r(62520),ei=r(12240),ed=r(51290),eo=r(5685);let ec=e=>{let{sessions:s,currentSessionId:r,projectId:a}=e;return(0,t.jsxs)("div",{className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",children:[(0,t.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"font-semibold text-lg",children:"Sessions"}),(0,t.jsx)(ed.c,{projectId:a,trigger:(0,t.jsxs)(u.$,{size:"sm",variant:"outline",className:"gap-1.5 mr-5",children:[(0,t.jsx)(el.A,{className:"w-3.5 h-3.5"}),"New"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[s.length," total"]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:s.map(e=>{let s=e.id===r,n=null!==e.meta.firstCommand?(0,h.H)(e.meta.firstCommand):e.id;return(0,t.jsx)(c(),{href:"/projects/".concat(a,"/sessions/").concat(encodeURIComponent(e.id)),className:(0,M.cn)("block rounded-lg p-2.5 transition-all duration-200 hover:bg-blue-50/60 hover:border-blue-300/60 hover:shadow-sm border border-sidebar-border/40 bg-sidebar/30",s&&"bg-blue-100 border-blue-400 shadow-md ring-1 ring-blue-200/50 hover:bg-blue-100 hover:border-blue-400"),children:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h3",{className:"text-sm font-medium line-clamp-2 leading-tight text-sidebar-foreground",children:n}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-sidebar-foreground/70",children:[(0,t.jsx)(ee.A,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.meta.messageCount})]}),e.meta.lastModifiedAt&&(0,t.jsx)("span",{className:"text-xs text-sidebar-foreground/60",children:new Date(e.meta.lastModifiedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})},e.id)})})]})},em=e=>{let{currentSessionId:s,projectId:r,className:a}=e,{data:{sessions:n}}=(0,eo.B)(r),[l,i]=(0,m.useState)(!1);return(0,t.jsx)(U.Nt,{open:!l,onOpenChange:e=>i(!e),className:(0,M.cn)("hidden md:flex h-full",a),children:(0,t.jsx)("div",{className:"relative h-full",children:(0,t.jsxs)("div",{className:(0,M.cn)("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out",l?"w-12":"w-72 lg:w-80"),children:[(0,t.jsx)(U.R6,{asChild:!0,children:(0,t.jsx)(u.$,{variant:"ghost",size:"icon",className:"absolute -right-3 top-4 z-10 bg-background border border-sidebar-border shadow-sm",children:(0,t.jsx)(ei.A,{className:(0,M.cn)("w-4 h-4 transition-transform duration-200",l&&"rotate-180")})})}),(0,t.jsx)(U.Ke,{className:"h-full data-[state=closed]:animate-slide-out-to-left data-[state=open]:animate-slide-in-from-left",children:(0,t.jsx)(ec,{sessions:n,currentSessionId:s,projectId:r})}),l&&(0,t.jsx)("div",{className:"h-full bg-sidebar border-r border-sidebar-border flex flex-col items-center pt-16",children:(0,t.jsx)(ee.A,{className:"w-5 h-5 text-sidebar-foreground/70"})})]})})})},eu=e=>{let{projectId:s,sessionId:r}=e,{session:o,conversations:f,getToolResult:v}=((e,s)=>{let r=(0,j.useSuspenseQuery)({...((e,s)=>({queryKey:["sessions",s],queryFn:async()=>(await x.s.api.projects[":projectId"].sessions[":sessionId"].$get({param:{projectId:e,sessionId:s}})).json()}))(e,s)}),t=(0,m.useMemo)(()=>new Map(r.data.session.conversations.flatMap(e=>"user"!==e.type||"string"==typeof e.message.content?[]:e.message.content.flatMap(e=>"string"==typeof e||"tool_result"!==e.type?[]:[[e.tool_use_id,e]]))),[r.data.session.conversations]),a=(0,m.useCallback)(e=>t.get(e),[t]);return{session:r.data.session,conversations:r.data.session.conversations,getToolResult:a}})(s,r),N=(0,a.useMutation)({mutationFn:async e=>{let s=await x.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),{isRunningTask:y,isPausedTask:w}=(e=>{let[s,r]=(0,g.fp)(b.r);return(0,p.useQuery)({queryKey:["aliveTasks"],queryFn:async()=>{let e=await x.s.api.tasks.alive.$get({});if(!e.ok)throw Error(e.statusText);return r((await e.json()).aliveTasks),e.json()},refetchOnReconnect:!0}),(0,m.useMemo)(()=>{let r=s.find(s=>s.sessionId===e);return{aliveTask:s.find(s=>s.sessionId===e),isRunningTask:(null==r?void 0:r.status)==="running",isPausedTask:(null==r?void 0:r.status)==="paused"}},[s,e])})(r),[k,A]=(0,m.useState)(0),C=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if(y&&f.length!==k){A(f.length);let e=C.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},[f,y,k]),(0,t.jsxs)("div",{className:"flex h-screen",children:[(0,t.jsx)(em,{currentSessionId:r,projectId:s}),(0,t.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(0,t.jsxs)("div",{ref:C,className:"max-w-none flex-1 overflow-y-auto",children:[(0,t.jsxs)("header",{className:"px-3 py-3 sticky top-0 z-10 bg-background w-full",children:[(0,t.jsx)(u.$,{asChild:!0,variant:"ghost",children:(0,t.jsxs)(c(),{href:"/projects/".concat(s),className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Back to Session List"]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsx)("h1",{className:"text-3xl font-bold break-all overflow-ellipsis line-clamp-2 px-5",children:null!==o.meta.firstCommand?(0,h.H)(o.meta.firstCommand):r})}),y&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,t.jsx)(l.A,{className:"w-4 h-4 animate-spin"}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)("p",{className:"text-sm font-medium",children:"Conversation is in progress..."})}),(0,t.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(r)},children:[(0,t.jsx)(i.A,{className:"w-4 h-4"}),"Abort"]})]}),w&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,t.jsx)(d.A,{className:"w-4 h-4"}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)("p",{className:"text-sm font-medium",children:"Conversation is paused..."})}),(0,t.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(r)},children:[(0,t.jsx)(i.A,{className:"w-4 h-4"}),"Abort"]})]}),(0,t.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["Session ID: ",r]})]})]}),(0,t.jsxs)("main",{className:"w-full px-20 pb-20 relative z-5",children:[(0,t.jsx)(X,{conversations:f,getToolResult:v}),(0,t.jsx)(en,{projectId:s,sessionId:r,isPausedTask:w})]})]})})]})}},82791:(e,s,r)=>{Promise.resolve().then(r.bind(r,98613)),Promise.resolve().then(r.bind(r,72611)),Promise.resolve().then(r.bind(r,13881)),Promise.resolve().then(r.bind(r,85452)),Promise.resolve().then(r.bind(r,120)),Promise.resolve().then(r.bind(r,27740)),Promise.resolve().then(r.bind(r,59054)),Promise.resolve().then(r.bind(r,8120)),Promise.resolve().then(r.bind(r,9161)),Promise.resolve().then(r.bind(r,63812)),Promise.resolve().then(r.bind(r,86260)),Promise.resolve().then(r.bind(r,15312)),Promise.resolve().then(r.bind(r,45320)),Promise.resolve().then(r.bind(r,63758))},89854:(e,s,r)=>{"use strict";r.d(s,{r:()=>t});let t=(0,r(48304).eU)([])}},e=>{e.O(0,[33,150,583,608,984,409,900,341,358],()=>e(e.s=82791)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{63758:(e,s,t)=>{"use strict";t.d(s,{SessionPageContent:()=>ej});var r=t(89835),a=t(59054),n=t(50417),i=t(58903),l=t(93856),d=t(38514),o=t(75123),c=t.n(o),m=t(55931),x=t(80942),u=t(53630),h=t(72667),p=t(63812),g=t(27608),b=t(89854),f=t(45320),j=t(41633),v=t(40138);let N=e=>{let{conversation:s,sidechainConversations:t,getToolResult:a}=e,n=(e=>{let s=e.at(0),t="".concat(e.length," conversations (").concat((null==s?void 0:s.type)!=="summary"?null==s?void 0:s.uuid:"",")");if(!s||"user"!==s.type)return t;let r="string"==typeof s.message.content?s.message.content:(()=>{let e=s.message.content.at(0);return void 0===e?null:"string"==typeof e?e:"text"===e.type?e.text:null})();return null!=r?r:t})(t),i="summary"!==s.type?s.uuid:s.leafUuid;return(0,r.jsxs)(v.lG,{children:[(0,r.jsx)(v.zM,{asChild:!0,children:(0,r.jsx)(x.$,{variant:"outline",size:"sm",className:"w-full mb-3 items-center justify-start",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(j.A,{className:"h-4 w-4 flex-shrink-0"}),(0,r.jsxs)("span",{className:"overflow-hidden text-ellipsis",children:["View Task: ",n]})]})})}),(0,r.jsxs)(v.Cf,{className:"!w-[1200px] !max-w-none max-h-[80vh] overflow-hidden flex flex-col",children:[(0,r.jsxs)(v.c7,{children:[(0,r.jsx)(v.L3,{children:n.length>100?"".concat(n.slice(0,100),"..."):n}),(0,r.jsxs)(v.rr,{children:["Root UUID: ",i]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto",children:(0,r.jsx)(X,{conversations:t,getToolResult:a})})]})]})};var y=t(55407),w=t(5530),k=t(9005),C=t(68607),A=t(36703),S=t(83632),T=t(8607),R=t(7951),I=t(18237);let M=(0,R.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function P(e){let{className:s,variant:t,asChild:a=!1,...n}=e,i=a?T.DX:"span";return(0,r.jsx)(i,{"data-slot":"badge",className:(0,I.cn)(M({variant:t}),s),...n})}var U=t(75284),_=t(45730),z=t(35853),E=t(35880),Z=t(96318);let $=e=>{let{content:s,className:t=""}=e;return(0,r.jsx)("div",{className:"prose prose-neutral dark:prose-invert max-w-none ".concat(t),children:(0,r.jsx)(z.oz,{remarkPlugins:[Z.A],components:{h1(e){let{children:s,...t}=e;return(0,r.jsx)("h1",{className:"text-3xl font-bold mb-6 mt-8 pb-3 border-b border-border text-foreground",...t,children:s})},h2(e){let{children:s,...t}=e;return(0,r.jsx)("h2",{className:"text-2xl font-semibold mb-4 mt-8 pb-2 border-b border-border/50 text-foreground",...t,children:s})},h3(e){let{children:s,...t}=e;return(0,r.jsx)("h3",{className:"text-xl font-semibold mb-3 mt-6 text-foreground",...t,children:s})},h4(e){let{children:s,...t}=e;return(0,r.jsx)("h4",{className:"text-lg font-medium mb-2 mt-4 text-foreground",...t,children:s})},h5(e){let{children:s,...t}=e;return(0,r.jsx)("h5",{className:"text-base font-medium mb-2 mt-4 text-foreground",...t,children:s})},h6(e){let{children:s,...t}=e;return(0,r.jsx)("h6",{className:"text-sm font-medium mb-2 mt-4 text-muted-foreground",...t,children:s})},p(e){let{children:s,...t}=e;return(0,r.jsx)("p",{className:"mb-4 leading-7 text-foreground",...t,children:s})},ul(e){let{children:s,...t}=e;return(0,r.jsx)("ul",{className:"mb-4 ml-6 list-disc space-y-2",...t,children:s})},ol(e){let{children:s,...t}=e;return(0,r.jsx)("ol",{className:"mb-4 ml-6 list-decimal space-y-2",...t,children:s})},li(e){let{children:s,...t}=e;return(0,r.jsx)("li",{className:"leading-7 text-foreground",...t,children:s})},code(e){let{className:s,children:t,...a}=e,n=/language-(\w+)/.exec(s||"");return n?(0,r.jsxs)("div",{className:"relative my-6",children:[(0,r.jsx)("div",{className:"flex items-center justify-between bg-muted/30 px-4 py-2 border-b border-border rounded-t-lg",children:(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:n[1]})}),(0,r.jsx)(A.A,{style:E.A,language:n[1],PreTag:"div",className:"!mt-0 !rounded-t-none !rounded-b-lg !border-t-0 !border !border-border",customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:String(t).replace(/\n$/,"")})]}):(0,r.jsx)("code",{className:"bg-muted/70 px-2 py-1 rounded-md text-sm font-mono text-foreground border",...a,children:t})},pre(e){let{children:s,...t}=e;return(0,r.jsx)("pre",{...t,children:s})},blockquote(e){let{children:s,...t}=e;return(0,r.jsx)("blockquote",{className:"border-l-4 border-primary/30 bg-muted/30 pl-6 pr-4 py-4 my-6 italic rounded-r-lg",...t,children:(0,r.jsx)("div",{className:"text-muted-foreground",children:s})})},a(e){let{children:s,href:t,...a}=e;return(0,r.jsx)("a",{href:t,className:"text-primary hover:text-primary/80 underline underline-offset-4 decoration-primary/30 hover:decoration-primary/60 transition-colors",...a,children:s})},table(e){let{children:s,...t}=e;return(0,r.jsx)("div",{className:"overflow-x-auto my-6 rounded-lg border border-border",children:(0,r.jsx)("table",{className:"min-w-full border-collapse",...t,children:s})})},thead(e){let{children:s,...t}=e;return(0,r.jsx)("thead",{className:"bg-muted/50",...t,children:s})},th(e){let{children:s,...t}=e;return(0,r.jsx)("th",{className:"border-b border-border px-4 py-3 text-left font-semibold text-foreground",...t,children:s})},td(e){let{children:s,...t}=e;return(0,r.jsx)("td",{className:"border-b border-border px-4 py-3 text-foreground",...t,children:s})},hr(e){let{...s}=e;return(0,r.jsx)("hr",{className:"my-8 border-t border-border",...s})},strong(e){let{children:s,...t}=e;return(0,r.jsx)("strong",{className:"font-semibold text-foreground",...t,children:s})},em(e){let{children:s,...t}=e;return(0,r.jsx)("em",{className:"italic text-foreground",...t,children:s})}},children:s})})},B=e=>{let{content:s,getToolResult:t}=e;if("text"===s.type)return(0,r.jsx)("div",{className:"w-full mx-2 my-6",children:(0,r.jsx)($,{content:s.text})});if("thinking"===s.type)return(0,r.jsx)(U.Zp,{className:"bg-muted/50 border-dashed gap-2 py-3 mb-2",children:(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsx)(U.aR,{className:"cursor-pointer hover:bg-muted/80 rounded-t-lg transition-colors py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(y.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Thinking"}),(0,r.jsx)(w.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap font-mono",children:s.thinking})})})]})});if("tool_use"===s.type){let e=t(s.id);return(0,r.jsxs)(U.Zp,{className:"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20 gap-2 py-3 mb-2",children:[(0,r.jsxs)(U.aR,{className:"py-0 px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(k.A,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Tool Use"}),(0,r.jsx)(P,{variant:"outline",className:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",children:s.name})]}),(0,r.jsxs)(U.BT,{className:"text-xs",children:["Tool execution with ID: ",s.id]})]}),(0,r.jsxs)(U.Wu,{className:"space-y-2 py-0 px-4",children:[(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Input Parameters"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)(A.A,{style:S.A,language:"json",PreTag:"div",className:"text-xs",children:JSON.stringify(s.input,null,2)})})]}),e&&(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Tool Result"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:"string"==typeof e.content?(0,r.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.content}):e.content.map(e=>{if("image"===e.type)return(0,r.jsx)(C.default,{src:"data:".concat(e.source.media_type,";base64,").concat(e.source.data),alt:"Tool Result"},e.source.data);if("text"===e.type)return(0,r.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.text},e.text);throw Error("Unexpected tool result content type")})})})]})]})]})}return s.type,null},D=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Meta Information"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:s})})]})},F=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Summarized"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})},K=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"System Message"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})};var W=t(93021),q=t(28043),L=t(72676),O=t(5556);let H=RegExp("<(?<tag>[^>]+)>(?<content>\\s*[^<]*?\\s*)<\\/\\k<tag>>","g"),G=O.Ik({tag:O.Yj(),content:O.Yj()}),V=e=>{let{text:s,id:t}=e,a=(e=>{var s,t,r,a;let n=Array.from(e.matchAll(H)).map(e=>G.safeParse(e.groups)).filter(e=>e.success).map(e=>e.data);if(0===n.length)return{kind:"text",content:e};let i=null==(s=n.find(e=>"command-name"===e.tag))?void 0:s.content,l=null==(t=n.find(e=>"command-args"===e.tag))?void 0:t.content,d=null==(r=n.find(e=>"command-message"===e.tag))?void 0:r.content,o=null==(a=n.find(e=>"local-command-stdout"===e.tag))?void 0:a.content;switch(!0){case void 0!==i:return{kind:"command",commandName:i,commandArgs:l,commandMessage:d};case void 0!==o:return{kind:"local-command",stdout:o};default:return{kind:"text",content:e}}})(s);return"command"===a.kind?(0,r.jsxs)(U.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",id:t,children:[(0,r.jsx)(U.aR,{className:"py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(L.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Claude Code Command"}),(0,r.jsx)(P,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",children:a.commandName})]})}),a.commandArgs||a.commandMessage?(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsxs)("div",{children:[a.commandArgs&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Arguments:"}),(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,r.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandArgs})})]}),a.commandMessage&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Message:"}),(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,r.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandMessage})})]})]})})}):null]}):"local-command"===a.kind?(0,r.jsxs)(U.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,r.jsx)(U.aR,{className:"py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(L.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Local Command"})]})}),(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:a.stdout})})]}):(0,r.jsx)($,{className:"w-full px-3 py-3 mb-5 border border-border rounded-lg bg-slate-50",content:a.content})},Q=e=>{let{content:s,id:t}=e;return"string"==typeof s?(0,r.jsx)(V,{text:s,id:t}):"text"===s.type?(0,r.jsx)(V,{text:s.text,id:t}):"image"===s.type?"base64"===s.source.type?(0,r.jsxs)(U.Zp,{className:"border-purple-200 bg-purple-50/50 dark:border-purple-800 dark:bg-purple-950/20",id:t,children:[(0,r.jsxs)(U.aR,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(W.A,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Image"}),(0,r.jsx)(P,{variant:"outline",className:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",children:s.source.media_type})]}),(0,r.jsx)(U.BT,{className:"text-xs",children:"User uploaded image content"})]}),(0,r.jsx)(U.Wu,{children:(0,r.jsx)("div",{className:"rounded-lg border overflow-hidden bg-background",children:(0,r.jsx)(C.default,{src:"data:".concat(s.source.media_type,";base64,").concat(s.source.data),alt:"User uploaded content",className:"max-w-full h-auto max-h-96 object-contain"})})})]}):(0,r.jsx)(U.Zp,{className:"border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",id:t,children:(0,r.jsxs)(U.aR,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(q.A,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Unsupported Media"}),(0,r.jsx)(P,{variant:"destructive",children:"Error"})]}),(0,r.jsx)(U.BT,{className:"text-xs",children:"Media type not supported for display"})]})}):(s.type,null)},Y=e=>{let{conversation:s,getToolResult:t,isRootSidechain:a,getSidechainConversations:n}=e;if("summary"===s.type)return(0,r.jsx)(F,{children:s.summary});if("system"===s.type)return(0,r.jsx)(K,{children:s.content});if(s.isSidechain)return a(s)?(0,r.jsx)(N,{conversation:s,sidechainConversations:n(s.uuid).map(e=>"summary"===e.type?e:{...e,isSidechain:!1}),getToolResult:t}):null;if("user"===s.type){let e="string"==typeof s.message.content?(0,r.jsx)(Q,{content:s.message.content,id:"message-".concat(s.uuid)}):(0,r.jsx)("ul",{className:"w-full",id:"message-".concat(s.uuid),children:s.message.content.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(Q,{content:e})},e.toString()))});return!0===s.isMeta?(0,r.jsx)(D,{children:e}):e}return"assistant"===s.type?(0,r.jsx)("ul",{className:"w-full",children:s.message.content.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(B,{content:e,getToolResult:t})},e.toString()))}):null},J=e=>{if("user"===e.type)return"user_".concat(e.uuid);if("assistant"===e.type)return"assistant_".concat(e.uuid);if("system"===e.type)return"system_".concat(e.uuid);if("summary"===e.type)return"summary_".concat(e.leafUuid);throw Error("Unknown conversation type: ".concat(e))},X=e=>{let{conversations:s,getToolResult:t}=e,{isRootSidechain:a,getSidechainConversations:n}=(e=>{let s=(0,m.useMemo)(()=>new Map(e.filter(e=>"summary"!==e.type).map(e=>[e.uuid,e])),[e]),t=(0,m.useCallback)(e=>{if("summary"===e.type||null===e.parentUuid)return e;let r=s.get(e.parentUuid);return void 0===r?e:t(r)},[s]),r=(0,m.useMemo)(()=>{let s=e.filter(e=>"summary"!==e.type).filter(e=>!0===e.isSidechain),r=new Map;for(let e of s){let s=t(e);if("summary"!==s.type)if(r.has(s.uuid)){var a;null==(a=r.get(s.uuid))||a.push(e)}else r.set(s.uuid,[e])}return r},[e,t]);return{isRootSidechain:(0,m.useCallback)(e=>"summary"!==e.type&&r.has(e.uuid),[r]),getSidechainConversations:(0,m.useCallback)(e=>{var s;return null!=(s=r.get(e))?s:[]},[r])}})(s);return(0,r.jsx)("ul",{children:s.flatMap(e=>{let s=(0,r.jsx)(Y,{conversation:e,getToolResult:t,isRootSidechain:a,getSidechainConversations:n},J(e)),i="summary"!==e.type&&e.isSidechain;return[(0,r.jsx)("li",{className:"w-full flex ".concat(i||"assistant"===e.type||"system"===e.type||"summary"===e.type?"justify-start":"justify-end"),children:(0,r.jsx)("div",{className:"w-[85%]",children:s})},J(e))]})})};var ee=t(26057),es=t(70038),et=t(79588),er=t(31264),ea=t(19611);let en=e=>{let{projectId:s,sessionId:t,isPausedTask:n}=e,l=(0,et.useRouter)(),d=(0,m.useRef)(null),o=(0,a.useMutation)({mutationFn:async e=>{let r=await u.s.api.projects[":projectId"].sessions[":sessionId"].resume.$post({param:{projectId:s,sessionId:t},json:{resumeMessage:e.message}});if(!r.ok)throw Error(r.statusText);return r.json()},onSuccess:async e=>{h(""),t!==e.sessionId&&l.push("/projects/".concat(s,"/sessions/").concat(e.sessionId,"#message-").concat(e.userMessageId))}}),[c,h]=(0,m.useState)(""),p=(0,m.useRef)(null),g=(0,m.useId)(),b=()=>{c.trim()&&o.mutate({message:c.trim()})};return(0,r.jsxs)(U.Zp,{className:"border-t rounded-t-none border-x-0 bg-background/50 backdrop-blur-sm mt-10",children:[(0,r.jsxs)(U.aR,{className:"pb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(ee.A,{className:"w-5 h-5 text-primary"}),(0,r.jsx)(U.ZB,{className:"text-lg",children:"Continue Conversation"})]}),(0,r.jsx)(U.BT,{children:"Start a new conversation based on this session's context"})]}),(0,r.jsxs)(U.Wu,{className:"space-y-4",children:[o.error&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md",children:[(0,r.jsx)(q.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:"Failed to resume chat. Please try again."})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(er.T,{ref:d,value:c,onChange:e=>h(e.target.value),onKeyDown:e=>{var s;(null==(s=p.current)||!s.handleKeyDown(e))&&"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),b())},placeholder:"Type your message here... (Start with / for commands, Shift+Enter to send)",className:"min-h-[80px] resize-none",disabled:o.isPending,maxLength:4e3,"aria-label":"Message input with command completion","aria-describedby":g,"aria-expanded":c.startsWith("/"),"aria-haspopup":"listbox",role:"combobox","aria-autocomplete":"list"}),(0,r.jsx)(ea.s,{ref:p,projectId:s,inputValue:c,onCommandSelect:e=>{var s;h(e),null==(s=d.current)||s.focus()},className:"absolute top-full left-0 right-0"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",id:g,children:[c.length,"/4000 characters • Use arrow keys to navigate commands"]}),(0,r.jsx)(x.$,{onClick:b,disabled:!c.trim()||o.isPending,size:"lg",className:"gap-2",children:o.isPending?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),"Starting... This may take a while."]}):n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(es.A,{className:"w-4 h-4"}),"Send"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(es.A,{className:"w-4 h-4"}),"Resume"]})})]})]})]})]})};var ei=t(62520),el=t(9187),ed=t(54058),eo=t(12240),ec=t(89290),em=t(77633),ex=t(51290),eu=t(5685);let eh=e=>{let{sessions:s,currentSessionId:t,projectId:a}=e;return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Sessions"}),(0,r.jsx)(ex.c,{projectId:a,trigger:(0,r.jsxs)(x.$,{size:"sm",variant:"outline",className:"gap-1.5 mr-5",children:[(0,r.jsx)(ei.A,{className:"w-3.5 h-3.5"}),"New"]})})]}),(0,r.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[s.length," total"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:s.map(e=>{let s=e.id===t,n=null!==e.meta.firstCommand?(0,h.H)(e.meta.firstCommand):e.id;return(0,r.jsx)(c(),{href:"/projects/".concat(a,"/sessions/").concat(encodeURIComponent(e.id)),className:(0,I.cn)("block rounded-lg p-2.5 transition-all duration-200 hover:bg-blue-50/60 hover:border-blue-300/60 hover:shadow-sm border border-sidebar-border/40 bg-sidebar/30",s&&"bg-blue-100 border-blue-400 shadow-md ring-1 ring-blue-200/50 hover:bg-blue-100 hover:border-blue-400"),children:(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("h3",{className:"text-sm font-medium line-clamp-2 leading-tight text-sidebar-foreground",children:n}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 text-xs text-sidebar-foreground/70",children:[(0,r.jsx)(ee.A,{className:"w-3 h-3"}),(0,r.jsx)("span",{children:e.meta.messageCount})]}),e.meta.lastModifiedAt&&(0,r.jsx)("span",{className:"text-xs text-sidebar-foreground/60",children:new Date(e.meta.lastModifiedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})},e.id)})})]})},ep=e=>{let{projectId:s}=e,[t]=(0,g.fp)(b.r),n=(0,a.useMutation)({mutationFn:async e=>{let s=await u.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}});return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Tasks"}),(0,r.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[t.length," active task",1!==t.length?"s":""]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-2",children:0===t.length?(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center pt-8",children:(0,r.jsxs)("div",{className:"text-center text-sidebar-foreground/60",children:[(0,r.jsx)(el.A,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),(0,r.jsx)("p",{className:"text-sm",children:"No active tasks"})]})}):t.map(e=>(0,r.jsxs)("div",{className:"block rounded-lg p-3 border border-sidebar-border/40 bg-sidebar/30 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:["running"===e.status?(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),(0,r.jsx)(ed.A,{className:"w-3 h-3 text-green-600"})]}):(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),(0,r.jsx)(d.A,{className:"w-3 h-3 text-orange-600"})]}),(0,r.jsx)("span",{className:"text-xs font-medium text-sidebar-foreground",children:e.status.toUpperCase()})]}),(0,r.jsx)(x.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>n.mutate(e.sessionId),disabled:n.isPending,children:(0,r.jsx)(l.A,{className:"w-3 h-3"})})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Task ID:",(0,r.jsx)("button",{type:"button",onClick:()=>{var s;return s=e.id,void navigator.clipboard.writeText(s)},className:"ml-1 font-mono hover:text-sidebar-foreground transition-colors",title:"Click to copy",children:e.id.slice(-8)})]}),(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Session:",(0,r.jsx)(c(),{href:"/projects/".concat(s,"/sessions/").concat(encodeURIComponent(e.sessionId)),className:"ml-1 hover:text-blue-600 transition-colors font-mono",title:"Go to session",children:e.sessionId.slice(-8)})]}),e.userMessageId&&(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Message:",(0,r.jsx)("span",{className:"ml-1 font-mono",children:e.userMessageId.slice(-8)})]})]})]},e.id))})]})},eg=()=>{var e,s;let{config:t,updateConfig:a}=(0,ec.U)();return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Settings"}),(0,r.jsx)("p",{className:"text-xs text-sidebar-foreground/70",children:"Display and behavior preferences"})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"font-medium text-sm text-sidebar-foreground",children:"Session Display"}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-start space-x-3 cursor-pointer",children:[(0,r.jsx)(em.S,{checked:null==(e=null==t?void 0:t.hideNoUserMessageSession)||e,onCheckedChange:e=>{t&&a({...t,hideNoUserMessageSession:!!e})},className:"mt-0.5"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-sidebar-foreground",children:"Hide empty sessions"}),(0,r.jsx)("div",{className:"text-xs text-sidebar-foreground/70",children:"Don't show sessions without user messages"})]})]}),(0,r.jsxs)("div",{className:"flex items-start space-x-3 cursor-pointer",children:[(0,r.jsx)(em.S,{checked:null==(s=null==t?void 0:t.unifySameTitleSession)||s,onCheckedChange:e=>{t&&a({...t,unifySameTitleSession:!!e})},className:"mt-0.5"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-sidebar-foreground",children:"Unify same title sessions"}),(0,r.jsx)("div",{className:"text-xs text-sidebar-foreground/70",children:"Group sessions with identical titles together"})]})]})]})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"font-medium text-sm text-sidebar-foreground opacity-50",children:"Coming Soon"}),(0,r.jsxs)("div",{className:"space-y-2 opacity-50",children:[(0,r.jsx)("div",{className:"text-xs text-sidebar-foreground/70",children:"• Message display preferences"}),(0,r.jsx)("div",{className:"text-xs text-sidebar-foreground/70",children:"• Auto-scroll behavior"}),(0,r.jsx)("div",{className:"text-xs text-sidebar-foreground/70",children:"• Code syntax highlighting"}),(0,r.jsx)("div",{className:"text-xs text-sidebar-foreground/70",children:"• Export/import options"})]})]})]})]})},eb=e=>{let{sessions:s,currentSessionId:t,projectId:a}=e,[n,i]=(0,m.useState)("sessions");return(0,r.jsxs)("div",{className:"h-full flex bg-sidebar text-sidebar-foreground",children:[(0,r.jsx)("div",{className:"w-12 flex flex-col border-r border-sidebar-border bg-sidebar/50",children:(0,r.jsxs)("div",{className:"flex flex-col p-2 space-y-1",children:[(0,r.jsx)("button",{type:"button",onClick:()=>i("sessions"),className:(0,I.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","sessions"===n?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Sessions",children:(0,r.jsx)(ee.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>i("tasks"),className:(0,I.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","tasks"===n?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Tasks",children:(0,r.jsx)(el.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>i("settings"),className:(0,I.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","settings"===n?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Settings",children:(0,r.jsx)(k.A,{className:"w-4 h-4"})})]})}),(0,r.jsx)("div",{className:"flex-1 flex flex-col",children:(()=>{switch(n){case"sessions":return(0,r.jsx)(eh,{sessions:s,currentSessionId:t,projectId:a});case"tasks":return(0,r.jsx)(ep,{projectId:a});case"settings":return(0,r.jsx)(eg,{});default:return null}})()})]})},ef=e=>{let{currentSessionId:s,projectId:t,className:a}=e,{data:{sessions:n}}=(0,eu.B)(t),[i,l]=(0,m.useState)(!1);return(0,r.jsx)(_.Nt,{open:!i,onOpenChange:e=>l(!e),className:(0,I.cn)("hidden md:flex h-full",a),children:(0,r.jsx)("div",{className:"relative h-full",children:(0,r.jsxs)("div",{className:(0,I.cn)("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out",i?"w-12":"w-72 lg:w-80"),children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsx)(x.$,{variant:"ghost",size:"icon",className:"absolute -right-3 top-4 z-10 bg-background border border-sidebar-border shadow-sm",children:(0,r.jsx)(eo.A,{className:(0,I.cn)("w-4 h-4 transition-transform duration-200",i&&"rotate-180")})})}),(0,r.jsx)(_.Ke,{className:"h-full data-[state=closed]:animate-slide-out-to-left data-[state=open]:animate-slide-in-from-left",children:(0,r.jsx)(eb,{sessions:n,currentSessionId:s,projectId:t})}),i&&(0,r.jsx)("div",{className:"h-full bg-sidebar border-r border-sidebar-border flex flex-col items-center pt-16",children:(0,r.jsx)(ee.A,{className:"w-5 h-5 text-sidebar-foreground/70"})})]})})})},ej=e=>{let{projectId:s,sessionId:t}=e,{session:o,conversations:j,getToolResult:v}=((e,s)=>{let t=(0,f.useSuspenseQuery)({...((e,s)=>({queryKey:["sessions",s],queryFn:async()=>(await u.s.api.projects[":projectId"].sessions[":sessionId"].$get({param:{projectId:e,sessionId:s}})).json()}))(e,s)}),r=(0,m.useMemo)(()=>new Map(t.data.session.conversations.flatMap(e=>"user"!==e.type||"string"==typeof e.message.content?[]:e.message.content.flatMap(e=>"string"==typeof e||"tool_result"!==e.type?[]:[[e.tool_use_id,e]]))),[t.data.session.conversations]),a=(0,m.useCallback)(e=>r.get(e),[r]);return{session:t.data.session,conversations:t.data.session.conversations,getToolResult:a}})(s,t),N=(0,a.useMutation)({mutationFn:async e=>{let s=await u.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),{isRunningTask:y,isPausedTask:w}=(e=>{let[s,t]=(0,g.fp)(b.r);return(0,p.useQuery)({queryKey:["aliveTasks"],queryFn:async()=>{let e=await u.s.api.tasks.alive.$get({});if(!e.ok)throw Error(e.statusText);return t((await e.json()).aliveTasks),e.json()},refetchOnReconnect:!0}),(0,m.useMemo)(()=>{let t=s.find(s=>s.sessionId===e);return{aliveTask:s.find(s=>s.sessionId===e),isRunningTask:(null==t?void 0:t.status)==="running",isPausedTask:(null==t?void 0:t.status)==="paused"}},[s,e])})(t),[k,C]=(0,m.useState)(0),A=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if(y&&j.length!==k){C(j.length);let e=A.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},[j,y,k]),(0,r.jsxs)("div",{className:"flex h-screen",children:[(0,r.jsx)(ef,{currentSessionId:t,projectId:s}),(0,r.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(0,r.jsxs)("div",{ref:A,className:"max-w-none flex-1 overflow-y-auto",children:[(0,r.jsxs)("header",{className:"px-3 py-3 sticky top-0 z-10 bg-background w-full",children:[(0,r.jsx)(x.$,{asChild:!0,variant:"ghost",children:(0,r.jsxs)(c(),{href:"/projects/".concat(s),className:"flex items-center gap-2",children:[(0,r.jsx)(n.A,{className:"w-4 h-4"}),"Back to Session List"]})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("div",{className:"flex items-center gap-3",children:(0,r.jsx)("h1",{className:"text-3xl font-bold break-all overflow-ellipsis line-clamp-2 px-5",children:null!==o.meta.firstCommand?(0,h.H)(o.meta.firstCommand):t})}),y&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,r.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium",children:"Conversation is in progress..."})}),(0,r.jsxs)(x.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(t)},children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),"Abort"]})]}),w&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,r.jsx)(d.A,{className:"w-4 h-4"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium",children:"Conversation is paused..."})}),(0,r.jsxs)(x.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(t)},children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),"Abort"]})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["Session ID: ",t]})]})]}),(0,r.jsxs)("main",{className:"w-full px-20 pb-20 relative z-5",children:[(0,r.jsx)(X,{conversations:j,getToolResult:v}),(0,r.jsx)(en,{projectId:s,sessionId:t,isPausedTask:w})]})]})})]})}},82791:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,63758))},89854:(e,s,t)=>{"use strict";t.d(s,{r:()=>r});let r=(0,t(48304).eU)([])}},e=>{e.O(0,[33,150,311,608,559,884,900,341,358],()=>e(e.s=82791)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{63758:(e,s,r)=>{"use strict";r.d(s,{SessionPageContent:()=>em});var t=r(89835),a=r(59054),n=r(50417),l=r(58903),i=r(93856),d=r(38514),o=r(75123),c=r.n(o),m=r(55931),u=r(80942),x=r(53630),h=r(72667),p=r(45320),g=r(41633),b=r(40138);let j=e=>{let{conversation:s,sidechainConversations:r,getToolResult:a}=e,n=(e=>{let s=e.at(0),r="".concat(e.length," conversations (").concat((null==s?void 0:s.type)!=="summary"?null==s?void 0:s.uuid:"",")");if(!s||"user"!==s.type)return r;let t="string"==typeof s.message.content?s.message.content:(()=>{let e=s.message.content.at(0);return void 0===e?null:"string"==typeof e?e:"text"===e.type?e.text:null})();return null!=t?t:r})(r),l="summary"!==s.type?s.uuid:s.leafUuid;return(0,t.jsxs)(b.lG,{children:[(0,t.jsx)(b.zM,{asChild:!0,children:(0,t.jsx)(u.$,{variant:"outline",size:"sm",className:"w-full mb-3 items-center justify-start",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,t.jsx)(g.A,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"overflow-hidden text-ellipsis",children:["View Task: ",n]})]})})}),(0,t.jsxs)(b.Cf,{className:"!w-[1200px] !max-w-none max-h-[80vh] overflow-hidden flex flex-col",children:[(0,t.jsxs)(b.c7,{children:[(0,t.jsx)(b.L3,{children:n.length>100?"".concat(n.slice(0,100),"..."):n}),(0,t.jsxs)(b.rr,{children:["Root UUID: ",l]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(Y,{conversations:r,getToolResult:a})})]})]})};var f=r(55407),v=r(5530),N=r(9005),y=r(68607),w=r(36703),k=r(83632),A=r(8607),C=r(7951),R=r(18237);let S=(0,C.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function T(e){let{className:s,variant:r,asChild:a=!1,...n}=e,l=a?A.DX:"span";return(0,t.jsx)(l,{"data-slot":"badge",className:(0,R.cn)(S({variant:r}),s),...n})}var M=r(75284),P=r(45730),I=r(35853),_=r(35880),U=r(96318);let z=e=>{let{content:s,className:r=""}=e;return(0,t.jsx)("div",{className:"prose prose-neutral dark:prose-invert max-w-none ".concat(r),children:(0,t.jsx)(I.oz,{remarkPlugins:[U.A],components:{h1(e){let{children:s,...r}=e;return(0,t.jsx)("h1",{className:"text-3xl font-bold mb-6 mt-8 pb-3 border-b border-border text-foreground",...r,children:s})},h2(e){let{children:s,...r}=e;return(0,t.jsx)("h2",{className:"text-2xl font-semibold mb-4 mt-8 pb-2 border-b border-border/50 text-foreground",...r,children:s})},h3(e){let{children:s,...r}=e;return(0,t.jsx)("h3",{className:"text-xl font-semibold mb-3 mt-6 text-foreground",...r,children:s})},h4(e){let{children:s,...r}=e;return(0,t.jsx)("h4",{className:"text-lg font-medium mb-2 mt-4 text-foreground",...r,children:s})},h5(e){let{children:s,...r}=e;return(0,t.jsx)("h5",{className:"text-base font-medium mb-2 mt-4 text-foreground",...r,children:s})},h6(e){let{children:s,...r}=e;return(0,t.jsx)("h6",{className:"text-sm font-medium mb-2 mt-4 text-muted-foreground",...r,children:s})},p(e){let{children:s,...r}=e;return(0,t.jsx)("p",{className:"mb-4 leading-7 text-foreground",...r,children:s})},ul(e){let{children:s,...r}=e;return(0,t.jsx)("ul",{className:"mb-4 ml-6 list-disc space-y-2",...r,children:s})},ol(e){let{children:s,...r}=e;return(0,t.jsx)("ol",{className:"mb-4 ml-6 list-decimal space-y-2",...r,children:s})},li(e){let{children:s,...r}=e;return(0,t.jsx)("li",{className:"leading-7 text-foreground",...r,children:s})},code(e){let{className:s,children:r,...a}=e,n=/language-(\w+)/.exec(s||"");return n?(0,t.jsxs)("div",{className:"relative my-6",children:[(0,t.jsx)("div",{className:"flex items-center justify-between bg-muted/30 px-4 py-2 border-b border-border rounded-t-lg",children:(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:n[1]})}),(0,t.jsx)(w.A,{style:_.A,language:n[1],PreTag:"div",className:"!mt-0 !rounded-t-none !rounded-b-lg !border-t-0 !border !border-border",customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:String(r).replace(/\n$/,"")})]}):(0,t.jsx)("code",{className:"bg-muted/70 px-2 py-1 rounded-md text-sm font-mono text-foreground border",...a,children:r})},pre(e){let{children:s,...r}=e;return(0,t.jsx)("pre",{...r,children:s})},blockquote(e){let{children:s,...r}=e;return(0,t.jsx)("blockquote",{className:"border-l-4 border-primary/30 bg-muted/30 pl-6 pr-4 py-4 my-6 italic rounded-r-lg",...r,children:(0,t.jsx)("div",{className:"text-muted-foreground",children:s})})},a(e){let{children:s,href:r,...a}=e;return(0,t.jsx)("a",{href:r,className:"text-primary hover:text-primary/80 underline underline-offset-4 decoration-primary/30 hover:decoration-primary/60 transition-colors",...a,children:s})},table(e){let{children:s,...r}=e;return(0,t.jsx)("div",{className:"overflow-x-auto my-6 rounded-lg border border-border",children:(0,t.jsx)("table",{className:"min-w-full border-collapse",...r,children:s})})},thead(e){let{children:s,...r}=e;return(0,t.jsx)("thead",{className:"bg-muted/50",...r,children:s})},th(e){let{children:s,...r}=e;return(0,t.jsx)("th",{className:"border-b border-border px-4 py-3 text-left font-semibold text-foreground",...r,children:s})},td(e){let{children:s,...r}=e;return(0,t.jsx)("td",{className:"border-b border-border px-4 py-3 text-foreground",...r,children:s})},hr(e){let{...s}=e;return(0,t.jsx)("hr",{className:"my-8 border-t border-border",...s})},strong(e){let{children:s,...r}=e;return(0,t.jsx)("strong",{className:"font-semibold text-foreground",...r,children:s})},em(e){let{children:s,...r}=e;return(0,t.jsx)("em",{className:"italic text-foreground",...r,children:s})}},children:s})})},K=e=>{let{content:s,getToolResult:r}=e;if("text"===s.type)return(0,t.jsx)("div",{className:"w-full mx-2 my-6",children:(0,t.jsx)(z,{content:s.text})});if("thinking"===s.type)return(0,t.jsx)(M.Zp,{className:"bg-muted/50 border-dashed gap-2 py-3 mb-2",children:(0,t.jsxs)(P.Nt,{children:[(0,t.jsx)(P.R6,{asChild:!0,children:(0,t.jsx)(M.aR,{className:"cursor-pointer hover:bg-muted/80 rounded-t-lg transition-colors py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(f.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(M.ZB,{className:"text-sm font-medium",children:"Thinking"}),(0,t.jsx)(v.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,t.jsx)(P.Ke,{children:(0,t.jsx)(M.Wu,{className:"py-0 px-4",children:(0,t.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap font-mono",children:s.thinking})})})]})});if("tool_use"===s.type){let e=r(s.id);return(0,t.jsxs)(M.Zp,{className:"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20 gap-2 py-3 mb-2",children:[(0,t.jsxs)(M.aR,{className:"py-0 px-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(N.A,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),(0,t.jsx)(M.ZB,{className:"text-sm font-medium",children:"Tool Use"}),(0,t.jsx)(T,{variant:"outline",className:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",children:s.name})]}),(0,t.jsxs)(M.BT,{className:"text-xs",children:["Tool execution with ID: ",s.id]})]}),(0,t.jsxs)(M.Wu,{className:"space-y-2 py-0 px-4",children:[(0,t.jsxs)(P.Nt,{children:[(0,t.jsx)(P.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Input Parameters"}),(0,t.jsx)(v.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(P.Ke,{children:(0,t.jsx)(w.A,{style:k.A,language:"json",PreTag:"div",className:"text-xs",children:JSON.stringify(s.input,null,2)})})]}),e&&(0,t.jsxs)(P.Nt,{children:[(0,t.jsx)(P.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Tool Result"}),(0,t.jsx)(v.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(P.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:"string"==typeof e.content?(0,t.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.content}):e.content.map(e=>{if("image"===e.type)return(0,t.jsx)(y.default,{src:"data:".concat(e.source.media_type,";base64,").concat(e.source.data),alt:"Tool Result"},e.source.data);if("text"===e.type)return(0,t.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.text},e.text);throw Error("Unexpected tool result content type")})})})]})]})]})}return s.type,null},Z=e=>{let{children:s}=e;return(0,t.jsxs)(P.Nt,{children:[(0,t.jsx)(P.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Meta Information"}),(0,t.jsx)(v.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(P.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:s})})]})},B=e=>{let{children:s}=e;return(0,t.jsxs)(P.Nt,{children:[(0,t.jsx)(P.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Summarized"}),(0,t.jsx)(v.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(P.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})},E=e=>{let{children:s}=e;return(0,t.jsxs)(P.Nt,{children:[(0,t.jsx)(P.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"System Message"}),(0,t.jsx)(v.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(P.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})};var $=r(93021),F=r(28043),D=r(72676),q=r(5556);let W=RegExp("<(?<tag>[^>]+)>(?<content>\\s*[^<]*?\\s*)<\\/\\k<tag>>","g"),L=q.Ik({tag:q.Yj(),content:q.Yj()}),O=e=>{let{text:s,id:r}=e,a=(e=>{var s,r,t,a;let n=Array.from(e.matchAll(W)).map(e=>L.safeParse(e.groups)).filter(e=>e.success).map(e=>e.data);if(0===n.length)return{kind:"text",content:e};let l=null==(s=n.find(e=>"command-name"===e.tag))?void 0:s.content,i=null==(r=n.find(e=>"command-args"===e.tag))?void 0:r.content,d=null==(t=n.find(e=>"command-message"===e.tag))?void 0:t.content,o=null==(a=n.find(e=>"local-command-stdout"===e.tag))?void 0:a.content;switch(!0){case void 0!==l:return{kind:"command",commandName:l,commandArgs:i,commandMessage:d};case void 0!==o:return{kind:"local-command",stdout:o};default:return{kind:"text",content:e}}})(s);return"command"===a.kind?(0,t.jsxs)(M.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",id:r,children:[(0,t.jsx)(M.aR,{className:"py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,t.jsx)(M.ZB,{className:"text-sm font-medium",children:"Claude Code Command"}),(0,t.jsx)(T,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",children:a.commandName})]})}),a.commandArgs||a.commandMessage?(0,t.jsx)(M.Wu,{className:"py-0 px-4",children:(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{children:[a.commandArgs&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Arguments:"}),(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandArgs})})]}),a.commandMessage&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Message:"}),(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandMessage})})]})]})})}):null]}):"local-command"===a.kind?(0,t.jsxs)(M.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,t.jsx)(M.aR,{className:"py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,t.jsx)(M.ZB,{className:"text-sm font-medium",children:"Local Command"})]})}),(0,t.jsx)(M.Wu,{className:"py-0 px-4",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:a.stdout})})]}):(0,t.jsx)(z,{className:"w-full px-3 py-3 mb-5 border border-border rounded-lg bg-slate-50",content:a.content})},Q=e=>{let{content:s,id:r}=e;return"string"==typeof s?(0,t.jsx)(O,{text:s,id:r}):"text"===s.type?(0,t.jsx)(O,{text:s.text,id:r}):"image"===s.type?"base64"===s.source.type?(0,t.jsxs)(M.Zp,{className:"border-purple-200 bg-purple-50/50 dark:border-purple-800 dark:bg-purple-950/20",id:r,children:[(0,t.jsxs)(M.aR,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)($.A,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),(0,t.jsx)(M.ZB,{className:"text-sm font-medium",children:"Image"}),(0,t.jsx)(T,{variant:"outline",className:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",children:s.source.media_type})]}),(0,t.jsx)(M.BT,{className:"text-xs",children:"User uploaded image content"})]}),(0,t.jsx)(M.Wu,{children:(0,t.jsx)("div",{className:"rounded-lg border overflow-hidden bg-background",children:(0,t.jsx)(y.default,{src:"data:".concat(s.source.media_type,";base64,").concat(s.source.data),alt:"User uploaded content",className:"max-w-full h-auto max-h-96 object-contain"})})})]}):(0,t.jsx)(M.Zp,{className:"border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",id:r,children:(0,t.jsxs)(M.aR,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(F.A,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,t.jsx)(M.ZB,{className:"text-sm font-medium",children:"Unsupported Media"}),(0,t.jsx)(T,{variant:"destructive",children:"Error"})]}),(0,t.jsx)(M.BT,{className:"text-xs",children:"Media type not supported for display"})]})}):(s.type,null)},H=e=>{let{conversation:s,getToolResult:r,isRootSidechain:a,getSidechainConversations:n}=e;if("summary"===s.type)return(0,t.jsx)(B,{children:s.summary});if("system"===s.type)return(0,t.jsx)(E,{children:s.content});if(s.isSidechain)return a(s)?(0,t.jsx)(j,{conversation:s,sidechainConversations:n(s.uuid).map(e=>"summary"===e.type?e:{...e,isSidechain:!1}),getToolResult:r}):null;if("user"===s.type){let e="string"==typeof s.message.content?(0,t.jsx)(Q,{content:s.message.content,id:"message-".concat(s.uuid)}):(0,t.jsx)("ul",{className:"w-full",id:"message-".concat(s.uuid),children:s.message.content.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(Q,{content:e})},e.toString()))});return!0===s.isMeta?(0,t.jsx)(Z,{children:e}):e}return"assistant"===s.type?(0,t.jsx)("ul",{className:"w-full",children:s.message.content.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(K,{content:e,getToolResult:r})},e.toString()))}):null},V=e=>{if("user"===e.type)return"user_".concat(e.uuid);if("assistant"===e.type)return"assistant_".concat(e.uuid);if("system"===e.type)return"system_".concat(e.uuid);if("summary"===e.type)return"summary_".concat(e.leafUuid);throw Error("Unknown conversation type: ".concat(e))},Y=e=>{let{conversations:s,getToolResult:r}=e,{isRootSidechain:a,getSidechainConversations:n}=(e=>{let s=(0,m.useMemo)(()=>new Map(e.filter(e=>"summary"!==e.type).map(e=>[e.uuid,e])),[e]),r=(0,m.useCallback)(e=>{if("summary"===e.type||null===e.parentUuid)return e;let t=s.get(e.parentUuid);return void 0===t?e:r(t)},[s]),t=(0,m.useMemo)(()=>{let s=e.filter(e=>"summary"!==e.type).filter(e=>!0===e.isSidechain),t=new Map;for(let e of s){let s=r(e);if("summary"!==s.type)if(t.has(s.uuid)){var a;null==(a=t.get(s.uuid))||a.push(e)}else t.set(s.uuid,[e])}return t},[e,r]);return{isRootSidechain:(0,m.useCallback)(e=>"summary"!==e.type&&t.has(e.uuid),[t]),getSidechainConversations:(0,m.useCallback)(e=>{var s;return null!=(s=t.get(e))?s:[]},[t])}})(s);return(0,t.jsx)("ul",{children:s.flatMap(e=>{let s=(0,t.jsx)(H,{conversation:e,getToolResult:r,isRootSidechain:a,getSidechainConversations:n},V(e)),l="summary"!==e.type&&e.isSidechain;return[(0,t.jsx)("li",{className:"w-full flex ".concat(l||"assistant"===e.type||"system"===e.type||"summary"===e.type?"justify-start":"justify-end"),children:(0,t.jsx)("div",{className:"w-[85%]",children:s})},V(e))]})})};var G=r(13881),J=r(26057),X=r(70038),ee=r(79588),es=r(31264),er=r(19611);let et=e=>{let{projectId:s,sessionId:r,isPausedTask:n}=e,i=(0,ee.useRouter)(),d=(0,m.useRef)(null),o=(0,G.useQueryClient)(),c=(0,a.useMutation)({mutationFn:async e=>{let t=await x.s.api.projects[":projectId"].sessions[":sessionId"].resume.$post({param:{projectId:s,sessionId:r},json:{resumeMessage:e.message}});if(!t.ok)throw Error(t.statusText);return await o.invalidateQueries({queryKey:["aliveTasks"]}),t.json()},onSuccess:async e=>{p(""),await o.invalidateQueries({queryKey:["aliveTasks"]}),r!==e.sessionId&&i.push("/projects/".concat(s,"/sessions/").concat(e.sessionId,"#message-").concat(e.userMessageId))}}),[h,p]=(0,m.useState)(""),g=(0,m.useRef)(null),b=(0,m.useId)(),j=()=>{h.trim()&&c.mutate({message:h.trim()})};return(0,t.jsxs)(M.Zp,{className:"border-t rounded-t-none border-x-0 bg-background/50 backdrop-blur-sm mt-10",children:[(0,t.jsxs)(M.aR,{className:"pb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(J.A,{className:"w-5 h-5 text-primary"}),(0,t.jsx)(M.ZB,{className:"text-lg",children:"Continue Conversation"})]}),(0,t.jsx)(M.BT,{children:"Start a new conversation based on this session's context"})]}),(0,t.jsxs)(M.Wu,{className:"space-y-4",children:[c.error&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md",children:[(0,t.jsx)(F.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Failed to resume chat. Please try again."})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(es.T,{ref:d,value:h,onChange:e=>p(e.target.value),onKeyDown:e=>{var s;(null==(s=g.current)||!s.handleKeyDown(e))&&"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),j())},placeholder:"Type your message here... (Start with / for commands, Shift+Enter to send)",className:"min-h-[80px] resize-none",disabled:c.isPending,maxLength:4e3,"aria-label":"Message input with command completion","aria-describedby":b,"aria-expanded":h.startsWith("/"),"aria-haspopup":"listbox",role:"combobox","aria-autocomplete":"list"}),(0,t.jsx)(er.s,{ref:g,projectId:s,inputValue:h,onCommandSelect:e=>{var s;p(e),null==(s=d.current)||s.focus()},className:"absolute top-full left-0 right-0"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",id:b,children:[h.length,"/4000 characters • Use arrow keys to navigate commands"]}),(0,t.jsx)(u.$,{onClick:j,disabled:!h.trim()||c.isPending,size:"lg",className:"gap-2",children:c.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.A,{className:"w-4 h-4 animate-spin"}),"Starting... This may take a while."]}):n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X.A,{className:"w-4 h-4"}),"Send"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X.A,{className:"w-4 h-4"}),"Resume"]})})]})]})]})]})};var ea=r(62520),en=r(12240),el=r(51290),ei=r(5685);let ed=e=>{let{sessions:s,currentSessionId:r,projectId:a}=e;return(0,t.jsxs)("div",{className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",children:[(0,t.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"font-semibold text-lg",children:"Sessions"}),(0,t.jsx)(el.c,{projectId:a,trigger:(0,t.jsxs)(u.$,{size:"sm",variant:"outline",className:"gap-1.5 mr-5",children:[(0,t.jsx)(ea.A,{className:"w-3.5 h-3.5"}),"New"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[s.length," total"]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:s.map(e=>{let s=e.id===r,n=null!==e.meta.firstCommand?(0,h.H)(e.meta.firstCommand):e.id;return(0,t.jsx)(c(),{href:"/projects/".concat(a,"/sessions/").concat(encodeURIComponent(e.id)),className:(0,R.cn)("block rounded-lg p-2.5 transition-all duration-200 hover:bg-blue-50/60 hover:border-blue-300/60 hover:shadow-sm border border-sidebar-border/40 bg-sidebar/30",s&&"bg-blue-100 border-blue-400 shadow-md ring-1 ring-blue-200/50 hover:bg-blue-100 hover:border-blue-400"),children:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h3",{className:"text-sm font-medium line-clamp-2 leading-tight text-sidebar-foreground",children:n}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-sidebar-foreground/70",children:[(0,t.jsx)(J.A,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.meta.messageCount})]}),e.meta.lastModifiedAt&&(0,t.jsx)("span",{className:"text-xs text-sidebar-foreground/60",children:new Date(e.meta.lastModifiedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})},e.id)})})]})},eo=e=>{let{currentSessionId:s,projectId:r,className:a}=e,{data:{sessions:n}}=(0,ei.B)(r),[l,i]=(0,m.useState)(!1);return(0,t.jsx)(P.Nt,{open:!l,onOpenChange:e=>i(!e),className:(0,R.cn)("hidden md:flex h-full",a),children:(0,t.jsx)("div",{className:"relative h-full",children:(0,t.jsxs)("div",{className:(0,R.cn)("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out",l?"w-12":"w-72 lg:w-80"),children:[(0,t.jsx)(P.R6,{asChild:!0,children:(0,t.jsx)(u.$,{variant:"ghost",size:"icon",className:"absolute -right-3 top-4 z-10 bg-background border border-sidebar-border shadow-sm",children:(0,t.jsx)(en.A,{className:(0,R.cn)("w-4 h-4 transition-transform duration-200",l&&"rotate-180")})})}),(0,t.jsx)(P.Ke,{className:"h-full data-[state=closed]:animate-slide-out-to-left data-[state=open]:animate-slide-in-from-left",children:(0,t.jsx)(ed,{sessions:n,currentSessionId:s,projectId:r})}),l&&(0,t.jsx)("div",{className:"h-full bg-sidebar border-r border-sidebar-border flex flex-col items-center pt-16",children:(0,t.jsx)(J.A,{className:"w-5 h-5 text-sidebar-foreground/70"})})]})})})};var ec=r(63812);let em=e=>{let{projectId:s,sessionId:r}=e,{session:o,conversations:g,getToolResult:b}=((e,s)=>{let r=(0,p.useSuspenseQuery)({...((e,s)=>({queryKey:["sessions",s],queryFn:async()=>(await x.s.api.projects[":projectId"].sessions[":sessionId"].$get({param:{projectId:e,sessionId:s}})).json()}))(e,s)}),t=(0,m.useMemo)(()=>new Map(r.data.session.conversations.flatMap(e=>"user"!==e.type||"string"==typeof e.message.content?[]:e.message.content.flatMap(e=>"string"==typeof e||"tool_result"!==e.type?[]:[[e.tool_use_id,e]]))),[r.data.session.conversations]),a=(0,m.useCallback)(e=>t.get(e),[t]);return{session:r.data.session,conversations:r.data.session.conversations,getToolResult:a}})(s,r),j=(0,a.useMutation)({mutationFn:async e=>{let s=await x.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),{isRunningTask:f,isPausedTask:v}=(e=>{let{data:s}=(0,ec.useQuery)({queryKey:["aliveTasks"],queryFn:async()=>{let e=await x.s.api.tasks.alive.$get({});if(!e.ok)throw Error(e.statusText);return e.json()},refetchOnReconnect:!0});return(0,m.useMemo)(()=>{let r=null==s?void 0:s.aliveTasks.find(s=>s.sessionId===e);return{aliveTask:r,isRunningTask:(null==r?void 0:r.status)==="running",isPausedTask:(null==r?void 0:r.status)==="paused"}},[s,e])})(r),[N,y]=(0,m.useState)(0),w=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if(f&&g.length!==N){y(g.length);let e=w.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},[g,f,N]),(0,t.jsxs)("div",{className:"flex h-screen",children:[(0,t.jsx)(eo,{currentSessionId:r,projectId:s}),(0,t.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(0,t.jsxs)("div",{ref:w,className:"max-w-none flex-1 overflow-y-auto",children:[(0,t.jsxs)("header",{className:"px-3 py-3 sticky top-0 z-10 bg-background w-full",children:[(0,t.jsx)(u.$,{asChild:!0,variant:"ghost",children:(0,t.jsxs)(c(),{href:"/projects/".concat(s),className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Back to Session List"]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsx)("h1",{className:"text-3xl font-bold break-all overflow-ellipsis line-clamp-2 px-5",children:null!==o.meta.firstCommand?(0,h.H)(o.meta.firstCommand):r})}),f&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,t.jsx)(l.A,{className:"w-4 h-4 animate-spin"}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)("p",{className:"text-sm font-medium",children:"Conversation is in progress..."})}),(0,t.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{j.mutate(r)},children:[(0,t.jsx)(i.A,{className:"w-4 h-4"}),"Abort"]})]}),v&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,t.jsx)(d.A,{className:"w-4 h-4"}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)("p",{className:"text-sm font-medium",children:"Conversation is paused..."})}),(0,t.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{j.mutate(r)},children:[(0,t.jsx)(i.A,{className:"w-4 h-4"}),"Abort"]})]}),(0,t.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["Session ID: ",r]})]})]}),(0,t.jsxs)("main",{className:"w-full px-20 pb-20 relative z-5",children:[(0,t.jsx)(Y,{conversations:g,getToolResult:b}),(0,t.jsx)(et,{projectId:s,sessionId:r,isPausedTask:v})]})]})})]})}},82791:(e,s,r)=>{Promise.resolve().then(r.bind(r,98613)),Promise.resolve().then(r.bind(r,72611)),Promise.resolve().then(r.bind(r,13881)),Promise.resolve().then(r.bind(r,85452)),Promise.resolve().then(r.bind(r,120)),Promise.resolve().then(r.bind(r,27740)),Promise.resolve().then(r.bind(r,59054)),Promise.resolve().then(r.bind(r,8120)),Promise.resolve().then(r.bind(r,9161)),Promise.resolve().then(r.bind(r,63812)),Promise.resolve().then(r.bind(r,86260)),Promise.resolve().then(r.bind(r,15312)),Promise.resolve().then(r.bind(r,45320)),Promise.resolve().then(r.bind(r,63758))}},e=>{e.O(0,[33,150,583,984,409,900,341,358],()=>e(e.s=82791)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{56812:(e,s,r)=>{"use strict";r.d(s,{SessionPageContent:()=>ed});var t=r(89835),a=r(50417),n=r(58903),l=r(75123),d=r.n(l),i=r(55931),o=r(80942),c=r(72667),m=r(63812),u=r(53630),x=r(45320),h=r(41633),p=r(40138);let g=e=>{let{conversation:s,sidechainConversations:r,getToolResult:a}=e,n=(e=>{let s=e.at(0),r="".concat(e.length," conversations (").concat((null==s?void 0:s.type)!=="summary"?null==s?void 0:s.uuid:"",")");if(!s||"user"!==s.type)return r;let t="string"==typeof s.message.content?s.message.content:(()=>{let e=s.message.content.at(0);return void 0===e?null:"string"==typeof e?e:"text"===e.type?e.text:null})();return null!=t?t:r})(r),l="summary"!==s.type?s.uuid:s.leafUuid;return(0,t.jsxs)(p.lG,{children:[(0,t.jsx)(p.zM,{asChild:!0,children:(0,t.jsx)(o.$,{variant:"outline",size:"sm",className:"w-full mb-3 items-center justify-start",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,t.jsx)(h.A,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"overflow-hidden text-ellipsis",children:["View Task: ",n]})]})})}),(0,t.jsxs)(p.Cf,{className:"!w-[1200px] !max-w-none max-h-[80vh] overflow-hidden flex flex-col",children:[(0,t.jsxs)(p.c7,{children:[(0,t.jsx)(p.L3,{children:n.length>100?"".concat(n.slice(0,100),"..."):n}),(0,t.jsxs)(p.rr,{children:["Root UUID: ",l]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(H,{conversations:r,getToolResult:a})})]})]})};var b=r(55407),f=r(5530),j=r(9005),v=r(68607),N=r(8607),y=r(7951),w=r(18237);let k=(0,y.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function C(e){let{className:s,variant:r,asChild:a=!1,...n}=e,l=a?N.DX:"span";return(0,t.jsx)(l,{"data-slot":"badge",className:(0,w.cn)(k({variant:r}),s),...n})}var R=r(75284),S=r(45730),A=r(35853),T=r(36703),M=r(35880),I=r(96318);let P=e=>{let{content:s,className:r=""}=e;return(0,t.jsx)("div",{className:"prose prose-neutral dark:prose-invert max-w-none ".concat(r),children:(0,t.jsx)(A.oz,{remarkPlugins:[I.A],components:{h1(e){let{children:s,...r}=e;return(0,t.jsx)("h1",{className:"text-3xl font-bold mb-6 mt-8 pb-3 border-b border-border text-foreground",...r,children:s})},h2(e){let{children:s,...r}=e;return(0,t.jsx)("h2",{className:"text-2xl font-semibold mb-4 mt-8 pb-2 border-b border-border/50 text-foreground",...r,children:s})},h3(e){let{children:s,...r}=e;return(0,t.jsx)("h3",{className:"text-xl font-semibold mb-3 mt-6 text-foreground",...r,children:s})},h4(e){let{children:s,...r}=e;return(0,t.jsx)("h4",{className:"text-lg font-medium mb-2 mt-4 text-foreground",...r,children:s})},h5(e){let{children:s,...r}=e;return(0,t.jsx)("h5",{className:"text-base font-medium mb-2 mt-4 text-foreground",...r,children:s})},h6(e){let{children:s,...r}=e;return(0,t.jsx)("h6",{className:"text-sm font-medium mb-2 mt-4 text-muted-foreground",...r,children:s})},p(e){let{children:s,...r}=e;return(0,t.jsx)("p",{className:"mb-4 leading-7 text-foreground",...r,children:s})},ul(e){let{children:s,...r}=e;return(0,t.jsx)("ul",{className:"mb-4 ml-6 list-disc space-y-2",...r,children:s})},ol(e){let{children:s,...r}=e;return(0,t.jsx)("ol",{className:"mb-4 ml-6 list-decimal space-y-2",...r,children:s})},li(e){let{children:s,...r}=e;return(0,t.jsx)("li",{className:"leading-7 text-foreground",...r,children:s})},code(e){let{className:s,children:r,...a}=e,n=/language-(\w+)/.exec(s||"");return n?(0,t.jsxs)("div",{className:"relative my-6",children:[(0,t.jsx)("div",{className:"flex items-center justify-between bg-muted/30 px-4 py-2 border-b border-border rounded-t-lg",children:(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:n[1]})}),(0,t.jsx)(T.A,{style:M.A,language:n[1],PreTag:"div",className:"!mt-0 !rounded-t-none !rounded-b-lg !border-t-0 !border !border-border",customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:String(r).replace(/\n$/,"")})]}):(0,t.jsx)("code",{className:"bg-muted/70 px-2 py-1 rounded-md text-sm font-mono text-foreground border",...a,children:r})},pre(e){let{children:s,...r}=e;return(0,t.jsx)("pre",{...r,children:s})},blockquote(e){let{children:s,...r}=e;return(0,t.jsx)("blockquote",{className:"border-l-4 border-primary/30 bg-muted/30 pl-6 pr-4 py-4 my-6 italic rounded-r-lg",...r,children:(0,t.jsx)("div",{className:"text-muted-foreground",children:s})})},a(e){let{children:s,href:r,...a}=e;return(0,t.jsx)("a",{href:r,className:"text-primary hover:text-primary/80 underline underline-offset-4 decoration-primary/30 hover:decoration-primary/60 transition-colors",...a,children:s})},table(e){let{children:s,...r}=e;return(0,t.jsx)("div",{className:"overflow-x-auto my-6 rounded-lg border border-border",children:(0,t.jsx)("table",{className:"min-w-full border-collapse",...r,children:s})})},thead(e){let{children:s,...r}=e;return(0,t.jsx)("thead",{className:"bg-muted/50",...r,children:s})},th(e){let{children:s,...r}=e;return(0,t.jsx)("th",{className:"border-b border-border px-4 py-3 text-left font-semibold text-foreground",...r,children:s})},td(e){let{children:s,...r}=e;return(0,t.jsx)("td",{className:"border-b border-border px-4 py-3 text-foreground",...r,children:s})},hr(e){let{...s}=e;return(0,t.jsx)("hr",{className:"my-8 border-t border-border",...s})},strong(e){let{children:s,...r}=e;return(0,t.jsx)("strong",{className:"font-semibold text-foreground",...r,children:s})},em(e){let{children:s,...r}=e;return(0,t.jsx)("em",{className:"italic text-foreground",...r,children:s})}},children:s})})},_=e=>{let{content:s,getToolResult:r}=e;if("text"===s.type)return(0,t.jsx)("div",{className:"w-full mx-2 my-6",children:(0,t.jsx)(P,{content:s.text})});if("thinking"===s.type)return(0,t.jsx)(R.Zp,{className:"bg-muted/50 border-dashed gap-2 py-3 mb-2",children:(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsx)(R.aR,{className:"cursor-pointer hover:bg-muted/80 rounded-t-lg transition-colors py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Thinking"}),(0,t.jsx)(f.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)(R.Wu,{className:"py-0 px-4",children:(0,t.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap font-mono",children:s.thinking})})})]})});if("tool_use"===s.type){let e=r(s.id);return(0,t.jsxs)(R.Zp,{className:"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20 gap-2 py-3 mb-2",children:[(0,t.jsxs)(R.aR,{className:"py-0 px-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(j.A,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Tool Use"}),(0,t.jsx)(C,{variant:"outline",className:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",children:s.name})]}),(0,t.jsxs)(R.BT,{className:"text-xs",children:["Tool execution with ID: ",s.id]})]}),(0,t.jsxs)(R.Wu,{className:"space-y-2 py-0 px-4",children:[(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Input Parameters"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(s.input,null,2)})})})]}),e&&(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Tool Result"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:"string"==typeof e.content?(0,t.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.content}):e.content.map(e=>{if("image"===e.type)return(0,t.jsx)(v.default,{src:"data:".concat(e.source.media_type,";base64,").concat(e.source.data),alt:"Tool Result"},e.source.data);if("text"===e.type)return(0,t.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.text},e.text);throw Error("Unexpected tool result content type")})})})]})]})]})}return s.type,null},U=e=>{let{children:s}=e;return(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Meta Information"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:s})})]})},Z=e=>{let{children:s}=e;return(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Summarized"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})},B=e=>{let{children:s}=e;return(0,t.jsxs)(S.Nt,{children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"System Message"}),(0,t.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,t.jsx)(S.Ke,{children:(0,t.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})};var z=r(93021),E=r(28043),K=r(72676),F=r(5556);let D=RegExp("<(?<tag>[^>]+)>(?<content>\\s*[^<]*?\\s*)<\\/\\k<tag>>","g"),$=F.Ik({tag:F.Yj(),content:F.Yj()}),W=e=>{let{text:s}=e,r=(e=>{var s,r,t,a;let n=Array.from(e.matchAll(D)).map(e=>$.safeParse(e.groups)).filter(e=>e.success).map(e=>e.data);if(0===n.length)return{kind:"text",content:e};let l=null==(s=n.find(e=>"command-name"===e.tag))?void 0:s.content,d=null==(r=n.find(e=>"command-args"===e.tag))?void 0:r.content,i=null==(t=n.find(e=>"command-message"===e.tag))?void 0:t.content,o=null==(a=n.find(e=>"local-command-stdout"===e.tag))?void 0:a.content;switch(!0){case void 0!==l:return{kind:"command",commandName:l,commandArgs:d,commandMessage:i};case void 0!==o:return{kind:"local-command",stdout:o};default:return{kind:"text",content:e}}})(s);return"command"===r.kind?(0,t.jsxs)(R.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,t.jsx)(R.aR,{className:"py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(K.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Claude Code Command"}),(0,t.jsx)(C,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",children:r.commandName})]})}),r.commandArgs||r.commandMessage?(0,t.jsx)(R.Wu,{className:"py-0 px-4",children:(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{children:[r.commandArgs&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Arguments:"}),(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("code",{className:"text-xs whitespace-pre-line",children:r.commandArgs})})]}),r.commandMessage&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Message:"}),(0,t.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,t.jsx)("code",{className:"text-xs whitespace-pre-line",children:r.commandMessage})})]})]})})}):null]}):"local-command"===r.kind?(0,t.jsxs)(R.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,t.jsx)(R.aR,{className:"py-0 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(K.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Local Command"})]})}),(0,t.jsx)(R.Wu,{className:"py-0 px-4",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:r.stdout})})]}):(0,t.jsx)(P,{className:"w-full px-3 py-3 mb-5 border border-border rounded-lg bg-slate-50",content:r.content})},q=e=>{let{content:s}=e;return"string"==typeof s?(0,t.jsx)(W,{text:s}):"text"===s.type?(0,t.jsx)(W,{text:s.text}):"image"===s.type?"base64"===s.source.type?(0,t.jsxs)(R.Zp,{className:"border-purple-200 bg-purple-50/50 dark:border-purple-800 dark:bg-purple-950/20",children:[(0,t.jsxs)(R.aR,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(z.A,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Image"}),(0,t.jsx)(C,{variant:"outline",className:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",children:s.source.media_type})]}),(0,t.jsx)(R.BT,{className:"text-xs",children:"User uploaded image content"})]}),(0,t.jsx)(R.Wu,{children:(0,t.jsx)("div",{className:"rounded-lg border overflow-hidden bg-background",children:(0,t.jsx)(v.default,{src:"data:".concat(s.source.media_type,";base64,").concat(s.source.data),alt:"User uploaded content",className:"max-w-full h-auto max-h-96 object-contain"})})})]}):(0,t.jsx)(R.Zp,{className:"border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",children:(0,t.jsxs)(R.aR,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(E.A,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,t.jsx)(R.ZB,{className:"text-sm font-medium",children:"Unsupported Media"}),(0,t.jsx)(C,{variant:"destructive",children:"Error"})]}),(0,t.jsx)(R.BT,{className:"text-xs",children:"Media type not supported for display"})]})}):(s.type,null)},L=e=>{let{conversation:s,getToolResult:r,isRootSidechain:a,getSidechainConversations:n}=e;if("summary"===s.type)return(0,t.jsx)(Z,{children:s.summary});if("system"===s.type)return(0,t.jsx)(B,{children:s.content});if(s.isSidechain)return a(s)?(0,t.jsx)(g,{conversation:s,sidechainConversations:n(s.uuid).map(e=>"summary"===e.type?e:{...e,isSidechain:!1}),getToolResult:r}):null;if("user"===s.type){let e="string"==typeof s.message.content?(0,t.jsx)(q,{content:s.message.content}):(0,t.jsx)("ul",{className:"w-full",id:"message-".concat(s.uuid),children:s.message.content.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(q,{content:e})},e.toString()))});return!0===s.isMeta?(0,t.jsx)(U,{children:e}):e}return"assistant"===s.type?(0,t.jsx)("ul",{className:"w-full",children:s.message.content.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(_,{content:e,getToolResult:r})},e.toString()))}):null},O=e=>{if("user"===e.type)return"user_".concat(e.uuid);if("assistant"===e.type)return"assistant_".concat(e.uuid);if("system"===e.type)return"system_".concat(e.uuid);if("summary"===e.type)return"summary_".concat(e.leafUuid);throw Error("Unknown conversation type: ".concat(e))},H=e=>{let{conversations:s,getToolResult:r}=e,{isRootSidechain:a,getSidechainConversations:n}=(e=>{let s=(0,i.useMemo)(()=>new Map(e.filter(e=>"summary"!==e.type).map(e=>[e.uuid,e])),[e]),r=(0,i.useCallback)(e=>{if("summary"===e.type||null===e.parentUuid)return e;let t=s.get(e.parentUuid);return void 0===t?e:r(t)},[s]),t=(0,i.useMemo)(()=>{let s=e.filter(e=>"summary"!==e.type).filter(e=>!0===e.isSidechain),t=new Map;for(let e of s){let s=r(e);if("summary"!==s.type)if(t.has(s.uuid)){var a;null==(a=t.get(s.uuid))||a.push(e)}else t.set(s.uuid,[e])}return t},[e,r]);return{isRootSidechain:(0,i.useCallback)(e=>"summary"!==e.type&&t.has(e.uuid),[t]),getSidechainConversations:(0,i.useCallback)(e=>{var s;return null!=(s=t.get(e))?s:[]},[t])}})(s);return(0,t.jsx)("ul",{children:s.flatMap(e=>{let s=(0,t.jsx)(L,{conversation:e,getToolResult:r,isRootSidechain:a,getSidechainConversations:n},O(e)),l="summary"!==e.type&&e.isSidechain;return[(0,t.jsx)("li",{className:"w-full flex ".concat(l||"assistant"===e.type||"system"===e.type||"summary"===e.type?"justify-start":"justify-end"),children:(0,t.jsx)("div",{className:"w-[85%]",children:s})},O(e))]})})};var V=r(59054),Q=r(26057),Y=r(70038),G=r(79588),J=r(31264),X=r(19611);let ee=e=>{let{projectId:s,sessionId:r}=e,a=(0,G.useRouter)(),l=(0,i.useRef)(null),d=(0,V.useMutation)({mutationFn:async e=>{let t=await u.s.api.projects[":projectId"].sessions[":sessionId"].resume.$post({param:{projectId:s,sessionId:r},json:{resumeMessage:e.message}});if(!t.ok)throw Error(t.statusText);return t.json()},onSuccess:e=>{m(""),a.push("/projects/".concat(s,"/sessions/").concat(e.nextSessionId,"#message-").concat(e.userMessageId))}}),[c,m]=(0,i.useState)(""),x=(0,i.useRef)(null),h=(0,i.useId)(),p=()=>{c.trim()&&d.mutate({message:c.trim()})};return(0,t.jsxs)(R.Zp,{className:"border-t rounded-t-none border-x-0 bg-background/50 backdrop-blur-sm mt-10",children:[(0,t.jsxs)(R.aR,{className:"pb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Q.A,{className:"w-5 h-5 text-primary"}),(0,t.jsx)(R.ZB,{className:"text-lg",children:"Continue Conversation"})]}),(0,t.jsx)(R.BT,{children:"Start a new conversation based on this session's context"})]}),(0,t.jsxs)(R.Wu,{className:"space-y-4",children:[d.error&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md",children:[(0,t.jsx)(E.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Failed to resume chat. Please try again."})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(J.T,{ref:l,value:c,onChange:e=>m(e.target.value),onKeyDown:e=>{var s;(null==(s=x.current)||!s.handleKeyDown(e))&&"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),p())},placeholder:"Type your message here... (Start with / for commands, Shift+Enter to send)",className:"min-h-[80px] resize-none",disabled:d.isPending,maxLength:4e3,"aria-label":"Message input with command completion","aria-describedby":h,"aria-expanded":c.startsWith("/"),"aria-haspopup":"listbox",role:"combobox","aria-autocomplete":"list"}),(0,t.jsx)(X.s,{ref:x,projectId:s,inputValue:c,onCommandSelect:e=>{var s;m(e),null==(s=l.current)||s.focus()},className:"absolute top-full left-0 right-0"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",id:h,children:[c.length,"/4000 characters • Use arrow keys to navigate commands"]}),(0,t.jsx)(o.$,{onClick:p,disabled:!c.trim()||d.isPending,size:"lg",className:"gap-2",children:d.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.A,{className:"w-4 h-4 animate-spin"}),"Starting..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.A,{className:"w-4 h-4"}),"Resume Chat"]})})]})]})]})]})};var es=r(62520),er=r(12240),et=r(51290),ea=r(5685);let en=e=>{let{sessions:s,currentSessionId:r,projectId:a}=e;return(0,t.jsxs)("div",{className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",children:[(0,t.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("h2",{className:"font-semibold text-lg",children:"Sessions"}),(0,t.jsx)(et.c,{projectId:a,trigger:(0,t.jsxs)(o.$,{size:"sm",variant:"outline",className:"gap-1.5 mr-5",children:[(0,t.jsx)(es.A,{className:"w-3.5 h-3.5"}),"New"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[s.length," total"]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:s.map(e=>{let s=e.id===r,n=null!==e.meta.firstCommand?(0,c.H)(e.meta.firstCommand):e.id;return(0,t.jsx)(d(),{href:"/projects/".concat(a,"/sessions/").concat(encodeURIComponent(e.id)),className:(0,w.cn)("block rounded-lg p-2.5 transition-all duration-200 hover:bg-blue-50/60 hover:border-blue-300/60 hover:shadow-sm border border-sidebar-border/40 bg-sidebar/30",s&&"bg-blue-100 border-blue-400 shadow-md ring-1 ring-blue-200/50 hover:bg-blue-100 hover:border-blue-400"),children:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h3",{className:"text-sm font-medium line-clamp-2 leading-tight text-sidebar-foreground",children:n}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-sidebar-foreground/70",children:[(0,t.jsx)(Q.A,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.meta.messageCount})]}),e.meta.lastModifiedAt&&(0,t.jsx)("span",{className:"text-xs text-sidebar-foreground/60",children:new Date(e.meta.lastModifiedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})},e.id)})})]})},el=e=>{let{currentSessionId:s,projectId:r,className:a}=e,{data:{sessions:n}}=(0,ea.B)(r),[l,d]=(0,i.useState)(!1);return(0,t.jsx)(S.Nt,{open:!l,onOpenChange:e=>d(!e),className:(0,w.cn)("hidden md:flex h-full",a),children:(0,t.jsx)("div",{className:"relative h-full",children:(0,t.jsxs)("div",{className:(0,w.cn)("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out",l?"w-12":"w-72 lg:w-80"),children:[(0,t.jsx)(S.R6,{asChild:!0,children:(0,t.jsx)(o.$,{variant:"ghost",size:"icon",className:"absolute -right-3 top-4 z-10 bg-background border border-sidebar-border shadow-sm",children:(0,t.jsx)(er.A,{className:(0,w.cn)("w-4 h-4 transition-transform duration-200",l&&"rotate-180")})})}),(0,t.jsx)(S.Ke,{className:"h-full data-[state=closed]:animate-slide-out-to-left data-[state=open]:animate-slide-in-from-left",children:(0,t.jsx)(en,{sessions:n,currentSessionId:s,projectId:r})}),l&&(0,t.jsx)("div",{className:"h-full bg-sidebar border-r border-sidebar-border flex flex-col items-center pt-16",children:(0,t.jsx)(Q.A,{className:"w-5 h-5 text-sidebar-foreground/70"})})]})})})},ed=e=>{let{projectId:s,sessionId:r}=e,{session:l,conversations:h,getToolResult:p}=((e,s)=>{let r=(0,x.useSuspenseQuery)({...((e,s)=>({queryKey:["sessions",s],queryFn:async()=>(await u.s.api.projects[":projectId"].sessions[":sessionId"].$get({param:{projectId:e,sessionId:s}})).json()}))(e,s)}),t=(0,i.useMemo)(()=>new Map(r.data.session.conversations.flatMap(e=>"user"!==e.type||"string"==typeof e.message.content?[]:e.message.content.flatMap(e=>"string"==typeof e||"tool_result"!==e.type?[]:[[e.tool_use_id,e]]))),[r.data.session.conversations]),a=(0,i.useCallback)(e=>t.get(e),[t]);return{session:r.data.session,conversations:r.data.session.conversations,getToolResult:a}})(s,r),{isResummingTask:g}=(e=>{let{data:s,isLoading:r}=(0,m.useQuery)({queryKey:["runningTasks"],queryFn:async()=>{let e=await u.s.api.tasks.running.$get({});if(!e.ok)throw Error(e.statusText);return e.json()},refetchInterval:e=>{var s,r,t;return(null!=(t=null==(r=e.state.data)||null==(s=r.runningTasks)?void 0:s.length)?t:0)>0&&2e3},staleTime:3e4,gcTime:3e5,refetchOnWindowFocus:!0});return{...(0,i.useMemo)(()=>{var r;let t=null==s?void 0:s.runningTasks.find(s=>s.nextSessionId===e);return{isResummingTask:!!t,task:t,hasRunningTasks:(null!=(r=null==s?void 0:s.runningTasks.length)?r:0)>0}},[s,e]),isLoading:r}})(r),[b,f]=(0,i.useState)(0),j=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(g&&h.length!==b){f(h.length);let e=j.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},[h,g,b]),(0,t.jsxs)("div",{className:"flex h-screen",children:[(0,t.jsx)(el,{currentSessionId:r,projectId:s}),(0,t.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(0,t.jsxs)("div",{ref:j,className:"max-w-none flex-1 overflow-y-auto",children:[(0,t.jsxs)("header",{className:"px-3 py-3 sticky top-0 z-10 bg-background w-full",children:[(0,t.jsx)(o.$,{asChild:!0,variant:"ghost",children:(0,t.jsxs)(d(),{href:"/projects/".concat(s),className:"flex items-center gap-2",children:[(0,t.jsx)(a.A,{className:"w-4 h-4"}),"Back to Session List"]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsx)("h1",{className:"text-3xl font-bold break-all overflow-ellipsis line-clamp-2 px-5",children:null!==l.meta.firstCommand?(0,c.H)(l.meta.firstCommand):r})}),g&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,t.jsx)(n.A,{className:"w-4 h-4 animate-spin"}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)("p",{className:"text-sm font-medium",children:"Conversation is being resumed..."})})]}),(0,t.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["Session ID: ",r]})]})]}),(0,t.jsxs)("main",{className:"w-full px-20 pb-20 relative z-5",children:[(0,t.jsx)(H,{conversations:h,getToolResult:p}),(0,t.jsx)(ee,{projectId:s,sessionId:r})]})]})})]})}},82791:(e,s,r)=>{Promise.resolve().then(r.bind(r,98613)),Promise.resolve().then(r.bind(r,72611)),Promise.resolve().then(r.bind(r,13881)),Promise.resolve().then(r.bind(r,85452)),Promise.resolve().then(r.bind(r,120)),Promise.resolve().then(r.bind(r,27740)),Promise.resolve().then(r.bind(r,59054)),Promise.resolve().then(r.bind(r,8120)),Promise.resolve().then(r.bind(r,9161)),Promise.resolve().then(r.bind(r,63812)),Promise.resolve().then(r.bind(r,86260)),Promise.resolve().then(r.bind(r,15312)),Promise.resolve().then(r.bind(r,45320)),Promise.resolve().then(r.bind(r,56812))}},e=>{e.O(0,[33,150,583,730,409,900,341,358],()=>e(e.s=82791)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{71968:(e,s,t)=>{"use strict";t.d(s,{SessionPageContent:()=>eb});var r=t(89835),a=t(59054),n=t(50417),i=t(58903),l=t(93856),d=t(38514),o=t(75123),c=t.n(o),m=t(55931),u=t(80942),x=t(53630),h=t(72667),p=t(63812),g=t(27608),b=t(89854),f=t(45320),j=t(41633),v=t(40138);let N=e=>{let{conversation:s,sidechainConversations:t,getToolResult:a}=e,n=(e=>{let s=e.at(0),t="".concat(e.length," conversations (").concat((null==s?void 0:s.type)!=="summary"?null==s?void 0:s.uuid:"",")");if(!s||"user"!==s.type)return t;let r="string"==typeof s.message.content?s.message.content:(()=>{let e=s.message.content.at(0);return void 0===e?null:"string"==typeof e?e:"text"===e.type?e.text:null})();return null!=r?r:t})(t),i="summary"!==s.type?s.uuid:s.leafUuid;return(0,r.jsxs)(v.lG,{children:[(0,r.jsx)(v.zM,{asChild:!0,children:(0,r.jsx)(u.$,{variant:"outline",size:"sm",className:"w-full mb-3 items-center justify-start",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(j.A,{className:"h-4 w-4 flex-shrink-0"}),(0,r.jsxs)("span",{className:"overflow-hidden text-ellipsis",children:["View Task: ",n]})]})})}),(0,r.jsxs)(v.Cf,{className:"!w-[1200px] !max-w-none max-h-[80vh] overflow-hidden flex flex-col",children:[(0,r.jsxs)(v.c7,{children:[(0,r.jsx)(v.L3,{children:n.length>100?"".concat(n.slice(0,100),"..."):n}),(0,r.jsxs)(v.rr,{children:["Root UUID: ",i]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto",children:(0,r.jsx)(X,{conversations:t,getToolResult:a})})]})]})};var y=t(55407),w=t(5530),k=t(9005),A=t(68607),C=t(36703),S=t(83632),T=t(8607),I=t(7951),R=t(18237);let P=(0,I.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function M(e){let{className:s,variant:t,asChild:a=!1,...n}=e,i=a?T.DX:"span";return(0,r.jsx)(i,{"data-slot":"badge",className:(0,R.cn)(P({variant:t}),s),...n})}var U=t(75284),_=t(45730),D=t(35853),E=t(35880),z=t(96318);let F=e=>{let{content:s,className:t=""}=e;return(0,r.jsx)("div",{className:"prose prose-neutral dark:prose-invert max-w-none ".concat(t),children:(0,r.jsx)(D.oz,{remarkPlugins:[z.A],components:{h1(e){let{children:s,...t}=e;return(0,r.jsx)("h1",{className:"text-3xl font-bold mb-6 mt-8 pb-3 border-b border-border text-foreground",...t,children:s})},h2(e){let{children:s,...t}=e;return(0,r.jsx)("h2",{className:"text-2xl font-semibold mb-4 mt-8 pb-2 border-b border-border/50 text-foreground",...t,children:s})},h3(e){let{children:s,...t}=e;return(0,r.jsx)("h3",{className:"text-xl font-semibold mb-3 mt-6 text-foreground",...t,children:s})},h4(e){let{children:s,...t}=e;return(0,r.jsx)("h4",{className:"text-lg font-medium mb-2 mt-4 text-foreground",...t,children:s})},h5(e){let{children:s,...t}=e;return(0,r.jsx)("h5",{className:"text-base font-medium mb-2 mt-4 text-foreground",...t,children:s})},h6(e){let{children:s,...t}=e;return(0,r.jsx)("h6",{className:"text-sm font-medium mb-2 mt-4 text-muted-foreground",...t,children:s})},p(e){let{children:s,...t}=e;return(0,r.jsx)("p",{className:"mb-4 leading-7 text-foreground",...t,children:s})},ul(e){let{children:s,...t}=e;return(0,r.jsx)("ul",{className:"mb-4 ml-6 list-disc space-y-2",...t,children:s})},ol(e){let{children:s,...t}=e;return(0,r.jsx)("ol",{className:"mb-4 ml-6 list-decimal space-y-2",...t,children:s})},li(e){let{children:s,...t}=e;return(0,r.jsx)("li",{className:"leading-7 text-foreground",...t,children:s})},code(e){let{className:s,children:t,...a}=e,n=/language-(\w+)/.exec(s||"");return n?(0,r.jsxs)("div",{className:"relative my-6",children:[(0,r.jsx)("div",{className:"flex items-center justify-between bg-muted/30 px-4 py-2 border-b border-border rounded-t-lg",children:(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:n[1]})}),(0,r.jsx)(C.A,{style:E.A,language:n[1],PreTag:"div",className:"!mt-0 !rounded-t-none !rounded-b-lg !border-t-0 !border !border-border",customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:String(t).replace(/\n$/,"")})]}):(0,r.jsx)("code",{className:"bg-muted/70 px-2 py-1 rounded-md text-sm font-mono text-foreground border",...a,children:t})},pre(e){let{children:s,...t}=e;return(0,r.jsx)("pre",{...t,children:s})},blockquote(e){let{children:s,...t}=e;return(0,r.jsx)("blockquote",{className:"border-l-4 border-primary/30 bg-muted/30 pl-6 pr-4 py-4 my-6 italic rounded-r-lg",...t,children:(0,r.jsx)("div",{className:"text-muted-foreground",children:s})})},a(e){let{children:s,href:t,...a}=e;return(0,r.jsx)("a",{href:t,className:"text-primary hover:text-primary/80 underline underline-offset-4 decoration-primary/30 hover:decoration-primary/60 transition-colors",...a,children:s})},table(e){let{children:s,...t}=e;return(0,r.jsx)("div",{className:"overflow-x-auto my-6 rounded-lg border border-border",children:(0,r.jsx)("table",{className:"min-w-full border-collapse",...t,children:s})})},thead(e){let{children:s,...t}=e;return(0,r.jsx)("thead",{className:"bg-muted/50",...t,children:s})},th(e){let{children:s,...t}=e;return(0,r.jsx)("th",{className:"border-b border-border px-4 py-3 text-left font-semibold text-foreground",...t,children:s})},td(e){let{children:s,...t}=e;return(0,r.jsx)("td",{className:"border-b border-border px-4 py-3 text-foreground",...t,children:s})},hr(e){let{...s}=e;return(0,r.jsx)("hr",{className:"my-8 border-t border-border",...s})},strong(e){let{children:s,...t}=e;return(0,r.jsx)("strong",{className:"font-semibold text-foreground",...t,children:s})},em(e){let{children:s,...t}=e;return(0,r.jsx)("em",{className:"italic text-foreground",...t,children:s})}},children:s})})},$=e=>{let{content:s,getToolResult:t}=e;if("text"===s.type)return(0,r.jsx)("div",{className:"w-full mx-2 my-6",children:(0,r.jsx)(F,{content:s.text})});if("thinking"===s.type)return(0,r.jsx)(U.Zp,{className:"bg-muted/50 border-dashed gap-2 py-3 mb-2",children:(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsx)(U.aR,{className:"cursor-pointer hover:bg-muted/80 rounded-t-lg transition-colors py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(y.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Thinking"}),(0,r.jsx)(w.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap font-mono",children:s.thinking})})})]})});if("tool_use"===s.type){let e=t(s.id);return(0,r.jsxs)(U.Zp,{className:"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20 gap-2 py-3 mb-2",children:[(0,r.jsxs)(U.aR,{className:"py-0 px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(k.A,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Tool Use"}),(0,r.jsx)(M,{variant:"outline",className:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",children:s.name})]}),(0,r.jsxs)(U.BT,{className:"text-xs",children:["Tool execution with ID: ",s.id]})]}),(0,r.jsxs)(U.Wu,{className:"space-y-2 py-0 px-4",children:[(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Input Parameters"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)(C.A,{style:S.A,language:"json",PreTag:"div",className:"text-xs",children:JSON.stringify(s.input,null,2)})})]}),e&&(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Tool Result"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:"string"==typeof e.content?(0,r.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.content}):e.content.map(e=>{if("image"===e.type)return(0,r.jsx)(A.default,{src:"data:".concat(e.source.media_type,";base64,").concat(e.source.data),alt:"Tool Result"},e.source.data);if("text"===e.type)return(0,r.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.text},e.text);throw Error("Unexpected tool result content type")})})})]})]})]})}return s.type,null},Z=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Meta Information"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:s})})]})},B=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Summarized"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})},K=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"System Message"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})};var q=t(93021),L=t(28043),W=t(72676),O=t(5556);let H=RegExp("<(?<tag>[^>]+)>(?<content>\\s*[^<]*?\\s*)<\\/\\k<tag>>","g"),V=O.Ik({tag:O.Yj(),content:O.Yj()}),Q=e=>{let{text:s,id:t}=e,a=(e=>{var s,t,r,a;let n=Array.from(e.matchAll(H)).map(e=>V.safeParse(e.groups)).filter(e=>e.success).map(e=>e.data);if(0===n.length)return{kind:"text",content:e};let i=null==(s=n.find(e=>"command-name"===e.tag))?void 0:s.content,l=null==(t=n.find(e=>"command-args"===e.tag))?void 0:t.content,d=null==(r=n.find(e=>"command-message"===e.tag))?void 0:r.content,o=null==(a=n.find(e=>"local-command-stdout"===e.tag))?void 0:a.content;switch(!0){case void 0!==i:return{kind:"command",commandName:i,commandArgs:l,commandMessage:d};case void 0!==o:return{kind:"local-command",stdout:o};default:return{kind:"text",content:e}}})(s);return"command"===a.kind?(0,r.jsxs)(U.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",id:t,children:[(0,r.jsx)(U.aR,{className:"py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(W.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Claude Code Command"}),(0,r.jsx)(M,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",children:a.commandName})]})}),a.commandArgs||a.commandMessage?(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsxs)("div",{children:[a.commandArgs&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Arguments:"}),(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,r.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandArgs})})]}),a.commandMessage&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Message:"}),(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,r.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandMessage})})]})]})})}):null]}):"local-command"===a.kind?(0,r.jsxs)(U.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,r.jsx)(U.aR,{className:"py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(W.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Local Command"})]})}),(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:a.stdout})})]}):(0,r.jsx)(F,{className:"w-full px-3 py-3 mb-5 border border-border rounded-lg bg-slate-50",content:a.content})},Y=e=>{let{content:s,id:t}=e;return"string"==typeof s?(0,r.jsx)(Q,{text:s,id:t}):"text"===s.type?(0,r.jsx)(Q,{text:s.text,id:t}):"image"===s.type?"base64"===s.source.type?(0,r.jsxs)(U.Zp,{className:"border-purple-200 bg-purple-50/50 dark:border-purple-800 dark:bg-purple-950/20",id:t,children:[(0,r.jsxs)(U.aR,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(q.A,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Image"}),(0,r.jsx)(M,{variant:"outline",className:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",children:s.source.media_type})]}),(0,r.jsx)(U.BT,{className:"text-xs",children:"User uploaded image content"})]}),(0,r.jsx)(U.Wu,{children:(0,r.jsx)("div",{className:"rounded-lg border overflow-hidden bg-background",children:(0,r.jsx)(A.default,{src:"data:".concat(s.source.media_type,";base64,").concat(s.source.data),alt:"User uploaded content",className:"max-w-full h-auto max-h-96 object-contain"})})})]}):(0,r.jsx)(U.Zp,{className:"border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",id:t,children:(0,r.jsxs)(U.aR,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(L.A,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Unsupported Media"}),(0,r.jsx)(M,{variant:"destructive",children:"Error"})]}),(0,r.jsx)(U.BT,{className:"text-xs",children:"Media type not supported for display"})]})}):(s.type,null)},G=e=>{let{conversation:s,getToolResult:t,isRootSidechain:a,getSidechainConversations:n}=e;if("summary"===s.type)return(0,r.jsx)(B,{children:s.summary});if("system"===s.type)return(0,r.jsx)(K,{children:s.content});if(s.isSidechain)return a(s)?(0,r.jsx)(N,{conversation:s,sidechainConversations:n(s.uuid).map(e=>"summary"===e.type?e:{...e,isSidechain:!1}),getToolResult:t}):null;if("user"===s.type){let e="string"==typeof s.message.content?(0,r.jsx)(Y,{content:s.message.content,id:"message-".concat(s.uuid)}):(0,r.jsx)("ul",{className:"w-full",id:"message-".concat(s.uuid),children:s.message.content.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(Y,{content:e})},e.toString()))});return!0===s.isMeta?(0,r.jsx)(Z,{children:e}):e}return"assistant"===s.type?(0,r.jsx)("ul",{className:"w-full",children:s.message.content.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)($,{content:e,getToolResult:t})},e.toString()))}):null},J=e=>{if("user"===e.type)return"user_".concat(e.uuid);if("assistant"===e.type)return"assistant_".concat(e.uuid);if("system"===e.type)return"system_".concat(e.uuid);if("summary"===e.type)return"summary_".concat(e.leafUuid);throw Error("Unknown conversation type: ".concat(e))},X=e=>{let{conversations:s,getToolResult:t}=e,{isRootSidechain:a,getSidechainConversations:n}=(e=>{let s=(0,m.useMemo)(()=>new Map(e.filter(e=>"summary"!==e.type).map(e=>[e.uuid,e])),[e]),t=(0,m.useCallback)(e=>{if("summary"===e.type||null===e.parentUuid)return e;let r=s.get(e.parentUuid);return void 0===r?e:t(r)},[s]),r=(0,m.useMemo)(()=>{let s=e.filter(e=>"summary"!==e.type).filter(e=>!0===e.isSidechain),r=new Map;for(let e of s){let s=t(e);if("summary"!==s.type)if(r.has(s.uuid)){var a;null==(a=r.get(s.uuid))||a.push(e)}else r.set(s.uuid,[e])}return r},[e,t]);return{isRootSidechain:(0,m.useCallback)(e=>"summary"!==e.type&&r.has(e.uuid),[r]),getSidechainConversations:(0,m.useCallback)(e=>{var s;return null!=(s=r.get(e))?s:[]},[r])}})(s);return(0,r.jsx)("ul",{children:s.flatMap(e=>{let s=(0,r.jsx)(G,{conversation:e,getToolResult:t,isRootSidechain:a,getSidechainConversations:n},J(e)),i="summary"!==e.type&&e.isSidechain;return[(0,r.jsx)("li",{className:"w-full flex ".concat(i||"assistant"===e.type||"system"===e.type||"summary"===e.type?"justify-start":"justify-end"),children:(0,r.jsx)("div",{className:"w-[85%]",children:s})},J(e))]})})};var ee=t(70038),es=t(79588),et=t(31264),er=t(19611);let ea=e=>{let{projectId:s,sessionId:t,isPausedTask:n,isRunningTask:l}=e,d=(0,es.useRouter)(),o=(0,m.useRef)(null),c=(0,a.useMutation)({mutationFn:async e=>{let r=await x.s.api.projects[":projectId"].sessions[":sessionId"].resume.$post({param:{projectId:s,sessionId:t},json:{resumeMessage:e.message}});if(!r.ok)throw Error(r.statusText);return r.json()},onSuccess:async e=>{t!==e.sessionId&&d.push("/projects/".concat(s,"/sessions/").concat(e.sessionId,"#message-").concat(e.userMessageId)),p("")}}),[h,p]=(0,m.useState)(""),g=(0,m.useRef)(null),b=(0,m.useId)(),f=()=>{h.trim()&&c.mutate({message:h.trim()})};return(0,r.jsxs)("div",{className:"border-t border-border/50 bg-muted/20 p-4 mt-6",children:[c.error&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 mb-3 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md",children:[(0,r.jsx)(L.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:"Failed to resume chat. Please try again."})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(et.T,{ref:o,value:h,onChange:e=>p(e.target.value),onKeyDown:e=>{var s;(null==(s=g.current)||!s.handleKeyDown(e))&&"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),f())},placeholder:"Type your message... (Start with / for commands, Shift+Enter to send)",className:"min-h-[60px] resize-none",disabled:c.isPending,maxLength:4e3,"aria-label":"Message input with command completion","aria-describedby":b,"aria-expanded":h.startsWith("/"),"aria-haspopup":"listbox",role:"combobox","aria-autocomplete":"list"}),(0,r.jsx)(er.s,{ref:g,projectId:s,inputValue:h,onCommandSelect:e=>{var s;p(e),null==(s=o.current)||s.focus()},className:"absolute top-full left-0 right-0"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",id:b,children:[h.length,"/4000"]}),(0,r.jsx)(u.$,{onClick:f,disabled:!h.trim()||c.isPending,size:"default",className:"gap-2",children:c.isPending?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),"Sending... This may take a while."]}):n||l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.A,{className:"w-4 h-4"}),"Send"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.A,{className:"w-4 h-4"}),"Resume"]})})]})]})]})};var en=t(26057),ei=t(9187),el=t(5685),ed=t(62520),eo=t(51290);let ec=e=>{let{sessions:s,currentSessionId:t,projectId:a}=e,n=(0,g.md)(b.r);return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Sessions"}),(0,r.jsx)(eo.c,{projectId:a,trigger:(0,r.jsxs)(u.$,{size:"sm",variant:"outline",className:"gap-1.5",children:[(0,r.jsx)(ed.A,{className:"w-3.5 h-3.5"}),"New"]})})]}),(0,r.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[s.length," total"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:s.map(e=>{let s=e.id===t,i=null!==e.meta.firstCommand?(0,h.H)(e.meta.firstCommand):e.id,l=n.find(s=>s.sessionId===e.id),d=(null==l?void 0:l.status)==="running",o=(null==l?void 0:l.status)==="paused";return(0,r.jsx)(c(),{href:"/projects/".concat(a,"/sessions/").concat(encodeURIComponent(e.id)),className:(0,R.cn)("block rounded-lg p-2.5 transition-all duration-200 hover:bg-blue-50/60 hover:border-blue-300/60 hover:shadow-sm border border-sidebar-border/40 bg-sidebar/30",s&&"bg-blue-100 border-blue-400 shadow-md ring-1 ring-blue-200/50 hover:bg-blue-100 hover:border-blue-400"),children:(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium line-clamp-2 leading-tight text-sidebar-foreground flex-1",children:i}),(d||o)&&(0,r.jsx)(M,{variant:d?"default":"secondary",className:(0,R.cn)("text-xs",d&&"bg-green-500 text-white",o&&"bg-yellow-500 text-white"),children:d?"Running":"Paused"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 text-xs text-sidebar-foreground/70",children:[(0,r.jsx)(en.A,{className:"w-3 h-3"}),(0,r.jsx)("span",{children:e.meta.messageCount})]}),e.meta.lastModifiedAt&&(0,r.jsx)("span",{className:"text-xs text-sidebar-foreground/60",children:new Date(e.meta.lastModifiedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})},e.id)})})]})};var em=t(57981);let eu=()=>(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Settings"}),(0,r.jsx)("p",{className:"text-xs text-sidebar-foreground/70",children:"Display and behavior preferences"})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"font-medium text-sm text-sidebar-foreground",children:"Session Display"}),(0,r.jsx)(em.o,{})]})})]});var ex=t(54058);let eh=e=>{let{task:s,projectId:t,onAbortTask:a,onCopyTaskId:n,isAbortPending:i}=e;return(0,r.jsxs)(c(),{href:"/projects/".concat(t,"/sessions/").concat(encodeURIComponent(s.sessionId)),className:"block rounded-lg p-3 border border-sidebar-border/40 bg-sidebar/30 hover:bg-sidebar-accent/20 transition-colors space-y-2 group",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:["running"===s.status?(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),(0,r.jsx)(ex.A,{className:"w-3 h-3 text-green-600"})]}):(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),(0,r.jsx)(d.A,{className:"w-3 h-3 text-orange-600"})]}),(0,r.jsx)("span",{className:"text-xs font-medium text-sidebar-foreground",children:s.status.toUpperCase()})]}),(0,r.jsx)(u.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(s.sessionId)},disabled:i,title:"Abort task",children:(0,r.jsx)(l.A,{className:"w-3 h-3"})})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Task ID:",(0,r.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(s.id)},className:"ml-1 font-mono hover:text-sidebar-foreground transition-colors",title:"Click to copy",children:s.id.slice(-8)})]}),(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Session:",(0,r.jsx)("span",{className:"ml-1 font-mono text-sidebar-foreground",children:s.sessionId.slice(-8)})]}),s.userMessageId&&(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Message:",(0,r.jsx)("span",{className:"ml-1 font-mono",children:s.userMessageId.slice(-8)})]})]})]})},ep=e=>{let{projectId:s}=e,[t]=(0,g.fp)(b.r),n=(0,a.useMutation)({mutationFn:async e=>{let s=await x.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),i=e=>{navigator.clipboard.writeText(e)},l=t.filter(e=>"running"===e.status),d=t.filter(e=>"paused"===e.status);return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Alive Sessions"}),(0,r.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[l.length," running, ",d.length," paused"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-4",children:0===t.length?(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center pt-8",children:(0,r.jsxs)("div",{className:"text-center text-sidebar-foreground/60",children:[(0,r.jsx)(ei.A,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),(0,r.jsx)("p",{className:"text-sm",children:"No alive sessions"})]})}):(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),(0,r.jsxs)("h3",{className:"text-xs font-semibold text-sidebar-foreground uppercase tracking-wide",children:["Running (",l.length,")"]})]}),(0,r.jsx)("div",{className:"space-y-2",children:l.map(e=>(0,r.jsx)(eh,{task:e,projectId:s,onAbortTask:e=>n.mutate(e),onCopyTaskId:i,isAbortPending:n.isPending},e.id))})]}),d.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),(0,r.jsxs)("h3",{className:"text-xs font-semibold text-sidebar-foreground uppercase tracking-wide",children:["Paused (",d.length,")"]})]}),(0,r.jsx)("div",{className:"space-y-2",children:d.map(e=>(0,r.jsx)(eh,{task:e,projectId:s,onAbortTask:e=>n.mutate(e),onCopyTaskId:i,isAbortPending:n.isPending},e.id))})]})]})})]})},eg=e=>{let{currentSessionId:s,projectId:t,className:a}=e,{data:{sessions:n}}=(0,el.B)(t),[i,l]=(0,m.useState)("sessions"),[d,o]=(0,m.useState)(!0),c=e=>{i===e&&d?o(!1):(l(e),o(!0))};return(0,r.jsx)("div",{className:(0,R.cn)("hidden md:flex h-full",a),children:(0,r.jsxs)("div",{className:(0,R.cn)("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out flex bg-sidebar text-sidebar-foreground",d?"w-72 lg:w-80":"w-12"),children:[(0,r.jsx)("div",{className:"w-12 flex flex-col border-r border-sidebar-border bg-sidebar/50",children:(0,r.jsxs)("div",{className:"flex flex-col p-2 space-y-1",children:[(0,r.jsx)("button",{type:"button",onClick:()=>c("sessions"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","sessions"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Sessions",children:(0,r.jsx)(en.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>c("tasks"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","tasks"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Tasks",children:(0,r.jsx)(ei.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>c("settings"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","settings"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Settings",children:(0,r.jsx)(k.A,{className:"w-4 h-4"})})]})}),d&&(0,r.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(()=>{switch(i){case"sessions":return(0,r.jsx)(ec,{sessions:n,currentSessionId:s,projectId:t});case"tasks":return(0,r.jsx)(ep,{projectId:t});case"settings":return(0,r.jsx)(eu,{});default:return null}})()})]})})},eb=e=>{let{projectId:s,sessionId:t}=e,{session:o,conversations:j,getToolResult:v}=((e,s)=>{let t=(0,f.useSuspenseQuery)({...((e,s)=>({queryKey:["sessions",s],queryFn:async()=>(await x.s.api.projects[":projectId"].sessions[":sessionId"].$get({param:{projectId:e,sessionId:s}})).json()}))(e,s)}),r=(0,m.useMemo)(()=>new Map(t.data.session.conversations.flatMap(e=>"user"!==e.type||"string"==typeof e.message.content?[]:e.message.content.flatMap(e=>"string"==typeof e||"tool_result"!==e.type?[]:[[e.tool_use_id,e]]))),[t.data.session.conversations]),a=(0,m.useCallback)(e=>r.get(e),[r]);return{session:t.data.session,conversations:t.data.session.conversations,getToolResult:a}})(s,t),N=(0,a.useMutation)({mutationFn:async e=>{let s=await x.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),{isRunningTask:y,isPausedTask:w}=(e=>{let[s,t]=(0,g.fp)(b.r);return(0,p.useQuery)({queryKey:["aliveTasks"],queryFn:async()=>{let e=await x.s.api.tasks.alive.$get({});if(!e.ok)throw Error(e.statusText);return t((await e.json()).aliveTasks),e.json()},refetchOnReconnect:!0}),(0,m.useMemo)(()=>{let t=s.find(s=>s.sessionId===e);return{aliveTask:s.find(s=>s.sessionId===e),isRunningTask:(null==t?void 0:t.status)==="running",isPausedTask:(null==t?void 0:t.status)==="paused"}},[s,e])})(t),[k,A]=(0,m.useState)(0),C=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if(y&&j.length!==k){A(j.length);let e=C.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},[j,y,k]),(0,r.jsxs)("div",{className:"flex h-screen",children:[(0,r.jsx)(eg,{currentSessionId:t,projectId:s}),(0,r.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(0,r.jsxs)("div",{ref:C,className:"max-w-none flex-1 overflow-y-auto",children:[(0,r.jsxs)("header",{className:"px-3 py-3 sticky top-0 z-10 bg-background w-full",children:[(0,r.jsx)(u.$,{asChild:!0,variant:"ghost",children:(0,r.jsxs)(c(),{href:"/projects/".concat(s),className:"flex items-center gap-2",children:[(0,r.jsx)(n.A,{className:"w-4 h-4"}),"Back to Session List"]})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("div",{className:"flex items-center gap-3",children:(0,r.jsx)("h1",{className:"text-3xl font-bold break-all overflow-ellipsis line-clamp-2 px-5",children:null!==o.meta.firstCommand?(0,h.H)(o.meta.firstCommand):t})}),y&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,r.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium",children:"Conversation is in progress..."})}),(0,r.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(t)},children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),"Abort"]})]}),w&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,r.jsx)(d.A,{className:"w-4 h-4"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium",children:"Conversation is paused..."})}),(0,r.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(t)},children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),"Abort"]})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["Session ID: ",t]})]})]}),(0,r.jsxs)("main",{className:"w-full px-20 pb-20 relative z-5",children:[(0,r.jsx)(X,{conversations:j,getToolResult:v}),(0,r.jsx)(ea,{projectId:s,sessionId:t,isPausedTask:w,isRunningTask:y})]})]})})]})}},82791:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,71968))},89854:(e,s,t)=>{"use strict";t.d(s,{r:()=>r});let r=(0,t(48304).eU)([])}},e=>{e.O(0,[33,150,311,608,830,5,900,341,358],()=>e(e.s=82791)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{71968:(e,s,t)=>{"use strict";t.d(s,{SessionPageContent:()=>eb});var r=t(89835),a=t(59054),n=t(50417),i=t(58903),l=t(93856),d=t(38514),o=t(75123),c=t.n(o),m=t(55931),u=t(80942),x=t(53630),h=t(72667),p=t(63812),g=t(27608),b=t(89854),f=t(45320),j=t(41633),v=t(40138);let N=e=>{let{conversation:s,sidechainConversations:t,getToolResult:a}=e,n=(e=>{let s=e.at(0),t="".concat(e.length," conversations (").concat((null==s?void 0:s.type)!=="summary"?null==s?void 0:s.uuid:"",")");if(!s||"user"!==s.type)return t;let r="string"==typeof s.message.content?s.message.content:(()=>{let e=s.message.content.at(0);return void 0===e?null:"string"==typeof e?e:"text"===e.type?e.text:null})();return null!=r?r:t})(t),i="summary"!==s.type?s.uuid:s.leafUuid;return(0,r.jsxs)(v.lG,{children:[(0,r.jsx)(v.zM,{asChild:!0,children:(0,r.jsx)(u.$,{variant:"outline",size:"sm",className:"w-full mb-3 items-center justify-start",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(j.A,{className:"h-4 w-4 flex-shrink-0"}),(0,r.jsxs)("span",{className:"overflow-hidden text-ellipsis",children:["View Task: ",n]})]})})}),(0,r.jsxs)(v.Cf,{className:"!w-[1200px] !max-w-none max-h-[80vh] overflow-hidden flex flex-col",children:[(0,r.jsxs)(v.c7,{children:[(0,r.jsx)(v.L3,{children:n.length>100?"".concat(n.slice(0,100),"..."):n}),(0,r.jsxs)(v.rr,{children:["Root UUID: ",i]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto",children:(0,r.jsx)(X,{conversations:t,getToolResult:a})})]})]})};var y=t(55407),w=t(5530),k=t(9005),A=t(68607),C=t(36703),S=t(83632),T=t(8607),I=t(7951),R=t(18237);let P=(0,I.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function M(e){let{className:s,variant:t,asChild:a=!1,...n}=e,i=a?T.DX:"span";return(0,r.jsx)(i,{"data-slot":"badge",className:(0,R.cn)(P({variant:t}),s),...n})}var U=t(75284),_=t(45730),D=t(35853),E=t(35880),z=t(96318);let F=e=>{let{content:s,className:t=""}=e;return(0,r.jsx)("div",{className:"prose prose-neutral dark:prose-invert max-w-none ".concat(t),children:(0,r.jsx)(D.oz,{remarkPlugins:[z.A],components:{h1(e){let{children:s,...t}=e;return(0,r.jsx)("h1",{className:"text-3xl font-bold mb-6 mt-8 pb-3 border-b border-border text-foreground",...t,children:s})},h2(e){let{children:s,...t}=e;return(0,r.jsx)("h2",{className:"text-2xl font-semibold mb-4 mt-8 pb-2 border-b border-border/50 text-foreground",...t,children:s})},h3(e){let{children:s,...t}=e;return(0,r.jsx)("h3",{className:"text-xl font-semibold mb-3 mt-6 text-foreground",...t,children:s})},h4(e){let{children:s,...t}=e;return(0,r.jsx)("h4",{className:"text-lg font-medium mb-2 mt-4 text-foreground",...t,children:s})},h5(e){let{children:s,...t}=e;return(0,r.jsx)("h5",{className:"text-base font-medium mb-2 mt-4 text-foreground",...t,children:s})},h6(e){let{children:s,...t}=e;return(0,r.jsx)("h6",{className:"text-sm font-medium mb-2 mt-4 text-muted-foreground",...t,children:s})},p(e){let{children:s,...t}=e;return(0,r.jsx)("p",{className:"mb-4 leading-7 text-foreground",...t,children:s})},ul(e){let{children:s,...t}=e;return(0,r.jsx)("ul",{className:"mb-4 ml-6 list-disc space-y-2",...t,children:s})},ol(e){let{children:s,...t}=e;return(0,r.jsx)("ol",{className:"mb-4 ml-6 list-decimal space-y-2",...t,children:s})},li(e){let{children:s,...t}=e;return(0,r.jsx)("li",{className:"leading-7 text-foreground",...t,children:s})},code(e){let{className:s,children:t,...a}=e,n=/language-(\w+)/.exec(s||"");return n?(0,r.jsxs)("div",{className:"relative my-6",children:[(0,r.jsx)("div",{className:"flex items-center justify-between bg-muted/30 px-4 py-2 border-b border-border rounded-t-lg",children:(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:n[1]})}),(0,r.jsx)(C.A,{style:E.A,language:n[1],PreTag:"div",className:"!mt-0 !rounded-t-none !rounded-b-lg !border-t-0 !border !border-border",customStyle:{margin:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:String(t).replace(/\n$/,"")})]}):(0,r.jsx)("code",{className:"bg-muted/70 px-2 py-1 rounded-md text-sm font-mono text-foreground border",...a,children:t})},pre(e){let{children:s,...t}=e;return(0,r.jsx)("pre",{...t,children:s})},blockquote(e){let{children:s,...t}=e;return(0,r.jsx)("blockquote",{className:"border-l-4 border-primary/30 bg-muted/30 pl-6 pr-4 py-4 my-6 italic rounded-r-lg",...t,children:(0,r.jsx)("div",{className:"text-muted-foreground",children:s})})},a(e){let{children:s,href:t,...a}=e;return(0,r.jsx)("a",{href:t,className:"text-primary hover:text-primary/80 underline underline-offset-4 decoration-primary/30 hover:decoration-primary/60 transition-colors",...a,children:s})},table(e){let{children:s,...t}=e;return(0,r.jsx)("div",{className:"overflow-x-auto my-6 rounded-lg border border-border",children:(0,r.jsx)("table",{className:"min-w-full border-collapse",...t,children:s})})},thead(e){let{children:s,...t}=e;return(0,r.jsx)("thead",{className:"bg-muted/50",...t,children:s})},th(e){let{children:s,...t}=e;return(0,r.jsx)("th",{className:"border-b border-border px-4 py-3 text-left font-semibold text-foreground",...t,children:s})},td(e){let{children:s,...t}=e;return(0,r.jsx)("td",{className:"border-b border-border px-4 py-3 text-foreground",...t,children:s})},hr(e){let{...s}=e;return(0,r.jsx)("hr",{className:"my-8 border-t border-border",...s})},strong(e){let{children:s,...t}=e;return(0,r.jsx)("strong",{className:"font-semibold text-foreground",...t,children:s})},em(e){let{children:s,...t}=e;return(0,r.jsx)("em",{className:"italic text-foreground",...t,children:s})}},children:s})})},$=e=>{let{content:s,getToolResult:t}=e;if("text"===s.type)return(0,r.jsx)("div",{className:"w-full mx-2 my-6",children:(0,r.jsx)(F,{content:s.text})});if("thinking"===s.type)return(0,r.jsx)(U.Zp,{className:"bg-muted/50 border-dashed gap-2 py-3 mb-2",children:(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsx)(U.aR,{className:"cursor-pointer hover:bg-muted/80 rounded-t-lg transition-colors py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(y.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Thinking"}),(0,r.jsx)(w.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap font-mono",children:s.thinking})})})]})});if("tool_use"===s.type){let e=t(s.id);return(0,r.jsxs)(U.Zp,{className:"border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20 gap-2 py-3 mb-2",children:[(0,r.jsxs)(U.aR,{className:"py-0 px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(k.A,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Tool Use"}),(0,r.jsx)(M,{variant:"outline",className:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",children:s.name})]}),(0,r.jsxs)(U.BT,{className:"text-xs",children:["Tool execution with ID: ",s.id]})]}),(0,r.jsxs)(U.Wu,{className:"space-y-2 py-0 px-4",children:[(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Input Parameters"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)(C.A,{style:S.A,language:"json",PreTag:"div",className:"text-xs",children:JSON.stringify(s.input,null,2)})})]}),e&&(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Tool Result"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:"string"==typeof e.content?(0,r.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.content}):e.content.map(e=>{if("image"===e.type)return(0,r.jsx)(A.default,{src:"data:".concat(e.source.media_type,";base64,").concat(e.source.data),alt:"Tool Result"},e.source.data);if("text"===e.type)return(0,r.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-line",children:e.text},e.text);throw Error("Unexpected tool result content type")})})})]})]})]})}return s.type,null},Z=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Meta Information"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:s})})]})},B=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"Summarized"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})},K=e=>{let{children:s}=e;return(0,r.jsxs)(_.Nt,{children:[(0,r.jsx)(_.R6,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center justify-between cursor-pointer hover:bg-muted/50 rounded p-2 -mx-2",children:[(0,r.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:"System Message"}),(0,r.jsx)(w.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})}),(0,r.jsx)(_.Ke,{children:(0,r.jsx)("div",{className:"bg-background rounded border p-3 mt-2",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:s})})})]})};var q=t(93021),L=t(28043),W=t(72676),O=t(5556);let H=RegExp("<(?<tag>[^>]+)>(?<content>\\s*[^<]*?\\s*)<\\/\\k<tag>>","g"),V=O.Ik({tag:O.Yj(),content:O.Yj()}),Q=e=>{let{text:s,id:t}=e,a=(e=>{var s,t,r,a;let n=Array.from(e.matchAll(H)).map(e=>V.safeParse(e.groups)).filter(e=>e.success).map(e=>e.data);if(0===n.length)return{kind:"text",content:e};let i=null==(s=n.find(e=>"command-name"===e.tag))?void 0:s.content,l=null==(t=n.find(e=>"command-args"===e.tag))?void 0:t.content,d=null==(r=n.find(e=>"command-message"===e.tag))?void 0:r.content,o=null==(a=n.find(e=>"local-command-stdout"===e.tag))?void 0:a.content;switch(!0){case void 0!==i:return{kind:"command",commandName:i,commandArgs:l,commandMessage:d};case void 0!==o:return{kind:"local-command",stdout:o};default:return{kind:"text",content:e}}})(s);return"command"===a.kind?(0,r.jsxs)(U.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",id:t,children:[(0,r.jsx)(U.aR,{className:"py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(W.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Claude Code Command"}),(0,r.jsx)(M,{variant:"outline",className:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",children:a.commandName})]})}),a.commandArgs||a.commandMessage?(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("div",{className:"space-y-2",children:(0,r.jsxs)("div",{children:[a.commandArgs&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Arguments:"}),(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,r.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandArgs})})]}),a.commandMessage&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Message:"}),(0,r.jsx)("div",{className:"bg-background rounded border p-2 mt-1",children:(0,r.jsx)("code",{className:"text-xs whitespace-pre-line",children:a.commandMessage})})]})]})})}):null]}):"local-command"===a.kind?(0,r.jsxs)(U.Zp,{className:"border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20 gap-2 py-3 mb-3",children:[(0,r.jsx)(U.aR,{className:"py-0 px-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(W.A,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Local Command"})]})}),(0,r.jsx)(U.Wu,{className:"py-0 px-4",children:(0,r.jsx)("pre",{className:"text-xs overflow-x-auto",children:a.stdout})})]}):(0,r.jsx)(F,{className:"w-full px-3 py-3 mb-5 border border-border rounded-lg bg-slate-50",content:a.content})},Y=e=>{let{content:s,id:t}=e;return"string"==typeof s?(0,r.jsx)(Q,{text:s,id:t}):"text"===s.type?(0,r.jsx)(Q,{text:s.text,id:t}):"image"===s.type?"base64"===s.source.type?(0,r.jsxs)(U.Zp,{className:"border-purple-200 bg-purple-50/50 dark:border-purple-800 dark:bg-purple-950/20",id:t,children:[(0,r.jsxs)(U.aR,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(q.A,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Image"}),(0,r.jsx)(M,{variant:"outline",className:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",children:s.source.media_type})]}),(0,r.jsx)(U.BT,{className:"text-xs",children:"User uploaded image content"})]}),(0,r.jsx)(U.Wu,{children:(0,r.jsx)("div",{className:"rounded-lg border overflow-hidden bg-background",children:(0,r.jsx)(A.default,{src:"data:".concat(s.source.media_type,";base64,").concat(s.source.data),alt:"User uploaded content",className:"max-w-full h-auto max-h-96 object-contain"})})})]}):(0,r.jsx)(U.Zp,{className:"border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",id:t,children:(0,r.jsxs)(U.aR,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(L.A,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,r.jsx)(U.ZB,{className:"text-sm font-medium",children:"Unsupported Media"}),(0,r.jsx)(M,{variant:"destructive",children:"Error"})]}),(0,r.jsx)(U.BT,{className:"text-xs",children:"Media type not supported for display"})]})}):(s.type,null)},G=e=>{let{conversation:s,getToolResult:t,isRootSidechain:a,getSidechainConversations:n}=e;if("summary"===s.type)return(0,r.jsx)(B,{children:s.summary});if("system"===s.type)return(0,r.jsx)(K,{children:s.content});if(s.isSidechain)return a(s)?(0,r.jsx)(N,{conversation:s,sidechainConversations:n(s.uuid).map(e=>"summary"===e.type?e:{...e,isSidechain:!1}),getToolResult:t}):null;if("user"===s.type){let e="string"==typeof s.message.content?(0,r.jsx)(Y,{content:s.message.content,id:"message-".concat(s.uuid)}):(0,r.jsx)("ul",{className:"w-full",id:"message-".concat(s.uuid),children:s.message.content.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(Y,{content:e})},e.toString()))});return!0===s.isMeta?(0,r.jsx)(Z,{children:e}):e}return"assistant"===s.type?(0,r.jsx)("ul",{className:"w-full",children:s.message.content.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)($,{content:e,getToolResult:t})},e.toString()))}):null},J=e=>{if("user"===e.type)return"user_".concat(e.uuid);if("assistant"===e.type)return"assistant_".concat(e.uuid);if("system"===e.type)return"system_".concat(e.uuid);if("summary"===e.type)return"summary_".concat(e.leafUuid);throw Error("Unknown conversation type: ".concat(e))},X=e=>{let{conversations:s,getToolResult:t}=e,{isRootSidechain:a,getSidechainConversations:n}=(e=>{let s=(0,m.useMemo)(()=>new Map(e.filter(e=>"summary"!==e.type).map(e=>[e.uuid,e])),[e]),t=(0,m.useCallback)(e=>{if("summary"===e.type||null===e.parentUuid)return e;let r=s.get(e.parentUuid);return void 0===r?e:t(r)},[s]),r=(0,m.useMemo)(()=>{let s=e.filter(e=>"summary"!==e.type).filter(e=>!0===e.isSidechain),r=new Map;for(let e of s){let s=t(e);if("summary"!==s.type)if(r.has(s.uuid)){var a;null==(a=r.get(s.uuid))||a.push(e)}else r.set(s.uuid,[e])}return r},[e,t]);return{isRootSidechain:(0,m.useCallback)(e=>"summary"!==e.type&&r.has(e.uuid),[r]),getSidechainConversations:(0,m.useCallback)(e=>{var s;return null!=(s=r.get(e))?s:[]},[r])}})(s);return(0,r.jsx)("ul",{children:s.flatMap(e=>{let s=(0,r.jsx)(G,{conversation:e,getToolResult:t,isRootSidechain:a,getSidechainConversations:n},J(e)),i="summary"!==e.type&&e.isSidechain;return[(0,r.jsx)("li",{className:"w-full flex ".concat(i||"assistant"===e.type||"system"===e.type||"summary"===e.type?"justify-start":"justify-end"),children:(0,r.jsx)("div",{className:"w-[85%]",children:s})},J(e))]})})};var ee=t(70038),es=t(79588),et=t(31264),er=t(19611);let ea=e=>{let{projectId:s,sessionId:t,isPausedTask:n,isRunningTask:l}=e,d=(0,es.useRouter)(),o=(0,m.useRef)(null),c=(0,a.useMutation)({mutationFn:async e=>{let r=await x.s.api.projects[":projectId"].sessions[":sessionId"].resume.$post({param:{projectId:s,sessionId:t},json:{resumeMessage:e.message}});if(!r.ok)throw Error(r.statusText);return r.json()},onSuccess:async e=>{t!==e.sessionId&&d.push("/projects/".concat(s,"/sessions/").concat(e.sessionId,"#message-").concat(e.userMessageId)),p("")}}),[h,p]=(0,m.useState)(""),g=(0,m.useRef)(null),b=(0,m.useId)(),f=()=>{h.trim()&&c.mutate({message:h.trim()})};return(0,r.jsxs)("div",{className:"border-t border-border/50 bg-muted/20 p-4 mt-6",children:[c.error&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 mb-3 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md",children:[(0,r.jsx)(L.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:"Failed to resume chat. Please try again."})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(et.T,{ref:o,value:h,onChange:e=>p(e.target.value),onKeyDown:e=>{var s;(null==(s=g.current)||!s.handleKeyDown(e))&&"Enter"===e.key&&e.shiftKey&&(e.preventDefault(),f())},placeholder:"Type your message... (Start with / for commands, Shift+Enter to send)",className:"min-h-[60px] resize-none",disabled:c.isPending,maxLength:4e3,"aria-label":"Message input with command completion","aria-describedby":b,"aria-expanded":h.startsWith("/"),"aria-haspopup":"listbox",role:"combobox","aria-autocomplete":"list"}),(0,r.jsx)(er.s,{ref:g,projectId:s,inputValue:h,onCommandSelect:e=>{var s;p(e),null==(s=o.current)||s.focus()},className:"absolute top-full left-0 right-0"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",id:b,children:[h.length,"/4000"]}),(0,r.jsx)(u.$,{onClick:f,disabled:!h.trim()||c.isPending,size:"default",className:"gap-2",children:c.isPending?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),"Sending... This may take a while."]}):n||l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.A,{className:"w-4 h-4"}),"Send"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.A,{className:"w-4 h-4"}),"Resume"]})})]})]})]})};var en=t(26057),ei=t(9187),el=t(5685),ed=t(62520),eo=t(51290);let ec=e=>{let{sessions:s,currentSessionId:t,projectId:a}=e,n=(0,g.md)(b.r);return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Sessions"}),(0,r.jsx)(eo.c,{projectId:a,trigger:(0,r.jsxs)(u.$,{size:"sm",variant:"outline",className:"gap-1.5",children:[(0,r.jsx)(ed.A,{className:"w-3.5 h-3.5"}),"New"]})})]}),(0,r.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[s.length," total"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:s.map(e=>{let s=e.id===t,i=null!==e.meta.firstCommand?(0,h.H)(e.meta.firstCommand):e.id,l=n.find(s=>s.sessionId===e.id),d=(null==l?void 0:l.status)==="running",o=(null==l?void 0:l.status)==="paused";return(0,r.jsx)(c(),{href:"/projects/".concat(a,"/sessions/").concat(encodeURIComponent(e.id)),className:(0,R.cn)("block rounded-lg p-2.5 transition-all duration-200 hover:bg-blue-50/60 hover:border-blue-300/60 hover:shadow-sm border border-sidebar-border/40 bg-sidebar/30",s&&"bg-blue-100 border-blue-400 shadow-md ring-1 ring-blue-200/50 hover:bg-blue-100 hover:border-blue-400"),children:(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium line-clamp-2 leading-tight text-sidebar-foreground flex-1",children:i}),(d||o)&&(0,r.jsx)(M,{variant:d?"default":"secondary",className:(0,R.cn)("text-xs",d&&"bg-green-500 text-white",o&&"bg-yellow-500 text-white"),children:d?"Running":"Paused"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 text-xs text-sidebar-foreground/70",children:[(0,r.jsx)(en.A,{className:"w-3 h-3"}),(0,r.jsx)("span",{children:e.meta.messageCount})]}),e.meta.lastModifiedAt&&(0,r.jsx)("span",{className:"text-xs text-sidebar-foreground/60",children:new Date(e.meta.lastModifiedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]})},e.id)})})]})};var em=t(57981);let eu=()=>(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Settings"}),(0,r.jsx)("p",{className:"text-xs text-sidebar-foreground/70",children:"Display and behavior preferences"})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"font-medium text-sm text-sidebar-foreground",children:"Session Display"}),(0,r.jsx)(em.o,{})]})})]});var ex=t(54058);let eh=e=>{let{task:s,projectId:t,onAbortTask:a,onCopyTaskId:n,isAbortPending:i}=e;return(0,r.jsxs)(c(),{href:"/projects/".concat(t,"/sessions/").concat(encodeURIComponent(s.sessionId)),className:"block rounded-lg p-3 border border-sidebar-border/40 bg-sidebar/30 hover:bg-sidebar-accent/20 transition-colors space-y-2 group",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:["running"===s.status?(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),(0,r.jsx)(ex.A,{className:"w-3 h-3 text-green-600"})]}):(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),(0,r.jsx)(d.A,{className:"w-3 h-3 text-orange-600"})]}),(0,r.jsx)("span",{className:"text-xs font-medium text-sidebar-foreground",children:s.status.toUpperCase()})]}),(0,r.jsx)(u.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(s.sessionId)},disabled:i,title:"Abort task",children:(0,r.jsx)(l.A,{className:"w-3 h-3"})})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Task ID:",(0,r.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(s.id)},className:"ml-1 font-mono hover:text-sidebar-foreground transition-colors",title:"Click to copy",children:s.id.slice(-8)})]}),(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Session:",(0,r.jsx)("span",{className:"ml-1 font-mono text-sidebar-foreground",children:s.sessionId.slice(-8)})]}),s.userMessageId&&(0,r.jsxs)("div",{className:"text-xs text-sidebar-foreground/70",children:["Message:",(0,r.jsx)("span",{className:"ml-1 font-mono",children:s.userMessageId.slice(-8)})]})]})]})},ep=e=>{let{projectId:s}=e,[t]=(0,g.fp)(b.r),n=(0,a.useMutation)({mutationFn:async e=>{let s=await x.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),i=e=>{navigator.clipboard.writeText(e)},l=t.filter(e=>"running"===e.status),d=t.filter(e=>"paused"===e.status);return(0,r.jsxs)("div",{className:"h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"border-b border-sidebar-border p-4",children:[(0,r.jsx)("h2",{className:"font-semibold text-lg",children:"Alive Sessions"}),(0,r.jsxs)("p",{className:"text-xs text-sidebar-foreground/70",children:[l.length," running, ",d.length," paused"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-4",children:0===t.length?(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center pt-8",children:(0,r.jsxs)("div",{className:"text-center text-sidebar-foreground/60",children:[(0,r.jsx)(ei.A,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),(0,r.jsx)("p",{className:"text-sm",children:"No alive sessions"})]})}):(0,r.jsxs)(r.Fragment,{children:[l.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),(0,r.jsxs)("h3",{className:"text-xs font-semibold text-sidebar-foreground uppercase tracking-wide",children:["Running (",l.length,")"]})]}),(0,r.jsx)("div",{className:"space-y-2",children:l.map(e=>(0,r.jsx)(eh,{task:e,projectId:s,onAbortTask:e=>n.mutate(e),onCopyTaskId:i,isAbortPending:n.isPending},e.id))})]}),d.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),(0,r.jsxs)("h3",{className:"text-xs font-semibold text-sidebar-foreground uppercase tracking-wide",children:["Paused (",d.length,")"]})]}),(0,r.jsx)("div",{className:"space-y-2",children:d.map(e=>(0,r.jsx)(eh,{task:e,projectId:s,onAbortTask:e=>n.mutate(e),onCopyTaskId:i,isAbortPending:n.isPending},e.id))})]})]})})]})},eg=e=>{let{currentSessionId:s,projectId:t,className:a}=e,{data:{sessions:n}}=(0,el.B)(t),[i,l]=(0,m.useState)("sessions"),[d,o]=(0,m.useState)(!0),c=e=>{i===e&&d?o(!1):(l(e),o(!0))};return(0,r.jsx)("div",{className:(0,R.cn)("hidden md:flex h-full",a),children:(0,r.jsxs)("div",{className:(0,R.cn)("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out flex bg-sidebar text-sidebar-foreground",d?"w-72 lg:w-80":"w-12"),children:[(0,r.jsx)("div",{className:"w-12 flex flex-col border-r border-sidebar-border bg-sidebar/50",children:(0,r.jsxs)("div",{className:"flex flex-col p-2 space-y-1",children:[(0,r.jsx)("button",{type:"button",onClick:()=>c("sessions"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","sessions"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Sessions",children:(0,r.jsx)(en.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>c("tasks"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","tasks"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Tasks",children:(0,r.jsx)(ei.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>c("settings"),className:(0,R.cn)("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","settings"===i&&d?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),title:"Settings",children:(0,r.jsx)(k.A,{className:"w-4 h-4"})})]})}),d&&(0,r.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(()=>{switch(i){case"sessions":return(0,r.jsx)(ec,{sessions:n,currentSessionId:s,projectId:t});case"tasks":return(0,r.jsx)(ep,{projectId:t});case"settings":return(0,r.jsx)(eu,{});default:return null}})()})]})})},eb=e=>{let{projectId:s,sessionId:t}=e,{session:o,conversations:j,getToolResult:v}=((e,s)=>{let t=(0,f.useSuspenseQuery)({...((e,s)=>({queryKey:["sessions",s],queryFn:async()=>(await x.s.api.projects[":projectId"].sessions[":sessionId"].$get({param:{projectId:e,sessionId:s}})).json()}))(e,s)}),r=(0,m.useMemo)(()=>new Map(t.data.session.conversations.flatMap(e=>"user"!==e.type||"string"==typeof e.message.content?[]:e.message.content.flatMap(e=>"string"==typeof e||"tool_result"!==e.type?[]:[[e.tool_use_id,e]]))),[t.data.session.conversations]),a=(0,m.useCallback)(e=>r.get(e),[r]);return{session:t.data.session,conversations:t.data.session.conversations,getToolResult:a}})(s,t),N=(0,a.useMutation)({mutationFn:async e=>{let s=await x.s.api.tasks.abort.$post({json:{sessionId:e}});if(!s.ok)throw Error(s.statusText);return s.json()}}),{isRunningTask:y,isPausedTask:w}=(e=>{let[s,t]=(0,g.fp)(b.r);return(0,p.useQuery)({queryKey:["aliveTasks"],queryFn:async()=>{let e=await x.s.api.tasks.alive.$get({});if(!e.ok)throw Error(e.statusText);return t((await e.json()).aliveTasks),e.json()},refetchOnReconnect:!0}),(0,m.useMemo)(()=>{let t=s.find(s=>s.sessionId===e);return{aliveTask:s.find(s=>s.sessionId===e),isRunningTask:(null==t?void 0:t.status)==="running",isPausedTask:(null==t?void 0:t.status)==="paused"}},[s,e])})(t),[k,A]=(0,m.useState)(0),C=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if((y||w)&&j.length!==k){A(j.length);let e=C.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},[j,y,w,k]),(0,r.jsxs)("div",{className:"flex h-screen",children:[(0,r.jsx)(eg,{currentSessionId:t,projectId:s}),(0,r.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:(0,r.jsxs)("div",{ref:C,className:"max-w-none flex-1 overflow-y-auto",children:[(0,r.jsxs)("header",{className:"px-3 py-3 sticky top-0 z-10 bg-background w-full",children:[(0,r.jsx)(u.$,{asChild:!0,variant:"ghost",children:(0,r.jsxs)(c(),{href:"/projects/".concat(s),className:"flex items-center gap-2",children:[(0,r.jsx)(n.A,{className:"w-4 h-4"}),"Back to Session List"]})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("div",{className:"flex items-center gap-3",children:(0,r.jsx)("h1",{className:"text-3xl font-bold break-all overflow-ellipsis line-clamp-2 px-5",children:null!==o.meta.firstCommand?(0,h.H)(o.meta.firstCommand):t})}),y&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,r.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium",children:"Conversation is in progress..."})}),(0,r.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(t)},children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),"Abort"]})]}),w&&(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/10 border border-primary/20 rounded-lg",children:[(0,r.jsx)(d.A,{className:"w-4 h-4"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium",children:"Conversation is paused..."})}),(0,r.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>{N.mutate(t)},children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),"Abort"]})]}),(0,r.jsxs)("p",{className:"text-muted-foreground font-mono text-sm",children:["Session ID: ",t]})]})]}),(0,r.jsxs)("main",{className:"w-full px-20 pb-10 relative z-5",children:[(0,r.jsx)(X,{conversations:j,getToolResult:v}),(0,r.jsx)(ea,{projectId:s,sessionId:t,isPausedTask:w,isRunningTask:y})]})]})})]})}},82791:(e,s,t)=>{Promise.resolve().then(t.bind(t,98613)),Promise.resolve().then(t.bind(t,72611)),Promise.resolve().then(t.bind(t,13881)),Promise.resolve().then(t.bind(t,85452)),Promise.resolve().then(t.bind(t,120)),Promise.resolve().then(t.bind(t,27740)),Promise.resolve().then(t.bind(t,59054)),Promise.resolve().then(t.bind(t,8120)),Promise.resolve().then(t.bind(t,9161)),Promise.resolve().then(t.bind(t,63812)),Promise.resolve().then(t.bind(t,86260)),Promise.resolve().then(t.bind(t,15312)),Promise.resolve().then(t.bind(t,45320)),Promise.resolve().then(t.bind(t,71968))},89854:(e,s,t)=>{"use strict";t.d(s,{r:()=>r});let r=(0,t(48304).eU)([])}},e=>{e.O(0,[33,150,311,608,830,5,900,341,358],()=>e(e.s=82791)),_N_E=e.O()}]);
|