conductor-oss 0.47.2 → 0.47.3
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/package.json +5 -5
- package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/packages/web/.next/app-path-routes-manifest.json +6 -6
- package/web/.next/standalone/packages/web/.next/build-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/react-loadable-manifest.json +5 -5
- package/web/.next/standalone/packages/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app-paths-manifest.json +6 -6
- package/web/.next/standalone/packages/web/.next/server/chunks/1862.js +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/2089.js +3 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/406.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/452.js +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/7023.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/795.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/9455.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/middleware-build-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/middleware.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/pages/500.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/2361.251d4ea3be6719de.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/4443.151639b97debfa19.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/{4997-6a73d1bb7f426694.js → 4997-01e580511e9b0f6e.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{8510-fcec71d54329c2c1.js → 8510-8ce80afda352ca0b.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/9083-f6cc418589b044e0.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/{9542-d0618e0c5cc2cb34.js → 9542-851f277828a35884.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/{layout-8bbef88f241abf1b.js → layout-0d42201507b180f9.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/sessions/[id]/{page-3949d8bd9297b710.js → page-bb9b714470eb9d53.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{webpack-15f2d60691dfaaf7.js → webpack-57c57d2831b4bb77.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/css/e942041e8202557e.css +1 -0
- package/web/.next/static/chunks/2361.251d4ea3be6719de.js +1 -0
- package/web/.next/static/chunks/4443.151639b97debfa19.js +1 -0
- package/web/.next/static/chunks/{4997-6a73d1bb7f426694.js → 4997-01e580511e9b0f6e.js} +1 -1
- package/web/.next/static/chunks/{8510-fcec71d54329c2c1.js → 8510-8ce80afda352ca0b.js} +1 -1
- package/web/.next/static/chunks/9083-f6cc418589b044e0.js +1 -0
- package/web/.next/static/chunks/{9542-d0618e0c5cc2cb34.js → 9542-851f277828a35884.js} +1 -1
- package/web/.next/static/chunks/app/{layout-8bbef88f241abf1b.js → layout-0d42201507b180f9.js} +1 -1
- package/web/.next/static/chunks/app/sessions/[id]/{page-3949d8bd9297b710.js → page-bb9b714470eb9d53.js} +1 -1
- package/web/.next/static/chunks/{webpack-15f2d60691dfaaf7.js → webpack-57c57d2831b4bb77.js} +1 -1
- package/web/.next/static/css/e942041e8202557e.css +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/4961.js +0 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/8554.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/1254.82607a9f7834419b.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/4443.fa15b1e0eecedcf9.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/9083-71b1ac941c487c6e.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/css/fac4f14c7e867f28.css +0 -1
- package/web/.next/static/chunks/1254.82607a9f7834419b.js +0 -1
- package/web/.next/static/chunks/4443.fa15b1e0eecedcf9.js +0 -1
- package/web/.next/static/chunks/9083-71b1ac941c487c6e.js +0 -1
- package/web/.next/static/css/fac4f14c7e867f28.css +0 -1
- /package/web/.next/standalone/packages/web/.next/static/{MznEMaOSBv_hr1wLP5Hgh → 9Av3W2bO7VIQis1QdU_sA}/_buildManifest.js +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{MznEMaOSBv_hr1wLP5Hgh → 9Av3W2bO7VIQis1QdU_sA}/_ssgManifest.js +0 -0
- /package/web/.next/static/{MznEMaOSBv_hr1wLP5Hgh → 9Av3W2bO7VIQis1QdU_sA}/_buildManifest.js +0 -0
- /package/web/.next/static/{MznEMaOSBv_hr1wLP5Hgh → 9Av3W2bO7VIQis1QdU_sA}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4997],{4997:(e,t,s)=>{s.r(t),s.d(t,{SessionDetail:()=>eh});var a=s(54568),n=s(42925),i=s(7620),l=s(79748),r=s(7920),c=s(46548),o=s(69863),d=s(97380),u=s(41007),x=s(90466),m=s(35131),h=s(46916);let p=m.bL,f=(0,i.forwardRef)(({className:e,...t},s)=>(0,a.jsx)(m.B8,{ref:s,className:(0,h.cn)("inline-flex max-w-full items-center gap-0.5 overflow-x-auto rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-0.5 whitespace-nowrap touch-pan-x [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e),...t}));f.displayName="TabsList";let v=(0,i.forwardRef)(({className:e,...t},s)=>(0,a.jsx)(m.l9,{ref:s,className:(0,h.cn)("inline-flex min-h-[34px] shrink-0 items-center gap-1.5 rounded-[3px] px-2.5 py-1.5 text-[12px] text-[var(--vk-text-muted)]","data-[state=active]:bg-[var(--vk-bg-active)] data-[state=active]:text-[var(--vk-text-normal)]","hover:text-[var(--vk-text-normal)]","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--vk-orange)]",e),...t}));v.displayName="TabsTrigger";let g=(0,i.forwardRef)(({className:e,...t},s)=>(0,a.jsx)(m.UC,{ref:s,className:(0,h.cn)("focus-visible:outline-none",e),...t}));g.displayName="TabsContent";var b=s(40443),j=s(76081),w=s(35821),k=s(10926),N=s(76050),y=s(34309),S=s(59706),C=s(34041),$=s(76265),A=s(45894),I=s(26463),E=s(96249),_=s(58299),M=s(56050),L=s(23555),R=s(60527),D=s(58588),F=s(99844),P=s(5881),q=s(72410);let T=(0,n.default)(()=>s.e(2084).then(s.bind(s,32084)).then(e=>e.SessionDiff),{loadableGenerated:{webpack:()=>[32084]},loading:()=>(0,a.jsx)("div",{className:"flex h-32 items-center justify-center text-[12px] text-[var(--vk-text-muted)]",children:"Loading changes…"}),ssr:!1});function U({text:e}){let[t,s]=(0,i.useState)(!1);async function n(){try{await navigator.clipboard.writeText(e),s(!0),window.setTimeout(()=>s(!1),1400)}catch{}}return(0,a.jsxs)("button",{type:"button",onClick:()=>void n(),className:"inline-flex max-w-[180px] items-center gap-1 font-mono text-[11px] text-[var(--vk-text-muted)] transition-colors hover:text-[var(--vk-text-normal)]",children:[(0,a.jsx)("span",{className:"truncate",children:e}),t?(0,a.jsx)(y.A,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,a.jsx)(S.A,{className:"h-3 w-3 shrink-0 opacity-50"})]})}function O(e,t){let s=e.metadata[t];return"string"==typeof s&&s.trim().length>0?s:void 0}function z(e){if(!e)return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null}function W({node:e,depth:t,selectedPath:s,expandedDirs:n,onToggleDir:i,onSelectFile:l}){let r=n.has(e.path),c=e.path===s,o=8+16*t;return e.isDir?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(e.path),className:"flex w-full items-center gap-1.5 py-1.5 text-left text-[12px] text-[var(--vk-text-muted)] hover:bg-white/4 active:bg-white/6",style:{paddingLeft:o},children:[r?(0,a.jsx)(C.A,{className:"h-3 w-3 shrink-0 opacity-50"}):(0,a.jsx)($.A,{className:"h-3 w-3 shrink-0 opacity-50"}),r?(0,a.jsx)(A.A,{className:"h-3.5 w-3.5 shrink-0 text-amber-400/70"}):(0,a.jsx)(I.A,{className:"h-3.5 w-3.5 shrink-0 text-amber-400/70"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]}),r?e.children.map(e=>(0,a.jsx)(W,{node:e,depth:t+1,selectedPath:s,expandedDirs:n,onToggleDir:i,onSelectFile:l},e.path)):null]}):(0,a.jsxs)("button",{type:"button",onClick:()=>l(e.path),className:`flex w-full items-center gap-1.5 py-1.5 pr-2 text-left text-[12px] transition-colors ${c?"bg-blue-500/10 text-[var(--vk-text-strong)]":"text-[var(--vk-text-normal)] hover:bg-white/4"}`,style:{paddingLeft:o+16},children:[(0,a.jsx)(E.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]})}let B={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",mjs:"javascript",cjs:"javascript",mts:"typescript",cts:"typescript",html:"html",htm:"html",css:"css",scss:"scss",sass:"sass",less:"less",vue:"vue",svelte:"svelte",astro:"astro",json:"json",jsonc:"jsonc",json5:"json5",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",xml:"xml",svg:"xml",plist:"xml",csv:"csv",tsv:"csv",md:"markdown",mdx:"mdx",tex:"latex",rst:"rst",rs:"rust",go:"go",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",hh:"cpp",cs:"csharp",java:"java",kt:"kotlin",kts:"kotlin",scala:"scala",swift:"swift",m:"objective-c",mm:"objective-cpp",zig:"zig",nim:"nim",v:"v",d:"d",py:"python",pyi:"python",rb:"ruby",php:"php",pl:"perl",pm:"perl",lua:"lua",r:"r",R:"r",jl:"julia",ex:"elixir",exs:"elixir",erl:"erlang",hrl:"erlang",hs:"haskell",lhs:"haskell",clj:"clojure",cljs:"clojure",ml:"ocaml",mli:"ocaml",fs:"fsharp",fsx:"fsharp",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",ps1:"powershell",psm1:"powershell",bat:"bat",cmd:"bat",dockerfile:"dockerfile",containerfile:"dockerfile",tf:"hcl",hcl:"hcl",nix:"nix",sql:"sql",graphql:"graphql",gql:"graphql",prisma:"prisma",proto:"protobuf",thrift:"thrift",makefile:"makefile",cmake:"cmake",asm:"asm",s:"asm",diff:"diff",patch:"diff",log:"log",txt:"plaintext",env:"dotenv",lock:"json"},Z={makefile:"makefile",Makefile:"makefile",dockerfile:"dockerfile",Dockerfile:"dockerfile",containerfile:"dockerfile",Containerfile:"dockerfile",gemfile:"ruby",Gemfile:"ruby",rakefile:"ruby",Rakefile:"ruby",cmakelists:"cmake",CMakeLists:"cmake",".gitignore":"gitignore",".dockerignore":"gitignore",".editorconfig":"ini",".prettierrc":"json",".eslintrc":"json",".babelrc":"json",".env":"dotenv",".env.local":"dotenv",".env.production":"dotenv","tsconfig.json":"jsonc","jsconfig.json":"jsonc"},G=new Set(["png","jpg","jpeg","gif","webp","svg","ico","bmp","avif"]);function K(e){let t=e.split("/").pop()??"",s=t.lastIndexOf(".");return s>=0?t.slice(s+1).toLowerCase():""}function V({code:e,lang:t}){let[n,l]=(0,i.useState)(null),r=(0,i.useRef)(e),c=(0,i.useRef)(t);if((0,i.useEffect)(()=>{r.current=e,c.current=t;let a=!1;return(async()=>{try{let{codeToHtml:n}=await Promise.all([s.e(9526),s.e(3838)]).then(s.bind(s,13838));if(a)return;let i=await n(e,{lang:t,theme:"github-dark-default"});a||r.current!==e||c.current!==t||l(i)}catch{if(a)return;try{let{codeToHtml:t}=await Promise.all([s.e(9526),s.e(3838)]).then(s.bind(s,13838));if(a)return;let n=await t(e,{lang:"plaintext",theme:"github-dark-default"});a||l(n)}catch{a||l(null)}}})(),()=>{a=!0}},[e,t]),!n){let t=e.split("\n"),s=String(t.length).length;return(0,a.jsx)("div",{className:"inline-block min-w-full align-top",children:(0,a.jsx)("table",{className:"min-w-full border-collapse font-mono text-[11px] leading-5",children:(0,a.jsx)("tbody",{children:t.map((e,t)=>(0,a.jsxs)("tr",{className:"hover:bg-white/3",children:[(0,a.jsx)("td",{className:"select-none whitespace-nowrap border-r border-white/6 px-2 text-right text-[var(--vk-text-muted)] opacity-40",style:{minWidth:`${s+2}ch`},children:t+1}),(0,a.jsx)("td",{className:"whitespace-pre px-3 text-[var(--vk-text-normal)]",children:e||"\xa0"})]},t))})})})}return(0,a.jsx)("div",{className:"shiki-viewer inline-block min-w-full align-top [&_.shiki]:!bg-transparent [&_.shiki]:p-0 [&_code]:text-[11px] [&_code]:leading-5 [&_pre]:!bg-transparent [&_pre]:!p-0",dangerouslySetInnerHTML:{__html:n}})}function J({sessionId:e,filePath:t}){let[s,n]=(0,i.useState)(null),[l,r]=(0,i.useState)(!0),[c,o]=(0,i.useState)(null),[d,u]=(0,i.useState)(!1),[x,m]=(0,i.useState)(!1),[h,p]=(0,i.useState)(0);if((0,i.useEffect)(()=>{let s=!1;r(!0),o(null),n(null),u(!1),m(!1),p(0);let a=new URLSearchParams({path:t});return fetch(`/api/sessions/${encodeURIComponent(e)}/files?${a.toString()}`,{cache:"no-store"}).then(async e=>{if(!e.ok)throw Error(`Failed to load file (${e.status})`);return e.json()}).then(e=>{s||(e.binary?u(!0):n("string"==typeof e.content?e.content:""),m(!!e.truncated),p("number"==typeof e.size?e.size:0))}).catch(e=>{s||o(e instanceof Error?e.message:"Failed to load file")}).finally(()=>{s||r(!1)}),()=>{s=!0}},[e,t]),l)return(0,a.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(_.A,{className:"h-4 w-4 animate-spin"}),"Loading…"]});if(c)return(0,a.jsx)("div",{className:"flex h-full items-center justify-center px-4 text-center text-[12px] text-red-400",children:c});if(d&&G.has(K(t))){let s=new URLSearchParams({path:t,raw:"1"}),n=`/api/sessions/${encodeURIComponent(e)}/files?${s.toString()}`;return(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-4",children:[(0,a.jsx)("img",{src:n,alt:t,className:"max-h-[60vh] max-w-full rounded-md object-contain"}),(0,a.jsxs)("span",{className:"text-[11px] text-[var(--vk-text-muted)]",children:[t.split("/").pop(),h>0?` \xb7 ${H(h)}`:""]})]})}if(d){let e=K(t);return(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 px-4 text-center",children:[(0,a.jsx)("div",{className:"rounded-lg bg-white/4 p-4",children:(0,a.jsx)(E.A,{className:"mx-auto h-8 w-8 text-[var(--vk-text-muted)]"})}),(0,a.jsxs)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:["Binary file",e?` (.${e})`:""," — preview not available"]}),h>0?(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)] opacity-60",children:H(h)}):null]})}let f=function(e){let t=e.split("/").pop()??"";if(Z[t])return Z[t];let s=t.lastIndexOf(".");if(s>=0){let e=t.slice(s+1).toLowerCase();if(B[e])return B[e]}return"plaintext"}(t);return(0,a.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[x?(0,a.jsxs)("div",{className:"shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-1 text-[11px] text-amber-300",children:["File truncated",h>0?` (${H(h)} total)`:""]}):null,(0,a.jsx)("div",{className:"min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain touch-pan-x touch-pan-y py-2",children:(0,a.jsx)(V,{code:s??"",lang:f})})]})}function H(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Q({sessionId:e,active:t}){let[s,n]=(0,i.useState)([]),[l,r]=(0,i.useState)(!0),[c,o]=(0,i.useState)(null),[d,u]=(0,i.useState)(!1),[x,m]=(0,i.useState)(""),[h,p]=(0,i.useState)(null),[f,v]=(0,i.useState)(new Set),g=(0,i.useRef)(!0),b=(0,i.useCallback)(async()=>{try{r(!0);let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/files`,{cache:"no-store"});if(!t.ok)throw Error(`Failed to load files (${t.status})`);let s=await t.json();if(!g.current)return;n(s.files??[]),u(!!s.truncated),o(null)}catch(e){if(!g.current)return;o(e instanceof Error?e.message:"Failed to load files")}finally{g.current&&r(!1)}},[e]);(0,i.useEffect)(()=>(g.current=!0,t&&b(),()=>{g.current=!1}),[t,b]);let j=(0,i.useMemo)(()=>(function(e){let t={name:"",path:"",children:[],isDir:!0};for(let s of e){let e=s.split("/"),a=t,n="";for(let t=0;t<e.length;t++){let s=e[t];n=n?`${n}/${s}`:s;let i=t===e.length-1,l=a.children.find(e=>e.name===s);l||(l={name:s,path:n,children:[],isDir:!i},a.children.push(l)),a=l}}return function e(t){for(let s of(t.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name,void 0,{sensitivity:"base"})),t))s.children.length>0&&e(s.children);return t}(t.children)})(s),[s]),w=(0,i.useMemo)(()=>(function(e,t){if(!t)return e;let s=t.toLowerCase();return function e(t){let a=[];for(let n of t)(function e(t){return!!(t.name.toLowerCase().includes(s)||t.path.toLowerCase().includes(s))||t.children.some(e)})(n)&&(n.isDir?a.push({...n,children:e(n.children)}):a.push(n));return a}(e)})(j,x.trim()),[j,x]);(0,i.useEffect)(()=>{if(x.trim()){let e=new Set;!function t(s){for(let a of s)a.isDir&&(e.add(a.path),t(a.children))}(w),v(e)}},[w,x]);let k=(0,i.useCallback)(e=>{v(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),N=(0,i.useCallback)(e=>{p(e)},[]),y=(0,i.useCallback)(()=>{p(null)},[]);if(l&&0===s.length)return(0,a.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(_.A,{className:"h-4 w-4 animate-spin"}),"Loading workspace files…"]});if(c)return(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[(0,a.jsx)("p",{className:"text-[12px] text-red-400",children:c}),(0,a.jsx)("button",{type:"button",onClick:()=>void b(),className:"text-[11px] text-[var(--vk-text-muted)] underline hover:text-[var(--vk-text-normal)]",children:"Retry"})]});let S=h?(0,a.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col lg:hidden",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-white/8 px-2 py-2",children:[(0,a.jsx)("button",{type:"button",onClick:y,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[var(--vk-text-muted)] hover:bg-white/6","aria-label":"Back to file list",children:(0,a.jsx)(M.A,{className:"h-4 w-4"})}),(0,a.jsx)(E.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate font-mono text-[11px] text-[var(--vk-text-strong)]",children:h})]}),(0,a.jsx)("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:(0,a.jsx)(J,{sessionId:e,filePath:h})})]}):null;return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto overscroll-contain lg:overflow-hidden",children:[S,(0,a.jsxs)("div",{className:`flex shrink-0 items-center gap-2 border-b border-white/8 px-2 py-1.5 ${h?"hidden lg:flex":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-md bg-white/4 px-2 py-1.5",children:[(0,a.jsx)(L.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{type:"text",value:x,onChange:e=>m(e.target.value),placeholder:"Search files…",className:"min-w-0 flex-1 bg-transparent text-[12px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>void b(),disabled:l,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[var(--vk-text-muted)] hover:bg-white/6 disabled:opacity-50","aria-label":"Refresh files",children:(0,a.jsx)(R.A,{className:`h-3.5 w-3.5 ${l?"animate-spin":""}`})})]}),d?(0,a.jsx)("div",{className:`shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-1.5 text-[11px] text-amber-300 ${h?"hidden lg:block":""}`,children:"File list truncated (4000 file limit)"}):null,(0,a.jsxs)("div",{className:`min-h-0 flex-1 lg:flex lg:flex-row ${h?"hidden lg:flex":"flex flex-col"}`,children:[(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain py-1 lg:max-w-[320px] lg:border-r lg:border-white/8",children:0===w.length?(0,a.jsx)("div",{className:"px-3 py-6 text-center text-[12px] text-[var(--vk-text-muted)]",children:x?"No files match your search.":"No files in workspace."}):w.map(e=>(0,a.jsx)(W,{node:e,depth:0,selectedPath:h,expandedDirs:f,onToggleDir:k,onSelectFile:N},e.path))}),(0,a.jsx)("div",{className:"hidden min-h-0 min-w-0 flex-1 lg:block",children:h?(0,a.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-white/8 px-3 py-2",children:[(0,a.jsx)(E.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate font-mono text-[11px] text-[var(--vk-text-strong)]",children:h})]}),(0,a.jsx)("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:(0,a.jsx)(J,{sessionId:e,filePath:h})})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-[12px] text-[var(--vk-text-muted)]",children:"Select a file to view its contents"})})]})]})}function X({session:e,sessionId:t,active:s}){let[n,l]=(0,i.useState)("changes"),r=(0,i.useMemo)(()=>O(e,"task")??O(e,"prompt")??("string"==typeof e.task?e.task:"")??("string"==typeof e.prompt?e.prompt:""),[e]),c=(0,i.useMemo)(()=>O(e,"agent")??("string"==typeof e.agent?e.agent:""),[e]),o=(0,i.useMemo)(()=>(function(e,t){if(!e||!t)return"";let s=new Date(e).getTime(),a=new Date(t).getTime();if(!Number.isFinite(s)||!Number.isFinite(a)||a<s)return"";let n=Math.floor((a-s)/6e4);if(n<1)return"<1m";if(n<60)return`${n}m`;let i=Math.floor(n/60);return`${i}h ${n%60}m`})(O(e,"startedAt")??e.startedAt,O(e,"finishedAt")??e.finishedAt),[e]),d=(0,i.useMemo)(()=>(function(e){if("number"==typeof e.cost)return e.cost;let t=e.metadata.cost;if("string"!=typeof t)return 0;try{let e=JSON.parse(t),s="number"==typeof e.estimatedCostUsd?e.estimatedCostUsd:0,a="number"==typeof e.totalUSD?e.totalUSD:0;return s??a}catch{return 0}})(e),[e]),u=(0,i.useMemo)(()=>z(O(e,"queuePosition")),[e]),x=(0,i.useMemo)(()=>z(O(e,"queueDepth")),[e]),m=(0,i.useMemo)(()=>O(e,"recoveryState")??"",[e]),h=(0,i.useMemo)(()=>"queued"===e.status?u?`Waiting in queue at position ${u}${x?` of ${x}`:""}.`:"Waiting in the launch queue.":"requeued_after_restart"===m?"Session recovered after backend restart and requeued.":"reattach_pending"===m?"Recovering terminal runtime after backend restart.":"detached_runtime"===m?"Backend restarted while agent may still be running.":"resume_required"===m?"Session recovered after restart. Send a message to resume.":"",[x,u,m,e.status]);return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto overscroll-contain lg:overflow-hidden",children:[h?(0,a.jsx)("div",{className:"shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-2",children:(0,a.jsx)("p",{className:"text-[12px] leading-snug text-amber-300",children:h})}):null,r?(0,a.jsx)("div",{className:"shrink-0 border-b border-white/8 px-3 py-2.5",children:(0,a.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap text-[13px] leading-relaxed text-[var(--vk-text-normal)]",children:r})}):null,(0,a.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-1 border-b border-white/8 px-3 py-2 text-[11px] text-[var(--vk-text-muted)]",children:[c?(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(q.N,{seed:{label:c},className:"h-4 w-4"}),(0,a.jsx)("span",{children:c})]}):null,e.branch?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(D.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)(U,{text:e.branch})]}):null,o?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(F.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{children:o})]}):null,d>0?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(P.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsxs)("span",{children:["$",d.toFixed(3)]})]}):null]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-0 border-b border-white/8 px-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>l("changes"),className:`px-3 py-2 text-[12px] font-medium transition-colors ${"changes"===n?"border-b-2 border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-b-2 border-transparent text-[var(--vk-text-muted)] hover:text-[var(--vk-text-normal)]"}`,children:"Changes"}),(0,a.jsx)("button",{type:"button",onClick:()=>l("files"),className:`px-3 py-2 text-[12px] font-medium transition-colors ${"files"===n?"border-b-2 border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-b-2 border-transparent text-[var(--vk-text-muted)] hover:text-[var(--vk-text-normal)]"}`,children:"Files"})]}),(0,a.jsx)("div",{className:"min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain",children:"changes"===n?(0,a.jsx)(T,{sessionId:t,active:s},t):(0,a.jsx)(Q,{sessionId:t,active:s&&"files"===n})})]})}var Y=s(40448),ee=s(50549),et=s(26083),es=s(31404),ea=s(59207);let en="block h-5 w-5 shrink-0 object-contain",ei=[{id:"finder",label:"Finder"},{id:"cursor",label:"Cursor"},{id:"antigravity",label:"Antigravity"},{id:"windsurf",label:"Windsurf"},{id:"zed",label:"Zed"},{id:"xcode",label:"Xcode"},{id:"vscode",label:"VS Code"},{id:"vscode-insiders",label:"VS Code Insiders"},{id:"intellij-idea",label:"IntelliJ IDEA"},{id:"custom",label:"Custom"}],el={finder:{kind:"image",imageSrc:"/icons/ide/finder.svg",className:en},vscode:{kind:"image",imageSrc:"/icons/ide/vscode-dark.svg",className:en},"vscode-insiders":{kind:"image",imageSrc:"/icons/ide/vscode-insiders.svg",className:en},cursor:{kind:"image",imageSrc:"/icons/ide/cursor-dark.svg",className:en},windsurf:{kind:"image",imageSrc:"/icons/ide/windsurf-dark.svg",className:en},"intellij-idea":{kind:"image",imageSrc:"/icons/ide/intellij.svg",className:en},zed:{kind:"image",imageSrc:"/icons/ide/zed-dark.svg",className:en},xcode:{kind:"image",imageSrc:"/icons/ide/xcode.svg",className:en},antigravity:{kind:"image",imageSrc:"/icons/ide/antigravity-dark.svg",className:en},custom:{kind:"icon",className:`${en} text-[var(--vk-text-muted)]`}};function er({editorId:e,label:t}){let s=el[e];return s?"icon"===s.kind?(0,a.jsx)(ee.A,{className:s?.className??`${en} text-[var(--vk-text-muted)]`}):(0,a.jsx)("img",{src:s.imageSrc,alt:`${t} logo`,className:s.className}):(0,a.jsx)(ee.A,{className:`${en} text-[var(--vk-text-muted)]`})}function ec({projectId:e,bridgeId:t,label:s="Open",triggerClassName:n}){let{preferences:l}=(0,ea.g)(t),[r,c]=(0,i.useState)(null),o=(0,i.useMemo)(()=>{var e;return e=l?.ide??"vscode",ei.find(t=>t.id===e)??{id:e,label:e}},[l?.ide]);async function d(s){if(e&&!r){c(s);try{let a=await fetch((0,es.S)(`/api/projects/${encodeURIComponent(e)}/open`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ide:s})}),n=await a.json().catch(()=>null);if(!a.ok)throw Error(n?.error??`Failed to open project (${a.status})`)}catch(e){window.alert(e instanceof Error?e.message:"Failed to open project")}finally{c(null)}}}return(0,a.jsxs)(Y.bL,{children:[(0,a.jsx)(Y.l9,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",disabled:!e||null!==r,className:(0,h.cn)("inline-flex h-9 items-center gap-2 rounded-[6px] border border-[rgba(255,255,255,0.08)] bg-[rgba(255,255,255,0.03)] px-3 text-[13px] text-[var(--vk-text-normal)] transition hover:bg-[rgba(255,255,255,0.06)] disabled:cursor-not-allowed disabled:opacity-60",n),"aria-label":"Open project in code editor",title:e?`Open project in ${o.label}`:"No project selected",children:[r?(0,a.jsx)(_.A,{className:"h-4 w-4 animate-spin text-current"}):(0,a.jsx)(et.A,{className:"h-4 w-4 text-current"}),(0,a.jsx)("span",{className:"hidden font-medium sm:inline",children:s}),(0,a.jsx)(C.A,{className:"h-3.5 w-3.5 text-current"})]})}),(0,a.jsx)(Y.ZL,{children:(0,a.jsx)(Y.UC,{align:"end",sideOffset:8,className:"z-50 min-w-[240px] rounded-[8px] border border-[rgba(255,255,255,0.08)] bg-[#1c1a19] p-2 shadow-[0_18px_50px_rgba(0,0,0,0.45)]",children:ei.map(e=>(0,a.jsxs)(Y.q7,{onSelect:()=>void d(e.id),className:"flex min-h-[44px] cursor-default items-center gap-3 rounded-[6px] px-3 py-2 text-[14px] text-[#f3efea] outline-none transition hover:bg-[rgba(255,255,255,0.06)] focus:bg-[rgba(255,255,255,0.06)]",children:[(0,a.jsx)(er,{editorId:e.id,label:e.label}),(0,a.jsx)("span",{className:"flex-1",children:e.label}),o.id===e.id?(0,a.jsx)(y.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}):null]},e.id))})})]})}let eo=(0,n.default)(()=>s.e(9542).then(s.bind(s,39542)).then(e=>e.SessionTerminal),{loadableGenerated:{webpack:()=>[39542]},loading:()=>(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading terminal..."})}),ed=(0,n.default)(()=>Promise.all([s.e(307),s.e(2799)]).then(s.bind(s,22799)).then(e=>e.SessionPreview),{loadableGenerated:{webpack:()=>[22799]},loading:()=>(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading preview..."})}),eu=(0,n.default)(()=>s.e(1874).then(s.bind(s,81874)).then(e=>e.SessionSkills),{loadableGenerated:{webpack:()=>[81874]},loading:()=>(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading skills..."})}),ex=(0,n.default)(()=>Promise.all([s.e(9526),s.e(2651),s.e(6183),s.e(9847)]).then(s.bind(s,56183)).then(e=>e.DispatcherPane),{loadableGenerated:{webpack:()=>[56183]},loading:()=>(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading dispatcher..."})});function em(e,t){let s=(0,N.tK)(t);return"overview"===e||"preview"===e||"skills"===e?e:"dispatcher"===e||"terminal"===e?"dispatcher"===s?"dispatcher":"terminal":s}function eh({sessionId:e,initialSession:t=null,bridgeId:s=null,immersiveMobileMode:n=!1,active:m=!0,suppressPreviewAutoOpen:h=!1,onOpenSidebar:y}){let S=(0,l.usePathname)(),C=(0,l.useRouter)(),$=(0,l.useSearchParams)(),{session:A,loading:I,error:E}=(0,w.w)(e,t,{enabled:m,bridgeId:s}),_=(0,i.useRef)(0),M=(0,i.useRef)(!1),[L,R]=(0,i.useState)(null),D=(0,i.useMemo)(()=>em($.get("tab"),A),[$,A]),F=(0,i.useCallback)(e=>{let t=em(e,A),s=(0,N.tK)(A),a=new URLSearchParams($.toString());t===s?a.delete("tab"):a.set("tab",t);let n=a.toString(),i=n.length>0?`${S}?${n}`:S;C.replace(i,{scroll:!1})},[S,C,$,A]);(0,i.useEffect)(()=>{if(!A)return;let e=$.get("tab"),t=em(e,A),s=t===(0,N.tK)(A)?null:t;if((e?.trim()?e:null)===s)return;let a=new URLSearchParams($.toString());s?a.set("tab",s):a.delete("tab");let n=a.toString(),i=n.length>0?`${S}?${n}`:S;C.replace(i,{scroll:!1})},[S,C,$,A]);let P=(0,i.useCallback)(e=>{_.current+=1,R({nonce:_.current,...e})},[]);(0,i.useEffect)(()=>{M.current=!1,_.current=0,R(null)},[e]);let q=(0,i.useCallback)(e=>{(function({active:e,activeTab:t,alreadyOpened:s,connected:a,suppressAutoOpen:n}){return a&&e&&"terminal"===t&&!s&&!n})({active:m,activeTab:D,alreadyOpened:M.current,connected:e,suppressAutoOpen:h})&&(M.current=!0,F("preview"))},[m,D,F,h]);if(I)return(0,a.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,a.jsx)(b.Zp,{className:"w-full max-w-md",children:(0,a.jsx)(b.Wu,{className:"py-7 text-center text-[13px] text-[var(--text-muted)]",children:"Loading session workspace..."})})});if(E)return(0,a.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,a.jsx)(b.Zp,{className:"w-full max-w-md border-[color:color-mix(in_srgb,var(--status-error)_45%,transparent)]",children:(0,a.jsx)(b.Wu,{className:"py-7 text-center text-[13px] text-[var(--status-error)]",children:E})})});if(!A)return(0,a.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,a.jsx)(b.Zp,{className:"w-full max-w-md",children:(0,a.jsx)(b.Wu,{className:"py-7 text-center text-[13px] text-[var(--text-muted)]",children:"Session not found"})})});let T="string"==typeof A.status?A.status:"unknown",U=(0,N.Zu)(A),O=function(e){switch(e){case"needs_input":return"needs input";case"working":return"working";case"running":return"running";case"spawning":return"spawning";case"queued":return"queued";default:return e.replace(/[_-]+/g," ")}}(T),z=function(e){switch(e){case"working":case"running":return"bg-amber-400";case"needs_input":return"bg-blue-400";case"spawning":case"queued":default:return"bg-gray-400";case"done":return"bg-emerald-400";case"errored":return"bg-red-400";case"stuck":return"bg-[var(--vk-accent)]";case"terminated":case"killed":return"bg-gray-500"}}(T),W="working"===T||"running"===T||"spawning"===T||"queued"===T||"needs_input"===T,B="queued"!==T&&"spawning"!==T,Z=m&&n&&"terminal"===D,G=m&&"preview"===D,K="min-h-[38px] gap-1.5 px-2.5 text-[12px] sm:min-h-0 sm:px-3",V=(0,i.useMemo)(()=>(0,k.kV)(e).slice(0,7),[e]),J=(0,a.jsxs)(f,{className:"flex w-full overflow-x-auto sm:w-fit sm:inline-flex",children:[(0,a.jsxs)(v,{value:"overview",className:K,children:[(0,a.jsx)(r.A,{className:"h-3.5 w-3.5"}),"Overview"]}),U?(0,a.jsxs)(v,{value:"dispatcher",className:K,children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"}),"Dispatcher"]}):(0,a.jsxs)(v,{value:"terminal",className:K,children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),"Terminal"]}),(0,a.jsxs)(v,{value:"preview",className:K,children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5"}),"Preview"]}),(0,a.jsxs)(v,{value:"skills",className:K,children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Skills"]})]});return(0,a.jsx)("div",{className:`flex h-full min-h-0 min-w-0 w-full flex-col ${Z?"overflow-hidden bg-[#060404]":"overflow-y-auto overscroll-contain lg:overflow-hidden"}`,children:(0,a.jsxs)(p,{value:D,onValueChange:F,className:Z?"flex min-h-0 min-w-0 w-full flex-1 flex-col gap-0 p-0":"flex min-h-0 min-w-0 w-full flex-1 flex-col gap-1 p-1 lg:gap-2 lg:p-3",children:[Z?(0,a.jsxs)("div",{className:"flex shrink-0 flex-col border-b border-white/10 bg-[#0d0908]",children:[(0,a.jsxs)("div",{className:"flex h-10 items-center gap-2 px-2",children:[y?(0,a.jsx)(j.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-[#8e847d] hover:text-[#c9c0b7]",onClick:y,"aria-label":"Open workspace panel",children:(0,a.jsx)(x.A,{className:"h-4 w-4"})}):null,(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[(0,a.jsx)("span",{className:`inline-block h-2 w-2 shrink-0 rounded-full ${z}${W?" animate-pulse":""}`}),(0,a.jsx)("span",{className:"text-[12px] font-medium text-[#efe8e1]",children:O}),(0,a.jsxs)("span",{className:"font-mono text-[10px] text-[#8e847d]",children:["\xb7 ",V]})]}),B?(0,a.jsx)(ec,{projectId:A.projectId,bridgeId:A.bridgeId??null}):null]}),(0,a.jsx)("div",{className:"px-1.5 pb-1.5",children:J})]}):(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1.5 sm:flex-nowrap",children:[J,(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:ml-auto sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:`inline-block h-2 w-2 shrink-0 rounded-full ${z}${W?" animate-pulse":""}`}),(0,a.jsx)("span",{className:"text-[11px] text-[var(--vk-text-muted)]",children:O}),(0,a.jsxs)("span",{className:"hidden font-mono text-[10px] text-[var(--vk-text-muted)] sm:inline",children:["\xb7 ",V]})]}),B?(0,a.jsx)(ec,{projectId:A.projectId,bridgeId:A.bridgeId??null}):null]})]}),(0,a.jsxs)("div",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden",children:[(0,a.jsx)(g,{value:"overview",className:"min-h-0 h-full min-w-0 w-full overflow-hidden focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:(0,a.jsx)(X,{session:A,sessionId:e,active:m&&"overview"===D})}),U?(0,a.jsx)(g,{value:"dispatcher",forceMount:!0,className:"min-h-0 h-full min-w-0 w-full overflow-hidden focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:(0,a.jsx)(ex,{thread:A,projectId:A.projectId,bridgeId:A.bridgeId??s,className:"h-full w-full border-0 xl:w-full"})}):(0,a.jsx)(g,{value:"terminal",forceMount:!0,className:Z?"flex min-h-0 h-full min-w-0 w-full flex-col overflow-hidden bg-[#060404] focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0":"flex min-h-0 h-full min-w-0 flex-col w-full overflow-hidden bg-transparent focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:(0,a.jsx)(eo,{sessionId:e,projectId:A.projectId,bridgeId:A.bridgeId??null,sessionState:T,runtimeMode:A.metadata.runtimeMode?.trim()??null,pendingInsert:L,immersiveMobileMode:Z,onPendingInsertConsumed:()=>R(null)})}),(0,a.jsx)(g,{value:"preview",className:"min-h-0 h-full min-w-0 w-full overflow-hidden focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:G?(0,a.jsx)(ed,{sessionId:e,active:G,onQueueTerminalInsert:P,onConnectionChange:q},e):null}),(0,a.jsx)(g,{value:"skills",className:"min-h-0 h-full min-w-0 w-full overflow-hidden focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:(0,a.jsx)(eu,{session:A,sessionId:e,active:m&&"skills"===D})})]})]},e)})}},40443:(e,t,s)=>{s.d(t,{Wu:()=>r,Zp:()=>i,aR:()=>l});var a=s(54568),n=s(46916);let i=(0,s(7620).forwardRef)(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,n.cn)("surface-card rounded-[var(--radius-md)] border",e),...t}));function l({className:e,...t}){return(0,a.jsx)("div",{className:(0,n.cn)("flex items-center gap-2 border-b border-[var(--vk-border)] px-3 py-2",e),...t})}function r({className:e,...t}){return(0,a.jsx)("div",{className:(0,n.cn)("px-3 py-2",e),...t})}i.displayName="Card"},59207:(e,t,s)=>{s.d(t,{g:()=>l});var a=s(7620),n=s(31404);function i(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function l(e,t){let s=t?.enabled??!0,[l,r]=(0,a.useState)(null),[c,o]=(0,a.useState)(s),[d,u]=(0,a.useState)(null),x=(0,a.useCallback)(async()=>{if(!s){r(null),u(null),o(!1);return}try{var t;let s,a,l,c=await fetch((0,n.S)("/api/preferences",e)),o=await c.json().catch(()=>null);if(!c.ok)throw Error(o?.error??o?.reason??`Failed to load preferences: ${c.status}`);r((t=o?.preferences,s=i(t),l=(a=i(s.notifications)).soundFile,{onboardingAcknowledged:!0===s.onboardingAcknowledged,codingAgent:"string"==typeof s.codingAgent&&s.codingAgent.trim().length>0?s.codingAgent.trim():"claude-code",ide:"string"==typeof s.ide&&s.ide.trim().length>0?s.ide.trim():"vscode",markdownEditor:"string"==typeof s.markdownEditor&&s.markdownEditor.trim().length>0?s.markdownEditor.trim():"obsidian",markdownEditorPath:"string"==typeof s.markdownEditorPath?s.markdownEditorPath.trim():"",notifications:{soundEnabled:!1!==a.soundEnabled,soundFile:null===l?null:"string"==typeof l&&l.trim().length>0?l.trim():"abstract-sound-4"}})),u(null)}catch(e){r(null),u(e instanceof Error?e.message:"Failed to load preferences")}finally{o(!1)}},[e,s]);return(0,a.useEffect)(()=>{s&&x()},[s,x]),{preferences:s?l:null,loading:!!s&&c,error:s?d:null,refresh:x}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4997],{4997:(e,t,s)=>{s.r(t),s.d(t,{SessionDetail:()=>eh});var a=s(54568),n=s(42925),i=s(7620),l=s(79748),r=s(7920),c=s(46548),o=s(69863),d=s(97380),u=s(41007),x=s(90466),m=s(35131),h=s(46916);let p=m.bL,f=(0,i.forwardRef)(({className:e,...t},s)=>(0,a.jsx)(m.B8,{ref:s,className:(0,h.cn)("inline-flex max-w-full items-center gap-0.5 overflow-x-auto rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-0.5 whitespace-nowrap touch-pan-x [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e),...t}));f.displayName="TabsList";let v=(0,i.forwardRef)(({className:e,...t},s)=>(0,a.jsx)(m.l9,{ref:s,className:(0,h.cn)("inline-flex min-h-[34px] shrink-0 items-center gap-1.5 rounded-[3px] px-2.5 py-1.5 text-[12px] text-[var(--vk-text-muted)]","data-[state=active]:bg-[var(--vk-bg-active)] data-[state=active]:text-[var(--vk-text-normal)]","hover:text-[var(--vk-text-normal)]","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--vk-orange)]",e),...t}));v.displayName="TabsTrigger";let g=(0,i.forwardRef)(({className:e,...t},s)=>(0,a.jsx)(m.UC,{ref:s,className:(0,h.cn)("focus-visible:outline-none",e),...t}));g.displayName="TabsContent";var b=s(40443),j=s(76081),w=s(35821),k=s(10926),N=s(76050),y=s(34309),S=s(59706),C=s(34041),$=s(76265),A=s(45894),I=s(26463),E=s(96249),_=s(58299),M=s(56050),L=s(23555),R=s(60527),D=s(58588),F=s(99844),P=s(5881),q=s(72410);let T=(0,n.default)(()=>s.e(2084).then(s.bind(s,32084)).then(e=>e.SessionDiff),{loadableGenerated:{webpack:()=>[32084]},loading:()=>(0,a.jsx)("div",{className:"flex h-32 items-center justify-center text-[12px] text-[var(--vk-text-muted)]",children:"Loading changes…"}),ssr:!1});function U({text:e}){let[t,s]=(0,i.useState)(!1);async function n(){try{await navigator.clipboard.writeText(e),s(!0),window.setTimeout(()=>s(!1),1400)}catch{}}return(0,a.jsxs)("button",{type:"button",onClick:()=>void n(),className:"inline-flex max-w-[180px] items-center gap-1 font-mono text-[11px] text-[var(--vk-text-muted)] transition-colors hover:text-[var(--vk-text-normal)]",children:[(0,a.jsx)("span",{className:"truncate",children:e}),t?(0,a.jsx)(y.A,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,a.jsx)(S.A,{className:"h-3 w-3 shrink-0 opacity-50"})]})}function O(e,t){let s=e.metadata[t];return"string"==typeof s&&s.trim().length>0?s:void 0}function z(e){if(!e)return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null}function W({node:e,depth:t,selectedPath:s,expandedDirs:n,onToggleDir:i,onSelectFile:l}){let r=n.has(e.path),c=e.path===s,o=8+16*t;return e.isDir?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(e.path),className:"flex w-full items-center gap-1.5 py-1.5 text-left text-[12px] text-[var(--vk-text-muted)] hover:bg-white/4 active:bg-white/6",style:{paddingLeft:o},children:[r?(0,a.jsx)(C.A,{className:"h-3 w-3 shrink-0 opacity-50"}):(0,a.jsx)($.A,{className:"h-3 w-3 shrink-0 opacity-50"}),r?(0,a.jsx)(A.A,{className:"h-3.5 w-3.5 shrink-0 text-amber-400/70"}):(0,a.jsx)(I.A,{className:"h-3.5 w-3.5 shrink-0 text-amber-400/70"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]}),r?e.children.map(e=>(0,a.jsx)(W,{node:e,depth:t+1,selectedPath:s,expandedDirs:n,onToggleDir:i,onSelectFile:l},e.path)):null]}):(0,a.jsxs)("button",{type:"button",onClick:()=>l(e.path),className:`flex w-full items-center gap-1.5 py-1.5 pr-2 text-left text-[12px] transition-colors ${c?"bg-blue-500/10 text-[var(--vk-text-strong)]":"text-[var(--vk-text-normal)] hover:bg-white/4"}`,style:{paddingLeft:o+16},children:[(0,a.jsx)(E.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]})}let B={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",mjs:"javascript",cjs:"javascript",mts:"typescript",cts:"typescript",html:"html",htm:"html",css:"css",scss:"scss",sass:"sass",less:"less",vue:"vue",svelte:"svelte",astro:"astro",json:"json",jsonc:"jsonc",json5:"json5",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",xml:"xml",svg:"xml",plist:"xml",csv:"csv",tsv:"csv",md:"markdown",mdx:"mdx",tex:"latex",rst:"rst",rs:"rust",go:"go",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",hh:"cpp",cs:"csharp",java:"java",kt:"kotlin",kts:"kotlin",scala:"scala",swift:"swift",m:"objective-c",mm:"objective-cpp",zig:"zig",nim:"nim",v:"v",d:"d",py:"python",pyi:"python",rb:"ruby",php:"php",pl:"perl",pm:"perl",lua:"lua",r:"r",R:"r",jl:"julia",ex:"elixir",exs:"elixir",erl:"erlang",hrl:"erlang",hs:"haskell",lhs:"haskell",clj:"clojure",cljs:"clojure",ml:"ocaml",mli:"ocaml",fs:"fsharp",fsx:"fsharp",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",ps1:"powershell",psm1:"powershell",bat:"bat",cmd:"bat",dockerfile:"dockerfile",containerfile:"dockerfile",tf:"hcl",hcl:"hcl",nix:"nix",sql:"sql",graphql:"graphql",gql:"graphql",prisma:"prisma",proto:"protobuf",thrift:"thrift",makefile:"makefile",cmake:"cmake",asm:"asm",s:"asm",diff:"diff",patch:"diff",log:"log",txt:"plaintext",env:"dotenv",lock:"json"},Z={makefile:"makefile",Makefile:"makefile",dockerfile:"dockerfile",Dockerfile:"dockerfile",containerfile:"dockerfile",Containerfile:"dockerfile",gemfile:"ruby",Gemfile:"ruby",rakefile:"ruby",Rakefile:"ruby",cmakelists:"cmake",CMakeLists:"cmake",".gitignore":"gitignore",".dockerignore":"gitignore",".editorconfig":"ini",".prettierrc":"json",".eslintrc":"json",".babelrc":"json",".env":"dotenv",".env.local":"dotenv",".env.production":"dotenv","tsconfig.json":"jsonc","jsconfig.json":"jsonc"},G=new Set(["png","jpg","jpeg","gif","webp","svg","ico","bmp","avif"]);function K(e){let t=e.split("/").pop()??"",s=t.lastIndexOf(".");return s>=0?t.slice(s+1).toLowerCase():""}function V({code:e,lang:t}){let[n,l]=(0,i.useState)(null),r=(0,i.useRef)(e),c=(0,i.useRef)(t);if((0,i.useEffect)(()=>{r.current=e,c.current=t;let a=!1;return(async()=>{try{let{codeToHtml:n}=await Promise.all([s.e(9526),s.e(3838)]).then(s.bind(s,13838));if(a)return;let i=await n(e,{lang:t,theme:"github-dark-default"});a||r.current!==e||c.current!==t||l(i)}catch{if(a)return;try{let{codeToHtml:t}=await Promise.all([s.e(9526),s.e(3838)]).then(s.bind(s,13838));if(a)return;let n=await t(e,{lang:"plaintext",theme:"github-dark-default"});a||l(n)}catch{a||l(null)}}})(),()=>{a=!0}},[e,t]),!n){let t=e.split("\n"),s=String(t.length).length;return(0,a.jsx)("div",{className:"inline-block min-w-full align-top",children:(0,a.jsx)("table",{className:"min-w-full border-collapse font-mono text-[11px] leading-5",children:(0,a.jsx)("tbody",{children:t.map((e,t)=>(0,a.jsxs)("tr",{className:"hover:bg-white/3",children:[(0,a.jsx)("td",{className:"select-none whitespace-nowrap border-r border-white/6 px-2 text-right text-[var(--vk-text-muted)] opacity-40",style:{minWidth:`${s+2}ch`},children:t+1}),(0,a.jsx)("td",{className:"whitespace-pre px-3 text-[var(--vk-text-normal)]",children:e||"\xa0"})]},t))})})})}return(0,a.jsx)("div",{className:"shiki-viewer inline-block min-w-full align-top [&_.shiki]:!bg-transparent [&_.shiki]:p-0 [&_code]:text-[11px] [&_code]:leading-5 [&_pre]:!bg-transparent [&_pre]:!p-0",dangerouslySetInnerHTML:{__html:n}})}function J({sessionId:e,filePath:t}){let[s,n]=(0,i.useState)(null),[l,r]=(0,i.useState)(!0),[c,o]=(0,i.useState)(null),[d,u]=(0,i.useState)(!1),[x,m]=(0,i.useState)(!1),[h,p]=(0,i.useState)(0);if((0,i.useEffect)(()=>{let s=!1;r(!0),o(null),n(null),u(!1),m(!1),p(0);let a=new URLSearchParams({path:t});return fetch(`/api/sessions/${encodeURIComponent(e)}/files?${a.toString()}`,{cache:"no-store"}).then(async e=>{if(!e.ok)throw Error(`Failed to load file (${e.status})`);return e.json()}).then(e=>{s||(e.binary?u(!0):n("string"==typeof e.content?e.content:""),m(!!e.truncated),p("number"==typeof e.size?e.size:0))}).catch(e=>{s||o(e instanceof Error?e.message:"Failed to load file")}).finally(()=>{s||r(!1)}),()=>{s=!0}},[e,t]),l)return(0,a.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(_.A,{className:"h-4 w-4 animate-spin"}),"Loading…"]});if(c)return(0,a.jsx)("div",{className:"flex h-full items-center justify-center px-4 text-center text-[12px] text-red-400",children:c});if(d&&G.has(K(t))){let s=new URLSearchParams({path:t,raw:"1"}),n=`/api/sessions/${encodeURIComponent(e)}/files?${s.toString()}`;return(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-4",children:[(0,a.jsx)("img",{src:n,alt:t,className:"max-h-[60vh] max-w-full rounded-md object-contain"}),(0,a.jsxs)("span",{className:"text-[11px] text-[var(--vk-text-muted)]",children:[t.split("/").pop(),h>0?` \xb7 ${H(h)}`:""]})]})}if(d){let e=K(t);return(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 px-4 text-center",children:[(0,a.jsx)("div",{className:"rounded-lg bg-white/4 p-4",children:(0,a.jsx)(E.A,{className:"mx-auto h-8 w-8 text-[var(--vk-text-muted)]"})}),(0,a.jsxs)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:["Binary file",e?` (.${e})`:""," — preview not available"]}),h>0?(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)] opacity-60",children:H(h)}):null]})}let f=function(e){let t=e.split("/").pop()??"";if(Z[t])return Z[t];let s=t.lastIndexOf(".");if(s>=0){let e=t.slice(s+1).toLowerCase();if(B[e])return B[e]}return"plaintext"}(t);return(0,a.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[x?(0,a.jsxs)("div",{className:"shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-1 text-[11px] text-amber-300",children:["File truncated",h>0?` (${H(h)} total)`:""]}):null,(0,a.jsx)("div",{className:"min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain touch-pan-x touch-pan-y py-2",children:(0,a.jsx)(V,{code:s??"",lang:f})})]})}function H(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Q({sessionId:e,active:t}){let[s,n]=(0,i.useState)([]),[l,r]=(0,i.useState)(!0),[c,o]=(0,i.useState)(null),[d,u]=(0,i.useState)(!1),[x,m]=(0,i.useState)(""),[h,p]=(0,i.useState)(null),[f,v]=(0,i.useState)(new Set),g=(0,i.useRef)(!0),b=(0,i.useCallback)(async()=>{try{r(!0);let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/files`,{cache:"no-store"});if(!t.ok)throw Error(`Failed to load files (${t.status})`);let s=await t.json();if(!g.current)return;n(s.files??[]),u(!!s.truncated),o(null)}catch(e){if(!g.current)return;o(e instanceof Error?e.message:"Failed to load files")}finally{g.current&&r(!1)}},[e]);(0,i.useEffect)(()=>(g.current=!0,t&&b(),()=>{g.current=!1}),[t,b]);let j=(0,i.useMemo)(()=>(function(e){let t={name:"",path:"",children:[],isDir:!0};for(let s of e){let e=s.split("/"),a=t,n="";for(let t=0;t<e.length;t++){let s=e[t];n=n?`${n}/${s}`:s;let i=t===e.length-1,l=a.children.find(e=>e.name===s);l||(l={name:s,path:n,children:[],isDir:!i},a.children.push(l)),a=l}}return function e(t){for(let s of(t.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name,void 0,{sensitivity:"base"})),t))s.children.length>0&&e(s.children);return t}(t.children)})(s),[s]),w=(0,i.useMemo)(()=>(function(e,t){if(!t)return e;let s=t.toLowerCase();return function e(t){let a=[];for(let n of t)(function e(t){return!!(t.name.toLowerCase().includes(s)||t.path.toLowerCase().includes(s))||t.children.some(e)})(n)&&(n.isDir?a.push({...n,children:e(n.children)}):a.push(n));return a}(e)})(j,x.trim()),[j,x]);(0,i.useEffect)(()=>{if(x.trim()){let e=new Set;!function t(s){for(let a of s)a.isDir&&(e.add(a.path),t(a.children))}(w),v(e)}},[w,x]);let k=(0,i.useCallback)(e=>{v(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),N=(0,i.useCallback)(e=>{p(e)},[]),y=(0,i.useCallback)(()=>{p(null)},[]);if(l&&0===s.length)return(0,a.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-[12px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(_.A,{className:"h-4 w-4 animate-spin"}),"Loading workspace files…"]});if(c)return(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[(0,a.jsx)("p",{className:"text-[12px] text-red-400",children:c}),(0,a.jsx)("button",{type:"button",onClick:()=>void b(),className:"text-[11px] text-[var(--vk-text-muted)] underline hover:text-[var(--vk-text-normal)]",children:"Retry"})]});let S=h?(0,a.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col lg:hidden",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-white/8 px-2 py-2",children:[(0,a.jsx)("button",{type:"button",onClick:y,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[var(--vk-text-muted)] hover:bg-white/6","aria-label":"Back to file list",children:(0,a.jsx)(M.A,{className:"h-4 w-4"})}),(0,a.jsx)(E.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate font-mono text-[11px] text-[var(--vk-text-strong)]",children:h})]}),(0,a.jsx)("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:(0,a.jsx)(J,{sessionId:e,filePath:h})})]}):null;return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto overscroll-contain lg:overflow-hidden",children:[S,(0,a.jsxs)("div",{className:`flex shrink-0 items-center gap-2 border-b border-white/8 px-2 py-1.5 ${h?"hidden lg:flex":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-md bg-white/4 px-2 py-1.5",children:[(0,a.jsx)(L.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{type:"text",value:x,onChange:e=>m(e.target.value),placeholder:"Search files…",className:"min-w-0 flex-1 bg-transparent text-[12px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>void b(),disabled:l,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[var(--vk-text-muted)] hover:bg-white/6 disabled:opacity-50","aria-label":"Refresh files",children:(0,a.jsx)(R.A,{className:`h-3.5 w-3.5 ${l?"animate-spin":""}`})})]}),d?(0,a.jsx)("div",{className:`shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-1.5 text-[11px] text-amber-300 ${h?"hidden lg:block":""}`,children:"File list truncated (4000 file limit)"}):null,(0,a.jsxs)("div",{className:`min-h-0 flex-1 lg:flex lg:flex-row ${h?"hidden lg:flex":"flex flex-col"}`,children:[(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain py-1 lg:max-w-[320px] lg:border-r lg:border-white/8",children:0===w.length?(0,a.jsx)("div",{className:"px-3 py-6 text-center text-[12px] text-[var(--vk-text-muted)]",children:x?"No files match your search.":"No files in workspace."}):w.map(e=>(0,a.jsx)(W,{node:e,depth:0,selectedPath:h,expandedDirs:f,onToggleDir:k,onSelectFile:N},e.path))}),(0,a.jsx)("div",{className:"hidden min-h-0 min-w-0 flex-1 lg:block",children:h?(0,a.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-white/8 px-3 py-2",children:[(0,a.jsx)(E.A,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"truncate font-mono text-[11px] text-[var(--vk-text-strong)]",children:h})]}),(0,a.jsx)("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:(0,a.jsx)(J,{sessionId:e,filePath:h})})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-[12px] text-[var(--vk-text-muted)]",children:"Select a file to view its contents"})})]})]})}function X({session:e,sessionId:t,active:s}){let[n,l]=(0,i.useState)("changes"),r=(0,i.useMemo)(()=>O(e,"task")??O(e,"prompt")??("string"==typeof e.task?e.task:"")??("string"==typeof e.prompt?e.prompt:""),[e]),c=(0,i.useMemo)(()=>O(e,"agent")??("string"==typeof e.agent?e.agent:""),[e]),o=(0,i.useMemo)(()=>(function(e,t){if(!e||!t)return"";let s=new Date(e).getTime(),a=new Date(t).getTime();if(!Number.isFinite(s)||!Number.isFinite(a)||a<s)return"";let n=Math.floor((a-s)/6e4);if(n<1)return"<1m";if(n<60)return`${n}m`;let i=Math.floor(n/60);return`${i}h ${n%60}m`})(O(e,"startedAt")??e.startedAt,O(e,"finishedAt")??e.finishedAt),[e]),d=(0,i.useMemo)(()=>(function(e){if("number"==typeof e.cost)return e.cost;let t=e.metadata.cost;if("string"!=typeof t)return 0;try{let e=JSON.parse(t),s="number"==typeof e.estimatedCostUsd?e.estimatedCostUsd:0,a="number"==typeof e.totalUSD?e.totalUSD:0;return s??a}catch{return 0}})(e),[e]),u=(0,i.useMemo)(()=>z(O(e,"queuePosition")),[e]),x=(0,i.useMemo)(()=>z(O(e,"queueDepth")),[e]),m=(0,i.useMemo)(()=>O(e,"recoveryState")??"",[e]),h=(0,i.useMemo)(()=>"queued"===e.status?u?`Waiting in queue at position ${u}${x?` of ${x}`:""}.`:"Waiting in the launch queue.":"requeued_after_restart"===m?"Session recovered after backend restart and requeued.":"reattach_pending"===m?"Recovering terminal runtime after backend restart.":"detached_runtime"===m?"Backend restarted while agent may still be running.":"resume_required"===m?"Session recovered after restart. Send a message to resume.":"",[x,u,m,e.status]);return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto overscroll-contain lg:overflow-hidden",children:[h?(0,a.jsx)("div",{className:"shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-2",children:(0,a.jsx)("p",{className:"text-[12px] leading-snug text-amber-300",children:h})}):null,r?(0,a.jsx)("div",{className:"shrink-0 border-b border-white/8 px-3 py-2.5",children:(0,a.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap text-[13px] leading-relaxed text-[var(--vk-text-normal)]",children:r})}):null,(0,a.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-1 border-b border-white/8 px-3 py-2 text-[11px] text-[var(--vk-text-muted)]",children:[c?(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(q.N,{seed:{label:c},className:"h-4 w-4"}),(0,a.jsx)("span",{children:c})]}):null,e.branch?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(D.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)(U,{text:e.branch})]}):null,o?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(F.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{children:o})]}):null,d>0?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(P.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsxs)("span",{children:["$",d.toFixed(3)]})]}):null]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-0 border-b border-white/8 px-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>l("changes"),className:`px-3 py-2 text-[12px] font-medium transition-colors ${"changes"===n?"border-b-2 border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-b-2 border-transparent text-[var(--vk-text-muted)] hover:text-[var(--vk-text-normal)]"}`,children:"Changes"}),(0,a.jsx)("button",{type:"button",onClick:()=>l("files"),className:`px-3 py-2 text-[12px] font-medium transition-colors ${"files"===n?"border-b-2 border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-b-2 border-transparent text-[var(--vk-text-muted)] hover:text-[var(--vk-text-normal)]"}`,children:"Files"})]}),(0,a.jsx)("div",{className:"min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain",children:"changes"===n?(0,a.jsx)(T,{sessionId:t,active:s},t):(0,a.jsx)(Q,{sessionId:t,active:s&&"files"===n})})]})}var Y=s(40448),ee=s(50549),et=s(26083),es=s(31404),ea=s(59207);let en="block h-5 w-5 shrink-0 object-contain",ei=[{id:"finder",label:"Finder"},{id:"cursor",label:"Cursor"},{id:"antigravity",label:"Antigravity"},{id:"windsurf",label:"Windsurf"},{id:"zed",label:"Zed"},{id:"xcode",label:"Xcode"},{id:"vscode",label:"VS Code"},{id:"vscode-insiders",label:"VS Code Insiders"},{id:"intellij-idea",label:"IntelliJ IDEA"},{id:"custom",label:"Custom"}],el={finder:{kind:"image",imageSrc:"/icons/ide/finder.svg",className:en},vscode:{kind:"image",imageSrc:"/icons/ide/vscode-dark.svg",className:en},"vscode-insiders":{kind:"image",imageSrc:"/icons/ide/vscode-insiders.svg",className:en},cursor:{kind:"image",imageSrc:"/icons/ide/cursor-dark.svg",className:en},windsurf:{kind:"image",imageSrc:"/icons/ide/windsurf-dark.svg",className:en},"intellij-idea":{kind:"image",imageSrc:"/icons/ide/intellij.svg",className:en},zed:{kind:"image",imageSrc:"/icons/ide/zed-dark.svg",className:en},xcode:{kind:"image",imageSrc:"/icons/ide/xcode.svg",className:en},antigravity:{kind:"image",imageSrc:"/icons/ide/antigravity-dark.svg",className:en},custom:{kind:"icon",className:`${en} text-[var(--vk-text-muted)]`}};function er({editorId:e,label:t}){let s=el[e];return s?"icon"===s.kind?(0,a.jsx)(ee.A,{className:s?.className??`${en} text-[var(--vk-text-muted)]`}):(0,a.jsx)("img",{src:s.imageSrc,alt:`${t} logo`,className:s.className}):(0,a.jsx)(ee.A,{className:`${en} text-[var(--vk-text-muted)]`})}function ec({projectId:e,bridgeId:t,label:s="Open",triggerClassName:n}){let{preferences:l}=(0,ea.g)(t),[r,c]=(0,i.useState)(null),o=(0,i.useMemo)(()=>{var e;return e=l?.ide??"vscode",ei.find(t=>t.id===e)??{id:e,label:e}},[l?.ide]);async function d(s){if(e&&!r){c(s);try{let a=await fetch((0,es.S)(`/api/projects/${encodeURIComponent(e)}/open`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ide:s})}),n=await a.json().catch(()=>null);if(!a.ok)throw Error(n?.error??`Failed to open project (${a.status})`)}catch(e){window.alert(e instanceof Error?e.message:"Failed to open project")}finally{c(null)}}}return(0,a.jsxs)(Y.bL,{children:[(0,a.jsx)(Y.l9,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",disabled:!e||null!==r,className:(0,h.cn)("inline-flex h-9 items-center gap-2 rounded-[6px] border border-[rgba(255,255,255,0.08)] bg-[rgba(255,255,255,0.03)] px-3 text-[13px] text-[var(--vk-text-normal)] transition hover:bg-[rgba(255,255,255,0.06)] disabled:cursor-not-allowed disabled:opacity-60",n),"aria-label":"Open project in code editor",title:e?`Open project in ${o.label}`:"No project selected",children:[r?(0,a.jsx)(_.A,{className:"h-4 w-4 animate-spin text-current"}):(0,a.jsx)(et.A,{className:"h-4 w-4 text-current"}),(0,a.jsx)("span",{className:"hidden font-medium sm:inline",children:s}),(0,a.jsx)(C.A,{className:"h-3.5 w-3.5 text-current"})]})}),(0,a.jsx)(Y.ZL,{children:(0,a.jsx)(Y.UC,{align:"end",sideOffset:8,className:"z-50 min-w-[240px] rounded-[8px] border border-[rgba(255,255,255,0.08)] bg-[#1c1a19] p-2 shadow-[0_18px_50px_rgba(0,0,0,0.45)]",children:ei.map(e=>(0,a.jsxs)(Y.q7,{onSelect:()=>void d(e.id),className:"flex min-h-[44px] cursor-default items-center gap-3 rounded-[6px] px-3 py-2 text-[14px] text-[#f3efea] outline-none transition hover:bg-[rgba(255,255,255,0.06)] focus:bg-[rgba(255,255,255,0.06)]",children:[(0,a.jsx)(er,{editorId:e.id,label:e.label}),(0,a.jsx)("span",{className:"flex-1",children:e.label}),o.id===e.id?(0,a.jsx)(y.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}):null]},e.id))})})]})}let eo=(0,n.default)(()=>s.e(9542).then(s.bind(s,39542)).then(e=>e.SessionTerminal),{loadableGenerated:{webpack:()=>[39542]},loading:()=>(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading terminal..."})}),ed=(0,n.default)(()=>Promise.all([s.e(307),s.e(2799)]).then(s.bind(s,22799)).then(e=>e.SessionPreview),{loadableGenerated:{webpack:()=>[22799]},loading:()=>(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading preview..."})}),eu=(0,n.default)(()=>s.e(1874).then(s.bind(s,81874)).then(e=>e.SessionSkills),{loadableGenerated:{webpack:()=>[81874]},loading:()=>(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading skills..."})}),ex=(0,n.default)(()=>Promise.all([s.e(9526),s.e(2651),s.e(6183),s.e(9847)]).then(s.bind(s,56183)).then(e=>e.DispatcherPane),{loadableGenerated:{webpack:()=>[56183]},loading:()=>(0,a.jsx)("div",{className:"flex h-full min-h-[240px] items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading dispatcher..."})});function em(e,t){let s=(0,N.tK)(t);return"overview"===e||"preview"===e||"skills"===e?e:"dispatcher"===e||"terminal"===e?"dispatcher"===s?"dispatcher":"terminal":s}function eh({sessionId:e,initialSession:t=null,bridgeId:s=null,immersiveMobileMode:n=!1,active:m=!0,suppressPreviewAutoOpen:h=!1,onOpenSidebar:y}){let S=(0,l.usePathname)(),C=(0,l.useRouter)(),$=(0,l.useSearchParams)(),{session:A,loading:I,error:E}=(0,w.w)(e,t,{enabled:m,bridgeId:s}),_=(0,i.useRef)(0),M=(0,i.useRef)(!1),[L,R]=(0,i.useState)(null),D=(0,i.useMemo)(()=>em($.get("tab"),A),[$,A]),F=(0,i.useCallback)(e=>{let t=em(e,A),s=(0,N.tK)(A),a=new URLSearchParams($.toString());t===s?a.delete("tab"):a.set("tab",t);let n=a.toString(),i=n.length>0?`${S}?${n}`:S;C.replace(i,{scroll:!1})},[S,C,$,A]);(0,i.useEffect)(()=>{if(!A)return;let e=$.get("tab"),t=em(e,A),s=t===(0,N.tK)(A)?null:t;if((e?.trim()?e:null)===s)return;let a=new URLSearchParams($.toString());s?a.set("tab",s):a.delete("tab");let n=a.toString(),i=n.length>0?`${S}?${n}`:S;C.replace(i,{scroll:!1})},[S,C,$,A]);let P=(0,i.useCallback)(e=>{_.current+=1,R({nonce:_.current,...e})},[]);(0,i.useEffect)(()=>{M.current=!1,_.current=0,R(null)},[e]);let q=(0,i.useCallback)(e=>{(function({active:e,activeTab:t,alreadyOpened:s,connected:a,suppressAutoOpen:n}){return a&&e&&"terminal"===t&&!s&&!n})({active:m,activeTab:D,alreadyOpened:M.current,connected:e,suppressAutoOpen:h})&&(M.current=!0,F("preview"))},[m,D,F,h]);if(I)return(0,a.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,a.jsx)(b.Zp,{className:"w-full max-w-md",children:(0,a.jsx)(b.Wu,{className:"py-7 text-center text-[13px] text-[var(--text-muted)]",children:"Loading session workspace..."})})});if(E)return(0,a.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,a.jsx)(b.Zp,{className:"w-full max-w-md border-[color:color-mix(in_srgb,var(--status-error)_45%,transparent)]",children:(0,a.jsx)(b.Wu,{className:"py-7 text-center text-[13px] text-[var(--status-error)]",children:E})})});if(!A)return(0,a.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,a.jsx)(b.Zp,{className:"w-full max-w-md",children:(0,a.jsx)(b.Wu,{className:"py-7 text-center text-[13px] text-[var(--text-muted)]",children:"Session not found"})})});let T="string"==typeof A.status?A.status:"unknown",U=(0,N.Zu)(A),O=function(e){switch(e){case"needs_input":return"needs input";case"working":return"working";case"running":return"running";case"spawning":return"spawning";case"queued":return"queued";default:return e.replace(/[_-]+/g," ")}}(T),z=function(e){switch(e){case"working":case"running":return"bg-amber-400";case"needs_input":return"bg-blue-400";case"spawning":case"queued":default:return"bg-gray-400";case"done":return"bg-emerald-400";case"errored":return"bg-red-400";case"stuck":return"bg-[var(--vk-accent)]";case"terminated":case"killed":return"bg-gray-500"}}(T),W="working"===T||"running"===T||"spawning"===T||"queued"===T||"needs_input"===T,B="queued"!==T&&"spawning"!==T,Z=m&&n&&"terminal"===D,G=m&&"preview"===D,K="min-h-[38px] gap-1.5 px-2.5 text-[12px] sm:min-h-0 sm:px-3",V=(0,i.useMemo)(()=>(0,k.kV)(e).slice(0,7),[e]),J=(0,a.jsxs)(f,{className:"flex w-full overflow-x-auto sm:w-fit sm:inline-flex",children:[(0,a.jsxs)(v,{value:"overview",className:K,children:[(0,a.jsx)(r.A,{className:"h-3.5 w-3.5"}),"Overview"]}),U?(0,a.jsxs)(v,{value:"dispatcher",className:K,children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"}),"Dispatcher"]}):(0,a.jsxs)(v,{value:"terminal",className:K,children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),"Terminal"]}),(0,a.jsxs)(v,{value:"preview",className:K,children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5"}),"Preview"]}),(0,a.jsxs)(v,{value:"skills",className:K,children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Skills"]})]});return(0,a.jsx)("div",{className:`flex h-full min-h-0 min-w-0 w-full flex-col ${Z?"overflow-hidden bg-[#060404]":"overflow-y-auto overscroll-contain lg:overflow-hidden"}`,children:(0,a.jsxs)(p,{value:D,onValueChange:F,className:Z?"flex min-h-0 min-w-0 w-full flex-1 flex-col gap-0 p-0":"flex min-h-0 min-w-0 w-full flex-1 flex-col gap-1 p-1 lg:gap-2 lg:p-3",children:[Z?(0,a.jsxs)("div",{className:"flex shrink-0 flex-col border-b border-white/10 bg-[#0d0908]",children:[(0,a.jsxs)("div",{className:"flex h-10 items-center gap-2 px-2",children:[y?(0,a.jsx)(j.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-[#8e847d] hover:text-[#c9c0b7]",onClick:y,"aria-label":"Open workspace panel",children:(0,a.jsx)(x.A,{className:"h-4 w-4"})}):null,(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[(0,a.jsx)("span",{className:`inline-block h-2 w-2 shrink-0 rounded-full ${z}${W?" animate-pulse":""}`}),(0,a.jsx)("span",{className:"text-[12px] font-medium text-[#efe8e1]",children:O}),(0,a.jsxs)("span",{className:"font-mono text-[10px] text-[#8e847d]",children:["\xb7 ",V]})]}),B?(0,a.jsx)(ec,{projectId:A.projectId,bridgeId:A.bridgeId??null}):null]}),(0,a.jsx)("div",{className:"px-1.5 pb-1.5",children:J})]}):(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1.5 sm:flex-nowrap",children:[J,(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:ml-auto sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:`inline-block h-2 w-2 shrink-0 rounded-full ${z}${W?" animate-pulse":""}`}),(0,a.jsx)("span",{className:"text-[11px] text-[var(--vk-text-muted)]",children:O}),(0,a.jsxs)("span",{className:"hidden font-mono text-[10px] text-[var(--vk-text-muted)] sm:inline",children:["\xb7 ",V]})]}),B?(0,a.jsx)(ec,{projectId:A.projectId,bridgeId:A.bridgeId??null}):null]})]}),(0,a.jsxs)("div",{className:"relative min-h-0 min-w-0 h-0 flex-1 overflow-hidden",children:[(0,a.jsx)(g,{value:"overview",className:"min-h-0 h-full min-w-0 w-full overflow-hidden focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:(0,a.jsx)(X,{session:A,sessionId:e,active:m&&"overview"===D})}),U?(0,a.jsx)(g,{value:"dispatcher",forceMount:!0,className:"min-h-0 h-full min-w-0 w-full overflow-hidden focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:(0,a.jsx)(ex,{thread:A,projectId:A.projectId,bridgeId:A.bridgeId??s,className:"h-full w-full border-0 xl:w-full"})}):(0,a.jsx)(g,{value:"terminal",forceMount:!0,className:Z?"flex min-h-0 h-full min-w-0 w-full flex-col overflow-hidden bg-[#060404] focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0":"flex min-h-0 h-full min-w-0 flex-col w-full overflow-hidden bg-transparent focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:(0,a.jsx)(eo,{sessionId:e,projectId:A.projectId,bridgeId:A.bridgeId??null,sessionState:T,runtimeMode:A.metadata.runtimeMode?.trim()??null,pendingInsert:L,immersiveMobileMode:Z,onPendingInsertConsumed:()=>R(null)})}),(0,a.jsx)(g,{value:"preview",className:"min-h-0 h-full min-w-0 w-full overflow-hidden focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:G?(0,a.jsx)(ed,{sessionId:e,active:G,onQueueTerminalInsert:P,onConnectionChange:q},e):null}),(0,a.jsx)(g,{value:"skills",className:"min-h-0 h-full min-w-0 w-full overflow-hidden focus-visible:outline-none [&[hidden]]:block data-[state=inactive]:pointer-events-none data-[state=inactive]:absolute data-[state=inactive]:inset-0 data-[state=inactive]:invisible data-[state=inactive]:opacity-0",children:(0,a.jsx)(eu,{session:A,sessionId:e,active:m&&"skills"===D})})]})]},e)})}},40443:(e,t,s)=>{s.d(t,{Wu:()=>r,Zp:()=>i,aR:()=>l});var a=s(54568),n=s(46916);let i=(0,s(7620).forwardRef)(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,n.cn)("surface-card rounded-[var(--radius-md)] border",e),...t}));function l({className:e,...t}){return(0,a.jsx)("div",{className:(0,n.cn)("flex items-center gap-2 border-b border-[var(--vk-border)] px-3 py-2",e),...t})}function r({className:e,...t}){return(0,a.jsx)("div",{className:(0,n.cn)("px-3 py-2",e),...t})}i.displayName="Card"},59207:(e,t,s)=>{s.d(t,{g:()=>l});var a=s(7620),n=s(31404);function i(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function l(e,t){let s=t?.enabled??!0,[l,r]=(0,a.useState)(null),[c,o]=(0,a.useState)(s),[d,u]=(0,a.useState)(null),x=(0,a.useCallback)(async()=>{if(!s){r(null),u(null),o(!1);return}try{var t;let s,a,l,c=await fetch((0,n.S)("/api/preferences",e)),o=await c.json().catch(()=>null);if(!c.ok)throw Error(o?.error??o?.reason??`Failed to load preferences: ${c.status}`);r((t=o?.preferences,s=i(t),l=(a=i(s.notifications)).soundFile,{onboardingAcknowledged:!0===s.onboardingAcknowledged,codingAgent:"string"==typeof s.codingAgent&&s.codingAgent.trim().length>0?s.codingAgent.trim():"claude-code",ide:"string"==typeof s.ide&&s.ide.trim().length>0?s.ide.trim():"vscode",markdownEditor:"string"==typeof s.markdownEditor&&s.markdownEditor.trim().length>0?s.markdownEditor.trim():"obsidian",markdownEditorPath:"string"==typeof s.markdownEditorPath?s.markdownEditorPath.trim():"",notifications:{soundEnabled:!1!==a.soundEnabled,soundFile:null===l?null:"string"==typeof l&&l.trim().length>0?l.trim():"abstract-sound-4"}})),u(null)}catch(e){r(null),u(e instanceof Error?e.message:"Failed to load preferences")}finally{o(!1)}},[e,s]);return(0,a.useEffect)(()=>{s&&x()},[s,x]),{preferences:s?l:null,loading:!!s&&c,error:s?d:null,refresh:x}}}}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8510],{2609:(e,t,r)=>{"use strict";r.d(t,{T5:()=>s.T5,hP:()=>n.hP,nO:()=>s.nO,yC:()=>o}),r(16744);var n=r(70590),s=r(87835);function o(e,t,r){let s=t.path||(null==r?void 0:r.path);return"path"===(t.routing||(null==r?void 0:r.routing)||"path")?s?{...r,...t,routing:"path"}:n.sb.throw((0,n.kd)(e)):t.path?n.sb.throw((0,n.s7)(e)):{...r,...t,path:void 0}}},2896:(e,t,r)=>{"use strict";function n({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(54568),r(97509),r(85999),r(12918),r(32106)},5974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={callServer:function(){return o.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var s in n)Object.defineProperty(t,s,{enumerable:!0,get:n[s]});let o=r(34273),a=r(16409),i=r(97102)},6035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(59113).createAsyncLocalStorage)()},6974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return n}});let n=r(74468)._(r(7620)).default.createContext(null)},10594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return h},handleClientScriptLoad:function(){return y},initScriptLoader:function(){return v}};for(var s in n)Object.defineProperty(t,s,{enumerable:!0,get:n[s]});let o=r(74468),a=r(99649),i=r(54568),l=o._(r(97509)),c=a._(r(7620)),u=r(2737),d=r(66161),p=r(71341),f=new Map,b=new Set,m=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:s=null,dangerouslySetInnerHTML:o,children:a="",strategy:i="afterInteractive",onError:c,stylesheets:u}=e,p=r||t;if(p&&b.has(p))return;if(f.has(t)){b.add(p),f.get(t).then(n,c);return}let m=()=>{s&&s(),b.add(p)},y=document.createElement("script"),v=new Promise((e,t)=>{y.addEventListener("load",function(t){e(),n&&n.call(this,t),m()}),y.addEventListener("error",function(e){t(e)})}).catch(function(e){c&&c(e)});o?(y.innerHTML=o.__html||"",m()):a?(y.textContent="string"==typeof a?a:Array.isArray(a)?a.join(""):"",m()):t&&(y.src=t,f.set(t,v)),(0,d.setAttributesFromProps)(y,e),"worker"===i&&y.setAttribute("type","text/partytown"),y.setAttribute("data-nscript",i),u&&(e=>{if(l.default.preinit)return e.forEach(e=>{l.default.preinit(e,{as:"style"})});{let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}})(u),document.body.appendChild(y)};function y(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>m(e))}):m(e)}function v(e){e.forEach(y),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");b.add(t)})}function _(e){let{id:t,src:r="",onLoad:n=()=>{},onReady:s=null,strategy:o="afterInteractive",onError:a,stylesheets:d,...f}=e,{updateScripts:y,scripts:v,getIsSsr:_,appDir:h,nonce:g}=(0,c.useContext)(u.HeadManagerContext);g=f.nonce||g;let w=(0,c.useRef)(!1);(0,c.useEffect)(()=>{let e=t||r;w.current||(s&&e&&b.has(e)&&s(),w.current=!0)},[s,t,r]);let E=(0,c.useRef)(!1);if((0,c.useEffect)(()=>{if(!E.current){if("afterInteractive"===o)m(e);else"lazyOnload"===o&&("complete"===document.readyState?(0,p.requestIdleCallback)(()=>m(e)):window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>m(e))}));E.current=!0}},[e,o]),("beforeInteractive"===o||"worker"===o)&&(y?(v[o]=(v[o]||[]).concat([{id:t,src:r,onLoad:n,onReady:s,onError:a,...f,nonce:g}]),y(v)):_&&_()?b.add(t||r):_&&!_()&&m({...e,nonce:g})),h){if(d&&d.forEach(e=>{l.default.preinit(e,{as:"style"})}),"beforeInteractive"===o)if(!r)return f.dangerouslySetInnerHTML&&(f.children=f.dangerouslySetInnerHTML.__html,delete f.dangerouslySetInnerHTML),(0,i.jsx)("script",{nonce:g,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([0,{...f,id:t}])})`}});else return l.default.preload(r,f.integrity?{as:"script",integrity:f.integrity,nonce:g,crossOrigin:f.crossOrigin}:{as:"script",nonce:g,crossOrigin:f.crossOrigin}),(0,i.jsx)("script",{nonce:g,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([r,{...f,id:t}])})`}});"afterInteractive"===o&&r&&l.default.preload(r,f.integrity?{as:"script",integrity:f.integrity,nonce:g,crossOrigin:f.crossOrigin}:{as:"script",nonce:g,crossOrigin:f.crossOrigin})}return null}Object.defineProperty(_,"__nextScript",{value:!0});let h=_;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23597:(e,t,r)=>{"use strict";function n({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return n}}),r(61841)},30679:(e,t,r)=>{"use strict";r.d(t,{PromisifiedAuthProvider:()=>l,d:()=>c});var n=r(30524),s=r(2609),o=r(45836),a=r(7620);let i=a.createContext(null);function l({authPromise:e,children:t}){return a.createElement(i.Provider,{value:e},t)}function c(e={}){let t=(0,o.useRouter)(),r=a.useContext(i),l=r;return(r&&"then"in r&&(l=a.use(r)),"u"<typeof window)?t?(0,n.As)(e):(0,s.hP)({...l,...e}):(0,n.As)({...l,...e})}},36727:(e,t,r)=>{"use strict";r.r(t),r.d(t,{KeylessCookieSync:()=>a});var n=r(79748),s=r(7620),o=r(38036);function a(e){var t;let a=(null==(t=(0,n.useSelectedLayoutSegments)()[0])?void 0:t.startsWith("/_not-found"))||!1;return(0,s.useEffect)(()=>{o.I&&!a&&r.e(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8510],{2609:(e,t,r)=>{"use strict";r.d(t,{T5:()=>s.T5,hP:()=>n.hP,nO:()=>s.nO,yC:()=>o}),r(16744);var n=r(70590),s=r(87835);function o(e,t,r){let s=t.path||(null==r?void 0:r.path);return"path"===(t.routing||(null==r?void 0:r.routing)||"path")?s?{...r,...t,routing:"path"}:n.sb.throw((0,n.kd)(e)):t.path?n.sb.throw((0,n.s7)(e)):{...r,...t,path:void 0}}},2896:(e,t,r)=>{"use strict";function n({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(54568),r(97509),r(85999),r(12918),r(32106)},5974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={callServer:function(){return o.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var s in n)Object.defineProperty(t,s,{enumerable:!0,get:n[s]});let o=r(34273),a=r(16409),i=r(97102)},6035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(59113).createAsyncLocalStorage)()},6974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return n}});let n=r(74468)._(r(7620)).default.createContext(null)},10594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return h},handleClientScriptLoad:function(){return y},initScriptLoader:function(){return v}};for(var s in n)Object.defineProperty(t,s,{enumerable:!0,get:n[s]});let o=r(74468),a=r(99649),i=r(54568),l=o._(r(97509)),c=a._(r(7620)),u=r(2737),d=r(66161),p=r(71341),f=new Map,b=new Set,m=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:s=null,dangerouslySetInnerHTML:o,children:a="",strategy:i="afterInteractive",onError:c,stylesheets:u}=e,p=r||t;if(p&&b.has(p))return;if(f.has(t)){b.add(p),f.get(t).then(n,c);return}let m=()=>{s&&s(),b.add(p)},y=document.createElement("script"),v=new Promise((e,t)=>{y.addEventListener("load",function(t){e(),n&&n.call(this,t),m()}),y.addEventListener("error",function(e){t(e)})}).catch(function(e){c&&c(e)});o?(y.innerHTML=o.__html||"",m()):a?(y.textContent="string"==typeof a?a:Array.isArray(a)?a.join(""):"",m()):t&&(y.src=t,f.set(t,v)),(0,d.setAttributesFromProps)(y,e),"worker"===i&&y.setAttribute("type","text/partytown"),y.setAttribute("data-nscript",i),u&&(e=>{if(l.default.preinit)return e.forEach(e=>{l.default.preinit(e,{as:"style"})});{let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}})(u),document.body.appendChild(y)};function y(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>m(e))}):m(e)}function v(e){e.forEach(y),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");b.add(t)})}function _(e){let{id:t,src:r="",onLoad:n=()=>{},onReady:s=null,strategy:o="afterInteractive",onError:a,stylesheets:d,...f}=e,{updateScripts:y,scripts:v,getIsSsr:_,appDir:h,nonce:g}=(0,c.useContext)(u.HeadManagerContext);g=f.nonce||g;let w=(0,c.useRef)(!1);(0,c.useEffect)(()=>{let e=t||r;w.current||(s&&e&&b.has(e)&&s(),w.current=!0)},[s,t,r]);let E=(0,c.useRef)(!1);if((0,c.useEffect)(()=>{if(!E.current){if("afterInteractive"===o)m(e);else"lazyOnload"===o&&("complete"===document.readyState?(0,p.requestIdleCallback)(()=>m(e)):window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>m(e))}));E.current=!0}},[e,o]),("beforeInteractive"===o||"worker"===o)&&(y?(v[o]=(v[o]||[]).concat([{id:t,src:r,onLoad:n,onReady:s,onError:a,...f,nonce:g}]),y(v)):_&&_()?b.add(t||r):_&&!_()&&m({...e,nonce:g})),h){if(d&&d.forEach(e=>{l.default.preinit(e,{as:"style"})}),"beforeInteractive"===o)if(!r)return f.dangerouslySetInnerHTML&&(f.children=f.dangerouslySetInnerHTML.__html,delete f.dangerouslySetInnerHTML),(0,i.jsx)("script",{nonce:g,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([0,{...f,id:t}])})`}});else return l.default.preload(r,f.integrity?{as:"script",integrity:f.integrity,nonce:g,crossOrigin:f.crossOrigin}:{as:"script",nonce:g,crossOrigin:f.crossOrigin}),(0,i.jsx)("script",{nonce:g,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([r,{...f,id:t}])})`}});"afterInteractive"===o&&r&&l.default.preload(r,f.integrity?{as:"script",integrity:f.integrity,nonce:g,crossOrigin:f.crossOrigin}:{as:"script",nonce:g,crossOrigin:f.crossOrigin})}return null}Object.defineProperty(_,"__nextScript",{value:!0});let h=_;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23597:(e,t,r)=>{"use strict";function n({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return n}}),r(61841)},30679:(e,t,r)=>{"use strict";r.d(t,{PromisifiedAuthProvider:()=>l,d:()=>c});var n=r(30524),s=r(2609),o=r(45836),a=r(7620);let i=a.createContext(null);function l({authPromise:e,children:t}){return a.createElement(i.Provider,{value:e},t)}function c(e={}){let t=(0,o.useRouter)(),r=a.useContext(i),l=r;return(r&&"then"in r&&(l=a.use(r)),"u"<typeof window)?t?(0,n.As)(e):(0,s.hP)({...l,...e}):(0,n.As)({...l,...e})}},36727:(e,t,r)=>{"use strict";r.r(t),r.d(t,{KeylessCookieSync:()=>a});var n=r(79748),s=r(7620),o=r(38036);function a(e){var t;let a=(null==(t=(0,n.useSelectedLayoutSegments)()[0])?void 0:t.startsWith("/_not-found"))||!1;return(0,s.useEffect)(()=>{o.I&&!a&&r.e(2361).then(r.bind(r,12361)).then(t=>t.syncKeylessConfigAction({...e,returnUrl:window.location.href}))},[a]),e.children}},37204:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClientClerkProvider:()=>O});var n=r(30524),s=r(20602);let o=new Set;var a=r(42925),i=r(79748),l=r(99321),c=r(7620);let u="u">typeof window?c.useLayoutEffect:c.useEffect,d=c.createContext(void 0);d.displayName="ClerkNextOptionsCtx";let p=()=>{let e=c.useContext(d);return null==e?void 0:e.value},f=e=>{let{children:t,options:r}=e;return c.createElement(d.Provider,{value:{value:r}},t)};var b=r(2609),m=r(10594),y=r.n(m);function v(e){let{publishableKey:t,clerkJSUrl:r,clerkJSVersion:s,clerkJSVariant:o,nonce:a}=p(),{domain:i,proxyUrl:l}=(0,n.ho)();if(!t)return null;let u={domain:i,proxyUrl:l,publishableKey:t,clerkJSUrl:r,clerkJSVersion:s,clerkJSVariant:o,nonce:a},d=(0,b.nO)(u),f="app"===e.router?"script":y();return c.createElement(f,{src:d,"data-clerk-js-script":!0,async:!0,defer:"pages"!==e.router&&void 0,crossOrigin:"anonymous",strategy:"pages"===e.router?"beforeInteractive":void 0,...(0,b.T5)(u)})}var _=r(38036),h=r(76975),g=r(67160),w=r(63680);let E=e=>{var t;return{...e,publishableKey:e.publishableKey||w.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY||"",clerkJSUrl:e.clerkJSUrl||w.env.NEXT_PUBLIC_CLERK_JS_URL,clerkJSVersion:e.clerkJSVersion||w.env.NEXT_PUBLIC_CLERK_JS_VERSION,proxyUrl:e.proxyUrl||w.env.NEXT_PUBLIC_CLERK_PROXY_URL||"",domain:e.domain||w.env.NEXT_PUBLIC_CLERK_DOMAIN||"",isSatellite:e.isSatellite||(0,h.zz)(w.env.NEXT_PUBLIC_CLERK_IS_SATELLITE),signInUrl:e.signInUrl||w.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL||"",signUpUrl:e.signUpUrl||w.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL||"",signInForceRedirectUrl:e.signInForceRedirectUrl||w.env.NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL||"",signUpForceRedirectUrl:e.signUpForceRedirectUrl||w.env.NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL||"",signInFallbackRedirectUrl:e.signInFallbackRedirectUrl||w.env.NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL||"",signUpFallbackRedirectUrl:e.signUpFallbackRedirectUrl||w.env.NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL||"",afterSignInUrl:e.afterSignInUrl||w.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL||"",afterSignUpUrl:e.afterSignUpUrl||w.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL||"",newSubscriptionRedirectUrl:e.newSubscriptionRedirectUrl||w.env.NEXT_PUBLIC_CLERK_CHECKOUT_CONTINUE_URL||"",telemetry:null!=(t=e.telemetry)?t:{disabled:(0,h.zz)(w.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED),debug:(0,h.zz)(w.env.NEXT_PUBLIC_CLERK_TELEMETRY_DEBUG)},sdkMetadata:g.tm}};var x=r(3102),C=r(57042);let k=()=>{var e,t;let r=(0,n.ho)(),{pagesRouter:s}=(0,C.r)();return null==(t=r.telemetry)||t.record((0,x.YF)({router:s?"pages":"app",...(null==(e=null==globalThis?void 0:globalThis.next)?void 0:e.version)?{nextjsVersion:globalThis.next.version}:{}})),null};var L=r(43458),R=r(73894),T=r(69560);let j=e=>{var t;return null!=window.__clerk_internal_navigations||(window.__clerk_internal_navigations={}),null!=(t=window.__clerk_internal_navigations)[e]||(t[e]={}),window.__clerk_internal_navigations[e]},I=e=>{let{windowNav:t,routerNav:r,name:n}=e,s=(0,i.usePathname)(),[o,a]=(0,c.useTransition)();t&&(j(n).fun=(e,s)=>new Promise(o=>{var i,l;null!=(i=j(n)).promisesBuffer||(i.promisesBuffer=[]),null==(l=j(n).promisesBuffer)||l.push(o),a(()=>{var n,o,a;if((null==(n=null==s?void 0:s.__internal_metadata)?void 0:n.navigationType)==="internal")t((null!=(a=null==(o=window.next)?void 0:o.version)?a:"")<"14.1.0"?history.state:null,"",e);else r(e)})}));let l=()=>{var e;null==(e=j(n).promisesBuffer)||e.forEach(e=>e()),j(n).promisesBuffer=[]};return(0,c.useEffect)(()=>(l(),l),[]),(0,c.useEffect)(()=>{o||l()},[s,o]),(0,c.useCallback)((e,t)=>j(n).fun(e,t),[])},P=(0,a.default)(()=>r.e(4443).then(r.bind(r,34443)).then(e=>e.KeylessCreatorOrReader),{loadableGenerated:{webpack:()=>[34443]}}),S=e=>{let t,r;if(L.M0){var a,d;let e=`Clerk:
|
|
2
2
|
Your current Next.js version (${l.version}) will be deprecated in the next major release of "@clerk/nextjs". Please upgrade to next@14.1.0 or later.`;(0,s.M)()?(a=e,o.has(a)||(o.add(a),console.warn(a))):(d=`
|
|
3
3
|
\x1b[43m----------
|
|
4
4
|
${e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9083],{862:(e,t,n)=>{n.d(t,{G:()=>C});var a=n(54568),r=n(7620),i=n(33593),o=n(90466),s=n(46916),l=n(79748),d=n(58299),c=n(34309),u=n(62868),p=n(2099),f=n(36645),m=n(59706),g=n(76081),h=n(17210),b=n(31404),v=n(44522);let y="conductor-dismissed-update-version";function w(){let e,t,n=(0,l.usePathname)(),i=(0,l.useSearchParams)(),[o,w]=(0,r.useState)(null),[x,C]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),[j,S]=(0,r.useState)(!1),[M,I]=(0,r.useState)(!1),[E,P]=(0,r.useState)(!1),N=(0,r.useMemo)(()=>(0,b.y)(window.location.href),[n,i]),T=(0,r.useCallback)(()=>(0,b.y)(window.location.href),[]),B=(0,r.useCallback)((e=!1)=>{let t=(0,b.S)("/api/app-update",T());if(!e)return t;let n=new URL(t,"http://127.0.0.1");return n.searchParams.set("force","1"),`${n.pathname}${n.search}${n.hash}`},[T]),L=(0,r.useCallback)(async(e=!1)=>{try{let t=await fetch(B(e),{cache:"no-store"}),n=await t.json().catch(()=>null);if(412===t.status)return C(null),null;if(!t.ok)throw Error("string"==typeof n?.error?n.error:`Failed to load update status (${t.status})`);return w(n),C(null),n}catch(e){return C(e instanceof Error?e.message:"Failed to load update status."),null}},[B,T]);(0,r.useEffect)(()=>{try{let e=window.localStorage.getItem(y);A(e&&e.length>0?e:null)}catch{}L(!0);let e=N?()=>{}:(0,h.F)(e=>{e&&(w(e),C(null))}),t=()=>{"visible"===document.visibilityState&&L(!1)};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{e(),window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}},[N,L]);let $=o?.latestVersion&&k===o.latestVersion,q=!!o?.restarting||E,O=(0,r.useMemo)(()=>!!o&&(!!q||"running"===o.jobStatus||!$&&("completed"===o.jobStatus||"failed"===o.jobStatus||!o.enabled&&!!o.reason||o.updateAvailable)),[$,q,o]);async function R(){o?.updateCommand&&(await navigator.clipboard.writeText(o.updateCommand),S(!0),window.setTimeout(()=>S(!1),1400))}async function G(){I(!0);try{let e=await fetch((0,b.S)("/api/app-update",T()),{method:"POST",headers:{"content-type":"application/json"}}),t=await e.json().catch(()=>null);if(!e.ok)throw Error("string"==typeof t?.error?t.error:`Update failed (${e.status})`);w(t),C(null)}catch(e){C(e instanceof Error?e.message:"Failed to trigger update.")}finally{I(!1)}}let U=(0,r.useCallback)(async()=>{let e=Date.now()+6e4;if(N){for(;Date.now()<e;){let e=await L(!1);if(!e?.restarting)return void P(!1);await new Promise(e=>window.setTimeout(e,1e3))}P(!1),C("Restart started on the paired device, but it did not reconnect in time. Retry from the bridge controls.");return}for(;Date.now()<e;){try{if((await fetch("/api/health",{cache:"no-store"})).ok)return void window.location.reload()}catch{}await new Promise(e=>window.setTimeout(e,1e3))}P(!1),C("Restart started, but the dashboard did not come back in time. Reload manually.")},[N,L]);async function F(){try{let e=await fetch((0,b.S)("/api/app-update",T()),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"restart"})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error("string"==typeof t?.error?t.error:`Restart failed (${e.status})`);w(t),C(null)}catch(e){C(e instanceof Error?e.message:"Failed to restart Conductor.")}}return((0,r.useEffect)(()=>{o?.restarting&&!E&&(P(!0),U())},[E,o?.restarting,U]),O)?(0,a.jsx)("div",{className:"pointer-events-none fixed bottom-3 right-3 z-[70] w-[min(calc(100vw-1.5rem),24rem)] sm:bottom-4 sm:right-4",children:(0,a.jsxs)("section",{className:(0,s.cn)("pointer-events-auto rounded-[14px] border bg-[var(--vk-bg-panel)] p-4 shadow-[0_16px_40px_rgba(0,0,0,0.35)]",o?.jobStatus==="failed"?"border-[color:color-mix(in_srgb,var(--vk-red)_55%,var(--vk-border))]":"border-[var(--vk-border)]"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[q||o?.jobStatus==="running"?(0,a.jsx)(d.A,{className:"h-4 w-4 animate-spin text-[var(--vk-orange)]"}):o?.jobStatus==="completed"?(0,a.jsx)(c.A,{className:"h-4 w-4 text-[var(--status-ready)]"}):o?.jobStatus==="failed"?(0,a.jsx)(u.A,{className:"h-4 w-4 text-[var(--vk-red)]"}):(0,a.jsx)(p.A,{className:"h-4 w-4 text-[var(--vk-orange)]"}),(0,a.jsx)("h2",{className:"truncate text-[13px] font-semibold text-[var(--vk-text-normal)]",children:o?(t=(e=o.currentVersion?.trim())?` (build ${e})`:"",!o.enabled&&o.reason?`Conductor update unavailable${t}`:o.restarting?`Restarting Conductor${t}`:"running"===o.jobStatus?`Updating Conductor${t}`:"completed"===o.jobStatus?`Conductor updated${t}`:"failed"===o.jobStatus?`Update failed${t}`:o.latestVersion?`Conductor ${o.latestVersion} is available${t}`:`Conductor update available${t}`):"Conductor update"})]}),(0,a.jsx)("p",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:o?function(e){if(!e.enabled&&e.reason)return(0,v.N8)(e);if(e.restarting)return"The launcher is restarting the runtime. This tab will reconnect automatically once it is ready.";if("running"===e.jobStatus)return e.jobMessage??"Installing the latest version in the background.";if("completed"===e.jobStatus)return e.jobMessage??"The latest version has been installed. Restart Conductor to use it.";if("failed"===e.jobStatus)return e.jobMessage??"The update command did not finish successfully.";let t=e.currentVersion?`You are running ${e.currentVersion}. `:"";return e.canAutoUpdate?`${t}Install the new release now and restart when it finishes.`:"npx"===e.installMode?`${t}Copy the restart command, run it in a terminal, and the next launch will use the latest release.`:`${t}Copy the update command, run it in a terminal, then restart Conductor.`}(o):"Checking for updates..."})]}),(0,a.jsx)("button",{type:"button",onClick:function(){if(o?.latestVersion){try{window.localStorage.setItem(y,o.latestVersion)}catch{}A(o.latestVersion);return}w(e=>e?{...e,reason:null,enabled:!0}:e)},className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-[7px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)]","aria-label":"Dismiss update notice",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]}),o?.updateCommand?(0,a.jsx)("div",{className:"mt-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-2 font-mono text-[11px] leading-5 text-[var(--vk-text-muted)]",children:o.updateCommand}):null,o?(0,a.jsx)("p",{className:"mt-2 text-[11px] leading-5 text-[var(--vk-text-faint)]",children:function(e){switch(e){case"npx":return"This session was launched through npx. Copy the restart command, run it in a terminal, and the next launch will use the latest package.";case"unknown":return"Automatic updates are unavailable for this install.";default:return null}}(o.installMode)??(o.restartRequired?"Restart the current Conductor process after the installer completes.":"Update state streams from the running Conductor runtime.")}):null,x?(0,a.jsx)("p",{className:"mt-2 text-[11px] text-[var(--vk-red)]",children:x}):o?.error?(0,a.jsx)("p",{className:"mt-2 text-[11px] text-[var(--vk-red)]",children:o.error}):null,o?.logsTail&&"failed"===o.jobStatus?(0,a.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-2 text-[10px] leading-4 text-[var(--vk-text-faint)]",children:o.logsTail}):null,(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-end gap-2",children:[o?.jobStatus==="failed"&&o.canAutoUpdate?(0,a.jsxs)(g.$,{type:"button",size:"sm",variant:"primary",onClick:()=>void G(),disabled:M,children:[M?(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Retry"]}):null,o?.jobStatus==="idle"&&o.canAutoUpdate?(0,a.jsxs)(g.$,{type:"button",size:"sm",variant:"primary",onClick:()=>void G(),disabled:M,children:[M?(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(p.A,{className:"h-3.5 w-3.5"}),"Update now"]}):null,o?.jobStatus==="idle"&&!o.canAutoUpdate&&o.updateCommand?(0,a.jsxs)(g.$,{type:"button",size:"sm",variant:"outline",onClick:()=>void R(),children:[j?(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 text-[var(--status-ready)]"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"}),j?"Copied":"npx"===o.installMode?"Copy restart command":"Copy command"]}):null,o?.restartRequired&&o.canRestart&&!o.restarting&&!E?(0,a.jsxs)(g.$,{type:"button",size:"sm",variant:"primary",onClick:()=>void F(),children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Restart now"]}):null,o?.restarting||E?(0,a.jsxs)(g.$,{type:"button",size:"sm",variant:"primary",disabled:!0,children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}),"Restarting"]}):null]})]})}):null}let x="conductor-workspace-sidebar-width";function C({sidebar:e,children:t,mobileSidebarOpen:n,desktopSidebarOpen:l,onToggleSidebar:d,hideMobileSidebarToggle:c=!1}){let[u,p]=(0,r.useState)(356),[f,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{let e=window.localStorage.getItem(x),t=e?Number.parseInt(e,10):NaN;Number.isFinite(t)&&p(Math.min(460,Math.max(296,t)))}catch{}},[]),(0,r.useEffect)(()=>{if(!f)return;let e=e=>{p(Math.min(460,Math.max(296,e.clientX)))},t=()=>{m(!1)};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t),document.body.style.userSelect="",document.body.style.cursor="";try{window.localStorage.setItem(x,String(u))}catch{}}},[f,u]);let g={"--workspace-sidebar-width":`${u}px`};return(0,a.jsxs)("div",{style:g,className:"relative flex h-svh w-full max-w-full overflow-hidden bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)] [padding-top:env(safe-area-inset-top)] [padding-bottom:env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]",children:[n&&(0,a.jsx)("button",{type:"button",className:"absolute inset-0 z-20 bg-black/45 lg:hidden",onClick:d,"aria-label":"Close workspace panel"}),(0,a.jsx)("aside",{className:(0,s.cn)("absolute inset-y-0 left-0 z-30 flex h-full w-full max-w-none flex-col border-r border-[var(--vk-border)] bg-[var(--vk-bg-panel)] transition-[transform,width] duration-200 sm:w-[min(90vw,var(--workspace-sidebar-width))] sm:max-w-[28rem]",n?"translate-x-0":"-translate-x-full",l?"lg:w-[var(--workspace-sidebar-width)]":"lg:w-0 lg:overflow-hidden lg:border-r-0","lg:relative lg:left-auto lg:translate-x-0"),children:e}),l?(0,a.jsx)("div",{className:"absolute bottom-0 left-[var(--workspace-sidebar-width)] top-0 z-30 hidden w-2 -translate-x-1/2 cursor-col-resize lg:block",onMouseDown:()=>m(!0),"aria-hidden":"true",children:(0,a.jsx)("div",{className:"mx-auto h-full w-px bg-transparent transition-colors hover:bg-[var(--vk-border)]"})}):null,l&&(0,a.jsx)("button",{type:"button",onClick:d,className:"absolute left-[var(--workspace-sidebar-width)] top-2 z-40 hidden h-7 w-7 -translate-x-1/2 items-center justify-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-muted)] shadow-[0_0_0_1px_rgba(0,0,0,0.25)] hover:bg-[var(--vk-bg-hover)] lg:inline-flex","aria-label":"Hide workspace panel",children:(0,a.jsx)(i.A,{className:"h-5 w-5"})}),(0,a.jsxs)("main",{className:"relative flex min-h-0 min-w-0 w-full flex-1 flex-col overflow-hidden bg-[var(--vk-bg-main)]",children:[!n&&!c&&(0,a.jsx)("button",{type:"button",onClick:d,className:"absolute left-2 top-2 z-40 inline-flex h-11 w-11 items-center justify-center rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-muted)] shadow-[0_10px_24px_rgba(0,0,0,0.28)] hover:bg-[var(--vk-bg-hover)] sm:h-8 sm:w-8 lg:hidden","aria-label":"Open workspace panel",children:(0,a.jsx)(o.A,{className:"h-5 w-5"})}),!l&&(0,a.jsx)("button",{type:"button",onClick:d,className:"absolute left-2 top-2 z-40 hidden h-7 w-7 items-center justify-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] lg:inline-flex","aria-label":"Open workspace panel",children:(0,a.jsx)(o.A,{className:"h-5 w-5"})}),t]}),(0,a.jsx)(w,{})]})}},5739:(e,t,n)=>{n.d(t,{q:()=>a});function a(e){return e.trim().toLowerCase().replace(/[_\s]+/g,"-")}},17210:(e,t,n)=>{n.d(t,{F:()=>M,L:()=>S});var a=n(31404),r=n(92070);let i=new Set,o=new Set,s=null,l=null,d=null,c=null,u=null,p=0;function f(){return i.size>0||o.size>0}function m(){return"u"<typeof document||"visible"===document.visibilityState}function g(e){if(Array.isArray(e))return{type:"snapshot",sessions:e};if(!e||"object"!=typeof e)return null;let t=e.type;return"snapshot"!==t&&"snapshot_delta"!==t?null:Array.isArray(e.sessions)?e:null}function h(e){return e&&"object"==typeof e&&"boolean"==typeof e.enabled?e:null}function b(e){for(let t of i)t(e);let t=h(e.appUpdate);if(t)for(let e of o)e(t)}function v(){return(0,a.y)(window.location.href)}async function y(){if("function"!=typeof fetch)return;let e=(async()=>{let e=v();try{let t=await fetch((0,a.S)("/api/sessions",e));if(!t.ok)return;let n=await t.json().catch(()=>null),r=g(n);if(!r)return;b(r)}catch{}try{let n=await fetch((0,a.S)("/api/app-update",e));if(!n.ok)return;let r=await n.json().catch(()=>null);var t=h(r);for(let e of o)e(t)}catch{}})();s=e.finally(()=>{s===e&&(s=null)}),await e}function w(){null!==u&&(window.clearTimeout(u),u=null)}function x(){if(!f()||!m()||v())return;w();let e=0===p?250:Math.min(400*2**(p-1),12e3);p+=1,u=window.setTimeout(()=>{u=null,A()},e)}function C(){w(),p=0,c?.abort(),c=null}async function k(e){try{let t=await fetch("/api/events",{cache:"no-store",signal:e.signal});if(!t.ok||!t.body){e.signal.aborted||x();return}for await(let n of(p=0,(0,r.w)(t.body,e.signal)))!function(e){let t;if("refresh"===e.event){s||y();return}try{t=JSON.parse(e.data)}catch{return}if(t&&"object"==typeof t&&"refresh"===t.type){s||y();return}let n=g(t);n&&b(n)}(n);e.signal.aborted||x()}catch{e.signal.aborted||x()}}function A(){if("u"<typeof fetch||c||!f()||!m()||v())return;let e=new AbortController;c=e,(async()=>{try{await k(e)}finally{c===e&&(c=null)}})()}function j(){if(!f()){C(),l&&(window.removeEventListener("focus",l),l=null),d&&(document.removeEventListener("visibilitychange",d),d=null);return}(l||d||(l=()=>{f()&&m()&&(A(),s||y())},d=()=>{f()&&m()?(A(),s||y()):C()},window.addEventListener("focus",l),document.addEventListener("visibilitychange",d)),v()||!m())?C():A()}function S(e){return i.add(e),j(),()=>{i.delete(e),j()}}function M(e){return o.add(e),j(),()=>{o.delete(e),j()}}},35821:(e,t,n)=>{n.d(t,{w:()=>r});var a=n(75120);function r(e,t=null,n){return(0,a.DA)(e,t,n)}},46012:(e,t,n)=>{n.d(t,{T:()=>i});var a=n(7620);function r(){return window.innerWidth>=1024}function i(e){let[t,n]=(0,a.useState)(!1),[i,o]=(0,a.useState)(e?.initialDesktopOpen??!0),s=(0,a.useCallback)(()=>{r()?o(e=>!e):n(e=>!e)},[]);return{mobileSidebarOpen:t,desktopSidebarOpen:i,toggleSidebar:s,closeSidebarOnMobile:(0,a.useCallback)(()=>{r()||n(!1)},[]),syncSidebarForViewport:(0,a.useCallback)(()=>{r()?o(!0):n(!1)},[])}}},53649:(e,t,n)=>{n.d(t,{U:()=>o});var a=n(7620),r=n(31404);function i(e,t){return{id:e,repo:"string"==typeof t?.repo?t.repo:null,path:"string"==typeof t?.path?t.path:null,iconUrl:"string"==typeof t?.iconUrl?t.iconUrl:null,boardDir:"string"==typeof t?.boardDir?t.boardDir:null,boardFile:"string"==typeof t?.boardFile?t.boardFile:null,description:"string"==typeof t?.description?t.description:null,defaultBranch:"string"==typeof t?.defaultBranch&&t.defaultBranch.trim().length>0?t.defaultBranch:"main",agent:"string"==typeof t?.agent&&t.agent.trim().length>0?t.agent:"claude-code",agentPermissions:"string"==typeof t?.agentPermissions&&t.agentPermissions.trim().length>0?t.agentPermissions:null,agentModel:"string"==typeof t?.agentModel&&t.agentModel.trim().length>0?t.agentModel:null,agentReasoningEffort:"string"==typeof t?.agentReasoningEffort&&t.agentReasoningEffort.trim().length>0?t.agentReasoningEffort:null}}function o(e,t){let n=t?.enabled??!0,[o,s]=(0,a.useState)([]),[l,d]=(0,a.useState)(n),[c,u]=(0,a.useState)(null),p=(0,a.useCallback)(async()=>{if(!n){s([]),u(null),d(!1);return}d(!0);try{let t=await fetch((0,r.S)("/api/config",e)),n=await t.json().catch(()=>null);if(!t.ok){let e="object"==typeof n&&null!==n?n.error??n.reason:null;throw Error(e??`Failed to fetch config: ${t.status}`)}s(function(e){if(!e||"object"!=typeof e)return[];let t=e.projects;return t?Array.isArray(t)?t.map((e,t)=>e&&"object"==typeof e?i("string"==typeof e.id&&e.id.trim().length>0?e.id:`project-${t+1}`,e):i(`project-${t+1}`,null)):"object"==typeof t?Object.entries(t).map(([e,t])=>i(e,t&&"object"==typeof t?t:null)):[]:[]}(n)),u(null)}catch(e){s([]),u(e instanceof Error?e.message:"Failed to fetch config")}finally{d(!1)}},[e,n]);return(0,a.useEffect)(()=>{p()},[p]),{projects:o,loading:!!n&&l,error:n?c:null,refresh:p}}},72410:(e,t,n)=>{n.d(t,{N:()=>u});var a=n(54568),r=n(7620);let i={amp:["/agents/amp-dark.svg","/agents/amp-light.svg"],claude:["/agents/claude-dark.svg","/agents/claude-light.svg"],codex:["/agents/codex-dark.svg","/agents/codex-light.svg"],copilot:["/agents/copilot-dark.svg","/agents/copilot-light.svg"],cursor:["/agents/cursor-dark.svg","/agents/cursor-light.svg"],droid:["/agents/droid-dark.svg","/agents/droid-light.svg"],gemini:["/agents/gemini-dark.svg","/agents/gemini-light.svg"],hermes:["/agents/hermes.png"],openclaw:["/agents/openclaw-dark.svg","/agents/openclaw-light.svg"],opencode:["/agents/opencode-dark.svg","/agents/opencode-light.svg"],qwen:["/agents/qwen-dark.svg","/agents/qwen-light.svg"]},o=new Map;for(let[e,t]of Object.entries({amp:["amp","amp-code","amp-cli","ampcode","agent-amp"],claude:["claude","claude-code","claude-cli","claudecode","ccr","claude-code-router","claude-mcp","claude-mcp-cli","claude-mcp-agent","agent-claude-code"],codex:["codex","openai-codex","codex-cli","codexcli","openai","agent-codex"],copilot:["copilot","github-copilot","githubcopilot","copilot-cli","agent-github-copilot"],cursor:["cursor","cursor-cli","cursor-agent","cursoragent","agent-cursor-cli"],droid:["droid","factory-droid","factory_droid","agent-droid"],gemini:["gemini","gemini-cli","google-gemini","googlegemini","agent-gemini"],hermes:["hermes","hermes-agent","nous-hermes","agent-hermes"],openclaw:["openclaw","open-claw","open_claw","agent-openclaw"],opencode:["opencode","open-code","open_code","open-code-cli","agent-opencode"],qwen:["qwen","qwen-code","qwen_code","qwen-code-cli","agent-qwen-code"]}))for(let n of t)o.set(s(n),e);function s(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/_+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function l(e){let t=s(e);if(!t)return null;let n=o.get(t);if(n)return n;for(let e of t.split("-")){let t=o.get(e);if(t)return t}for(let[e,n]of o.entries())if(t===e||t.startsWith(`${e}-`)||t.endsWith(`-${e}`)||t.includes(`-${e}-`))return n;return null}function d(e){try{let t=new URL(e),n=l(t.hostname.replace(/^www\./,"").replace(/\./g,"-"));if(n)return n;return l(t.pathname.replace(/\//g,"-"))}catch{return l(e)}}function c({label:e,className:t}){let n=e.split(/[^a-z0-9]/iu).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join("");return(0,a.jsx)("span",{"aria-hidden":"true",className:`inline-flex shrink-0 items-center justify-center rounded-[0.2rem] text-[9px] font-semibold text-white ${t}`,style:{backgroundColor:function(e){let t=["#14b8a6","#06b6d4","#0ea5e9","#8b5cf6","#ec4899","#f97316","#f59e0b","#ef4444","#22c55e","#84cc16"],n=0;for(let a=0;a<e.length;a+=1)n=(31*n+e.charCodeAt(a))%t.length;return t[Math.abs(n)%t.length]??"#6b7280"}(`${e}:${e.length}`)},children:n||"AI"})}function u({seed:e,className:t="h-6 w-6"}){let[n,o]=(0,r.useState)(0),s=e?.label?.trim()??"",p=(0,r.useMemo)(()=>s?function(e){if(!e.label.trim())return[];let t=l(e.label)??(e.homepage?d(e.homepage):null)??(e.iconUrl?d(e.iconUrl):null),n="string"==typeof e.iconUrl&&e.iconUrl.trim().length>0?e.iconUrl.trim():null,a=[];return t&&a.push(...i[t]),n&&a.push(n),a}({label:s,iconUrl:e?.iconUrl,homepage:e?.homepage}):[],[s,e?.homepage,e?.iconUrl]);if((0,r.useEffect)(()=>{o(0)},[s,p]),!s)return(0,a.jsx)(c,{label:"AI",className:t});let f=p[n]??null;return f?(0,a.jsx)("img",{src:f,alt:`${s} icon`,loading:"lazy",className:`${t} shrink-0 rounded-[0.2rem] object-contain scale-125`,onError:()=>o(e=>e+1)}):(0,a.jsx)(c,{label:s,className:t})}},75120:(e,t,n)=>{n.d(t,{DA:()=>P,Kc:()=>I,eI:()=>E});var a=n(7620),r=n(31404),i=n(10926),o=n(17210),s=n(77522);let l="local",d=new Map,c=new Map,u=new Map;function p(e){return(0,i.C0)(e)??l}function f(e){let t=d.get(e);return t||(t={sessionsById:new Map,orderedIds:[],version:0,loading:!0,error:null,listInitialized:!1,refreshPromise:null,unsubscribeSnapshots:null,activeConsumers:0,pollTimer:null,focusHandler:null,visibilityHandler:null},d.set(e,t)),t}function m(e){let t=c.get(e);return t||(t=new Set,c.set(e,t)),t}function g(e){for(let t of m(e))t()}function h(e,t){let n=u.get(e);if(n)for(let e of new Set(t)){let t=n.get(e);if(t)for(let e of t)e()}}function b(e){return[...e.values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).map(e=>e.id)}function v(e,t,n){let a=f(e);a.sessionsById=t,a.orderedIds=n,a.version+=1}function y(e,t,n){let a=f(e),r=a.sessionsById.get(t);if(!r)return null;let i=new Map(a.sessionsById),o=n(r);return o?i.set(t,o):i.delete(t),v(e,i,b(i)),a.loading=!1,a.error=null,g(e),h(e,[t]),r}function w(e){return{id:e.id,projectId:e.projectId,bridgeId:e.bridgeId??null,bridgeConnected:e.bridgeConnected??null,bridgeConnection:e.bridgeConnection??null,status:e.status,activity:e.activity,branch:e.branch,model:e.model??null,reasoningEffort:e.reasoningEffort??null,issueId:e.issueId,summary:e.summary??null,createdAt:e.createdAt,lastActivityAt:e.lastActivityAt,pr:e.pr??null,metadata:e.metadata}}async function x(e,t){let n=f(e);if(n.refreshPromise)return void await n.refreshPromise;let a=(async()=>{let a=new Set(n.sessionsById.keys());try{var i;let o=await fetch((0,r.S)("/api/sessions",t),{cache:"no-store"});if(!o.ok){let e=await o.json().catch(()=>null);throw Error(e?.error??e?.reason??`Failed to fetch sessions: ${o.status}`)}let s=(i=await o.json().catch(()=>null),Array.isArray(i)?i:Array.isArray(i?.sessions)?i.sessions:[]);for(let e of s)a.add(e.id);let l=new Map(s.map(e=>[e.id,e]));v(e,l,b(l)),n.error=null}catch(e){n.error=e instanceof Error?e.message:"Failed to fetch sessions"}finally{n.loading=!1,g(e),h(e,a)}})();n.refreshPromise=a.finally(()=>{n.refreshPromise===a&&(n.refreshPromise=null)}),await a}function C(){return"visible"===document.visibilityState}function k(e){let t=f(e);null!==t.pollTimer&&(window.clearTimeout(t.pollTimer),t.pollTimer=null)}function A(e,t){let n=f(e);k(e),e!==l&&0!==n.activeConsumers&&C()&&(n.pollTimer=window.setTimeout(async()=>{0!==f(e).activeConsumers&&C()&&(await x(e,t),A(e,t))},15e3))}function j(e,t){let n=f(e);n.activeConsumers+=1,n.activeConsumers>1||(!function(e){if(e!==l)return;let t=f(e);t.unsubscribeSnapshots||(t.unsubscribeSnapshots=(0,o.L)(t=>{let n=f(e),a=new Set;if("snapshot"===t.type){for(let e of n.sessionsById.keys())a.add(e);for(let e of t.sessions)a.add(e.id);v(e,new Map(t.sessions.map(e=>{let t=w(e);return[t.id,t]})),t.sessions.map(e=>e.id))}else{let r=new Map(n.sessionsById);for(let e of t.sessions){let t=w(e);r.set(t.id,t),a.add(t.id)}for(let e of t.removedSessionIds??[])r.delete(e),a.add(e);v(e,r,b(r))}n.loading=!1,n.error=null,g(e),h(e,a)}))}(e),n.listInitialized||(n.listInitialized=!0),function(e,t){let n=f(e);if(n.focusHandler||n.visibilityHandler)return;let a=()=>{0!==n.activeConsumers&&(x(e,t),A(e,t))},r=()=>{0!==n.activeConsumers&&("visible"===document.visibilityState&&x(e,t),k(e),A(e,t))};n.focusHandler=a,n.visibilityHandler=r,window.addEventListener("focus",a),document.addEventListener("visibilitychange",r)}(e,t),C()&&x(e,t),A(e,t))}function S(e){let t=f(e);if(t.activeConsumers=Math.max(0,t.activeConsumers-1),!(t.activeConsumers>0)){let n;k(e),(n=f(e)).focusHandler&&(window.removeEventListener("focus",n.focusHandler),n.focusHandler=null),n.visibilityHandler&&(document.removeEventListener("visibilitychange",n.visibilityHandler),n.visibilityHandler=null),t.unsubscribeSnapshots?.(),t.unsubscribeSnapshots=null}}async function M(e,t,n){let a=f(t);try{let i=await fetch((0,r.S)(`/api/sessions/${encodeURIComponent(e)}`,n),{cache:"no-store"});if(404===i.status){let n=new Map(a.sessionsById);return n.delete(e),v(t,n,b(n)),a.error=null,null}if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error??e?.reason??`Failed to fetch session: ${i.status}`)}let o=await i.json(),s=new Map(a.sessionsById);return s.set(o.id,o),v(t,s,b(s)),a.error=null,o}catch(e){throw a.error=e instanceof Error?e.message:"Failed to fetch session",e}finally{a.loading=!1,g(t),h(t,[e])}}function I(e,t){let n=e.trim();if(!n)return()=>{};let a=p(t?.bridgeId??(0,i.DW)(n)?.bridgeId??null),r=y(a,n,e=>{if("archived"===e.status.trim().toLowerCase())return e;let t=new Date().toISOString(),n={...e.metadata};return n.archivedAt=n.archivedAt??t,n.finishedAt=n.finishedAt??t,n.summary="Archived",delete n.terminationRequested,{...e,status:"archived",activity:"exited",summary:"Archived",lastActivityAt:t,metadata:n}});if(!r)return()=>{};let o="function"==typeof structuredClone?structuredClone(r):JSON.parse(JSON.stringify(r));return()=>{y(a,n,()=>o)}}function E(e,t){let n=t?.enabled??!0,r=p(t?.bridgeId),i=f(r),[,o]=(0,a.useReducer)(e=>e+1,0),[s,l]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{var e;let a;if(l(!0),!n)return;j(r,t?.bridgeId);let i=(e=()=>o(),(a=m(r)).add(e),()=>{a.delete(e)});return()=>{i(),S(r)}},[n,t?.bridgeId,r]),{sessions:(0,a.useMemo)(()=>{let t,a;return n&&s?(t=f(r),a=e?.trim(),t.orderedIds.map(e=>t.sessionsById.get(e)).filter(e=>!!e).filter(e=>!a||e.projectId===a)):[]},[n,s,e,r,i.version]),loading:!!n&&(!s||i.loading),error:n?i.error:null,refresh:()=>x(r,t?.bridgeId)}}function P(e,t=null,n){let r=n?.enabled??!0,o="string"==typeof e&&e.trim().length>0?e.trim():null,d=(0,i.C0)(n?.bridgeId??t?.bridgeId??(0,i.DW)(o)?.bridgeId??null),c=p(d),m=f(c),[,y]=(0,a.useReducer)(e=>e+1,0),[w,x]=(0,a.useState)(!1),[C,k]=(0,a.useState)(t),[A,I]=(0,a.useState)(null),[E,N]=(0,a.useState)(r&&null!==o&&null===t),T=o?m.sessionsById.get(o)??C??t:null;return(0,a.useEffect)(()=>{x(!0),function(e,t){if(!t)return;let n=f(e),a=n.sessionsById.get(t.id);if(a&&JSON.stringify(a)===JSON.stringify(t))return;let r=new Map(n.sessionsById);r.set(t.id,t),v(e,r,b(r)),n.loading=!1,g(e),h(e,[t.id])}(c,t),k(t),I(null)},[t,c]),(0,a.useEffect)(()=>{if(r&&null!==o){var e;let t,n,a;return e=()=>y(),(t=u.get(c))||(t=new Map,u.set(c,t)),(n=t.get(o))||(n=new Set,t.set(o,n)),(a=n).add(e),()=>{if(a.delete(e),a.size>0)return;let t=u.get(c);t?.delete(o),t&&0===t.size&&u.delete(c)}}},[r,o,c]),(0,a.useEffect)(()=>{if(r&&null!==o)return j(c,d),()=>{S(c)}},[r,d,o,c]),(0,a.useEffect)(()=>{var e;let t;if(!r||null===o||c===l||(e=T?.status,(t=e?.trim().toLowerCase())&&s.C.has(t)))return;let n=()=>{"visible"===document.visibilityState&&M(o,c,d).catch(()=>{})};n();let a=window.setInterval(n,5e3);return()=>{window.clearInterval(a)}},[T?.status,r,d,o,c]),(0,a.useEffect)(()=>{if(!r||null===o){k(null),I(null),N(!1);return}if(t||m.sessionsById.has(o)){k(e=>m.sessionsById.get(o)??e??t),I(null),N(!1);return}let e=!1;return N(!0),I(null),M(o,c,d).then(t=>{e||(k(t),I(null))}).catch(t=>{e||(k(null),I(t instanceof Error?t.message:"Failed to fetch session"))}).finally(()=>{e||N(!1)}),()=>{e=!0}},[r,d,t,o,c,m]),{session:o?w?T??null:t??null:null,loading:E,error:r&&o?A??m.error:null}}},76050:(e,t,n)=>{function a(e){return e?.metadata.sessionKind==="project_dispatcher"}function r(e){return a(e)?"dispatcher":"terminal"}n.d(t,{Zu:()=>a,tK:()=>r})},76196:(e,t,n)=>{n.d(t,{DZ:()=>v,O$:()=>h,Tk:()=>m,Zp:()=>u,Zz:()=>p,d8:()=>g,u6:()=>b,yM:()=>f}),[...new Set(["killed","terminated","done","cleanup","errored","merged"])];let a=["amp","claude-code","codex","cursor-cli","droid","gemini","github-copilot","opencode","qwen-code","ccr"],r={amp:"default",claudeCode:"pro",codex:"chatgpt",cursorCli:"default",droid:"default",gemini:"oauth",githubCopilot:"default",opencode:"default",qwenCode:"oauth",ccr:"default"},i={amp:{agent:"amp",label:"Amp",accessKey:"amp",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Amp CLI catalog and custom override support."}]},"claude-code":{agent:"claude-code",label:"Claude Code",accessKey:"claudeCode",defaultAccess:"pro",accessOptions:[{id:"pro",label:"Claude Pro",description:"Shows the current Sonnet models that Claude Code documents for Pro usage."},{id:"max",label:"Claude Max",description:"Unlocks both Sonnet and Opus model choices in Claude Code."},{id:"api",label:"Anthropic API",description:"Use direct Anthropic API credentials instead of a Claude subscription."}]},codex:{agent:"codex",label:"Codex",accessKey:"codex",defaultAccess:"chatgpt",accessOptions:[{id:"chatgpt",label:"ChatGPT Plan",description:"Use the ChatGPT-backed Codex login flow for paid ChatGPT workspaces."},{id:"api",label:"OpenAI API",description:"Use direct OpenAI API credentials when Codex is pointed at the API."}]},"cursor-cli":{agent:"cursor-cli",label:"Cursor Agent",accessKey:"cursorCli",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Cursor Agent catalog and custom override support."}]},droid:{agent:"droid",label:"Droid",accessKey:"droid",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Droid catalog and custom override support."}]},gemini:{agent:"gemini",label:"Gemini",accessKey:"gemini",defaultAccess:"oauth",accessOptions:[{id:"oauth",label:"Google Login",description:"Use the built-in Google account flow that Gemini CLI ships with."},{id:"api",label:"Gemini API",description:"Use a Gemini API key or Vertex AI project for broader model control."}]},"github-copilot":{agent:"github-copilot",label:"GitHub Copilot",accessKey:"githubCopilot",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Copilot CLI catalog and custom override support."}]},opencode:{agent:"opencode",label:"OpenCode",accessKey:"opencode",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed OpenCode catalog and custom override support."}]},"qwen-code":{agent:"qwen-code",label:"Qwen Code",accessKey:"qwenCode",defaultAccess:"oauth",accessOptions:[{id:"oauth",label:"Qwen OAuth",description:"Use Qwen Code's built-in browser login and bundled provider defaults."},{id:"api",label:"DashScope / Custom API",description:"Use DashScope or another OpenAI-compatible endpoint configured for Qwen Code."}]},ccr:{agent:"ccr",label:"CCR",accessKey:"ccr",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Claude Code Router catalog and custom override support."}]}},o=[{id:"low",label:"Low",description:"Fast responses with lighter reasoning."},{id:"medium",label:"Medium",description:"Balanced speed and reasoning depth for everyday tasks."},{id:"high",label:"High",description:"Deeper reasoning for more complex tasks."}],s=[...o,{id:"xhigh",label:"Extra High",description:"Maximum reasoning depth for the hardest tasks."}];function l(e,t,n,a=function(e){return e.trim().split(/[-_]+/g).filter(Boolean).map(e=>"gpt"===e.toLowerCase()?"GPT":e[0]?.toUpperCase()+e.slice(1)).join(" ")}(e)){return{id:e,label:a,description:t,access:n}}let d={amp:{modelsByAccess:{default:[l("free","Amp Free mode prioritizes lower-cost execution.",["default"],"Amp Free"),l("rush","Amp Rush mode prioritizes faster turnaround.",["default"],"Amp Rush"),l("smart","Amp Smart mode balances quality, speed, and tool choice.",["default"],"Amp Smart"),l("deep","Amp Deep mode enables the highest-capability reasoning path.",["default"],"Amp Deep")]},defaultModelByAccess:{default:"smart"}},"claude-code":{modelsByAccess:{pro:[l("claude-sonnet-4-6","Balanced Claude Code model for day-to-day coding tasks.",["pro","max","api"],"Claude Sonnet 4.6"),l("claude-haiku-4-5","Fast Claude model for lightweight tasks.",["pro","max","api"],"Claude Haiku 4.5")],max:[l("claude-sonnet-4-6","Balanced Claude Code model for day-to-day coding tasks.",["pro","max","api"],"Claude Sonnet 4.6"),l("claude-opus-4-6","Highest-capability Claude Code model for deeper reasoning.",["max","api"],"Claude Opus 4.6"),l("claude-haiku-4-5","Fast Claude model for lightweight tasks.",["pro","max","api"],"Claude Haiku 4.5")],api:[l("claude-sonnet-4-6","Balanced Claude Code model for day-to-day coding tasks.",["pro","max","api"],"Claude Sonnet 4.6"),l("claude-opus-4-6","Highest-capability Claude Code model for deeper reasoning.",["max","api"],"Claude Opus 4.6"),l("claude-haiku-4-5","Fast Claude model for lightweight tasks.",["pro","max","api"],"Claude Haiku 4.5")]},defaultModelByAccess:{pro:"claude-sonnet-4-6",max:"claude-opus-4-6",api:"claude-sonnet-4-6"},reasoningOptionsByAccess:{pro:o,max:o,api:o},defaultReasoningByAccess:{pro:"medium",max:"high",api:"medium"}},codex:{modelsByAccess:{chatgpt:[l("gpt-5.4","Latest frontier coding model exposed by Codex.",["chatgpt","api"],"GPT-5.4"),l("gpt-5.4-mini","Smaller GPT-5.4 variant for faster or lower-cost coding tasks.",["chatgpt","api"],"GPT-5.4-Mini"),l("gpt-5.3-codex","Balanced Codex coding model.",["chatgpt","api"],"GPT-5.3-Codex"),l("gpt-5.3-codex-spark","Fast Codex model optimized for rapid iteration.",["chatgpt"],"GPT-5.3-Codex-Spark"),l("gpt-5.2-codex","Previous generation Codex coding model.",["chatgpt","api"],"GPT-5.2-Codex"),l("gpt-5.2","Previous frontier model for professional work with configurable reasoning effort.",["chatgpt","api"],"GPT-5.2"),l("gpt-5.1-codex-max","High-capability legacy Codex model.",["chatgpt","api"],"GPT-5.1-Codex-Max"),l("gpt-5.1-codex-mini","Smaller Codex model for quick tasks.",["chatgpt","api"],"GPT-5.1-Codex-Mini")],api:[l("gpt-5.4","Latest frontier coding model exposed by Codex.",["chatgpt","api"],"GPT-5.4"),l("gpt-5.4-mini","Smaller GPT-5.4 variant for faster or lower-cost coding tasks.",["chatgpt","api"],"GPT-5.4-Mini"),l("gpt-5.3-codex","Balanced Codex coding model.",["chatgpt","api"],"GPT-5.3-Codex"),l("gpt-5.2-codex","Previous generation Codex coding model.",["chatgpt","api"],"GPT-5.2-Codex"),l("gpt-5.2","Previous frontier model for professional work with configurable reasoning effort.",["chatgpt","api"],"GPT-5.2"),l("gpt-5.1-codex-max","High-capability legacy Codex model.",["chatgpt","api"],"GPT-5.1-Codex-Max"),l("gpt-5.1-codex-mini","Smaller Codex model for quick tasks.",["chatgpt","api"],"GPT-5.1-Codex-Mini")]},defaultModelByAccess:{chatgpt:"gpt-5.4",api:"gpt-5.4"},reasoningOptionsByAccess:{chatgpt:s,api:s},defaultReasoningByAccess:{chatgpt:"high",api:"high"}},"cursor-cli":{modelsByAccess:{default:[l("gpt-5","Cursor Agent's GPT-5 preset alias.",["default"],"GPT-5"),l("sonnet-4","Cursor Agent's Sonnet preset alias.",["default"],"Sonnet 4"),l("opus","Cursor Agent's Opus preset alias.",["default"],"Opus")]},defaultModelByAccess:{default:"gpt-5"}},droid:{modelsByAccess:{default:[]},defaultModelByAccess:{}},gemini:{modelsByAccess:{oauth:[l("gemini-3.1-pro-preview","High-capability Gemini model discovered in local Gemini sessions.",["oauth","api"],"Gemini 3.1 Pro Preview"),l("gemini-3-flash-preview","Fast Gemini model discovered in local Gemini sessions.",["oauth","api"],"Gemini 3 Flash Preview")],api:[l("gemini-3.1-pro-preview","High-capability Gemini model discovered in local Gemini sessions.",["oauth","api"],"Gemini 3.1 Pro Preview"),l("gemini-3-flash-preview","Fast Gemini model discovered in local Gemini sessions.",["oauth","api"],"Gemini 3 Flash Preview")]},defaultModelByAccess:{oauth:"gemini-3.1-pro-preview",api:"gemini-3.1-pro-preview"}},"github-copilot":{modelsByAccess:{default:[]},defaultModelByAccess:{}},opencode:{modelsByAccess:{default:[]},defaultModelByAccess:{}},"qwen-code":{modelsByAccess:{oauth:[l("coder-model","Model discovered in the local Qwen Code installation.",["oauth","api"],"Coder Model")],api:[l("coder-model","Model discovered in the local Qwen Code installation.",["oauth","api"],"Coder Model")]},defaultModelByAccess:{oauth:"coder-model",api:"coder-model"}},ccr:{modelsByAccess:{default:[l("claude-sonnet-4-6","Balanced Claude model exposed through Claude Code Router.",["default"],"Claude Sonnet 4.6"),l("claude-opus-4-6","Highest-capability Claude model exposed through Claude Code Router.",["default"],"Claude Opus 4.6"),l("claude-haiku-4-5","Fast Claude model exposed through Claude Code Router.",["default"],"Claude Haiku 4.5")]},defaultModelByAccess:{default:"claude-sonnet-4-6"},reasoningOptionsByAccess:{default:o},defaultReasoningByAccess:{default:"medium"}}};function c(e){let t=e.trim().toLowerCase().replace(/[_\s]+/g,"-");return a.includes(t)?t:null}function u(){return{...r}}function p(e){return null!==c(e)}function f(e){let t=c(e);return t?i[t]:null}function m(e,t){let n=f(e);if(!n)return null;let a=t?.[n.accessKey];return"string"==typeof a&&n.accessOptions.some(e=>e.id===a)?a:n.defaultAccess}function g(e,t){let n=c(e);if(!n)return[];let a=m(n,t);if(!a)return[];let r=d[n],i=r.modelsByAccess[a]??[];if(i.length>0)return[...i];let o=[],s=new Set;for(let e of Object.values(r.modelsByAccess))if(Array.isArray(e))for(let t of e)s.has(t.id)||(s.add(t.id),o.push(t));return o}function h(e,t){let n=c(e);if(!n)return null;let a=m(n,t);return a?d[n].defaultModelByAccess[a]??null:null}function b(e,t){let n=c(e);if(!n)return[];let a=m(n,t);return a?d[n].reasoningOptionsByAccess?.[a]??[]:[]}function v(e,t){let n=c(e);if(!n)return null;let a=m(n,t);return a?d[n].defaultReasoningByAccess?.[a]??null:null}},84169:(e,t,n)=>{n.d(t,{V:()=>o});var a=n(54568),r=n(7620),i=n(37270);let o=(0,r.memo)(function({title:e,onOpenPreferences:t,rightContent:n}){return(0,a.jsxs)("header",{className:"flex h-[33px] items-center border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)] pl-14 pr-2 text-[12px] text-[var(--vk-text-muted)] sm:pl-5 sm:pr-5 sm:text-[13px]",children:[(0,a.jsx)("div",{className:"min-w-0 flex-1 text-left sm:text-center",children:(0,a.jsx)("span",{className:"block truncate font-medium tracking-[0.01em] text-[var(--vk-text-muted)]",children:e??"All Projects"})}),n?(0,a.jsx)("div",{className:"ml-1 flex shrink-0 items-center gap-1.5",children:n}):null,t?(0,a.jsx)("div",{className:"ml-1 flex shrink-0",children:(0,a.jsx)("button",{type:"button",onClick:t,className:"inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)]","aria-label":"Open preferences",title:"Preferences",children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})}):null]})})},84527:(e,t,n)=>{n.d(t,{J:()=>o});var a=n(31404),r=n(75120);async function i(e,t){let n=await fetch((0,a.S)(`/api/sessions/${encodeURIComponent(e)}/archive`,t),{method:"POST"}),r=await n.json().catch(()=>null);if(404===n.status&&(n=await fetch((0,a.S)(`/api/sessions/${encodeURIComponent(e)}/actions`,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"archive"})}),r=await n.json().catch(()=>null)),!n.ok)throw Error(r?.error??`Failed to archive session: ${n.status}`)}async function o(e,t){let n=(0,r.Kc)(e,t);try{await i(e,t?.bridgeId)}catch(e){throw n(),e}}},85626:(e,t,n)=>{n.d(t,{$E:()=>u,ww:()=>d,zu:()=>c});let a="abstract-sound-4",r={"abstract-sound-1":{steps:[{frequency:784,durationMs:90,gain:.24},{frequency:988,durationMs:90,gain:.22},{frequency:1175,durationMs:120,gain:.2}]},"abstract-sound-2":{steps:[{frequency:659,durationMs:120,gain:.22},{frequency:523,durationMs:140,gain:.2},{frequency:659,durationMs:120,gain:.18}]},"abstract-sound-3":{steps:[{frequency:440,durationMs:80,gain:.22},{frequency:554,durationMs:80,gain:.22},{frequency:659,durationMs:90,gain:.2},{frequency:880,durationMs:120,gain:.18}]},"abstract-sound-4":{steps:[{frequency:523,durationMs:130,gain:.22},{frequency:659,durationMs:130,gain:.2},{frequency:784,durationMs:150,gain:.18}]},"cow-mooing":{steps:[{frequency:220,durationMs:220,type:"triangle",gain:.24},{frequency:174,durationMs:260,type:"triangle",gain:.2}]},"phone-vibration":{vibrate:[120,60,120,60,180],steps:[{frequency:180,durationMs:140,gain:.16},{frequency:220,durationMs:140,gain:.14}]},rooster:{steps:[{frequency:784,durationMs:70,type:"square",gain:.24},{frequency:1046,durationMs:70,type:"square",gain:.22},{frequency:1318,durationMs:90,type:"square",gain:.2},{frequency:1568,durationMs:120,type:"square",gain:.18}]}},i=null;function o(){let e=window,t=e.AudioContext??e.webkitAudioContext;return t?(i||(i=new t),i):null}function s(e){let t=e?.trim();return t&&t in r?t:a}function l(e,t,n){return Math.min(n,Math.max(t,e))}function d(e){return s(e)}async function c(){let e=o();if(!e)return!1;if("suspended"===e.state)try{await e.resume()}catch{return!1}return"running"===e.state}async function u(e,t){let n=s(e),a=r[n];if("phone-vibration"===n&&a.vibrate&&"u">typeof navigator&&"function"==typeof navigator.vibrate)return navigator.vibrate(a.vibrate);let i=o();if(!i||!a.steps||0===a.steps.length)return!1;if("suspended"===i.state)try{await i.resume()}catch{return!1}if("running"!==i.state)return!1;let d=l(t?.volume??.4,.05,.8),c=i.currentTime+.02;for(let e of a.steps)!function(e,t,n,a){let r=e.createOscillator(),i=e.createGain(),o=l((n.gain??1)*a,.02,.9),s=Math.max(.04,n.durationMs/1e3),d=t+Math.max(.015,Math.min(.05,.35*s)),c=t+Math.max(.02,.7*s),u=t+s;r.type=n.type??"sine",r.frequency.setValueAtTime(n.frequency,t),i.gain.setValueAtTime(1e-4,t),i.gain.linearRampToValueAtTime(o,d),i.gain.exponentialRampToValueAtTime(1e-4,c),i.gain.setValueAtTime(1e-4,u),r.connect(i),i.connect(e.destination),r.start(t),r.stop(u+.05)}(i,c,e,d),c+=Math.max(.06,e.durationMs/1e3+.04);return!0}},86011:(e,t,n)=>{n.d(t,{Q:()=>c});var a=n(7620),r=n(31404),i=n(85626);function o(){return"u"<typeof document||"visible"===document.visibilityState}function s(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function l(e){return`${e.id}::${e.timestamp}`}function d(e){null!==e.current&&(window.clearTimeout(e.current),e.current=null)}function c({enabled:e,projectId:t,preferences:n,bridgeId:u}){let p=(0,a.useRef)(n?.soundEnabled!==!1),f=(0,a.useRef)((0,i.ww)(n?.soundFile)),m=(0,a.useRef)(new Set),g=(0,a.useRef)(null),h=(0,a.useRef)(!1),b=(0,a.useRef)(null),v=(0,a.useRef)(null),y=(0,a.useRef)(null);(0,a.useEffect)(()=>{p.current=n?.soundEnabled!==!1,f.current=(0,i.ww)(n?.soundFile)},[n?.soundEnabled,n?.soundFile]),(0,a.useEffect)(()=>{if(!e)return;let n=t?.trim()||null,a=u?.trim()||null,c=`${a??"local"}::${n??""}`;b.current!==c&&(b.current=c,m.current=new Set,g.current=null,h.current=!1);let w=!1,x=async e=>{if(w||!o())return;if(v.current)return void await v.current;let t=(async()=>{let t=new URLSearchParams({limit:"20"});n&&t.set("project",n),!e&&g.current&&t.set("since",g.current);try{var o;let n,d=await fetch((0,r.S)(`/api/notifications?${t.toString()}`,a),{cache:"no-store"});if(!d.ok)return;let c=(o=await d.json().catch(()=>null),n=s(o),(Array.isArray(n.notifications)?n.notifications:[]).map(e=>{var t;let n,a,r,i,o,l,d,c;return n=s(e),a="string"==typeof n.id?n.id.trim():"",r="string"==typeof n.message?n.message.trim():"",i="string"==typeof n.timestamp?n.timestamp.trim():"",o="string"==typeof n.sessionId?n.sessionId.trim():"",l="string"==typeof n.projectId?n.projectId.trim():"",d="string"==typeof n.type?n.type.trim():"",c="high"===(t=n.priority)||"medium"===t||"low"===t?n.priority:"low",a&&r&&i&&o&&l&&d?{id:a,priority:c,message:r,timestamp:i,sessionId:o,projectId:l,type:d}:null}).filter(e=>null!==e).sort((e,t)=>{let n=Date.parse(t.timestamp)-Date.parse(e.timestamp);return 0!==n?n:t.id.localeCompare(e.id)}));if(0===c.length){h.current=!0;return}if(g.current=c[0]?.timestamp??null,e||!h.current){for(let e of c)m.current.add(l(e));h.current=!0;return}let u=c.filter(e=>!m.current.has(l(e)));for(let e of c)m.current.add(l(e));if(0===u.length)return;let b=u.find(e=>"high"===e.priority)??u.find(e=>"medium"===e.priority)??u[0]??null;if(!b||"low"===b.priority||!p.current)return;await (0,i.$E)(f.current)}catch{}})();v.current=t;try{await t}finally{v.current===t&&(v.current=null),h.current=!0}},C=()=>{d(y),!w&&o()&&(y.current=window.setTimeout(()=>{x(!1).finally(()=>{C()})},1e4))},k=()=>{!w&&o()&&x(!h.current).finally(()=>{C()})},A=()=>{o()?k():d(y)},j=()=>{o()&&k()},S=()=>{(0,i.zu)()};return k(),window.addEventListener("focus",j),document.addEventListener("visibilitychange",A),window.addEventListener("pointerdown",S,!0),window.addEventListener("touchstart",S,!0),window.addEventListener("keydown",S,!0),()=>{w=!0,d(y),window.removeEventListener("focus",j),document.removeEventListener("visibilitychange",A),window.removeEventListener("pointerdown",S,!0),window.removeEventListener("touchstart",S,!0),window.removeEventListener("keydown",S,!0)}},[u,e,t])}},92070:(e,t,n)=>{n.d(t,{w:()=>o});let a=/\r?\n\r?\n/;function r(e){return e.trimStart()}function i(e){let t=null,n=[];for(let a of e.split(/\r?\n/))!a.startsWith(":")&&(a.startsWith("event:")?t=r(a.slice(6)):a.startsWith("data:")&&n.push(r(a.slice(5))));return 0===n.length?null:{event:t,data:n.join("\n")}}async function*o(e,t){let n=e.getReader(),r=new TextDecoder,o="";try{for(;;){if(t?.aborted)return;let{done:e,value:s}=await n.read();if(e){let e=r.decode(void 0,{stream:!1});e.length>0&&(o+=e)}else s&&(o+=r.decode(s,{stream:!0}));for(;;){let e=o.match(a);if(!e||"number"!=typeof e.index)break;let t=o.slice(0,e.index);o=o.slice(e.index+e[0].length);let n=i(t);n&&(yield n)}if(e){let e=i(o);e&&(yield e);break}}}finally{n.releaseLock()}}},95106:(e,t,n)=>{n.d(t,{t:()=>r});var a=n(75120);function r(e,t){return(0,a.eI)(e,t)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9542],{14796:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(13454).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},39542:(e,t,n)=>{n.r(t),n.d(t,{SessionTerminal:()=>C});var r=n(54568),l=n(26083),i=n(13454);let a=(0,i.A)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]),s=(0,i.A)("square-stop",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);var o=n(58299),c=n(60527),u=n(14796),d=n(36645),m=n(82797),h=n(7620),f=n(76081),p=n(31404);let w=new Set(["queued","spawning","running","working","needs_input","stuck"]),b=new Set(["done","needs_input","stuck","errored","terminated","killed"]);var x=n(63680);function g(e){return"127.0.0.1"===e||"localhost"===e||"::1"===e}function y(e){return e.length>1&&e.endsWith("/")?e.replace(/\/+$/,""):e}function v(e){return e.startsWith("/api/sessions/")&&e.includes("/terminal/ttyd")}async function k(e,t){let n=await fetch((0,p.S)(`/api/sessions/${encodeURIComponent(e)}/terminal/token`,t?.bridgeId),{cache:"no-store",signal:t?.signal}),r=await n.json().catch(()=>null),l="string"==typeof r?.ttydHttpUrl&&r.ttydHttpUrl.trim().length>0?r.ttydHttpUrl.trim():null,i="string"==typeof r?.ttydWsUrl&&r.ttydWsUrl.trim().length>0?r.ttydWsUrl.trim():null,a=(()=>{let e=r?.expiresInSeconds;if("number"==typeof e&&Number.isFinite(e))return Math.max(0,Math.floor(e));if("string"==typeof e){let t=Number.parseInt(e.trim(),10);if(Number.isFinite(t))return Math.max(0,t)}return null})();return 401===n.status||403===n.status?{interactive:!1,ttydHttpUrl:null,ttydWsUrl:null,reason:r?.error??"Terminal access denied"}:n.ok?{interactive:!0,ttydHttpUrl:l,ttydWsUrl:i,expiresInSeconds:a}:{interactive:!1,ttydHttpUrl:null,ttydWsUrl:null,reason:r?.error??"Terminal unavailable"}}async function j(e,t){let n=function(){let e=function(){if("u"<typeof document)return null;let e=document.querySelector('meta[name="conductor-backend-url"]'),t=e?.content?.trim();if(!t)return null;try{let e=window.location.origin,n=new URL(t,e);if("http:"!==n.protocol&&"https:"!==n.protocol)return null;{let e=new URL(window.location.origin);g(n.hostname)&&!g(e.hostname)&&(n.hostname=e.hostname,"https:"===e.protocol&&"http:"===n.protocol&&(n.protocol="https:"))}return n.toString()}catch{return null}}();if(e)return e;let t=x.env.NEXT_PUBLIC_CONDUCTOR_BACKEND_URL?.trim();if(t)return t;let{protocol:n,hostname:r,origin:l,port:i}=window.location;return"3000"===i||"4747"===i?`${n}//${r}:4749`:l}(),r=window.location.origin,l=await k(e,t);if(!l.interactive)return{terminalUrl:null,interactive:!1,reason:l.reason,expiresInSeconds:null};let i=function(e,t,n,r){let l=e??t;if(!l)return null;try{let e=(()=>{try{return new URL(l,r).pathname}catch{return null}})(),t=e&&v(e)?r:n,i=new URL(l,t);return"ws:"===i.protocol&&(i.protocol="http:"),"wss:"===i.protocol&&(i.protocol="https:"),"/ws"===i.pathname?i.pathname="/":i.pathname.endsWith("/ws")&&(i.pathname=y(i.pathname.slice(0,-3))),i.pathname=y(i.pathname),i.hash="",i.toString()}catch{return null}}(l.ttydHttpUrl,l.ttydWsUrl,n,r);return i?{terminalUrl:function(e,t){let n=t?.trim();if(!n)return e;try{let t=new URL(e);if(!v(t.pathname))return e;return t.searchParams.set("bridgeId",n),t.toString()}catch{return e}}(i,t?.bridgeId),interactive:!0,reason:null,expiresInSeconds:l.expiresInSeconds}:{terminalUrl:null,interactive:!1,reason:"Failed to resolve the ttyd terminal URL."}}function N(e){if(!e)return null;try{let t=new URL(e);return t.searchParams.delete("token"),t.hash="",t.toString()}catch{return e}}var S=n(86181);let U=new Set(["archived","killed","terminated","restored"]);async function L(e,t,n){let r=await fetch((0,p.S)(`/api/sessions/${encodeURIComponent(e)}/keys`,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Failed to queue terminal input (${r.status})`)}}function E(e,t){if(!e||!t||null===e.contentWindow)return;let n="*";try{n=new URL(e.src).origin}catch{}e.contentWindow.postMessage({type:"conductor-ttyd-auth-token",token:t},n)}function R(e){let{sessionId:t,bridgeId:n,sessionState:i,runtimeMode:x,pendingInsert:g,immersiveMobileMode:y=!1,onPendingInsertConsumed:v}=e,k=(0,h.useRef)(null),R=(0,h.useRef)(0),C=(0,h.useRef)(0),A=(0,h.useRef)(null),I=(0,h.useRef)(!1),T=(0,h.useRef)(null),M=(0,h.useRef)(0),_=(0,h.useMemo)(()=>i.trim().toLowerCase(),[i]),P=x?.trim().toLowerCase()??null,$="ttyd"===P,z=$?!U.has(_):w.has(_),O=!$&&!y&&b.has(_),[W,F]=(0,h.useState)(null),[H,q]=(0,h.useState)(null),[D,B]=(0,h.useState)(z),[K,V]=(0,h.useState)(null),[J,X]=(0,h.useState)(!1),[G,Q]=(0,h.useState)(0),[Y,Z]=(0,h.useState)(""),[ee,et]=(0,h.useState)(!1),[en,er]=(0,h.useState)(null),[el,ei]=(0,h.useState)(null),[ea,es]=(0,h.useState)(!1),eo=(0,h.useRef)(null),ec=(0,h.useRef)(!1),eu=(0,h.useCallback)(()=>{let e=function(e){if(!e)return null;try{let t=new URL(e).searchParams.get("token")?.trim();return t&&t.length>0?t:null}catch{return null}}(H);e&&E(A.current?.querySelector("iframe"),e)},[H]);(0,h.useEffect)(()=>{eo.current=W},[W]),(0,h.useEffect)(()=>{I.current=J},[J]),(0,h.useEffect)(()=>{R.current=0,C.current=0,F(null),q(null),B(z),V(null),X(!1),Q(0),Z(""),et(!1),er(null),ei(null),ec.current=!1,I.current=!1,T.current=null,M.current=0},[z,t]),(0,h.useEffect)(()=>{if(!z){B(!1),V(null);return}let e=!1,r=null,l=null,i=new AbortController;return B(!0),V(null),j(t,{signal:i.signal,bridgeId:n}).then(t=>{if(!e){if(C.current=0,t.interactive&&t.terminalUrl){var n,r,i;let e,a,s=ec.current||(n=eo.current,r=t.terminalUrl,e=N(n),a=N(r),!e||e!==a);ec.current=!1,q(t.terminalUrl);let o=!s&&eo.current&&function(e,t){if(!e)return!1;try{let n=new URL(e),r=new URL(t);if(n.origin!==r.origin||n.pathname!==r.pathname)return!1;let l=new URLSearchParams(n.searchParams),i=new URLSearchParams(r.searchParams);l.delete("token"),i.delete("token");let a=l.toString(),s=i.toString();if(a!==s)return!1;let o=new URL(e).searchParams.get("token"),c=new URL(t).searchParams.get("token");return o!==c}catch{return!1}}(eo.current,t.terminalUrl);if(s||!eo.current)eo.current||X(!1),F(t.terminalUrl);else if(o){let e=(()=>{try{return new URL(t.terminalUrl).searchParams.get("token")}catch{return null}})();if(e){let t=A.current?.querySelector("iframe");t&&E(t,e)}}V(null);let c="number"!=typeof(i=t.expiresInSeconds)||!Number.isFinite(i)||i<=0?null:1e3*Math.max(5,i-10);null!==c&&(l=window.setTimeout(()=>{Q(e=>e+1)},c));return}eo.current||(F(null),q(null),X(!1)),V(t.reason??"Live ttyd terminal is unavailable.")}}).catch(t=>{if(e||t instanceof DOMException&&"AbortError"===t.name)return;let n=!!eo.current;n||(F(null),q(null),X(!1)),V(t instanceof Error?t.message:"Failed to resolve ttyd terminal.");let l=C.current,i=n?5e3:Math.min(4e3,500*2**l);C.current=n?0:Math.min(l+1,3),r=window.setTimeout(()=>{Q(e=>e+1)},i)}).finally(()=>{e||B(!1)}),()=>{e=!0,i.abort(),null!==r&&window.clearTimeout(r),null!==l&&window.clearTimeout(l)}},[n,G,z,t]);let ed=(0,h.useCallback)(()=>{if(!z)return;let e=window.Date.now();if(e-M.current<1500)return;M.current=e;let t=null===T.current?0:e-T.current;T.current=null,eu(),t>=3e5&&I.current&&eo.current&&(ec.current=!0),Q(e=>e+1)},[z,eu]);(0,h.useEffect)(()=>{if("u"<typeof document)return;let e=()=>{if("hidden"===document.visibilityState){T.current=window.Date.now();return}"visible"===document.visibilityState&&ed()},t=()=>{ed()};return document.addEventListener("visibilitychange",e),window.addEventListener("focus",t),window.addEventListener("pageshow",t),window.addEventListener("online",t),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",t),window.removeEventListener("pageshow",t),window.removeEventListener("online",t)}},[ed]),(0,h.useEffect)(()=>{if(!g||g.nonce<=R.current)return;R.current=g.nonce;let e=g.inlineText.trim();if(0===e.length)return;let r=!1;return L(t,`${e} `,n).then(()=>{r||(ei(null),v?.())}).catch(e=>{r||ei(e instanceof Error?e.message:"Failed to queue terminal input.")}),()=>{r=!0}},[n,v,g,t]),(0,h.useEffect)(()=>{J&&eu()},[J,eu]);let em=(0,h.useCallback)(async()=>{let e=Y.trim();if(0!==e.length&&!ee){et(!0),er(null);try{let r=await fetch((0,p.S)(`/api/sessions/${encodeURIComponent(t)}/actions`,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"send",message:e})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Failed to send message (${r.status})`)}Z(""),k.current?.focus()}catch(e){er(e instanceof Error?e.message:"Failed to send message")}finally{et(!1)}}},[n,Y,ee,t]),eh=(0,h.useCallback)(async()=>{try{let e=await navigator.clipboard.readText();e&&await L(t,e,n)}catch{}},[n,t]),ef=(0,h.useCallback)(async()=>{await L(t,"\x03",n)},[n,t]),ep=(0,h.useCallback)(()=>{let e=A.current;if(!e)return;let t=window.visualViewport;if(!t)return;let{usableHeight:n,keyboardVisible:r}=(0,S.wP)(window.innerHeight,t.height,t.offsetTop,e.getBoundingClientRect().top);if(!r){e.style.removeProperty("height"),es(!1);return}n<=0?e.style.removeProperty("height"):(e.style.height=`${Math.max(0,Math.round(n))}px`,es(!0))},[]);(0,h.useEffect)(()=>{let e=A.current;if(!e)return;let t=null,n=()=>{null===t&&(t=window.setTimeout(()=>{t=null,ep()},16))};n();let r="u"<typeof ResizeObserver?null:new ResizeObserver(()=>{n()}),l=window.visualViewport;return r?.observe(e),window.addEventListener("resize",n),l?.addEventListener("resize",n),l?.addEventListener("scroll",n),()=>{r?.disconnect(),window.removeEventListener("resize",n),l?.removeEventListener("resize",n),l?.removeEventListener("scroll",n),null!==t&&window.clearTimeout(t),e.style.removeProperty("height")}},[ep,z,W]),(0,h.useEffect)(()=>{},[K,z,J,P,en,el,D,t,W,H,$]);let ew=(0,h.useCallback)(()=>{V(null),C.current=0,ec.current=!0,Q(e=>e+1)},[]),eb=z?"Connecting live terminal":O?"Session is waiting for input":"Live terminal is not active",ex=K??(z?"Reconnecting to the existing ttyd terminal.":$?"This ttyd terminal is no longer attached. It only closes after an explicit kill or archive.":O?"Send a follow-up below to relaunch the agent in a fresh ttyd terminal.":`Session status is \`${_}\`. Interactive ttyd terminals only run while the agent is active.`),eg=H??W??void 0;return(0,r.jsxs)("div",{className:y?"group/terminal relative flex h-full min-h-0 min-w-0 w-full flex-1 flex-col overflow-hidden bg-[#060404]":"group/terminal relative flex h-full min-h-0 min-w-0 w-full flex-1 flex-col overflow-hidden rounded-none border-0 bg-[#060404] lg:rounded-[14px] lg:border lg:border-white/10 lg:shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]",children:[(0,r.jsxs)("div",{className:"absolute right-2 top-2 z-10 flex items-center gap-2 sm:right-3 sm:top-3",children:[eg?(0,r.jsx)("a",{href:eg,target:"_blank",rel:"noreferrer",className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-white/10 bg-[#141010]/92 text-[#c9c0b7] backdrop-blur-sm transition hover:bg-[#201818] sm:h-7 sm:w-7","aria-label":"Open ttyd terminal in a new tab",children:(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"})}):null,window.matchMedia?.("(pointer: coarse)").matches?(0,r.jsx)(f.$,{type:"button",size:"icon",variant:"ghost",className:"h-9 w-9 rounded-full border border-white/10 bg-[#141010]/92 text-[#c9c0b7] backdrop-blur-sm hover:bg-[#201818] sm:h-7 sm:w-7",onClick:eh,"aria-label":"Paste from clipboard",children:(0,r.jsx)(a,{className:"h-3.5 w-3.5"})}):null,(0,r.jsx)(f.$,{type:"button",size:"icon",variant:"ghost",className:"h-9 w-9 rounded-full border border-white/10 bg-[#141010]/92 text-[#c9c0b7] backdrop-blur-sm hover:bg-[#201818] sm:h-7 sm:w-7",onClick:ef,"aria-label":"Soft stop (Ctrl+C)",children:(0,r.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(f.$,{type:"button",size:"icon",variant:"ghost",className:"h-9 w-9 rounded-full border border-white/10 bg-[#141010]/92 text-[#c9c0b7] backdrop-blur-sm hover:bg-[#201818] sm:h-7 sm:w-7",onClick:ew,"aria-label":"Reload ttyd terminal",children:D?(0,r.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(c.A,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)("div",{className:y?"min-h-0 min-w-0 flex-1 overflow-hidden px-0 pb-[env(safe-area-inset-bottom)] pt-0 w-full":"min-h-0 min-w-0 flex-1 overflow-hidden px-0.5 pb-0 pt-0.5 lg:px-1.5 lg:pb-1 lg:pt-3 w-full",children:z&&W?(0,r.jsxs)("div",{ref:A,className:"relative min-h-0 flex-1 w-full overflow-hidden rounded-[10px] bg-[#060404] pb-[env(safe-area-inset-bottom)]",children:[J?null:(0,r.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-[#060404]",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-[#141010]/92 px-3 py-2 text-[12px] text-[#c9c0b7] backdrop-blur-sm",children:[(0,r.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}),(0,r.jsx)("span",{children:"Loading ttyd terminal…"})]})}),(0,r.jsx)("iframe",{title:`ttyd terminal for ${t}`,src:W,className:"min-h-0 flex-1 w-full border-0 bg-[#060404]",allow:"clipboard-read; clipboard-write",loading:"eager",onLoad:()=>{X(!0),V(null),ep(),eu()}},t)]}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center p-4",children:(0,r.jsx)("div",{className:"max-w-lg rounded-[16px] border border-white/10 bg-[#141010]/92 p-5 text-[#efe8e1] shadow-[0_24px_48px_rgba(0,0,0,0.34)]",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"mt-0.5 rounded-full border border-white/10 bg-[#201818] p-2 text-[#c9c0b7]",children:K?(0,r.jsx)(u.A,{className:"h-4 w-4"}):(0,r.jsx)(o.A,{className:`h-4 w-4 ${D?"animate-spin":""}`})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-[14px] font-medium",children:eb}),(0,r.jsx)("div",{className:"mt-1 text-[12px] leading-5 text-[#a79c94]",children:ex}),eg?(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)("a",{href:eg,target:"_blank",rel:"noreferrer",className:"text-[12px] text-[#d7c6b7] underline underline-offset-4",children:"Open the ttyd terminal directly"})}):null]})]})})})}),!O&&el?(0,r.jsx)("div",{className:"absolute inset-x-0 bottom-0 z-10 border-t border-white/12 bg-[#161212] px-3 py-2 text-[11px] text-[#ffb39e] backdrop-blur-sm [padding-bottom:env(safe-area-inset-bottom)]",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(u.A,{className:"h-3 w-3 shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:el}),(0,r.jsx)("button",{type:"button",className:"ml-auto shrink-0 text-[#8e847d] hover:text-[#c9c0b7]",onClick:()=>ei(null),children:(0,r.jsx)(d.A,{className:"h-3 w-3"})})]})}):null,O?(0,r.jsxs)("div",{className:"absolute inset-x-0 bottom-0 z-10 border-t border-white/12 bg-[#161212] backdrop-blur-sm [padding-bottom:env(safe-area-inset-bottom)]",children:[el?(0,r.jsxs)("div",{className:"flex items-center gap-1.5 px-3 pt-1.5 text-[11px] text-[#ffb39e]",children:[(0,r.jsx)(u.A,{className:"h-3 w-3 shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:el}),(0,r.jsx)("button",{type:"button",className:"ml-auto shrink-0 text-[#8e847d] hover:text-[#c9c0b7]",onClick:()=>ei(null),children:(0,r.jsx)(d.A,{className:"h-3 w-3"})})]}):null,en?(0,r.jsxs)("div",{className:"flex items-center gap-1.5 px-3 pt-1.5 text-[11px] text-[#ff8f7a]",children:[(0,r.jsx)(u.A,{className:"h-3 w-3 shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:en}),(0,r.jsx)("button",{type:"button",className:"ml-auto shrink-0 text-[#8e847d] hover:text-[#c9c0b7]",onClick:()=>er(null),children:(0,r.jsx)(d.A,{className:"h-3 w-3"})})]}):null,(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),em()},className:"flex items-center gap-2 px-2 py-2 lg:px-3",children:[(0,r.jsx)("input",{ref:k,type:"text",value:Y,onChange:e=>Z(e.target.value),placeholder:"Send a follow-up message…",enterKeyHint:"done",disabled:ee,className:"h-8 min-w-0 flex-1 rounded-md border border-white/10 bg-[#0c0808] px-2.5 text-[12px] text-[#efe8e1] outline-none placeholder:text-[#7d746e] focus:border-white/20 disabled:opacity-50",onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.currentTarget.blur())}}),(0,r.jsx)(f.$,{type:"submit",size:"icon",variant:"ghost",disabled:ee||0===Y.trim().length,className:"h-8 w-8 shrink-0 rounded-md border border-white/10 bg-[#0c0808] text-[#c9c0b7] hover:bg-[#201818] disabled:opacity-30","aria-label":"Send message",children:ee?(0,r.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(m.A,{className:"h-3.5 w-3.5"})})]})]}):null]})}let C=(0,h.memo)(function(e){return(0,r.jsx)(R,{...e})},function(e,t){var n,r;return e.sessionId===t.sessionId&&e.projectId===t.projectId&&e.bridgeId===t.bridgeId&&e.sessionState===t.sessionState&&e.runtimeMode===t.runtimeMode&&e.immersiveMobileMode===t.immersiveMobileMode&&((n=e.pendingInsert)===(r=t.pendingInsert)||!!n&&!!r&&n.nonce===r.nonce&&n.inlineText===r.inlineText)})},82797:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(13454).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9542],{14796:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(13454).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},39542:(e,t,n)=>{n.r(t),n.d(t,{SessionTerminal:()=>C});var r=n(54568),l=n(26083),i=n(13454);let a=(0,i.A)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]),s=(0,i.A)("square-stop",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);var o=n(58299),c=n(60527),u=n(14796),d=n(36645),m=n(82797),h=n(7620),f=n(76081),p=n(31404);let w=new Set(["queued","spawning","running","working","needs_input","stuck"]),b=new Set(["done","needs_input","stuck","errored","terminated","killed"]);var x=n(63680);function g(e){return"127.0.0.1"===e||"localhost"===e||"::1"===e}function y(e){return e.length>1&&e.endsWith("/")?e.replace(/\/+$/,""):e}function v(e){return e.startsWith("/api/sessions/")&&e.includes("/terminal/ttyd")}async function k(e,t){let n=await fetch((0,p.S)(`/api/sessions/${encodeURIComponent(e)}/terminal/token`,t?.bridgeId),{cache:"no-store",signal:t?.signal}),r=await n.json().catch(()=>null),l="string"==typeof r?.ttydHttpUrl&&r.ttydHttpUrl.trim().length>0?r.ttydHttpUrl.trim():null,i="string"==typeof r?.ttydWsUrl&&r.ttydWsUrl.trim().length>0?r.ttydWsUrl.trim():null,a=(()=>{let e=r?.expiresInSeconds;if("number"==typeof e&&Number.isFinite(e))return Math.max(0,Math.floor(e));if("string"==typeof e){let t=Number.parseInt(e.trim(),10);if(Number.isFinite(t))return Math.max(0,t)}return null})();return 401===n.status||403===n.status?{interactive:!1,ttydHttpUrl:null,ttydWsUrl:null,reason:r?.error??"Terminal access denied"}:n.ok?{interactive:!0,ttydHttpUrl:l,ttydWsUrl:i,expiresInSeconds:a}:{interactive:!1,ttydHttpUrl:null,ttydWsUrl:null,reason:r?.error??"Terminal unavailable"}}async function j(e,t){let n=function(){let e=function(){if("u"<typeof document)return null;let e=document.querySelector('meta[name="conductor-backend-url"]'),t=e?.content?.trim();if(!t)return null;try{let e=window.location.origin,n=new URL(t,e);if("http:"!==n.protocol&&"https:"!==n.protocol)return null;{let e=new URL(window.location.origin);g(n.hostname)&&!g(e.hostname)&&(n.hostname=e.hostname,"https:"===e.protocol&&"http:"===n.protocol&&(n.protocol="https:"))}return n.toString()}catch{return null}}();if(e)return e;let t=x.env.NEXT_PUBLIC_CONDUCTOR_BACKEND_URL?.trim();if(t)return t;let{protocol:n,hostname:r,origin:l,port:i}=window.location;return"3000"===i||"4747"===i?`${n}//${r}:4749`:l}(),r=window.location.origin,l=await k(e,t);if(!l.interactive)return{terminalUrl:null,interactive:!1,reason:l.reason,expiresInSeconds:null};let i=function(e,t,n,r){let l=e??t;if(!l)return null;try{let e=(()=>{try{return new URL(l,r).pathname}catch{return null}})(),t=e&&v(e)?r:n,i=new URL(l,t);return"ws:"===i.protocol&&(i.protocol="http:"),"wss:"===i.protocol&&(i.protocol="https:"),"/ws"===i.pathname?i.pathname="/":i.pathname.endsWith("/ws")&&(i.pathname=y(i.pathname.slice(0,-3))),i.pathname=y(i.pathname),i.hash="",i.toString()}catch{return null}}(l.ttydHttpUrl,l.ttydWsUrl,n,r);return i?{terminalUrl:function(e,t){let n=t?.trim();if(!n)return e;try{let t=new URL(e);if(!v(t.pathname))return e;return t.searchParams.set("bridgeId",n),t.toString()}catch{return e}}(i,t?.bridgeId),interactive:!0,reason:null,expiresInSeconds:l.expiresInSeconds}:{terminalUrl:null,interactive:!1,reason:"Failed to resolve the ttyd terminal URL."}}function N(e){if(!e)return null;try{let t=new URL(e);return t.searchParams.delete("token"),t.hash="",t.toString()}catch{return e}}var S=n(86181);let U=new Set(["archived","killed","terminated","restored"]);async function L(e,t,n){let r=await fetch((0,p.S)(`/api/sessions/${encodeURIComponent(e)}/keys`,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Failed to queue terminal input (${r.status})`)}}function E(e,t){if(!e||!t||null===e.contentWindow)return;let n="*";try{n=new URL(e.src).origin}catch{}e.contentWindow.postMessage({type:"conductor-ttyd-auth-token",token:t},n)}function R(e){let{sessionId:t,bridgeId:n,sessionState:i,runtimeMode:x,pendingInsert:g,immersiveMobileMode:y=!1,onPendingInsertConsumed:v}=e,k=(0,h.useRef)(null),R=(0,h.useRef)(0),C=(0,h.useRef)(0),A=(0,h.useRef)(null),I=(0,h.useRef)(!1),T=(0,h.useRef)(null),M=(0,h.useRef)(0),_=(0,h.useMemo)(()=>i.trim().toLowerCase(),[i]),$=x?.trim().toLowerCase()??null,P="ttyd"===$,z=P?!U.has(_):w.has(_),O=!P&&!y&&b.has(_),[W,F]=(0,h.useState)(null),[H,q]=(0,h.useState)(null),[D,B]=(0,h.useState)(z),[K,V]=(0,h.useState)(null),[J,X]=(0,h.useState)(!1),[G,Q]=(0,h.useState)(0),[Y,Z]=(0,h.useState)(""),[ee,et]=(0,h.useState)(!1),[en,er]=(0,h.useState)(null),[el,ei]=(0,h.useState)(null),[ea,es]=(0,h.useState)(!1),eo=(0,h.useRef)(null),ec=(0,h.useRef)(!1),eu=(0,h.useCallback)(()=>{let e=function(e){if(!e)return null;try{let t=new URL(e).searchParams.get("token")?.trim();return t&&t.length>0?t:null}catch{return null}}(H);e&&E(A.current?.querySelector("iframe"),e)},[H]);(0,h.useEffect)(()=>{eo.current=W},[W]),(0,h.useEffect)(()=>{I.current=J},[J]),(0,h.useEffect)(()=>{R.current=0,C.current=0,F(null),q(null),B(z),V(null),X(!1),Q(0),Z(""),et(!1),er(null),ei(null),ec.current=!1,I.current=!1,T.current=null,M.current=0},[z,t]),(0,h.useEffect)(()=>{if(!z){B(!1),V(null);return}let e=!1,r=null,l=null,i=new AbortController;return B(!0),V(null),j(t,{signal:i.signal,bridgeId:n}).then(t=>{if(!e){if(C.current=0,t.interactive&&t.terminalUrl){var n,r,i;let e,a,s=ec.current||(n=eo.current,r=t.terminalUrl,e=N(n),a=N(r),!e||e!==a);ec.current=!1,q(t.terminalUrl);let o=!s&&eo.current&&function(e,t){if(!e)return!1;try{let n=new URL(e),r=new URL(t);if(n.origin!==r.origin||n.pathname!==r.pathname)return!1;let l=new URLSearchParams(n.searchParams),i=new URLSearchParams(r.searchParams);l.delete("token"),i.delete("token");let a=l.toString(),s=i.toString();if(a!==s)return!1;let o=new URL(e).searchParams.get("token"),c=new URL(t).searchParams.get("token");return o!==c}catch{return!1}}(eo.current,t.terminalUrl);if(s||!eo.current)eo.current||X(!1),F(t.terminalUrl);else if(o){let e=(()=>{try{return new URL(t.terminalUrl).searchParams.get("token")}catch{return null}})();if(e){let t=A.current?.querySelector("iframe");t&&E(t,e)}}V(null);let c="number"!=typeof(i=t.expiresInSeconds)||!Number.isFinite(i)||i<=0?null:1e3*Math.max(5,i-10);null!==c&&(l=window.setTimeout(()=>{Q(e=>e+1)},c));return}eo.current||(F(null),q(null),X(!1)),V(t.reason??"Live ttyd terminal is unavailable.")}}).catch(t=>{if(e||t instanceof DOMException&&"AbortError"===t.name)return;let n=!!eo.current;n||(F(null),q(null),X(!1)),V(t instanceof Error?t.message:"Failed to resolve ttyd terminal.");let l=C.current,i=n?5e3:Math.min(4e3,500*2**l);C.current=n?0:Math.min(l+1,3),r=window.setTimeout(()=>{Q(e=>e+1)},i)}).finally(()=>{e||B(!1)}),()=>{e=!0,i.abort(),null!==r&&window.clearTimeout(r),null!==l&&window.clearTimeout(l)}},[n,G,z,t]);let ed=(0,h.useCallback)(()=>{if(!z)return;let e=window.Date.now();if(e-M.current<1500)return;M.current=e;let t=null===T.current?0:e-T.current;T.current=null,eu(),t>=3e5&&I.current&&eo.current&&(ec.current=!0),Q(e=>e+1)},[z,eu]);(0,h.useEffect)(()=>{if("u"<typeof document)return;let e=()=>{if("hidden"===document.visibilityState){T.current=window.Date.now();return}"visible"===document.visibilityState&&ed()},t=()=>{ed()};return document.addEventListener("visibilitychange",e),window.addEventListener("focus",t),window.addEventListener("pageshow",t),window.addEventListener("online",t),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",t),window.removeEventListener("pageshow",t),window.removeEventListener("online",t)}},[ed]),(0,h.useEffect)(()=>{if(!g||g.nonce<=R.current)return;R.current=g.nonce;let e=g.inlineText.trim();if(0===e.length)return;let r=!1;return L(t,`${e} `,n).then(()=>{r||(ei(null),v?.())}).catch(e=>{r||ei(e instanceof Error?e.message:"Failed to queue terminal input.")}),()=>{r=!0}},[n,v,g,t]),(0,h.useEffect)(()=>{J&&eu()},[J,eu]);let em=(0,h.useCallback)(async()=>{let e=Y.trim();if(0!==e.length&&!ee){et(!0),er(null);try{let r=await fetch((0,p.S)(`/api/sessions/${encodeURIComponent(t)}/actions`,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"send",message:e})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Failed to send message (${r.status})`)}Z(""),k.current?.focus()}catch(e){er(e instanceof Error?e.message:"Failed to send message")}finally{et(!1)}}},[n,Y,ee,t]),eh=(0,h.useCallback)(async()=>{try{let e=await navigator.clipboard.readText();e&&await L(t,e,n)}catch{}},[n,t]),ef=(0,h.useCallback)(async()=>{await L(t,"\x03",n)},[n,t]),ep=(0,h.useCallback)(()=>{let e=A.current;if(!e)return;let t=window.visualViewport;if(!t)return;let{usableHeight:n,keyboardVisible:r}=(0,S.wP)(window.innerHeight,t.height,t.offsetTop,e.getBoundingClientRect().top);if(!r){e.style.height="100%",es(!1);return}if(n<=0){e.style.height="100%";return}e.style.height=`${Math.max(0,Math.round(n))}px`,es(!0)},[]);(0,h.useEffect)(()=>{let e=A.current;if(!e)return;let t=null,n=()=>{null===t&&(t=window.setTimeout(()=>{t=null,ep()},16))};n();let r="u"<typeof ResizeObserver?null:new ResizeObserver(()=>{n()}),l=window.visualViewport;return r?.observe(e),window.addEventListener("resize",n),l?.addEventListener("resize",n),l?.addEventListener("scroll",n),()=>{r?.disconnect(),window.removeEventListener("resize",n),l?.removeEventListener("resize",n),l?.removeEventListener("scroll",n),null!==t&&window.clearTimeout(t),e.style.removeProperty("height")}},[ep,z,W]),(0,h.useEffect)(()=>{},[K,z,J,$,en,el,D,t,W,H,P]);let ew=(0,h.useCallback)(()=>{V(null),C.current=0,ec.current=!0,Q(e=>e+1)},[]),eb=z?"Connecting live terminal":O?"Session is waiting for input":"Live terminal is not active",ex=K??(z?"Reconnecting to the existing ttyd terminal.":P?"This ttyd terminal is no longer attached. It only closes after an explicit kill or archive.":O?"Send a follow-up below to relaunch the agent in a fresh ttyd terminal.":`Session status is \`${_}\`. Interactive ttyd terminals only run while the agent is active.`),eg=H??W??void 0;return(0,r.jsxs)("div",{className:y?"group/terminal relative flex min-h-0 min-w-0 w-full flex-1 flex-col overflow-hidden bg-[#060404]":"group/terminal relative flex min-h-0 min-w-0 w-full flex-1 flex-col overflow-hidden rounded-none border-0 bg-[#060404] lg:rounded-[14px] lg:border lg:border-white/10 lg:shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]",children:[(0,r.jsxs)("div",{className:"absolute right-2 top-2 z-10 flex items-center gap-2 sm:right-3 sm:top-3",children:[eg?(0,r.jsx)("a",{href:eg,target:"_blank",rel:"noreferrer",className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-white/10 bg-[#141010]/92 text-[#c9c0b7] backdrop-blur-sm transition hover:bg-[#201818] sm:h-7 sm:w-7","aria-label":"Open ttyd terminal in a new tab",children:(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"})}):null,window.matchMedia?.("(pointer: coarse)").matches?(0,r.jsx)(f.$,{type:"button",size:"icon",variant:"ghost",className:"h-9 w-9 rounded-full border border-white/10 bg-[#141010]/92 text-[#c9c0b7] backdrop-blur-sm hover:bg-[#201818] sm:h-7 sm:w-7",onClick:eh,"aria-label":"Paste from clipboard",children:(0,r.jsx)(a,{className:"h-3.5 w-3.5"})}):null,(0,r.jsx)(f.$,{type:"button",size:"icon",variant:"ghost",className:"h-9 w-9 rounded-full border border-white/10 bg-[#141010]/92 text-[#c9c0b7] backdrop-blur-sm hover:bg-[#201818] sm:h-7 sm:w-7",onClick:ef,"aria-label":"Soft stop (Ctrl+C)",children:(0,r.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(f.$,{type:"button",size:"icon",variant:"ghost",className:"h-9 w-9 rounded-full border border-white/10 bg-[#141010]/92 text-[#c9c0b7] backdrop-blur-sm hover:bg-[#201818] sm:h-7 sm:w-7",onClick:ew,"aria-label":"Reload ttyd terminal",children:D?(0,r.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(c.A,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)("div",{className:y?"min-h-0 min-w-0 h-0 flex-1 overflow-hidden px-0 pb-[env(safe-area-inset-bottom)] pt-0 w-full":"min-h-0 min-w-0 h-0 flex-1 overflow-hidden px-0.5 pb-0 pt-0.5 lg:px-1.5 lg:pb-1 lg:pt-3 w-full",children:z&&W?(0,r.jsxs)("div",{ref:A,className:"relative min-h-0 flex-1 w-full overflow-hidden rounded-[10px] bg-[#060404] pb-[env(safe-area-inset-bottom)]",children:[J?null:(0,r.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-[#060404]",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-[#141010]/92 px-3 py-2 text-[12px] text-[#c9c0b7] backdrop-blur-sm",children:[(0,r.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}),(0,r.jsx)("span",{children:"Loading ttyd terminal…"})]})}),(0,r.jsx)("iframe",{title:`ttyd terminal for ${t}`,src:W,className:"min-h-0 flex-1 w-full border-0 bg-[#060404]",allow:"clipboard-read; clipboard-write",loading:"eager",onLoad:()=>{X(!0),V(null),ep(),eu()}},t)]}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center p-4",children:(0,r.jsx)("div",{className:"max-w-lg rounded-[16px] border border-white/10 bg-[#141010]/92 p-5 text-[#efe8e1] shadow-[0_24px_48px_rgba(0,0,0,0.34)]",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"mt-0.5 rounded-full border border-white/10 bg-[#201818] p-2 text-[#c9c0b7]",children:K?(0,r.jsx)(u.A,{className:"h-4 w-4"}):(0,r.jsx)(o.A,{className:`h-4 w-4 ${D?"animate-spin":""}`})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-[14px] font-medium",children:eb}),(0,r.jsx)("div",{className:"mt-1 text-[12px] leading-5 text-[#a79c94]",children:ex}),eg?(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)("a",{href:eg,target:"_blank",rel:"noreferrer",className:"text-[12px] text-[#d7c6b7] underline underline-offset-4",children:"Open the ttyd terminal directly"})}):null]})]})})})}),!O&&el?(0,r.jsx)("div",{className:"absolute inset-x-0 bottom-0 z-10 border-t border-white/12 bg-[#161212] px-3 py-2 text-[11px] text-[#ffb39e] backdrop-blur-sm [padding-bottom:env(safe-area-inset-bottom)]",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(u.A,{className:"h-3 w-3 shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:el}),(0,r.jsx)("button",{type:"button",className:"ml-auto shrink-0 text-[#8e847d] hover:text-[#c9c0b7]",onClick:()=>ei(null),children:(0,r.jsx)(d.A,{className:"h-3 w-3"})})]})}):null,O?(0,r.jsxs)("div",{className:"absolute inset-x-0 bottom-0 z-10 border-t border-white/12 bg-[#161212] backdrop-blur-sm [padding-bottom:env(safe-area-inset-bottom)]",children:[el?(0,r.jsxs)("div",{className:"flex items-center gap-1.5 px-3 pt-1.5 text-[11px] text-[#ffb39e]",children:[(0,r.jsx)(u.A,{className:"h-3 w-3 shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:el}),(0,r.jsx)("button",{type:"button",className:"ml-auto shrink-0 text-[#8e847d] hover:text-[#c9c0b7]",onClick:()=>ei(null),children:(0,r.jsx)(d.A,{className:"h-3 w-3"})})]}):null,en?(0,r.jsxs)("div",{className:"flex items-center gap-1.5 px-3 pt-1.5 text-[11px] text-[#ff8f7a]",children:[(0,r.jsx)(u.A,{className:"h-3 w-3 shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:en}),(0,r.jsx)("button",{type:"button",className:"ml-auto shrink-0 text-[#8e847d] hover:text-[#c9c0b7]",onClick:()=>er(null),children:(0,r.jsx)(d.A,{className:"h-3 w-3"})})]}):null,(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),em()},className:"flex items-center gap-2 px-2 py-2 lg:px-3",children:[(0,r.jsx)("input",{ref:k,type:"text",value:Y,onChange:e=>Z(e.target.value),placeholder:"Send a follow-up message…",enterKeyHint:"done",disabled:ee,className:"h-8 min-w-0 flex-1 rounded-md border border-white/10 bg-[#0c0808] px-2.5 text-[12px] text-[#efe8e1] outline-none placeholder:text-[#7d746e] focus:border-white/20 disabled:opacity-50",onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.currentTarget.blur())}}),(0,r.jsx)(f.$,{type:"submit",size:"icon",variant:"ghost",disabled:ee||0===Y.trim().length,className:"h-8 w-8 shrink-0 rounded-md border border-white/10 bg-[#0c0808] text-[#c9c0b7] hover:bg-[#201818] disabled:opacity-30","aria-label":"Send message",children:ee?(0,r.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(m.A,{className:"h-3.5 w-3.5"})})]})]}):null]})}let C=(0,h.memo)(function(e){return(0,r.jsx)(R,{...e})},function(e,t){var n,r;return e.sessionId===t.sessionId&&e.projectId===t.projectId&&e.bridgeId===t.bridgeId&&e.sessionState===t.sessionState&&e.runtimeMode===t.runtimeMode&&e.immersiveMobileMode===t.immersiveMobileMode&&((n=e.pendingInsert)===(r=t.pendingInsert)||!!n&&!!r&&n.nonce===r.nonce&&n.inlineText===r.inlineText)})},82797:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(13454).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])}}]);
|
package/web/.next/static/chunks/app/{layout-8bbef88f241abf1b.js → layout-0d42201507b180f9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{46916:(e,r,t)=>{"use strict";t.d(r,{cn:()=>s});var o=t(9917),n=t(2809);function s(...e){return(0,n.QP)((0,o.$)(e))}},48204:(e,r,t)=>{"use strict";t.d(r,{ThemeProvider:()=>d});var o=t(54568),n=t(7620);let s=(0,n.createContext)({theme:"dark",toggleTheme:()=>{}});function i(e){let r=document.documentElement;r.classList.remove("dark","light"),r.classList.add(e)}function d({children:e}){let[r,t]=(0,n.useState)("dark");(0,n.useEffect)(()=>{let e=localStorage.getItem("conductor-theme");if("light"===e||"dark"===e){t(e),i(e);return}i("dark")},[]);let a=(0,n.useCallback)(()=>{t(e=>{let r="dark"===e?"light":"dark";return localStorage.setItem("conductor-theme",r),i(r),r})},[]);return(0,o.jsx)(s.Provider,{value:{theme:r,toggleTheme:a},children:e})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{46916:(e,r,t)=>{"use strict";t.d(r,{cn:()=>s});var o=t(9917),n=t(2809);function s(...e){return(0,n.QP)((0,o.$)(e))}},48204:(e,r,t)=>{"use strict";t.d(r,{ThemeProvider:()=>d});var o=t(54568),n=t(7620);let s=(0,n.createContext)({theme:"dark",toggleTheme:()=>{}});function i(e){let r=document.documentElement;r.classList.remove("dark","light"),r.classList.add(e)}function d({children:e}){let[r,t]=(0,n.useState)("dark");(0,n.useEffect)(()=>{let e=localStorage.getItem("conductor-theme");if("light"===e||"dark"===e){t(e),i(e);return}i("dark")},[]);let a=(0,n.useCallback)(()=>{t(e=>{let r="dark"===e?"light":"dark";return localStorage.setItem("conductor-theme",r),i(r),r})},[]);return(0,o.jsx)(s.Provider,{value:{theme:r,toggleTheme:a},children:e})}},69560:(e,r,t)=>{"use strict";t.d(r,{y:()=>n});var o=t(5974);let n=(0,o.createServerReference)("008dc77c9933e12e1ac5cc19e642659ac65c52e9cb",o.callServer,void 0,o.findSourceMapURL,"invalidateCacheAction")},73894:(e,r,t)=>{"use strict";t.d(r,{A:()=>n});var o=t(5974);let n=(0,o.createServerReference)("00312661be7b38656f0d015c71f2e31512f3d03bd5",o.callServer,void 0,o.findSourceMapURL,"detectKeylessEnvDriftAction")},74471:()=>{},92690:(e,r,t)=>{"use strict";t.d(r,{TooltipProvider:()=>d});var o=t(54568),n=t(97257),s=t(7620),i=t(46916);let d=n.Kq;n.bL,n.l9,(0,s.forwardRef)(({className:e,sideOffset:r=8,...t},s)=>(0,o.jsx)(n.ZL,{children:(0,o.jsx)(n.UC,{ref:s,sideOffset:r,className:(0,i.cn)("z-50 rounded-[var(--radius-xs)] border border-[var(--border-strong)] bg-[var(--bg-panel)] px-2 py-1.5","text-[11px] text-[var(--text-normal)] shadow-[var(--shadow-soft)]","animate-in fade-in-0 zoom-in-95",e),...t})})).displayName="TooltipContent"},98709:(e,r,t)=>{Promise.resolve().then(t.bind(t,37204)),Promise.resolve().then(t.bind(t,36727)),Promise.resolve().then(t.bind(t,76940)),Promise.resolve().then(t.bind(t,48914)),Promise.resolve().then(t.bind(t,30679)),Promise.resolve().then(t.bind(t,62520)),Promise.resolve().then(t.bind(t,93603)),Promise.resolve().then(t.t.bind(t,48477,23)),Promise.resolve().then(t.t.bind(t,91745,23)),Promise.resolve().then(t.t.bind(t,79584,23)),Promise.resolve().then(t.t.bind(t,84978,23)),Promise.resolve().then(t.t.bind(t,74471,23)),Promise.resolve().then(t.bind(t,48204)),Promise.resolve().then(t.bind(t,92690))}},e=>{e.O(0,[9271,9306,3357,524,3051,8510,587,1968,7358],()=>e(e.s=98709)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[824],{18510:(e,t,n)=>{"use strict";n.d(t,{J:()=>s,s:()=>r});var i=n(10926);function s(e){let t=(0,i.C0)(e);if(!t)return"/";let n=new URLSearchParams;return n.set("bridge",t),`/?${n.toString()}`}function r(e,t={}){let n,s=e.trim(),d=(0,i.DW)(s)?s:(n=(0,i.C0)(t.bridgeId))?(0,i.Bp)(n,s):s,l=new URLSearchParams,o=t.tab?.trim();o&&l.set("tab",o);let a=l.toString(),c=`/sessions/${encodeURIComponent(d)}`;return a.length>0?`${c}?${a}`:c}},39337:(e,t,n)=>{"use strict";n.d(t,{default:()=>w});var i=n(54568),s=n(7620),r=n(79748),d=n(46012),l=n(862),o=n(84169),a=n(39702),c=n(29450),u=n(4997),b=n(86181),g=n(53649),
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[824],{18510:(e,t,n)=>{"use strict";n.d(t,{J:()=>s,s:()=>r});var i=n(10926);function s(e){let t=(0,i.C0)(e);if(!t)return"/";let n=new URLSearchParams;return n.set("bridge",t),`/?${n.toString()}`}function r(e,t={}){let n,s=e.trim(),d=(0,i.DW)(s)?s:(n=(0,i.C0)(t.bridgeId))?(0,i.Bp)(n,s):s,l=new URLSearchParams,o=t.tab?.trim();o&&l.set("tab",o);let a=l.toString(),c=`/sessions/${encodeURIComponent(d)}`;return a.length>0?`${c}?${a}`:c}},39337:(e,t,n)=>{"use strict";n.d(t,{default:()=>w});var i=n(54568),s=n(7620),r=n(79748),d=n(46012),l=n(862),o=n(84169),a=n(39702),c=n(29450),u=n(4997),b=n(86181),g=n(53649),p=n(86011),m=n(59207),h=n(35821),f=n(95106),S=n(10926),I=n(18510),j=n(84527),v=n(76050);function w({requiresPairedDeviceScope:e=!1}){let t=(0,r.useParams)(),n=(0,r.useRouter)(),x=(0,r.useSearchParams)(),M=(0,s.useMemo)(()=>(0,S.DW)(t.id)?.bridgeId??null,[t.id]),E=(0,s.useMemo)(()=>(0,S.C0)(x.get("bridge")??x.get("bridgeId")),[x]),k=M??E,C=(0,s.useMemo)(()=>k&&!M?(0,S.Bp)(k,t.id):t.id,[t.id,k,M]),P=!e||!!k,{session:$}=(0,h.w)(C,null,{bridgeId:k,enabled:P}),L=$?.bridgeId??k,{projects:N}=(0,g.U)(L,{enabled:!e||!!L}),{preferences:O,loading:R}=(0,m.g)(L,{enabled:!e||!!L}),{mobileSidebarOpen:U,desktopSidebarOpen:_,toggleSidebar:D,closeSidebarOnMobile:J}=(0,d.T)({initialDesktopOpen:!1}),W=U||_,{sessions:y,refresh:B}=(0,f.t)(void 0,{enabled:W&&(!e||!!L),bridgeId:L}),[K,T]=(0,s.useState)(null),[z,A]=(0,s.useState)(!1),G=(0,s.useMemo)(()=>{let e=x.get("tab");return"dispatcher"!==e&&("terminal"===e?"terminal"===(0,v.tK)($):null===e&&"terminal"===(0,v.tK)($))},[$,x])&&z,Q=$?.projectId??null;(0,p.Q)({enabled:!R&&null!==Q,projectId:Q,preferences:O?.notifications??null,bridgeId:L});let V=(0,s.useMemo)(()=>$?[$.projectId,$.branch].filter(Boolean).join(" \xb7 "):K||"Session",[$,K]),q=(0,s.useMemo)(()=>(0,I.J)(L),[L]);async function F(e){(await (0,j.J)(e,{bridgeId:L}),e===C)?n.replace(q):L&&B()}return((0,s.useEffect)(()=>{if(C===t.id)return;let e=new URLSearchParams(x.toString());e.delete("bridge"),e.delete("bridgeId");let i=e.toString(),s=`/sessions/${encodeURIComponent(C)}${i.length>0?`?${i}`:""}`;n.replace(s,{scroll:!1})},[C,t.id,n,x]),(0,s.useEffect)(()=>{$?.projectId?T($.projectId):!K&&N.length>0&&T(N[0]?.id??null)},[$?.projectId,N,K]),(0,s.useEffect)(()=>{let e="function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null,t=()=>{A((0,b.k$)())};return t(),window.addEventListener("resize",t),e?.addEventListener?.("change",t),()=>{window.removeEventListener("resize",t),e?.removeEventListener?.("change",t)}},[]),t.id)?(0,i.jsxs)(l.G,{mobileSidebarOpen:U,desktopSidebarOpen:_,onToggleSidebar:D,hideMobileSidebarToggle:G,sidebar:W?(0,i.jsx)(c.WorkspaceSidebarPanel,{projects:N,selectedProjectId:K,onSelectProject:e=>{null===e?n.push(q):T(e)},sessions:y,selectedSessionId:C,onSelectSession:(e,t)=>{let i=y.find(t=>t.id===e)??null;n.push((0,I.s)(e,{bridgeId:L,tab:t?.tab??(0,v.tK)(i)})),J()},onArchiveSession:F,onCreateWorkspace:()=>{n.push(q)}}):null,children:[G?null:(0,i.jsx)(o.V,{title:V,rightContent:(0,i.jsx)(a.J,{})}),(0,i.jsx)("div",{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden ${G?"bg-[#060404]":""}`,children:(0,i.jsx)(u.SessionDetail,{sessionId:C,initialSession:$,bridgeId:L,immersiveMobileMode:G,onOpenSidebar:D},C)})]}):(0,i.jsx)("div",{className:"flex h-svh items-center justify-center",children:(0,i.jsx)("span",{className:"text-[13px] text-[var(--text-muted)]",children:"No session ID provided"})})}},69755:(e,t,n)=>{Promise.resolve().then(n.bind(n,39337))}},e=>{e.O(0,[3357,5587,3051,1257,9151,9703,9083,4997,9450,587,1968,7358],()=>e(e.s=69755)),_N_E=e.O()}]);
|