@kaitranntt/ccs 7.50.0-dev.9 → 7.51.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +15 -0
  2. package/dist/ccs.js +22 -6
  3. package/dist/ccs.js.map +1 -1
  4. package/dist/commands/help-command.d.ts.map +1 -1
  5. package/dist/commands/help-command.js +14 -0
  6. package/dist/commands/help-command.js.map +1 -1
  7. package/dist/delegation/headless-executor.d.ts.map +1 -1
  8. package/dist/delegation/headless-executor.js +4 -1
  9. package/dist/delegation/headless-executor.js.map +1 -1
  10. package/dist/targets/droid-command-router.d.ts +26 -0
  11. package/dist/targets/droid-command-router.d.ts.map +1 -0
  12. package/dist/targets/droid-command-router.js +240 -0
  13. package/dist/targets/droid-command-router.js.map +1 -0
  14. package/dist/ui/assets/{accounts-y2u0CVK8.js → accounts-p8Gb9myI.js} +1 -1
  15. package/dist/ui/assets/{alert-dialog-CetY4Iww.js → alert-dialog-B_Bdo2ou.js} +1 -1
  16. package/dist/ui/assets/{api-5q1FT1uL.js → api-Bw82I4NV.js} +1 -1
  17. package/dist/ui/assets/{auth-section-CaQeee-F.js → auth-section-CswwM0bu.js} +1 -1
  18. package/dist/ui/assets/{backups-section-hF88BjYJ.js → backups-section-6slvPh7p.js} +1 -1
  19. package/dist/ui/assets/{checkbox-Dhm5Fzkb.js → checkbox-D19h9xqD.js} +1 -1
  20. package/dist/ui/assets/{cliproxy-BeYNWmY_.js → cliproxy-BxWh_a8E.js} +1 -1
  21. package/dist/ui/assets/{cliproxy-control-panel-CJELeI80.js → cliproxy-control-panel-BEaTM1tV.js} +1 -1
  22. package/dist/ui/assets/{confirm-dialog-Dn3SrwNV.js → confirm-dialog-7-N-o1DD.js} +1 -1
  23. package/dist/ui/assets/{copilot-vwT-4_V4.js → copilot-C2ADI_mS.js} +1 -1
  24. package/dist/ui/assets/{cursor-CN3lIX63.js → cursor-BzUnxDMC.js} +1 -1
  25. package/dist/ui/assets/{droid-DBP2yCY7.js → droid-BOC3J2_I.js} +1 -1
  26. package/dist/ui/assets/{globalenv-section-DNKAJasL.js → globalenv-section-Caco9nNS.js} +1 -1
  27. package/dist/ui/assets/{health-C7tNiLzc.js → health-Cn_YNAry.js} +1 -1
  28. package/dist/ui/assets/{index-MGh88HoC.js → index-0LBl1v7D.js} +1 -1
  29. package/dist/ui/assets/{index-C8-ef-r7.js → index-B_ON5mBa.js} +1 -1
  30. package/dist/ui/assets/{index-QBUSDLTx.js → index-CVKOwyBR.js} +1 -1
  31. package/dist/ui/assets/index-Ck953xpy.css +1 -0
  32. package/dist/ui/assets/{index-uYnNU6Ut.js → index-CnAQ8t2b.js} +1 -1
  33. package/dist/ui/assets/{index-k-HuyjpO.js → index-DNFjYwGe.js} +9 -9
  34. package/dist/ui/assets/{proxy-status-widget-CIm5vKY7.js → proxy-status-widget-B31OXK00.js} +1 -1
  35. package/dist/ui/assets/{separator-BLVyAGAm.js → separator-51ocJFnp.js} +1 -1
  36. package/dist/ui/assets/{shared-CHH09ZNi.js → shared-k-J_KXcM.js} +1 -1
  37. package/dist/ui/assets/{switch-CwLyB4JK.js → switch-B3t2TDvW.js} +1 -1
  38. package/dist/ui/assets/{updates-VlxL3aum.js → updates-CYChhYqV.js} +1 -1
  39. package/dist/ui/index.html +2 -2
  40. package/dist/utils/shell-executor.d.ts +5 -0
  41. package/dist/utils/shell-executor.d.ts.map +1 -1
  42. package/dist/utils/shell-executor.js +22 -3
  43. package/dist/utils/shell-executor.js.map +1 -1
  44. package/lib/hooks/websearch-transformer.cjs +78 -52
  45. package/package.json +1 -1
  46. package/dist/ui/assets/index-s-oTl3hW.css +0 -1
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{bf as W,aL as X,bg as Z,bh as J,bi as ee,bj as se,bk as te,c as d,B as E,ax as ae,K as ne,N as re,q as oe,r as ie,s as le,t as ce,v as de,b as I,T as xe,o as me,p as ue,W as he}from"./index-k-HuyjpO.js";import{A as ge,a as pe,b as fe,c as be,d as je,e as ye,f as Ne,g as Ce}from"./alert-dialog-CetY4Iww.js";import{u as $,a as we,b as ve,e as Se}from"./tanstack-DDJIhNJd.js";import{t as P}from"./notifications-B2HqRBj7.js";import{a3 as ke,A as Ae,R as f,aV as Pe,aW as Ve,aX as Ie,X as Te,b as Re,aY as De,aZ as Ue,U as Ee,q as Ke,k as $e,a2 as qe,aq as Le,T as K,ax as Fe}from"./icons-DrewC9c3.js";const ts="2026-02-24-antigravity-oauth-v2",_e="I ACCEPT RISK",Me=_e,as={reviewedIssue509:!1,understandsBanRisk:!1,acceptsFullResponsibility:!1,typedPhrase:""};function ns(s){return s.reviewedIssue509&&s.understandsBanRisk&&s.acceptsFullResponsibility&&s.typedPhrase.trim().replace(/\s+/g," ").toUpperCase()===Me}async function Be(){const s=await fetch("/api/cliproxy/sync/status");if(!s.ok){let n="Failed to fetch sync status";try{const t=await s.json();n=t.error||t.message||n}catch{}throw new Error(n)}return s.json()}async function He(){const s=new AbortController,n=setTimeout(()=>s.abort(),3e4);try{const t=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:s.signal});if(!t.ok){let a="Sync failed";try{const r=await t.json();a=r.error||r.message||a}catch{}throw new Error(a)}return t.json()}catch(t){throw t instanceof Error&&t.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):t}finally{clearTimeout(n)}}function Ye(){return $({queryKey:["cliproxy-sync-status"],queryFn:Be,refetchInterval:3e4,retry:1,staleTime:1e4})}function Ge(){const s=we();return ve({mutationFn:He,onSuccess:n=>{s.invalidateQueries({queryKey:["cliproxy-sync-status"]}),s.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?P.info("No profiles to sync"):P.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{P.error(`Sync failed: ${n.message}`)}})}function V(s,n){const t=s.replace(/-\d+$/,"").split(".").map(Number),a=n.replace(/-\d+$/,"").split(".").map(Number);for(let r=0;r<3;r++){if((t[r]||0)>(a[r]||0))return!0;if((t[r]||0)<(a[r]||0))return!1}return!1}function Oe(s){if(!s)return"";const n=new Date(s).getTime(),a=Date.now()-n,r=Math.floor(a/(1e3*60*60)),i=Math.floor(a%(1e3*60*60)/(1e3*60));return r>0?`${r}h ${i}m`:`${i}m`}function Qe(s){if(!s)return"";const n=Date.now()-s,t=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return t<1?"just now":t<60?`${t}m ago`:`${a}h ago`}function N({icon:s,tooltip:n,onClick:t,disabled:a,isPending:r,className:i,variant:l="ghost"}){return e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(I,{variant:l==="destructive-ghost"?"ghost":l,size:"sm",className:d("h-7 w-7 p-0",l==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:t,disabled:a,children:r?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(s,{className:"w-3.5 h-3.5"})})}),e.jsx(ue,{side:"bottom",className:"text-xs",children:n})]})}function rs(){const{data:s,isLoading:n}=W(),{data:t}=X(),{data:a,isLoading:r}=Z(),i=J(),l=ee(),C=se(),u=te(),{data:q}=Ye(),{mutate:L,isPending:w}=Ge(),[h,T]=y.useState(!1),[g,F]=y.useState(""),[_,b]=y.useState(!1),[v,S]=y.useState(null),{data:M}=$({queryKey:["cliproxy-server-config"],queryFn:()=>he.cliproxyServer.get(),staleTime:3e4}),B=Se({mutationKey:["update-backend"]})>0,x=M?.remote,R=x?.enabled&&x?.host,p=s?.running??!1,k=i.isPending||l.isPending||C.isPending||u.isPending||B||w,H=t?.hasUpdate??!1,m=t?.isStable===!1,D=t?.currentVersion,j=q?.configured??!1,Y=j?"Sync Ready":"No Config",A=m?t?.maxStableVersion||a?.latestStable:t?.latestVersion,U=o=>{if(!o)return;const c=a?.maxStableVersion||"6.6.80";if(V(o,c)){S(o),b(!0);return}u.mutate({version:o})},G=()=>{v&&u.mutate({version:v,force:!0}),b(!1),S(null)},O=()=>{b(!1),S(null)},Q=R?(()=>{const o=x.protocol||"http",c=x.port||(o==="https"?443:80);return o==="https"&&c===443||o==="http"&&c===80?x.host:`${x.host}:${c}`})():null;return R?e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(E,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:"Active"})]}),e.jsx(Ae,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:Q})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsx(ae,{delayDuration:300,children:e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors",p?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:d("w-2 h-2 rounded-full",p?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:t?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(f,{className:"w-3 h-3 animate-spin text-muted-foreground"}):p?e.jsxs(e.Fragment,{children:[e.jsx(N,{icon:w?f:Pe,tooltip:"Sync profiles to CLIProxy",onClick:()=>L(),disabled:!j||k,isPending:w}),e.jsx(N,{icon:Ve,tooltip:"Restart",onClick:()=>C.mutate(),disabled:k,isPending:C.isPending}),e.jsx(N,{icon:Ie,tooltip:"Stop",onClick:()=>l.mutate(),disabled:k,isPending:l.isPending,variant:"destructive-ghost"})]}):null,e.jsx(N,{icon:h?Te:Re,tooltip:h?"Close":"Version settings",onClick:()=>T(!h),className:h?"bg-muted":void 0})]})]}),D&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:d("text-xs font-mono text-muted-foreground",m&&"text-amber-600 dark:text-amber-400"),children:["v",D]}),(H||m)&&A&&e.jsxs(E,{variant:"secondary",className:d("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",m?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>U(A),title:`Click to ${m?"downgrade":"update"}`,children:[m?e.jsx(De,{className:"w-2.5 h-2.5"}):e.jsx(Ue,{className:"w-2.5 h-2.5"}),A]})]}),p&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:["Port ",s.port]}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3"}),s.sessionCount," session",s.sessionCount!==1?"s":""]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ke,{className:"w-3 h-3"}),Oe(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[j?e.jsx($e,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(qe,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:d("text-xs",j?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Y})]}),e.jsx(ne,{open:h,onOpenChange:T,children:e.jsxs(re,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Version Management"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(oe,{value:g,onValueChange:F,disabled:r,children:[e.jsx(ie,{className:"h-8 text-xs flex-1",children:e.jsx(le,{placeholder:"Select version to install..."})}),e.jsx(ce,{children:a?.versions.slice(0,20).map(o=>{const c=a?.maxStableVersion&&V(o,a.maxStableVersion);return e.jsx(de,{value:o,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",o,o===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"(stable)"}),c&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},o)})})]}),e.jsxs(I,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>U(g),disabled:u.isPending||!g,children:[u.isPending?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Le,{className:"w-3.5 h-3.5"}),"Install"]})]}),g&&a?.maxStableVersion&&V(g,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(K,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:["Versions above ",a.maxStableVersion," have known issues"]})]}),t?.checkedAt&&e.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:["Last checked ",Qe(t.checkedAt)]})]})}),!p&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not running"}),e.jsxs(I,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>i.mutate(),disabled:i.isPending,children:[i.isPending?e.jsx(f,{className:"w-3 h-3 animate-spin"}):e.jsx(Fe,{className:"w-3 h-3"}),"Start"]})]}),e.jsx(ge,{open:_,onOpenChange:b,children:e.jsxs(pe,{children:[e.jsxs(fe,{children:[e.jsxs(be,{className:"flex items-center gap-2",children:[e.jsx(K,{className:"w-5 h-5 text-amber-500"}),"Install Unstable Version?"]}),e.jsxs(je,{className:"space-y-2",children:[e.jsxs("p",{children:["You are about to install ",e.jsxs("strong",{children:["v",v]}),", which is above the maximum stable version"," ",e.jsxs("strong",{children:["v",a?.maxStableVersion||"6.6.80"]}),"."]}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:"This version has known stability issues and may cause unexpected behavior."}),e.jsx("p",{children:"Are you sure you want to proceed?"})]})]}),e.jsxs(ye,{children:[e.jsx(Ne,{onClick:O,children:"Cancel"}),e.jsx(Ce,{onClick:G,className:"bg-amber-500 hover:bg-amber-600 text-white",children:"Install Anyway"})]})]})})]})})}export{Me as A,as as D,rs as P,_e as R,ts as a,ns as i};
1
+ import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{bf as W,aL as X,bg as Z,bh as J,bi as ee,bj as se,bk as te,c as d,B as E,ax as ae,K as ne,N as re,q as oe,r as ie,s as le,t as ce,v as de,b as I,T as xe,o as me,p as ue,W as he}from"./index-DNFjYwGe.js";import{A as ge,a as pe,b as fe,c as be,d as je,e as ye,f as Ne,g as Ce}from"./alert-dialog-B_Bdo2ou.js";import{u as $,a as we,b as ve,e as Se}from"./tanstack-DDJIhNJd.js";import{t as P}from"./notifications-B2HqRBj7.js";import{a3 as ke,A as Ae,R as f,aV as Pe,aW as Ve,aX as Ie,X as Te,b as Re,aY as De,aZ as Ue,U as Ee,q as Ke,k as $e,a2 as qe,aq as Le,T as K,ax as Fe}from"./icons-DrewC9c3.js";const ts="2026-02-24-antigravity-oauth-v2",_e="I ACCEPT RISK",Me=_e,as={reviewedIssue509:!1,understandsBanRisk:!1,acceptsFullResponsibility:!1,typedPhrase:""};function ns(s){return s.reviewedIssue509&&s.understandsBanRisk&&s.acceptsFullResponsibility&&s.typedPhrase.trim().replace(/\s+/g," ").toUpperCase()===Me}async function Be(){const s=await fetch("/api/cliproxy/sync/status");if(!s.ok){let n="Failed to fetch sync status";try{const t=await s.json();n=t.error||t.message||n}catch{}throw new Error(n)}return s.json()}async function He(){const s=new AbortController,n=setTimeout(()=>s.abort(),3e4);try{const t=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:s.signal});if(!t.ok){let a="Sync failed";try{const r=await t.json();a=r.error||r.message||a}catch{}throw new Error(a)}return t.json()}catch(t){throw t instanceof Error&&t.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):t}finally{clearTimeout(n)}}function Ye(){return $({queryKey:["cliproxy-sync-status"],queryFn:Be,refetchInterval:3e4,retry:1,staleTime:1e4})}function Ge(){const s=we();return ve({mutationFn:He,onSuccess:n=>{s.invalidateQueries({queryKey:["cliproxy-sync-status"]}),s.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?P.info("No profiles to sync"):P.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{P.error(`Sync failed: ${n.message}`)}})}function V(s,n){const t=s.replace(/-\d+$/,"").split(".").map(Number),a=n.replace(/-\d+$/,"").split(".").map(Number);for(let r=0;r<3;r++){if((t[r]||0)>(a[r]||0))return!0;if((t[r]||0)<(a[r]||0))return!1}return!1}function Oe(s){if(!s)return"";const n=new Date(s).getTime(),a=Date.now()-n,r=Math.floor(a/(1e3*60*60)),i=Math.floor(a%(1e3*60*60)/(1e3*60));return r>0?`${r}h ${i}m`:`${i}m`}function Qe(s){if(!s)return"";const n=Date.now()-s,t=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return t<1?"just now":t<60?`${t}m ago`:`${a}h ago`}function N({icon:s,tooltip:n,onClick:t,disabled:a,isPending:r,className:i,variant:l="ghost"}){return e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(I,{variant:l==="destructive-ghost"?"ghost":l,size:"sm",className:d("h-7 w-7 p-0",l==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:t,disabled:a,children:r?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(s,{className:"w-3.5 h-3.5"})})}),e.jsx(ue,{side:"bottom",className:"text-xs",children:n})]})}function rs(){const{data:s,isLoading:n}=W(),{data:t}=X(),{data:a,isLoading:r}=Z(),i=J(),l=ee(),C=se(),u=te(),{data:q}=Ye(),{mutate:L,isPending:w}=Ge(),[h,T]=y.useState(!1),[g,F]=y.useState(""),[_,b]=y.useState(!1),[v,S]=y.useState(null),{data:M}=$({queryKey:["cliproxy-server-config"],queryFn:()=>he.cliproxyServer.get(),staleTime:3e4}),B=Se({mutationKey:["update-backend"]})>0,x=M?.remote,R=x?.enabled&&x?.host,p=s?.running??!1,k=i.isPending||l.isPending||C.isPending||u.isPending||B||w,H=t?.hasUpdate??!1,m=t?.isStable===!1,D=t?.currentVersion,j=q?.configured??!1,Y=j?"Sync Ready":"No Config",A=m?t?.maxStableVersion||a?.latestStable:t?.latestVersion,U=o=>{if(!o)return;const c=a?.maxStableVersion||"6.6.80";if(V(o,c)){S(o),b(!0);return}u.mutate({version:o})},G=()=>{v&&u.mutate({version:v,force:!0}),b(!1),S(null)},O=()=>{b(!1),S(null)},Q=R?(()=>{const o=x.protocol||"http",c=x.port||(o==="https"?443:80);return o==="https"&&c===443||o==="http"&&c===80?x.host:`${x.host}:${c}`})():null;return R?e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(E,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:"Active"})]}),e.jsx(Ae,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:Q})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsx(ae,{delayDuration:300,children:e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors",p?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:d("w-2 h-2 rounded-full",p?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:t?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(f,{className:"w-3 h-3 animate-spin text-muted-foreground"}):p?e.jsxs(e.Fragment,{children:[e.jsx(N,{icon:w?f:Pe,tooltip:"Sync profiles to CLIProxy",onClick:()=>L(),disabled:!j||k,isPending:w}),e.jsx(N,{icon:Ve,tooltip:"Restart",onClick:()=>C.mutate(),disabled:k,isPending:C.isPending}),e.jsx(N,{icon:Ie,tooltip:"Stop",onClick:()=>l.mutate(),disabled:k,isPending:l.isPending,variant:"destructive-ghost"})]}):null,e.jsx(N,{icon:h?Te:Re,tooltip:h?"Close":"Version settings",onClick:()=>T(!h),className:h?"bg-muted":void 0})]})]}),D&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:d("text-xs font-mono text-muted-foreground",m&&"text-amber-600 dark:text-amber-400"),children:["v",D]}),(H||m)&&A&&e.jsxs(E,{variant:"secondary",className:d("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",m?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>U(A),title:`Click to ${m?"downgrade":"update"}`,children:[m?e.jsx(De,{className:"w-2.5 h-2.5"}):e.jsx(Ue,{className:"w-2.5 h-2.5"}),A]})]}),p&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:["Port ",s.port]}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3"}),s.sessionCount," session",s.sessionCount!==1?"s":""]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ke,{className:"w-3 h-3"}),Oe(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[j?e.jsx($e,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(qe,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:d("text-xs",j?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Y})]}),e.jsx(ne,{open:h,onOpenChange:T,children:e.jsxs(re,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Version Management"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(oe,{value:g,onValueChange:F,disabled:r,children:[e.jsx(ie,{className:"h-8 text-xs flex-1",children:e.jsx(le,{placeholder:"Select version to install..."})}),e.jsx(ce,{children:a?.versions.slice(0,20).map(o=>{const c=a?.maxStableVersion&&V(o,a.maxStableVersion);return e.jsx(de,{value:o,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",o,o===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"(stable)"}),c&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},o)})})]}),e.jsxs(I,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>U(g),disabled:u.isPending||!g,children:[u.isPending?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Le,{className:"w-3.5 h-3.5"}),"Install"]})]}),g&&a?.maxStableVersion&&V(g,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(K,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:["Versions above ",a.maxStableVersion," have known issues"]})]}),t?.checkedAt&&e.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:["Last checked ",Qe(t.checkedAt)]})]})}),!p&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not running"}),e.jsxs(I,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>i.mutate(),disabled:i.isPending,children:[i.isPending?e.jsx(f,{className:"w-3 h-3 animate-spin"}):e.jsx(Fe,{className:"w-3 h-3"}),"Start"]})]}),e.jsx(ge,{open:_,onOpenChange:b,children:e.jsxs(pe,{children:[e.jsxs(fe,{children:[e.jsxs(be,{className:"flex items-center gap-2",children:[e.jsx(K,{className:"w-5 h-5 text-amber-500"}),"Install Unstable Version?"]}),e.jsxs(je,{className:"space-y-2",children:[e.jsxs("p",{children:["You are about to install ",e.jsxs("strong",{children:["v",v]}),", which is above the maximum stable version"," ",e.jsxs("strong",{children:["v",a?.maxStableVersion||"6.6.80"]}),"."]}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:"This version has known stability issues and may cause unexpected behavior."}),e.jsx("p",{children:"Are you sure you want to proceed?"})]})]}),e.jsxs(ye,{children:[e.jsx(Ne,{onClick:O,children:"Cancel"}),e.jsx(Ce,{onClick:G,className:"bg-amber-500 hover:bg-amber-600 text-white",children:"Install Anyway"})]})]})})]})})}export{Me as A,as as D,rs as P,_e as R,ts as a,ns as i};
@@ -1 +1 @@
1
- import{j as i,$ as n}from"./radix-ui-C1Gpgz6I.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-k-HuyjpO.js";function m({className:t,orientation:a="horizontal",decorative:o=!0,...r}){return i.jsx(n,{"data-slot":"separator",decorative:o,orientation:a,className:e("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}export{m as S};
1
+ import{j as i,$ as n}from"./radix-ui-C1Gpgz6I.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-DNFjYwGe.js";function m({className:t,orientation:a="horizontal",decorative:o=!0,...r}){return i.jsx(n,{"data-slot":"separator",decorative:o,orientation:a,className:e("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}export{m as S};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{b1 as X,b2 as Y,b3 as ee,O as se,Q as te,R as re,B as C,b4 as L,b5 as I,b6 as E,b as F,I as ae,m as P,c as D,C as ne,a as le}from"./index-k-HuyjpO.js";import{O as ie,a1 as ce,aN as oe,T as R,R as T,F as de,aj as me,a2 as he}from"./icons-DrewC9c3.js";import"./tanstack-DDJIhNJd.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const y={commands:"Commands",skills:"Skills",agents:"Agents"};function Ce(){const[t,n]=j.useState("commands"),[s,r]=j.useState(""),[l,c]=j.useState(null),{data:a,isError:o,error:d,refetch:m}=X(),{data:u,isLoading:f,isFetching:h,isError:p,error:w,refetch:$}=Y(t),N=u?.items??[],M=s.trim().toLowerCase(),v=s.trim(),x=j.useMemo(()=>{const i=u?.items??[];return M?i.filter(b=>[b.name,b.description,b.path].some(J=>J.toLowerCase().includes(M))):i},[u,M]),g=j.useMemo(()=>x.length===0?null:l?x.find(i=>i.path===l)??x[0]:x[0],[x,l]),{data:k,isLoading:Q,isError:_,error:U,refetch:V}=ee(t,g?.path??null),B=[{id:"commands",label:y.commands,icon:ie,count:a?.commands??0},{id:"skills",label:y.skills,icon:ce,count:a?.skills??0},{id:"agents",label:y.agents,icon:oe,count:a?.agents??0}],W=B.reduce((i,b)=>i+b.count,0),q=!f&&!p&&N.length===0,H=!f&&!p&&N.length>0&&x.length===0,K=z(d,"Shared item totals could not be loaded. Listing still works."),Z=z(w,`Unable to fetch shared ${t}. Please try again.`),G=z(U,`Unable to load content for ${g?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Shared Data"}),e.jsx("p",{className:"text-muted-foreground",children:"Commands, skills, and agents shared across Claude instances"})]}),e.jsx(se,{value:t,onValueChange:i=>{n(i),r(""),c(null)},children:e.jsx(te,{className:"h-auto flex-wrap justify-start",children:B.map(i=>e.jsxs(re,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(A,{label:"Total Shared",value:W}),e.jsx(A,{label:y[t],value:N.length}),e.jsx(A,{label:"Visible",value:x.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(C,{variant:"secondary",children:"Markdown detail view"}),v?e.jsxs(C,{variant:"outline",children:["Filter: ",v]}):null]})]})]}),a&&!a.symlinkStatus.valid&&e.jsxs(L,{variant:"warning",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Configuration Required"}),e.jsxs(E,{children:[a.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),o&&e.jsxs(L,{variant:"info",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Counts unavailable"}),e.jsxs(E,{children:[e.jsx("p",{children:K}),e.jsx("div",{className:"mt-3",children:e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{m()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry counts"]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(de,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:y[t]})]}),!f&&!p&&e.jsxs(C,{variant:"outline",className:"text-[10px] h-5",children:[x.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(me,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{value:s,onChange:i=>r(i.target.value),placeholder:`Filter ${t} by name, description, or path`,"aria-label":`Filter ${t} by name, description, or path`,className:"pl-8 h-9"})]}),!f&&!p&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",x.length," of ",N.length," ",t,v?` for "${v}"`:"",h?" (refreshing...)":""]})]}),e.jsx(P,{className:"flex-1 min-h-0",children:f?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Loading shared ",t,"..."]}):p?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(he,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium",children:["Failed to load shared ",t]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Z})]}),e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{$()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry"]})]})}):q?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["No shared ",t," found. Run `ccs sync` or add items in your shared directory."]}):H?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["No ",t,' match "',v,'".']}):e.jsx("div",{className:"p-2 space-y-1",children:x.map(i=>e.jsxs("button",{type:"button",onClick:()=>c(i.path),className:D("w-full text-left p-3 rounded-md border transition-colors",g?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:g?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:g.name}),e.jsx(C,{variant:"outline",className:"uppercase text-[10px]",children:g.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(O,{label:"Path",value:g.path,mono:!0}),k?.contentPath&&k.contentPath!==g.path&&e.jsx(O,{label:"Resolved Source",value:k.contentPath,mono:!0})]})}),e.jsx(ne,{className:"min-h-0 flex-1",children:e.jsx(le,{className:"p-0 h-full",children:e.jsx(P,{className:"h-full px-5 py-4",children:Q?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown content..."}):_?e.jsxs(L,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Failed to load content"}),e.jsxs(E,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry content"]})})]})]}):e.jsx(ue,{content:k?.content??""})})})})]})]}):e.jsxs("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:["Select a ",t.slice(0,-1)," to view full content."]})})]})})})]})}function A({label:t,value:n}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:n})]})}function O({label:t,value:n,mono:s=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("p",{className:D("text-xs mt-1 break-words",s?"font-mono":"text-sm"),children:n})]})}function z(t,n){if(!(t instanceof Error))return n;const s=t.message.toLowerCase();return s.includes("failed to fetch")||s.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":t.message||n}function ue({content:t}){const n=j.useMemo(()=>pe(t),[t]);return n.blocks.length===0&&n.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No markdown content available."}):e.jsxs("div",{className:"space-y-5",children:[n.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:n.frontmatter.map(s=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:xe(s.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:s.value})]},`${s.key}:${s.value}`))})}):null,n.blocks.map((s,r)=>{if(s.type==="heading"){const l=s.level<=1?"text-xl font-semibold":s.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:l,children:S(s.text,`heading-${r}`)},`heading-${r}`)}return s.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:S(s.text,`paragraph-${r}`)},`paragraph-${r}`):s.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:s.items.map((l,c)=>e.jsx("li",{children:S(l,`ul-item-${r}-${c}`)},`ul-item-${r}-${c}`))},`ul-${r}`):s.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:s.items.map((l,c)=>e.jsx("li",{children:S(l,`ol-item-${r}-${c}`)},`ol-item-${r}-${c}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[s.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:s.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:s.content})]},`code-${r}`)})]})}function xe(t){return t.replace(/[-_]/g," ")}function S(t,n){const s=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,r=[];let l=0,c=0;for(const a of t.matchAll(s)){const o=a[0],d=a.index??0;if(d>l&&r.push(t.slice(l,d)),a[2])r.push(e.jsx("strong",{className:"font-semibold",children:a[2]},`${n}-strong-${c}`));else if(a[3])r.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:a[3]},`${n}-code-${c}`));else if(a[4])r.push(e.jsx("em",{className:"italic",children:a[4]},`${n}-em-${c}`));else if(a[5]&&a[6]){const m=a[6].trim();/^(https?:\/\/|mailto:)/i.test(m)?r.push(e.jsx("a",{href:m,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:a[5]},`${n}-link-${c}`)):r.push(a[5])}else r.push(o);l=d+o.length,c+=1}return l<t.length&&r.push(t.slice(l)),r.length===0?[t]:r}function pe(t){const n=t.replace(/\r\n/g,`
1
+ import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{b1 as X,b2 as Y,b3 as ee,O as se,Q as te,R as re,B as C,b4 as L,b5 as I,b6 as E,b as F,I as ae,m as P,c as D,C as ne,a as le}from"./index-DNFjYwGe.js";import{O as ie,a1 as ce,aN as oe,T as R,R as T,F as de,aj as me,a2 as he}from"./icons-DrewC9c3.js";import"./tanstack-DDJIhNJd.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const y={commands:"Commands",skills:"Skills",agents:"Agents"};function Ce(){const[t,n]=j.useState("commands"),[s,r]=j.useState(""),[l,c]=j.useState(null),{data:a,isError:o,error:d,refetch:m}=X(),{data:u,isLoading:f,isFetching:h,isError:p,error:w,refetch:$}=Y(t),N=u?.items??[],M=s.trim().toLowerCase(),v=s.trim(),x=j.useMemo(()=>{const i=u?.items??[];return M?i.filter(b=>[b.name,b.description,b.path].some(J=>J.toLowerCase().includes(M))):i},[u,M]),g=j.useMemo(()=>x.length===0?null:l?x.find(i=>i.path===l)??x[0]:x[0],[x,l]),{data:k,isLoading:Q,isError:_,error:U,refetch:V}=ee(t,g?.path??null),B=[{id:"commands",label:y.commands,icon:ie,count:a?.commands??0},{id:"skills",label:y.skills,icon:ce,count:a?.skills??0},{id:"agents",label:y.agents,icon:oe,count:a?.agents??0}],W=B.reduce((i,b)=>i+b.count,0),q=!f&&!p&&N.length===0,H=!f&&!p&&N.length>0&&x.length===0,K=z(d,"Shared item totals could not be loaded. Listing still works."),Z=z(w,`Unable to fetch shared ${t}. Please try again.`),G=z(U,`Unable to load content for ${g?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Shared Data"}),e.jsx("p",{className:"text-muted-foreground",children:"Commands, skills, and agents shared across Claude instances"})]}),e.jsx(se,{value:t,onValueChange:i=>{n(i),r(""),c(null)},children:e.jsx(te,{className:"h-auto flex-wrap justify-start",children:B.map(i=>e.jsxs(re,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(A,{label:"Total Shared",value:W}),e.jsx(A,{label:y[t],value:N.length}),e.jsx(A,{label:"Visible",value:x.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(C,{variant:"secondary",children:"Markdown detail view"}),v?e.jsxs(C,{variant:"outline",children:["Filter: ",v]}):null]})]})]}),a&&!a.symlinkStatus.valid&&e.jsxs(L,{variant:"warning",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Configuration Required"}),e.jsxs(E,{children:[a.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),o&&e.jsxs(L,{variant:"info",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Counts unavailable"}),e.jsxs(E,{children:[e.jsx("p",{children:K}),e.jsx("div",{className:"mt-3",children:e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{m()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry counts"]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(de,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:y[t]})]}),!f&&!p&&e.jsxs(C,{variant:"outline",className:"text-[10px] h-5",children:[x.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(me,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{value:s,onChange:i=>r(i.target.value),placeholder:`Filter ${t} by name, description, or path`,"aria-label":`Filter ${t} by name, description, or path`,className:"pl-8 h-9"})]}),!f&&!p&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",x.length," of ",N.length," ",t,v?` for "${v}"`:"",h?" (refreshing...)":""]})]}),e.jsx(P,{className:"flex-1 min-h-0",children:f?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Loading shared ",t,"..."]}):p?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(he,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium",children:["Failed to load shared ",t]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Z})]}),e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{$()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry"]})]})}):q?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["No shared ",t," found. Run `ccs sync` or add items in your shared directory."]}):H?e.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["No ",t,' match "',v,'".']}):e.jsx("div",{className:"p-2 space-y-1",children:x.map(i=>e.jsxs("button",{type:"button",onClick:()=>c(i.path),className:D("w-full text-left p-3 rounded-md border transition-colors",g?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:g?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:g.name}),e.jsx(C,{variant:"outline",className:"uppercase text-[10px]",children:g.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(O,{label:"Path",value:g.path,mono:!0}),k?.contentPath&&k.contentPath!==g.path&&e.jsx(O,{label:"Resolved Source",value:k.contentPath,mono:!0})]})}),e.jsx(ne,{className:"min-h-0 flex-1",children:e.jsx(le,{className:"p-0 h-full",children:e.jsx(P,{className:"h-full px-5 py-4",children:Q?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown content..."}):_?e.jsxs(L,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(I,{children:"Failed to load content"}),e.jsxs(E,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry content"]})})]})]}):e.jsx(ue,{content:k?.content??""})})})})]})]}):e.jsxs("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:["Select a ",t.slice(0,-1)," to view full content."]})})]})})})]})}function A({label:t,value:n}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:n})]})}function O({label:t,value:n,mono:s=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("p",{className:D("text-xs mt-1 break-words",s?"font-mono":"text-sm"),children:n})]})}function z(t,n){if(!(t instanceof Error))return n;const s=t.message.toLowerCase();return s.includes("failed to fetch")||s.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":t.message||n}function ue({content:t}){const n=j.useMemo(()=>pe(t),[t]);return n.blocks.length===0&&n.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No markdown content available."}):e.jsxs("div",{className:"space-y-5",children:[n.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:n.frontmatter.map(s=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:xe(s.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:s.value})]},`${s.key}:${s.value}`))})}):null,n.blocks.map((s,r)=>{if(s.type==="heading"){const l=s.level<=1?"text-xl font-semibold":s.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:l,children:S(s.text,`heading-${r}`)},`heading-${r}`)}return s.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:S(s.text,`paragraph-${r}`)},`paragraph-${r}`):s.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:s.items.map((l,c)=>e.jsx("li",{children:S(l,`ul-item-${r}-${c}`)},`ul-item-${r}-${c}`))},`ul-${r}`):s.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:s.items.map((l,c)=>e.jsx("li",{children:S(l,`ol-item-${r}-${c}`)},`ol-item-${r}-${c}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[s.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:s.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:s.content})]},`code-${r}`)})]})}function xe(t){return t.replace(/[-_]/g," ")}function S(t,n){const s=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,r=[];let l=0,c=0;for(const a of t.matchAll(s)){const o=a[0],d=a.index??0;if(d>l&&r.push(t.slice(l,d)),a[2])r.push(e.jsx("strong",{className:"font-semibold",children:a[2]},`${n}-strong-${c}`));else if(a[3])r.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:a[3]},`${n}-code-${c}`));else if(a[4])r.push(e.jsx("em",{className:"italic",children:a[4]},`${n}-em-${c}`));else if(a[5]&&a[6]){const m=a[6].trim();/^(https?:\/\/|mailto:)/i.test(m)?r.push(e.jsx("a",{href:m,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:a[5]},`${n}-link-${c}`)):r.push(a[5])}else r.push(o);l=d+o.length,c+=1}return l<t.length&&r.push(t.slice(l)),r.length===0?[t]:r}function pe(t){const n=t.replace(/\r\n/g,`
2
2
  `).trim();if(!n)return{blocks:[],frontmatter:[]};let s=n;const r=[];if(s.startsWith(`---
3
3
  `)){const l=s.indexOf(`
4
4
  ---
@@ -1 +1 @@
1
- import{j as a,a2 as s,a3 as n}from"./radix-ui-C1Gpgz6I.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-k-HuyjpO.js";function c({className:t,...r}){return a.jsx(s,{"data-slot":"switch",className:e("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:a.jsx(n,{"data-slot":"switch-thumb",className:e("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{c as S};
1
+ import{j as a,a2 as s,a3 as n}from"./radix-ui-C1Gpgz6I.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-DNFjYwGe.js";function c({className:t,...r}){return a.jsx(s,{"data-slot":"switch",className:e("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:a.jsx(n,{"data-slot":"switch-thumb",className:e("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{c as S};
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{L as C,r as c}from"./react-vendor-CNOkPC89.js";import{B as w,c as v,b as x,w as A,b7 as E,C as b,i as f,j as g,Y as j,a as N,m as h,b8 as _,b9 as D,I as L,ba as U}from"./index-k-HuyjpO.js";import{J as z,z as B,aO as $,r as Q,E as G,w as J,a1 as V,c as Y,aP as q,aj as F}from"./icons-DrewC9c3.js";import"./tanstack-DDJIhNJd.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const W={new:"New",stable:"Stable",planned:"Planned"},H={new:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-300",stable:"border-green-200 bg-green-50 text-green-700 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-300",planned:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300"};function K({status:s,className:a}){return e.jsx(w,{variant:"outline",className:v("font-medium",H[s],a),children:W[s]})}const I="ccs:updates:notice-progress:v1";function X(s){return s==="new"?"new":"seen"}function m(s,a){return a[s.id]??X(s.status)}function S(s){return s!=="done"&&s!=="dismissed"}function Z(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem(I);if(!s)return{};const a=JSON.parse(s);if(!a||typeof a!="object"||Array.isArray(a))return{};const l={};for(const[d,t]of Object.entries(a))typeof d=="string"&&(t==="new"||t==="seen"||t==="done"||t==="dismissed")&&(l[d]=t);return l}catch{return{}}}function ee(s){typeof window>"u"||window.localStorage.setItem(I,JSON.stringify(s))}const se={new:{label:"Needs Action",className:"border-amber-300/70 bg-amber-100/70 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/15 dark:text-amber-300",showDot:!0},seen:{label:"In Review",className:"border-blue-300/70 bg-blue-100/70 text-blue-800 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-300"},done:{label:"Done",className:"border-emerald-300/70 bg-emerald-100/70 text-emerald-800 dark:border-emerald-500/40 dark:bg-emerald-500/15 dark:text-emerald-300"},dismissed:{label:"Dismissed",className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}};function P({state:s,className:a}){const l=se[s];return e.jsxs(w,{variant:"outline",className:v("gap-1.5 border text-[10px] font-medium",l.className,a),children:[l.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),l.label]})}function re({action:s}){return e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]}),s.type==="route"&&s.path&&e.jsx(x,{size:"sm",asChild:!0,children:e.jsxs(C,{to:s.path,children:["Open",e.jsx(z,{className:"h-3.5 w-3.5"})]})})]}),s.type==="command"&&s.command&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(B,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:s.command}),e.jsx(A,{value:s.command})]})]})}function ae({notice:s,progress:a,relatedEntries:l,onUpdateProgress:d}){return s?e.jsxs("div",{className:"flex-1 min-w-0 bg-background grid grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[e.jsxs("div",{className:"border-b bg-background px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx(P,{state:a}),e.jsx(K,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx($,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:["Published ",E(s.publishedAt)]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(x,{size:"sm",onClick:()=>d("done"),children:[e.jsx(Q,{className:"h-4 w-4"}),"Mark done"]}),e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>d("dismissed"),children:[e.jsx(G,{className:"h-4 w-4"}),"Dismiss"]}),e.jsxs(x,{size:"sm",variant:"ghost",onClick:()=>d("new"),children:[e.jsx(J,{className:"h-4 w-4"}),"Reopen"]})]})]}),e.jsx("div",{className:"min-h-0 p-4",children:e.jsxs("div",{className:"grid h-full gap-4 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,1fr)] overflow-hidden",children:[e.jsxs(b,{className:"h-full overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-primary"}),e.jsx(g,{className:"text-base",children:"Do Next"})]}),e.jsx(j,{children:s.primaryAction})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(t=>e.jsx(re,{action:t},`${s.id}-${t.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsx(g,{className:"text-base",children:"Impacted Integrations"}),e.jsx(j,{children:"Related areas based on update scope and routing."})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:l.map(t=>e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 truncate text-sm font-medium",children:t.name}),e.jsx(w,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:_[t.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[t.routes[0]&&e.jsx(x,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(C,{to:t.routes[0].path,children:t.routes[0].label})}),t.commands[0]&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1.5",children:[e.jsx("code",{className:"truncate rounded bg-background px-1.5 py-0.5 text-[11px]",children:t.commands[0]}),e.jsx(A,{value:t.commands[0]})]})]})]},t.id))})})})]}),e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsx(g,{className:"text-base",children:"Why It Matters"}),e.jsx(j,{children:"Short context only, no wall-of-text release notes."})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:s.highlights.map(t=>e.jsxs("li",{children:["- ",t]},`${s.id}-${t}`))})})})]})]})]})})]}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No updates available."})})}function te({notice:s,progress:a,selected:l,onSelect:d}){return e.jsxs("button",{type:"button",onClick:d,className:v("w-full rounded-lg border px-3 py-3 text-left transition-colors",l?"border-primary/30 bg-primary/10":"border-transparent bg-background/40 hover:border-border hover:bg-muted/70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.primaryAction})]}),e.jsx(Y,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:E(s.publishedAt)}),e.jsx(P,{state:a})]})]})}const de=[{id:"inbox",label:"Action Required"},{id:"done",label:"Done"},{id:"all",label:"All"}];function le(s,a){return a?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(d=>`${d.label} ${d.description} ${d.command||""}`),...s.routes.map(d=>d.label)].join(" ").toLowerCase().includes(a):!0}function fe(){const s=c.useMemo(()=>[...D].sort((r,n)=>n.publishedAt.localeCompare(r.publishedAt)),[]),[a,l]=c.useState("inbox"),[d,t]=c.useState(""),[i,y]=c.useState(()=>Z()),[k,M]=c.useState(null);c.useEffect(()=>{ee(i)},[i]);const u=c.useMemo(()=>{const r=d.trim().toLowerCase();return s.filter(n=>{const p=m(n,i);return le(n,r)?a==="done"?p==="done":a==="inbox"?S(p):!0:!1})},[s,i,d,a]),o=c.useMemo(()=>{const r=a==="all"?s:u;return r.find(n=>n.id===k)??r[0]??null},[s,k,a,u]),O=r=>{M(r.id),y(n=>m(r,n)!=="new"?n:{...n,[r.id]:"seen"})},R=c.useMemo(()=>s.filter(r=>S(m(r,i))).length,[s,i]),T=c.useMemo(()=>s.filter(r=>m(r,i)==="done").length,[s,i]);return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"Updates Inbox"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Focus on actions, then mark updates done or dismissed."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:"Needs Action"}),e.jsx("p",{className:"text-base font-semibold",children:R})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:"Done"}),e.jsx("p",{className:"text-base font-semibold",children:T})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(F,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(L,{value:d,onChange:r=>t(r.target.value),placeholder:"Search actions or commands",className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:de.map(r=>e.jsx(x,{size:"sm",variant:a===r.id?"default":"outline",onClick:()=>l(r.id),children:r.label},r.id))})]}),e.jsx(h,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:u.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:"No notices match this view."}):u.map(r=>e.jsx(te,{notice:r,progress:m(r,i),selected:o?.id===r.id,onSelect:()=>O(r)},r.id))})})]}),e.jsx(ae,{notice:o,progress:o?m(o,i):null,relatedEntries:o?U(o):[],onUpdateProgress:r=>{o&&y(n=>({...n,[o.id]:r}))}})]})}export{fe as UpdatesPage};
1
+ import{j as e}from"./radix-ui-C1Gpgz6I.js";import{L as C,r as c}from"./react-vendor-CNOkPC89.js";import{B as w,c as v,b as x,w as A,b7 as E,C as b,i as f,j as g,Y as j,a as N,m as h,b8 as _,b9 as D,I as L,ba as U}from"./index-DNFjYwGe.js";import{J as z,z as B,aO as $,r as Q,E as G,w as J,a1 as V,c as Y,aP as q,aj as F}from"./icons-DrewC9c3.js";import"./tanstack-DDJIhNJd.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const W={new:"New",stable:"Stable",planned:"Planned"},H={new:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-300",stable:"border-green-200 bg-green-50 text-green-700 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-300",planned:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300"};function K({status:s,className:a}){return e.jsx(w,{variant:"outline",className:v("font-medium",H[s],a),children:W[s]})}const I="ccs:updates:notice-progress:v1";function X(s){return s==="new"?"new":"seen"}function m(s,a){return a[s.id]??X(s.status)}function S(s){return s!=="done"&&s!=="dismissed"}function Z(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem(I);if(!s)return{};const a=JSON.parse(s);if(!a||typeof a!="object"||Array.isArray(a))return{};const l={};for(const[d,t]of Object.entries(a))typeof d=="string"&&(t==="new"||t==="seen"||t==="done"||t==="dismissed")&&(l[d]=t);return l}catch{return{}}}function ee(s){typeof window>"u"||window.localStorage.setItem(I,JSON.stringify(s))}const se={new:{label:"Needs Action",className:"border-amber-300/70 bg-amber-100/70 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/15 dark:text-amber-300",showDot:!0},seen:{label:"In Review",className:"border-blue-300/70 bg-blue-100/70 text-blue-800 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-300"},done:{label:"Done",className:"border-emerald-300/70 bg-emerald-100/70 text-emerald-800 dark:border-emerald-500/40 dark:bg-emerald-500/15 dark:text-emerald-300"},dismissed:{label:"Dismissed",className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}};function P({state:s,className:a}){const l=se[s];return e.jsxs(w,{variant:"outline",className:v("gap-1.5 border text-[10px] font-medium",l.className,a),children:[l.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),l.label]})}function re({action:s}){return e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]}),s.type==="route"&&s.path&&e.jsx(x,{size:"sm",asChild:!0,children:e.jsxs(C,{to:s.path,children:["Open",e.jsx(z,{className:"h-3.5 w-3.5"})]})})]}),s.type==="command"&&s.command&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(B,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:s.command}),e.jsx(A,{value:s.command})]})]})}function ae({notice:s,progress:a,relatedEntries:l,onUpdateProgress:d}){return s?e.jsxs("div",{className:"flex-1 min-w-0 bg-background grid grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[e.jsxs("div",{className:"border-b bg-background px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx(P,{state:a}),e.jsx(K,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx($,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:["Published ",E(s.publishedAt)]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(x,{size:"sm",onClick:()=>d("done"),children:[e.jsx(Q,{className:"h-4 w-4"}),"Mark done"]}),e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>d("dismissed"),children:[e.jsx(G,{className:"h-4 w-4"}),"Dismiss"]}),e.jsxs(x,{size:"sm",variant:"ghost",onClick:()=>d("new"),children:[e.jsx(J,{className:"h-4 w-4"}),"Reopen"]})]})]}),e.jsx("div",{className:"min-h-0 p-4",children:e.jsxs("div",{className:"grid h-full gap-4 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,1fr)] overflow-hidden",children:[e.jsxs(b,{className:"h-full overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-primary"}),e.jsx(g,{className:"text-base",children:"Do Next"})]}),e.jsx(j,{children:s.primaryAction})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(t=>e.jsx(re,{action:t},`${s.id}-${t.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsx(g,{className:"text-base",children:"Impacted Integrations"}),e.jsx(j,{children:"Related areas based on update scope and routing."})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:l.map(t=>e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 truncate text-sm font-medium",children:t.name}),e.jsx(w,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:_[t.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[t.routes[0]&&e.jsx(x,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(C,{to:t.routes[0].path,children:t.routes[0].label})}),t.commands[0]&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1.5",children:[e.jsx("code",{className:"truncate rounded bg-background px-1.5 py-0.5 text-[11px]",children:t.commands[0]}),e.jsx(A,{value:t.commands[0]})]})]})]},t.id))})})})]}),e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsx(g,{className:"text-base",children:"Why It Matters"}),e.jsx(j,{children:"Short context only, no wall-of-text release notes."})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:s.highlights.map(t=>e.jsxs("li",{children:["- ",t]},`${s.id}-${t}`))})})})]})]})]})})]}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No updates available."})})}function te({notice:s,progress:a,selected:l,onSelect:d}){return e.jsxs("button",{type:"button",onClick:d,className:v("w-full rounded-lg border px-3 py-3 text-left transition-colors",l?"border-primary/30 bg-primary/10":"border-transparent bg-background/40 hover:border-border hover:bg-muted/70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.primaryAction})]}),e.jsx(Y,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:E(s.publishedAt)}),e.jsx(P,{state:a})]})]})}const de=[{id:"inbox",label:"Action Required"},{id:"done",label:"Done"},{id:"all",label:"All"}];function le(s,a){return a?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(d=>`${d.label} ${d.description} ${d.command||""}`),...s.routes.map(d=>d.label)].join(" ").toLowerCase().includes(a):!0}function fe(){const s=c.useMemo(()=>[...D].sort((r,n)=>n.publishedAt.localeCompare(r.publishedAt)),[]),[a,l]=c.useState("inbox"),[d,t]=c.useState(""),[i,y]=c.useState(()=>Z()),[k,M]=c.useState(null);c.useEffect(()=>{ee(i)},[i]);const u=c.useMemo(()=>{const r=d.trim().toLowerCase();return s.filter(n=>{const p=m(n,i);return le(n,r)?a==="done"?p==="done":a==="inbox"?S(p):!0:!1})},[s,i,d,a]),o=c.useMemo(()=>{const r=a==="all"?s:u;return r.find(n=>n.id===k)??r[0]??null},[s,k,a,u]),O=r=>{M(r.id),y(n=>m(r,n)!=="new"?n:{...n,[r.id]:"seen"})},R=c.useMemo(()=>s.filter(r=>S(m(r,i))).length,[s,i]),T=c.useMemo(()=>s.filter(r=>m(r,i)==="done").length,[s,i]);return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"Updates Inbox"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Focus on actions, then mark updates done or dismissed."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:"Needs Action"}),e.jsx("p",{className:"text-base font-semibold",children:R})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:"Done"}),e.jsx("p",{className:"text-base font-semibold",children:T})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(F,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(L,{value:d,onChange:r=>t(r.target.value),placeholder:"Search actions or commands",className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:de.map(r=>e.jsx(x,{size:"sm",variant:a===r.id?"default":"outline",onClick:()=>l(r.id),children:r.label},r.id))})]}),e.jsx(h,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:u.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:"No notices match this view."}):u.map(r=>e.jsx(te,{notice:r,progress:m(r,i),selected:o?.id===r.id,onSelect:()=>O(r)},r.id))})})]}),e.jsx(ae,{notice:o,progress:o?m(o,i):null,relatedEntries:o?U(o):[],onUpdateProgress:r=>{o&&y(n=>({...n,[o.id]:r}))}})]})}export{fe as UpdatesPage};
@@ -24,7 +24,7 @@
24
24
  href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap"
25
25
  rel="stylesheet"
26
26
  />
27
- <script type="module" crossorigin src="/assets/index-k-HuyjpO.js"></script>
27
+ <script type="module" crossorigin src="/assets/index-DNFjYwGe.js"></script>
28
28
  <link rel="modulepreload" crossorigin href="/assets/react-vendor-CNOkPC89.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/radix-ui-C1Gpgz6I.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/tanstack-DDJIhNJd.js">
@@ -33,7 +33,7 @@
33
33
  <link rel="modulepreload" crossorigin href="/assets/utils-CzKF5WmX.js">
34
34
  <link rel="modulepreload" crossorigin href="/assets/form-utils-Cn_Uld6y.js">
35
35
  <link rel="modulepreload" crossorigin href="/assets/code-highlight-BRUf_pqB.js">
36
- <link rel="stylesheet" crossorigin href="/assets/index-s-oTl3hW.css">
36
+ <link rel="stylesheet" crossorigin href="/assets/index-Ck953xpy.css">
37
37
  </head>
38
38
  <body>
39
39
  <div id="root"></div>
@@ -17,6 +17,11 @@ export declare function stripAnthropicEnv(env: NodeJS.ProcessEnv): NodeJS.Proces
17
17
  * to avoid missing variants like `claudecode`.
18
18
  */
19
19
  export declare function stripClaudeCodeEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
20
+ /**
21
+ * Resolve CCS-managed environment overrides for Claude launch.
22
+ * - preferences.auto_update: false -> DISABLE_AUTOUPDATER=1
23
+ */
24
+ export declare function getClaudeLaunchEnvOverrides(): NodeJS.ProcessEnv;
20
25
  /**
21
26
  * Escape arguments for shell execution (cross-platform)
22
27
  *
@@ -1 +1 @@
1
- {"version":3,"file":"shell-executor.d.ts","sourceRoot":"","sources":["../../src/utils/shell-executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAOH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAQ3E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAQ5E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAqBlD;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,MAAM,CAAC,UAAU,GAAG,IAAW,GACvC,IAAI,CA0FN"}
1
+ {"version":3,"file":"shell-executor.d.ts","sourceRoot":"","sources":["../../src/utils/shell-executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAQH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAQ3E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAQ5E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,CAAC,UAAU,CAU/D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAqBlD;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,MAAM,CAAC,UAAU,GAAG,IAAW,GACvC,IAAI,CA2FN"}
@@ -5,11 +5,12 @@
5
5
  * Cross-platform shell execution utilities for CCS.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.execClaude = exports.escapeShellArg = exports.stripClaudeCodeEnv = exports.stripAnthropicEnv = void 0;
8
+ exports.execClaude = exports.escapeShellArg = exports.getClaudeLaunchEnvOverrides = exports.stripClaudeCodeEnv = exports.stripAnthropicEnv = void 0;
9
9
  const child_process_1 = require("child_process");
10
10
  const error_manager_1 = require("./error-manager");
11
11
  const websearch_manager_1 = require("./websearch-manager");
12
12
  const signal_forwarder_1 = require("./signal-forwarder");
13
+ const unified_config_loader_1 = require("../config/unified-config-loader");
13
14
  /**
14
15
  * Strip ANTHROPIC_* env vars from an environment object.
15
16
  * Used for account/default profiles to prevent stale proxy config from
@@ -41,6 +42,23 @@ function stripClaudeCodeEnv(env) {
41
42
  return result;
42
43
  }
43
44
  exports.stripClaudeCodeEnv = stripClaudeCodeEnv;
45
+ /**
46
+ * Resolve CCS-managed environment overrides for Claude launch.
47
+ * - preferences.auto_update: false -> DISABLE_AUTOUPDATER=1
48
+ */
49
+ function getClaudeLaunchEnvOverrides() {
50
+ try {
51
+ const config = (0, unified_config_loader_1.loadOrCreateUnifiedConfig)();
52
+ if (config.preferences?.auto_update === false) {
53
+ return { DISABLE_AUTOUPDATER: '1' };
54
+ }
55
+ }
56
+ catch {
57
+ // Config read errors should never block Claude launch.
58
+ }
59
+ return {};
60
+ }
61
+ exports.getClaudeLaunchEnvOverrides = getClaudeLaunchEnvOverrides;
44
62
  /**
45
63
  * Escape arguments for shell execution (cross-platform)
46
64
  *
@@ -78,6 +96,7 @@ function execClaude(claudeCli, args, envVars = null) {
78
96
  const needsShell = isWindows && /\.(cmd|bat)$/i.test(claudeCli);
79
97
  // Get WebSearch hook config env vars
80
98
  const webSearchEnv = (0, websearch_manager_1.getWebSearchHookEnv)();
99
+ const claudeLaunchEnv = getClaudeLaunchEnvOverrides();
81
100
  // For account/default profiles, strip ANTHROPIC_* from parent env to prevent
82
101
  // stale proxy config (e.g., from prior CLIProxy sessions) from interfering
83
102
  // with native Claude API routing. Settings-based profiles explicitly inject
@@ -88,8 +107,8 @@ function execClaude(claudeCli, args, envVars = null) {
88
107
  : process.env;
89
108
  // Prepare environment (merge with base env if envVars provided)
90
109
  const mergedEnv = envVars
91
- ? { ...baseEnv, ...envVars, ...webSearchEnv }
92
- : { ...baseEnv, ...webSearchEnv };
110
+ ? { ...baseEnv, ...claudeLaunchEnv, ...envVars, ...webSearchEnv }
111
+ : { ...baseEnv, ...claudeLaunchEnv, ...webSearchEnv };
93
112
  // Strip Claude Code nested session guard env var to allow CCS delegation
94
113
  // (Claude Code v2.1.39+ sets CLAUDECODE to detect nested sessions)
95
114
  const env = stripClaudeCodeEnv(mergedEnv);
@@ -1 +1 @@
1
- {"version":3,"file":"shell-executor.js","sourceRoot":"","sources":["../../src/utils/shell-executor.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iDAA+D;AAC/D,mDAA+C;AAC/C,2DAA0D;AAC1D,yDAA6D;AAE7D;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,GAAsB;IACtD,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAClC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AARD,8CAQC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,GAAsB;IACvD,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC;YACvC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AARD,gDAQC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;IAE/C,IAAI,SAAS,EAAE,CAAC;QACd,0EAA0E;QAC1E,qEAAqE;QACrE,qDAAqD;QACrD,OAAO,CACL,GAAG;YACH,MAAM,CAAC,GAAG,CAAC;iBACR,OAAO,CAAC,WAAW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aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,mCAAmC,SAAS,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACjF,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AA/FD,gCA+FC"}
@@ -282,6 +282,61 @@ async function processHook() {
282
282
  /**
283
283
  * Execute search via Gemini CLI
284
284
  */
285
+ function shouldRetryGeminiWithLegacyPrompt(errorMessage) {
286
+ const lowerError = (errorMessage || '').toLowerCase();
287
+
288
+ return (
289
+ lowerError.includes('unknown option') ||
290
+ lowerError.includes('unknown argument') ||
291
+ lowerError.includes('unrecognized option') ||
292
+ lowerError.includes('usage: gemini') ||
293
+ lowerError.includes('use --prompt') ||
294
+ lowerError.includes('using the --prompt option')
295
+ );
296
+ }
297
+
298
+ function runGeminiCommand(args, timeoutMs) {
299
+ const spawnResult = spawnSync('gemini', args, {
300
+ encoding: 'utf8',
301
+ timeout: timeoutMs,
302
+ maxBuffer: 1024 * 1024 * 2,
303
+ stdio: ['pipe', 'pipe', 'pipe'],
304
+ shell: isWindows,
305
+ });
306
+
307
+ if (spawnResult.error) {
308
+ if (spawnResult.error.code === 'ENOENT') {
309
+ return { success: false, error: 'Gemini CLI not installed' };
310
+ }
311
+ throw spawnResult.error;
312
+ }
313
+
314
+ if (spawnResult.status !== 0) {
315
+ const stderr = (spawnResult.stderr || '').trim();
316
+ return {
317
+ success: false,
318
+ error: stderr || `Gemini CLI exited with code ${spawnResult.status}`,
319
+ };
320
+ }
321
+
322
+ const result = (spawnResult.stdout || '').trim();
323
+
324
+ if (!result || result.length < MIN_VALID_RESPONSE_LENGTH) {
325
+ return { success: false, error: 'Empty or too short response from Gemini' };
326
+ }
327
+
328
+ const lowerResult = result.toLowerCase();
329
+ if (
330
+ lowerResult.includes('error:') ||
331
+ lowerResult.includes('failed to') ||
332
+ lowerResult.includes('authentication required')
333
+ ) {
334
+ return { success: false, error: `Gemini returned error: ${result.substring(0, 100)}` };
335
+ }
336
+
337
+ return { success: true, content: result };
338
+ }
339
+
285
340
  function tryGeminiSearch(query, timeoutSec = DEFAULT_TIMEOUT_SEC) {
286
341
  try {
287
342
  const timeoutMs = timeoutSec * 1000;
@@ -290,54 +345,31 @@ function tryGeminiSearch(query, timeoutSec = DEFAULT_TIMEOUT_SEC) {
290
345
 
291
346
  // Allow model override via env var
292
347
  const model = process.env.CCS_WEBSEARCH_GEMINI_MODEL || config.model;
348
+ const baseArgs = ['--model', model, '--yolo'];
349
+ const positionalArgs = [...baseArgs, prompt];
293
350
 
294
351
  if (process.env.CCS_DEBUG) {
295
- console.error(`[CCS Hook] Executing: gemini --model ${model} --yolo -p "..."`);
352
+ console.error(`[CCS Hook] Executing: gemini --model ${model} --yolo "..."`);
296
353
  }
297
354
 
298
- const spawnResult = spawnSync(
299
- 'gemini',
300
- ['--model', model, '--yolo', '-p', prompt],
301
- {
302
- encoding: 'utf8',
303
- timeout: timeoutMs,
304
- maxBuffer: 1024 * 1024 * 2,
305
- stdio: ['pipe', 'pipe', 'pipe'],
306
- shell: isWindows,
307
- }
308
- );
309
-
310
- if (spawnResult.error) {
311
- if (spawnResult.error.code === 'ENOENT') {
312
- return { success: false, error: 'Gemini CLI not installed' };
313
- }
314
- throw spawnResult.error;
355
+ // Current Gemini CLI prefers positional prompts and deprecates -p/--prompt.
356
+ // Retry once with -p for legacy CLIs that still require it.
357
+ const positionalResult = runGeminiCommand(positionalArgs, timeoutMs);
358
+ if (positionalResult.success) {
359
+ return positionalResult;
315
360
  }
316
361
 
317
- if (spawnResult.status !== 0) {
318
- const stderr = (spawnResult.stderr || '').trim();
319
- return {
320
- success: false,
321
- error: stderr || `Gemini CLI exited with code ${spawnResult.status}`,
322
- };
323
- }
324
-
325
- const result = (spawnResult.stdout || '').trim();
326
-
327
- if (!result || result.length < MIN_VALID_RESPONSE_LENGTH) {
328
- return { success: false, error: 'Empty or too short response from Gemini' };
362
+ if (!shouldRetryGeminiWithLegacyPrompt(positionalResult.error)) {
363
+ return positionalResult;
329
364
  }
330
365
 
331
- const lowerResult = result.toLowerCase();
332
- if (
333
- lowerResult.includes('error:') ||
334
- lowerResult.includes('failed to') ||
335
- lowerResult.includes('authentication required')
336
- ) {
337
- return { success: false, error: `Gemini returned error: ${result.substring(0, 100)}` };
366
+ if (process.env.CCS_DEBUG) {
367
+ console.error('[CCS Hook] Positional Gemini prompt failed; retrying with -p for legacy CLI');
368
+ console.error(`[CCS Hook] Executing: gemini --model ${model} --yolo -p "..."`);
338
369
  }
339
370
 
340
- return { success: true, content: result };
371
+ const legacyPromptArgs = [...baseArgs, '-p', prompt];
372
+ return runGeminiCommand(legacyPromptArgs, timeoutMs);
341
373
  } catch (err) {
342
374
  if (err.killed) {
343
375
  return { success: false, error: 'Gemini CLI timed out' };
@@ -362,17 +394,13 @@ function tryOpenCodeSearch(query, timeoutSec = DEFAULT_TIMEOUT_SEC) {
362
394
  console.error(`[CCS Hook] Executing: opencode run --model ${model} "..."`);
363
395
  }
364
396
 
365
- const spawnResult = spawnSync(
366
- 'opencode',
367
- ['run', prompt, '--model', model],
368
- {
369
- encoding: 'utf8',
370
- timeout: timeoutMs,
371
- maxBuffer: 1024 * 1024 * 2,
372
- stdio: ['pipe', 'pipe', 'pipe'],
373
- shell: isWindows,
374
- }
375
- );
397
+ const spawnResult = spawnSync('opencode', ['run', prompt, '--model', model], {
398
+ encoding: 'utf8',
399
+ timeout: timeoutMs,
400
+ maxBuffer: 1024 * 1024 * 2,
401
+ stdio: ['pipe', 'pipe', 'pipe'],
402
+ shell: isWindows,
403
+ });
376
404
 
377
405
  if (spawnResult.error) {
378
406
  if (spawnResult.error.code === 'ENOENT') {
@@ -599,9 +627,7 @@ function outputNoToolsMessage(query) {
599
627
  * Output all providers failed message
600
628
  */
601
629
  function outputAllFailedMessage(query, errors) {
602
- const errorDetails = errors
603
- .map((e) => ` - ${e.provider}: ${e.error}`)
604
- .join('\n');
630
+ const errorDetails = errors.map((e) => ` - ${e.provider}: ${e.error}`).join('\n');
605
631
 
606
632
  const message = [
607
633
  '[WebSearch - All Providers Failed]',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitranntt/ccs",
3
- "version": "7.50.0-dev.9",
3
+ "version": "7.51.0-dev.1",
4
4
  "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
5
5
  "keywords": [
6
6
  "cli",