shioricode 0.4.20 → 0.4.21

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 (75) hide show
  1. package/dist/bin.cjs +13117 -12448
  2. package/dist/bin.mjs +13155 -12486
  3. package/dist/client/assets/{ArtifactPanel-DhNMewF_.js → ArtifactPanel-CdR4rtqI.js} +2 -2
  4. package/dist/client/assets/{ChatMarkdown-CQLSgdaS.js → ChatMarkdown-LC7VQG0i.js} +2 -2
  5. package/dist/client/assets/{DiffPanel-IxDswq5p.js → DiffPanel-Dj0UZJm3.js} +3 -3
  6. package/dist/client/assets/DiffPanelShell-xseg5JQo.js +2 -0
  7. package/dist/client/assets/{DiffWorkerPoolProvider-dhrEONTb.js → DiffWorkerPoolProvider-D6XJdZWI.js} +2 -2
  8. package/dist/client/assets/NoActiveThreadState-CQmuWJhb.js +2 -0
  9. package/dist/client/assets/ProviderModelPicker-Bze2CcYx.js +2 -0
  10. package/dist/client/assets/SettingsPanels-DqCqBUI7.js +4 -0
  11. package/dist/client/assets/_chat-CKouNPVs.js +2 -0
  12. package/dist/client/assets/_chat._threadId-CU4xs7Dd.js +289 -0
  13. package/dist/client/assets/{_chat.index-B4NLV9mk.js → _chat.index-20AQsDPh.js} +2 -2
  14. package/dist/client/assets/automations-CWJGpvWf.js +2 -0
  15. package/dist/client/assets/{badge-BaTrdaZE.js → badge-1VUDnpuQ.js} +2 -2
  16. package/dist/client/assets/clientSettings-5THztvzS.js +2 -0
  17. package/dist/client/assets/{collapsible-DfWqkHJg.js → collapsible--nYYN5Zg.js} +2 -2
  18. package/dist/client/assets/{dialog-DjTpVApd.js → dialog-BzCtORYk.js} +2 -2
  19. package/dist/client/assets/{empty-Be-8qJMT.js → empty-DrPVL67l.js} +2 -2
  20. package/dist/client/assets/{gitReactQuery-TUte-oT5.js → gitReactQuery-Be_6T0Ee.js} +2 -2
  21. package/dist/client/assets/index-B58EBW6O.js +6 -0
  22. package/dist/client/assets/index-Cr2B1Z-_.css +2 -0
  23. package/dist/client/assets/{input-CE9hmpu7.js → input-DWDmgkdY.js} +2 -2
  24. package/dist/client/assets/pull-requests-Doz3BMXH.js +46 -0
  25. package/dist/client/assets/queuedTurnsStore-CIDk30NZ.js +2 -0
  26. package/dist/client/assets/{scroll-area-CbQzkLT_.js → scroll-area-CFMQ9e4_.js} +2 -2
  27. package/dist/client/assets/{separator-DI5DQ7Ks.js → separator-BdZ-ET3V.js} +2 -2
  28. package/dist/client/assets/settings-BGn4mjTS.js +2 -0
  29. package/dist/client/assets/settings.appearance-Ckvmtwdi.js +2 -0
  30. package/dist/client/assets/settings.archived-2t5UQQrc.js +2 -0
  31. package/dist/client/assets/{settings.computer-use-tZN9IYDg.js → settings.computer-use-Dfj_6GTK.js} +2 -2
  32. package/dist/client/assets/{settings.credits-BpgwqbI7.js → settings.credits-BUY8PBTc.js} +2 -2
  33. package/dist/client/assets/settings.general-Bvydzs1m.js +2 -0
  34. package/dist/client/assets/settings.mcp-Byoxze4F.js +2 -0
  35. package/dist/client/assets/{settings.mobile-PxkOX11C.js → settings.mobile-BUu4CP8r.js} +2 -2
  36. package/dist/client/assets/{settings.plugins-CQejJM2o.js → settings.plugins-CAvGUyw-.js} +2 -2
  37. package/dist/client/assets/settings.remote-BaGj1Eao.js +2 -0
  38. package/dist/client/assets/{settings.skills-Cg57qd7S.js → settings.skills-B-UfH45M.js} +2 -2
  39. package/dist/client/assets/{settings.theme-builder-DUu9nCmf.js → settings.theme-builder-DYn2dp1p.js} +2 -2
  40. package/dist/client/assets/{skillsMcpShared-CGi0RTQJ.js → skillsMcpShared-RFZJX9uG.js} +2 -2
  41. package/dist/client/assets/store-KYb5gyLf.js +12 -0
  42. package/dist/client/assets/{terminalStateStore-COv6Fwmt.js → terminalStateStore-DBL14uZB.js} +2 -2
  43. package/dist/client/assets/{textarea-CFQ0q5G1.js → textarea-CeNMtAmc.js} +2 -2
  44. package/dist/client/assets/{toggle-CwB81Wb2.js → toggle-BR_nJmIu.js} +2 -2
  45. package/dist/client/assets/{toggle-group-B4poMzYg.js → toggle-group-Tr8y9Pwx.js} +2 -2
  46. package/dist/client/assets/{uiStateStore-DsIsCBO9.js → uiStateStore-CC1coFoR.js} +2 -2
  47. package/dist/client/assets/{useHandleNewThread-DtShg-Gb.js → useHandleNewThread-CRjy_n7m.js} +2 -2
  48. package/dist/client/assets/useSettings-CvQQz7AW.js +2 -0
  49. package/dist/client/assets/{useTheme-CpDK1jpf.js → useTheme-D0lWhUH9.js} +2 -2
  50. package/dist/client/assets/utils-D1UgimcN.js +2 -0
  51. package/dist/client/assets/{vendor-effect-DldSDsna.js → vendor-effect-Chd9hYxF.js} +1 -1
  52. package/dist/client/assets/{vendor-ui-D-080HIn.js → vendor-ui-CJZCHXkp.js} +2 -2
  53. package/dist/client/index.html +15 -15
  54. package/package.json +1 -1
  55. package/dist/client/assets/DiffPanelShell-BYPngGr7.js +0 -2
  56. package/dist/client/assets/NoActiveThreadState-BhsV4knw.js +0 -2
  57. package/dist/client/assets/ProviderModelPicker-DvZxygLs.js +0 -2
  58. package/dist/client/assets/SettingsPanels-CcxbSb2Y.js +0 -4
  59. package/dist/client/assets/_chat-BKEfH7bm.js +0 -2
  60. package/dist/client/assets/_chat._threadId-CKYAWkIl.js +0 -289
  61. package/dist/client/assets/automations-BaROU0my.js +0 -2
  62. package/dist/client/assets/clientSettings-333fq8u7.js +0 -2
  63. package/dist/client/assets/index-DO0-ySqI.js +0 -6
  64. package/dist/client/assets/index-Hee7CrbY.css +0 -2
  65. package/dist/client/assets/pull-requests-D0RjDNry.js +0 -46
  66. package/dist/client/assets/queuedTurnsStore-C44-Rdam.js +0 -2
  67. package/dist/client/assets/settings-DYPhYb14.js +0 -2
  68. package/dist/client/assets/settings.appearance-DcK3XBNk.js +0 -2
  69. package/dist/client/assets/settings.archived-bTn7EzG_.js +0 -2
  70. package/dist/client/assets/settings.general-C_Aq9Mn4.js +0 -2
  71. package/dist/client/assets/settings.mcp-BnzVTWcW.js +0 -2
  72. package/dist/client/assets/settings.remote-BlV5n30n.js +0 -2
  73. package/dist/client/assets/store-8a4nbwgb.js +0 -12
  74. package/dist/client/assets/useSettings-Bof_skNF.js +0 -2
  75. package/dist/client/assets/utils-X2TItr-k.js +0 -2
@@ -1,46 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t,b as n}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as r}from"./vendor-react-BvVnE5E6.js";import{c as i,d as a,f as o,m as s,w as c}from"./vendor-tanstack-DxB_J8A7.js";import{c as l}from"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import{l as u,m as d,s as f,u as p}from"./clientSettings-333fq8u7.js";import{V as m,c as h,t as g}from"./utils-X2TItr-k.js";import{At as _,St as v,i as y,ot as b,vt as x,xt as S}from"./store-8a4nbwgb.js";import{t as C}from"./uiStateStore-DsIsCBO9.js";import{Bn as w,Cn as T,Cr as E,Fn as D,Fr as O,Pr as k,Rn as A,Vn as j,dr as ee,ir as M,qn as N,rr as te,wn as ne}from"./vendor-ui-D-080HIn.js";import{a as re,c as P,i as ie,o as ae,r as oe,s as se}from"./gitReactQuery-TUte-oT5.js";import"./input-CE9hmpu7.js";import{t as F}from"./scroll-area-CbQzkLT_.js";import"./separator-DI5DQ7Ks.js";import{L as ce,a as le,n as ue}from"./vendor-diffs-CBk6gACd.js";import{G as de,J as I,K as L,Nt as R,U as z,V as fe,W as B,q as V,r as pe,z as H}from"./index-DO0-ySqI.js";import{a as me,i as he,l as ge,s as _e}from"./DiffPanelShell-BYPngGr7.js";import{t as ve}from"./useTheme-CpDK1jpf.js";import"./vendor--shikijs-core-BAnPeRVm.js";import"./vendor-hast-util-to-jsx-runtime-Dkh1YHjw.js";import"./vendor-hast-util-raw-ryote2N_.js";import"./vendor-extend-BluXZM4M.js";import"./vendor-katex-VTL7DqQH.js";import{t as U}from"./ChatMarkdown-CQLSgdaS.js";import"./vendor--shikijs-engine-javascript-DmYKhP_-.js";import"./vendor-diff-JjX2GAnZ.js";import{n as ye,r as be,t as xe}from"./toggle-group-B4poMzYg.js";import"./toggle-CwB81Wb2.js";import{t as Se}from"./badge-BaTrdaZE.js";import{t as Ce}from"./DockedSidebarResizeHandle-DkVhNVa1.js";import{a as W,i as G,n as we,o as K,r as q,t as J}from"./empty-Be-8qJMT.js";import{n as Te,r as Ee,t as De}from"./collapsible-DfWqkHJg.js";var Y=r(),X=e(t(),1),Oe={open:`Open`,closed:`Closed`,draft:`Draft`},ke={open:`bg-success/12 text-success`,draft:`bg-muted-foreground/10 text-muted-foreground`,merged:`bg-violet-500/12 text-violet-600 dark:text-violet-400`,closed:`bg-destructive/12 text-destructive`};function Ae(e){return e.state===`merged`?`merged`:e.state===`closed`?`closed`:e.isDraft===!0?`draft`:`open`}function je(e){return e instanceof Error&&e.message.trim().length>0?e.message:typeof e==`string`&&e.trim().length>0?e:null}function Me(e){let t=e.toLowerCase();return t.includes(`not authenticated`)||t.includes(`gh auth login`)||t.includes(`no oauth token`)}function Ne(e){let t=e.toLowerCase();return t.includes(`command not found: gh`)||t.includes("gh`) is required")}function Pe(e){let t=je(e);return t?t.toLowerCase().includes(`not a git repository`)?`Pull requests are unavailable because this project is not a git repository.`:Ne(t)?"GitHub CLI (`gh`) is required to view pull requests for this project.":Me(t)?"Authenticate GitHub CLI with `gh auth login` to view pull requests for this project.":t:`Failed to load pull requests.`}function Fe(e,t){switch(t){case`closed`:return e.filter(e=>e.state===`closed`||e.state===`merged`);case`draft`:return e.filter(e=>e.state===`open`&&e.isDraft===!0);default:return e.filter(e=>e.state===`open`)}}function Ie(e){return e.status===`success`?e.visiblePullRequestsCount>0:!0}function Le(e){switch(e){case`closed`:return{title:`No closed pull requests`,description:`Closed and merged pull requests from your projects will show up here.`};case`draft`:return{title:`No draft pull requests`,description:`Draft pull requests from your projects will show up here.`};default:return{title:`No open pull requests`,description:`Open a PR from any of your projects and it will show up here.`}}}var Z=l(),Re=`pull_requests_detail_sidebar_width`,ze=448,Be=960,Ve=.5,He=`
2
- [data-diffs-header],
3
- [data-diff],
4
- [data-file],
5
- [data-error-wrapper],
6
- [data-virtualizer-buffer] {
7
- --diffs-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
8
- --diffs-light-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
9
- --diffs-dark-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
10
- --diffs-token-light-bg: transparent;
11
- --diffs-token-dark-bg: transparent;
12
-
13
- --diffs-bg-context-override: color-mix(in srgb, var(--background) 97%, var(--foreground));
14
- --diffs-bg-hover-override: color-mix(in srgb, var(--background) 94%, var(--foreground));
15
- --diffs-bg-separator-override: color-mix(in srgb, var(--background) 95%, var(--foreground));
16
- --diffs-bg-buffer-override: color-mix(in srgb, var(--background) 90%, var(--foreground));
17
-
18
- --diffs-bg-addition-override: color-mix(in srgb, var(--background) 92%, var(--success));
19
- --diffs-bg-addition-number-override: color-mix(in srgb, var(--background) 88%, var(--success));
20
- --diffs-bg-addition-hover-override: color-mix(in srgb, var(--background) 85%, var(--success));
21
- --diffs-bg-addition-emphasis-override: color-mix(in srgb, var(--background) 80%, var(--success));
22
-
23
- --diffs-bg-deletion-override: color-mix(in srgb, var(--background) 92%, var(--destructive));
24
- --diffs-bg-deletion-number-override: color-mix(in srgb, var(--background) 88%, var(--destructive));
25
- --diffs-bg-deletion-hover-override: color-mix(in srgb, var(--background) 85%, var(--destructive));
26
- --diffs-bg-deletion-emphasis-override: color-mix(in srgb, var(--background) 80%, var(--destructive));
27
-
28
- background-color: var(--diffs-bg) !important;
29
- }
30
-
31
- [data-file-info] {
32
- background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
33
- border-block-color: var(--border) !important;
34
- color: var(--foreground) !important;
35
- }
36
-
37
- [data-diffs-header] {
38
- position: sticky !important;
39
- top: 0;
40
- z-index: 4;
41
- background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
42
- border-bottom: 1px solid var(--border) !important;
43
- }
44
- `,Ue={"--diffs-font-family":`var(--font-mono)`,"--diffs-header-font-family":`var(--font-mono)`};function Q(e){return Math.max(ze,Math.min(e,Be))}function We(){return typeof window>`u`?ze:Q(window.innerWidth*Ve)}function Ge(e){let t=e.name??e.prevName??``;return t.startsWith(`a/`)||t.startsWith(`b/`)?t.slice(2):t}function Ke(e){return e.cacheKey??`${e.prevName??`none`}:${e.name}`}function qe(e){let t=(0,Y.c)(33),{filter:r,open:i,projectId:a,number:o,onClose:s}=e,c=fe(),l=(0,X.useRef)(null),u=(0,X.useRef)(null),[d,f]=(0,X.useState)(Je),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>{let t=Q(e);f(t),p(Re,t,n)},t[0]=m):m=t[0];let h=m,_;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{u.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`)},t[1]=_):_=t[1];let v=_,y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{e.button!==0||!l.current||(u.current={pointerId:e.pointerId,startWidth:l.current.getBoundingClientRect().width,startX:e.clientX},e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`)},t[2]=y):y=t[2];let b=y,x;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{let t=u.current;!t||t.pointerId!==e.pointerId||(f(Q(t.startWidth+(t.startX-e.clientX))),e.preventDefault())},t[3]=x):x=t[3];let S=x,C;t[4]===d?C=t[5]:(C=e=>{let t=u.current;!t||t.pointerId!==e.pointerId||(h(d),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),v(),e.preventDefault())},t[4]=d,t[5]=C);let w=C,T,E;if(t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>v(),E=[v],t[6]=T,t[7]=E):(T=t[6],E=t[7]),(0,X.useEffect)(T,E),!i||a===null||o===null)return null;if(c){let e;t[8]===s?e=t[9]:(e=e=>{e||s()},t[8]=s,t[9]=e);let n;t[10]!==r||t[11]!==o||t[12]!==s||t[13]!==a?(n=(0,Z.jsx)(I,{side:`bottom`,showCloseButton:!1,keepMounted:!0,className:`h-[min(92dvh,900px)] w-full max-w-full p-0`,children:(0,Z.jsx)(Ye,{filter:r,projectId:a,number:o,onClose:s})}),t[10]=r,t[11]=o,t[12]=s,t[13]=a,t[14]=n):n=t[14];let c;return t[15]!==i||t[16]!==e||t[17]!==n?(c=(0,Z.jsx)(V,{open:i,onOpenChange:e,children:n}),t[15]=i,t[16]=e,t[17]=n,t[18]=c):c=t[18],c}let D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=g(`relative hidden min-h-0 shrink-0 border-l border-border bg-card text-foreground md:flex`),t[19]=D):D=t[19];let O;t[20]===d?O=t[21]:(O={width:d},t[20]=d,t[21]=O);let k;t[22]===w?k=t[23]:(k=(0,Z.jsx)(Ce,{ariaLabel:`Resize pull request detail panel`,onPointerCancel:w,onPointerDown:b,onPointerMove:S,onPointerUp:w}),t[22]=w,t[23]=k);let A;t[24]!==r||t[25]!==o||t[26]!==s||t[27]!==a?(A=(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,Z.jsx)(Ye,{filter:r,projectId:a,number:o,onClose:s})}),t[24]=r,t[25]=o,t[26]=s,t[27]=a,t[28]=A):A=t[28];let j;return t[29]!==k||t[30]!==A||t[31]!==O?(j=(0,Z.jsxs)(`div`,{ref:l,className:D,style:O,children:[k,A]}),t[29]=k,t[30]=A,t[31]=O,t[32]=j):j=t[32],j}function Je(){let e=u(Re,n);return e===null?We():Q(e)}function Ye({filter:e,projectId:t,number:n,onClose:r}){let o=c(),l=s(),{resolvedTheme:u}=ve(),p=(0,X.useRef)(null),C=y(e=>e.projects.find(e=>e.id===t)??null),w=C?.cwd??null,T=a(oe({cwd:w,filter:e})),O=(0,X.useMemo)(()=>T.data?T.data.pullRequests.find(e=>e.number===n)??null:null,[T.data,n]),k=a(ae({cwd:w,number:n})),N=k.data?.diff??``,P=(0,X.useMemo)(()=>{let e=N.trim();return e.length===0?null:_e(e,`pull-requests-panel:${u}`)},[N,u]),F=(0,X.useMemo)(()=>{let e=N.trim();if(e.length===0)return[];try{return ce(e,P??void 0).flatMap(e=>e.files).toSorted((e,t)=>Ge(e).localeCompare(Ge(t),void 0,{numeric:!0,sensitivity:`base`}))}catch{return[]}},[P,N]),de=be({rootRef:p,enabled:!k.isLoading&&!k.isError&&F.length>0&&!!P,dependencyKey:`${P??`none`}:${k.isError?`error`:`ok`}:${k.isLoading?`loading`:`ready`}:${F.length}:${u}`}),I=a(se({cwd:w,number:n,pullRequest:O})),R=a(re({cwd:w,number:n})),[z,fe]=(0,X.useState)(`files`),B=I.data?.summary??null,V=i(ie({cwd:w,queryClient:l})),pe=(0,X.useCallback)(()=>{if(!O)return;let e=d();e&&e.shell.openExternal(O.url).catch(e=>{console.warn(`Failed to open pull request in browser.`,e)})},[O]),H=(0,X.useCallback)(async()=>{if(!(!O||!w))try{let e=await V.mutateAsync({reference:String(O.number),mode:`worktree`});o({to:`/`,search:t=>({...t,branch:e.branch,worktreePath:e.worktreePath})})}catch(e){console.warn(`Failed to checkout pull request.`,e)}},[o,V,w,O]),Ce=(0,X.useCallback)(()=>{if(!O||!C)return;let e=B&&B.length>0?`\n\n**AI summary of changes:**\n${B}`:``,t=[`Please review pull request #${O.number}: **${O.title}**.`,``,`- URL: ${O.url}`,`- State: ${O.state}`,`- Base branch: \`${O.baseBranch}\``,`- Head branch: \`${O.headBranch}\``,e,``,`Walk through the changes file by file, highlight bugs, risky refactors, security or performance concerns, and suggest concrete improvements. Finish with a short overall verdict and a list of follow-up actions.`].join(`
45
- `),n=b.getState(),r=h();n.setProjectDraftThreadId(C.id,r,{createdAt:new Date().toISOString(),envMode:`local`,runtimeMode:m}),n.applyStickyState(r),n.setPrompt(r,t),o({to:`/$threadId`,params:{threadId:r}})},[o,C,O,B]),we=O?.state===`open`?`success`:O?.state===`merged`?`secondary`:`error`,Te=!k.isLoading&&!k.isError&&F.length>0&&!de;return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsxs)(`header`,{children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 px-4 pt-3.5 pb-2.5`,children:[O?(0,Z.jsx)(`span`,{className:g(`mt-px flex size-8 shrink-0 items-center justify-center rounded-lg`,ke[Ae(O)]),"aria-hidden":!0,children:(0,Z.jsx)(M,{className:`size-4`})}):(0,Z.jsx)(L,{className:`mt-px size-8 shrink-0 rounded-lg`}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:O?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`h2`,{className:`text-balance line-clamp-2 text-base font-semibold leading-snug text-foreground`,children:O.title}),(0,Z.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Se,{variant:we,className:`h-5 px-1.5 text-[10px] uppercase tracking-wide`,children:O.state}),O.isDraft?(0,Z.jsx)(Se,{variant:`outline`,className:`h-5 px-1.5 text-[10px] uppercase tracking-wide`,children:`Draft`}):null,(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,O.number]})]}),(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1 text-[11px]`,children:[(0,Z.jsx)(A,{className:`size-3 shrink-0 text-muted-foreground/50`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`max-w-[45%] truncate font-mono text-muted-foreground/80`,children:O.headBranch}),(0,Z.jsx)(D,{className:`size-2.5 shrink-0 text-muted-foreground/40`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`max-w-[45%] truncate font-mono text-muted-foreground/50`,children:O.baseBranch})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`h-4 w-48 animate-pulse rounded bg-muted`}),(0,Z.jsx)(`div`,{className:`mt-2 h-3 w-64 animate-pulse rounded bg-muted/70`})]})}),(0,Z.jsx)(f,{type:`button`,size:`icon`,variant:`ghost`,"aria-label":`Close pull request detail`,className:`size-7 shrink-0`,onClick:r,children:(0,Z.jsx)(j,{className:`size-4`,"aria-hidden":!0})})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 px-4 pb-3`,children:[(0,Z.jsxs)(`div`,{className:`inline-flex`,children:[(0,Z.jsxs)(f,{type:`button`,size:`xs`,disabled:!O||V.isPending,className:`gap-1.5 rounded-r-none`,onClick:()=>{H()},children:[(0,Z.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),V.isPending?`Checking out…`:`Checkout`]}),(0,Z.jsxs)(x,{children:[(0,Z.jsx)(_,{render:(0,Z.jsx)(f,{type:`button`,size:`xs`,"aria-label":`More checkout options`,disabled:!O||V.isPending,className:`-ml-px rounded-l-none border-l border-l-primary-foreground/20 px-1.5`}),children:(0,Z.jsx)(te,{className:`size-3.5`,"aria-hidden":!0})}),(0,Z.jsxs)(v,{align:`end`,side:`bottom`,children:[(0,Z.jsxs)(S,{onClick:()=>{H()},children:[(0,Z.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),`Checkout`]}),(0,Z.jsxs)(S,{onClick:pe,children:[(0,Z.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),`Open in GitHub`]})]})]})]}),(0,Z.jsxs)(f,{type:`button`,size:`xs`,variant:`outline`,disabled:!O||!C,className:`gap-1.5`,onClick:Ce,children:[(0,Z.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),`Review`]})]}),(0,Z.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3`,children:I.isLoading?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,"aria-label":`Loading pull request summary`,children:[(0,Z.jsx)(L,{className:`h-3 w-11/12 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-10/12 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-9/12 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-8/12 rounded-full`})]}):I.isError?(0,Z.jsx)(`p`,{className:`text-pretty text-xs text-muted-foreground/80`,children:`Failed to summarize this pull request.`}):B&&B.length>0?(0,Z.jsx)(U,{text:B,cwd:w??void 0,className:`text-xs leading-relaxed text-muted-foreground`}):(0,Z.jsx)(`p`,{className:`text-pretty text-xs text-muted-foreground/60`,children:`No summary generated for this pull request.`})})]}),(0,Z.jsx)(`div`,{className:`my-2 flex h-9 shrink-0 items-center px-4`,children:(0,Z.jsxs)(ye,{value:[z],onValueChange:e=>{let t=e[0];(t===`files`||t===`conversation`)&&fe(t)},className:`h-7 gap-1`,children:[(0,Z.jsx)(xe,{value:`files`,className:`h-6 px-2 text-xs`,children:`Files`}),(0,Z.jsxs)(xe,{value:`conversation`,className:`h-6 gap-1 px-2 text-xs`,children:[`Conversation`,R.data?(()=>{let e=R.data.comments.length+R.data.reviews.length;return e>0?(0,Z.jsx)(`span`,{className:`ml-1 tabular-nums text-muted-foreground/60`,children:e}):null})():null]})]})}),z===`conversation`?(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(tt,{query:R,projectCwd:w,pullRequestUrl:O?.url??null})}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,style:Ue,children:k.isLoading?(0,Z.jsx)(me,{label:`Loading the diff`}):k.isError?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,Z.jsx)(J,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(W,{variant:`icon`,children:(0,Z.jsx)(j,{})}),(0,Z.jsx)(K,{className:`text-pretty`,children:`Failed to load diff`}),(0,Z.jsx)(q,{className:`text-pretty`,children:k.error instanceof Error?k.error.message:`The diff could not be retrieved.`})]})})}):F.length===0?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,Z.jsx)(J,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(K,{className:`text-pretty`,children:`No changes to show`}),(0,Z.jsx)(q,{className:`text-pretty`,children:`This pull request has an empty diff.`})]})})}):(0,Z.jsxs)(`div`,{className:`relative h-full min-h-0`,children:[Te?(0,Z.jsx)(he,{label:`Loading the diff`}):null,(0,Z.jsx)(`div`,{ref:p,className:`h-full min-h-0`,children:(0,Z.jsx)(le,{className:`diff-render-surface h-full min-h-0 overflow-auto px-2 pb-2`,config:{overscrollSize:600,intersectionObserverMargin:1200},children:F.map(e=>{let t=`${Ke(e)}:${u}`;return(0,Z.jsx)(`div`,{"data-diff-file-path":Ge(e),className:`diff-render-file mb-2 rounded-md first:mt-2 last:mb-0`,children:(0,Z.jsx)(ue,{fileDiff:e,options:{diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:ge(u),themeType:u,unsafeCSS:He}})},t)})})})]})})]})}function Xe(e){let t=[];for(let n of e.comments)t.push({kind:`comment`,id:`comment:${n.id}`,createdAt:n.createdAt,data:n});for(let n of e.reviews)t.push({kind:`review`,id:`review:${n.id}`,createdAt:n.submittedAt,data:n});return t.sort((e,t)=>e.createdAt===t.createdAt?0:e.createdAt<t.createdAt?-1:1),t}function Ze(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}function Qe(e){switch(e){case`approved`:return{label:`approved these changes`,tone:`success`};case`changes_requested`:return{label:`requested changes`,tone:`destructive`};case`dismissed`:return{label:`dismissed a review`,tone:`muted`};case`pending`:return{label:`started a pending review`,tone:`muted`};default:return{label:`left a review`,tone:`muted`}}}function $e(e){let t=(0,Y.c)(11),{author:n}=e,[r,i]=(0,X.useState)(!1),a=n??``,o,s;t[0]===a?(o=t[1],s=t[2]):(s=a.trim(),o=s.charAt(0).toUpperCase(),t[0]=a,t[1]=o,t[2]=s);let c=o;if(s.length>0&&!r){let e=`https://github.com/${encodeURIComponent(s)}.png?size=64`,n=`${s} avatar`,r;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>i(!0),t[3]=r):r=t[3];let a;return t[4]!==e||t[5]!==n?(a=(0,Z.jsx)(`img`,{src:e,alt:n,loading:`lazy`,decoding:`async`,className:`size-7 shrink-0 rounded-full border border-border/60 bg-muted object-cover`,onError:r}),t[4]=e,t[5]=n,t[6]=a):a=t[6],a}let l;t[7]===c?l=t[8]:(l=c.length>0?c:(0,Z.jsx)(w,{className:`size-3.5`}),t[7]=c,t[8]=l);let u;return t[9]===l?u=t[10]:(u=(0,Z.jsx)(`div`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium text-muted-foreground`,"aria-hidden":!0,children:l}),t[9]=l,t[10]=u),u}function et(e){let t=(0,Y.c)(25),{author:n,createdAt:r,children:i,headerExtra:a,url:o}=e,s;t[0]===n?s=t[1]:(s=(0,Z.jsx)($e,{author:n}),t[0]=n,t[1]=s);let c=n??`Unknown user`,l;t[2]===c?l=t[3]:(l=(0,Z.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:c}),t[2]=c,t[3]=l);let u;t[4]===a?u=t[5]:(u=a?(0,Z.jsx)(`span`,{className:`truncate`,children:a}):null,t[4]=a,t[5]=u);let d;t[6]===r?d=t[7]:(d=Ze(r),t[6]=r,t[7]=d);let f;t[8]===d?f=t[9]:(f=(0,Z.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-muted-foreground/70`,children:d}),t[8]=d,t[9]=f);let p;t[10]===o?p=t[11]:(p=o?(0,Z.jsx)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground/70 transition-colors hover:text-foreground`,"aria-label":`Open on GitHub`,children:(0,Z.jsx)(ee,{className:`size-3`})}):null,t[10]=o,t[11]=p);let m;t[12]!==l||t[13]!==u||t[14]!==f||t[15]!==p?(m=(0,Z.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/60 px-3 py-1.5 text-xs text-muted-foreground`,children:[l,u,f,p]}),t[12]=l,t[13]=u,t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;t[17]===i?h=t[18]:(h=(0,Z.jsx)(`div`,{className:`px-3 py-2`,children:i}),t[17]=i,t[18]=h);let g;t[19]!==m||t[20]!==h?(g=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-lg border border-border/60 bg-card/60`,children:[m,h]}),t[19]=m,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==s||t[23]!==g?(_=(0,Z.jsxs)(`article`,{className:`flex gap-3 text-sm`,children:[s,g]}),t[22]=s,t[23]=g,t[24]=_):_=t[24],_}function tt(e){let t=(0,Y.c)(29),{query:n,projectCwd:r}=e;if(n.isLoading){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`flex h-full flex-col gap-3 overflow-hidden p-4`,children:[0,1,2].map(nt)}),t[0]=e):e=t[0],e}if(n.isError){let e,r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(W,{variant:`icon`,children:(0,Z.jsx)(j,{})}),r=(0,Z.jsx)(K,{className:`text-pretty`,children:`Failed to load conversation`}),t[1]=e,t[2]=r):(e=t[1],r=t[2]);let i=n.error instanceof Error?n.error.message:`The conversation could not be retrieved.`,a;return t[3]===i?a=t[4]:(a=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,Z.jsx)(J,{children:(0,Z.jsxs)(G,{children:[e,r,(0,Z.jsx)(q,{className:`text-pretty`,children:i})]})})}),t[3]=i,t[4]=a),a}let i=n.data;if(!i)return null;let a,o,s,c,l,u;if(t[5]!==i||t[6]!==r){u=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Xe(i);if(i.description.length===0&&e.length===0){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,Z.jsx)(J,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(W,{variant:`icon`,children:(0,Z.jsx)(O,{})}),(0,Z.jsx)(K,{className:`text-pretty`,children:`No conversation yet`}),(0,Z.jsx)(q,{className:`text-pretty`,children:`This pull request has no description or comments.`})]})})}),t[13]=e):e=t[13],u=e;break bb0}a=F,l=`h-full`,o=`flex flex-col gap-3 p-4`,t[14]!==i.description||t[15]!==i.descriptionAuthor||t[16]!==i.descriptionCreatedAt||t[17]!==r?(s=i.description.length>0?(0,Z.jsx)(et,{author:i.descriptionAuthor,createdAt:i.descriptionCreatedAt??``,headerExtra:`opened this pull request`,children:(0,Z.jsx)(U,{text:i.description,cwd:r??void 0,className:`text-xs leading-relaxed text-foreground/90`})}):null,t[14]=i.description,t[15]=i.descriptionAuthor,t[16]=i.descriptionCreatedAt,t[17]=r,t[18]=s):s=t[18];let n;t[19]===r?n=t[20]:(n=e=>e.kind===`comment`?(0,Z.jsx)(et,{author:e.data.author,createdAt:e.data.createdAt,headerExtra:`commented`,...e.data.url?{url:e.data.url}:{},children:(0,Z.jsx)(U,{text:e.data.body,cwd:r??void 0,className:`text-xs leading-relaxed text-foreground/90`})},e.id):(0,Z.jsx)(rt,{review:e.data,projectCwd:r},e.id),t[19]=r,t[20]=n),c=e.map(n)}t[5]=i,t[6]=r,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=u}else a=t[7],o=t[8],s=t[9],c=t[10],l=t[11],u=t[12];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;t[21]!==o||t[22]!==s||t[23]!==c?(d=(0,Z.jsxs)(`div`,{className:o,children:[s,c]}),t[21]=o,t[22]=s,t[23]=c,t[24]=d):d=t[24];let f;return t[25]!==a||t[26]!==l||t[27]!==d?(f=(0,Z.jsx)(a,{className:l,children:d}),t[25]=a,t[26]=l,t[27]=d,t[28]=f):f=t[28],f}function nt(e){return(0,Z.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Z.jsx)(L,{className:`size-7 rounded-full`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(L,{className:`h-3 w-36 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-11/12 rounded-full`}),(0,Z.jsx)(L,{className:`h-3 w-9/12 rounded-full`})]})]},e)}function rt(e){let t=(0,Y.c)(21),{review:n,projectCwd:r}=e,i;t[0]===n.state?i=t[1]:(i=Qe(n.state),t[0]=n.state,t[1]=i);let{label:a,tone:o}=i,s=n.state===`approved`?k:n.state===`changes_requested`?T:O,c=o===`success`?`text-success`:o===`destructive`?`text-destructive`:`text-muted-foreground`,l;t[2]===c?l=t[3]:(l=g(`flex items-center gap-1`,c),t[2]=c,t[3]=l);let u;t[4]===s?u=t[5]:(u=(0,Z.jsx)(s,{className:`size-3`,"aria-hidden":!0}),t[4]=s,t[5]=u);let d;t[6]!==a||t[7]!==l||t[8]!==u?(d=(0,Z.jsxs)(`span`,{className:l,children:[u,a]}),t[6]=a,t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=d,p;t[10]===n.url?p=t[11]:(p=n.url?{url:n.url}:{},t[10]=n.url,t[11]=p);let m;t[12]!==r||t[13]!==n.body?(m=n.body.length>0?(0,Z.jsx)(U,{text:n.body,cwd:r??void 0,className:`text-xs leading-relaxed text-foreground/90`}):(0,Z.jsx)(`p`,{className:`text-xs italic text-muted-foreground/70`,children:`No review body.`}),t[12]=r,t[13]=n.body,t[14]=m):m=t[14];let h;return t[15]!==f||t[16]!==n.author||t[17]!==n.submittedAt||t[18]!==p||t[19]!==m?(h=(0,Z.jsx)(et,{author:n.author,createdAt:n.submittedAt,headerExtra:f,...p,children:m}),t[15]=f,t[16]=n.author,t[17]=n.submittedAt,t[18]=p,t[19]=m,t[20]=h):h=t[20],h}var $=[`open`,`draft`,`closed`];function it({filter:e,selectedProjectId:t,selectedNumber:n,onSelect:r,onFilterChange:i,columnClass:a}){let c=s(),l=y(e=>e.projects),u=C(e=>e.requestProjectAdd),d=o({queries:l.flatMap(e=>$.map(t=>oe({cwd:e.cwd,filter:t})))}),p=(0,X.useMemo)(()=>{let e={open:[],draft:[],closed:[]};for(let[t,n]of d.entries())e[$[t%$.length]].push(n);return e},[d]),m=p[e],h=(0,X.useMemo)(()=>{let e={};for(let t of $){let n=p[t];if(n.some(e=>e.isLoading)){e[t]=null;continue}let r=0;for(let e of n)e.data&&(r+=Fe(e.data.pullRequests,t).length);e[t]=r}return e},[p]),[_,v]=(0,X.useState)({}),b=(0,X.useCallback)((e,t)=>{v(n=>n[e]===t?n:{...n,[e]:t})},[]),x=(0,X.useMemo)(()=>l.map((t,n)=>{let r=m[n];if(!r)return{project:t,state:{status:`loading`},visiblePullRequests:[]};if(r.isError)return{project:t,state:{status:`error`,message:Pe(r.error)},visiblePullRequests:[]};if(!r.data)return{project:t,state:{status:`loading`},visiblePullRequests:[]};let i=Fe(r.data.pullRequests,e);return{project:t,state:{status:`success`,pullRequests:r.data.pullRequests},visiblePullRequests:i}}),[e,l,m]),S=x.reduce((e,t)=>e+t.visiblePullRequests.length,0),w=m.every(e=>!e.isLoading)&&S===0,T=Le(e),E=(0,X.useCallback)(()=>{c.invalidateQueries({queryKey:P.all})},[c]);return l.length===0?(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6`,children:(0,Z.jsxs)(J,{children:[(0,Z.jsxs)(G,{children:[(0,Z.jsx)(W,{variant:`icon`,children:(0,Z.jsx)(M,{})}),(0,Z.jsx)(K,{className:`text-pretty`,children:`No projects registered`}),(0,Z.jsx)(q,{className:`text-pretty`,children:`Open a project in ShioriCode to see its pull requests here.`})]}),(0,Z.jsx)(we,{children:(0,Z.jsx)(f,{onClick:u,children:`Open Folder`})})]})}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsx)(`div`,{className:`flex h-12 shrink-0 items-center border-b border-border/40`,children:(0,Z.jsxs)(`div`,{className:g(a,`flex h-full items-center justify-between gap-3`),children:[(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":`Pull request filter`,className:`inline-flex h-7 items-center gap-0.5 rounded-lg border border-border/60 bg-muted/40 p-0.5`,children:$.map(t=>{let n=t===e,r=h[t];return(0,Z.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,onClick:()=>i(t),className:g(`inline-flex h-6 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium leading-none transition-colors`,n?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[(0,Z.jsx)(`span`,{children:Oe[t]}),(0,Z.jsx)(`span`,{className:g(`min-w-4 rounded-full px-1 text-center text-[10px] tabular-nums`,n?`bg-muted-foreground/15 text-foreground`:`opacity-60`),children:r??`–`})]},t)})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(de,{render:(0,Z.jsx)(f,{type:`button`,size:`icon-xs`,variant:`ghost`,className:`text-muted-foreground hover:text-foreground`,onClick:E,"aria-label":`Refresh pull requests`,children:(0,Z.jsx)(N,{className:`size-3.5`,"aria-hidden":!0})})}),(0,Z.jsx)(B,{children:`Refresh`})]})]})}),(0,Z.jsx)(F,{className:`min-h-0 flex-1`,children:(0,Z.jsxs)(`div`,{className:g(a,`flex flex-col gap-1.5 pt-3 pb-4`),children:[x.map(({project:i,state:a,visiblePullRequests:o})=>{let s=a.status===`success`?o.length:null,c=_[i.id]??Ie({status:a.status,visiblePullRequestsCount:s??0});return(0,Z.jsxs)(De,{open:c,onOpenChange:e=>b(i.id,e),children:[(0,Z.jsxs)(Ee,{className:g(`group/section sticky top-0 z-10 flex w-full items-center gap-1.5 rounded-md px-1 py-2`,R?`bg-background text-left`:`bg-background/80 backdrop-blur-md text-left`,`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80`,`transition-colors hover:text-foreground`),children:[(0,Z.jsx)(te,{className:g(`size-3.5 shrink-0 opacity-50 transition-transform`,c?`rotate-0`:`-rotate-90`),"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:i.name}),s===null?a.status===`loading`?(0,Z.jsx)(L,{className:`h-3 w-5 rounded-full`}):null:(0,Z.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted-foreground/10 px-1.5 text-[10px] font-semibold tabular-nums text-muted-foreground normal-case tracking-normal`,children:s})]}),(0,Z.jsx)(Te,{children:(0,Z.jsx)(at,{filter:e,projectId:i.id,state:a,visiblePullRequests:o,selectedProjectId:t,selectedNumber:n,onSelect:r})})]},i.id)}),w?(0,Z.jsx)(`div`,{className:`p-6`,children:(0,Z.jsx)(J,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(W,{variant:`icon`,children:(0,Z.jsx)(M,{})}),(0,Z.jsx)(K,{className:`text-pretty`,children:T.title}),(0,Z.jsx)(q,{className:`text-pretty`,children:T.description})]})})}):null]})})]})}function at(e){let t=(0,Y.c)(30),{filter:n,projectId:r,state:i,visiblePullRequests:a,selectedProjectId:o,selectedNumber:s,onSelect:c}=e;if(i.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1 pb-2`,children:[0,1,2].map(ot)}),t[0]=e):e=t[0],e}if(i.status===`error`){let e;t[1]===i.message?e=t[2]:(e=Me(i.message),t[1]=i.message,t[2]=e);let n=e,r;t[3]===i.message?r=t[4]:(r=Ne(i.message),t[3]=i.message,t[4]=r);let a=r,o=a?`GitHub CLI (gh) is required to list pull requests.`:n?`GitHub CLI is not authenticated.`:i.message,s;t[5]===o?s=t[6]:(s=(0,Z.jsx)(`p`,{className:`text-xs text-destructive/90 text-pretty`,children:o}),t[5]=o,t[6]=s);let c;t[7]!==n||t[8]!==a?(c=a?(0,Z.jsx)(`a`,{href:`https://cli.github.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-xs text-primary underline-offset-2 hover:underline`,children:`Install GitHub CLI`}):n?(0,Z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Run `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),` in a terminal.`]}):null,t[7]=n,t[8]=a,t[9]=c):c=t[9];let l;return t[10]!==s||t[11]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 px-4 pb-3 pt-1`,children:[s,c]}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}if(a.length===0){let e;t[13]===n?e=t[14]:(e=Le(n),t[13]=n,t[14]=e);let r;return t[15]===e.title?r=t[16]:(r=(0,Z.jsxs)(`p`,{className:`px-4 pb-3 pt-1 text-xs text-muted-foreground/60`,children:[e.title,`.`]}),t[15]=e.title,t[16]=r),r}let l;if(t[17]!==c||t[18]!==r||t[19]!==s||t[20]!==o||t[21]!==a){let e;t[23]!==c||t[24]!==r||t[25]!==s||t[26]!==o?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(st,{pullRequest:e,isActive:o===r&&s===e.number,onSelect:()=>c({projectId:r,number:e.number})})},e.number),t[23]=c,t[24]=r,t[25]=s,t[26]=o,t[27]=e):e=t[27],l=a.map(e),t[17]=c,t[18]=r,t[19]=s,t[20]=o,t[21]=a,t[22]=l}else l=t[22];let u;return t[28]===l?u=t[29]:(u=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5 pb-2`,children:l}),t[28]=l,t[29]=u),u}function ot(e){return(0,Z.jsxs)(`li`,{className:`flex items-center gap-2.5 py-2 pl-2 pr-2.5`,children:[(0,Z.jsx)(L,{className:`size-7 shrink-0 rounded-md`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,Z.jsx)(L,{className:`h-3 w-[70%] rounded-full`}),(0,Z.jsx)(L,{className:`h-2.5 w-[40%] rounded-full`})]})]},e)}function st(e){let t=(0,Y.c)(34),{pullRequest:n,isActive:r,onSelect:i}=e,a=ke[Ae(n)],o=r||void 0,s=r&&`border-border/60 bg-sidebar-accent`,c;t[0]===s?c=t[1]:(c=g(`group/pr flex w-full min-w-0 items-center gap-2.5 rounded-lg border border-transparent py-2 pl-2 pr-2.5 text-left`,`hover:bg-sidebar-accent/60 hover:border-border/50`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,s),t[0]=s,t[1]=c);let l;t[2]===a?l=t[3]:(l=g(`flex size-7 shrink-0 items-center justify-center rounded-md`,a),t[2]=a,t[3]=l);let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(M,{className:`size-3.5`}),t[4]=u):u=t[4];let d;t[5]===l?d=t[6]:(d=(0,Z.jsx)(`span`,{className:l,"aria-hidden":!0,children:u}),t[5]=l,t[6]=d);let f;t[7]===n.title?f=t[8]:(f=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium leading-tight text-foreground`,children:n.title}),t[7]=n.title,t[8]=f);let p;t[9]===n.isDraft?p=t[10]:(p=n.isDraft?(0,Z.jsx)(`span`,{className:`shrink-0 rounded border border-border/60 px-1 py-px text-[9px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Draft`}):null,t[9]=n.isDraft,t[10]=p);let m;t[11]===n.number?m=t[12]:(m=(0,Z.jsxs)(`span`,{className:`shrink-0 text-[11px] tabular-nums text-muted-foreground/50`,children:[`#`,n.number]}),t[11]=n.number,t[12]=m);let h;t[13]!==f||t[14]!==p||t[15]!==m?(h=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[f,p,m]}),t[13]=f,t[14]=p,t[15]=m,t[16]=h):h=t[16];let _;t[17]===n.headBranch?_=t[18]:(_=(0,Z.jsx)(`span`,{className:`max-w-[45%] truncate font-mono text-muted-foreground/80`,children:n.headBranch}),t[17]=n.headBranch,t[18]=_);let v;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(D,{className:`size-2.5 shrink-0 text-muted-foreground/40`,"aria-hidden":!0}),t[19]=v):v=t[19];let y;t[20]===n.baseBranch?y=t[21]:(y=(0,Z.jsx)(`span`,{className:`max-w-[45%] truncate font-mono text-muted-foreground/50`,children:n.baseBranch}),t[20]=n.baseBranch,t[21]=y);let b;t[22]!==_||t[23]!==y?(b=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-[11px]`,children:[_,v,y]}),t[22]=_,t[23]=y,t[24]=b):b=t[24];let x;t[25]!==h||t[26]!==b?(x=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[h,b]}),t[25]=h,t[26]=b,t[27]=x):x=t[27];let S;return t[28]!==i||t[29]!==o||t[30]!==x||t[31]!==c||t[32]!==d?(S=(0,Z.jsxs)(`button`,{type:`button`,onClick:i,"data-active":o,className:c,children:[d,x]}),t[28]=i,t[29]=o,t[30]=x,t[31]=c,t[32]=d,t[33]=S):S=t[33],S}function ct(e){let t=(0,Y.c)(29),{search:n}=e,r=c(),i=n.filter??`open`,a;t[0]!==i||t[1]!==r?(a=e=>{r({to:`/pull-requests`,search:{projectId:e.projectId,number:e.number,filter:i}})},t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]!==i||t[4]!==r?(s=()=>{r({to:`/pull-requests`,search:{filter:i}})},t[3]=i,t[4]=r,t[5]=s):s=t[5];let l=s,u;t[6]===r?u=t[7]:(u=e=>{r({to:`/pull-requests`,search:{filter:e}})},t[6]=r,t[7]=u);let d=u,f=n.projectId??null,p=n.number??null,m=f!==null&&p!==null,h=m?`w-full px-4`:`mx-auto w-full max-w-3xl px-4`,_;t[8]===h?_=t[9]:(_=R?(0,Z.jsx)(`div`,{className:`drag-region flex h-[52px] shrink-0 items-center`,children:(0,Z.jsxs)(`div`,{className:g(h,`flex h-full items-center gap-2 select-none`),children:[(0,Z.jsx)(M,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsx)(`h1`,{className:`text-sm font-semibold tracking-tight text-foreground`,children:`Pull Requests`})]})}):(0,Z.jsx)(`header`,{className:`flex h-12 shrink-0 items-center`,children:(0,Z.jsxs)(`div`,{className:g(h,`flex h-full items-center gap-2`),children:[(0,Z.jsx)(M,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsx)(`h1`,{className:`text-sm font-semibold tracking-tight text-foreground`,children:`Pull Requests`})]})}),t[8]=h,t[9]=_);let v;t[10]!==d||t[11]!==h||t[12]!==i||t[13]!==o||t[14]!==p||t[15]!==f?(v=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,Z.jsx)(it,{filter:i,selectedProjectId:f,selectedNumber:p,onSelect:o,onFilterChange:d,columnClass:h})}),t[10]=d,t[11]=h,t[12]=i,t[13]=o,t[14]=p,t[15]=f,t[16]=v):v=t[16];let y;t[17]!==_||t[18]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background [contain:paint]`,children:[_,v]}),t[17]=_,t[18]=v,t[19]=y):y=t[19];let b;t[20]!==l||t[21]!==m||t[22]!==i||t[23]!==p||t[24]!==f?(b=(0,Z.jsx)(qe,{filter:i,open:m,projectId:f,number:p,onClose:l}),t[20]=l,t[21]=m,t[22]=i,t[23]=p,t[24]=f,t[25]=b):b=t[25];let x;return t[26]!==y||t[27]!==b?(x=(0,Z.jsx)(H,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,Z.jsxs)(`div`,{className:`relative isolate flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[y,b]})}),t[26]=y,t[27]=b,t[28]=x):x=t[28],x}function lt(){let e=(0,Y.c)(2),t=pe.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,Z.jsx)(ct,{search:t}),e[0]=t,e[1]=n),n}export{lt as component};
46
- //# sourceMappingURL=pull-requests-D0RjDNry.js.map
@@ -1,2 +0,0 @@
1
- import{i as e,n as t,r as n}from"./vendor-zustand-qsUGoIcm.js";import{Jt as r,Xt as i,Yt as a}from"./store-8a4nbwgb.js";var o=`shioricode:queued-turns:v1`,s=1,c=Object.freeze({queuedTurnsByThreadId:{}}),l=Object.freeze([]),u=r(typeof localStorage<`u`?localStorage:a(),300);i(`queued-turns`,()=>{u.flush()});function d(e){return typeof e==`object`&&!!e}function f(e){switch(e){case`failed`:return`failed`;case`sending`:return`queued`;default:return`queued`}}function p(e){if(!d(e))return null;let t=d(e.composerSnapshot)?e.composerSnapshot:null,n=typeof e.id==`string`?e.id:``,r=typeof e.threadId==`string`?e.threadId:``,i=typeof e.messageId==`string`?e.messageId:``,a=typeof e.text==`string`?e.text:``,o=typeof e.titleSeed==`string`?e.titleSeed:``,s=typeof e.createdAt==`string`?e.createdAt:``;if(n.length===0||r.length===0||i.length===0||o.length===0||s.length===0)return null;let c=Array.isArray(e.attachments)?e.attachments:[],l=Array.isArray(t?.persistedAttachments)?t.persistedAttachments:[],u=Array.isArray(t?.terminalContexts)?t.terminalContexts:[],p=typeof t?.prompt==`string`?t.prompt:``,m=e.modelSelection,h=e.runtimeMode,g=e.interactionMode;return!m||h!==`approval-required`&&h!==`full-access`||g!==`default`&&g!==`plan`?null:{id:n,threadId:r,messageId:i,text:a,attachments:c,modelSelection:m,runtimeMode:h,interactionMode:g,titleSeed:o,createdAt:s,composerSnapshot:{prompt:p,persistedAttachments:l,terminalContexts:u},status:f(e.status),errorMessage:typeof e.errorMessage==`string`&&e.errorMessage.trim().length>0?e.errorMessage:null}}function m(e){if(!d(e))return c;let t={};for(let[n,r]of Object.entries(e.queuedTurnsByThreadId??{})){if(!Array.isArray(r)||n.length===0)continue;let e=r.map(e=>p(e)).filter(e=>e!==null).map(e=>e.status===`sending`?{id:e.id,threadId:e.threadId,messageId:e.messageId,text:e.text,attachments:e.attachments,modelSelection:e.modelSelection,runtimeMode:e.runtimeMode,interactionMode:e.interactionMode,titleSeed:e.titleSeed,createdAt:e.createdAt,composerSnapshot:e.composerSnapshot,status:`queued`,errorMessage:null}:e);e.length>0&&(t[n]=e)}return{queuedTurnsByThreadId:t}}function h(e){let t={};for(let[n,r]of Object.entries(e.queuedTurnsByThreadId)){let e=(r??[]).filter(e=>e.id.length>0);e.length>0&&(t[n]=e)}return{queuedTurnsByThreadId:t}}function g(e,t,n){let r=e.queuedTurnsByThreadId[t]??[],i=n(r);if(i===r)return e;let a={...e.queuedTurnsByThreadId};return i.length===0?delete a[t]:a[t]=i,{queuedTurnsByThreadId:a}}var _=e()(n(e=>({queuedTurnsByThreadId:{},enqueueQueuedTurn:t=>{let n={...t,status:`queued`,errorMessage:null};return e(e=>g(e,t.threadId,e=>[...e,n])),n},removeQueuedTurn:(t,n)=>{t.length===0||n.length===0||e(e=>g(e,t,e=>e.filter(e=>e.id!==n)))},markQueuedTurnSending:(t,n)=>{t.length===0||n.length===0||e(e=>g(e,t,e=>e.map(e=>e.id===n?{...e,status:`sending`,errorMessage:null}:e)))},markQueuedTurnFailed:(t,n,r)=>{t.length===0||n.length===0||e(e=>g(e,t,e=>e.map(e=>e.id===n?{...e,status:`failed`,errorMessage:r.trim().length>0?r:`Failed to send queued message.`}:e)))},clearQueuedTurns:t=>{t.length!==0&&e(e=>{if(!(t in e.queuedTurnsByThreadId))return e;let n={...e.queuedTurnsByThreadId};return delete n[t],{queuedTurnsByThreadId:n}})}}),{name:o,version:s,storage:t(()=>u),partialize:h,merge:(e,t)=>({...t,...m(e)})}));function v(e,t){return t?e[t]??l:l}export{_ as n,v as t};
2
- //# sourceMappingURL=queuedTurnsStore-C44-Rdam.js.map
@@ -1,2 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{w as r,y as i}from"./vendor-tanstack-DxB_J8A7.js";import{c as a}from"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import{s as o}from"./clientSettings-333fq8u7.js";import"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import{or as s}from"./vendor-ui-D-080HIn.js";import"./useSettings-Bof_skNF.js";import"./useHandleNewThread-DtShg-Gb.js";import"./gitReactQuery-TUte-oT5.js";import"./input-CE9hmpu7.js";import"./scroll-area-CbQzkLT_.js";import"./separator-DI5DQ7Ks.js";import{Nt as c,X as l,Y as u,z as d}from"./index-DO0-ySqI.js";import"./ProviderModelPicker-DvZxygLs.js";import"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{d as f}from"./SettingsPanels-CcxbSb2Y.js";var p=n(),m=e(t()),h=a();function g(){let e=(0,p.c)(19),[t,n]=(0,m.useState)(0),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>n(_),e[0]=a):a=e[0];let{changedSettingLabels:g,restoreDefaults:v}=f(a),y=r(),b;e[1]===y?b=e[2]:(b=()=>{y(l(u()))},e[1]=y,e[2]=b);let x=b,S,C;e[3]===x?(S=e[4],C=e[5]):(S=()=>{let e=e=>{e.defaultPrevented||e.key===`Escape`&&(e.preventDefault(),x())};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},C=[x],e[3]=x,e[4]=S,e[5]=C),(0,m.useEffect)(S,C);let w;e[6]!==g||e[7]!==v?(w=!c&&(0,h.jsx)(`header`,{className:`border-b border-border px-3 py-2 sm:px-5`,children:(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Settings`}),(0,h.jsx)(`div`,{className:`ms-auto flex items-center gap-2`,children:(0,h.jsxs)(o,{size:`xs`,variant:`outline`,disabled:g.length===0,onClick:()=>void v(),children:[(0,h.jsx)(s,{className:`size-3.5`}),`Restore defaults`]})})]})}),e[6]=g,e[7]=v,e[8]=w):w=e[8];let T;e[9]!==g||e[10]!==v?(T=c&&(0,h.jsxs)(`div`,{className:`app-titlebar-window-controls-inset drag-region flex h-[52px] shrink-0 items-center border-b border-border px-5 [--app-titlebar-base-left-padding:1.25rem]`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground/70`,children:`Settings`}),(0,h.jsx)(`div`,{className:`ms-auto flex items-center gap-2`,children:(0,h.jsxs)(o,{size:`xs`,variant:`outline`,disabled:g.length===0,onClick:()=>void v(),children:[(0,h.jsx)(s,{className:`size-3.5`}),`Restore defaults`]})})]}),e[9]=g,e[10]=v,e[11]=T):T=e[11];let E;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,h.jsx)(i,{}),e[12]=E):E=e[12];let D;e[13]===t?D=e[14]:(D=(0,h.jsx)(`div`,{className:`min-h-0 flex flex-1 flex-col`,children:E},t),e[13]=t,e[14]=D);let O;return e[15]!==w||e[16]!==T||e[17]!==D?(O=(0,h.jsx)(d,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate`,children:(0,h.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground`,children:[w,T,D]})}),e[15]=w,e[16]=T,e[17]=D,e[18]=O):O=e[18],O}function _(e){return e+1}function v(){let e=(0,p.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(g,{}),e[0]=t):t=e[0],t}export{v as component};
2
- //# sourceMappingURL=settings-DYPhYb14.js.map
@@ -1,2 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{C as r}from"./vendor-tanstack-DxB_J8A7.js";import{c as i}from"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import{s as a}from"./clientSettings-333fq8u7.js";import{S as o,v as s,y as c}from"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import{Br as l,Vn as u,jn as d}from"./vendor-ui-D-080HIn.js";import{n as ee,r as te}from"./useSettings-Bof_skNF.js";import"./useHandleNewThread-DtShg-Gb.js";import"./gitReactQuery-TUte-oT5.js";import{t as f}from"./input-CE9hmpu7.js";import{G as p,Nt as ne,U as m,W as h,m as re,nt as g}from"./index-DO0-ySqI.js";import{i as ie,t as ae}from"./useTheme-CpDK1jpf.js";import{a as _,i as v,o as y,r as b,s as x}from"./ProviderModelPicker-DvZxygLs.js";import"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{a as oe,c as S,l as C,n as w,o as T,p as E,r as D,s as O,u as k}from"./SettingsPanels-CcxbSb2Y.js";var A=n(),j=e(t(),1),M=i(),N=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],P={light:`Light theme`,dark:`Dark theme`};function F(e){let t=(0,A.c)(9),{label:n,onClick:r}=e,i=`Reset ${n} to default`,o;t[0]===r?o=t[1]:(o=e=>{e.stopPropagation(),r()},t[0]=r,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,M.jsx)(d,{className:`size-3`}),t[2]=s):s=t[2];let c;t[3]!==i||t[4]!==o?(c=(0,M.jsx)(p,{render:(0,M.jsx)(a,{size:`icon-xs`,variant:`ghost`,"aria-label":i,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,onClick:o,children:s})}),t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,M.jsx)(h,{side:`top`,children:`Reset to default`}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,M.jsxs)(m,{children:[c,l]}),t[7]=c,t[8]=u),u}function I(){let{theme:e,setTheme:t,importedThemes:n,lightThemeId:i,darkThemeId:d,setThemeAssignment:p,importTheme:m,removeImportedTheme:h,themeOptionsByAppearance:A}=ae(),I=ee(),{updateSettings:L}=te(),[R,z]=(0,j.useState)(!1),[B,se]=(0,j.useState)({all:[],monospace:[]}),[V,H]=(0,j.useState)(``),[U,W]=(0,j.useState)(``),[G,K]=(0,j.useState)(!1),q=(0,j.useRef)(null),ce=(0,j.useCallback)(()=>{q.current?.click()},[]),le=(0,j.useCallback)(async e=>{let t=Array.from(e.target.files??[]);if(e.target.value=``,t.length===0)return;z(!0);let n=[];for(let e of t)try{let t=m(await e.text());n.push(t.name)}catch(t){g.add({type:`error`,title:`Could not import ${e.name}`,description:t instanceof Error?t.message:`The theme file is invalid JSON.`})}n.length>0&&g.add({type:`success`,title:n.length===1?`Imported ${n[0]}`:`Imported ${n.length} themes`,description:n.length===1?`The imported theme is now selected for its appearance.`:`Each imported theme is now selected for its matching appearance.`}),z(!1)},[m]);(0,j.useEffect)(()=>{let e=!1;return K(!0),ie().then(t=>{e||se(t)}).finally(()=>{e||K(!1)}),()=>{e=!0}},[]);let J=(0,j.useMemo)(()=>C(B.all,I.uiFontFamily,D),[B.all,I.uiFontFamily]),Y=(0,j.useMemo)(()=>k(J,V),[J,V]),X=(0,j.useMemo)(()=>C(B.monospace,I.codeFontFamily,w),[B.monospace,I.codeFontFamily]),Z=(0,j.useMemo)(()=>k(X,U),[X,U]),Q=Math.max(0,J.length-1),$=Math.max(0,X.length-1);return(0,M.jsxs)(oe,{children:[(0,M.jsxs)(O,{title:`Themes`,children:[(0,M.jsx)(T,{title:`Theme mode`,description:`Choose when the app resolves to its light or dark appearance.`,resetAction:e===o.themeMode?null:(0,M.jsx)(F,{label:`theme mode`,onClick:()=>t(`system`)}),control:(0,M.jsxs)(b,{value:e,onValueChange:e=>{(e===`system`||e===`light`||e===`dark`)&&t(e)},children:[(0,M.jsx)(y,{className:`w-full sm:w-40`,"aria-label":`Theme preference`,children:(0,M.jsx)(x,{children:N.find(t=>t.value===e)?.label??`System`})}),(0,M.jsx)(_,{align:`end`,alignItemWithTrigger:!1,children:N.map(e=>(0,M.jsx)(v,{hideIndicator:!0,value:e.value,children:e.label},e.value))})]})}),(0,M.jsx)(T,{title:P.light,description:`Used whenever the app resolves to its light appearance.`,resetAction:i===`builtin:shioricode-light`?null:(0,M.jsx)(F,{label:`light theme`,onClick:()=>p(`light`,c)}),control:(0,M.jsxs)(b,{value:i,onValueChange:e=>{e&&p(`light`,e)},children:[(0,M.jsx)(y,{className:`w-full sm:w-52`,"aria-label":`Light theme`,children:(0,M.jsx)(x,{children:A.light.find(e=>e.id===i)?.name??`Shiori Light`})}),(0,M.jsx)(_,{align:`end`,alignItemWithTrigger:!1,children:A.light.map(e=>(0,M.jsx)(v,{hideIndicator:!0,value:e.id,children:e.name},e.id))})]})}),(0,M.jsx)(T,{title:P.dark,description:`Used whenever the app resolves to its dark appearance.`,resetAction:d===`builtin:shioricode-dark`?null:(0,M.jsx)(F,{label:`dark theme`,onClick:()=>p(`dark`,s)}),control:(0,M.jsxs)(b,{value:d,onValueChange:e=>{e&&p(`dark`,e)},children:[(0,M.jsx)(y,{className:`w-full sm:w-52`,"aria-label":`Dark theme`,children:(0,M.jsx)(x,{children:A.dark.find(e=>e.id===d)?.name??`Shiori Dark`})}),(0,M.jsx)(_,{align:`end`,alignItemWithTrigger:!1,children:A.dark.map(e=>(0,M.jsx)(v,{hideIndicator:!0,value:e.id,children:e.name},e.id))})]})}),(0,M.jsxs)(T,{title:`Import themes`,description:`Import JSON theme files. Each file targets either the light or dark appearance and becomes the active theme for that appearance.`,control:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{ref:q,type:`file`,accept:`.json,application/json`,multiple:!0,className:`hidden`,onChange:le}),(0,M.jsx)(a,{size:`sm`,variant:`outline`,disabled:R,onClick:ce,children:R?(0,M.jsx)(re,{children:`Importing themes`}):`Import JSON`})]}),children:[n.length>0?(0,M.jsx)(`div`,{className:`mt-4 space-y-2`,children:n.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl border border-border/80 bg-background/60 px-3 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,M.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e.name}),(0,M.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:e.appearance}),e.appearance===`light`&&i===e.id?(0,M.jsx)(`span`,{className:`rounded-full bg-primary/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em] text-primary`,children:`Active`}):null,e.appearance===`dark`&&d===e.id?(0,M.jsx)(`span`,{className:`rounded-full bg-primary/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em] text-primary`,children:`Active`}):null]}),e.description?(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}):null,(0,M.jsx)(`p`,{className:`text-[11px] text-muted-foreground/80`,children:e.author?`By ${e.author}`:`Imported theme`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(a,{size:`xs`,variant:`outline`,onClick:()=>p(e.appearance,e.id),children:`Use`}),(0,M.jsx)(a,{size:`icon-xs`,variant:`ghost`,"aria-label":`Remove ${e.name}`,onClick:()=>h(e.id),children:(0,M.jsx)(u,{className:`size-3.5`})})]})]},e.id))}):(0,M.jsx)(`div`,{className:`mt-4 rounded-xl border border-dashed border-border/80 bg-background/40 px-3 py-4 text-xs text-muted-foreground`,children:`Imported themes will appear here after you add a JSON file.`}),(0,M.jsxs)(r,{to:`/settings/theme-builder`,className:`mt-3 inline-flex items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,M.jsx)(l,{className:`size-3`}),`Build your own theme`]})]})]}),ne?(0,M.jsx)(O,{title:`Window`,children:(0,M.jsx)(T,{title:`Translucent sidebar`,description:`Make the sidebar translucent so desktop content is visible behind it. macOS only.`,resetAction:I.sidebarTranslucent===o.sidebarTranslucent?null:(0,M.jsx)(F,{label:`translucent sidebar`,onClick:()=>L({sidebarTranslucent:!1})}),control:(0,M.jsx)(E,{checked:I.sidebarTranslucent,onCheckedChange:e=>L({sidebarTranslucent:!!e}),"aria-label":`Enable translucent sidebar`})})}):null,(0,M.jsxs)(O,{title:`Interface`,children:[(0,M.jsx)(T,{title:`Hide personal details`,description:`Mask personal details in the interface to reduce casual on-screen exposure.`,resetAction:I.blurPersonalData===o.blurPersonalData?null:(0,M.jsx)(F,{label:`personal details masking`,onClick:()=>L({blurPersonalData:o.blurPersonalData})}),control:(0,M.jsx)(E,{checked:I.blurPersonalData,onCheckedChange:e=>L({blurPersonalData:!!e}),"aria-label":`Hide personal details`})}),(0,M.jsx)(T,{title:`UI font`,description:`Choose the interface font. Installed fonts load from your system when available.`,status:G?`Loading installed fonts...`:Q>0?`${Q} installed fonts available.`:`Using system defaults only.`,resetAction:I.uiFontFamily===o.uiFontFamily?null:(0,M.jsx)(F,{label:`UI font`,onClick:()=>L({uiFontFamily:o.uiFontFamily})}),control:(0,M.jsxs)(b,{value:I.uiFontFamily,onOpenChange:e=>{e||H(``)},onValueChange:e=>{e&&L({uiFontFamily:e})},children:[(0,M.jsx)(y,{className:`w-full sm:w-56`,"aria-label":`UI font`,children:(0,M.jsx)(x,{children:J.find(e=>e.value===I.uiFontFamily)?.label??D.label})}),(0,M.jsx)(_,{align:`end`,alignItemWithTrigger:!1,header:(0,M.jsx)(f,{autoFocus:!0,value:V,placeholder:`Search fonts`,"aria-label":`Search UI fonts`,className:`h-8`,onChange:e=>H(e.target.value),onKeyDown:e=>e.stopPropagation()}),listClassName:`max-h-[min(var(--available-height),18rem)]`,children:Y.length>0?Y.map(e=>(0,M.jsx)(v,{hideIndicator:!0,value:e.value,children:e.label},e.value)):(0,M.jsx)(`div`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:`No fonts found.`})})]})}),(0,M.jsx)(T,{title:`Code font`,description:`Choose the monospace font used for code, diffs, terminals, and inline shortcuts.`,status:G?`Loading installed fonts...`:$>0?`${$} monospace fonts available.`:`Using system monospace by default.`,resetAction:I.codeFontFamily===o.codeFontFamily?null:(0,M.jsx)(F,{label:`code font`,onClick:()=>L({codeFontFamily:o.codeFontFamily})}),control:(0,M.jsxs)(b,{value:I.codeFontFamily,onOpenChange:e=>{e||W(``)},onValueChange:e=>{e&&L({codeFontFamily:e})},children:[(0,M.jsx)(y,{className:`w-full sm:w-56`,"aria-label":`Code font`,children:(0,M.jsx)(x,{children:X.find(e=>e.value===I.codeFontFamily)?.label??w.label})}),(0,M.jsx)(_,{align:`end`,alignItemWithTrigger:!1,header:(0,M.jsx)(f,{autoFocus:!0,value:U,placeholder:`Search fonts`,"aria-label":`Search code fonts`,className:`h-8`,onChange:e=>W(e.target.value),onKeyDown:e=>e.stopPropagation()}),listClassName:`max-h-[min(var(--available-height),18rem)]`,children:Z.length>0?Z.map(e=>(0,M.jsx)(v,{hideIndicator:!0,value:e.value,children:e.label},e.value)):(0,M.jsx)(`div`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:`No fonts found.`})})]})}),(0,M.jsx)(T,{title:`Time format`,description:`System default follows your browser or OS clock preference.`,resetAction:I.timestampFormat===o.timestampFormat?null:(0,M.jsx)(F,{label:`time format`,onClick:()=>L({timestampFormat:o.timestampFormat})}),control:(0,M.jsxs)(b,{value:I.timestampFormat,onValueChange:e=>{(e===`locale`||e===`12-hour`||e===`24-hour`)&&L({timestampFormat:e})},children:[(0,M.jsx)(y,{className:`w-full sm:w-40`,"aria-label":`Timestamp format`,children:(0,M.jsx)(x,{children:S[I.timestampFormat]})}),(0,M.jsxs)(_,{align:`end`,alignItemWithTrigger:!1,children:[(0,M.jsx)(v,{hideIndicator:!0,value:`locale`,children:S.locale}),(0,M.jsx)(v,{hideIndicator:!0,value:`12-hour`,children:S[`12-hour`]}),(0,M.jsx)(v,{hideIndicator:!0,value:`24-hour`,children:S[`24-hour`]})]})]})}),(0,M.jsx)(T,{title:`Diff line wrapping`,description:`Set the default wrap state when the diff panel opens.`,resetAction:I.diffWordWrap===o.diffWordWrap?null:(0,M.jsx)(F,{label:`diff line wrapping`,onClick:()=>L({diffWordWrap:o.diffWordWrap})}),control:(0,M.jsx)(E,{checked:I.diffWordWrap,onCheckedChange:e=>L({diffWordWrap:!!e}),"aria-label":`Wrap diff lines by default`})})]})]})}var L=I;export{L as component};
2
- //# sourceMappingURL=settings.appearance-DcK3XBNk.js.map
@@ -1,2 +0,0 @@
1
- import"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import"./vendor-react-BvVnE5E6.js";import"./vendor-tanstack-DxB_J8A7.js";import"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import"./clientSettings-333fq8u7.js";import"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import"./vendor-ui-D-080HIn.js";import"./useSettings-Bof_skNF.js";import"./useHandleNewThread-DtShg-Gb.js";import"./gitReactQuery-TUte-oT5.js";import"./input-CE9hmpu7.js";import"./ProviderModelPicker-DvZxygLs.js";import"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{t as e}from"./SettingsPanels-CcxbSb2Y.js";var t=e;export{t as component};
2
- //# sourceMappingURL=settings.archived-bTn7EzG_.js.map
@@ -1,2 +0,0 @@
1
- import"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import"./vendor-react-BvVnE5E6.js";import"./vendor-tanstack-DxB_J8A7.js";import"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import"./clientSettings-333fq8u7.js";import"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import"./vendor-ui-D-080HIn.js";import"./useSettings-Bof_skNF.js";import"./useHandleNewThread-DtShg-Gb.js";import"./gitReactQuery-TUte-oT5.js";import"./input-CE9hmpu7.js";import"./ProviderModelPicker-DvZxygLs.js";import"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{i as e}from"./SettingsPanels-CcxbSb2Y.js";var t=e;export{t as component};
2
- //# sourceMappingURL=settings.general-C_Aq9Mn4.js.map
@@ -1,2 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import{d as r}from"./vendor-tanstack-DxB_J8A7.js";import{c as i}from"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import{f as a,s as o}from"./clientSettings-333fq8u7.js";import{t as s,tt as c}from"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import{Hn as ee,Mn as l,Sn as u,Wr as d,_r as f,dr as p}from"./vendor-ui-D-080HIn.js";import"./useSettings-Bof_skNF.js";import"./useHandleNewThread-DtShg-Gb.js";import"./gitReactQuery-TUte-oT5.js";import{t as m}from"./input-CE9hmpu7.js";import"./scroll-area-CbQzkLT_.js";import{M as h,N as g,j as _,nt as v,u as y}from"./index-DO0-ySqI.js";import{a as b,i as x,o as S,r as C,s as w}from"./ProviderModelPicker-DvZxygLs.js";import{a as T,c as E,i as D,l as O,n as k,r as te,s as ne,t as re}from"./dialog-DjTpVApd.js";import{t as ie}from"./badge-BaTrdaZE.js";import{a as A,i as j,o as ae,r as M,t as oe}from"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{a as N,f as se,o as P,p as F,s as I}from"./SettingsPanels-CcxbSb2Y.js";import{a as L,i as R,o as z,r as B,s as V,t as H}from"./skillsMcpShared-CGi0RTQJ.js";var U=n(),W=e(t(),1),G=i();function K(e){return[e.name,e.transport,e.transport===`stdio`?[e.command??``,...e.args??[]].join(` `):e.url??``,JSON.stringify(e.headers??{}),JSON.stringify(e.envHttpHeaders??{}),e.bearerTokenEnvVar??``,(e.oauthScopes??[]).join(`,`),e.oauthResource??``,e.providers.join(`,`)].join(`|`)}function q(e){return e.name.replace(/^(codex|claude):/,``)}function J(e){return[e.source,e.sourceName??``,e.configPath??``,K(e)].join(`|`)}function Y(e){return Object.keys(e??{}).some(e=>e.toLowerCase()===`authorization`)}function X(e){return e.transport!==`stdio`&&!Y(e.headers)&&!Y(e.envHttpHeaders)&&!e.bearerTokenEnvVar?.trim()}function Z(e){let t=(0,U.c)(4),{transport:n}=e,r;t[0]===n?r=t[1]:(r=n===`stdio`?`stdio`:n.toUpperCase(),t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,G.jsx)(ie,{variant:`secondary`,className:`text-[10px] font-mono uppercase`,children:i}),t[2]=i,t[3]=a),a}function ce(e){let t=(0,U.c)(45),{server:n,onToggle:r,onDelete:i,onAuthenticate:a,authPending:c,grouped:ee}=e,u;t[0]!==n.args||t[1]!==n.command||t[2]!==n.transport||t[3]!==n.url?(u=n.transport===`stdio`?[n.command,...n.args??[]].join(` `):n.url??``,t[0]=n.args,t[1]=n.command,t[2]=n.transport,t[3]=n.url,t[4]=u):u=t[4];let f=u,p=n.auth.status===`unauthenticated`,m=n.auth.message??`Authentication required`,h=n.auth.status===`authenticated`?`Authenticated`:null,g=p&&typeof a==`function`,_=ee&&`pl-10 sm:pl-11`,v;t[5]===_?v=t[6]:(v=s(`flex items-center gap-3 border-t border-border/60 px-4 py-2.5 sm:px-5`,_),t[5]=_,t[6]=v);let y;t[7]===n?y=t[8]:(y=q(n),t[7]=n,t[8]=y);let b;t[9]===y?b=t[10]:(b=(0,G.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:y}),t[9]=y,t[10]=b);let x;t[11]!==m||t[12]!==p?(x=p?(0,G.jsx)(`span`,{title:m,children:(0,G.jsx)(d,{className:`size-3.5 shrink-0 text-amber-600`,"aria-label":m})}):null,t[11]=m,t[12]=p,t[13]=x):x=t[13];let S;t[14]===n.transport?S=t[15]:(S=(0,G.jsx)(Z,{transport:n.transport}),t[14]=n.transport,t[15]=S);let C;t[16]!==b||t[17]!==x||t[18]!==S?(C=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b,x,S]}),t[16]=b,t[17]=x,t[18]=S,t[19]=C):C=t[19];let w;t[20]===f?w=t[21]:(w=(0,G.jsx)(`p`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:f}),t[20]=f,t[21]=w);let T;t[22]!==C||t[23]!==w?(T=(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[C,w]}),t[22]=C,t[23]=w,t[24]=T):T=t[24];let E;t[25]!==h||t[26]!==m||t[27]!==c||t[28]!==a||t[29]!==g?(E=g?(0,G.jsx)(o,{size:`xs`,variant:`link`,className:`h-auto px-0 text-amber-700 hover:text-amber-800`,disabled:c,onClick:a,title:m,children:c?`Authenticating…`:`Authenticate`}):h?(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:h}):null,t[25]=h,t[26]=m,t[27]=c,t[28]=a,t[29]=g,t[30]=E):E=t[30];let D;t[31]!==r||t[32]!==n.enabled||t[33]!==n.readOnly?(D=(0,G.jsx)(F,{checked:n.enabled,disabled:n.readOnly,onCheckedChange:r}),t[31]=r,t[32]=n.enabled,t[33]=n.readOnly,t[34]=D):D=t[34];let O;t[35]===i?O=t[36]:(O=i?(0,G.jsx)(o,{size:`icon-xs`,variant:`ghost`,onClick:i,children:(0,G.jsx)(l,{className:`size-3.5 text-muted-foreground`})}):null,t[35]=i,t[36]=O);let k;t[37]!==E||t[38]!==D||t[39]!==O?(k=(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[E,D,O]}),t[37]=E,t[38]=D,t[39]=O,t[40]=k):k=t[40];let te;return t[41]!==T||t[42]!==k||t[43]!==v?(te=(0,G.jsxs)(`div`,{className:v,children:[T,k]}),t[41]=T,t[42]=k,t[43]=v,t[44]=te):te=t[44],te}var le=[{value:`stdio`,label:`stdio`},{value:`sse`,label:`SSE`},{value:`http`,label:`HTTP`}],ue=[{value:`claudeAgent`,label:c.claudeAgent},{value:`glm`,label:c.glm},{value:`codex`,label:c.codex}];function de(e){let t=(0,U.c)(51),{onAdd:n}=e,[r,i]=(0,W.useState)(!1),[a,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(`stdio`),[u,d]=(0,W.useState)(``),[f,p]=(0,W.useState)(``),[h,g]=(0,W.useState)(``),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=[],t[0]=_):_=t[0];let[v,y]=(0,W.useState)(_),x;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{s(``),l(`stdio`),d(``),p(``),g(``),y([])},t[1]=x):x=t[1];let ie=x,A=a.trim().length>0&&(c===`stdio`?f.trim().length>0:u.trim().length>0),j;t[2]!==h||t[3]!==f||t[4]!==A||t[5]!==a||t[6]!==n||t[7]!==v||t[8]!==c||t[9]!==u?(j=()=>{A&&(n({name:a.trim(),transport:c,enabled:!0,providers:v,...c===`stdio`?{command:f.trim(),...h.trim()?{args:h.trim().split(/\s+/)}:{}}:{url:u.trim()}}),ie(),i(!1))},t[2]=h,t[3]=f,t[4]=A,t[5]=a,t[6]=n,t[7]=v,t[8]=c,t[9]=u,t[10]=j):j=t[10];let ae=j,M;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},t[11]=M):M=t[11];let oe=M,N;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,G.jsx)(O,{render:(0,G.jsxs)(o,{size:`sm`,variant:`outline`,className:`gap-1.5`,children:[(0,G.jsx)(ee,{className:`size-3.5`}),`Add Server`]})}),t[12]=N):N=t[12];let P;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,G.jsxs)(T,{children:[(0,G.jsx)(E,{children:`Add MCP Server`}),(0,G.jsx)(te,{children:`Configure an MCP server to extend your coding agent with additional tools.`})]}),t[13]=P):P=t[13];let F;t[14]===ae?F=t[15]:(F=e=>{e.preventDefault(),ae()},t[14]=ae,t[15]=F);let I;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,G.jsxs)(`label`,{htmlFor:`mcp-server-name`,className:`text-sm font-medium`,children:[`Name `,(0,G.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),t[16]=I):I=t[16];let L;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>s(e.target.value),t[17]=L):L=t[17];let R;t[18]===a?R=t[19]:(R=(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[I,(0,G.jsx)(m,{id:`mcp-server-name`,required:!0,autoComplete:`off`,placeholder:`e.g. GitHub, Filesystem`,value:a,onChange:L})]}),t[18]=a,t[19]=R);let z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,G.jsx)(`label`,{className:`text-sm font-medium`,children:`Transport`}),t[20]=z):z=t[20];let B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>l(e),t[21]=B):B=t[21];let V;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,G.jsx)(S,{children:(0,G.jsx)(w,{})}),t[22]=V):V=t[22];let H;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,G.jsx)(b,{children:le.map(fe)}),t[23]=H):H=t[23];let K;t[24]===c?K=t[25]:(K=(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[z,(0,G.jsxs)(C,{value:c,onValueChange:B,children:[V,H]})]}),t[24]=c,t[25]=K);let q;t[26]!==h||t[27]!==f||t[28]!==c||t[29]!==u?(q=c===`stdio`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`label`,{htmlFor:`mcp-server-command`,className:`text-sm font-medium`,children:[`Command `,(0,G.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,G.jsx)(m,{id:`mcp-server-command`,required:!0,autoComplete:`off`,placeholder:`e.g. npx, node, python`,value:f,onChange:e=>p(e.target.value),className:`font-mono`})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`label`,{htmlFor:`mcp-server-args`,className:`text-sm font-medium`,children:[`Arguments `,(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:`(optional)`})]}),(0,G.jsx)(m,{id:`mcp-server-args`,autoComplete:`off`,placeholder:`e.g. -y @modelcontextprotocol/server-github`,value:h,onChange:e=>g(e.target.value),className:`font-mono`})]})]}):(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`label`,{htmlFor:`mcp-server-url`,className:`text-sm font-medium`,children:[`URL `,(0,G.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,G.jsx)(m,{id:`mcp-server-url`,required:!0,autoComplete:`url`,placeholder:`https://mcp.example.com/sse`,value:u,onChange:e=>d(e.target.value),className:`font-mono`})]}),t[26]=h,t[27]=f,t[28]=c,t[29]=u,t[30]=q):q=t[30];let J;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,G.jsxs)(`div`,{className:`text-sm font-medium`,children:[`Providers `,(0,G.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(none = all)`})]}),t[31]=J):J=t[31];let Y;t[32]===v?Y=t[33]:(Y=ue.map(e=>(0,G.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5 text-sm`,children:[(0,G.jsx)(se,{checked:v.includes(e.value),onCheckedChange:()=>oe(e.value)}),(0,G.jsx)(`span`,{className:`select-none`,children:e.label})]},e.value)),t[32]=v,t[33]=Y);let X;t[34]===Y?X=t[35]:(X=(0,G.jsxs)(`div`,{className:`space-y-2`,children:[J,(0,G.jsx)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:gap-x-8 sm:gap-y-2`,children:Y})]}),t[34]=Y,t[35]=X);let Z;t[36]!==R||t[37]!==K||t[38]!==q||t[39]!==X?(Z=(0,G.jsxs)(`div`,{className:`space-y-4 px-6 py-4`,children:[R,K,q,X]}),t[36]=R,t[37]=K,t[38]=q,t[39]=X,t[40]=Z):Z=t[40];let ce;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,G.jsx)(k,{render:(0,G.jsx)(o,{variant:`outline`,type:`button`,children:`Cancel`})}),t[41]=ce):ce=t[41];let de=!A,Q;t[42]===de?Q=t[43]:(Q=(0,G.jsxs)(D,{children:[ce,(0,G.jsx)(o,{type:`submit`,disabled:de,children:`Add Server`})]}),t[42]=de,t[43]=Q);let $;t[44]!==Z||t[45]!==Q||t[46]!==F?($=(0,G.jsxs)(ne,{className:`sm:max-w-md`,children:[P,(0,G.jsxs)(`form`,{className:`contents`,onSubmit:F,children:[Z,Q]})]}),t[44]=Z,t[45]=Q,t[46]=F,t[47]=$):$=t[47];let pe;return t[48]!==r||t[49]!==$?(pe=(0,G.jsxs)(re,{open:r,onOpenChange:i,children:[N,$]}),t[48]=r,t[49]=$,t[50]=pe):pe=t[50],pe}function fe(e){return(0,G.jsx)(x,{value:e.value,children:e.label},e.value)}function Q(){let e=(0,U.c)(2),t=$,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(u,{className:`size-3.5`}),e[0]=n):n=e[0];let r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(I,{title:`Codex`,icon:n,children:(0,G.jsx)(P,{title:`Managed MCP at session start`,description:`ShioriCode injects configured MCP servers into an isolated Codex runtime home for each session, while Codex continues to load its own user and project config.`,control:(0,G.jsxs)(o,{size:`sm`,variant:`outline`,className:`gap-1.5`,onClick:t,children:[(0,G.jsx)(p,{className:`size-3`}),`Open global config.toml`]})})}),e[1]=r):r=e[1],r}function $(){let e={}.CODEX_HOME??`${{}.HOME??`~`}/.codex`;y(a(),`${e}/config.toml`).catch(pe)}function pe(){}function me(){let e=(0,U.c)(2),t=he,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(u,{className:`size-3.5`}),e[0]=n):n=e[0];let r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(I,{title:`Claude`,icon:n,children:(0,G.jsx)(P,{title:`Filesystem settings`,description:`ShioriCode lets Claude load user and project MCP configuration from Claude settings sources.`,control:(0,G.jsxs)(o,{size:`sm`,variant:`outline`,className:`gap-1.5`,onClick:t,children:[(0,G.jsx)(p,{className:`size-3`}),`Open settings.json`]})})}),e[1]=r):r=e[1],r}function he(){let e={}.HOME??`~`;y(a(),`${e}/.claude/settings.json`).catch(ge)}function ge(){}function _e({servers:e,displayedServers:t,warnings:n,isLoading:r,authenticatingServerKey:i,onAdd:a,onAuthenticate:o,onToggle:s,onDelete:c,onDeleteExternal:ee}){let[l,u]=(0,W.useState)(``),p=(0,W.useCallback)(t=>{if(t.readOnly)return-1;let n=K(t);return e.findIndex(e=>K(e)===n)},[e]),m=(0,W.useMemo)(()=>l?t.filter(e=>z(l,e.name,e.source,e.transport,e.url,e.command)):t,[t,l]),v=(0,W.useMemo)(()=>L(m),[m]),y=t.length>5,b=v.size>1,x=(e,t)=>{let n=p(e);return(0,G.jsx)(ce,{server:e,grouped:t,authPending:i===J(e),...X(e)?{onAuthenticate:()=>o(e)}:{},...n>=0?{onToggle:()=>s(n),onDelete:()=>c(n)}:{onDelete:()=>ee(e)}},`${e.source}|${K(e)}`)};return(0,G.jsxs)(I,{title:`MCP Servers`,icon:(0,G.jsx)(f,{className:`size-3.5`}),headerAction:(0,G.jsx)(de,{onAdd:a}),children:[n.length>0?(0,G.jsx)(`div`,{className:`px-4 pb-0 pt-4 sm:px-5`,children:(0,G.jsxs)(_,{variant:`warning`,className:`rounded-2xl`,children:[(0,G.jsx)(d,{}),(0,G.jsx)(g,{children:`MCP needs attention`}),(0,G.jsx)(h,{children:n.map(e=>(0,G.jsx)(`p`,{children:e},e))})]})}):null,t.length===0?(0,G.jsxs)(oe,{className:`min-h-48`,children:[(0,G.jsx)(A,{variant:`icon`,children:(0,G.jsx)(f,{})}),(0,G.jsxs)(j,{children:[(0,G.jsx)(ae,{children:r?`Loading MCP servers`:`No MCP servers configured`}),(0,G.jsx)(M,{children:r?`Checking ShioriCode, Codex, and Claude MCP configuration.`:`Add MCP servers to extend your coding agents with additional tools and capabilities.`})]})]}):(0,G.jsxs)(G.Fragment,{children:[y?(0,G.jsx)(B,{value:l,onChange:u,placeholder:`Filter MCP servers…`,resultCount:m.length,totalCount:t.length}):null,(0,G.jsx)(`div`,{className:`max-h-96 overflow-y-auto`,children:m.length===0?(0,G.jsxs)(`p`,{className:`px-4 py-6 text-center text-sm text-muted-foreground sm:px-5`,children:[`No servers match “`,l,`”`]}):b?Array.from(v.entries()).map(([e,t])=>(0,G.jsx)(R,{source:e,count:t.length,defaultOpen:!0,children:t.map(e=>x(e,!0))},e)):m.map(e=>x(e,!1))})]})]})}function ve(){let{servers:e,persistServers:t,queryClient:n}=V(),[i,o]=(0,W.useState)(null),s=r({queryKey:H,queryFn:()=>a().server.listMcpServers(),staleTime:5e3}),c=e.map(e=>({...e,source:e.providers.includes(`claudeAgent`)?`claude`:`codex`,readOnly:!1,auth:{status:`unknown`}})),ee=s.data?.servers??c,l=s.data?.warnings??[],u=(0,W.useCallback)(n=>{t([...e,n])},[t,e]),d=(0,W.useCallback)(n=>{t(e.map((e,t)=>t===n?{...e,enabled:!e.enabled}:e))},[t,e]),f=(0,W.useCallback)(n=>{t(e.filter((e,t)=>t!==n))},[t,e]),p=(0,W.useCallback)(e=>{a().server.removeMcpServer({source:e.source,name:e.name,...e.sourceName?{sourceName:e.sourceName}:{},...e.configPath?{configPath:e.configPath}:{}}).then(()=>n.invalidateQueries({queryKey:H}))},[n]),m=(0,W.useCallback)(async e=>{let t=J(e);o(t);try{await a().server.authenticateMcpServer({source:e.source,name:e.name,...e.sourceName?{sourceName:e.sourceName}:{},...e.configPath?{configPath:e.configPath}:{}}),v.add({type:`success`,title:`Authenticated ${q(e)}`})}catch(e){v.add({type:`error`,title:e instanceof Error?e.message:`Failed to authenticate MCP server.`})}finally{o(e=>e===t?null:e),n.invalidateQueries({queryKey:H})}},[n]);return(0,G.jsxs)(N,{children:[(0,G.jsx)(_e,{servers:e,displayedServers:ee,warnings:l,isLoading:s.isLoading,authenticatingServerKey:i,onAdd:u,onAuthenticate:m,onToggle:d,onDelete:f,onDeleteExternal:p}),(0,G.jsx)(Q,{}),(0,G.jsx)(me,{})]})}var ye=ve;export{ye as component};
2
- //# sourceMappingURL=settings.mcp-BnzVTWcW.js.map
@@ -1,2 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{Ci as t}from"./vendor--effect-atom-react-6hEhKm5I.js";import"./vendor--floating-ui-react-dom-CGq-bz3X.js";import{t as n}from"./vendor-react-BvVnE5E6.js";import"./vendor-tanstack-DxB_J8A7.js";import{c as r}from"./vendor--lexical-react-Dg6NVZQt.js";import"./vendor-effect-DldSDsna.js";import{g as i,s as a}from"./clientSettings-333fq8u7.js";import"./utils-X2TItr-k.js";import"./store-8a4nbwgb.js";import"./terminalStateStore-COv6Fwmt.js";import"./uiStateStore-DsIsCBO9.js";import{Ar as o,In as s,Mr as c,Nr as l,On as u,Vr as d,Zn as f,_r as p,dr as m,pr as h,qn as g}from"./vendor-ui-D-080HIn.js";import"./useSettings-Bof_skNF.js";import"./useHandleNewThread-DtShg-Gb.js";import"./gitReactQuery-TUte-oT5.js";import{t as _}from"./input-CE9hmpu7.js";import{M as v,N as y,c as b,j as x,l as S}from"./index-DO0-ySqI.js";import"./ProviderModelPicker-DvZxygLs.js";import"./empty-Be-8qJMT.js";import"./collapsible-DfWqkHJg.js";import{a as C,o as w,s as T}from"./SettingsPanels-CcxbSb2Y.js";import{t as E}from"./vendor-qrcode-generator-CJtPPqPY.js";var D=n(),O=e(t(),1),k=r();function ee(e){let t=(0,D.c)(24),{url:n}=e,[r,i]=(0,O.useState)(!1),[s,c]=(0,O.useState)(!1),u,f;if(t[0]!==n){let e=E(0,`M`);e.addData(n,`Byte`),e.make(),f=e.createDataURL(7,2),t[0]=n,t[1]=f}else f=t[1];u=f;let p=u,m=typeof navigator<`u`&&!!navigator.clipboard,h;t[2]===n?h=t[3]:(h=async()=>{m&&(await navigator.clipboard.writeText(n),c(!0),window.setTimeout(()=>c(!1),1200))},t[2]=n,t[3]=h);let g=h,_;t[4]===n?_=t[5]:(_=(0,k.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded-md border border-border bg-muted/40 px-3 py-2 text-xs`,children:n}),t[4]=n,t[5]=_);let v;t[6]===g?v=t[7]:(v=()=>void g(),t[6]=g,t[7]=v);let y;t[8]===s?y=t[9]:(y=s?(0,k.jsx)(l,{className:`size-3.5`}):(0,k.jsx)(o,{className:`size-3.5`}),t[8]=s,t[9]=y);let b=s?`Copied`:`Copy`,x;t[10]!==v||t[11]!==y||t[12]!==b?(x=(0,k.jsxs)(a,{size:`sm`,variant:`outline`,disabled:!m,onClick:v,children:[y,b]}),t[10]=v,t[11]=y,t[12]=b,t[13]=x):x=t[13];let S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,k.jsxs)(a,{size:`sm`,variant:`outline`,onClick:()=>i(A),children:[(0,k.jsx)(d,{className:`size-3.5`}),`QR`]}),t[14]=S):S=t[14];let C;t[15]!==_||t[16]!==x?(C=(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[_,x,S]}),t[15]=_,t[16]=x,t[17]=C):C=t[17];let w;t[18]!==p||t[19]!==r?(w=r?(0,k.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-xl border border-border bg-white p-4`,children:[(0,k.jsx)(`img`,{src:p,alt:`Remote access QR code`,className:`size-56 max-w-full rounded-md`}),(0,k.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:`Scan with the iOS app to prefill Remote Server, or open it in a browser.`})]}):null,t[18]=p,t[19]=r,t[20]=w):w=t[20];let T;return t[21]!==C||t[22]!==w?(T=(0,k.jsxs)(`div`,{className:`space-y-3`,children:[C,w]}),t[21]=C,t[22]=w,t[23]=T):T=t[23],T}function A(e){return!e}var j=[{id:`method`,title:`Who can reach it`},{id:`prerequisites`,title:`Get ready`},{id:`credentials`,title:`Sign-in`},{id:`enable`,title:`Turn on`}],M=[{value:`shiori-managed`,label:`ShioriCode Managed`,badge:`Recommended · no Tailscale`,description:`Get a stable shiori.codes link through Shiori's hosted relay. Sign in once; this machine only makes an outbound encrypted connection.`},{value:`tailscale-serve`,label:`Only my devices`,badge:`Private · recommended`,description:`Reachable from devices signed into your tailnet (phone, laptop…) — Tailscale gates the network, your sign-in gates the app. No ports, DNS, or certificates to manage.`},{value:`tailscale-funnel`,label:`Public link`,badge:`Anywhere, behind sign-in`,description:`A public https://….ts.net address that works from any browser — your sign-in is the only gate, so use a strong password. Zero infrastructure.`}];function N(e,t){if(e===`shiori-managed`)return[{id:`shiori-account`,label:`Shiori account is connected`,ok:t.managed.accountLinked,hint:t.managed.accountLinked?null:`Sign in to Shiori in your browser, then return here.`,href:null}];let n=t.tailscale,r=[{id:`installed`,label:`Tailscale is installed`,ok:n.installed,hint:n.installed?null:`Install Tailscale on this machine, then check again.`,href:n.installed?null:`https://tailscale.com/download`},{id:`running`,label:`Tailscale is connected`,ok:n.running,hint:n.running?null:n.backendState===`NeedsLogin`?"Open the Tailscale app and sign in (or run `tailscale up`).":"Open the Tailscale app or run `tailscale up`.",href:null}];return e===`tailscale-funnel`&&r.push({id:`https`,label:`HTTPS certificates are enabled on your tailnet`,ok:n.httpsEnabled,hint:n.httpsEnabled?null:`In the Tailscale admin console, open DNS and enable HTTPS certificates.`,href:n.httpsEnabled?null:`https://login.tailscale.com/admin/dns`}),r}function P(e){return e.keepExisting?null:e.username.trim()?e.password.length<8?`Use at least 8 characters — this password is the only thing between the internet and this machine.`:e.password===e.confirm?null:`Passwords don't match.`:`Pick a username.`}var F=4e3;function te({status:e,onStatus:t,onClose:n,initialMethod:r}){let[o,d]=(0,O.useState)(`method`),[f,p]=(0,O.useState)(r??`shiori-managed`),[h,C]=(0,O.useState)(e.username??``),[w,T]=(0,O.useState)(``),[E,D]=(0,O.useState)(``),[A,te]=(0,O.useState)(e.authConfigured),[I,L]=(0,O.useState)(!1),[R,z]=(0,O.useState)(null),[B,V]=(0,O.useState)(!1),[H,U]=(0,O.useState)(null),[W,G]=(0,O.useState)(!1),K=j.findIndex(e=>e.id===o),q=(0,O.useCallback)(async()=>{try{t(await i().remote.getStatus())}catch{}},[t]);(0,O.useEffect)(()=>{if(o!==`prerequisites`)return;let e=window.setInterval(()=>void q(),F);return()=>window.clearInterval(e)},[o,q]);let ne=(0,O.useCallback)(()=>{z(null);let e=j[K-1];e&&!B&&d(e.id)},[K,B]),re=(0,O.useCallback)(()=>{z(null),d(`prerequisites`)},[]),ie=(0,O.useCallback)(()=>{z(null),d(`credentials`)},[]),J=(0,O.useCallback)(async()=>{L(!0),z(null);try{let e=await i().remote.beginManagedSignIn({provider:`github`});(await window.desktopBridge?.openExternal(e.authUrl)===!1||window.desktopBridge===void 0)&&window.open(e.authUrl,`_blank`,`noopener,noreferrer`)}catch(e){z(e instanceof Error?e.message:`Couldn't start Shiori sign-in.`)}finally{L(!1)}},[]),Y=(0,O.useCallback)(async()=>{z(null);let e=P({username:h,password:w,confirm:E,keepExisting:A});if(e){z(e);return}if(A){d(`enable`);return}L(!0);try{t(await i().remote.setCredentials({username:h.trim(),password:w})),await S(h.trim(),w),T(``),D(``),d(`enable`)}catch(e){z(e instanceof Error?e.message:`Couldn't save the credentials.`)}finally{L(!1)}},[h,w,E,A,t]),X=(0,O.useCallback)(async()=>{z(null),L(!0);try{t(await i().remote.setExposure({method:f})),V(!0)}catch(e){z(e instanceof Error?e.message:`Couldn't turn on remote access.`)}finally{L(!1)}},[f,t]),ae=(0,O.useCallback)(async()=>{G(!0),U(null);try{U(await i().remote.testConnection())}catch(e){U({ok:!1,url:null,latencyMs:null,error:e instanceof Error?e.message:`Test failed.`})}finally{G(!1)}},[]),Z=N(f,e),Q=Z.every(e=>e.ok),$=M.find(e=>e.value===f);return(0,k.jsxs)(`div`,{className:`space-y-4 px-4 py-4 sm:px-5`,children:[(0,k.jsx)(`ol`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px]`,children:j.map((e,t)=>{let n=t<K?`done`:t===K?`current`:`upcoming`;return(0,k.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t>0?(0,k.jsx)(`span`,{className:`text-muted-foreground/40`,children:`—`}):null,(0,k.jsxs)(`span`,{className:n===`current`?`font-medium text-foreground`:n===`done`?`text-primary`:`text-muted-foreground`,children:[t+1,`. `,e.title]})]},e.id)})}),R?(0,k.jsxs)(x,{variant:`error`,children:[(0,k.jsx)(y,{children:`Couldn't continue`}),(0,k.jsx)(v,{children:R})]}):null,o===`method`?(0,k.jsx)(`div`,{className:`space-y-3`,children:(0,k.jsx)(`div`,{className:`grid gap-2`,children:M.map(e=>{let t=f===e.value;return(0,k.jsxs)(`button`,{type:`button`,onClick:()=>p(e.value),className:`flex flex-col items-start gap-0.5 rounded-lg border px-3 py-2.5 text-left transition-colors ${t?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:bg-muted/40`}`,children:[(0,k.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[t?(0,k.jsx)(l,{className:`size-3.5 text-primary`}):null,e.label,(0,k.jsx)(`span`,{className:`rounded-full border border-border px-1.5 py-px text-[10px] font-normal text-muted-foreground`,children:e.badge})]}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]},e.value)})})}):null,o===`prerequisites`?(0,k.jsxs)(`div`,{className:`space-y-3`,children:[(0,k.jsx)(`ul`,{className:`divide-y divide-border rounded-lg border border-border`,children:Z.map(e=>(0,k.jsxs)(`li`,{className:`flex items-start gap-2.5 px-3 py-2.5`,children:[e.ok?(0,k.jsx)(l,{className:`mt-0.5 size-4 shrink-0 text-emerald-500`}):(0,k.jsx)(c,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,k.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,k.jsx)(`div`,{className:`text-sm text-foreground`,children:e.label}),!e.ok&&e.hint?(0,k.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.hint,` `,e.href?(0,k.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-0.5 text-primary hover:underline`,children:[`Open`,(0,k.jsx)(m,{className:`size-3`})]}):null]}):null]})]},e.id))}),(0,k.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,k.jsx)(g,{className:`size-3 animate-spin [animation-duration:3s]`}),`Checking automatically — finish the steps above and they'll turn green.`]}),f===`shiori-managed`&&!e.managed.accountLinked?(0,k.jsxs)(a,{size:`sm`,disabled:I,onClick:()=>void J(),children:[I?(0,k.jsx)(u,{className:`size-3.5 animate-spin`}):null,`Sign in with GitHub`,(0,k.jsx)(m,{className:`size-3.5`})]}):null]}):null,o===`credentials`?(0,k.jsxs)(`div`,{className:`space-y-3`,children:[e.authConfigured?(0,k.jsx)(x,{variant:`info`,children:(0,k.jsxs)(v,{children:[`A sign-in is already set`,e.username?` for “${e.username}”`:``,`.`,` `,(0,k.jsx)(`button`,{type:`button`,className:`font-medium text-primary hover:underline`,onClick:()=>te(e=>!e),children:A?`Set a new one instead`:`Keep the existing one`})]})}):(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This username and password is what you'll type on your phone or any remote browser. Anyone who signs in has full access to this machine — make it strong.`}),A?null:(0,k.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,k.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,k.jsx)(b,{htmlFor:`wizard-username`,children:`Username`}),(0,k.jsx)(_,{id:`wizard-username`,autoComplete:`username`,value:h,onChange:e=>C(e.target.value),disabled:I})]}),(0,k.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,k.jsx)(b,{htmlFor:`wizard-password`,children:`Password`}),(0,k.jsx)(_,{id:`wizard-password`,type:`password`,autoComplete:`new-password`,value:w,onChange:e=>T(e.target.value),disabled:I})]}),(0,k.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,k.jsx)(b,{htmlFor:`wizard-confirm`,children:`Confirm password`}),(0,k.jsx)(_,{id:`wizard-confirm`,type:`password`,autoComplete:`new-password`,value:E,onChange:e=>D(e.target.value),disabled:I})]})]})]}):null,o===`enable`?(0,k.jsx)(`div`,{className:`space-y-3`,children:B?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(x,{variant:`success`,children:[(0,k.jsx)(y,{children:`Remote access is on`}),(0,k.jsx)(v,{children:e.url?`Open this URL on your phone or another device and sign in.`:`Waiting for the URL — refresh in a moment.`})]}),e.url?(0,k.jsx)(ee,{url:e.url}):null,(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(a,{size:`sm`,variant:`outline`,disabled:W,onClick:()=>void ae(),children:[W?(0,k.jsx)(u,{className:`size-3.5 animate-spin`}):null,`Test connection`]}),H?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs ${H.ok?`text-emerald-600 dark:text-emerald-400`:`text-destructive`}`,children:[H.ok?(0,k.jsx)(l,{className:`size-3.5`}):(0,k.jsx)(c,{className:`size-3.5`}),H.ok?`Reachable${H.latencyMs===null?``:` · ${H.latencyMs}ms`}`:H.error??`Not reachable.`]}):null]})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Ready to go:`,` `,(0,k.jsx)(`span`,{className:`font-medium text-foreground`,children:$?.label}),`. Sign-in required for every device.`,f===`tailscale-funnel`?` The first public request can take a minute while Tailscale provisions the TLS certificate.`:f===`shiori-managed`?` The first setup downloads a checksum-verified connector and can take a moment.`:``]}),(0,k.jsxs)(a,{disabled:I,onClick:()=>void X(),children:[I?(0,k.jsx)(u,{className:`size-3.5 animate-spin`}):null,`Turn on remote access`]})]})}):null,(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border pt-3`,children:[(0,k.jsx)(`div`,{children:K>0&&!B?(0,k.jsxs)(a,{size:`sm`,variant:`ghost`,disabled:I,onClick:ne,children:[(0,k.jsx)(s,{className:`size-3.5`}),`Back`]}):null}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(a,{size:`sm`,variant:`ghost`,disabled:I,onClick:n,children:B?`Done`:`Cancel`}),o===`method`?(0,k.jsx)(a,{size:`sm`,onClick:re,children:`Continue`}):null,o===`prerequisites`?(0,k.jsx)(a,{size:`sm`,disabled:I||!Q,onClick:ie,children:`Continue`}):null,o===`credentials`?(0,k.jsxs)(a,{size:`sm`,disabled:I,onClick:()=>void Y(),children:[I?(0,k.jsx)(u,{className:`size-3.5 animate-spin`}):null,`Continue`]}):null]})]})]})}var I=[{value:`off`,label:`Off`,hint:`This machine only`},{value:`shiori-managed`,label:`Managed`,hint:`Public · hosted by Shiori`},{value:`tailscale-serve`,label:`My devices`,hint:`Private · via your tailnet`},{value:`tailscale-funnel`,label:`Public link`,hint:`Anywhere · behind sign-in`}];function L(e){let t=new Date(e).getTime();if(Number.isNaN(t))return`unknown`;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<45)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function R(){let[e,t]=(0,O.useState)(null),[n,r]=(0,O.useState)(!0),[o,s]=(0,O.useState)(!1),[d,m]=(0,O.useState)(!1),[S,E]=(0,O.useState)(null),[D,A]=(0,O.useState)(!1),[j,M]=(0,O.useState)(void 0),[N,P]=(0,O.useState)(null),[F,R]=(0,O.useState)(!1),z=(0,O.useRef)(!1),[B,V]=(0,O.useState)(``),[H,U]=(0,O.useState)(``),W=(0,O.useCallback)(async()=>{s(!0),E(null);try{t(await i().remote.getStatus())}catch(e){E(e instanceof Error?e.message:`Failed to load remote status.`)}finally{s(!1)}},[]);(0,O.useEffect)(()=>{let e=!1;return i().remote.getStatus().then(n=>{e||(t(n),!z.current&&n.desiredMethod===`off`&&!n.enabled&&(z.current=!0,A(!0)))}).catch(t=>{e||E(t instanceof Error?t.message:`Failed to load remote status.`)}).finally(()=>{e||r(!1)}),()=>{e=!0}},[]),(0,O.useEffect)(()=>{e?.username&&V(e.username)},[e?.username]);let G=(0,O.useCallback)(async e=>{m(!0),E(null);try{t(await e())}catch(e){E(e instanceof Error?e.message:`Something went wrong.`)}finally{m(!1)}},[]),K=(0,O.useCallback)(e=>G(()=>i().remote.setExposure({method:e})),[G]),q=(0,O.useCallback)(()=>G(()=>i().remote.setCredentials({username:B.trim(),password:H}).then(e=>(U(``),e))),[G,B,H]),ne=(0,O.useCallback)(e=>G(()=>i().remote.revokeSession({sessionId:e})),[G]),re=(0,O.useCallback)(()=>G(()=>i().remote.disconnectManagedAccount({})),[G]),ie=(0,O.useCallback)(async()=>{R(!0),P(null);try{P(await i().remote.testConnection())}catch(e){P({ok:!1,url:null,latencyMs:null,error:e instanceof Error?e.message:`Test failed.`})}finally{R(!1)}},[]),J=(0,O.useCallback)(e=>{M(e),A(!0)},[]),Y=e?.tailscale,X=e?.managed,ae=!!X?.accountLinked,Z=!!Y?.installed,Q=!!(Y?.installed&&Y.httpsEnabled),$=!!(e&&e.desiredMethod!==`off`&&e.desiredMethod!==e.method),oe=(0,O.useMemo)(()=>e?e.enabled?e.reachability===`public`?`Public`:`Live`:`Off`:`…`,[e]);return n?(0,k.jsx)(C,{children:(0,k.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-8 text-sm text-muted-foreground`,children:[(0,k.jsx)(u,{className:`size-4 animate-spin`}),`Loading remote access…`]})}):(0,k.jsxs)(C,{children:[(0,k.jsx)(T,{title:`Remote access`,icon:(0,k.jsx)(h,{className:`size-3.5`}),headerAction:(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium ${e?.enabled?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:[(0,k.jsx)(`span`,{className:`size-1.5 rounded-full ${e?.enabled?`bg-emerald-500`:`bg-muted-foreground/50`}`}),oe]}),(0,k.jsx)(a,{size:`xs`,variant:`outline`,disabled:d||o,onClick:()=>void W(),children:(0,k.jsx)(g,{className:`size-3.5 ${o?`animate-spin`:``}`})})]}),children:D&&e?(0,k.jsx)(te,{status:e,onStatus:t,onClose:()=>{A(!1),M(void 0)},...j===void 0?{}:{initialMethod:j}},j??`default`):(0,k.jsxs)(w,{title:`Reach ShioriCode from your phone and other devices`,description:`The server keeps running on this machine; remote access only changes how devices reach it. Anyone who signs in has full access — keep the password strong.`,status:e?.enabled&&e.url?`${e.sessions.length} device${e.sessions.length===1?``:`s`} connected`:void 0,control:(0,k.jsx)(a,{size:`sm`,variant:`outline`,disabled:d,onClick:()=>J(),children:e?.enabled?`Run setup again`:`Set up remote access`}),children:[S?(0,k.jsxs)(x,{variant:`error`,className:`mb-3`,children:[(0,k.jsx)(y,{children:`Couldn't complete that`}),(0,k.jsx)(v,{children:S})]}):null,$&&e?(0,k.jsxs)(x,{variant:`warning`,className:`mb-3`,children:[(0,k.jsx)(y,{children:`Remote access was interrupted`}),(0,k.jsx)(v,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`span`,{children:e.notice??`The exposure no longer matches what you set up.`}),(0,k.jsx)(a,{size:`xs`,variant:`outline`,disabled:d,onClick:()=>void K(e.desiredMethod),children:`Repair`})]})})]}):null,e?.enabled&&e.url?(0,k.jsxs)(`div`,{className:`space-y-3`,children:[(0,k.jsx)(ee,{url:e.url}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(a,{size:`sm`,variant:`outline`,disabled:F,onClick:()=>void ie(),children:[F?(0,k.jsx)(u,{className:`size-3.5 animate-spin`}):null,`Test connection`]}),N?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs ${N.ok?`text-emerald-600 dark:text-emerald-400`:`text-destructive`}`,children:[N.ok?(0,k.jsx)(l,{className:`size-3.5`}):(0,k.jsx)(c,{className:`size-3.5`}),N.ok?`Reachable${N.latencyMs===null?``:` · ${N.latencyMs}ms`}`:N.error??`Not reachable.`]}):null]})]}):(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Not exposed yet. Use the setup wizard to get a link in about a minute.`}),e?.notice&&!$?(0,k.jsx)(x,{variant:`warning`,className:`mt-3`,children:(0,k.jsx)(v,{children:e.notice})}):null]})}),D?null:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(T,{title:`How it's reached`,icon:(0,k.jsx)(p,{className:`size-3.5`}),children:(0,k.jsxs)(w,{title:`Access method`,description:X?.accountLinked?`Managed is ready. Tailscale remains available for private tailnet-only access.`:Y?.installed?Y.running?`Connect Shiori for Managed, or keep using this machine's Tailscale connection.`:`Connect Shiori for Managed without Tailscale, or reconnect the Tailscale app.`:`ShioriCode Managed gives this machine a hosted link without Tailscale, ports, or DNS setup.`,children:[(0,k.jsx)(`div`,{className:`mt-1 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:I.map(t=>{let n=e?.method===t.value;return(0,k.jsxs)(`button`,{type:`button`,disabled:d||t.value===`shiori-managed`&&!ae||t.value===`tailscale-serve`&&!Z||t.value===`tailscale-funnel`&&!Q,onClick:()=>void K(t.value),className:`flex flex-col items-start gap-0.5 rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${n?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:bg-muted/40`}`,children:[(0,k.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground`,children:[n?(0,k.jsx)(l,{className:`size-3.5 text-primary`}):null,t.label]}),(0,k.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t.hint})]},t.value)})}),Y&&!Y.installed?(0,k.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:[(0,k.jsx)(`a`,{href:`https://tailscale.com/download`,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:`Download Tailscale`}),` `,`and sign in, then come back — the setup wizard checks it live.`]}):null,Q||e?.method===`tailscale-funnel`?null:Y?.installed&&!Y.httpsEnabled?(0,k.jsx)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:`Public access needs HTTPS certificates enabled on your tailnet (admin console → DNS → Enable HTTPS).`}):null,(0,k.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border px-3 py-2.5`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`text-sm text-foreground`,children:`ShioriCode Managed`}),(0,k.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:X?.accountLinked?X.endpoint?`Connected · ${X.endpoint}`:`Shiori account connected`:`No Shiori account connected`})]}),X?.accountLinked?(0,k.jsx)(a,{size:`xs`,variant:`ghost`,disabled:d,onClick:()=>void re(),children:`Disconnect`}):(0,k.jsx)(a,{size:`xs`,variant:`outline`,onClick:()=>J(`shiori-managed`),children:`Connect`})]})]})}),(0,k.jsx)(T,{title:`Sign-in`,children:(0,k.jsx)(w,{title:`Owner credentials`,description:e?.requireAuth?`A login is required for remote access.`:`Set a password so the iOS app and remote browsers can sign in. It's required the moment you expose this machine.`,status:e?.authConfigured?`Configured${e.username?` · ${e.username}`:``}`:`Not set`,children:(0,k.jsxs)(`div`,{className:`mt-1 grid gap-3 sm:grid-cols-[1fr_1fr_auto] sm:items-end`,children:[(0,k.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,k.jsx)(b,{htmlFor:`remote-username`,children:`Username`}),(0,k.jsx)(_,{id:`remote-username`,autoComplete:`username`,value:B,onChange:e=>V(e.target.value),disabled:d})]}),(0,k.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,k.jsx)(b,{htmlFor:`remote-password`,children:e?.authConfigured?`New password`:`Password`}),(0,k.jsx)(_,{id:`remote-password`,type:`password`,autoComplete:`new-password`,value:H,onChange:e=>U(e.target.value),disabled:d})]}),(0,k.jsx)(a,{disabled:d||B.trim().length===0||H.length===0,onClick:()=>void q(),children:e?.authConfigured?`Update`:`Set password`})]})})}),(0,k.jsx)(T,{title:`Devices`,icon:(0,k.jsx)(f,{className:`size-3.5`}),children:(0,k.jsx)(w,{title:`Connected devices`,description:`Sessions that have signed in remotely. Revoke one to sign it out immediately.`,children:e&&e.sessions.length>0?(0,k.jsx)(`div`,{className:`mt-1 divide-y divide-border rounded-lg border border-border`,children:e.sessions.map(e=>(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 px-3 py-2.5`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`div`,{className:`truncate text-sm text-foreground`,children:e.label??e.username}),(0,k.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`last seen `,L(e.lastSeenAt)]})]}),(0,k.jsx)(a,{size:`xs`,variant:`ghost`,disabled:d,onClick:()=>void ne(e.id),children:`Revoke`})]},e.id))}):(0,k.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`No devices connected yet.`})})})]})]})}var z=R;export{z as component};
2
- //# sourceMappingURL=settings.remote-BlV5n30n.js.map